"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.renderPromptContractSection = renderPromptContractSection;
const decision_1 = require("./decision");
const prompt_text_1 = require("./prompt-text");
const structured_contract_support_1 = require("./structured-contract-support");
const MINIFIED_DECISION_JSON_RULE = "Return the decision JSON as compact JSON: do not pretty-print, indent, or add optional whitespace inside the JSON object.";
function renderPromptContractSection(input) {
    const lines = [
        ...(input.heading ? [input.heading] : []),
        decision_1.DECISION_START_MARKER,
        `- ${MINIFIED_DECISION_JSON_RULE}`,
        ...input.rules.map((rule) => `- ${rule}`),
    ];
    if (input.promptSchema !== undefined) {
        lines.push(`${prompt_text_1.PROMPT_TEXT.fieldJsonSchema}:`, (0, structured_contract_support_1.renderWorkerPromptJsonSchemaForDisplay)(input.promptSchema));
    }
    lines.push("Example:", JSON.stringify(input.example), decision_1.DECISION_END_MARKER);
    if (input.trailingBlankLine) {
        lines.push("");
    }
    return lines;
}
