"use strict";
/**
 * Externalized LLM prompt constants for the yaml-workflow pipeline.
 *
 * Template strings live in prompt-templates.ts. This file re-exports them
 * and provides builder functions that compose prompts at runtime.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.EXTRACT_DEFAULT_USER_TEMPLATE = exports.EXTRACT_DEFAULT_SYSTEM_PROMPT = exports.VALIDATION_PROMPT = exports.COMPILATION_PROMPT = void 0;
exports.buildRecompilationHint = buildRecompilationHint;
// Re-export all prompt template constants
var prompt_templates_1 = require("./prompt-templates");
Object.defineProperty(exports, "COMPILATION_PROMPT", { enumerable: true, get: function () { return prompt_templates_1.COMPILATION_PROMPT; } });
Object.defineProperty(exports, "VALIDATION_PROMPT", { enumerable: true, get: function () { return prompt_templates_1.VALIDATION_PROMPT; } });
Object.defineProperty(exports, "EXTRACT_DEFAULT_SYSTEM_PROMPT", { enumerable: true, get: function () { return prompt_templates_1.EXTRACT_DEFAULT_SYSTEM_PROMPT; } });
Object.defineProperty(exports, "EXTRACT_DEFAULT_USER_TEMPLATE", { enumerable: true, get: function () { return prompt_templates_1.EXTRACT_DEFAULT_USER_TEMPLATE; } });
// ── Recompilation hint (compile stage retry) ──────────────────────────────────
/**
 * Build the retry hint injected into the compile stage when
 * user feedback or a prior deployment error triggers recompilation.
 */
function buildRecompilationHint(feedback, priorYaml) {
    return [
        `\n## RECOMPILATION — User Feedback`,
        `The user reviewed the compiled output and provided this feedback:`,
        `> ${feedback}`,
        ``,
        `You MUST produce a plan that addresses this feedback. Key rules:`,
        `- Complex tool arguments (steps arrays, script strings, selector objects) are ALWAYS fixed — never dynamic inputs.`,
        `- Only simple scalar values (URLs, credentials, file paths) should be dynamic trigger inputs.`,
        `- If the feedback says certain fields should not be inputs, classify them as "fixed" with their default values from the execution trace.`,
        `- If the feedback mentions input key mismatches, ensure dataFlow edges use the exact field names each tool expects.`,
        `- Session fields (_handle, page_id) must be threaded through ALL subsequent steps via dataFlow edges.`,
        ...(priorYaml ? [
            ``,
            `### Previous YAML (to improve upon)`,
            '```yaml',
            priorYaml.slice(0, 2000),
            '```',
        ] : []),
    ].join('\n');
}
