"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatPromptWithClarifications = exports.DEFAULT_DATA_APP_CLAUDE_MODEL = exports.DATA_APP_CLAUDE_MODELS = exports.DATA_APP_TEMPLATES = exports.isAppVersionInProgress = exports.APP_VERSION_TERMINAL_STATUSES = exports.APP_VERSION_STAGE_ORDER = void 0;
/**
 * Ordered pipeline stages. Index position determines progression — used to
 * skip completed stages when a build is retried after a worker crash.
 * 'ready' is included as the final stage; 'error' is terminal but not a
 * stage (not reachable through normal progression).
 */
exports.APP_VERSION_STAGE_ORDER = [
    'pending',
    'sandbox',
    'catalog',
    'generating',
    'building',
    'packaging',
    'ready',
];
exports.APP_VERSION_TERMINAL_STATUSES = ['ready', 'error'];
const isAppVersionInProgress = (status) => !exports.APP_VERSION_TERMINAL_STATUSES.includes(status);
exports.isAppVersionInProgress = isAppVersionInProgress;
exports.DATA_APP_TEMPLATES = [
    'dashboard',
    'slideshow',
    'pdf',
    'custom',
];
/**
 * Claude model used to generate / iterate the data app inside the sandbox.
 * Mapped to the Claude CLI's `--model <alias>` flag verbatim. Persisted
 * per-version on `AppVersionResources.claudeModel` so the user can switch
 * mid-iteration without losing the record of which model built which version.
 */
exports.DATA_APP_CLAUDE_MODELS = ['opus', 'sonnet', 'haiku'];
exports.DEFAULT_DATA_APP_CLAUDE_MODEL = 'sonnet';
/**
 * Fold clarifications into the prompt sent to the sandbox. The persisted
 * prompt stays as the user's original words — clarifications travel
 * separately on `resources.clarifications` for chat rendering.
 */
const formatPromptWithClarifications = (prompt, clarifications) => {
    if (!clarifications || clarifications.length === 0)
        return prompt;
    const qa = clarifications
        .map((c, i) => `${i + 1}. Q: ${c.question.trim()}\n   A: ${c.answer.trim()}`)
        .join('\n');
    return `${prompt}\n\nClarifications:\n${qa}`;
};
exports.formatPromptWithClarifications = formatPromptWithClarifications;
//# sourceMappingURL=types.js.map