@tarquinen/opencode-dcp 1.1.0-beta.2 → 1.1.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/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/messages/prune.d.ts.map +1 -1
- package/dist/lib/messages/prune.js +38 -48
- package/dist/lib/messages/prune.js.map +1 -1
- package/dist/lib/messages/utils.d.ts +2 -0
- package/dist/lib/messages/utils.d.ts.map +1 -1
- package/dist/lib/messages/utils.js +65 -0
- package/dist/lib/messages/utils.js.map +1 -1
- package/dist/lib/prompts/assistant/nudge/nudge-both.txt +10 -0
- package/dist/lib/prompts/assistant/nudge/nudge-discard.txt +9 -0
- package/dist/lib/prompts/assistant/nudge/nudge-extract.txt +9 -0
- package/dist/lib/prompts/assistant/system/system-prompt-both.txt +44 -0
- package/dist/lib/prompts/assistant/system/system-prompt-discard.txt +36 -0
- package/dist/lib/prompts/assistant/system/system-prompt-extract.txt +36 -0
- package/dist/lib/prompts/discard-tool-spec.txt +12 -27
- package/dist/lib/prompts/extract-tool-spec.txt +19 -51
- 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/lib/prompts/{nudge → user/nudge}/nudge-both.txt +0 -0
- /package/dist/lib/prompts/{nudge → user/nudge}/nudge-discard.txt +0 -0
- /package/dist/lib/prompts/{nudge → user/nudge}/nudge-extract.txt +0 -0
- /package/dist/lib/prompts/{system → user/system}/system-prompt-both.txt +0 -0
- /package/dist/lib/prompts/{system → user/system}/system-prompt-discard.txt +0 -0
- /package/dist/lib/prompts/{system → user/system}/system-prompt-extract.txt +0 -0
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,MA2GK,CAAA;AAEnB,eAAe,MAAM,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -20,18 +20,31 @@ 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;
|
|
36
|
+
// Use user-role prompts for reasoning models (second person),
|
|
37
|
+
// assistant-role prompts for non-reasoning models (first person)
|
|
38
|
+
const roleDir = state.isReasoningModel ? "user" : "assistant";
|
|
26
39
|
let promptName;
|
|
27
40
|
if (discardEnabled && extractEnabled) {
|
|
28
|
-
promptName =
|
|
41
|
+
promptName = `${roleDir}/system/system-prompt-both`;
|
|
29
42
|
}
|
|
30
43
|
else if (discardEnabled) {
|
|
31
|
-
promptName =
|
|
44
|
+
promptName = `${roleDir}/system/system-prompt-discard`;
|
|
32
45
|
}
|
|
33
46
|
else if (extractEnabled) {
|
|
34
|
-
promptName =
|
|
47
|
+
promptName = `${roleDir}/system/system-prompt-extract`;
|
|
35
48
|
}
|
|
36
49
|
else {
|
|
37
50
|
return;
|
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,OAAO,EAAE,CAAC;QAClB,OAAO,EAAE,CAAA;IACb,CAAC;IAED,2BAA2B;IAC3B,IAAI,OAAO,UAAU,KAAK,WAAW,EAAE,CAAC;QACpC,CAAC;QAAC,UAAkB,CAAC,mBAAmB,GAAG,KAAK,CAAA;IACpD,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IACvC,MAAM,KAAK,GAAG,kBAAkB,EAAE,CAAA;IAElC,MAAM,CAAC,IAAI,C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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;AAuG7C,eAAO,MAAM,sBAAsB,GAC/B,OAAO,YAAY,EACnB,QAAQ,YAAY,EACpB,QAAQ,MAAM,EACd,UAAU,SAAS,EAAE,KACtB,IA8CF,CAAA;AAED,eAAO,MAAM,KAAK,GACd,OAAO,YAAY,EACnB,QAAQ,MAAM,EACd,QAAQ,YAAY,EACpB,UAAU,SAAS,EAAE,KACtB,IAGF,CAAA"}
|
|
@@ -1,27 +1,32 @@
|
|
|
1
1
|
import { loadPrompt } from "../prompt";
|
|
2
|
-
import { extractParameterKey, buildToolIdList } from "./utils";
|
|
3
|
-
import { getLastUserMessage, isMessageCompacted } from "../shared-utils";
|
|
4
|
-
const PRUNED_TOOL_INPUT_REPLACEMENT = "[
|
|
2
|
+
import { extractParameterKey, buildToolIdList, createSyntheticUserMessage, createSyntheticAssistantMessage, } from "./utils";
|
|
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
|
-
const getNudgeString = (config) => {
|
|
6
|
+
const getNudgeString = (config, isReasoningModel) => {
|
|
7
7
|
const discardEnabled = config.tools.discard.enabled;
|
|
8
8
|
const extractEnabled = config.tools.extract.enabled;
|
|
9
|
+
const roleDir = isReasoningModel ? "user" : "assistant";
|
|
9
10
|
if (discardEnabled && extractEnabled) {
|
|
10
|
-
return loadPrompt(
|
|
11
|
+
return loadPrompt(`${roleDir}/nudge/nudge-both`);
|
|
11
12
|
}
|
|
12
13
|
else if (discardEnabled) {
|
|
13
|
-
return loadPrompt(
|
|
14
|
+
return loadPrompt(`${roleDir}/nudge/nudge-discard`);
|
|
14
15
|
}
|
|
15
16
|
else if (extractEnabled) {
|
|
16
|
-
return loadPrompt(
|
|
17
|
+
return loadPrompt(`${roleDir}/nudge/nudge-extract`);
|
|
17
18
|
}
|
|
18
19
|
return "";
|
|
19
20
|
};
|
|
20
|
-
const
|
|
21
|
+
const wrapPrunableToolsUser = (content) => `<prunable-tools>
|
|
21
22
|
The following tools have been invoked and are available for pruning. This list does not mandate immediate action. Consider your current goals and the resources you need before discarding valuable tool inputs or outputs. Consolidate your prunes for efficiency; it is rarely worth pruning a single tiny tool output. Keep the context free of noise.
|
|
22
23
|
${content}
|
|
23
24
|
</prunable-tools>`;
|
|
24
|
-
const
|
|
25
|
+
const wrapPrunableToolsAssistant = (content) => `<prunable-tools>
|
|
26
|
+
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.
|
|
27
|
+
${content}
|
|
28
|
+
</prunable-tools>`;
|
|
29
|
+
const getCooldownMessage = (config, isReasoningModel) => {
|
|
25
30
|
const discardEnabled = config.tools.discard.enabled;
|
|
26
31
|
const extractEnabled = config.tools.extract.enabled;
|
|
27
32
|
let toolName;
|
|
@@ -34,12 +39,11 @@ const getCooldownMessage = (config) => {
|
|
|
34
39
|
else {
|
|
35
40
|
toolName = "extract tool";
|
|
36
41
|
}
|
|
37
|
-
|
|
38
|
-
Context management was just performed. Do not use the ${toolName} again. A fresh list will be available after your next tool use
|
|
39
|
-
|
|
42
|
+
const message = isReasoningModel
|
|
43
|
+
? `Context management was just performed. Do not use the ${toolName} again. A fresh list will be available after your next tool use.`
|
|
44
|
+
: `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.`;
|
|
45
|
+
return `<prunable-tools>\n${message}\n</prunable-tools>`;
|
|
40
46
|
};
|
|
41
|
-
const SYNTHETIC_MESSAGE_ID = "msg_01234567890123456789012345";
|
|
42
|
-
const SYNTHETIC_PART_ID = "prt_01234567890123456789012345";
|
|
43
47
|
const buildPrunableToolsList = (state, config, logger, messages) => {
|
|
44
48
|
const lines = [];
|
|
45
49
|
const toolIdList = buildToolIdList(state, messages, logger);
|
|
@@ -69,20 +73,19 @@ const buildPrunableToolsList = (state, config, logger, messages) => {
|
|
|
69
73
|
if (lines.length === 0) {
|
|
70
74
|
return "";
|
|
71
75
|
}
|
|
72
|
-
|
|
76
|
+
const wrapFn = state.isReasoningModel ? wrapPrunableToolsUser : wrapPrunableToolsAssistant;
|
|
77
|
+
return wrapFn(lines.join("\n"));
|
|
73
78
|
};
|
|
74
79
|
export const insertPruneToolContext = (state, config, logger, messages) => {
|
|
75
80
|
if (!config.tools.discard.enabled && !config.tools.extract.enabled) {
|
|
76
81
|
return;
|
|
77
82
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
83
|
+
// For reasoning models, inject into user role; for non-reasoning, inject into assistant role
|
|
84
|
+
const isReasoningModel = state.isReasoningModel;
|
|
82
85
|
let prunableToolsContent;
|
|
83
86
|
if (state.lastToolPrune) {
|
|
84
87
|
logger.debug("Last tool was prune - injecting cooldown message");
|
|
85
|
-
prunableToolsContent = getCooldownMessage(config);
|
|
88
|
+
prunableToolsContent = getCooldownMessage(config, isReasoningModel);
|
|
86
89
|
}
|
|
87
90
|
else {
|
|
88
91
|
const prunableToolsList = buildPrunableToolsList(state, config, logger, messages);
|
|
@@ -94,33 +97,24 @@ export const insertPruneToolContext = (state, config, logger, messages) => {
|
|
|
94
97
|
if (config.tools.settings.nudgeEnabled &&
|
|
95
98
|
state.nudgeCounter >= config.tools.settings.nudgeFrequency) {
|
|
96
99
|
logger.info("Inserting prune nudge message");
|
|
97
|
-
nudgeString = "\n" + getNudgeString(config);
|
|
100
|
+
nudgeString = "\n" + getNudgeString(config, isReasoningModel);
|
|
98
101
|
}
|
|
99
102
|
prunableToolsContent = prunableToolsList + nudgeString;
|
|
100
103
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
id: SYNTHETIC_PART_ID,
|
|
116
|
-
sessionID: lastUserMessage.info.sessionID,
|
|
117
|
-
messageID: SYNTHETIC_MESSAGE_ID,
|
|
118
|
-
type: "text",
|
|
119
|
-
text: prunableToolsContent,
|
|
120
|
-
},
|
|
121
|
-
],
|
|
122
|
-
};
|
|
123
|
-
messages.push(userMessage);
|
|
104
|
+
if (isReasoningModel) {
|
|
105
|
+
const lastUserMessage = getLastUserMessage(messages);
|
|
106
|
+
if (!lastUserMessage) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
messages.push(createSyntheticUserMessage(lastUserMessage, prunableToolsContent));
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
const lastAssistantMessage = getLastAssistantMessage(messages);
|
|
113
|
+
if (!lastAssistantMessage) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
messages.push(createSyntheticAssistantMessage(lastAssistantMessage, prunableToolsContent));
|
|
117
|
+
}
|
|
124
118
|
};
|
|
125
119
|
export const prune = (state, logger, config, messages) => {
|
|
126
120
|
pruneToolOutputs(state, logger, messages);
|
|
@@ -138,7 +132,6 @@ const pruneToolOutputs = (state, logger, messages) => {
|
|
|
138
132
|
if (!state.prune.toolIds.includes(part.callID)) {
|
|
139
133
|
continue;
|
|
140
134
|
}
|
|
141
|
-
// Skip write and edit tools - their inputs are pruned instead
|
|
142
135
|
if (part.tool === "write" || part.tool === "edit") {
|
|
143
136
|
continue;
|
|
144
137
|
}
|
|
@@ -157,15 +150,12 @@ const pruneToolInputs = (state, logger, messages) => {
|
|
|
157
150
|
if (!state.prune.toolIds.includes(part.callID)) {
|
|
158
151
|
continue;
|
|
159
152
|
}
|
|
160
|
-
// Only prune inputs for write and edit tools
|
|
161
153
|
if (part.tool !== "write" && part.tool !== "edit") {
|
|
162
154
|
continue;
|
|
163
155
|
}
|
|
164
|
-
// Don't prune yet if tool is still pending or running
|
|
165
156
|
if (part.state.status === "pending" || part.state.status === "running") {
|
|
166
157
|
continue;
|
|
167
158
|
}
|
|
168
|
-
// Write tool has content field, edit tool has oldString/newString fields
|
|
169
159
|
if (part.tool === "write" && part.state.input?.content !== undefined) {
|
|
170
160
|
part.state.input.content = PRUNED_TOOL_INPUT_REPLACEMENT;
|
|
171
161
|
}
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"prune.js","sourceRoot":"","sources":["../../../lib/messages/prune.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,OAAO,EACH,mBAAmB,EACnB,eAAe,EACf,0BAA0B,EAC1B,+BAA+B,GAClC,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEjG,MAAM,6BAA6B,GAC/B,gGAAgG,CAAA;AACpG,MAAM,8BAA8B,GAChC,+EAA+E,CAAA;AAEnF,MAAM,cAAc,GAAG,CAAC,MAAoB,EAAE,gBAAyB,EAAU,EAAE;IAC/E,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAA;IACnD,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAA;IACnD,MAAM,OAAO,GAAG,gBAAgB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAA;IAEvD,IAAI,cAAc,IAAI,cAAc,EAAE,CAAC;QACnC,OAAO,UAAU,CAAC,GAAG,OAAO,mBAAmB,CAAC,CAAA;IACpD,CAAC;SAAM,IAAI,cAAc,EAAE,CAAC;QACxB,OAAO,UAAU,CAAC,GAAG,OAAO,sBAAsB,CAAC,CAAA;IACvD,CAAC;SAAM,IAAI,cAAc,EAAE,CAAC;QACxB,OAAO,UAAU,CAAC,GAAG,OAAO,sBAAsB,CAAC,CAAA;IACvD,CAAC;IACD,OAAO,EAAE,CAAA;AACb,CAAC,CAAA;AAED,MAAM,qBAAqB,GAAG,CAAC,OAAe,EAAU,EAAE,CAAC;;EAEzD,OAAO;kBACS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AAC;AACL,CAAC,CAAA"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Logger } from "../logger";
|
|
2
2
|
import type { SessionState, WithParts } from "../state";
|
|
3
|
+
export declare const createSyntheticUserMessage: (baseMessage: WithParts, content: string) => WithParts;
|
|
4
|
+
export declare const createSyntheticAssistantMessage: (baseMessage: WithParts, content: string) => WithParts;
|
|
3
5
|
/**
|
|
4
6
|
* Extracts a human-readable key from tool metadata for display purposes.
|
|
5
7
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../lib/messages/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAElC,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../lib/messages/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAElC,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAMvD,eAAO,MAAM,0BAA0B,GAAI,aAAa,SAAS,EAAE,SAAS,MAAM,KAAG,SAwBpF,CAAA;AAED,eAAO,MAAM,+BAA+B,GACxC,aAAa,SAAS,EACtB,SAAS,MAAM,KAChB,SA0BF,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,MAAM,EAAE,YAAY,GAAG,KAAG,MA6EnE,CAAA;AAED,wBAAgB,eAAe,CAC3B,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,SAAS,EAAE,EACrB,MAAM,EAAE,MAAM,GACf,MAAM,EAAE,CAeV"}
|
|
@@ -1,4 +1,58 @@
|
|
|
1
1
|
import { isMessageCompacted } from "../shared-utils";
|
|
2
|
+
const SYNTHETIC_MESSAGE_ID = "msg_01234567890123456789012345";
|
|
3
|
+
const SYNTHETIC_PART_ID = "prt_01234567890123456789012345";
|
|
4
|
+
export const createSyntheticUserMessage = (baseMessage, content) => {
|
|
5
|
+
const userInfo = baseMessage.info;
|
|
6
|
+
return {
|
|
7
|
+
info: {
|
|
8
|
+
id: SYNTHETIC_MESSAGE_ID,
|
|
9
|
+
sessionID: userInfo.sessionID,
|
|
10
|
+
role: "user",
|
|
11
|
+
time: { created: Date.now() },
|
|
12
|
+
agent: userInfo.agent || "code",
|
|
13
|
+
model: {
|
|
14
|
+
providerID: userInfo.model.providerID,
|
|
15
|
+
modelID: userInfo.model.modelID,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
parts: [
|
|
19
|
+
{
|
|
20
|
+
id: SYNTHETIC_PART_ID,
|
|
21
|
+
sessionID: userInfo.sessionID,
|
|
22
|
+
messageID: SYNTHETIC_MESSAGE_ID,
|
|
23
|
+
type: "text",
|
|
24
|
+
text: content,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export const createSyntheticAssistantMessage = (baseMessage, content) => {
|
|
30
|
+
const assistantInfo = baseMessage.info;
|
|
31
|
+
return {
|
|
32
|
+
info: {
|
|
33
|
+
id: SYNTHETIC_MESSAGE_ID,
|
|
34
|
+
sessionID: assistantInfo.sessionID,
|
|
35
|
+
role: "assistant",
|
|
36
|
+
parentID: assistantInfo.parentID,
|
|
37
|
+
modelID: assistantInfo.modelID,
|
|
38
|
+
providerID: assistantInfo.providerID,
|
|
39
|
+
time: { created: Date.now() },
|
|
40
|
+
tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } },
|
|
41
|
+
cost: 0,
|
|
42
|
+
path: assistantInfo.path,
|
|
43
|
+
mode: assistantInfo.mode,
|
|
44
|
+
},
|
|
45
|
+
parts: [
|
|
46
|
+
{
|
|
47
|
+
id: SYNTHETIC_PART_ID,
|
|
48
|
+
sessionID: assistantInfo.sessionID,
|
|
49
|
+
messageID: SYNTHETIC_MESSAGE_ID,
|
|
50
|
+
type: "text",
|
|
51
|
+
text: content,
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
};
|
|
55
|
+
};
|
|
2
56
|
/**
|
|
3
57
|
* Extracts a human-readable key from tool metadata for display purposes.
|
|
4
58
|
*/
|
|
@@ -6,6 +60,17 @@ export const extractParameterKey = (tool, parameters) => {
|
|
|
6
60
|
if (!parameters)
|
|
7
61
|
return "";
|
|
8
62
|
if (tool === "read" && parameters.filePath) {
|
|
63
|
+
const offset = parameters.offset;
|
|
64
|
+
const limit = parameters.limit;
|
|
65
|
+
if (offset !== undefined && limit !== undefined) {
|
|
66
|
+
return `${parameters.filePath} (lines ${offset}-${offset + limit})`;
|
|
67
|
+
}
|
|
68
|
+
if (offset !== undefined) {
|
|
69
|
+
return `${parameters.filePath} (lines ${offset}+)`;
|
|
70
|
+
}
|
|
71
|
+
if (limit !== undefined) {
|
|
72
|
+
return `${parameters.filePath} (lines 0-${limit})`;
|
|
73
|
+
}
|
|
9
74
|
return parameters.filePath;
|
|
10
75
|
}
|
|
11
76
|
if (tool === "write" && parameters.filePath) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../lib/messages/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../lib/messages/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAIpD,MAAM,oBAAoB,GAAG,gCAAgC,CAAA;AAC7D,MAAM,iBAAiB,GAAG,gCAAgC,CAAA;AAE1D,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,WAAsB,EAAE,OAAe,EAAa,EAAE;IAC7F,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAmB,CAAA;IAChD,OAAO;QACH,IAAI,EAAE;YACF,EAAE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AO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;gBAC7B,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;IACD,OAAO,OAAO,CAAA;AAClB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<instruction name=context_management_required>
|
|
2
|
+
**CRITICAL CONTEXT WARNING:** My context window is filling with tool outputs. I must adhere strictly to context hygiene.
|
|
3
|
+
|
|
4
|
+
**Immediate Actions Required:**
|
|
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
|
+
|
|
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
|
+
</instruction>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<instruction name=context_management_required>
|
|
2
|
+
**CRITICAL CONTEXT WARNING:** My context window is filling with tool outputs. I must adhere strictly to context hygiene.
|
|
3
|
+
|
|
4
|
+
**Immediate Actions Required:**
|
|
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
|
+
|
|
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
|
+
</instruction>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<instruction name=context_management_required>
|
|
2
|
+
**CRITICAL CONTEXT WARNING:** My context window is filling with tool outputs. I must adhere strictly to context hygiene.
|
|
3
|
+
|
|
4
|
+
**Immediate Actions Required:**
|
|
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
|
+
|
|
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
|
+
</instruction>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<system-reminder>
|
|
2
|
+
<instruction name=context_management_protocol policy_level=critical>
|
|
3
|
+
|
|
4
|
+
ENVIRONMENT
|
|
5
|
+
You are operating in a context-constrained environment and thus must proactively manage your context window using the `discard` 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
|
+
|
|
7
|
+
TWO TOOLS FOR CONTEXT MANAGEMENT
|
|
8
|
+
- `discard`: Remove tool outputs that are no longer needed (completed tasks, noise, outdated info). No preservation of content.
|
|
9
|
+
- `extract`: Extract key findings into distilled knowledge before removing raw outputs. Use when you need to preserve information.
|
|
10
|
+
|
|
11
|
+
CHOOSING THE RIGHT TOOL
|
|
12
|
+
Ask: "Is this output clearly noise or irrelevant?"
|
|
13
|
+
- **Yes** → `discard` (pure cleanup, no preservation)
|
|
14
|
+
- **No** → `extract` (default - preserves key findings)
|
|
15
|
+
|
|
16
|
+
Common scenarios:
|
|
17
|
+
- Task complete, no valuable context → `discard`
|
|
18
|
+
- Task complete, insights worth remembering → `extract`
|
|
19
|
+
- Noise, irrelevant, or superseded outputs → `discard`
|
|
20
|
+
- Valuable context needed later but raw output too large → `extract`
|
|
21
|
+
|
|
22
|
+
PRUNE METHODICALLY - BATCH YOUR ACTIONS
|
|
23
|
+
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.
|
|
24
|
+
|
|
25
|
+
You WILL evaluate pruning when ANY of these are true:
|
|
26
|
+
- Task or sub-task is complete
|
|
27
|
+
- You are about to start a new phase of work
|
|
28
|
+
- Write or edit operations are complete (pruning removes the large input content)
|
|
29
|
+
|
|
30
|
+
You MUST NOT prune when:
|
|
31
|
+
- The tool output will be needed for upcoming implementation work
|
|
32
|
+
- The output contains files or context you'll need to reference when making edits
|
|
33
|
+
|
|
34
|
+
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.
|
|
35
|
+
|
|
36
|
+
NOTES
|
|
37
|
+
When in doubt, keep it. Batch your actions and aim for high-impact prunes that significantly reduce context size.
|
|
38
|
+
FAILURE TO PRUNE will result in context leakage and DEGRADED PERFORMANCES.
|
|
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>.
|
|
40
|
+
|
|
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.
|
|
42
|
+
|
|
43
|
+
</instruction>
|
|
44
|
+
</system-reminder>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<system-reminder>
|
|
2
|
+
<instruction name=context_management_protocol policy_level=critical>
|
|
3
|
+
|
|
4
|
+
ENVIRONMENT
|
|
5
|
+
You are operating in a context-constrained environment and thus must proactively manage your context window using the `discard` tool. A <prunable-tools> list is injected by the environment as an assistant message, and always contains up to date information. Use this information when deciding what to discard.
|
|
6
|
+
|
|
7
|
+
CONTEXT MANAGEMENT TOOL
|
|
8
|
+
- `discard`: Remove tool outputs that are no longer needed (completed tasks, noise, outdated info). No preservation of content.
|
|
9
|
+
|
|
10
|
+
DISCARD METHODICALLY - BATCH YOUR ACTIONS
|
|
11
|
+
Every tool call adds to your context debt. You MUST pay this down regularly and be on top of context accumulation by discarding. Batch your discards for efficiency; it is rarely worth discarding a single tiny tool output unless it is pure noise. Evaluate what SHOULD be discarded before jumping the gun.
|
|
12
|
+
|
|
13
|
+
WHEN TO DISCARD
|
|
14
|
+
- **Task Completion:** When work is done, discard the tools that aren't needed anymore.
|
|
15
|
+
- **Noise Removal:** If outputs are irrelevant, unhelpful, or superseded by newer info, discard them.
|
|
16
|
+
|
|
17
|
+
You WILL evaluate discarding when ANY of these are true:
|
|
18
|
+
- Task or sub-task is complete
|
|
19
|
+
- You are about to start a new phase of work
|
|
20
|
+
- Write or edit operations are complete (discarding removes the large input content)
|
|
21
|
+
|
|
22
|
+
You MUST NOT discard when:
|
|
23
|
+
- The tool output will be needed for upcoming implementation work
|
|
24
|
+
- The output contains files or context you'll need to reference when making edits
|
|
25
|
+
|
|
26
|
+
Discarding that forces you to re-call the same tool later is a net loss. Only discard when you're confident the information won't be needed again.
|
|
27
|
+
|
|
28
|
+
NOTES
|
|
29
|
+
When in doubt, keep it. Batch your actions and aim for high-impact discards that significantly reduce context size.
|
|
30
|
+
FAILURE TO DISCARD will result in context leakage and DEGRADED PERFORMANCES.
|
|
31
|
+
There may be tools in session context that do not appear in the <prunable-tools> list, this is expected, you can ONLY discard what you see in <prunable-tools>.
|
|
32
|
+
|
|
33
|
+
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.
|
|
34
|
+
|
|
35
|
+
</instruction>
|
|
36
|
+
</system-reminder>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<system-reminder>
|
|
2
|
+
<instruction name=context_management_protocol policy_level=critical>
|
|
3
|
+
|
|
4
|
+
ENVIRONMENT
|
|
5
|
+
You are operating in a context-constrained environment and thus must proactively manage your context window using the `extract` tool. A <prunable-tools> list is injected by the environment as an assistant message, and always contains up to date information. Use this information when deciding what to extract.
|
|
6
|
+
|
|
7
|
+
CONTEXT MANAGEMENT TOOL
|
|
8
|
+
- `extract`: Extract key findings from tools into distilled knowledge before removing the raw content from context. Use this to preserve important information while reducing context size.
|
|
9
|
+
|
|
10
|
+
EXTRACT METHODICALLY - BATCH YOUR ACTIONS
|
|
11
|
+
Every tool call adds to your context debt. You MUST pay this down regularly and be on top of context accumulation by extracting. Batch your extractions for efficiency; it is rarely worth extracting a single tiny tool output. Evaluate what SHOULD be extracted before jumping the gun.
|
|
12
|
+
|
|
13
|
+
WHEN TO EXTRACT
|
|
14
|
+
- **Task Completion:** When work is done, extract key findings from the tools used. Scale distillation depth to the value of the content.
|
|
15
|
+
- **Knowledge Preservation:** When you have valuable context you want to preserve but need to reduce size, use high-fidelity distillation. Your distillation must be comprehensive, capturing technical details (signatures, logic, constraints) such that the raw output is no longer needed. THINK: high signal, complete technical substitute.
|
|
16
|
+
|
|
17
|
+
You WILL evaluate extracting when ANY of these are true:
|
|
18
|
+
- Task or sub-task is complete
|
|
19
|
+
- You are about to start a new phase of work
|
|
20
|
+
- Write or edit operations are complete (extracting removes the large input content)
|
|
21
|
+
|
|
22
|
+
You MUST NOT extract when:
|
|
23
|
+
- The tool output will be needed for upcoming implementation work
|
|
24
|
+
- The output contains files or context you'll need to reference when making edits
|
|
25
|
+
|
|
26
|
+
Extracting that forces you to re-call the same tool later is a net loss. Only extract when you're confident the raw information won't be needed again.
|
|
27
|
+
|
|
28
|
+
NOTES
|
|
29
|
+
When in doubt, keep it. Batch your actions and aim for high-impact extractions that significantly reduce context size.
|
|
30
|
+
FAILURE TO EXTRACT will result in context leakage and DEGRADED PERFORMANCES.
|
|
31
|
+
There may be tools in session context that do not appear in the <prunable-tools> list, this is expected, you can ONLY extract what you see in <prunable-tools>.
|
|
32
|
+
|
|
33
|
+
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.
|
|
34
|
+
|
|
35
|
+
</instruction>
|
|
36
|
+
</system-reminder>
|
|
@@ -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,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,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AAO,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,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAC7B,MAAW,EACX,KAAmB,EACnB,MAAc,EACd,QAAqB,EACR,EAAE;IACf,MAAM,eAAe,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAA;IACpD,IAAI,CAAC,eAAe,EAAE,CAAC;QACnB,OAAM;IACV,CAAC;IAED,MAAM,aAAa,GAAG,eAAe,CAAC,IAAI,CAAC,SAAS,CAAA;IAEpD,IAAI,KAAK,CAAC,SAAS,KAAK,IAAI,IAAI,KAAK,CAAC,SAAS,KAAK,aAAa,EAAE,CAAC;QAChE,MAAM,CAAC,IAAI,CAAC,oBAAoB,KAAK,CAAC,SAAS,OAAO,aAAa,EAAE,CAAC,CAAA;QACtE,IAAI,CAAC;YACD,MAAM,wBAAwB,CAAC,MAAM,EAAE,KAAK,E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AM,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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CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,GAAqB;IACnD,OAAO,IAAI,CAAC;QACR,WAAW,EAAE,wBAAwB;QACrC,IAAI,EAAE;YACF,GAAG,EAAE,IAAI,CAAC,MAAM;iBACX,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;iBAC3B,QAAQ,CAAC,kEAAkE,CAAC;YACjF,YAAY,EAAE,IAAI,CAAC,MAAM;iBACpB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;iBAC3B,QAAQ,CACL,0FAA0F,CAC7F;SACR;QACD,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO;YACvB,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACvD,GAAG,CAAC,MAAM,CAAC,KAAK,CACZ,4CAA4C,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CACtE,CAAA;gBACD,OAAO,2EAA2E,CAAA;YACtF,CAAC;YAED,8CAA8C;YAC9C,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,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.0
|
|
4
|
+
"version": "1.1.0",
|
|
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",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|