@tarquinen/opencode-dcp 1.0.4 → 1.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +30 -5
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +45 -16
  4. package/dist/index.js.map +1 -1
  5. package/dist/lib/config.d.ts +20 -1
  6. package/dist/lib/config.d.ts.map +1 -1
  7. package/dist/lib/config.js +153 -33
  8. package/dist/lib/config.js.map +1 -1
  9. package/dist/lib/messages/prune.d.ts.map +1 -1
  10. package/dist/lib/messages/prune.js +67 -15
  11. package/dist/lib/messages/prune.js.map +1 -1
  12. package/dist/lib/prompt.js +1 -1
  13. package/dist/lib/prompt.js.map +1 -1
  14. package/dist/lib/prompts/discard-tool-spec.txt +56 -0
  15. package/dist/lib/prompts/extract-tool-spec.txt +79 -0
  16. package/dist/lib/prompts/nudge/nudge-both.txt +10 -0
  17. package/dist/lib/prompts/nudge/nudge-discard.txt +9 -0
  18. package/dist/lib/prompts/nudge/nudge-extract.txt +9 -0
  19. package/dist/lib/prompts/{synthetic.txt → system/system-prompt-both.txt} +23 -13
  20. package/dist/lib/prompts/system/system-prompt-discard.txt +49 -0
  21. package/dist/lib/prompts/system/system-prompt-extract.txt +49 -0
  22. package/dist/lib/state/state.d.ts +1 -0
  23. package/dist/lib/state/state.d.ts.map +1 -1
  24. package/dist/lib/state/state.js +20 -2
  25. package/dist/lib/state/state.js.map +1 -1
  26. package/dist/lib/state/tool-cache.d.ts.map +1 -1
  27. package/dist/lib/state/tool-cache.js +27 -7
  28. package/dist/lib/state/tool-cache.js.map +1 -1
  29. package/dist/lib/state/types.d.ts +2 -0
  30. package/dist/lib/state/types.d.ts.map +1 -1
  31. package/dist/lib/strategies/deduplication.js +1 -1
  32. package/dist/lib/strategies/deduplication.js.map +1 -1
  33. package/dist/lib/strategies/index.d.ts +1 -1
  34. package/dist/lib/strategies/index.d.ts.map +1 -1
  35. package/dist/lib/strategies/index.js +1 -1
  36. package/dist/lib/strategies/index.js.map +1 -1
  37. package/dist/lib/strategies/on-idle.d.ts.map +1 -1
  38. package/dist/lib/strategies/on-idle.js +2 -1
  39. package/dist/lib/strategies/on-idle.js.map +1 -1
  40. package/dist/lib/strategies/{prune-tool.d.ts → tools.d.ts} +3 -6
  41. package/dist/lib/strategies/tools.d.ts.map +1 -0
  42. package/dist/lib/strategies/tools.js +121 -0
  43. package/dist/lib/strategies/tools.js.map +1 -0
  44. package/dist/lib/strategies/utils.d.ts +0 -1
  45. package/dist/lib/strategies/utils.d.ts.map +1 -1
  46. package/dist/lib/strategies/utils.js +0 -1
  47. package/dist/lib/strategies/utils.js.map +1 -1
  48. package/dist/lib/ui/notification.d.ts +1 -0
  49. package/dist/lib/ui/notification.d.ts.map +1 -1
  50. package/dist/lib/ui/notification.js +21 -0
  51. package/dist/lib/ui/notification.js.map +1 -1
  52. package/package.json +1 -1
  53. package/dist/lib/prompts/nudge.txt +0 -10
  54. package/dist/lib/prompts/tool.txt +0 -72
  55. package/dist/lib/strategies/prune-tool.d.ts.map +0 -1
  56. package/dist/lib/strategies/prune-tool.js +0 -88
  57. package/dist/lib/strategies/prune-tool.js.map +0 -1
  58. /package/dist/lib/prompts/{pruning.txt → on-idle-analysis.txt} +0 -0
@@ -3,7 +3,43 @@ import { extractParameterKey, buildToolIdList } from "./utils";
3
3
  import { getLastUserMessage, isMessageCompacted } from "../shared-utils";
4
4
  const PRUNED_TOOL_INPUT_REPLACEMENT = '[Input removed to save context]';
5
5
  const PRUNED_TOOL_OUTPUT_REPLACEMENT = '[Output removed to save context - information superseded or no longer needed]';
6
- const NUDGE_STRING = loadPrompt("nudge");
6
+ const getNudgeString = (config) => {
7
+ const discardEnabled = config.strategies.discardTool.enabled;
8
+ const extractEnabled = config.strategies.extractTool.enabled;
9
+ if (discardEnabled && extractEnabled) {
10
+ return loadPrompt("nudge/nudge-both");
11
+ }
12
+ else if (discardEnabled) {
13
+ return loadPrompt("nudge/nudge-discard");
14
+ }
15
+ else if (extractEnabled) {
16
+ return loadPrompt("nudge/nudge-extract");
17
+ }
18
+ return "";
19
+ };
20
+ const wrapPrunableTools = (content) => `<prunable-tools>
21
+ The following tools have been invoked and are available for pruning. This list does not mandate immediate action. Consider your current goals and the resources you need before discarding valuable tool inputs or outputs. Consolidate your prunes for efficiency; it is rarely worth pruning a single tiny tool output. Keep the context free of noise.
22
+ ${content}
23
+ </prunable-tools>`;
24
+ const getCooldownMessage = (config) => {
25
+ const discardEnabled = config.strategies.discardTool.enabled;
26
+ const extractEnabled = config.strategies.extractTool.enabled;
27
+ let toolName;
28
+ if (discardEnabled && extractEnabled) {
29
+ toolName = "discard or extract tools";
30
+ }
31
+ else if (discardEnabled) {
32
+ toolName = "discard tool";
33
+ }
34
+ else {
35
+ toolName = "extract tool";
36
+ }
37
+ return `<prunable-tools>
38
+ Context management was just performed. Do not use the ${toolName} again. A fresh list will be available after your next tool use.
39
+ </prunable-tools>`;
40
+ };
41
+ const SYNTHETIC_MESSAGE_ID = "msg_01234567890123456789012345";
42
+ const SYNTHETIC_PART_ID = "prt_01234567890123456789012345";
7
43
  const buildPrunableToolsList = (state, config, logger, messages) => {
8
44
  const lines = [];
9
45
  const toolIdList = buildToolIdList(state, messages, logger);
@@ -11,7 +47,11 @@ const buildPrunableToolsList = (state, config, logger, messages) => {
11
47
  if (state.prune.toolIds.includes(toolCallId)) {
12
48
  return;
13
49
  }
14
- if (config.strategies.pruneTool.protectedTools.includes(toolParameterEntry.tool)) {
50
+ const allProtectedTools = [
51
+ ...config.strategies.discardTool.protectedTools,
52
+ ...config.strategies.extractTool.protectedTools
53
+ ];
54
+ if (allProtectedTools.includes(toolParameterEntry.tool)) {
15
55
  return;
16
56
  }
17
57
  const numericId = toolIdList.indexOf(toolCallId);
@@ -27,28 +67,40 @@ const buildPrunableToolsList = (state, config, logger, messages) => {
27
67
  if (lines.length === 0) {
28
68
  return "";
29
69
  }
30
- return `<prunable-tools>\nThe following tools have been invoked and are available for pruning. This list does not mandate immediate action. Consider your current goals and the resources you need before discarding valuable tool inputs or outputs. Keep the context free of noise.\n${lines.join('\n')}\n</prunable-tools>`;
70
+ return wrapPrunableTools(lines.join('\n'));
31
71
  };
32
72
  export const insertPruneToolContext = (state, config, logger, messages) => {
33
- if (!config.strategies.pruneTool.enabled) {
73
+ if (!config.strategies.discardTool.enabled && !config.strategies.extractTool.enabled) {
34
74
  return;
35
75
  }
36
76
  const lastUserMessage = getLastUserMessage(messages);
37
77
  if (!lastUserMessage) {
38
78
  return;
39
79
  }
40
- const prunableToolsList = buildPrunableToolsList(state, config, logger, messages);
41
- if (!prunableToolsList) {
42
- return;
80
+ let prunableToolsContent;
81
+ if (state.lastToolPrune) {
82
+ logger.debug("Last tool was prune - injecting cooldown message");
83
+ prunableToolsContent = getCooldownMessage(config);
43
84
  }
44
- let nudgeString = "";
45
- if (state.nudgeCounter >= config.strategies.pruneTool.nudge.frequency) {
46
- logger.info("Inserting prune nudge message");
47
- nudgeString = "\n" + NUDGE_STRING;
85
+ else {
86
+ const prunableToolsList = buildPrunableToolsList(state, config, logger, messages);
87
+ if (!prunableToolsList) {
88
+ return;
89
+ }
90
+ logger.debug("prunable-tools: \n" + prunableToolsList);
91
+ let nudgeString = "";
92
+ // TODO: Using Math.min() means the lower frequency dominates when both tools are enabled.
93
+ // Consider using separate counters for each tool's nudge, or documenting this behavior.
94
+ const nudgeFrequency = Math.min(config.strategies.discardTool.nudge.frequency, config.strategies.extractTool.nudge.frequency);
95
+ if (state.nudgeCounter >= nudgeFrequency) {
96
+ logger.info("Inserting prune nudge message");
97
+ nudgeString = "\n" + getNudgeString(config);
98
+ }
99
+ prunableToolsContent = prunableToolsList + nudgeString;
48
100
  }
49
101
  const userMessage = {
50
102
  info: {
51
- id: "msg_01234567890123456789012345",
103
+ id: SYNTHETIC_MESSAGE_ID,
52
104
  sessionID: lastUserMessage.info.sessionID,
53
105
  role: "user",
54
106
  time: { created: Date.now() },
@@ -60,11 +112,11 @@ export const insertPruneToolContext = (state, config, logger, messages) => {
60
112
  },
61
113
  parts: [
62
114
  {
63
- id: "prt_01234567890123456789012345",
115
+ id: SYNTHETIC_PART_ID,
64
116
  sessionID: lastUserMessage.info.sessionID,
65
- messageID: "msg_01234567890123456789012345",
117
+ messageID: SYNTHETIC_MESSAGE_ID,
66
118
  type: "text",
67
- text: prunableToolsList + nudgeString,
119
+ text: prunableToolsContent,
68
120
  }
69
121
  ]
70
122
  };
@@ -1 +1 @@
1
- {"version":3,"file":"prune.js","sourceRoot":"","sources":["../../../lib/messages/prune.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9D,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAGxE,MAAM,6BAA6B,GAAG,iCAAiC,CAAA;AACvE,MAAM,8BAA8B,GAAG,+EAA+E,CAAA;AACtH,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;AAExC,MAAM,sBAAsB,GAAG,CAC3B,KAAmB,EACnB,MAAoB,EACpB,MAAc,EACd,QAAqB,EACf,EAAE;IACR,MAAM,KAAK,GAAa,EAAE,CAAA;IAC1B,MAAM,UAAU,GAAa,eAAe,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;IAErE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,kBAAkB,EAAE,UAAU,EAAE,EAAE;QAC5D,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;YAC3C,OAAM;QACV,CAAC;QACD,IAAI,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,cAAc,CAAC,QAAQ,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC;YAC/E,OAAM;QACV,CA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@ function minimizeMessages(messages, alreadyPrunedIds, protectedToolCallIds) {
108
108
  export function buildAnalysisPrompt(unprunedToolCallIds, messages, alreadyPrunedIds, protectedToolCallIds) {
109
109
  const minimizedMessages = minimizeMessages(messages, alreadyPrunedIds, protectedToolCallIds);
110
110
  const messagesJson = JSON.stringify(minimizedMessages, null, 2).replace(/\\n/g, '\n');
111
- return loadPrompt("pruning", {
111
+ return loadPrompt("on-idle-analysis", {
112
112
  available_tool_call_ids: unprunedToolCallIds.join(", "),
113
113
  session_history: messagesJson
114
114
  });
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../lib/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,IAA6B;IAClE,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,GAAG,IAAI,MAAM,CAAC,CAAA;IAC1D,IAAI,OAAO,GAAG,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAA;IACnD,IAAI,IAAI,EAAE,CAAC;QACP,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9C,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,SAAS,GAAG,QAAQ,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,CAAA;QAC3E,CAAC;IACL,CAAC;IACD,OAAO,OAAO,CAAA;AAClB,CAAC;AAED,SAAS,gBAAgB,CAAC,QAAe,EAAE,gBAA2B,EAAE,oBAA+B;IACnG,MAAM,YAAY,GAAG,gBAAgB,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,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.
2
+
3
+ ## IMPORTANT: The Prunable List
4
+ A `<prunable-tools>` list is injected into user messages showing available tool outputs you can discard when there are tools available for pruning. Each line has the format `ID: tool, parameter` (e.g., `20: read, /path/to/file.ts`). You MUST only use numeric IDs that appear in this list to select which tools to discard.
5
+
6
+ **Note:** For `write` and `edit` tools, discarding removes the input content (the code being written/edited) while preserving the output confirmation. This is useful after completing a file modification when you no longer need the raw content in context.
7
+
8
+ ## When to Use This Tool
9
+
10
+ Use `discard` for removing tool outputs that are no longer needed **without preserving their content**:
11
+
12
+ ### 1. Task Completion (Clean Up)
13
+ **When:** You have successfully completed a specific unit of work (e.g., fixed a bug, wrote a file, answered a question).
14
+ **Action:** Discard the tools used for that task with reason `completion`.
15
+
16
+ ### 2. Removing Noise (Garbage Collection)
17
+ **When:** You have read files or run commands that turned out to be irrelevant, unhelpful, or outdated (meaning later tools have provided fresher, more valid information).
18
+ **Action:** Discard these specific tool outputs immediately with reason `noise`.
19
+
20
+ ## When NOT to Use This Tool
21
+
22
+ - **If you need to preserve information:** Keep the raw output in context rather than discarding it.
23
+ - **If you'll need the output later:** Don't discard files you plan to edit, or context you'll need for implementation.
24
+
25
+ ## Best Practices
26
+ - **Strategic Batching:** Don't discard single small tool outputs (like short bash commands) unless they are pure noise. Wait until you have several items to perform high-impact discards.
27
+ - **Think ahead:** Before discarding, ask: "Will I need this output for an upcoming task?" If yes, keep it.
28
+
29
+ ## Format
30
+ The `ids` parameter is an array where the first element is the reason, followed by numeric IDs:
31
+ `ids: ["reason", "id1", "id2", ...]`
32
+
33
+ ## Examples
34
+
35
+ <example_noise>
36
+ Assistant: [Reads 'wrong_file.ts']
37
+ This file isn't relevant to the auth system. I'll remove it to clear the context.
38
+ [Uses discard with ids: ["noise", "5"]]
39
+ </example_noise>
40
+
41
+ <example_completion>
42
+ Assistant: [Runs tests, they pass]
43
+ The tests passed. I'll clean up now.
44
+ [Uses discard with ids: ["completion", "20", "21"]]
45
+ </example_completion>
46
+
47
+ <example_keep>
48
+ Assistant: [Reads 'auth.ts' to understand the login flow]
49
+ I've understood the auth flow. I'll need to modify this file to add the new validation, so I'm keeping this read in context rather than discarding.
50
+ </example_keep>
51
+
52
+ <example_edit_completion>
53
+ Assistant: [Edits 'auth.ts' to add validation]
54
+ The edit was successful. I no longer need the raw edit content in context.
55
+ [Uses discard with ids: ["completion", "15"]]
56
+ </example_edit_completion>
@@ -0,0 +1,79 @@
1
+ Extracts key findings from tool outputs into distilled knowledge, then removes the raw outputs from context.
2
+
3
+ ## IMPORTANT: The Prunable List
4
+ A `<prunable-tools>` list is injected into user messages showing available tool outputs you can extract from when there are tools available for pruning. Each line has the format `ID: tool, parameter` (e.g., `20: read, /path/to/file.ts`). You MUST only use numeric IDs that appear in this list to select which tools to extract.
5
+
6
+ ## When to Use This Tool
7
+
8
+ Use `extract` when you have gathered useful information that you want to **preserve in distilled form** before removing the raw outputs:
9
+
10
+ ### 1. Task Completion
11
+ **When:** You have completed a unit of work and want to preserve key findings.
12
+ **Action:** Extract with distillation scaled to the value of the content. High-value insights require comprehensive capture; routine completions can use lighter distillation.
13
+
14
+ ### 2. Knowledge Preservation
15
+ **When:** You have read files, run commands, or gathered context that contains valuable information you'll need to reference later, but the full raw output is too large to keep.
16
+ **Action:** Convert raw data into distilled knowledge. This allows you to remove large outputs (like full file reads) while keeping only the specific parts you need (like a single function signature or constant).
17
+
18
+ ## CRITICAL: Distillation Requirements
19
+
20
+ You MUST provide distilled findings in the `distillation` parameter. This is not optional.
21
+
22
+ - **Comprehensive Capture:** Distillation is not just a summary. It must be a high-fidelity representation of the technical details. If you read a file, the distillation should include function signatures, specific logic flows, constant values, and any constraints or edge cases discovered.
23
+ - **Task-Relevant Verbosity:** Be as verbose as necessary to ensure that the "distilled" version is a complete substitute for the raw output for the task at hand. If you will need to reference a specific algorithm or interface later, include it in its entirety within the distillation.
24
+ - **Extract Per-ID:** When extracting from multiple tools, your `distillation` object MUST contain a corresponding entry for EVERY ID being extracted. You must capture high-fidelity findings for each tool individually to ensure no signal is lost.
25
+ - **Structure:** Map EVERY `ID` from the `ids` array to its specific distilled findings.
26
+ Example: `{ "20": { ... }, "21": { ... } }`
27
+ - Capture all relevant details (function names, logic, constraints) to ensure no signal is lost.
28
+ - Prioritize information that is essential for the immediate next steps of your plan.
29
+
30
+ ## When NOT to Use This Tool
31
+
32
+ - **If you need precise syntax:** If you'll need to edit a file, grep for exact strings, or reference precise syntax, keep the raw output. Distillation works for understanding; implementation often requires the original.
33
+ - **If uncertain:** Prefer keeping over re-fetching. The cost of retaining context is lower than the cost of redundant tool calls.
34
+
35
+ ## Best Practices
36
+ - **Technical Fidelity:** Ensure that types, parameters, and return values are preserved if they are relevant to upcoming implementation steps.
37
+ - **Strategic Batching:** Wait until you have several items or a few large outputs to extract, rather than doing tiny, frequent extractions. Aim for high-impact extractions that significantly reduce context size.
38
+ - **Think ahead:** Before extracting, ask: "Will I need the raw output for an upcoming task?" If you researched a file you'll later edit, do NOT extract it.
39
+
40
+ ## Format
41
+ The `ids` parameter is an array of numeric IDs as strings:
42
+ `ids: ["id1", "id2", ...]`
43
+
44
+ The `distillation` parameter is an object mapping each ID to its distilled findings:
45
+ `distillation: { "id1": { ...findings... }, "id2": { ...findings... } }`
46
+
47
+ ## Example
48
+
49
+ <example_extraction>
50
+ Assistant: [Reads service implementation, types, and config]
51
+ I'll preserve the full technical specification and implementation logic before extracting.
52
+ [Uses extract with ids: ["10", "11", "12"], distillation: {
53
+ "10": {
54
+ "file": "src/services/auth.ts",
55
+ "signatures": [
56
+ "async function validateToken(token: string): Promise<User | null>",
57
+ "function hashPassword(password: string): string"
58
+ ],
59
+ "logic": "The validateToken function first checks the local cache before calling the external OIDC provider. It uses a 5-minute TTL for cached tokens.",
60
+ "dependencies": ["import { cache } from '../utils/cache'", "import { oidc } from '../config'"],
61
+ "constraints": "Tokens must be at least 128 chars long. hashPassword uses bcrypt with 12 rounds."
62
+ },
63
+ "11": {
64
+ "file": "src/types/user.ts",
65
+ "interface": "interface User { id: string; email: string; permissions: ('read' | 'write' | 'admin')[]; status: 'active' | 'suspended'; }",
66
+ "context": "The permissions array is strictly typed and used by the RBAC middleware."
67
+ },
68
+ "12": {
69
+ "file": "config/default.json",
70
+ "values": { "PORT": 3000, "RETRY_STRATEGY": "exponential", "MAX_ATTEMPTS": 5 },
71
+ "impact": "The retry strategy affects all outgoing HTTP clients in the core module."
72
+ }
73
+ }]
74
+ </example_extraction>
75
+
76
+ <example_keep>
77
+ Assistant: [Reads 'auth.ts' to understand the login flow]
78
+ I've understood the auth flow. I'll need to modify this file to add the new validation, so I'm keeping this read in context rather than extracting.
79
+ </example_keep>
@@ -0,0 +1,10 @@
1
+ <instruction name=context_management_required>
2
+ **CRITICAL CONTEXT WARNING:** Your context window is filling with tool outputs. Strict adherence to context hygiene is required.
3
+
4
+ **Immediate Actions Required:**
5
+ 1. **Task Completion:** If a sub-task is complete, decide: use `discard` if no valuable context to preserve (default), or use `extract` if insights are worth keeping.
6
+ 2. **Noise Removal:** If you read files or ran commands that yielded no value, use `discard` to remove them.
7
+ 3. **Knowledge Preservation:** If you are holding valuable raw data you'll need to reference later, use `extract` to distill the insights and remove the raw entry.
8
+
9
+ **Protocol:** You should prioritize this cleanup, but do not interrupt a critical atomic operation if one is in progress. Once the immediate step is done, you must perform context management.
10
+ </instruction>
@@ -0,0 +1,9 @@
1
+ <instruction name=context_management_required>
2
+ **CRITICAL CONTEXT WARNING:** Your context window is filling with tool outputs. Strict adherence to context hygiene is required.
3
+
4
+ **Immediate Actions Required:**
5
+ 1. **Task Completion:** If a sub-task is complete, use the `discard` tool to remove the tools used.
6
+ 2. **Noise Removal:** If you read files or ran commands that yielded no value, use the `discard` tool to remove them.
7
+
8
+ **Protocol:** You should prioritize this cleanup, but do not interrupt a critical atomic operation if one is in progress. Once the immediate step is done, you must discard unneeded tool outputs.
9
+ </instruction>
@@ -0,0 +1,9 @@
1
+ <instruction name=context_management_required>
2
+ **CRITICAL CONTEXT WARNING:** Your context window is filling with tool outputs. Strict adherence to context hygiene is required.
3
+
4
+ **Immediate Actions Required:**
5
+ 1. **Task Completion:** If you have completed work, extract key findings from the tools used. Scale distillation depth to the value of the content.
6
+ 2. **Knowledge Preservation:** If you are holding valuable raw data you'll need to reference later, use the `extract` tool with high-fidelity distillation to preserve the insights and remove the raw entry.
7
+
8
+ **Protocol:** You should prioritize this cleanup, but do not interrupt a critical atomic operation if one is in progress. Once the immediate step is done, you must extract valuable findings from tool outputs.
9
+ </instruction>
@@ -2,21 +2,30 @@
2
2
  <instruction name=context_management_protocol policy_level=critical>
3
3
 
4
4
  ENVIRONMENT
5
- You are operating in a context-constrained environment and thus must proactively manage your context window using the `prune` tool. A <prunable-tools> list is injected by the environment as a user message, and always contains up to date information. Use this information when deciding what to prune.
5
+ You are operating in a context-constrained environment and thus must proactively manage your context window using the `discard` and `extract` tools. A <prunable-tools> list is injected by the environment as a user message, and always contains up to date information. Use this information when deciding what to prune.
6
6
 
7
- PRUNE EARLY, PRUNE OFTEN - BUT PRUNE METHODICALLY
8
- Every tool call adds to your context debt. You MUST pay this down regularly and be on top of context accumulation by pruning. Evaluate what SHOULD be pruned before jumping the gun.
7
+ TWO TOOLS FOR CONTEXT MANAGEMENT
8
+ - `discard`: Remove tool outputs that are no longer needed (completed tasks, noise, outdated info). No preservation of content.
9
+ - `extract`: Extract key findings into distilled knowledge before removing raw outputs. Use when you need to preserve information.
9
10
 
10
- WHEN TO PRUNE? THE THREE SCENARIOS TO CONSIDER
11
- 1. TASK COMPLETION: When work is done, quietly prune the tools that aren't needed anymore
12
- 2. NOISE REMOVAL: If outputs are irrelevant, unhelpful, or superseded by newer info, prune IMMEDIATELY. No distillation - gun it down
13
- 3. CONTEXT CONSOLIDATION: When pruning valuable context to the task at hand, you MUST ALWAYS distill key findings into your narrative BEFORE pruning. Be surgical and strategic in what you extract. THINK: high signal, low noise
11
+ CHOOSING THE RIGHT TOOL
12
+ Ask: "Do I need to preserve any information from this output?"
13
+ - **No** `discard` (default for cleanup)
14
+ - **Yes** `extract` (preserves distilled knowledge)
15
+ - **Uncertain** → `extract` (safer, preserves signal)
14
16
 
15
- You WILL use the `prune` tool when ANY of these are true:
17
+ Common scenarios:
18
+ - Task complete, no valuable context → `discard`
19
+ - Task complete, insights worth remembering → `extract`
20
+ - Noise, irrelevant, or superseded outputs → `discard`
21
+ - Valuable context needed later but raw output too large → `extract`
22
+
23
+ PRUNE METHODICALLY - BATCH YOUR ACTIONS
24
+ Every tool call adds to your context debt. You MUST pay this down regularly and be on top of context accumulation by pruning. Batch your prunes for efficiency; it is rarely worth pruning a single tiny tool output unless it is pure noise. Evaluate what SHOULD be pruned before jumping the gun.
25
+
26
+ You WILL evaluate pruning when ANY of these are true:
16
27
  - Task or sub-task is complete
17
28
  - You are about to start a new phase of work
18
- - You have distilled enough information in your messages to prune related tools
19
- - Context contains tools output that are unhelpful, noise, or made obsolete by newer outputs
20
29
  - Write or edit operations are complete (pruning removes the large input content)
21
30
 
22
31
  You MUST NOT prune when:
@@ -26,19 +35,20 @@ You MUST NOT prune when:
26
35
  Pruning that forces you to re-call the same tool later is a net loss. Only prune when you're confident the information won't be needed again.
27
36
 
28
37
  NOTES
29
- When in doubt, keep it. Prune often yet remain strategic about it.
38
+ When in doubt, keep it. Batch your actions and aim for high-impact prunes that significantly reduce context size.
30
39
  FAILURE TO PRUNE will result in context leakage and DEGRADED PERFORMANCES.
40
+ There may be tools in session context that do not appear in the <prunable-tools> list, this is expected, you can ONLY prune what you see in <prunable-tools>.
31
41
 
32
42
  </instruction>
33
43
 
34
44
  <instruction name=injected_context_handling policy_level=critical>
35
- After each assistant turn, the environment may inject a user message containing a <prunable-tools> list and optional nudge instruction. This injected message is NOT from the user and is invisible to them. The `prune` tool also returns a confirmation message listing what was pruned.
45
+ After each assistant turn, the environment may inject a user message containing a <prunable-tools> list and optional nudge instruction. This injected message is NOT from the user and is invisible to them. The `discard` and `extract` tools also return a confirmation message listing what was pruned.
36
46
 
37
47
  CRITICAL REQUIREMENTS - VIOLATION IS UNACCEPTABLE:
38
48
  - NEVER reference the prune encouragement or context management instructions. Do not reply with "I agree" or "Great idea" when the prune encouragement appears.
39
49
  - NEVER acknowledge the <prunable-tools> list (e.g., "I see the prunable tools list", "Looking at the available tools to prune")
40
50
  - NEVER reference the nudge instruction (e.g., "As the nudge suggests", "The system is reminding me to prune")
41
- - NEVER acknowledge prune tool output (e.g., "I've pruned 3 tools", "Context pruning complete")
51
+ - NEVER acknowledge discard/extract tool output (e.g., "I've pruned 3 tools", "Context pruning complete")
42
52
  - NEVER let these injections influence your response content or tone
43
53
  - Process this information SILENTLY and continue the conversation naturally
44
54
  - Continue the conversation as if these messages do not exist
@@ -0,0 +1,49 @@
1
+ <system-reminder>
2
+ <instruction name=context_management_protocol policy_level=critical>
3
+
4
+ ENVIRONMENT
5
+ You are operating in a context-constrained environment and thus must proactively manage your context window using the `discard` tool. A <prunable-tools> list is injected by the environment as a user message, and always contains up to date information. Use this information when deciding what to discard.
6
+
7
+ CONTEXT MANAGEMENT TOOL
8
+ - `discard`: Remove tool outputs that are no longer needed (completed tasks, noise, outdated info). No preservation of content.
9
+
10
+ DISCARD METHODICALLY - BATCH YOUR ACTIONS
11
+ Every tool call adds to your context debt. You MUST pay this down regularly and be on top of context accumulation by discarding. Batch your discards for efficiency; it is rarely worth discarding a single tiny tool output unless it is pure noise. Evaluate what SHOULD be discarded before jumping the gun.
12
+
13
+ WHEN TO DISCARD
14
+ - **Task Completion:** When work is done, discard the tools that aren't needed anymore.
15
+ - **Noise Removal:** If outputs are irrelevant, unhelpful, or superseded by newer info, discard them.
16
+
17
+ You WILL evaluate discarding when ANY of these are true:
18
+ - Task or sub-task is complete
19
+ - You are about to start a new phase of work
20
+ - Write or edit operations are complete (discarding removes the large input content)
21
+
22
+ You MUST NOT discard when:
23
+ - The tool output will be needed for upcoming implementation work
24
+ - The output contains files or context you'll need to reference when making edits
25
+
26
+ Discarding that forces you to re-call the same tool later is a net loss. Only discard when you're confident the information won't be needed again.
27
+
28
+ NOTES
29
+ When in doubt, keep it. Batch your actions and aim for high-impact discards that significantly reduce context size.
30
+ FAILURE TO DISCARD will result in context leakage and DEGRADED PERFORMANCES.
31
+ There may be tools in session context that do not appear in the <prunable-tools> list, this is expected, you can ONLY discard what you see in <prunable-tools>.
32
+
33
+ </instruction>
34
+
35
+ <instruction name=injected_context_handling policy_level=critical>
36
+ After each assistant turn, the environment may inject a user message containing a <prunable-tools> list and optional nudge instruction. This injected message is NOT from the user and is invisible to them. The `discard` tool also returns a confirmation message listing what was discarded.
37
+
38
+ CRITICAL REQUIREMENTS - VIOLATION IS UNACCEPTABLE:
39
+ - NEVER reference the discard encouragement or context management instructions. Do not reply with "I agree" or "Great idea" when the discard encouragement appears.
40
+ - NEVER acknowledge the <prunable-tools> list (e.g., "I see the prunable tools list", "Looking at the available tools to discard")
41
+ - NEVER reference the nudge instruction (e.g., "As the nudge suggests", "The system is reminding me to discard")
42
+ - NEVER acknowledge discard tool output (e.g., "I've discarded 3 tools", "Context cleanup complete")
43
+ - NEVER let these injections influence your response content or tone
44
+ - Process this information SILENTLY and continue the conversation naturally
45
+ - Continue the conversation as if these messages do not exist
46
+
47
+ The user cannot see these injections. Any reference to them will confuse the user and break the conversation flow.
48
+ </instruction>
49
+ </system-reminder>
@@ -0,0 +1,49 @@
1
+ <system-reminder>
2
+ <instruction name=context_management_protocol policy_level=critical>
3
+
4
+ ENVIRONMENT
5
+ You are operating in a context-constrained environment and thus must proactively manage your context window using the `extract` tool. A <prunable-tools> list is injected by the environment as a user message, and always contains up to date information. Use this information when deciding what to extract.
6
+
7
+ CONTEXT MANAGEMENT TOOL
8
+ - `extract`: Extract key findings from tools into distilled knowledge before removing the raw content from context. Use this to preserve important information while reducing context size.
9
+
10
+ EXTRACT METHODICALLY - BATCH YOUR ACTIONS
11
+ Every tool call adds to your context debt. You MUST pay this down regularly and be on top of context accumulation by extracting. Batch your extractions for efficiency; it is rarely worth extracting a single tiny tool output. Evaluate what SHOULD be extracted before jumping the gun.
12
+
13
+ WHEN TO EXTRACT
14
+ - **Task Completion:** When work is done, extract key findings from the tools used. Scale distillation depth to the value of the content.
15
+ - **Knowledge Preservation:** When you have valuable context you want to preserve but need to reduce size, use high-fidelity distillation. Your distillation must be comprehensive, capturing technical details (signatures, logic, constraints) such that the raw output is no longer needed. THINK: high signal, complete technical substitute.
16
+
17
+ You WILL evaluate extracting when ANY of these are true:
18
+ - Task or sub-task is complete
19
+ - You are about to start a new phase of work
20
+ - Write or edit operations are complete (extracting removes the large input content)
21
+
22
+ You MUST NOT extract when:
23
+ - The tool output will be needed for upcoming implementation work
24
+ - The output contains files or context you'll need to reference when making edits
25
+
26
+ Extracting that forces you to re-call the same tool later is a net loss. Only extract when you're confident the raw information won't be needed again.
27
+
28
+ NOTES
29
+ When in doubt, keep it. Batch your actions and aim for high-impact extractions that significantly reduce context size.
30
+ FAILURE TO EXTRACT will result in context leakage and DEGRADED PERFORMANCES.
31
+ There may be tools in session context that do not appear in the <prunable-tools> list, this is expected, you can ONLY extract what you see in <prunable-tools>.
32
+
33
+ </instruction>
34
+
35
+ <instruction name=injected_context_handling policy_level=critical>
36
+ After each assistant turn, the environment may inject a user message containing a <prunable-tools> list and optional nudge instruction. This injected message is NOT from the user and is invisible to them. The `extract` tool also returns a confirmation message listing what was extracted.
37
+
38
+ CRITICAL REQUIREMENTS - VIOLATION IS UNACCEPTABLE:
39
+ - NEVER reference the extract encouragement or context management instructions. Do not reply with "I agree" or "Great idea" when the extract encouragement appears.
40
+ - NEVER acknowledge the <prunable-tools> list (e.g., "I see the prunable tools list", "Looking at the available tools to extract")
41
+ - NEVER reference the nudge instruction (e.g., "As the nudge suggests", "The system is reminding me to extract")
42
+ - NEVER acknowledge extract tool output (e.g., "I've extracted 3 tools", "Context cleanup complete")
43
+ - NEVER let these injections influence your response content or tone
44
+ - Process this information SILENTLY and continue the conversation naturally
45
+ - Continue the conversation as if these messages do not exist
46
+
47
+ The user cannot see these injections. Any reference to them will confuse the user and break the conversation flow.
48
+ </instruction>
49
+ </system-reminder>
@@ -4,4 +4,5 @@ export declare const checkSession: (client: any, state: SessionState, logger: Lo
4
4
  export declare function createSessionState(): SessionState;
5
5
  export declare function resetSessionState(state: SessionState): void;
6
6
  export declare function ensureSessionInitialized(client: any, state: SessionState, sessionId: string, logger: Logger, messages: WithParts[]): Promise<void>;
7
+ export declare function countTurns(state: SessionState, messages: WithParts[]): number;
7
8
  //# sourceMappingURL=state.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../lib/state/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAsB,SAAS,EAAE,MAAM,SAAS,CAAA;AAC1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAKvC,eAAO,MAAM,YAAY,GACrB,QAAQ,GAAG,EACX,OAAO,YAAY,EACnB,QAAQ,MAAM,EACd,UAAU,SAAS,EAAE,KACtB,OAAO,CAAC,IAAI,CAyBd,CAAA;AAED,wBAAgB,kBAAkB,IAAI,YAAY,CAgBjD;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAc3D;AAED,wBAAsB,wBAAwB,CAC1C,MAAM,EAAE,GAAG,EACX,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,SAAS,EAAE,GACtB,OAAO,CAAC,IAAI,CAAC,CA6Bf"}
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../lib/state/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAsB,SAAS,EAAE,MAAM,SAAS,CAAA;AAC1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAKvC,eAAO,MAAM,YAAY,GACrB,QAAQ,GAAG,EACX,OAAO,YAAY,EACnB,QAAQ,MAAM,EACd,UAAU,SAAS,EAAE,KACtB,OAAO,CAAC,IAAI,CA2Bd,CAAA;AAED,wBAAgB,kBAAkB,IAAI,YAAY,CAiBjD;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAe3D;AAED,wBAAsB,wBAAwB,CAC1C,MAAM,EAAE,GAAG,EACX,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,SAAS,EAAE,GACtB,OAAO,CAAC,IAAI,CAAC,CA8Bf;AAYD,wBAAgB,UAAU,CAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,MAAM,CAa7E"}
@@ -1,6 +1,6 @@
1
1
  import { loadSessionState } from "./persistence";
2
2
  import { isSubAgentSession } from "./utils";
3
- import { getLastUserMessage } from "../shared-utils";
3
+ import { getLastUserMessage, isMessageCompacted } from "../shared-utils";
4
4
  export const checkSession = async (client, state, logger, messages) => {
5
5
  const lastUserMessage = getLastUserMessage(messages);
6
6
  if (!lastUserMessage) {
@@ -23,6 +23,7 @@ export const checkSession = async (client, state, logger, messages) => {
23
23
  state.prune.toolIds = [];
24
24
  logger.info("Detected compaction from messages - cleared tool cache", { timestamp: lastCompactionTimestamp });
25
25
  }
26
+ state.currentTurn = countTurns(state, messages);
26
27
  };
27
28
  export function createSessionState() {
28
29
  return {
@@ -38,7 +39,8 @@ export function createSessionState() {
38
39
  toolParameters: new Map(),
39
40
  nudgeCounter: 0,
40
41
  lastToolPrune: false,
41
- lastCompaction: 0
42
+ lastCompaction: 0,
43
+ currentTurn: 0
42
44
  };
43
45
  }
44
46
  export function resetSessionState(state) {
@@ -55,6 +57,7 @@ export function resetSessionState(state) {
55
57
  state.nudgeCounter = 0;
56
58
  state.lastToolPrune = false;
57
59
  state.lastCompaction = 0;
60
+ state.currentTurn = 0;
58
61
  }
59
62
  export async function ensureSessionInitialized(client, state, sessionId, logger, messages) {
60
63
  if (state.sessionId === sessionId) {
@@ -68,6 +71,7 @@ export async function ensureSessionInitialized(client, state, sessionId, logger,
68
71
  state.isSubAgent = isSubAgent;
69
72
  logger.info("isSubAgent = " + isSubAgent);
70
73
  state.lastCompaction = findLastCompactionTimestamp(messages);
74
+ state.currentTurn = countTurns(state, messages);
71
75
  const persisted = await loadSessionState(sessionId, logger);
72
76
  if (persisted === null) {
73
77
  return;
@@ -89,4 +93,18 @@ function findLastCompactionTimestamp(messages) {
89
93
  }
90
94
  return 0;
91
95
  }
96
+ export function countTurns(state, messages) {
97
+ let turnCount = 0;
98
+ for (const msg of messages) {
99
+ if (isMessageCompacted(state, msg)) {
100
+ continue;
101
+ }
102
+ for (const part of msg.parts) {
103
+ if (part.type === "step-start") {
104
+ turnCount++;
105
+ }
106
+ }
107
+ }
108
+ return turnCount;
109
+ }
92
110
  //# sourceMappingURL=state.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"state.js","sourceRoot":"","sources":["../../../lib/state/state.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEpD,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAC7B,MAAW,EACX,KAAmB,EACnB,MAAc,EACd,QAAqB,EACR,EAAE;IAEf,MAAM,eAAe,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAA;IACpD,IAAI,CAAC,eAAe,EAAE,CAAC;QACnB,OAAM;IACV,CAAC;IAED,MAAM,aAAa,GAAG,eAAe,CAAC,IAAI,CAAC,SAAS,CAAA;IAEpD,IAAI,KAAK,CAAC,SAAS,KAAK,IAAI,IAAI,KAAK,CAAC,SAAS,KAAK,aAAa,EAAE,CAAC;QAChE,MAAM,CAAC,IAAI,CAAC,oBAAoB,KAAK,CAAC,SAAS,OAAO,aAAa,EAAE,CAAC,CAAA;QACtE,IAAI,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AE,YAAY,EAAc,SAAS,EAAE,MAAM,SAAS,CAAA;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAKxC;;GAEG;AACH,wBAAsB,aAAa,CAC/B,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,SAAS,EAAE,GACtB,OAAO,CAAC,IAAI,CAAC,CA6Cf;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAWjE"}
1
+ {"version":3,"file":"tool-cache.d.ts","sourceRoot":"","sources":["../../../lib/state/tool-cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAc,SAAS,EAAE,MAAM,SAAS,CAAA;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAKxC;;GAEG;AACH,wBAAsB,aAAa,CAC/B,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,SAAS,EAAE,GACtB,OAAO,CAAC,IAAI,CAAC,CA6Ef;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAWjE"}