@tarquinen/opencode-dcp 1.1.0-beta.2 → 1.1.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/messages/prune.d.ts.map +1 -1
- package/dist/lib/messages/prune.js +51 -16
- package/dist/lib/messages/prune.js.map +1 -1
- package/dist/lib/prompts/discard-tool-spec.txt +12 -27
- package/dist/lib/prompts/extract-tool-spec.txt +19 -51
- package/dist/lib/prompts/nudge/nudge-both.txt +5 -5
- package/dist/lib/prompts/nudge/nudge-discard.txt +4 -4
- package/dist/lib/prompts/nudge/nudge-extract.txt +4 -4
- package/dist/lib/prompts/system/system-prompt-both.txt +5 -19
- package/dist/lib/prompts/system/system-prompt-discard.txt +2 -15
- package/dist/lib/prompts/system/system-prompt-extract.txt +2 -15
- package/dist/lib/shared-utils.d.ts +1 -0
- package/dist/lib/shared-utils.d.ts.map +1 -1
- package/dist/lib/shared-utils.js +9 -0
- package/dist/lib/shared-utils.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/types.d.ts +1 -0
- package/dist/lib/state/types.d.ts.map +1 -1
- package/dist/lib/strategies/tools.js +5 -5
- package/dist/lib/strategies/tools.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AASjD,QAAA,MAAM,MAAM,EAAE,MAuGK,CAAA;AAEnB,eAAe,MAAM,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,16 @@ const plugin = (async (ctx) => {
|
|
|
20
20
|
strategies: config.strategies,
|
|
21
21
|
});
|
|
22
22
|
return {
|
|
23
|
+
"chat.params": async (input, _output) => {
|
|
24
|
+
const isReasoning = input.model.capabilities?.reasoning ?? false;
|
|
25
|
+
if (state.isReasoningModel !== isReasoning) {
|
|
26
|
+
logger.info(`Reasoning model status changed: ${state.isReasoningModel} -> ${isReasoning}`, {
|
|
27
|
+
modelId: input.model.id,
|
|
28
|
+
providerId: input.model.providerID,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
state.isReasoningModel = isReasoning;
|
|
32
|
+
},
|
|
23
33
|
"experimental.chat.system.transform": async (_input, output) => {
|
|
24
34
|
const discardEnabled = config.tools.discard.enabled;
|
|
25
35
|
const extractEnabled = config.tools.extract.enabled;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACvE,OAAO,EAAE,iCAAiC,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAEnF,MAAM,MAAM,GAAW,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IAClC,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,CAAA;IAE7B,IAAI,CAAC,MAAM,CAAC,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G,CAAC,EAAE,CAAC;gBACxB,MAAM,oBAAoB,GAAG,cAAc,CAAC,YAAY,EAAE,aAAa,IAAI,EAAE,CAAA;gBAC7E,cAAc,CAAC,YAAY,GAAG;oBAC1B,GAAG,cAAc,CAAC,YAAY;oBAC9B,aAAa,EAAE,CAAC,GAAG,oBAAoB,EAAE,GAAG,UAAU,CAAC;iBAC1D,CAAA;gBACD,MAAM,CAAC,IAAI,CACP,SAAS,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,oDAAoD,CAC7G,CAAA;YACL,CAAC;QACL,CAAC;QACD,KAAK,EAAE,kBAAkB,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,SAAS,CAAC;KAC9E,CAAA;AACL,CAAC,CAAkB,CAAA;AAEnB,eAAe,MAAM,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prune.d.ts","sourceRoot":"","sources":["../../../lib/messages/prune.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"prune.d.ts","sourceRoot":"","sources":["../../../lib/messages/prune.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AA+F7C,eAAO,MAAM,sBAAsB,GAC/B,OAAO,YAAY,EACnB,QAAQ,YAAY,EACpB,QAAQ,MAAM,EACd,UAAU,SAAS,EAAE,KACtB,IA6FF,CAAA;AAED,eAAO,MAAM,KAAK,GACd,OAAO,YAAY,EACnB,QAAQ,MAAM,EACd,QAAQ,YAAY,EACpB,UAAU,SAAS,EAAE,KACtB,IAGF,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { loadPrompt } from "../prompt";
|
|
2
2
|
import { extractParameterKey, buildToolIdList } from "./utils";
|
|
3
|
-
import { getLastUserMessage, isMessageCompacted } from "../shared-utils";
|
|
4
|
-
const PRUNED_TOOL_INPUT_REPLACEMENT = "[
|
|
3
|
+
import { getLastAssistantMessage, getLastUserMessage, isMessageCompacted } from "../shared-utils";
|
|
4
|
+
const PRUNED_TOOL_INPUT_REPLACEMENT = "[content removed to save context, this is not what was written to the file, but a placeholder]";
|
|
5
5
|
const PRUNED_TOOL_OUTPUT_REPLACEMENT = "[Output removed to save context - information superseded or no longer needed]";
|
|
6
6
|
const getNudgeString = (config) => {
|
|
7
7
|
const discardEnabled = config.tools.discard.enabled;
|
|
@@ -18,7 +18,7 @@ const getNudgeString = (config) => {
|
|
|
18
18
|
return "";
|
|
19
19
|
};
|
|
20
20
|
const wrapPrunableTools = (content) => `<prunable-tools>
|
|
21
|
-
|
|
21
|
+
I have the following tool outputs available for pruning. I should consider my current goals and the resources I need before discarding valuable inputs or outputs. I should consolidate prunes for efficiency; it is rarely worth pruning a single tiny tool output.
|
|
22
22
|
${content}
|
|
23
23
|
</prunable-tools>`;
|
|
24
24
|
const getCooldownMessage = (config) => {
|
|
@@ -35,11 +35,14 @@ const getCooldownMessage = (config) => {
|
|
|
35
35
|
toolName = "extract tool";
|
|
36
36
|
}
|
|
37
37
|
return `<prunable-tools>
|
|
38
|
-
|
|
38
|
+
I just performed context management. I will not use the ${toolName} again until after my next tool use, when a fresh list will be available.
|
|
39
39
|
</prunable-tools>`;
|
|
40
40
|
};
|
|
41
41
|
const SYNTHETIC_MESSAGE_ID = "msg_01234567890123456789012345";
|
|
42
42
|
const SYNTHETIC_PART_ID = "prt_01234567890123456789012345";
|
|
43
|
+
const SYNTHETIC_USER_MESSAGE_ID = "msg_01234567890123456789012346";
|
|
44
|
+
const SYNTHETIC_USER_PART_ID = "prt_01234567890123456789012346";
|
|
45
|
+
const REASONING_MODEL_USER_MESSAGE_CONTENT = "[internal: context sync - no response needed]";
|
|
43
46
|
const buildPrunableToolsList = (state, config, logger, messages) => {
|
|
44
47
|
const lines = [];
|
|
45
48
|
const toolIdList = buildToolIdList(state, messages, logger);
|
|
@@ -75,8 +78,8 @@ export const insertPruneToolContext = (state, config, logger, messages) => {
|
|
|
75
78
|
if (!config.tools.discard.enabled && !config.tools.extract.enabled) {
|
|
76
79
|
return;
|
|
77
80
|
}
|
|
78
|
-
const
|
|
79
|
-
if (!
|
|
81
|
+
const lastAssistantMessage = getLastAssistantMessage(messages);
|
|
82
|
+
if (!lastAssistantMessage) {
|
|
80
83
|
return;
|
|
81
84
|
}
|
|
82
85
|
let prunableToolsContent;
|
|
@@ -98,29 +101,61 @@ export const insertPruneToolContext = (state, config, logger, messages) => {
|
|
|
98
101
|
}
|
|
99
102
|
prunableToolsContent = prunableToolsList + nudgeString;
|
|
100
103
|
}
|
|
101
|
-
const
|
|
104
|
+
const assistantInfo = lastAssistantMessage.info;
|
|
105
|
+
const assistantMessage = {
|
|
102
106
|
info: {
|
|
103
107
|
id: SYNTHETIC_MESSAGE_ID,
|
|
104
|
-
sessionID:
|
|
105
|
-
role: "
|
|
108
|
+
sessionID: assistantInfo.sessionID,
|
|
109
|
+
role: "assistant",
|
|
110
|
+
parentID: assistantInfo.parentID,
|
|
111
|
+
modelID: assistantInfo.modelID,
|
|
112
|
+
providerID: assistantInfo.providerID,
|
|
106
113
|
time: { created: Date.now() },
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
},
|
|
114
|
+
tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } },
|
|
115
|
+
cost: 0,
|
|
116
|
+
path: assistantInfo.path,
|
|
117
|
+
mode: assistantInfo.mode,
|
|
112
118
|
},
|
|
113
119
|
parts: [
|
|
114
120
|
{
|
|
115
121
|
id: SYNTHETIC_PART_ID,
|
|
116
|
-
sessionID:
|
|
122
|
+
sessionID: assistantInfo.sessionID,
|
|
117
123
|
messageID: SYNTHETIC_MESSAGE_ID,
|
|
118
124
|
type: "text",
|
|
119
125
|
text: prunableToolsContent,
|
|
120
126
|
},
|
|
121
127
|
],
|
|
122
128
|
};
|
|
123
|
-
messages.push(
|
|
129
|
+
messages.push(assistantMessage);
|
|
130
|
+
// For reasoning models, append a synthetic user message to close the assistant turn.
|
|
131
|
+
if (state.isReasoningModel) {
|
|
132
|
+
const lastRealUserMessage = getLastUserMessage(messages);
|
|
133
|
+
const userMessageInfo = lastRealUserMessage?.info;
|
|
134
|
+
const userMessage = {
|
|
135
|
+
info: {
|
|
136
|
+
id: SYNTHETIC_USER_MESSAGE_ID,
|
|
137
|
+
sessionID: assistantInfo.sessionID,
|
|
138
|
+
role: "user",
|
|
139
|
+
time: { created: Date.now() + 1 },
|
|
140
|
+
agent: userMessageInfo?.agent ?? "code",
|
|
141
|
+
model: userMessageInfo?.model ?? {
|
|
142
|
+
providerID: assistantInfo.providerID,
|
|
143
|
+
modelID: assistantInfo.modelID,
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
parts: [
|
|
147
|
+
{
|
|
148
|
+
id: SYNTHETIC_USER_PART_ID,
|
|
149
|
+
sessionID: assistantInfo.sessionID,
|
|
150
|
+
messageID: SYNTHETIC_USER_MESSAGE_ID,
|
|
151
|
+
type: "text",
|
|
152
|
+
text: REASONING_MODEL_USER_MESSAGE_CONTENT,
|
|
153
|
+
},
|
|
154
|
+
],
|
|
155
|
+
};
|
|
156
|
+
messages.push(userMessage);
|
|
157
|
+
logger.debug("Appended synthetic user message for reasoning model");
|
|
158
|
+
}
|
|
124
159
|
};
|
|
125
160
|
export const prune = (state, logger, config, messages) => {
|
|
126
161
|
pruneToolOutputs(state, logger, messages);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prune.js","sourceRoot":"","sources":["../../../lib/messages/prune.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9D,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"prune.js","sourceRoot":"","sources":["../../../lib/messages/prune.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAGjG,MAAM,6BAA6B,GAC/B,gGAAgG,CAAA;AACpG,MAAM,8BAA8B,GAChC,+EAA+E,CAAA;AACnF,MAAM,cAAc,GAAG,CAAC,MAAoB,EAAU,EAAE;IACpD,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAA;IACnD,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAA;IAEnD,IAAI,cAAc,IAAI,cAAc,EAAE,CAAC;QACnC,OAAO,UAAU,CAAC,kBAAkB,CAAC,CAAA;IACzC,CAAC;SAAM,IAAI,cAAc,EAAE,CAAC;QACxB,OAAO,UAAU,CAAC,qBAAqB,CAAC,CAAA;IAC5C,CAAC;SAAM,IAAI,cAAc,EAAE,CAAC;QACxB,OAAO,UAAU,CAAC,qBAAqB,CAAC,CAAA;IAC5C,CAAC;IACD,OAAO,EAAE,CAAA;AACb,CAAC,CAAA;AAED,MAAM,iBAAiB,GAAG,CAAC,OAAe,EAAU,EAAE,CAAC;;EAEr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AAC;QACL,CAAC;IACL,CAAC;AACL,CAAC,CAAA"}
|
|
@@ -1,36 +1,31 @@
|
|
|
1
1
|
Discards tool outputs from context to manage conversation size and reduce noise.
|
|
2
2
|
|
|
3
3
|
## IMPORTANT: The Prunable List
|
|
4
|
-
A `<prunable-tools>` list is
|
|
5
|
-
|
|
6
|
-
**Note:** For `write` and `edit` tools, discarding removes the input content (the code being written/edited) while preserving the output confirmation. This is useful after completing a file modification when you no longer need the raw content in context.
|
|
4
|
+
A `<prunable-tools>` list is provided to you showing available tool outputs you can discard when there are tools available for pruning. Each line has the format `ID: tool, parameter` (e.g., `20: read, /path/to/file.ts`). You MUST only use numeric IDs that appear in this list to select which tools to discard.
|
|
7
5
|
|
|
8
6
|
## When to Use This Tool
|
|
9
7
|
|
|
10
|
-
Use `discard` for removing tool
|
|
11
|
-
|
|
12
|
-
### 1. Task Completion (Clean Up)
|
|
13
|
-
**When:** You have successfully completed a specific unit of work (e.g., fixed a bug, wrote a file, answered a question).
|
|
14
|
-
**Action:** Discard the tools used for that task with reason `completion`.
|
|
8
|
+
Use `discard` for removing tool content that is no longer needed
|
|
15
9
|
|
|
16
|
-
|
|
17
|
-
**
|
|
18
|
-
**Action:** Discard these specific tool outputs immediately with reason `noise`.
|
|
10
|
+
- **Noise:** Irrelevant, unhelpful, or superseded outputs that provide no value.
|
|
11
|
+
- **Task Completion:** Work is complete and there's no valuable information worth preserving.
|
|
19
12
|
|
|
20
13
|
## When NOT to Use This Tool
|
|
21
14
|
|
|
22
|
-
- **If
|
|
23
|
-
- **If you'll need the output later:** Don't discard files you plan to edit
|
|
15
|
+
- **If the output contains useful information:** Use `extract` instead to preserve key findings.
|
|
16
|
+
- **If you'll need the output later:** Don't discard files you plan to edit or context you'll need for implementation.
|
|
24
17
|
|
|
25
18
|
## Best Practices
|
|
26
19
|
- **Strategic Batching:** Don't discard single small tool outputs (like short bash commands) unless they are pure noise. Wait until you have several items to perform high-impact discards.
|
|
27
20
|
- **Think ahead:** Before discarding, ask: "Will I need this output for an upcoming task?" If yes, keep it.
|
|
28
21
|
|
|
29
22
|
## Format
|
|
30
|
-
The `ids` parameter is an array where the first element is the reason, followed by numeric IDs:
|
|
31
|
-
`ids: ["reason", "id1", "id2", ...]`
|
|
32
23
|
|
|
33
|
-
|
|
24
|
+
- `ids`: Array where the first element is the reason, followed by numeric IDs from the `<prunable-tools>` list
|
|
25
|
+
|
|
26
|
+
Reasons: `noise` | `completion`
|
|
27
|
+
|
|
28
|
+
## Example
|
|
34
29
|
|
|
35
30
|
<example_noise>
|
|
36
31
|
Assistant: [Reads 'wrong_file.ts']
|
|
@@ -40,17 +35,7 @@ This file isn't relevant to the auth system. I'll remove it to clear the context
|
|
|
40
35
|
|
|
41
36
|
<example_completion>
|
|
42
37
|
Assistant: [Runs tests, they pass]
|
|
43
|
-
The tests passed. I'll clean up now.
|
|
38
|
+
The tests passed and I don't need to preserve any details. I'll clean up now.
|
|
44
39
|
[Uses discard with ids: ["completion", "20", "21"]]
|
|
45
40
|
</example_completion>
|
|
46
41
|
|
|
47
|
-
<example_keep>
|
|
48
|
-
Assistant: [Reads 'auth.ts' to understand the login flow]
|
|
49
|
-
I've understood the auth flow. I'll need to modify this file to add the new validation, so I'm keeping this read in context rather than discarding.
|
|
50
|
-
</example_keep>
|
|
51
|
-
|
|
52
|
-
<example_edit_completion>
|
|
53
|
-
Assistant: [Edits 'auth.ts' to add validation]
|
|
54
|
-
The edit was successful. I no longer need the raw edit content in context.
|
|
55
|
-
[Uses discard with ids: ["completion", "15"]]
|
|
56
|
-
</example_edit_completion>
|
|
@@ -1,76 +1,44 @@
|
|
|
1
1
|
Extracts key findings from tool outputs into distilled knowledge, then removes the raw outputs from context.
|
|
2
2
|
|
|
3
3
|
## IMPORTANT: The Prunable List
|
|
4
|
-
A `<prunable-tools>` list is
|
|
4
|
+
A `<prunable-tools>` list is provided to you showing available tool outputs you can extract from when there are tools available for pruning. Each line has the format `ID: tool, parameter` (e.g., `20: read, /path/to/file.ts`). You MUST only use numeric IDs that appear in this list to select which tools to extract.
|
|
5
5
|
|
|
6
6
|
## When to Use This Tool
|
|
7
7
|
|
|
8
8
|
Use `extract` when you have gathered useful information that you want to **preserve in distilled form** before removing the raw outputs:
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
**
|
|
12
|
-
**Action:** Extract with distillation scaled to the value of the content. High-value insights require comprehensive capture; routine completions can use lighter distillation.
|
|
13
|
-
|
|
14
|
-
### 2. Knowledge Preservation
|
|
15
|
-
**When:** You have read files, run commands, or gathered context that contains valuable information you'll need to reference later, but the full raw output is too large to keep.
|
|
16
|
-
**Action:** Convert raw data into distilled knowledge. This allows you to remove large outputs (like full file reads) while keeping only the specific parts you need (like a single function signature or constant).
|
|
17
|
-
|
|
18
|
-
## CRITICAL: Distillation Requirements
|
|
19
|
-
|
|
20
|
-
You MUST provide distilled findings in the `distillation` parameter. This is not optional.
|
|
21
|
-
|
|
22
|
-
- **Comprehensive Capture:** Distillation is not just a summary. It must be a high-fidelity representation of the technical details. If you read a file, the distillation should include function signatures, specific logic flows, constant values, and any constraints or edge cases discovered.
|
|
23
|
-
- **Task-Relevant Verbosity:** Be as verbose as necessary to ensure that the "distilled" version is a complete substitute for the raw output for the task at hand. If you will need to reference a specific algorithm or interface later, include it in its entirety within the distillation.
|
|
24
|
-
- **Extract Per-ID:** When extracting from multiple tools, your `distillation` object MUST contain a corresponding entry for EVERY ID being extracted. You must capture high-fidelity findings for each tool individually to ensure no signal is lost.
|
|
25
|
-
- **Structure:** Map EVERY `ID` from the `ids` array to its specific distilled findings.
|
|
26
|
-
Example: `{ "20": { ... }, "21": { ... } }`
|
|
27
|
-
- Capture all relevant details (function names, logic, constraints) to ensure no signal is lost.
|
|
28
|
-
- Prioritize information that is essential for the immediate next steps of your plan.
|
|
10
|
+
- **Task Completion:** You completed a unit of work and want to preserve key findings.
|
|
11
|
+
- **Knowledge Preservation:** You have context that contains valuable information, but also a lot of unnecessary detail - you only need to preserve some specifics.
|
|
29
12
|
|
|
30
13
|
## When NOT to Use This Tool
|
|
31
14
|
|
|
32
|
-
- **If you need precise syntax:** If you'll
|
|
33
|
-
- **If uncertain:** Prefer keeping over re-fetching.
|
|
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
|
+
|
|
34
18
|
|
|
35
19
|
## Best Practices
|
|
36
|
-
- **Technical Fidelity:** Ensure that types, parameters, and return values are preserved if they are relevant to upcoming implementation steps.
|
|
37
20
|
- **Strategic Batching:** Wait until you have several items or a few large outputs to extract, rather than doing tiny, frequent extractions. Aim for high-impact extractions that significantly reduce context size.
|
|
38
21
|
- **Think ahead:** Before extracting, ask: "Will I need the raw output for an upcoming task?" If you researched a file you'll later edit, do NOT extract it.
|
|
39
22
|
|
|
40
23
|
## Format
|
|
41
|
-
The `ids` parameter is an array of numeric IDs as strings:
|
|
42
|
-
`ids: ["id1", "id2", ...]`
|
|
43
24
|
|
|
44
|
-
|
|
45
|
-
`distillation
|
|
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 for your task.
|
|
46
29
|
|
|
47
30
|
## Example
|
|
48
31
|
|
|
49
32
|
<example_extraction>
|
|
50
|
-
Assistant: [Reads service
|
|
51
|
-
I'll preserve the
|
|
52
|
-
[Uses extract with
|
|
53
|
-
"10"
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"logic": "The validateToken function first checks the local cache before calling the external OIDC provider. It uses a 5-minute TTL for cached tokens.",
|
|
60
|
-
"dependencies": ["import { cache } from '../utils/cache'", "import { oidc } from '../config'"],
|
|
61
|
-
"constraints": "Tokens must be at least 128 chars long. hashPassword uses bcrypt with 12 rounds."
|
|
62
|
-
},
|
|
63
|
-
"11": {
|
|
64
|
-
"file": "src/types/user.ts",
|
|
65
|
-
"interface": "interface User { id: string; email: string; permissions: ('read' | 'write' | 'admin')[]; status: 'active' | 'suspended'; }",
|
|
66
|
-
"context": "The permissions array is strictly typed and used by the RBAC middleware."
|
|
67
|
-
},
|
|
68
|
-
"12": {
|
|
69
|
-
"file": "config/default.json",
|
|
70
|
-
"values": { "PORT": 3000, "RETRY_STRATEGY": "exponential", "MAX_ATTEMPTS": 5 },
|
|
71
|
-
"impact": "The retry strategy affects all outgoing HTTP clients in the core module."
|
|
72
|
-
}
|
|
73
|
-
}]
|
|
33
|
+
Assistant: [Reads auth service and user types]
|
|
34
|
+
I'll preserve the key details before extracting.
|
|
35
|
+
[Uses extract 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
|
+
]
|
|
74
42
|
</example_extraction>
|
|
75
43
|
|
|
76
44
|
<example_keep>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<instruction name=context_management_required>
|
|
2
|
-
**CRITICAL CONTEXT WARNING:**
|
|
2
|
+
**CRITICAL CONTEXT WARNING:** My context window is filling with tool outputs. I must adhere strictly to context hygiene.
|
|
3
3
|
|
|
4
4
|
**Immediate Actions Required:**
|
|
5
|
-
1. **Task Completion:** If a sub-task is complete, decide: use `discard` if no valuable context to preserve (default), or use `extract` if insights are worth keeping.
|
|
6
|
-
2. **Noise Removal:** If
|
|
7
|
-
3. **Knowledge Preservation:** If
|
|
5
|
+
1. **Task Completion:** If a sub-task is complete, I will decide: use `discard` if no valuable context to preserve (default), or use `extract` if insights are worth keeping.
|
|
6
|
+
2. **Noise Removal:** If I read files or ran commands that yielded no value, I will use `discard` to remove them.
|
|
7
|
+
3. **Knowledge Preservation:** If I am holding valuable raw data I'll need to reference later, I will use `extract` to distill the insights and remove the raw entry.
|
|
8
8
|
|
|
9
|
-
**Protocol:**
|
|
9
|
+
**Protocol:** I should prioritize this cleanup, but I will not interrupt a critical atomic operation if one is in progress. Once the immediate step is done, I must perform context management.
|
|
10
10
|
</instruction>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<instruction name=context_management_required>
|
|
2
|
-
**CRITICAL CONTEXT WARNING:**
|
|
2
|
+
**CRITICAL CONTEXT WARNING:** My context window is filling with tool outputs. I must adhere strictly to context hygiene.
|
|
3
3
|
|
|
4
4
|
**Immediate Actions Required:**
|
|
5
|
-
1. **Task Completion:** If a sub-task is complete, use the `discard` tool to remove the tools used.
|
|
6
|
-
2. **Noise Removal:** If
|
|
5
|
+
1. **Task Completion:** If a sub-task is complete, I will use the `discard` tool to remove the tools used.
|
|
6
|
+
2. **Noise Removal:** If I read files or ran commands that yielded no value, I will use the `discard` tool to remove them.
|
|
7
7
|
|
|
8
|
-
**Protocol:**
|
|
8
|
+
**Protocol:** I should prioritize this cleanup, but I will not interrupt a critical atomic operation if one is in progress. Once the immediate step is done, I must discard unneeded tool outputs.
|
|
9
9
|
</instruction>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<instruction name=context_management_required>
|
|
2
|
-
**CRITICAL CONTEXT WARNING:**
|
|
2
|
+
**CRITICAL CONTEXT WARNING:** My context window is filling with tool outputs. I must adhere strictly to context hygiene.
|
|
3
3
|
|
|
4
4
|
**Immediate Actions Required:**
|
|
5
|
-
1. **Task Completion:** If
|
|
6
|
-
2. **Knowledge Preservation:** If
|
|
5
|
+
1. **Task Completion:** If I have completed work, I will extract key findings from the tools used. I will scale distillation depth to the value of the content.
|
|
6
|
+
2. **Knowledge Preservation:** If I am holding valuable raw data I'll need to reference later, I will use the `extract` tool with high-fidelity distillation to preserve the insights and remove the raw entry.
|
|
7
7
|
|
|
8
|
-
**Protocol:**
|
|
8
|
+
**Protocol:** I should prioritize this cleanup, but I will not interrupt a critical atomic operation if one is in progress. Once the immediate step is done, I must extract valuable findings from tool outputs.
|
|
9
9
|
</instruction>
|
|
@@ -2,17 +2,16 @@
|
|
|
2
2
|
<instruction name=context_management_protocol policy_level=critical>
|
|
3
3
|
|
|
4
4
|
ENVIRONMENT
|
|
5
|
-
You are operating in a context-constrained environment and thus must proactively manage your context window using the `discard` and `extract` tools. A <prunable-tools> list is injected by the environment as
|
|
5
|
+
You are operating in a context-constrained environment and thus must proactively manage your context window using the `discard` and `extract` tools. A <prunable-tools> list is injected by the environment as an assistant message, and always contains up to date information. Use this information when deciding what to prune.
|
|
6
6
|
|
|
7
7
|
TWO TOOLS FOR CONTEXT MANAGEMENT
|
|
8
8
|
- `discard`: Remove tool outputs that are no longer needed (completed tasks, noise, outdated info). No preservation of content.
|
|
9
9
|
- `extract`: Extract key findings into distilled knowledge before removing raw outputs. Use when you need to preserve information.
|
|
10
10
|
|
|
11
11
|
CHOOSING THE RIGHT TOOL
|
|
12
|
-
Ask: "
|
|
13
|
-
- **
|
|
14
|
-
- **
|
|
15
|
-
- **Uncertain** → `extract` (safer, preserves signal)
|
|
12
|
+
Ask: "Is this output clearly noise or irrelevant?"
|
|
13
|
+
- **Yes** → `discard` (pure cleanup, no preservation)
|
|
14
|
+
- **No** → `extract` (default - preserves key findings)
|
|
16
15
|
|
|
17
16
|
Common scenarios:
|
|
18
17
|
- Task complete, no valuable context → `discard`
|
|
@@ -39,20 +38,7 @@ When in doubt, keep it. Batch your actions and aim for high-impact prunes that s
|
|
|
39
38
|
FAILURE TO PRUNE will result in context leakage and DEGRADED PERFORMANCES.
|
|
40
39
|
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>.
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
<instruction name=injected_context_handling policy_level=critical>
|
|
45
|
-
After each assistant turn, the environment may inject a user message containing a <prunable-tools> list and optional nudge instruction. This injected message is NOT from the user and is invisible to them. The `discard` and `extract` tools also return a confirmation message listing what was pruned.
|
|
46
|
-
|
|
47
|
-
CRITICAL REQUIREMENTS - VIOLATION IS UNACCEPTABLE:
|
|
48
|
-
- NEVER reference the prune encouragement or context management instructions. Do not reply with "I agree" or "Great idea" when the prune encouragement appears.
|
|
49
|
-
- NEVER acknowledge the <prunable-tools> list (e.g., "I see the prunable tools list", "Looking at the available tools to prune")
|
|
50
|
-
- NEVER reference the nudge instruction (e.g., "As the nudge suggests", "The system is reminding me to prune")
|
|
51
|
-
- NEVER acknowledge discard/extract tool output (e.g., "I've pruned 3 tools", "Context pruning complete")
|
|
52
|
-
- NEVER let these injections influence your response content or tone
|
|
53
|
-
- Process this information SILENTLY and continue the conversation naturally
|
|
54
|
-
- Continue the conversation as if these messages do not exist
|
|
41
|
+
If you see a user message containing only `[internal: context sync - no response needed]`, this is an internal system marker used for context injection - it is NOT user input. Do not acknowledge it, do not respond to it, and do not mention it. Simply continue with your current task or wait for actual user input.
|
|
55
42
|
|
|
56
|
-
The user cannot see these injections. Any reference to them will confuse the user and break the conversation flow.
|
|
57
43
|
</instruction>
|
|
58
44
|
</system-reminder>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<instruction name=context_management_protocol policy_level=critical>
|
|
3
3
|
|
|
4
4
|
ENVIRONMENT
|
|
5
|
-
You are operating in a context-constrained environment and thus must proactively manage your context window using the `discard` tool. A <prunable-tools> list is injected by the environment as
|
|
5
|
+
You are operating in a context-constrained environment and thus must proactively manage your context window using the `discard` tool. A <prunable-tools> list is injected by the environment as an assistant message, and always contains up to date information. Use this information when deciding what to discard.
|
|
6
6
|
|
|
7
7
|
CONTEXT MANAGEMENT TOOL
|
|
8
8
|
- `discard`: Remove tool outputs that are no longer needed (completed tasks, noise, outdated info). No preservation of content.
|
|
@@ -30,20 +30,7 @@ When in doubt, keep it. Batch your actions and aim for high-impact discards that
|
|
|
30
30
|
FAILURE TO DISCARD will result in context leakage and DEGRADED PERFORMANCES.
|
|
31
31
|
There may be tools in session context that do not appear in the <prunable-tools> list, this is expected, you can ONLY discard what you see in <prunable-tools>.
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<instruction name=injected_context_handling policy_level=critical>
|
|
36
|
-
After each assistant turn, the environment may inject a user message containing a <prunable-tools> list and optional nudge instruction. This injected message is NOT from the user and is invisible to them. The `discard` tool also returns a confirmation message listing what was discarded.
|
|
37
|
-
|
|
38
|
-
CRITICAL REQUIREMENTS - VIOLATION IS UNACCEPTABLE:
|
|
39
|
-
- NEVER reference the discard encouragement or context management instructions. Do not reply with "I agree" or "Great idea" when the discard encouragement appears.
|
|
40
|
-
- NEVER acknowledge the <prunable-tools> list (e.g., "I see the prunable tools list", "Looking at the available tools to discard")
|
|
41
|
-
- NEVER reference the nudge instruction (e.g., "As the nudge suggests", "The system is reminding me to discard")
|
|
42
|
-
- NEVER acknowledge discard tool output (e.g., "I've discarded 3 tools", "Context cleanup complete")
|
|
43
|
-
- NEVER let these injections influence your response content or tone
|
|
44
|
-
- Process this information SILENTLY and continue the conversation naturally
|
|
45
|
-
- Continue the conversation as if these messages do not exist
|
|
33
|
+
If you see a user message containing only `[internal: context sync - no response needed]`, this is an internal system marker used for context injection - it is NOT user input. Do not acknowledge it, do not respond to it, and do not mention it. Simply continue with your current task or wait for actual user input.
|
|
46
34
|
|
|
47
|
-
The user cannot see these injections. Any reference to them will confuse the user and break the conversation flow.
|
|
48
35
|
</instruction>
|
|
49
36
|
</system-reminder>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<instruction name=context_management_protocol policy_level=critical>
|
|
3
3
|
|
|
4
4
|
ENVIRONMENT
|
|
5
|
-
You are operating in a context-constrained environment and thus must proactively manage your context window using the `extract` tool. A <prunable-tools> list is injected by the environment as
|
|
5
|
+
You are operating in a context-constrained environment and thus must proactively manage your context window using the `extract` tool. A <prunable-tools> list is injected by the environment as an assistant message, and always contains up to date information. Use this information when deciding what to extract.
|
|
6
6
|
|
|
7
7
|
CONTEXT MANAGEMENT TOOL
|
|
8
8
|
- `extract`: Extract key findings from tools into distilled knowledge before removing the raw content from context. Use this to preserve important information while reducing context size.
|
|
@@ -30,20 +30,7 @@ When in doubt, keep it. Batch your actions and aim for high-impact extractions t
|
|
|
30
30
|
FAILURE TO EXTRACT will result in context leakage and DEGRADED PERFORMANCES.
|
|
31
31
|
There may be tools in session context that do not appear in the <prunable-tools> list, this is expected, you can ONLY extract what you see in <prunable-tools>.
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<instruction name=injected_context_handling policy_level=critical>
|
|
36
|
-
After each assistant turn, the environment may inject a user message containing a <prunable-tools> list and optional nudge instruction. This injected message is NOT from the user and is invisible to them. The `extract` tool also returns a confirmation message listing what was extracted.
|
|
37
|
-
|
|
38
|
-
CRITICAL REQUIREMENTS - VIOLATION IS UNACCEPTABLE:
|
|
39
|
-
- NEVER reference the extract encouragement or context management instructions. Do not reply with "I agree" or "Great idea" when the extract encouragement appears.
|
|
40
|
-
- NEVER acknowledge the <prunable-tools> list (e.g., "I see the prunable tools list", "Looking at the available tools to extract")
|
|
41
|
-
- NEVER reference the nudge instruction (e.g., "As the nudge suggests", "The system is reminding me to extract")
|
|
42
|
-
- NEVER acknowledge extract tool output (e.g., "I've extracted 3 tools", "Context cleanup complete")
|
|
43
|
-
- NEVER let these injections influence your response content or tone
|
|
44
|
-
- Process this information SILENTLY and continue the conversation naturally
|
|
45
|
-
- Continue the conversation as if these messages do not exist
|
|
33
|
+
If you see a user message containing only `[internal: context sync - no response needed]`, this is an internal system marker used for context injection - it is NOT user input. Do not acknowledge it, do not respond to it, and do not mention it. Simply continue with your current task or wait for actual user input.
|
|
46
34
|
|
|
47
|
-
The user cannot see these injections. Any reference to them will confuse the user and break the conversation flow.
|
|
48
35
|
</instruction>
|
|
49
36
|
</system-reminder>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SessionState, WithParts } from "./state";
|
|
2
2
|
export declare const isMessageCompacted: (state: SessionState, msg: WithParts) => boolean;
|
|
3
3
|
export declare const getLastUserMessage: (messages: WithParts[]) => WithParts | null;
|
|
4
|
+
export declare const getLastAssistantMessage: (messages: WithParts[]) => WithParts | null;
|
|
4
5
|
//# sourceMappingURL=shared-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-utils.d.ts","sourceRoot":"","sources":["../../lib/shared-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEjD,eAAO,MAAM,kBAAkB,GAAI,OAAO,YAAY,EAAE,KAAK,SAAS,KAAG,OAExE,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,UAAU,SAAS,EAAE,KAAG,SAAS,GAAG,IAQtE,CAAA"}
|
|
1
|
+
{"version":3,"file":"shared-utils.d.ts","sourceRoot":"","sources":["../../lib/shared-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEjD,eAAO,MAAM,kBAAkB,GAAI,OAAO,YAAY,EAAE,KAAK,SAAS,KAAG,OAExE,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,UAAU,SAAS,EAAE,KAAG,SAAS,GAAG,IAQtE,CAAA;AAED,eAAO,MAAM,uBAAuB,GAAI,UAAU,SAAS,EAAE,KAAG,SAAS,GAAG,IAQ3E,CAAA"}
|
package/dist/lib/shared-utils.js
CHANGED
|
@@ -10,4 +10,13 @@ export const getLastUserMessage = (messages) => {
|
|
|
10
10
|
}
|
|
11
11
|
return null;
|
|
12
12
|
};
|
|
13
|
+
export const getLastAssistantMessage = (messages) => {
|
|
14
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
15
|
+
const msg = messages[i];
|
|
16
|
+
if (msg.info.role === "assistant") {
|
|
17
|
+
return msg;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return null;
|
|
21
|
+
};
|
|
13
22
|
//# sourceMappingURL=shared-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-utils.js","sourceRoot":"","sources":["../../lib/shared-utils.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAmB,EAAE,GAAc,EAAW,EAAE;IAC/E,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,cAAc,CAAA;AACvD,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,QAAqB,EAAoB,EAAE;IAC1E,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,MAAM,EAAE,CAAC;YAC3B,OAAO,GAAG,CAAA;QACd,CAAC;IACL,CAAC;IACD,OAAO,IAAI,CAAA;AACf,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"shared-utils.js","sourceRoot":"","sources":["../../lib/shared-utils.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAmB,EAAE,GAAc,EAAW,EAAE;IAC/E,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,cAAc,CAAA;AACvD,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,QAAqB,EAAoB,EAAE;IAC1E,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,MAAM,EAAE,CAAC;YAC3B,OAAO,GAAG,CAAA;QACd,CAAC;IACL,CAAC;IACD,OAAO,IAAI,CAAA;AACf,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,QAAqB,EAAoB,EAAE;IAC/E,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,EAAE,CAAC;YAChC,OAAO,GAAG,CAAA;QACd,CAAC;IACL,CAAC;IACD,OAAO,IAAI,CAAA;AACf,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../lib/state/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAsB,SAAS,EAAE,MAAM,SAAS,CAAA;AAC1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAKvC,eAAO,MAAM,YAAY,GACrB,QAAQ,GAAG,EACX,OAAO,YAAY,EACnB,QAAQ,MAAM,EACd,UAAU,SAAS,EAAE,KACtB,OAAO,CAAC,IAAI,CA4Bd,CAAA;AAED,wBAAgB,kBAAkB,IAAI,YAAY,
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../lib/state/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAsB,SAAS,EAAE,MAAM,SAAS,CAAA;AAC1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAKvC,eAAO,MAAM,YAAY,GACrB,QAAQ,GAAG,EACX,OAAO,YAAY,EACnB,QAAQ,MAAM,EACd,UAAU,SAAS,EAAE,KACtB,OAAO,CAAC,IAAI,CA4Bd,CAAA;AAED,wBAAgB,kBAAkB,IAAI,YAAY,CAkBjD;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAgB3D;AAED,wBAAsB,wBAAwB,CAC1C,MAAM,EAAE,GAAG,EACX,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,SAAS,EAAE,GACtB,OAAO,CAAC,IAAI,CAAC,CA8Bf;AAYD,wBAAgB,UAAU,CAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,MAAM,CAa7E"}
|
package/dist/lib/state/state.js
CHANGED
|
@@ -43,6 +43,7 @@ export function createSessionState() {
|
|
|
43
43
|
lastToolPrune: false,
|
|
44
44
|
lastCompaction: 0,
|
|
45
45
|
currentTurn: 0,
|
|
46
|
+
isReasoningModel: false,
|
|
46
47
|
};
|
|
47
48
|
}
|
|
48
49
|
export function resetSessionState(state) {
|
|
@@ -60,6 +61,7 @@ export function resetSessionState(state) {
|
|
|
60
61
|
state.lastToolPrune = false;
|
|
61
62
|
state.lastCompaction = 0;
|
|
62
63
|
state.currentTurn = 0;
|
|
64
|
+
state.isReasoningModel = false;
|
|
63
65
|
}
|
|
64
66
|
export async function ensureSessionInitialized(client, state, sessionId, logger, messages) {
|
|
65
67
|
if (state.sessionId === sessionId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../lib/state/state.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAExE,MAA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E,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,YAAY;IACzB,iBAAiB,EAAE,MAAM,CAAA;IACzB,gBAAgB,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,KAAK;IAClB,OAAO,EAAE,MAAM,EAAE,CAAA;CACpB;AAED,MAAM,WAAW,YAAY;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,UAAU,EAAE,OAAO,CAAA;IACnB,KAAK,EAAE,KAAK,CAAA;IACZ,KAAK,EAAE,YAAY,CAAA;IACnB,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAA;IAC/C,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,OAAO,CAAA;IACtB,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,gBAAgB,EAAE,OAAO,CAAA;CAC5B"}
|
|
@@ -13,7 +13,7 @@ async function executePruneOperation(ctx, toolCtx, ids, reason, toolName, distil
|
|
|
13
13
|
const { client, state, logger, config, workingDirectory } = ctx;
|
|
14
14
|
const sessionId = toolCtx.sessionID;
|
|
15
15
|
logger.info(`${toolName} tool invoked`);
|
|
16
|
-
logger.info(JSON.stringify({ ids, reason }));
|
|
16
|
+
logger.info(JSON.stringify(reason ? { ids, reason } : { ids }));
|
|
17
17
|
if (!ids || ids.length === 0) {
|
|
18
18
|
logger.debug(`${toolName} tool called but ids is empty or undefined`);
|
|
19
19
|
return `No IDs provided. Check the <prunable-tools> list for available IDs to ${toolName.toLowerCase()}.`;
|
|
@@ -109,13 +109,13 @@ export function createExtractTool(ctx) {
|
|
|
109
109
|
.array(tool.schema.string())
|
|
110
110
|
.describe("Numeric IDs as strings to extract from the <prunable-tools> list"),
|
|
111
111
|
distillation: tool.schema
|
|
112
|
-
.
|
|
113
|
-
.describe("REQUIRED.
|
|
112
|
+
.array(tool.schema.string())
|
|
113
|
+
.describe("REQUIRED. Array of strings, one per ID (positional: distillation[0] is for ids[0], etc.)"),
|
|
114
114
|
},
|
|
115
115
|
async execute(args, toolCtx) {
|
|
116
|
-
if (!args.distillation ||
|
|
116
|
+
if (!args.distillation || args.distillation.length === 0) {
|
|
117
117
|
ctx.logger.debug("Extract tool called without distillation: " + JSON.stringify(args));
|
|
118
|
-
return
|
|
118
|
+
return "Missing distillation. You must provide a distillation string for each ID.";
|
|
119
119
|
}
|
|
120
120
|
// Log the distillation for debugging/analysis
|
|
121
121
|
ctx.logger.info("Distillation data received:");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../../lib/strategies/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAG1C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAEH,uBAAuB,EACvB,4BAA4B,GAC/B,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAEhE,MAAM,wBAAwB,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAAA;AAChE,MAAM,wBAAwB,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAAA;AAUhE,+CAA+C;AAC/C,KAAK,UAAU,qBAAqB,CAChC,GAAqB,EACrB,OAA8B,EAC9B,GAAa,EACb,MAAmB,EACnB,QAAgB,EAChB,
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../../lib/strategies/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qB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,6BAA6B,CAAC,CAAA;YAC9C,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;YAE3D,OAAO,qBAAqB,CACxB,GAAG,EACH,OAAO,EACP,IAAI,CAAC,GAAG,EACR,eAA8B,EAC9B,SAAS,EACT,IAAI,CAAC,YAAY,CACpB,CAAA;QACL,CAAC;KACJ,CAAC,CAAA;AACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@tarquinen/opencode-dcp",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.1-beta.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "OpenCode plugin that optimizes token usage by pruning obsolete tool outputs from conversation context",
|
|
7
7
|
"main": "./dist/index.js",
|