"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.template_content = exports.description = exports.handle = void 0;
exports.handle = 'compress';
exports.description = 'Compress session context by selectively discarding intermediary messages';
exports.template_content = `Compress the session context. Your goal is to reduce \`total_est_tokens\` to near \`target_tokens\` (~50,000). **Never discard below \`floor_tokens\` (30,000)** — you need enough context to continue working.

## Process
1. Call \`get_messages\` to see all messages with \`short_id\`, \`preview\`, \`est_tokens\`, plus \`target_tokens\` and \`floor_tokens\`
2. Cherry-pick individual messages to discard — see priority and keep rules below
3. Stop selecting once the estimated remaining tokens would be near \`target_tokens\`
4. Call \`discard_messages\` with the selected short_ids
5. A follow-up turn starts automatically with reduced context — continue your task

## Keep Rules (always preserve)
- The most recent user message and your response to it
- Code changes (create_file, overwrite_file, quick_edit, delete_file) — these are your working context
- Plan conclusions and summaries that anchor ongoing work (write_todo, final)

## Discard Priority (discard these first)
1. \`request_context\` outputs for files you already finished examining
2. \`run_command\` outputs that served a one-time purpose (find, rg, tree, npm test, etc.)
3. \`execute_code\` outputs that were for quick verification
4. \`generate_title\` calls
5. Older user messages that have been fully addressed

## Critical Rules
- **Cherry-pick individual messages** using their \`short_id\`. Do NOT discard entire groups.
- **Never go below \`floor_tokens\`** — you need context to continue working after compression.
- **Never discard code changes** — create_file, overwrite_file, quick_edit, delete_file messages are your working context. Even if "completed," they show what the current state of files should be.
- **Never discard explanation/planning** — final, html_final, write_todo messages are anchors to understand session. you must have a valid reason to discard each one.
- After discarding, continue your task with the reduced context.`;
//# sourceMappingURL=compress.js.map