@tarquinen/opencode-dcp 1.3.3-beta.0 → 1.4.0-beta.0
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.
- package/LICENSE +619 -21
- package/README.md +15 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/commands/sweep.js +6 -6
- package/dist/lib/commands/sweep.js.map +1 -1
- package/dist/lib/config.d.ts +2 -1
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +32 -19
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/hooks.d.ts +8 -1
- package/dist/lib/hooks.d.ts.map +1 -1
- package/dist/lib/hooks.js +5 -1
- package/dist/lib/hooks.js.map +1 -1
- package/dist/lib/messages/inject.d.ts +2 -1
- package/dist/lib/messages/inject.d.ts.map +1 -1
- package/dist/lib/messages/inject.js +36 -21
- package/dist/lib/messages/inject.js.map +1 -1
- package/dist/lib/messages/utils.d.ts +12 -0
- package/dist/lib/messages/utils.d.ts.map +1 -1
- package/dist/lib/messages/utils.js +44 -4
- package/dist/lib/messages/utils.js.map +1 -1
- package/dist/lib/prompts/_codegen/compress.generated.d.ts +2 -0
- package/dist/lib/prompts/_codegen/compress.generated.d.ts.map +1 -0
- package/dist/lib/prompts/_codegen/compress.generated.js +40 -0
- package/dist/lib/prompts/_codegen/compress.generated.js.map +1 -0
- package/dist/lib/prompts/_codegen/distill.generated.d.ts +2 -0
- package/dist/lib/prompts/_codegen/distill.generated.d.ts.map +1 -0
- package/dist/lib/prompts/_codegen/distill.generated.js +33 -0
- package/dist/lib/prompts/_codegen/distill.generated.js.map +1 -0
- package/dist/lib/prompts/{nudge.generated.d.ts → _codegen/nudge.generated.d.ts} +1 -1
- package/dist/lib/prompts/_codegen/nudge.generated.d.ts.map +1 -0
- package/dist/lib/prompts/{nudge.generated.js → _codegen/nudge.generated.js} +1 -1
- package/dist/lib/prompts/_codegen/nudge.generated.js.map +1 -0
- package/dist/lib/prompts/_codegen/prune.generated.d.ts +2 -0
- package/dist/lib/prompts/_codegen/prune.generated.d.ts.map +1 -0
- package/dist/lib/prompts/_codegen/prune.generated.js +23 -0
- package/dist/lib/prompts/_codegen/prune.generated.js.map +1 -0
- package/dist/lib/prompts/_codegen/system.generated.d.ts +2 -0
- package/dist/lib/prompts/_codegen/system.generated.d.ts.map +1 -0
- package/dist/lib/prompts/_codegen/system.generated.js +50 -0
- package/dist/lib/prompts/_codegen/system.generated.js.map +1 -0
- package/dist/lib/prompts/index.d.ts.map +1 -1
- package/dist/lib/prompts/index.js +5 -6
- package/dist/lib/prompts/index.js.map +1 -1
- package/dist/lib/protected-file-patterns.d.ts +2 -2
- package/dist/lib/protected-file-patterns.d.ts.map +1 -1
- package/dist/lib/protected-file-patterns.js +34 -7
- package/dist/lib/protected-file-patterns.js.map +1 -1
- package/dist/lib/state/state.d.ts.map +1 -1
- package/dist/lib/state/state.js +2 -0
- package/dist/lib/state/state.js.map +1 -1
- package/dist/lib/state/tool-cache.d.ts.map +1 -1
- package/dist/lib/state/tool-cache.js +6 -1
- package/dist/lib/state/tool-cache.js.map +1 -1
- package/dist/lib/state/types.d.ts +2 -0
- package/dist/lib/state/types.d.ts.map +1 -1
- package/dist/lib/strategies/deduplication.js +3 -3
- package/dist/lib/strategies/deduplication.js.map +1 -1
- package/dist/lib/strategies/purge-errors.js +3 -3
- package/dist/lib/strategies/purge-errors.js.map +1 -1
- package/dist/lib/strategies/supersede-writes.d.ts.map +1 -1
- package/dist/lib/strategies/supersede-writes.js +5 -4
- package/dist/lib/strategies/supersede-writes.js.map +1 -1
- package/dist/lib/strategies/utils.d.ts +7 -0
- package/dist/lib/strategies/utils.d.ts.map +1 -1
- package/dist/lib/strategies/utils.js +58 -28
- package/dist/lib/strategies/utils.js.map +1 -1
- package/dist/lib/tools/compress.d.ts.map +1 -1
- package/dist/lib/tools/compress.js +29 -15
- package/dist/lib/tools/compress.js.map +1 -1
- package/dist/lib/tools/distill.d.ts.map +1 -1
- package/dist/lib/tools/distill.js +25 -25
- package/dist/lib/tools/distill.js.map +1 -1
- package/dist/lib/tools/prune-shared.js +4 -4
- package/dist/lib/tools/prune-shared.js.map +1 -1
- package/package.json +3 -3
- package/dist/lib/prompts/compress-tool-spec.d.ts +0 -2
- package/dist/lib/prompts/compress-tool-spec.d.ts.map +0 -1
- package/dist/lib/prompts/compress-tool-spec.js +0 -58
- package/dist/lib/prompts/compress-tool-spec.js.map +0 -1
- package/dist/lib/prompts/distill-tool-spec.d.ts +0 -2
- package/dist/lib/prompts/distill-tool-spec.d.ts.map +0 -1
- package/dist/lib/prompts/distill-tool-spec.js +0 -48
- package/dist/lib/prompts/distill-tool-spec.js.map +0 -1
- package/dist/lib/prompts/nudge.generated.d.ts.map +0 -1
- package/dist/lib/prompts/nudge.generated.js.map +0 -1
- package/dist/lib/prompts/prune-tool-spec.d.ts +0 -2
- package/dist/lib/prompts/prune-tool-spec.d.ts.map +0 -1
- package/dist/lib/prompts/prune-tool-spec.js +0 -40
- package/dist/lib/prompts/prune-tool-spec.js.map +0 -1
- package/dist/lib/prompts/system.generated.d.ts +0 -2
- package/dist/lib/prompts/system.generated.d.ts.map +0 -1
- package/dist/lib/prompts/system.generated.js +0 -90
- package/dist/lib/prompts/system.generated.js.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare const COMPRESS_TOOL_SPEC = "Collapses a contiguous range of conversation into a single summary.\n\n## When to Use This Tool\n\nUse `compress` when you want to condense an entire sequence of work into a brief summary:\n\n- **Phase Completion:** You completed a phase (research, tool calls, implementation) and want to collapse the entire sequence into a summary.\n- **Exploration Done:** You explored multiple files or ran multiple commands and only need a summary of what you learned.\n- **Failed Attempts:** You tried several unsuccessful approaches and want to condense them into a brief note.\n- **Verbose Output:** A section of conversation has grown large but can be summarized without losing critical details.\n\n## When NOT to Use This Tool\n\n- **If you need specific details:** If you'll need exact code, file contents, or error messages from the range, keep them.\n- **For individual tool outputs:** Use `prune` or `distill` for single tool outputs. Compress targets conversation ranges.\n- **If it's recent content:** You may still need recent work for the current phase.\n\n## How It Works\n\n1. `startString` \u2014 A unique text string that marks the start of the range to compress\n2. `endString` \u2014 A unique text string that marks the end of the range to compress\n3. `topic` \u2014 A short label (3-5 words) describing the compressed content\n4. `summary` \u2014 The replacement text that will be inserted\n\nEverything between startString and endString (inclusive) is removed and replaced with your summary.\n\n**Important:** The compress will FAIL if `startString` or `endString` is not found in the conversation. The compress will also FAIL if either string is found multiple times. Provide a larger string with more surrounding context to uniquely identify the intended match.\n\n## Best Practices\n- **Choose unique strings:** Pick text that appears only once in the conversation.\n- **Write concise topics:** Examples: \"Auth System Exploration\", \"Token Logic Refactor\"\n- **Write comprehensive summaries:** Include key information like file names, function signatures, and important findings.\n- **Timing:** Best used after finishing a work phase, not during active exploration.\n\n## Format\n\n- `input`: Array with four elements: [startString, endString, topic, summary]\n\n## Example\n\n<example_compress>\nConversation: [Asked about auth] -> [Read 5 files] -> [Analyzed patterns] -> [Found \"JWT tokens with 24h expiry\"]\n\n[Uses compress with:\n input: [\n \"Asked about authentication\",\n \"JWT tokens with 24h expiry\",\n \"Auth System Exploration\",\n \"Auth: JWT 24h expiry, bcrypt passwords, refresh rotation. Files: auth.ts, tokens.ts, middleware/auth.ts\"\n ]\n]\n</example_compress>\n\n<example_keep>\nAssistant: [Just finished reading auth.ts]\nI've read the auth file and now need to make edits based on it. I'm keeping this in context rather than compressing.\n</example_keep>";
|
|
2
|
-
//# sourceMappingURL=compress-tool-spec.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compress-tool-spec.d.ts","sourceRoot":"","sources":["../../../lib/prompts/compress-tool-spec.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,o2FAwDf,CAAA"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
export const COMPRESS_TOOL_SPEC = `Collapses a contiguous range of conversation into a single summary.
|
|
2
|
-
|
|
3
|
-
## When to Use This Tool
|
|
4
|
-
|
|
5
|
-
Use \`compress\` when you want to condense an entire sequence of work into a brief summary:
|
|
6
|
-
|
|
7
|
-
- **Phase Completion:** You completed a phase (research, tool calls, implementation) and want to collapse the entire sequence into a summary.
|
|
8
|
-
- **Exploration Done:** You explored multiple files or ran multiple commands and only need a summary of what you learned.
|
|
9
|
-
- **Failed Attempts:** You tried several unsuccessful approaches and want to condense them into a brief note.
|
|
10
|
-
- **Verbose Output:** A section of conversation has grown large but can be summarized without losing critical details.
|
|
11
|
-
|
|
12
|
-
## When NOT to Use This Tool
|
|
13
|
-
|
|
14
|
-
- **If you need specific details:** If you'll need exact code, file contents, or error messages from the range, keep them.
|
|
15
|
-
- **For individual tool outputs:** Use \`prune\` or \`distill\` for single tool outputs. Compress targets conversation ranges.
|
|
16
|
-
- **If it's recent content:** You may still need recent work for the current phase.
|
|
17
|
-
|
|
18
|
-
## How It Works
|
|
19
|
-
|
|
20
|
-
1. \`startString\` — A unique text string that marks the start of the range to compress
|
|
21
|
-
2. \`endString\` — A unique text string that marks the end of the range to compress
|
|
22
|
-
3. \`topic\` — A short label (3-5 words) describing the compressed content
|
|
23
|
-
4. \`summary\` — The replacement text that will be inserted
|
|
24
|
-
|
|
25
|
-
Everything between startString and endString (inclusive) is removed and replaced with your summary.
|
|
26
|
-
|
|
27
|
-
**Important:** The compress will FAIL if \`startString\` or \`endString\` is not found in the conversation. The compress will also FAIL if either string is found multiple times. Provide a larger string with more surrounding context to uniquely identify the intended match.
|
|
28
|
-
|
|
29
|
-
## Best Practices
|
|
30
|
-
- **Choose unique strings:** Pick text that appears only once in the conversation.
|
|
31
|
-
- **Write concise topics:** Examples: "Auth System Exploration", "Token Logic Refactor"
|
|
32
|
-
- **Write comprehensive summaries:** Include key information like file names, function signatures, and important findings.
|
|
33
|
-
- **Timing:** Best used after finishing a work phase, not during active exploration.
|
|
34
|
-
|
|
35
|
-
## Format
|
|
36
|
-
|
|
37
|
-
- \`input\`: Array with four elements: [startString, endString, topic, summary]
|
|
38
|
-
|
|
39
|
-
## Example
|
|
40
|
-
|
|
41
|
-
<example_compress>
|
|
42
|
-
Conversation: [Asked about auth] -> [Read 5 files] -> [Analyzed patterns] -> [Found "JWT tokens with 24h expiry"]
|
|
43
|
-
|
|
44
|
-
[Uses compress with:
|
|
45
|
-
input: [
|
|
46
|
-
"Asked about authentication",
|
|
47
|
-
"JWT tokens with 24h expiry",
|
|
48
|
-
"Auth System Exploration",
|
|
49
|
-
"Auth: JWT 24h expiry, bcrypt passwords, refresh rotation. Files: auth.ts, tokens.ts, middleware/auth.ts"
|
|
50
|
-
]
|
|
51
|
-
]
|
|
52
|
-
</example_compress>
|
|
53
|
-
|
|
54
|
-
<example_keep>
|
|
55
|
-
Assistant: [Just finished reading auth.ts]
|
|
56
|
-
I've read the auth file and now need to make edits based on it. I'm keeping this in context rather than compressing.
|
|
57
|
-
</example_keep>`;
|
|
58
|
-
//# sourceMappingURL=compress-tool-spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,2 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,48 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nudge.generated.d.ts","sourceRoot":"","sources":["../../../lib/prompts/nudge.generated.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,KAAK,+6BAYjB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,2 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,40 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,2 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"system.generated.d.ts","sourceRoot":"","sources":["../../../lib/prompts/system.generated.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM,09JAqFlB,CAAA"}
|
|
@@ -1,90 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|