@tarquinen/opencode-dcp 1.3.2-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 +17 -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/context.d.ts.map +1 -1
- package/dist/lib/commands/context.js +8 -7
- package/dist/lib/commands/context.js.map +1 -1
- package/dist/lib/commands/stats.d.ts.map +1 -1
- package/dist/lib/commands/stats.js +13 -8
- package/dist/lib/commands/stats.js.map +1 -1
- package/dist/lib/commands/sweep.d.ts.map +1 -1
- package/dist/lib/commands/sweep.js +10 -9
- package/dist/lib/commands/sweep.js.map +1 -1
- package/dist/lib/config.d.ts +3 -1
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +47 -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 +10 -4
- 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 +39 -31
- package/dist/lib/messages/inject.js.map +1 -1
- package/dist/lib/messages/prune.js +6 -6
- package/dist/lib/messages/prune.js.map +1 -1
- package/dist/lib/messages/utils.d.ts +20 -4
- package/dist/lib/messages/utils.d.ts.map +1 -1
- package/dist/lib/messages/utils.js +47 -42
- 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/shared-utils.js +1 -1
- package/dist/lib/shared-utils.js.map +1 -1
- package/dist/lib/state/persistence.d.ts +8 -2
- package/dist/lib/state/persistence.d.ts.map +1 -1
- package/dist/lib/state/persistence.js +6 -1
- package/dist/lib/state/persistence.js.map +1 -1
- package/dist/lib/state/state.d.ts.map +1 -1
- package/dist/lib/state/state.js +8 -6
- 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 +4 -2
- package/dist/lib/state/types.d.ts.map +1 -1
- package/dist/lib/state/utils.js +2 -2
- package/dist/lib/state/utils.js.map +1 -1
- package/dist/lib/strategies/deduplication.d.ts.map +1 -1
- package/dist/lib/strategies/deduplication.js +7 -6
- package/dist/lib/strategies/deduplication.js.map +1 -1
- package/dist/lib/strategies/purge-errors.d.ts.map +1 -1
- package/dist/lib/strategies/purge-errors.js +7 -6
- 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 +10 -8
- 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 +35 -17
- 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.d.ts.map +1 -1
- package/dist/lib/tools/prune-shared.js +7 -5
- package/dist/lib/tools/prune-shared.js.map +1 -1
- package/dist/lib/ui/notification.d.ts.map +1 -1
- package/dist/lib/ui/notification.js +63 -0
- package/dist/lib/ui/notification.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 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"}
|