@tarquinen/opencode-dcp 1.3.0-beta.1 → 1.3.1-beta.2

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 (164) hide show
  1. package/README.md +12 -11
  2. package/dist/index.js +13 -13
  3. package/dist/index.js.map +1 -1
  4. package/dist/lib/commands/context.d.ts.map +1 -1
  5. package/dist/lib/commands/context.js +36 -23
  6. package/dist/lib/commands/context.js.map +1 -1
  7. package/dist/lib/config.d.ts +7 -7
  8. package/dist/lib/config.d.ts.map +1 -1
  9. package/dist/lib/config.js +47 -46
  10. package/dist/lib/config.js.map +1 -1
  11. package/dist/lib/hooks.d.ts.map +1 -1
  12. package/dist/lib/hooks.js +8 -29
  13. package/dist/lib/hooks.js.map +1 -1
  14. package/dist/lib/messages/inject.d.ts +7 -0
  15. package/dist/lib/messages/inject.d.ts.map +1 -1
  16. package/dist/lib/messages/inject.js +67 -62
  17. package/dist/lib/messages/inject.js.map +1 -1
  18. package/dist/lib/messages/prune.js +7 -7
  19. package/dist/lib/messages/prune.js.map +1 -1
  20. package/dist/lib/messages/utils.d.ts +22 -2
  21. package/dist/lib/messages/utils.d.ts.map +1 -1
  22. package/dist/lib/messages/utils.js +46 -12
  23. package/dist/lib/messages/utils.js.map +1 -1
  24. package/dist/lib/prompts/compress-tool-spec.d.ts +2 -0
  25. package/dist/lib/prompts/compress-tool-spec.d.ts.map +1 -0
  26. package/dist/lib/prompts/compress-tool-spec.js +58 -0
  27. package/dist/lib/prompts/compress-tool-spec.js.map +1 -0
  28. package/dist/lib/prompts/distill-tool-spec.d.ts +2 -0
  29. package/dist/lib/prompts/distill-tool-spec.d.ts.map +1 -0
  30. package/dist/lib/prompts/distill-tool-spec.js +48 -0
  31. package/dist/lib/prompts/distill-tool-spec.js.map +1 -0
  32. package/dist/lib/prompts/index.d.ts +7 -0
  33. package/dist/lib/prompts/index.d.ts.map +1 -1
  34. package/dist/lib/prompts/index.js +28 -36
  35. package/dist/lib/prompts/index.js.map +1 -1
  36. package/dist/lib/prompts/nudge.generated.d.ts +2 -0
  37. package/dist/lib/prompts/nudge.generated.d.ts.map +1 -0
  38. package/dist/lib/prompts/nudge.generated.js +17 -0
  39. package/dist/lib/prompts/nudge.generated.js.map +1 -0
  40. package/dist/lib/prompts/prune-tool-spec.d.ts +2 -0
  41. package/dist/lib/prompts/prune-tool-spec.d.ts.map +1 -0
  42. package/dist/lib/prompts/prune-tool-spec.js +40 -0
  43. package/dist/lib/prompts/prune-tool-spec.js.map +1 -0
  44. package/dist/lib/prompts/system.generated.d.ts +2 -0
  45. package/dist/lib/prompts/system.generated.d.ts.map +1 -0
  46. package/dist/lib/prompts/system.generated.js +90 -0
  47. package/dist/lib/prompts/system.generated.js.map +1 -0
  48. package/dist/lib/state/persistence.d.ts +2 -2
  49. package/dist/lib/state/persistence.d.ts.map +1 -1
  50. package/dist/lib/state/persistence.js +1 -1
  51. package/dist/lib/state/persistence.js.map +1 -1
  52. package/dist/lib/state/state.js +3 -3
  53. package/dist/lib/state/state.js.map +1 -1
  54. package/dist/lib/state/tool-cache.d.ts.map +1 -1
  55. package/dist/lib/state/tool-cache.js +2 -5
  56. package/dist/lib/state/tool-cache.js.map +1 -1
  57. package/dist/lib/state/types.d.ts +2 -2
  58. package/dist/lib/state/types.d.ts.map +1 -1
  59. package/dist/lib/state/utils.js +1 -1
  60. package/dist/lib/state/utils.js.map +1 -1
  61. package/dist/lib/strategies/index.d.ts +1 -1
  62. package/dist/lib/strategies/index.d.ts.map +1 -1
  63. package/dist/lib/strategies/index.js +1 -1
  64. package/dist/lib/strategies/index.js.map +1 -1
  65. package/dist/lib/tools/compress.d.ts +4 -0
  66. package/dist/lib/tools/compress.d.ts.map +1 -0
  67. package/dist/lib/tools/{squash.js → compress.js} +22 -22
  68. package/dist/lib/tools/compress.js.map +1 -0
  69. package/dist/lib/tools/{discard.d.ts → distill.d.ts} +2 -2
  70. package/dist/lib/tools/distill.d.ts.map +1 -0
  71. package/dist/lib/tools/{extract.js → distill.js} +12 -7
  72. package/dist/lib/tools/{extract.js.map → distill.js.map} +1 -1
  73. package/dist/lib/tools/index.d.ts +3 -3
  74. package/dist/lib/tools/index.d.ts.map +1 -1
  75. package/dist/lib/tools/index.js +3 -3
  76. package/dist/lib/tools/index.js.map +1 -1
  77. package/dist/lib/tools/prune.d.ts +4 -0
  78. package/dist/lib/tools/prune.d.ts.map +1 -0
  79. package/dist/lib/tools/{discard.js → prune.js} +6 -6
  80. package/dist/lib/tools/prune.js.map +1 -0
  81. package/dist/lib/tools/utils.d.ts +3 -3
  82. package/dist/lib/tools/utils.d.ts.map +1 -1
  83. package/dist/lib/tools/utils.js +7 -7
  84. package/dist/lib/tools/utils.js.map +1 -1
  85. package/dist/lib/ui/notification.d.ts +1 -1
  86. package/dist/lib/ui/notification.d.ts.map +1 -1
  87. package/dist/lib/ui/notification.js +7 -7
  88. package/dist/lib/ui/notification.js.map +1 -1
  89. package/package.json +6 -4
  90. package/dist/lib/prompts/discard-tool-spec.d.ts +0 -2
  91. package/dist/lib/prompts/discard-tool-spec.d.ts.map +0 -1
  92. package/dist/lib/prompts/discard-tool-spec.js +0 -18
  93. package/dist/lib/prompts/discard-tool-spec.js.map +0 -1
  94. package/dist/lib/prompts/extract-tool-spec.d.ts +0 -2
  95. package/dist/lib/prompts/extract-tool-spec.d.ts.map +0 -1
  96. package/dist/lib/prompts/extract-tool-spec.js +0 -23
  97. package/dist/lib/prompts/extract-tool-spec.js.map +0 -1
  98. package/dist/lib/prompts/nudge/all.d.ts +0 -2
  99. package/dist/lib/prompts/nudge/all.d.ts.map +0 -1
  100. package/dist/lib/prompts/nudge/all.js +0 -9
  101. package/dist/lib/prompts/nudge/all.js.map +0 -1
  102. package/dist/lib/prompts/nudge/discard-extract.d.ts +0 -2
  103. package/dist/lib/prompts/nudge/discard-extract.d.ts.map +0 -1
  104. package/dist/lib/prompts/nudge/discard-extract.js +0 -8
  105. package/dist/lib/prompts/nudge/discard-extract.js.map +0 -1
  106. package/dist/lib/prompts/nudge/discard-squash.d.ts +0 -2
  107. package/dist/lib/prompts/nudge/discard-squash.d.ts.map +0 -1
  108. package/dist/lib/prompts/nudge/discard-squash.js +0 -8
  109. package/dist/lib/prompts/nudge/discard-squash.js.map +0 -1
  110. package/dist/lib/prompts/nudge/discard.d.ts +0 -2
  111. package/dist/lib/prompts/nudge/discard.d.ts.map +0 -1
  112. package/dist/lib/prompts/nudge/discard.js +0 -8
  113. package/dist/lib/prompts/nudge/discard.js.map +0 -1
  114. package/dist/lib/prompts/nudge/extract-squash.d.ts +0 -2
  115. package/dist/lib/prompts/nudge/extract-squash.d.ts.map +0 -1
  116. package/dist/lib/prompts/nudge/extract-squash.js +0 -8
  117. package/dist/lib/prompts/nudge/extract-squash.js.map +0 -1
  118. package/dist/lib/prompts/nudge/extract.d.ts +0 -2
  119. package/dist/lib/prompts/nudge/extract.d.ts.map +0 -1
  120. package/dist/lib/prompts/nudge/extract.js +0 -8
  121. package/dist/lib/prompts/nudge/extract.js.map +0 -1
  122. package/dist/lib/prompts/nudge/squash.d.ts +0 -2
  123. package/dist/lib/prompts/nudge/squash.d.ts.map +0 -1
  124. package/dist/lib/prompts/nudge/squash.js +0 -8
  125. package/dist/lib/prompts/nudge/squash.js.map +0 -1
  126. package/dist/lib/prompts/squash-tool-spec.d.ts +0 -2
  127. package/dist/lib/prompts/squash-tool-spec.d.ts.map +0 -1
  128. package/dist/lib/prompts/squash-tool-spec.js +0 -33
  129. package/dist/lib/prompts/squash-tool-spec.js.map +0 -1
  130. package/dist/lib/prompts/system/all.d.ts +0 -2
  131. package/dist/lib/prompts/system/all.d.ts.map +0 -1
  132. package/dist/lib/prompts/system/all.js +0 -26
  133. package/dist/lib/prompts/system/all.js.map +0 -1
  134. package/dist/lib/prompts/system/discard-extract.d.ts +0 -2
  135. package/dist/lib/prompts/system/discard-extract.d.ts.map +0 -1
  136. package/dist/lib/prompts/system/discard-extract.js +0 -26
  137. package/dist/lib/prompts/system/discard-extract.js.map +0 -1
  138. package/dist/lib/prompts/system/discard-squash.d.ts +0 -2
  139. package/dist/lib/prompts/system/discard-squash.d.ts.map +0 -1
  140. package/dist/lib/prompts/system/discard-squash.js +0 -25
  141. package/dist/lib/prompts/system/discard-squash.js.map +0 -1
  142. package/dist/lib/prompts/system/discard.d.ts +0 -2
  143. package/dist/lib/prompts/system/discard.d.ts.map +0 -1
  144. package/dist/lib/prompts/system/discard.js +0 -27
  145. package/dist/lib/prompts/system/discard.js.map +0 -1
  146. package/dist/lib/prompts/system/extract-squash.d.ts +0 -2
  147. package/dist/lib/prompts/system/extract-squash.d.ts.map +0 -1
  148. package/dist/lib/prompts/system/extract-squash.js +0 -25
  149. package/dist/lib/prompts/system/extract-squash.js.map +0 -1
  150. package/dist/lib/prompts/system/extract.d.ts +0 -2
  151. package/dist/lib/prompts/system/extract.d.ts.map +0 -1
  152. package/dist/lib/prompts/system/extract.js +0 -27
  153. package/dist/lib/prompts/system/extract.js.map +0 -1
  154. package/dist/lib/prompts/system/squash.d.ts +0 -2
  155. package/dist/lib/prompts/system/squash.d.ts.map +0 -1
  156. package/dist/lib/prompts/system/squash.js +0 -27
  157. package/dist/lib/prompts/system/squash.js.map +0 -1
  158. package/dist/lib/tools/discard.d.ts.map +0 -1
  159. package/dist/lib/tools/discard.js.map +0 -1
  160. package/dist/lib/tools/extract.d.ts +0 -4
  161. package/dist/lib/tools/extract.d.ts.map +0 -1
  162. package/dist/lib/tools/squash.d.ts +0 -4
  163. package/dist/lib/tools/squash.d.ts.map +0 -1
  164. package/dist/lib/tools/squash.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compress-tool-spec.js","sourceRoot":"","sources":["../../../lib/prompts/compress-tool-spec.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAwDlB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const DISTILL_TOOL_SPEC = "Distills key findings from tool outputs into preserved knowledge, then removes the raw outputs from context.\n\n## IMPORTANT: The Prunable List\nA `<prunable-tools>` list is provided to you showing available tool outputs you can distill 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 distill.\n\n## When to Use This Tool\n\nUse `distill` when you have individual tool outputs with valuable information you want to **preserve in distilled form** before removing the raw content:\n\n- **Large Outputs:** The raw output is too large but contains valuable technical details worth keeping.\n- **Knowledge Preservation:** You have context that contains valuable information (signatures, logic, constraints) but also a lot of unnecessary detail.\n\n## When NOT to Use This Tool\n\n- **If you need precise syntax:** If you'll edit a file or grep for exact strings, keep the raw output.\n- **If uncertain:** Prefer keeping over re-fetching.\n\n\n## Best Practices\n- **Strategic Batching:** Wait until you have several items or a few large outputs to distill, rather than doing tiny, frequent distillations. Aim for high-impact distillations that significantly reduce context size.\n- **Think ahead:** Before distilling, ask: \"Will I need the raw output for upcoming work?\" If you researched a file you'll later edit, do NOT distill it.\n\n## Format\n\n- `ids`: Array of numeric IDs as strings from the `<prunable-tools>` list\n- `distillation`: Array of strings, one per ID (positional: distillation[0] is for ids[0], etc.)\n\nEach distillation string should capture the essential information you need to preserve - function signatures, logic, constraints, values, etc. Be as detailed as needed.\n\n## Example\n\n<example_distillation>\nAssistant: [Reads auth service and user types]\nI'll preserve the key details before distilling.\n[Uses distill with:\n ids: [\"10\", \"11\"],\n distillation: [\n \"auth.ts: validateToken(token: string) -> User|null checks cache first (5min TTL) then OIDC. hashPassword uses bcrypt 12 rounds. Tokens must be 128+ chars.\",\n \"user.ts: interface User { id: string; email: string; permissions: ('read'|'write'|'admin')[]; status: 'active'|'suspended' }\"\n ]\n]\n</example_distillation>\n\n<example_keep>\nAssistant: [Reads 'auth.ts' to understand the login flow]\nI'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 distilling.\n</example_keep>";
2
+ //# sourceMappingURL=distill-tool-spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"distill-tool-spec.d.ts","sourceRoot":"","sources":["../../../lib/prompts/distill-tool-spec.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,glFA8Cd,CAAA"}
@@ -0,0 +1,48 @@
1
+ export const DISTILL_TOOL_SPEC = `Distills key findings from tool outputs into preserved knowledge, then removes the raw outputs from context.
2
+
3
+ ## IMPORTANT: The Prunable List
4
+ A \`<prunable-tools>\` list is provided to you showing available tool outputs you can distill 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 distill.
5
+
6
+ ## When to Use This Tool
7
+
8
+ Use \`distill\` when you have individual tool outputs with valuable information you want to **preserve in distilled form** before removing the raw content:
9
+
10
+ - **Large Outputs:** The raw output is too large but contains valuable technical details worth keeping.
11
+ - **Knowledge Preservation:** You have context that contains valuable information (signatures, logic, constraints) but also a lot of unnecessary detail.
12
+
13
+ ## When NOT to Use This Tool
14
+
15
+ - **If you need precise syntax:** If you'll edit a file or grep for exact strings, keep the raw output.
16
+ - **If uncertain:** Prefer keeping over re-fetching.
17
+
18
+
19
+ ## Best Practices
20
+ - **Strategic Batching:** Wait until you have several items or a few large outputs to distill, rather than doing tiny, frequent distillations. Aim for high-impact distillations that significantly reduce context size.
21
+ - **Think ahead:** Before distilling, ask: "Will I need the raw output for upcoming work?" If you researched a file you'll later edit, do NOT distill it.
22
+
23
+ ## Format
24
+
25
+ - \`ids\`: Array of numeric IDs as strings from the \`<prunable-tools>\` list
26
+ - \`distillation\`: Array of strings, one per ID (positional: distillation[0] is for ids[0], etc.)
27
+
28
+ Each distillation string should capture the essential information you need to preserve - function signatures, logic, constraints, values, etc. Be as detailed as needed.
29
+
30
+ ## Example
31
+
32
+ <example_distillation>
33
+ Assistant: [Reads auth service and user types]
34
+ I'll preserve the key details before distilling.
35
+ [Uses distill with:
36
+ ids: ["10", "11"],
37
+ distillation: [
38
+ "auth.ts: validateToken(token: string) -> User|null checks cache first (5min TTL) then OIDC. hashPassword uses bcrypt 12 rounds. Tokens must be 128+ chars.",
39
+ "user.ts: interface User { id: string; email: string; permissions: ('read'|'write'|'admin')[]; status: 'active'|'suspended' }"
40
+ ]
41
+ ]
42
+ </example_distillation>
43
+
44
+ <example_keep>
45
+ Assistant: [Reads 'auth.ts' to understand the login flow]
46
+ 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 distilling.
47
+ </example_keep>`;
48
+ //# sourceMappingURL=distill-tool-spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"distill-tool-spec.js","sourceRoot":"","sources":["../../../lib/prompts/distill-tool-spec.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA8CjB,CAAA"}
@@ -1,2 +1,9 @@
1
+ export interface ToolFlags {
2
+ distill: boolean;
3
+ compress: boolean;
4
+ prune: boolean;
5
+ }
6
+ export declare function renderSystemPrompt(flags: ToolFlags): string;
7
+ export declare function renderNudge(flags: ToolFlags): string;
1
8
  export declare function loadPrompt(name: string, vars?: Record<string, string>): string;
2
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/prompts/index.ts"],"names":[],"mappings":"AA2CA,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAW9E"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/prompts/index.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,SAAS;IACtB,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,OAAO,CAAA;IACjB,KAAK,EAAE,OAAO,CAAA;CACjB;AAgBD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAE3D;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAEpD;AAQD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAW9E"}
@@ -1,41 +1,33 @@
1
1
  // Tool specs
2
- import { DISCARD_TOOL_SPEC } from "./discard-tool-spec";
3
- import { EXTRACT_TOOL_SPEC } from "./extract-tool-spec";
4
- import { SQUASH_TOOL_SPEC } from "./squash-tool-spec";
5
- // System prompts
6
- import { SYSTEM_PROMPT_DISCARD } from "./system/discard";
7
- import { SYSTEM_PROMPT_EXTRACT } from "./system/extract";
8
- import { SYSTEM_PROMPT_SQUASH } from "./system/squash";
9
- import { SYSTEM_PROMPT_DISCARD_EXTRACT } from "./system/discard-extract";
10
- import { SYSTEM_PROMPT_DISCARD_SQUASH } from "./system/discard-squash";
11
- import { SYSTEM_PROMPT_EXTRACT_SQUASH } from "./system/extract-squash";
12
- import { SYSTEM_PROMPT_ALL } from "./system/all";
13
- // Nudge prompts
14
- import { NUDGE_DISCARD } from "./nudge/discard";
15
- import { NUDGE_EXTRACT } from "./nudge/extract";
16
- import { NUDGE_SQUASH } from "./nudge/squash";
17
- import { NUDGE_DISCARD_EXTRACT } from "./nudge/discard-extract";
18
- import { NUDGE_DISCARD_SQUASH } from "./nudge/discard-squash";
19
- import { NUDGE_EXTRACT_SQUASH } from "./nudge/extract-squash";
20
- import { NUDGE_ALL } from "./nudge/all";
2
+ import { PRUNE_TOOL_SPEC } from "./prune-tool-spec";
3
+ import { DISTILL_TOOL_SPEC } from "./distill-tool-spec";
4
+ import { COMPRESS_TOOL_SPEC } from "./compress-tool-spec";
5
+ // Generated prompts (from .md files via scripts/generate-prompts.ts)
6
+ import { SYSTEM as SYSTEM_PROMPT } from "./system.generated";
7
+ import { NUDGE } from "./nudge.generated";
8
+ function processConditionals(template, flags) {
9
+ const tools = ["distill", "compress", "prune"];
10
+ let result = template;
11
+ // Strip comments: // ... //
12
+ result = result.replace(/\/\/.*?\/\//g, "");
13
+ // Process tool conditionals
14
+ for (const tool of tools) {
15
+ const regex = new RegExp(`<${tool}>([\\s\\S]*?)</${tool}>`, "g");
16
+ result = result.replace(regex, (_, content) => (flags[tool] ? content : ""));
17
+ }
18
+ // Collapse multiple blank/whitespace-only lines to single blank line
19
+ return result.replace(/\n([ \t]*\n)+/g, "\n\n").trim();
20
+ }
21
+ export function renderSystemPrompt(flags) {
22
+ return processConditionals(SYSTEM_PROMPT, flags);
23
+ }
24
+ export function renderNudge(flags) {
25
+ return processConditionals(NUDGE, flags);
26
+ }
21
27
  const PROMPTS = {
22
- "discard-tool-spec": DISCARD_TOOL_SPEC,
23
- "extract-tool-spec": EXTRACT_TOOL_SPEC,
24
- "squash-tool-spec": SQUASH_TOOL_SPEC,
25
- "system/system-prompt-discard": SYSTEM_PROMPT_DISCARD,
26
- "system/system-prompt-extract": SYSTEM_PROMPT_EXTRACT,
27
- "system/system-prompt-squash": SYSTEM_PROMPT_SQUASH,
28
- "system/system-prompt-discard-extract": SYSTEM_PROMPT_DISCARD_EXTRACT,
29
- "system/system-prompt-discard-squash": SYSTEM_PROMPT_DISCARD_SQUASH,
30
- "system/system-prompt-extract-squash": SYSTEM_PROMPT_EXTRACT_SQUASH,
31
- "system/system-prompt-all": SYSTEM_PROMPT_ALL,
32
- "nudge/nudge-discard": NUDGE_DISCARD,
33
- "nudge/nudge-extract": NUDGE_EXTRACT,
34
- "nudge/nudge-squash": NUDGE_SQUASH,
35
- "nudge/nudge-discard-extract": NUDGE_DISCARD_EXTRACT,
36
- "nudge/nudge-discard-squash": NUDGE_DISCARD_SQUASH,
37
- "nudge/nudge-extract-squash": NUDGE_EXTRACT_SQUASH,
38
- "nudge/nudge-all": NUDGE_ALL,
28
+ "prune-tool-spec": PRUNE_TOOL_SPEC,
29
+ "distill-tool-spec": DISTILL_TOOL_SPEC,
30
+ "compress-tool-spec": COMPRESS_TOOL_SPEC,
39
31
  };
40
32
  export function loadPrompt(name, vars) {
41
33
  let content = PROMPTS[name];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/prompts/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,iBAAiB;AACjB,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAA;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhD,gBAAgB;AAChB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,MAAM,OAAO,GAA2B;IACpC,mBAAmB,EAAE,iBAAiB;IACtC,mBAAmB,EAAE,iBA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O,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3B,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,EAAE,CAAC,CAAA;IAChD,CAAC;IACD,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"}
@@ -0,0 +1,2 @@
1
+ export declare const NUDGE = "<instruction name=context_management_required>\nCRITICAL CONTEXT WARNING\nYour context window is filling with tool. Strict adherence to context hygiene is required.\n\nPROTOCOL\nYou should prioritize context management, but do not interrupt a critical atomic operation if one is in progress. Once the immediate step is done, you must perform context management.\n\nIMMEDIATE ACTION REQUIRED\n<distill>KNOWLEDGE PRESERVATION: If holding valuable raw data you POTENTIALLY will need in your task, use the `distill` tool. Produce a high-fidelity distillation to preserve insights - be thorough</distill>\n<prune>NOISE REMOVAL: If you read files or ran commands that yielded no value, use the `prune` tool to remove them. If newer tools supersedes older ones, prune the old</prune>\n<compress>PHASE COMPLETION: If a phase is complete, use the `compress` tool to condense the entire sequence into a detailed summary</compress>\n</instruction>\n";
2
+ //# sourceMappingURL=nudge.generated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nudge.generated.d.ts","sourceRoot":"","sources":["../../../lib/prompts/nudge.generated.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,KAAK,+6BAYjB,CAAA"}
@@ -0,0 +1,17 @@
1
+ // AUTO-GENERATED FILE - DO NOT EDIT
2
+ // Generated from nudge.md by scripts/generate-prompts.ts
3
+ // To modify, edit nudge.md and run `npm run generate:prompts`
4
+ export const NUDGE = `<instruction name=context_management_required>
5
+ CRITICAL CONTEXT WARNING
6
+ Your context window is filling with tool. Strict adherence to context hygiene is required.
7
+
8
+ PROTOCOL
9
+ You should prioritize context management, 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
+
11
+ IMMEDIATE ACTION REQUIRED
12
+ <distill>KNOWLEDGE PRESERVATION: If holding valuable raw data you POTENTIALLY will need in your task, use the \`distill\` tool. Produce a high-fidelity distillation to preserve insights - be thorough</distill>
13
+ <prune>NOISE REMOVAL: If you read files or ran commands that yielded no value, use the \`prune\` tool to remove them. If newer tools supersedes older ones, prune the old</prune>
14
+ <compress>PHASE COMPLETION: If a phase is complete, use the \`compress\` tool to condense the entire sequence into a detailed summary</compress>
15
+ </instruction>
16
+ `;
17
+ //# sourceMappingURL=nudge.generated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nudge.generated.js","sourceRoot":"","sources":["../../../lib/prompts/nudge.generated.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,yDAAyD;AACzD,8DAA8D;AAE9D,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;CAYpB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const PRUNE_TOOL_SPEC = "Prunes tool outputs from context to manage conversation size and reduce noise.\n\n## IMPORTANT: The Prunable List\nA `<prunable-tools>` list is provided to you showing available tool outputs you can prune 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 prune.\n\n## When to Use This Tool\n\nUse `prune` for removing individual tool outputs that are no longer needed:\n\n- **Noise:** Irrelevant, unhelpful, or superseded outputs that provide no value.\n- **Wrong Files:** You read or accessed something that turned out to be irrelevant.\n- **Outdated Info:** Outputs that have been superseded by newer information.\n\n## When NOT to Use This Tool\n\n- **If the output contains useful information:** Keep it in context rather than pruning.\n- **If you'll need the output later:** Don't prune files you plan to edit or context you'll need for implementation.\n\n## Best Practices\n- **Strategic Batching:** Don't prune single small tool outputs (like short bash commands) unless they are pure noise. Wait until you have several items to perform high-impact prunes.\n- **Think ahead:** Before pruning, ask: \"Will I need this output for upcoming work?\" If yes, keep it.\n\n## Format\n\n- `ids`: Array of numeric IDs as strings from the `<prunable-tools>` list\n\n## Example\n\n<example_noise>\nAssistant: [Reads 'wrong_file.ts']\nThis file isn't relevant to the auth system. I'll remove it to clear the context.\n[Uses prune with ids: [\"5\"]]\n</example_noise>\n\n<example_superseded>\nAssistant: [Reads config.ts, then reads updated config.ts after changes]\nThe first read is now outdated. I'll prune it and keep the updated version.\n[Uses prune with ids: [\"20\"]]\n</example_superseded>";
2
+ //# sourceMappingURL=prune-tool-spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prune-tool-spec.d.ts","sourceRoot":"","sources":["../../../lib/prompts/prune-tool-spec.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,+zDAsCN,CAAA"}
@@ -0,0 +1,40 @@
1
+ export const PRUNE_TOOL_SPEC = `Prunes tool outputs from context to manage conversation size and reduce noise.
2
+
3
+ ## IMPORTANT: The Prunable List
4
+ A \`<prunable-tools>\` list is provided to you showing available tool outputs you can prune 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 prune.
5
+
6
+ ## When to Use This Tool
7
+
8
+ Use \`prune\` for removing individual tool outputs that are no longer needed:
9
+
10
+ - **Noise:** Irrelevant, unhelpful, or superseded outputs that provide no value.
11
+ - **Wrong Files:** You read or accessed something that turned out to be irrelevant.
12
+ - **Outdated Info:** Outputs that have been superseded by newer information.
13
+
14
+ ## When NOT to Use This Tool
15
+
16
+ - **If the output contains useful information:** Keep it in context rather than pruning.
17
+ - **If you'll need the output later:** Don't prune files you plan to edit or context you'll need for implementation.
18
+
19
+ ## Best Practices
20
+ - **Strategic Batching:** Don't prune single small tool outputs (like short bash commands) unless they are pure noise. Wait until you have several items to perform high-impact prunes.
21
+ - **Think ahead:** Before pruning, ask: "Will I need this output for upcoming work?" If yes, keep it.
22
+
23
+ ## Format
24
+
25
+ - \`ids\`: Array of numeric IDs as strings from the \`<prunable-tools>\` list
26
+
27
+ ## Example
28
+
29
+ <example_noise>
30
+ Assistant: [Reads 'wrong_file.ts']
31
+ This file isn't relevant to the auth system. I'll remove it to clear the context.
32
+ [Uses prune with ids: ["5"]]
33
+ </example_noise>
34
+
35
+ <example_superseded>
36
+ Assistant: [Reads config.ts, then reads updated config.ts after changes]
37
+ The first read is now outdated. I'll prune it and keep the updated version.
38
+ [Uses prune with ids: ["20"]]
39
+ </example_superseded>`;
40
+ //# sourceMappingURL=prune-tool-spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prune-tool-spec.js","sourceRoot":"","sources":["../../../lib/prompts/prune-tool-spec.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAsCT,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const SYSTEM = "<system-reminder>\n<instruction name=context_management_protocol policy_level=critical>\n\nENVIRONMENT\nYou are operating in a context-constrained environment and must proactively manage your context window. The environment calls the `context_info` tool to provide an up-to-date <prunable-tools> list after each turn. Use this information when deciding what to prune.\n\nIMPORTANT: The `context_info` tool is only available to the environment - you do not have access to it and must not attempt to call it.\n\nAVAILABLE TOOLS\n<prune>`prune`: Remove individual tool outputs that are noise, irrelevant, or superseded. No preservation of content.</prune>\n<distill>`distill`: Distill key findings from individual tool outputs into preserved knowledge. Use when you need to preserve valuable technical details.</distill>\n<compress>`compress`: Collapse a contiguous range of conversation (completed phases) into a single summary.</compress>\n\nPRUNE METHODICALLY - BATCH YOUR ACTIONS\nEvery 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.\n\nYou MUST NOT prune when:\n\n- The tool output will be needed for upcoming implementation work\n- The output contains files or context you'll need to reference when making edits\n\nPruning 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.\n\n<prune>\nWHEN TO PRUNE\n- **Noise Removal:** Outputs that are irrelevant, unhelpful, or superseded by newer info.\n- **Wrong Files:** You read or accessed something that turned out to be irrelevant to the current work.\n- **Outdated Info:** Outputs that have been superseded by newer information.\n\nYou WILL evaluate pruning when ANY of these are true:\n\nYou accessed something that turned out to be irrelevant\nInformation has been superseded by newer outputs\nYou are about to start a new phase of work\n</prune>\n\n<distill>\nWHEN TO DISTILL\n**Large Outputs:** The raw output is too large but contains valuable technical details worth keeping.\n**Knowledge Preservation:** Valuable context you want to preserve but need to reduce size. 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.\n\nYou WILL evaluate distilling when ANY of these are true:\n\n- You have large tool outputs with valuable technical details\n- You need to preserve specific information but reduce context size\n- You are about to start a new phase of work and want to retain key insights\n </distill>\n <compress>\n WHEN TO COMPRESS\n- **Phase Completion:** When a phase is complete, condense the entire sequence (research, tool calls, implementation) into a summary.\n- **Exploration Done:** When you've explored multiple files or ran multiple commands and only need a summary of findings.\n\nYou WILL evaluate compressing when ANY of these are true:\n\n- Phase is complete\n- You are about to start a new phase of work\n- Significant conversation has accumulated that can be summarized\n </compress>\n\nNOTES\nWhen in doubt, KEEP IT.\n// **\uD83E\uDC47 idk about that one \uD83E\uDC47** //\nBatch your actions and aim for high-impact prunes that significantly reduce context size.\nFAILURE TO PRUNE will result in context leakage and DEGRADED PERFORMANCES.\nIf no <prunable-tools> list is present in context, do NOT TRY TO PRUNE ANYTHING as it will fail and waste resources.\nThere 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>.\n\n</instruction>\n\n<instruction name=injected_context_handling policy_level=critical>\nAfter each turn, the environment injects a synthetic message containing a <prunable-tools> list and optional nudge instruction. You do not have access to this mechanism.\n\nCRITICAL REQUIREMENTS - VIOLATION IS UNACCEPTABLE:\n\n- NEVER reference the prune encouragement or context management instructions. Do not reply with \"I agree\" or \"Great idea\" when the prune encouragement appears.\n- NEVER acknowledge the <prunable-tools> list (e.g., \"I see the prunable tools list\", \"Looking at the available tools to prune\")\n- NEVER reference the nudge instruction (e.g., \"As the nudge suggests\", \"The system is reminding me to prune\")\n- NEVER acknowledge context management tool output (e.g., \"I've pruned 3 tools\", \"Context cleanup complete\")\n- NEVER let these injections influence your response content or tone\n- Process this information SILENTLY and continue the conversation naturally\n- Continue the conversation as if these messages do not exist\n\nThe user cannot see these injections. Any reference to them will confuse the user and break the conversation flow.\n</instruction>\n</system-reminder>\n";
2
+ //# sourceMappingURL=system.generated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"system.generated.d.ts","sourceRoot":"","sources":["../../../lib/prompts/system.generated.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM,09JAqFlB,CAAA"}
@@ -0,0 +1,90 @@
1
+ // AUTO-GENERATED FILE - DO NOT EDIT
2
+ // Generated from system.md by scripts/generate-prompts.ts
3
+ // To modify, edit system.md and run `npm run generate:prompts`
4
+ export const SYSTEM = `<system-reminder>
5
+ <instruction name=context_management_protocol policy_level=critical>
6
+
7
+ ENVIRONMENT
8
+ You are operating in a context-constrained environment and must proactively manage your context window. The environment calls the \`context_info\` tool to provide an up-to-date <prunable-tools> list after each turn. Use this information when deciding what to prune.
9
+
10
+ IMPORTANT: The \`context_info\` tool is only available to the environment - you do not have access to it and must not attempt to call it.
11
+
12
+ AVAILABLE TOOLS
13
+ <prune>\`prune\`: Remove individual tool outputs that are noise, irrelevant, or superseded. No preservation of content.</prune>
14
+ <distill>\`distill\`: Distill key findings from individual tool outputs into preserved knowledge. Use when you need to preserve valuable technical details.</distill>
15
+ <compress>\`compress\`: Collapse a contiguous range of conversation (completed phases) into a single summary.</compress>
16
+
17
+ PRUNE METHODICALLY - BATCH YOUR ACTIONS
18
+ 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.
19
+
20
+ You MUST NOT prune when:
21
+
22
+ - The tool output will be needed for upcoming implementation work
23
+ - The output contains files or context you'll need to reference when making edits
24
+
25
+ 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.
26
+
27
+ <prune>
28
+ WHEN TO PRUNE
29
+ - **Noise Removal:** Outputs that are irrelevant, unhelpful, or superseded by newer info.
30
+ - **Wrong Files:** You read or accessed something that turned out to be irrelevant to the current work.
31
+ - **Outdated Info:** Outputs that have been superseded by newer information.
32
+
33
+ You WILL evaluate pruning when ANY of these are true:
34
+
35
+ You accessed something that turned out to be irrelevant
36
+ Information has been superseded by newer outputs
37
+ You are about to start a new phase of work
38
+ </prune>
39
+
40
+ <distill>
41
+ WHEN TO DISTILL
42
+ **Large Outputs:** The raw output is too large but contains valuable technical details worth keeping.
43
+ **Knowledge Preservation:** Valuable context you want to preserve but need to reduce size. 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.
44
+
45
+ You WILL evaluate distilling when ANY of these are true:
46
+
47
+ - You have large tool outputs with valuable technical details
48
+ - You need to preserve specific information but reduce context size
49
+ - You are about to start a new phase of work and want to retain key insights
50
+ </distill>
51
+ <compress>
52
+ WHEN TO COMPRESS
53
+ - **Phase Completion:** When a phase is complete, condense the entire sequence (research, tool calls, implementation) into a summary.
54
+ - **Exploration Done:** When you've explored multiple files or ran multiple commands and only need a summary of findings.
55
+
56
+ You WILL evaluate compressing when ANY of these are true:
57
+
58
+ - Phase is complete
59
+ - You are about to start a new phase of work
60
+ - Significant conversation has accumulated that can be summarized
61
+ </compress>
62
+
63
+ NOTES
64
+ When in doubt, KEEP IT.
65
+ // **🡇 idk about that one 🡇** //
66
+ Batch your actions and aim for high-impact prunes that significantly reduce context size.
67
+ FAILURE TO PRUNE will result in context leakage and DEGRADED PERFORMANCES.
68
+ If no <prunable-tools> list is present in context, do NOT TRY TO PRUNE ANYTHING as it will fail and waste resources.
69
+ 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>.
70
+
71
+ </instruction>
72
+
73
+ <instruction name=injected_context_handling policy_level=critical>
74
+ After each turn, the environment injects a synthetic message containing a <prunable-tools> list and optional nudge instruction. You do not have access to this mechanism.
75
+
76
+ CRITICAL REQUIREMENTS - VIOLATION IS UNACCEPTABLE:
77
+
78
+ - NEVER reference the prune encouragement or context management instructions. Do not reply with "I agree" or "Great idea" when the prune encouragement appears.
79
+ - NEVER acknowledge the <prunable-tools> list (e.g., "I see the prunable tools list", "Looking at the available tools to prune")
80
+ - NEVER reference the nudge instruction (e.g., "As the nudge suggests", "The system is reminding me to prune")
81
+ - NEVER acknowledge context management tool output (e.g., "I've pruned 3 tools", "Context cleanup complete")
82
+ - NEVER let these injections influence your response content or tone
83
+ - Process this information SILENTLY and continue the conversation naturally
84
+ - Continue the conversation as if these messages do not exist
85
+
86
+ The user cannot see these injections. Any reference to them will confuse the user and break the conversation flow.
87
+ </instruction>
88
+ </system-reminder>
89
+ `;
90
+ //# sourceMappingURL=system.generated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"system.generated.js","sourceRoot":"","sources":["../../../lib/prompts/system.generated.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,0DAA0D;AAC1D,+DAA+D;AAE/D,MAAM,CAAC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqFrB,CAAA"}
@@ -3,12 +3,12 @@
3
3
  * Persists pruned tool IDs across sessions so they survive OpenCode restarts.
4
4
  * Storage location: ~/.local/share/opencode/storage/plugin/dcp/{sessionId}.json
5
5
  */
6
- import type { SessionState, SessionStats, Prune, SquashSummary } from "./types";
6
+ import type { SessionState, SessionStats, Prune, CompressSummary } from "./types";
7
7
  import type { Logger } from "../logger";
8
8
  export interface PersistedSessionState {
9
9
  sessionName?: string;
10
10
  prune: Prune;
11
- squashSummaries: SquashSummary[];
11
+ compressSummaries: CompressSummary[];
12
12
  stats: SessionStats;
13
13
  lastUpdated: string;
14
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"persistence.d.ts","sourceRoot":"","sources":["../../../lib/state/persistence.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAC/E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAEvC,MAAM,WAAW,qBAAqB;IAClC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,KAAK,CAAA;IACZ,eAAe,EAAE,aAAa,EAAE,CAAA;IAChC,KAAK,EAAE,YAAY,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;CACtB;AAcD,wBAAsB,gBAAgB,CAClC,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,MAAM,EACd,WAAW,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC,CA8Bf;AAED,wBAAsB,gBAAgB,CAClC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACf,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CA8BvC;AAED,MAAM,WAAW,eAAe;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;CACvB;AAED,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAqClF"}
1
+ {"version":3,"file":"persistence.d.ts","sourceRoot":"","sources":["../../../lib/state/persistence.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACjF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAEvC,MAAM,WAAW,qBAAqB;IAClC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,KAAK,CAAA;IACZ,iBAAiB,EAAE,eAAe,EAAE,CAAA;IACpC,KAAK,EAAE,YAAY,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;CACtB;AAcD,wBAAsB,gBAAgB,CAClC,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,MAAM,EACd,WAAW,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC,CA8Bf;AAED,wBAAsB,gBAAgB,CAClC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACf,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CA8BvC;AAED,MAAM,WAAW,eAAe;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;CACvB;AAED,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAqClF"}
@@ -25,7 +25,7 @@ export async function saveSessionState(sessionState, logger, sessionName) {
25
25
  const state = {
26
26
  sessionName: sessionName,
27
27
  prune: sessionState.prune,
28
- squashSummaries: sessionState.squashSummaries,
28
+ compressSummaries: sessionState.compressSummaries,
29
29
  stats: sessionState.stats,
30
30
  lastUpdated: new Date().toISOString(),
31
31
  };
@@ -1 +1 @@
1
- {"version":3,"file":"persistence.js","sourceRoot":"","sources":["../../../lib/state/persistence.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE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CAAC,KAAK,CAAC,OAAO,CAA0B,CAAA;gBAE1D,IAAI,KAAK,EAAE,KAAK,EAAE,gBAAgB,IAAI,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;oBAC1D,MAAM,CAAC,WAAW,IAAI,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAA;oBAClD,MAAM,CAAC,UAAU,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAA;oBAC/C,MAAM,CAAC,YAAY,EAAE,CAAA;gBACzB,CAAC;YACL,CAAC;YAAC,MAAM,CAAC;gBACL,qBAAqB;YACzB,CAAC;QACL,CAAC;QAED,MAAM,CAAC,KAAK,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAA;IACjD,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QAClB,MAAM,CAAC,IAAI,CAAC,+BAA+B,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAA;IAC3E,CAAC;IAED,OAAO,MAAM,CAAA;AACjB,CAAC"}
@@ -34,7 +34,7 @@ export function createSessionState() {
34
34
  toolIds: [],
35
35
  messageIds: [],
36
36
  },
37
- squashSummaries: [],
37
+ compressSummaries: [],
38
38
  stats: {
39
39
  pruneTokenCounter: 0,
40
40
  totalPruneTokens: 0,
@@ -54,7 +54,7 @@ export function resetSessionState(state) {
54
54
  toolIds: [],
55
55
  messageIds: [],
56
56
  };
57
- state.squashSummaries = [];
57
+ state.compressSummaries = [];
58
58
  state.stats = {
59
59
  pruneTokenCounter: 0,
60
60
  totalPruneTokens: 0,
@@ -87,7 +87,7 @@ export async function ensureSessionInitialized(client, state, sessionId, logger,
87
87
  toolIds: persisted.prune.toolIds || [],
88
88
  messageIds: persisted.prune.messageIds || [],
89
89
  };
90
- state.squashSummaries = persisted.squashSummaries || [];
90
+ state.compressSummaries = persisted.compressSummaries || [];
91
91
  state.stats = {
92
92
  pruneTokenCounter: persisted.stats?.pruneTokenCounter || 0,
93
93
  totalPruneTokens: persisted.stats?.totalPruneTokens || 0,
@@ -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,EACH,iBAAiB,EACjB,2BAA2B,EAC3B,UAAU,EACV,iBAAiB,GACpB,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEpD,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAC7B,MAAW,EACX,KAAmB,EACnB,MAAc,EACd,QAAqB,EACR,EAAE;IACf,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,CAAC;YACD,MAAM,wBAAwB,CAAC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAA;QAClF,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAChB,MAAM,CAAC,KAAK,CAAC,oCAAoC,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAA;QAC9E,CAAC;IACL,CAAC;IAED,MAAM,uBAAuB,GAAG,2BAA2B,CAAC,QAAQ,CAAC,CAAA;IACrE,IAAI,uBAAuB,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC;QACjD,KAAK,CAAC,cAAc,GAAG,uBAAuB,CAAA;QAC9C,iBAAiB,CAAC,KAAK,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QAC1D,gBAAgB,EAAE,SAAS,CAAC,KAAK,EAAE,gBAAgB,IAAI,CAAC;KAC3D,CAAA;AACL,CAAC"}
@@ -1 +1 @@
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,CAwEf;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAajE"}
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,CAqEf;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAajE"}
@@ -27,12 +27,9 @@ export async function syncToolCache(state, config, logger, messages) {
27
27
  turnProtectionTurns > 0 &&
28
28
  state.currentTurn - turnCounter < turnProtectionTurns;
29
29
  state.lastToolPrune =
30
- (part.tool === "discard" ||
31
- part.tool === "extract" ||
32
- part.tool === "squash") &&
33
- part.state.status === "completed";
30
+ part.tool === "distill" || part.tool === "compress" || part.tool === "prune";
34
31
  const allProtectedTools = config.tools.settings.protectedTools;
35
- if (part.tool === "discard" || part.tool === "extract" || part.tool === "squash") {
32
+ if (part.tool === "distill" || part.tool === "compress" || part.tool === "prune") {
36
33
  state.nudgeCounter = 0;
37
34
  }
38
35
  else if (!allProtectedTools.includes(part.tool) && !isProtectedByTurn) {
@@ -1 +1 @@
1
- {"version":3,"file":"tool-cache.js","sourceRoot":"","sources":["../../../lib/state/tool-cache.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEpD,MAAM,mBAAmB,GAAG,IAAI,CAAA;AAEhC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAC/B,KAAmB,EACnB,MAAoB,EACpB,MAAc,EACd,QAAqB;IAErB,IAAI,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAA;QAE7D,KAAK,CAAC,YAAY,GAAG,CAAC,CAAA;QACtB,IAAI,WAAW,GAAG,CAAC,CAAA;QAEnB,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;YACzB,IAAI,kBAAkB,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC;gBACjC,SAAQ;YACZ,CAAC;YAED,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;YACvD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;gBACvB,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;oBAC7B,WAAW,EAAE,CAAA;oBACb,SAAQ;gBACZ,CAAC;gBAED,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,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AC;QAED,MAAM,CAAC,IAAI,CACP,wBAAwB,KAAK,CAAC,cAAc,CAAC,IAAI,kBAAkB,KAAK,CAAC,WAAW,mBAAmB,KAAK,CAAC,YAAY,EAAE,CAC9H,CAAA;QACD,uBAAuB,CAAC,KAAK,CAAC,CAAA;IAClC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,MAAM,CAAC,IAAI,CAAC,8CAA8C,EAAE;YACxD,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;SAChE,CAAC,CAAA;IACN,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAmB;IACvD,IAAI,KAAK,CAAC,cAAc,CAAC,IAAI,IAAI,mBAAmB,EAAE,CAAC;QACnD,OAAM;IACV,CAAC;IAED,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAC9D,CAAC,EACD,KAAK,CAAC,cAAc,CAAC,IAAI,GAAG,mBAAmB,CAClD,CAAA;IAED,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;QAC7B,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IACpC,CAAC;AACL,CAAC"}
@@ -15,7 +15,7 @@ export interface SessionStats {
15
15
  pruneTokenCounter: number;
16
16
  totalPruneTokens: number;
17
17
  }
18
- export interface SquashSummary {
18
+ export interface CompressSummary {
19
19
  anchorMessageId: string;
20
20
  summary: string;
21
21
  }
@@ -27,7 +27,7 @@ export interface SessionState {
27
27
  sessionId: string | null;
28
28
  isSubAgent: boolean;
29
29
  prune: Prune;
30
- squashSummaries: SquashSummary[];
30
+ compressSummaries: CompressSummary[];
31
31
  stats: SessionStats;
32
32
  toolParameters: Map<string, ToolParameterEntry>;
33
33
  nudgeCounter: number;
@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resetOnCompaction(state) {
36
36
  state.toolParameters.clear();
37
37
  state.prune.toolIds = [];
38
38
  state.prune.messageIds = [];
39
- state.squashSummaries = [];
39
+ state.compressSummaries = [];
40
40
  state.nudgeCounter = 0;
41
41
  state.lastToolPrune = false;
42
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../lib/state/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEpD,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,MAAW,EAAE,SAAiB;IAClE,IAAI,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,CAAA;QACpE,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAA;IAClC,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QAClB,OAAO,KAAK,CAAA;IAChB,CAAC;AACL,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,QAAqB;IAC7D,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5C,MAAM,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;QACvB,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,IAAI,GAAG,CAAC,IAAI,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;YAC7D,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAA;QAChC,CAAC;IACL,CAAC;IACD,OAAO,CAAC,CAAA;AACZ,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,KAAmB,EAAE,QAAqB;IACjE,IAAI,SAAS,GAAG,CAAC,CAAA;IACjB,KAAK,MAAM,GAAG,IAAI,QA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C3B,KAAK,CAAC,iBAAiB,GAAG,EAAE,CAAA;IAC5B,KAAK,CAAC,YAAY,GAAG,CAAC,CAAA;IACtB,KAAK,CAAC,aAAa,GAAG,KAAK,CAAA;AAC/B,CAAC"}
@@ -1,5 +1,5 @@
1
1
  export { deduplicate } from "./deduplication";
2
- export { createDiscardTool, createExtractTool, createSquashTool } from "../tools";
2
+ export { createPruneTool, createDistillTool, createCompressTool } from "../tools";
3
3
  export { supersedeWrites } from "./supersede-writes";
4
4
  export { purgeErrors } from "./purge-errors";
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/strategies/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/strategies/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA"}
@@ -1,5 +1,5 @@
1
1
  export { deduplicate } from "./deduplication";
2
- export { createDiscardTool, createExtractTool, createSquashTool } from "../tools";
2
+ export { createPruneTool, createDistillTool, createCompressTool } from "../tools";
3
3
  export { supersedeWrites } from "./supersede-writes";
4
4
  export { purgeErrors } from "./purge-errors";
5
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/strategies/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/strategies/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { tool } from "@opencode-ai/plugin";
2
+ import type { PruneToolContext } from "./types";
3
+ export declare function createCompressTool(ctx: PruneToolContext): ReturnType<typeof tool>;
4
+ //# sourceMappingURL=compress.d.ts.map