// Based on https://platform.claude.com/docs/en/build-with-claude/context-editing#client-side-compaction-sdk
export const COMPACTION_PROMPT = `You will be given a conversation history to summarize. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:

1. Task Overview
   The user's core request and success criteria
   Any clarifications or constraints they specified

2. Current State
   What has been completed so far
   Files created, modified, or analyzed (with paths if relevant)
   Key outputs or artifacts produced

3. Important Discoveries
   Technical constraints or requirements uncovered
   Decisions made and their rationale
   Errors encountered and how they were resolved
   What approaches were tried that didn't work (and why)

4. Build Completion Status
   CRITICAL: Clearly state the build's progress toward finalization:
   - Were all requested features/changes implemented?
   - Was \`build_debug\` called? Did it pass or fail?
   - Were there any unresolved errors (TypeScript, runtime, build)?
   - Were any APIs tested? Did they pass?
   - Is the build ready for \`build_finalize\`, or are there remaining tasks?

5. Next Steps
   Be SPECIFIC about exactly what the resuming agent should do next.
   If the build is complete and debug passed, the next step is: "Call build_finalize to complete the build."
   If there are remaining tasks, list them in priority order.
   NEVER suggest "ask the user what to work on next" if there are clear remaining tasks or if the build is ready to finalize.

6. Context to Preserve
   User preferences or style requirements
   Domain-specific details that aren't obvious
   Any promises made to the user

Be concise but complete—err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task. The resuming agent should be able to take action immediately without asking the user for direction.

Output ONLY the summary content. No preamble, no wrapping tags.`;
/**
 * Formats the conversation history into a user message for compaction.
 */
export function formatCompactionRequest(messagesJson) {
    return `\`\`\`json
${messagesJson}
\`\`\``;
}
/**
 * Wraps the generated summary with continuation context to help the model
 * understand it's resuming a previous session.
 */
export function formatSummaryMessage(summary) {
    return `[Session Continuation]

You are resuming a previous session. The following is a summary of what has been accomplished so far:

---

${summary}

---

Continue from where you left off. If there are next steps outlined above, proceed with them.`;
}
//# sourceMappingURL=compaction.js.map