export function renderContextAttachments(plan) {
    if (!plan.attachments.length && !plan.inline_text.trim() && !plan.warnings.length)
        return "";
    const lines = [
        "<system-reminder>",
        "SEED context ledger attachments are cache-aware. Prefer referenced context for durable material; use inline hot context only for this turn.",
        `turn_kind: ${plan.turn_kind}`,
    ];
    if (plan.attachments.length) {
        lines.push("attachments:");
        for (const attachment of plan.attachments) {
            lines.push(`- context:${attachment.bundle_id} | ${attachment.category}/${attachment.scope} | ${attachment.render_mode} | ${attachment.title}`);
            lines.push(`  ref: ${attachment.body_ref}`);
            lines.push(`  sha256: ${attachment.body_sha256}`);
            if (attachment.render_mode === "inline" && attachment.inline_text) {
                lines.push("  inline:");
                lines.push(indentBlock(attachment.inline_text, "    "));
            }
            else if (attachment.render_mode === "inline" || attachment.render_mode === "digest") {
                lines.push(`  digest: ${attachment.digest}`);
            }
            if (attachment.reason)
                lines.push(`  reason: ${attachment.reason}`);
        }
    }
    if (plan.inline_text.trim()) {
        lines.push("inline_hot_context:");
        lines.push(plan.inline_text.trim());
    }
    if (plan.warnings.length) {
        lines.push("warnings:");
        for (const warning of plan.warnings)
            lines.push(`- ${warning}`);
    }
    lines.push("</system-reminder>");
    return lines.join("\n");
}
function indentBlock(value, prefix) {
    return value.split("\n").map((line) => `${prefix}${line}`).join("\n");
}
//# sourceMappingURL=render.js.map