@tarquinen/opencode-dcp 2.1.6 → 2.2.0-beta0
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/README.md +30 -49
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -29
- package/dist/index.js.map +1 -1
- package/dist/lib/commands/context.d.ts.map +1 -1
- package/dist/lib/commands/context.js +36 -8
- package/dist/lib/commands/context.js.map +1 -1
- package/dist/lib/commands/help.d.ts.map +1 -1
- package/dist/lib/commands/help.js +2 -6
- package/dist/lib/commands/help.js.map +1 -1
- package/dist/lib/commands/manual.d.ts +1 -3
- package/dist/lib/commands/manual.d.ts.map +1 -1
- package/dist/lib/commands/manual.js +4 -43
- package/dist/lib/commands/manual.js.map +1 -1
- package/dist/lib/commands/sweep.js +1 -1
- package/dist/lib/commands/sweep.js.map +1 -1
- package/dist/lib/compress-logger.d.ts +15 -0
- package/dist/lib/compress-logger.d.ts.map +1 -0
- package/dist/lib/compress-logger.js +132 -0
- package/dist/lib/compress-logger.js.map +1 -0
- package/dist/lib/config.d.ts +5 -20
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +172 -346
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/hooks.d.ts +7 -0
- package/dist/lib/hooks.d.ts.map +1 -1
- package/dist/lib/hooks.js +23 -16
- package/dist/lib/hooks.js.map +1 -1
- package/dist/lib/logger.d.ts.map +1 -1
- package/dist/lib/logger.js +6 -0
- package/dist/lib/logger.js.map +1 -1
- package/dist/lib/messages/index.d.ts +2 -2
- package/dist/lib/messages/index.d.ts.map +1 -1
- package/dist/lib/messages/index.js +2 -2
- package/dist/lib/messages/index.js.map +1 -1
- package/dist/lib/messages/inject/inject.d.ts +6 -0
- package/dist/lib/messages/inject/inject.d.ts.map +1 -0
- package/dist/lib/messages/inject/inject.js +99 -0
- package/dist/lib/messages/inject/inject.js.map +1 -0
- package/dist/lib/messages/inject/utils.d.ts +20 -0
- package/dist/lib/messages/inject/utils.d.ts.map +1 -0
- package/dist/lib/messages/inject/utils.js +137 -0
- package/dist/lib/messages/inject/utils.js.map +1 -0
- package/dist/lib/messages/prune.js +7 -7
- package/dist/lib/messages/prune.js.map +1 -1
- package/dist/lib/messages/utils.d.ts +16 -28
- package/dist/lib/messages/utils.d.ts.map +1 -1
- package/dist/lib/messages/utils.js +40 -133
- package/dist/lib/messages/utils.js.map +1 -1
- package/dist/lib/prompts/_codegen/system.generated.d.ts +1 -1
- package/dist/lib/prompts/_codegen/system.generated.d.ts.map +1 -1
- package/dist/lib/prompts/_codegen/system.generated.js +36 -32
- package/dist/lib/prompts/_codegen/system.generated.js.map +1 -1
- package/dist/lib/prompts/compress.d.ts +2 -0
- package/dist/lib/prompts/compress.d.ts.map +1 -0
- package/dist/lib/prompts/compress.js +122 -0
- package/dist/lib/prompts/compress.js.map +1 -0
- package/dist/lib/prompts/index.d.ts +6 -10
- package/dist/lib/prompts/index.d.ts.map +1 -1
- package/dist/lib/prompts/index.js +17 -40
- package/dist/lib/prompts/index.js.map +1 -1
- package/dist/lib/prompts/iteration-nudge.d.ts +2 -0
- package/dist/lib/prompts/iteration-nudge.d.ts.map +1 -0
- package/dist/lib/prompts/iteration-nudge.js +9 -0
- package/dist/lib/prompts/iteration-nudge.js.map +1 -0
- package/dist/lib/prompts/nudge.d.ts +2 -0
- package/dist/lib/prompts/nudge.d.ts.map +1 -0
- package/dist/lib/prompts/nudge.js +40 -0
- package/dist/lib/prompts/nudge.js.map +1 -0
- package/dist/lib/prompts/turn-nudge.d.ts +2 -0
- package/dist/lib/prompts/turn-nudge.d.ts.map +1 -0
- package/dist/lib/prompts/turn-nudge.js +12 -0
- package/dist/lib/prompts/turn-nudge.js.map +1 -0
- package/dist/lib/state/persistence.d.ts +6 -0
- package/dist/lib/state/persistence.d.ts.map +1 -1
- package/dist/lib/state/persistence.js +58 -38
- package/dist/lib/state/persistence.js.map +1 -1
- package/dist/lib/state/state.d.ts.map +1 -1
- package/dist/lib/state/state.js +20 -5
- package/dist/lib/state/state.js.map +1 -1
- package/dist/lib/state/tool-cache.d.ts.map +1 -1
- package/dist/lib/state/tool-cache.js +3 -17
- package/dist/lib/state/tool-cache.js.map +1 -1
- package/dist/lib/state/types.d.ts +7 -2
- package/dist/lib/state/types.d.ts.map +1 -1
- package/dist/lib/state/utils.d.ts +1 -0
- package/dist/lib/state/utils.d.ts.map +1 -1
- package/dist/lib/state/utils.js +33 -6
- package/dist/lib/state/utils.js.map +1 -1
- package/dist/lib/strategies/index.d.ts +0 -1
- package/dist/lib/strategies/index.d.ts.map +1 -1
- package/dist/lib/strategies/index.js +0 -1
- package/dist/lib/strategies/index.js.map +1 -1
- package/dist/lib/strategies/utils.d.ts +1 -0
- package/dist/lib/strategies/utils.d.ts.map +1 -1
- package/dist/lib/strategies/utils.js +15 -0
- package/dist/lib/strategies/utils.js.map +1 -1
- package/dist/lib/tools/compress-utils.d.ts +7 -4
- package/dist/lib/tools/compress-utils.d.ts.map +1 -1
- package/dist/lib/tools/compress-utils.js +34 -25
- package/dist/lib/tools/compress-utils.js.map +1 -1
- package/dist/lib/tools/compress.d.ts +2 -2
- package/dist/lib/tools/compress.d.ts.map +1 -1
- package/dist/lib/tools/compress.js +21 -58
- package/dist/lib/tools/compress.js.map +1 -1
- package/dist/lib/tools/index.d.ts +1 -3
- package/dist/lib/tools/index.d.ts.map +1 -1
- package/dist/lib/tools/index.js +0 -2
- package/dist/lib/tools/index.js.map +1 -1
- package/dist/lib/tools/types.d.ts +1 -1
- package/dist/lib/tools/types.d.ts.map +1 -1
- package/dist/lib/ui/notification.d.ts +2 -2
- package/dist/lib/ui/notification.d.ts.map +1 -1
- package/dist/lib/ui/notification.js +31 -28
- package/dist/lib/ui/notification.js.map +1 -1
- package/dist/lib/ui/utils.d.ts +3 -4
- package/dist/lib/ui/utils.d.ts.map +1 -1
- package/dist/lib/ui/utils.js +165 -24
- package/dist/lib/ui/utils.js.map +1 -1
- package/package.json +2 -1
- package/dist/lib/messages/inject.d.ts +0 -14
- package/dist/lib/messages/inject.d.ts.map +0 -1
- package/dist/lib/messages/inject.js +0 -266
- package/dist/lib/messages/inject.js.map +0 -1
- package/dist/lib/prompts/_codegen/compress-nudge.generated.d.ts +0 -2
- package/dist/lib/prompts/_codegen/compress-nudge.generated.d.ts.map +0 -1
- package/dist/lib/prompts/_codegen/compress-nudge.generated.js +0 -15
- package/dist/lib/prompts/_codegen/compress-nudge.generated.js.map +0 -1
- package/dist/lib/prompts/_codegen/compress.generated.d.ts +0 -2
- package/dist/lib/prompts/_codegen/compress.generated.d.ts.map +0 -1
- package/dist/lib/prompts/_codegen/compress.generated.js +0 -66
- package/dist/lib/prompts/_codegen/compress.generated.js.map +0 -1
- package/dist/lib/prompts/_codegen/distill.generated.d.ts +0 -2
- package/dist/lib/prompts/_codegen/distill.generated.d.ts.map +0 -1
- package/dist/lib/prompts/_codegen/distill.generated.js +0 -33
- package/dist/lib/prompts/_codegen/distill.generated.js.map +0 -1
- package/dist/lib/prompts/_codegen/nudge.generated.d.ts +0 -2
- package/dist/lib/prompts/_codegen/nudge.generated.d.ts.map +0 -1
- package/dist/lib/prompts/_codegen/nudge.generated.js +0 -17
- package/dist/lib/prompts/_codegen/nudge.generated.js.map +0 -1
- package/dist/lib/prompts/_codegen/prune.generated.d.ts +0 -2
- package/dist/lib/prompts/_codegen/prune.generated.d.ts.map +0 -1
- package/dist/lib/prompts/_codegen/prune.generated.js +0 -23
- package/dist/lib/prompts/_codegen/prune.generated.js.map +0 -1
- package/dist/lib/tools/distill.d.ts +0 -4
- package/dist/lib/tools/distill.d.ts.map +0 -1
- package/dist/lib/tools/distill.js +0 -41
- package/dist/lib/tools/distill.js.map +0 -1
- package/dist/lib/tools/prune-shared.d.ts +0 -6
- package/dist/lib/tools/prune-shared.d.ts.map +0 -1
- package/dist/lib/tools/prune-shared.js +0 -113
- package/dist/lib/tools/prune-shared.js.map +0 -1
- package/dist/lib/tools/prune.d.ts +0 -4
- package/dist/lib/tools/prune.d.ts.map +0 -1
- package/dist/lib/tools/prune.js +0 -28
- package/dist/lib/tools/prune.js.map +0 -1
package/dist/lib/ui/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../lib/ui/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../lib/ui/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAExD,SAAS,mBAAmB,CAAC,IAAY,EAAE,UAAe;IACtD,IAAI,CAAC,UAAU;QAAE,OAAO,EAAE,CAAA;IAE1B,IAAI,IAAI,KAAK,MAAM,IAAI,UAAU,CAAC,QAAQ,EAAE,CAAC;QACzC,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAA;QAChC,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAA;QAC9B,IAAI,MAAM,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YAC9C,OAAO,GAAG,UAAU,CAAC,QAAQ,WAAW,MAAM,IAAI,MAAM,GAAG,KAAK,GAAG,CAAA;QACvE,CAAC;QACD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACvB,OAAO,GAAG,UAAU,CAAC,QAAQ,WAAW,MAAM,IAAI,CAAA;QACtD,CAAC;QACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACtB,OAAO,GAAG,UAAU,CAAC,QAAQ,aAAa,KAAK,GAAG,CAAA;QACtD,CAAC;QACD,OAAO,UAAU,CAAC,QAAQ,CAAA;IAC9B,CAAC;IAED,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,WAAW,CAAC,IAAI,UAAU,CAAC,QAAQ,EAAE,CAAC;QAC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AChB,CAAC;AAED,MAAM,UAAU,0BAA0B,CACtC,SAAmB,EACnB,YAA6C,EAC7C,gBAAyB;IAEzB,MAAM,KAAK,GAAa,EAAE,CAAA;IAC1B,KAAK,CAAC,IAAI,CAAC,oCAAoC,SAAS,CAAC,MAAM,gBAAgB,CAAC,CAAA;IAChF,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAEd,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,KAAK,CAAC,IAAI,CAAC,wBAAwB,SAAS,CAAC,MAAM,IAAI,CAAC,CAAA;QACxD,KAAK,CAAC,IAAI,CAAC,GAAG,qBAAqB,CAAC,SAAS,EAAE,YAAY,EAAE,gBAAgB,CAAC,CAAC,CAAA;IACnF,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAA;AAClC,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": "2.
|
|
4
|
+
"version": "2.2.0-beta0",
|
|
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",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@anthropic-ai/tokenizer": "^0.0.4",
|
|
46
46
|
"@opencode-ai/sdk": "^1.1.48",
|
|
47
|
+
"fuzzball": "^2.2.3",
|
|
47
48
|
"jsonc-parser": "^3.3.1",
|
|
48
49
|
"zod": "^4.3.6"
|
|
49
50
|
},
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { SessionState, WithParts } from "../state";
|
|
2
|
-
import type { Logger } from "../logger";
|
|
3
|
-
import type { PluginConfig } from "../config";
|
|
4
|
-
export declare const wrapPrunableTools: (content: string) => string;
|
|
5
|
-
export declare const wrapCompressContext: (messageCount: number) => string;
|
|
6
|
-
export declare const wrapCooldownMessage: (flags: {
|
|
7
|
-
prune: boolean;
|
|
8
|
-
distill: boolean;
|
|
9
|
-
compress: boolean;
|
|
10
|
-
}) => string;
|
|
11
|
-
export declare const buildPrunableToolsList: (state: SessionState, config: PluginConfig, logger: Logger) => string;
|
|
12
|
-
export declare const insertPruneToolContext: (state: SessionState, config: PluginConfig, logger: Logger, messages: WithParts[]) => void;
|
|
13
|
-
export declare const insertMessageIdContext: (state: SessionState, config: PluginConfig, messages: WithParts[]) => void;
|
|
14
|
-
//# sourceMappingURL=inject.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inject.d.ts","sourceRoot":"","sources":["../../../lib/messages/inject.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+B7C,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,KAAG,MAKnD,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,cAAc,MAAM,KAAG,MAIvC,CAAA;AAEpB,eAAO,MAAM,mBAAmB,GAAI,OAAO;IACvC,KAAK,EAAE,OAAO,CAAA;IACd,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,OAAO,CAAA;CACpB,KAAG,MAmBH,CAAA;AAwGD,eAAO,MAAM,sBAAsB,GAC/B,OAAO,YAAY,EACnB,QAAQ,YAAY,EACpB,QAAQ,MAAM,KACf,MAiDF,CAAA;AAED,eAAO,MAAM,sBAAsB,GAC/B,OAAO,YAAY,EACnB,QAAQ,YAAY,EACpB,QAAQ,MAAM,EACd,UAAU,SAAS,EAAE,KACtB,IA2FF,CAAA;AAED,eAAO,MAAM,sBAAsB,GAC/B,OAAO,YAAY,EACnB,QAAQ,YAAY,EACpB,UAAU,SAAS,EAAE,KACtB,IAuCF,CAAA"}
|
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
import { formatMessageIdTag } from "../message-ids";
|
|
2
|
-
import { renderNudge, renderCompressNudge } from "../prompts";
|
|
3
|
-
import { extractParameterKey, createSyntheticTextPart, createSyntheticToolPart, isIgnoredUserMessage, appendMessageIdTagToToolOutput, findLastToolPart, } from "./utils";
|
|
4
|
-
import { getFilePathsFromParameters, isProtected } from "../protected-file-patterns";
|
|
5
|
-
import { getLastUserMessage, isMessageCompacted } from "../shared-utils";
|
|
6
|
-
import { getCurrentTokenUsage } from "../strategies/utils";
|
|
7
|
-
function parsePercentageString(value, total) {
|
|
8
|
-
if (!value.endsWith("%"))
|
|
9
|
-
return undefined;
|
|
10
|
-
const percent = parseFloat(value.slice(0, -1));
|
|
11
|
-
if (isNaN(percent)) {
|
|
12
|
-
return undefined;
|
|
13
|
-
}
|
|
14
|
-
const roundedPercent = Math.round(percent);
|
|
15
|
-
const clampedPercent = Math.max(0, Math.min(100, roundedPercent));
|
|
16
|
-
return Math.round((clampedPercent / 100) * total);
|
|
17
|
-
}
|
|
18
|
-
// XML wrappers
|
|
19
|
-
export const wrapPrunableTools = (content) => {
|
|
20
|
-
return `<prunable-tools>
|
|
21
|
-
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 pruning 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
|
-
${content}
|
|
23
|
-
</prunable-tools>`;
|
|
24
|
-
};
|
|
25
|
-
export const wrapCompressContext = (messageCount) => `<compress-context>
|
|
26
|
-
Compress available. Conversation: ${messageCount} messages.
|
|
27
|
-
Compress collapses completed task sequences or exploration phases into summaries.
|
|
28
|
-
Uses ID boundaries [startId, endId, topic, summary].
|
|
29
|
-
</compress-context>`;
|
|
30
|
-
export const wrapCooldownMessage = (flags) => {
|
|
31
|
-
const enabledTools = [];
|
|
32
|
-
if (flags.distill)
|
|
33
|
-
enabledTools.push("distill");
|
|
34
|
-
if (flags.compress)
|
|
35
|
-
enabledTools.push("compress");
|
|
36
|
-
if (flags.prune)
|
|
37
|
-
enabledTools.push("prune");
|
|
38
|
-
let toolName;
|
|
39
|
-
if (enabledTools.length === 0) {
|
|
40
|
-
toolName = "pruning tools";
|
|
41
|
-
}
|
|
42
|
-
else if (enabledTools.length === 1) {
|
|
43
|
-
toolName = `${enabledTools[0]} tool`;
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
const last = enabledTools.pop();
|
|
47
|
-
toolName = `${enabledTools.join(", ")} or ${last} tools`;
|
|
48
|
-
}
|
|
49
|
-
return `<context-info>
|
|
50
|
-
Context management was just performed. Do NOT use the ${toolName} again. A fresh list will be available after your next tool use.
|
|
51
|
-
</context-info>`;
|
|
52
|
-
};
|
|
53
|
-
const resolveContextLimit = (config, state, providerId, modelId) => {
|
|
54
|
-
const modelLimits = config.tools.settings.modelLimits;
|
|
55
|
-
const contextLimit = config.tools.settings.contextLimit;
|
|
56
|
-
if (modelLimits) {
|
|
57
|
-
const providerModelId = providerId !== undefined && modelId !== undefined
|
|
58
|
-
? `${providerId}/${modelId}`
|
|
59
|
-
: undefined;
|
|
60
|
-
const limit = providerModelId !== undefined ? modelLimits[providerModelId] : undefined;
|
|
61
|
-
if (limit !== undefined) {
|
|
62
|
-
if (typeof limit === "string" && limit.endsWith("%")) {
|
|
63
|
-
if (state.modelContextLimit === undefined) {
|
|
64
|
-
return undefined;
|
|
65
|
-
}
|
|
66
|
-
return parsePercentageString(limit, state.modelContextLimit);
|
|
67
|
-
}
|
|
68
|
-
return typeof limit === "number" ? limit : undefined;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
if (typeof contextLimit === "string") {
|
|
72
|
-
if (contextLimit.endsWith("%")) {
|
|
73
|
-
if (state.modelContextLimit === undefined) {
|
|
74
|
-
return undefined;
|
|
75
|
-
}
|
|
76
|
-
return parsePercentageString(contextLimit, state.modelContextLimit);
|
|
77
|
-
}
|
|
78
|
-
return undefined;
|
|
79
|
-
}
|
|
80
|
-
return contextLimit;
|
|
81
|
-
};
|
|
82
|
-
const shouldInjectCompressNudge = (config, state, messages, providerId, modelId) => {
|
|
83
|
-
if (config.tools.compress.permission === "deny") {
|
|
84
|
-
return false;
|
|
85
|
-
}
|
|
86
|
-
const lastAssistant = messages.findLast((msg) => msg.info.role === "assistant");
|
|
87
|
-
if (lastAssistant) {
|
|
88
|
-
const parts = Array.isArray(lastAssistant.parts) ? lastAssistant.parts : [];
|
|
89
|
-
const hasDcpTool = parts.some((part) => part.type === "tool" &&
|
|
90
|
-
part.state.status === "completed" &&
|
|
91
|
-
(part.tool === "compress" || part.tool === "prune" || part.tool === "distill"));
|
|
92
|
-
if (hasDcpTool) {
|
|
93
|
-
return false;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
const contextLimit = resolveContextLimit(config, state, providerId, modelId);
|
|
97
|
-
if (contextLimit === undefined) {
|
|
98
|
-
return false;
|
|
99
|
-
}
|
|
100
|
-
const currentTokens = getCurrentTokenUsage(messages);
|
|
101
|
-
return currentTokens > contextLimit;
|
|
102
|
-
};
|
|
103
|
-
const getNudgeString = (config) => {
|
|
104
|
-
const flags = {
|
|
105
|
-
prune: config.tools.prune.permission !== "deny",
|
|
106
|
-
distill: config.tools.distill.permission !== "deny",
|
|
107
|
-
compress: config.tools.compress.permission !== "deny",
|
|
108
|
-
manual: false,
|
|
109
|
-
};
|
|
110
|
-
if (!flags.prune && !flags.distill && !flags.compress) {
|
|
111
|
-
return "";
|
|
112
|
-
}
|
|
113
|
-
return renderNudge(flags);
|
|
114
|
-
};
|
|
115
|
-
const getCooldownMessage = (config) => {
|
|
116
|
-
return wrapCooldownMessage({
|
|
117
|
-
prune: config.tools.prune.permission !== "deny",
|
|
118
|
-
distill: config.tools.distill.permission !== "deny",
|
|
119
|
-
compress: config.tools.compress.permission !== "deny",
|
|
120
|
-
});
|
|
121
|
-
};
|
|
122
|
-
const buildCompressContext = (state, messages) => {
|
|
123
|
-
const messageCount = messages.filter((msg) => !isMessageCompacted(state, msg)).length;
|
|
124
|
-
return wrapCompressContext(messageCount);
|
|
125
|
-
};
|
|
126
|
-
export const buildPrunableToolsList = (state, config, logger) => {
|
|
127
|
-
const lines = [];
|
|
128
|
-
const toolIdList = state.toolIdList;
|
|
129
|
-
state.toolParameters.forEach((toolParameterEntry, toolCallId) => {
|
|
130
|
-
if (state.prune.tools.has(toolCallId)) {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
const allProtectedTools = config.tools.settings.protectedTools;
|
|
134
|
-
if (allProtectedTools.includes(toolParameterEntry.tool)) {
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
const filePaths = getFilePathsFromParameters(toolParameterEntry.tool, toolParameterEntry.parameters);
|
|
138
|
-
if (isProtected(filePaths, config.protectedFilePatterns)) {
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
const numericId = toolIdList.indexOf(toolCallId);
|
|
142
|
-
if (numericId === -1) {
|
|
143
|
-
logger.warn(`Tool in cache but not in toolIdList - possible stale entry`, {
|
|
144
|
-
toolCallId,
|
|
145
|
-
tool: toolParameterEntry.tool,
|
|
146
|
-
});
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
const paramKey = extractParameterKey(toolParameterEntry.tool, toolParameterEntry.parameters);
|
|
150
|
-
const description = paramKey
|
|
151
|
-
? `${toolParameterEntry.tool}, ${paramKey}`
|
|
152
|
-
: toolParameterEntry.tool;
|
|
153
|
-
const tokenSuffix = toolParameterEntry.tokenCount !== undefined
|
|
154
|
-
? ` (~${toolParameterEntry.tokenCount} tokens)`
|
|
155
|
-
: "";
|
|
156
|
-
lines.push(`${numericId}: ${description}${tokenSuffix}`);
|
|
157
|
-
logger.debug(`Prunable tool found - ID: ${numericId}, Tool: ${toolParameterEntry.tool}, Call ID: ${toolCallId}`);
|
|
158
|
-
});
|
|
159
|
-
if (lines.length === 0) {
|
|
160
|
-
return "";
|
|
161
|
-
}
|
|
162
|
-
return wrapPrunableTools(lines.join("\n"));
|
|
163
|
-
};
|
|
164
|
-
export const insertPruneToolContext = (state, config, logger, messages) => {
|
|
165
|
-
if (state.manualMode || state.pendingManualTrigger) {
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
const pruneEnabled = config.tools.prune.permission !== "deny";
|
|
169
|
-
const distillEnabled = config.tools.distill.permission !== "deny";
|
|
170
|
-
const compressEnabled = config.tools.compress.permission !== "deny";
|
|
171
|
-
if (!pruneEnabled && !distillEnabled && !compressEnabled) {
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
const pruneOrDistillEnabled = pruneEnabled || distillEnabled;
|
|
175
|
-
const contentParts = [];
|
|
176
|
-
const lastUserMessage = getLastUserMessage(messages);
|
|
177
|
-
const providerId = lastUserMessage
|
|
178
|
-
? lastUserMessage.info.model.providerID
|
|
179
|
-
: undefined;
|
|
180
|
-
const modelId = lastUserMessage
|
|
181
|
-
? lastUserMessage.info.model.modelID
|
|
182
|
-
: undefined;
|
|
183
|
-
if (state.lastToolPrune) {
|
|
184
|
-
logger.debug("Last tool was prune - injecting cooldown message");
|
|
185
|
-
contentParts.push(getCooldownMessage(config));
|
|
186
|
-
}
|
|
187
|
-
else {
|
|
188
|
-
if (pruneOrDistillEnabled) {
|
|
189
|
-
const prunableToolsList = buildPrunableToolsList(state, config, logger);
|
|
190
|
-
if (prunableToolsList) {
|
|
191
|
-
// logger.debug("prunable-tools: \n" + prunableToolsList)
|
|
192
|
-
contentParts.push(prunableToolsList);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
if (compressEnabled) {
|
|
196
|
-
const compressContext = buildCompressContext(state, messages);
|
|
197
|
-
// logger.debug("compress-context: \n" + compressContext)
|
|
198
|
-
contentParts.push(compressContext);
|
|
199
|
-
}
|
|
200
|
-
if (shouldInjectCompressNudge(config, state, messages, providerId, modelId)) {
|
|
201
|
-
logger.info("Inserting compress nudge - token usage exceeds contextLimit");
|
|
202
|
-
contentParts.push(renderCompressNudge());
|
|
203
|
-
}
|
|
204
|
-
else if (config.tools.settings.nudgeEnabled &&
|
|
205
|
-
state.nudgeCounter >= Math.max(1, config.tools.settings.nudgeFrequency)) {
|
|
206
|
-
logger.info("Inserting prune nudge message");
|
|
207
|
-
contentParts.push(getNudgeString(config));
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
if (contentParts.length === 0) {
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
const combinedContent = `\n${contentParts.join("\n")}`;
|
|
214
|
-
if (!lastUserMessage) {
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
const lastNonIgnoredMessage = messages.findLast((msg) => !(msg.info.role === "user" && isIgnoredUserMessage(msg)));
|
|
218
|
-
if (!lastNonIgnoredMessage) {
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
// When following a user message, append a synthetic text part since models like Claude
|
|
222
|
-
// expect assistant turns to start with reasoning parts which cannot be easily faked.
|
|
223
|
-
// For all other cases, append a synthetic tool part to the last message which works
|
|
224
|
-
// across all models without disrupting their behavior.
|
|
225
|
-
if (lastNonIgnoredMessage.info.role === "user") {
|
|
226
|
-
const textPart = createSyntheticTextPart(lastNonIgnoredMessage, combinedContent, `${lastNonIgnoredMessage.info.id}:context`);
|
|
227
|
-
lastNonIgnoredMessage.parts.push(textPart);
|
|
228
|
-
}
|
|
229
|
-
else {
|
|
230
|
-
const toolPart = createSyntheticToolPart(lastNonIgnoredMessage, combinedContent, modelId ?? "", `${lastNonIgnoredMessage.info.id}:context`);
|
|
231
|
-
lastNonIgnoredMessage.parts.push(toolPart);
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
|
-
export const insertMessageIdContext = (state, config, messages) => {
|
|
235
|
-
if (config.tools.compress.permission === "deny") {
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
|
-
const lastUserMessage = getLastUserMessage(messages);
|
|
239
|
-
const toolModelId = lastUserMessage
|
|
240
|
-
? (lastUserMessage.info.model.modelID ?? "")
|
|
241
|
-
: "";
|
|
242
|
-
for (const message of messages) {
|
|
243
|
-
if (message.info.role === "user" && isIgnoredUserMessage(message)) {
|
|
244
|
-
continue;
|
|
245
|
-
}
|
|
246
|
-
const messageRef = state.messageIds.byRawId.get(message.info.id);
|
|
247
|
-
if (!messageRef) {
|
|
248
|
-
continue;
|
|
249
|
-
}
|
|
250
|
-
const tag = formatMessageIdTag(messageRef);
|
|
251
|
-
const messageIdSeed = `${message.info.id}:message-id:${messageRef}`;
|
|
252
|
-
if (message.info.role === "user") {
|
|
253
|
-
message.parts.push(createSyntheticTextPart(message, tag, messageIdSeed));
|
|
254
|
-
continue;
|
|
255
|
-
}
|
|
256
|
-
if (message.info.role !== "assistant") {
|
|
257
|
-
continue;
|
|
258
|
-
}
|
|
259
|
-
const lastToolPart = findLastToolPart(message);
|
|
260
|
-
if (lastToolPart && appendMessageIdTagToToolOutput(lastToolPart, tag)) {
|
|
261
|
-
continue;
|
|
262
|
-
}
|
|
263
|
-
message.parts.push(createSyntheticToolPart(message, tag, toolModelId, messageIdSeed));
|
|
264
|
-
}
|
|
265
|
-
};
|
|
266
|
-
//# sourceMappingURL=inject.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inject.js","sourceRoot":"","sources":["../../../lib/messages/inject.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAC7D,OAAO,EACH,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,8BAA8B,EAC9B,gBAAgB,GACnB,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,0BAA0B,EAAE,WAAW,EAAE,MAAM,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OAAO,CAAC,IAAI,CAAC,EAAE,eAAe,UAAU,EAAE,CAAA;QAEnE,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAC/B,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,OAAO,EAAE,GAAG,EAAE,aAAa,CAAC,CAAC,CAAA;YACxE,SAAQ;QACZ,CAAC;QAED,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;YACpC,SAAQ;QACZ,CAAC;QAED,MAAM,YAAY,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAA;QAC9C,IAAI,YAAY,IAAI,8BAA8B,CAAC,YAAY,EAAE,GAAG,CAAC,EAAE,CAAC;YACpE,SAAQ;QACZ,CAAC;QAED,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC,CAAA;IACzF,CAAC;AACL,CAAC,CAAA"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare const COMPRESS_NUDGE = "<instruction name=context_limit_reached>\nCRITICAL CONTEXT LIMIT\nYour session context has exceeded the configured limit. Strict adherence to context compression is required.\n\nPROTOCOL\nYou should prioritize context management, but do not interrupt a critical atomic operation if one is in progress. Once the immediate step is done, you must perform context management.\n\nIMMEDIATE ACTION REQUIRED\nPHASE COMPLETION: If a phase is complete, use the `compress` tool to condense the entire sequence into a detailed summary\n</instruction>\n";
|
|
2
|
-
//# sourceMappingURL=compress-nudge.generated.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compress-nudge.generated.d.ts","sourceRoot":"","sources":["../../../../lib/prompts/_codegen/compress-nudge.generated.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,kiBAU1B,CAAA"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// AUTO-GENERATED FILE - DO NOT EDIT
|
|
2
|
-
// Generated from compress-nudge.md by scripts/generate-prompts.ts
|
|
3
|
-
// To modify, edit compress-nudge.md and run `npm run generate:prompts`
|
|
4
|
-
export const COMPRESS_NUDGE = `<instruction name=context_limit_reached>
|
|
5
|
-
CRITICAL CONTEXT LIMIT
|
|
6
|
-
Your session context has exceeded the configured limit. Strict adherence to context compression is required.
|
|
7
|
-
|
|
8
|
-
PROTOCOL
|
|
9
|
-
You should prioritize context management, but do not interrupt a critical atomic operation if one is in progress. Once the immediate step is done, you must perform context management.
|
|
10
|
-
|
|
11
|
-
IMMEDIATE ACTION REQUIRED
|
|
12
|
-
PHASE COMPLETION: If a phase is complete, use the \`compress\` tool to condense the entire sequence into a detailed summary
|
|
13
|
-
</instruction>
|
|
14
|
-
`;
|
|
15
|
-
//# sourceMappingURL=compress-nudge.generated.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compress-nudge.generated.js","sourceRoot":"","sources":["../../../../lib/prompts/_codegen/compress-nudge.generated.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,uEAAuE;AAEvE,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;CAU7B,CAAA"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare const COMPRESS = "Use this tool to collapse a contiguous range of conversation into a preserved summary.\n\nTHE PHILOSOPHY OF COMPRESS\n`compress` transforms verbose conversation sequences into dense, high-fidelity summaries. This is not cleanup - it is crystallization. Your summary becomes the authoritative record of what transpired.\n\nThink of compression as phase transitions: raw exploration becomes refined understanding. The original context served its purpose; your summary now carries that understanding forward.\n\nTHE SUMMARY\nYour summary must be EXHAUSTIVE. Capture file paths, function signatures, decisions made, constraints discovered, key findings... EVERYTHING that maintains context integrity. This is not a brief note - it is an authoritative record so faithful that the original conversation adds no value.\n\nWhen the selected range includes user messages, preserve the user's intent with extra care. Do not change scope, constraints, priorities, acceptance criteria, or requested outcomes.\n\nYet be LEAN. Strip away the noise: failed attempts that led nowhere, verbose tool outputs, back-and-forth exploration. What remains should be pure signal - golden nuggets of detail that preserve full understanding with zero ambiguity.\n\nTHE WAYS OF COMPRESS\n`compress` when a chapter closes - when a phase of work is truly complete and the raw conversation has served its purpose:\n\nResearch concluded and findings are clear\nImplementation finished and verified\nExploration exhausted and patterns understood\n\nDo NOT compress when:\nYou may need exact code, error messages, or file contents from the range\nWork in that area is still active or may resume\nYou're mid-sprint on related functionality\n\nBefore compressing, ask: _\"Is this chapter closed?\"_ Compression is irreversible. The summary replaces everything in the range.\n\nBOUNDARY IDS\nYou specify boundaries by ID.\n\nUse the injected IDs visible in the conversation:\n\n- `mNNNN` IDs identify raw messages\n- `bN` IDs identify previously compressed blocks\n\nRules:\n\n- Pick `startId` and `endId` directly from injected IDs in context.\n- IDs must exist in the current visible context.\n- `startId` must appear before `endId`.\n- Do not invent IDs.\n\nCOMPRESSED BLOCK PLACEHOLDERS\nWhen the selected range includes previously compressed blocks, use placeholders in this exact format:\n\n- `(bN)`\n\nRules:\n\n- Include every required placeholder exactly once.\n- Do not include placeholders for blocks outside the selected range.\n- Treat `(bN)` placeholders as reserved tokens and only use them intentionally.\n- If needed in prose, refer to a block as plain text like `compressed b3` (not as a placeholder token).\n\nTHE FORMAT OF COMPRESS\n`topic`: Short label (3-5 words) for display - e.g., \"Auth System Exploration\"\n`content`: Object containing:\n`startId`: Boundary ID marking the beginning of the range (`mNNNN` or `bN`)\n`endId`: Boundary ID marking the end of the range (`mNNNN` or `bN`)\n`summary`: Complete technical summary replacing all content in the range\n";
|
|
2
|
-
//# sourceMappingURL=compress.generated.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compress.generated.d.ts","sourceRoot":"","sources":["../../../../lib/prompts/_codegen/compress.generated.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,QAAQ,8+FA6DpB,CAAA"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// AUTO-GENERATED FILE - DO NOT EDIT
|
|
2
|
-
// Generated from compress.md by scripts/generate-prompts.ts
|
|
3
|
-
// To modify, edit compress.md and run `npm run generate:prompts`
|
|
4
|
-
export const COMPRESS = `Use this tool to collapse a contiguous range of conversation into a preserved summary.
|
|
5
|
-
|
|
6
|
-
THE PHILOSOPHY OF COMPRESS
|
|
7
|
-
\`compress\` transforms verbose conversation sequences into dense, high-fidelity summaries. This is not cleanup - it is crystallization. Your summary becomes the authoritative record of what transpired.
|
|
8
|
-
|
|
9
|
-
Think of compression as phase transitions: raw exploration becomes refined understanding. The original context served its purpose; your summary now carries that understanding forward.
|
|
10
|
-
|
|
11
|
-
THE SUMMARY
|
|
12
|
-
Your summary must be EXHAUSTIVE. Capture file paths, function signatures, decisions made, constraints discovered, key findings... EVERYTHING that maintains context integrity. This is not a brief note - it is an authoritative record so faithful that the original conversation adds no value.
|
|
13
|
-
|
|
14
|
-
When the selected range includes user messages, preserve the user's intent with extra care. Do not change scope, constraints, priorities, acceptance criteria, or requested outcomes.
|
|
15
|
-
|
|
16
|
-
Yet be LEAN. Strip away the noise: failed attempts that led nowhere, verbose tool outputs, back-and-forth exploration. What remains should be pure signal - golden nuggets of detail that preserve full understanding with zero ambiguity.
|
|
17
|
-
|
|
18
|
-
THE WAYS OF COMPRESS
|
|
19
|
-
\`compress\` when a chapter closes - when a phase of work is truly complete and the raw conversation has served its purpose:
|
|
20
|
-
|
|
21
|
-
Research concluded and findings are clear
|
|
22
|
-
Implementation finished and verified
|
|
23
|
-
Exploration exhausted and patterns understood
|
|
24
|
-
|
|
25
|
-
Do NOT compress when:
|
|
26
|
-
You may need exact code, error messages, or file contents from the range
|
|
27
|
-
Work in that area is still active or may resume
|
|
28
|
-
You're mid-sprint on related functionality
|
|
29
|
-
|
|
30
|
-
Before compressing, ask: _"Is this chapter closed?"_ Compression is irreversible. The summary replaces everything in the range.
|
|
31
|
-
|
|
32
|
-
BOUNDARY IDS
|
|
33
|
-
You specify boundaries by ID.
|
|
34
|
-
|
|
35
|
-
Use the injected IDs visible in the conversation:
|
|
36
|
-
|
|
37
|
-
- \`mNNNN\` IDs identify raw messages
|
|
38
|
-
- \`bN\` IDs identify previously compressed blocks
|
|
39
|
-
|
|
40
|
-
Rules:
|
|
41
|
-
|
|
42
|
-
- Pick \`startId\` and \`endId\` directly from injected IDs in context.
|
|
43
|
-
- IDs must exist in the current visible context.
|
|
44
|
-
- \`startId\` must appear before \`endId\`.
|
|
45
|
-
- Do not invent IDs.
|
|
46
|
-
|
|
47
|
-
COMPRESSED BLOCK PLACEHOLDERS
|
|
48
|
-
When the selected range includes previously compressed blocks, use placeholders in this exact format:
|
|
49
|
-
|
|
50
|
-
- \`(bN)\`
|
|
51
|
-
|
|
52
|
-
Rules:
|
|
53
|
-
|
|
54
|
-
- Include every required placeholder exactly once.
|
|
55
|
-
- Do not include placeholders for blocks outside the selected range.
|
|
56
|
-
- Treat \`(bN)\` placeholders as reserved tokens and only use them intentionally.
|
|
57
|
-
- If needed in prose, refer to a block as plain text like \`compressed b3\` (not as a placeholder token).
|
|
58
|
-
|
|
59
|
-
THE FORMAT OF COMPRESS
|
|
60
|
-
\`topic\`: Short label (3-5 words) for display - e.g., "Auth System Exploration"
|
|
61
|
-
\`content\`: Object containing:
|
|
62
|
-
\`startId\`: Boundary ID marking the beginning of the range (\`mNNNN\` or \`bN\`)
|
|
63
|
-
\`endId\`: Boundary ID marking the end of the range (\`mNNNN\` or \`bN\`)
|
|
64
|
-
\`summary\`: Complete technical summary replacing all content in the range
|
|
65
|
-
`;
|
|
66
|
-
//# sourceMappingURL=compress.generated.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compress.generated.js","sourceRoot":"","sources":["../../../../lib/prompts/_codegen/compress.generated.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,4DAA4D;AAC5D,iEAAiE;AAEjE,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6DvB,CAAA"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare const DISTILL = "Use this tool to distill relevant findings from a selection of raw tool outputs into preserved knowledge, in order to denoise key bits and parts of context.\n\nTHE PRUNABLE TOOLS LIST\nA <prunable-tools> will show in context when outputs are available for distillation (you don't need to look for it). Each entry follows the format `ID: tool, parameter (~token usage)` (e.g., `20: read, /path/to/file.ts (~1500 tokens)`). You MUST select outputs by their numeric ID. THESE ARE YOUR ONLY VALID TARGETS.\n\nTHE PHILOSOPHY OF DISTILLATION\n`distill` is your favored instrument for transforming raw tool outputs into preserved knowledge. This is not mere summarization; it is high-fidelity extraction that makes the original output obsolete.\n\nYour distillation must be COMPLETE. Capture function signatures, type definitions, business logic, constraints, configuration values... EVERYTHING essential. Think of it as creating a high signal technical substitute so faithful that re-fetching the original would yield no additional value. Be thorough; be comprehensive; leave no ambiguity, ensure that your distillation stands alone, and is designed for easy retrieval and comprehension.\n\nAIM FOR IMPACT. Distillation is most powerful when applied to outputs that contain signal buried in noise. A single line requires no distillation; a hundred lines of API documentation do. Make sure the distillation is meaningful.\n\nTHE WAYS OF DISTILL\n`distill` when you have extracted the essence from tool outputs and the raw form has served its purpose.\nHere are some examples:\nEXPLORATION: You've read extensively and grasp the architecture. The original file contents are no longer needed; your understanding, synthesized, is sufficient.\nPRESERVATION: Valuable technical details (signatures, logic, constraints) coexist with noise. Preserve the former; discard the latter.\n\nNot everything should be distilled. Prefer keeping raw outputs when:\nPRECISION MATTERS: You will edit the file, grep for exact strings, or need line-accurate references. Distillation sacrifices precision for essence.\nUNCERTAINTY REMAINS: If you might need to re-examine the original, defer. Distillation is irreversible; be certain before you commit.\n\nBefore distilling, ask yourself: _\"Will I need the raw output for upcoming work?\"_ If you plan to edit a file you just read, keep it intact. Distillation is for completed exploration, not active work.\n\nTHE FORMAT OF DISTILL\n`targets`: Array of objects, each containing:\n`id`: Numeric ID (as string) from the `<prunable-tools>` list\n`distillation`: Complete technical substitute for that tool output\n";
|
|
2
|
-
//# sourceMappingURL=distill.generated.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"distill.generated.d.ts","sourceRoot":"","sources":["../../../../lib/prompts/_codegen/distill.generated.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO,+kFA4BnB,CAAA"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// AUTO-GENERATED FILE - DO NOT EDIT
|
|
2
|
-
// Generated from distill.md by scripts/generate-prompts.ts
|
|
3
|
-
// To modify, edit distill.md and run `npm run generate:prompts`
|
|
4
|
-
export const DISTILL = `Use this tool to distill relevant findings from a selection of raw tool outputs into preserved knowledge, in order to denoise key bits and parts of context.
|
|
5
|
-
|
|
6
|
-
THE PRUNABLE TOOLS LIST
|
|
7
|
-
A <prunable-tools> will show in context when outputs are available for distillation (you don't need to look for it). Each entry follows the format \`ID: tool, parameter (~token usage)\` (e.g., \`20: read, /path/to/file.ts (~1500 tokens)\`). You MUST select outputs by their numeric ID. THESE ARE YOUR ONLY VALID TARGETS.
|
|
8
|
-
|
|
9
|
-
THE PHILOSOPHY OF DISTILLATION
|
|
10
|
-
\`distill\` is your favored instrument for transforming raw tool outputs into preserved knowledge. This is not mere summarization; it is high-fidelity extraction that makes the original output obsolete.
|
|
11
|
-
|
|
12
|
-
Your distillation must be COMPLETE. Capture function signatures, type definitions, business logic, constraints, configuration values... EVERYTHING essential. Think of it as creating a high signal technical substitute so faithful that re-fetching the original would yield no additional value. Be thorough; be comprehensive; leave no ambiguity, ensure that your distillation stands alone, and is designed for easy retrieval and comprehension.
|
|
13
|
-
|
|
14
|
-
AIM FOR IMPACT. Distillation is most powerful when applied to outputs that contain signal buried in noise. A single line requires no distillation; a hundred lines of API documentation do. Make sure the distillation is meaningful.
|
|
15
|
-
|
|
16
|
-
THE WAYS OF DISTILL
|
|
17
|
-
\`distill\` when you have extracted the essence from tool outputs and the raw form has served its purpose.
|
|
18
|
-
Here are some examples:
|
|
19
|
-
EXPLORATION: You've read extensively and grasp the architecture. The original file contents are no longer needed; your understanding, synthesized, is sufficient.
|
|
20
|
-
PRESERVATION: Valuable technical details (signatures, logic, constraints) coexist with noise. Preserve the former; discard the latter.
|
|
21
|
-
|
|
22
|
-
Not everything should be distilled. Prefer keeping raw outputs when:
|
|
23
|
-
PRECISION MATTERS: You will edit the file, grep for exact strings, or need line-accurate references. Distillation sacrifices precision for essence.
|
|
24
|
-
UNCERTAINTY REMAINS: If you might need to re-examine the original, defer. Distillation is irreversible; be certain before you commit.
|
|
25
|
-
|
|
26
|
-
Before distilling, ask yourself: _"Will I need the raw output for upcoming work?"_ If you plan to edit a file you just read, keep it intact. Distillation is for completed exploration, not active work.
|
|
27
|
-
|
|
28
|
-
THE FORMAT OF DISTILL
|
|
29
|
-
\`targets\`: Array of objects, each containing:
|
|
30
|
-
\`id\`: Numeric ID (as string) from the \`<prunable-tools>\` list
|
|
31
|
-
\`distillation\`: Complete technical substitute for that tool output
|
|
32
|
-
`;
|
|
33
|
-
//# sourceMappingURL=distill.generated.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"distill.generated.js","sourceRoot":"","sources":["../../../../lib/prompts/_codegen/distill.generated.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,2DAA2D;AAC3D,gEAAgE;AAEhE,MAAM,CAAC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BtB,CAAA"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare const NUDGE = "<instruction name=context_management_required>\nCRITICAL CONTEXT WARNING\nYour context window is filling with tool. Strict adherence to context hygiene is required.\n\nPROTOCOL\nYou should prioritize context management, but do not interrupt a critical atomic operation if one is in progress. Once the immediate step is done, you must perform context management.\n\nIMMEDIATE ACTION REQUIRED\n<distill>KNOWLEDGE PRESERVATION: If holding valuable raw data you POTENTIALLY will need in your task, use the `distill` tool. Produce a high-fidelity distillation to preserve insights - be thorough</distill>\n<compress>PHASE COMPLETION: If a phase is complete, use the `compress` tool to condense the entire sequence into a detailed summary</compress>\n<prune>NOISE REMOVAL: If you read files or ran commands that yielded no value, use the `prune` tool to remove them. If newer tools supersedes older ones, prune the old</prune>\n</instruction>\n";
|
|
2
|
-
//# sourceMappingURL=nudge.generated.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nudge.generated.d.ts","sourceRoot":"","sources":["../../../../lib/prompts/_codegen/nudge.generated.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,KAAK,+6BAYjB,CAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// AUTO-GENERATED FILE - DO NOT EDIT
|
|
2
|
-
// Generated from nudge.md by scripts/generate-prompts.ts
|
|
3
|
-
// To modify, edit nudge.md and run `npm run generate:prompts`
|
|
4
|
-
export const NUDGE = `<instruction name=context_management_required>
|
|
5
|
-
CRITICAL CONTEXT WARNING
|
|
6
|
-
Your context window is filling with tool. Strict adherence to context hygiene is required.
|
|
7
|
-
|
|
8
|
-
PROTOCOL
|
|
9
|
-
You should prioritize context management, but do not interrupt a critical atomic operation if one is in progress. Once the immediate step is done, you must perform context management.
|
|
10
|
-
|
|
11
|
-
IMMEDIATE ACTION REQUIRED
|
|
12
|
-
<distill>KNOWLEDGE PRESERVATION: If holding valuable raw data you POTENTIALLY will need in your task, use the \`distill\` tool. Produce a high-fidelity distillation to preserve insights - be thorough</distill>
|
|
13
|
-
<compress>PHASE COMPLETION: If a phase is complete, use the \`compress\` tool to condense the entire sequence into a detailed summary</compress>
|
|
14
|
-
<prune>NOISE REMOVAL: If you read files or ran commands that yielded no value, use the \`prune\` tool to remove them. If newer tools supersedes older ones, prune the old</prune>
|
|
15
|
-
</instruction>
|
|
16
|
-
`;
|
|
17
|
-
//# sourceMappingURL=nudge.generated.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nudge.generated.js","sourceRoot":"","sources":["../../../../lib/prompts/_codegen/nudge.generated.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,yDAAyD;AACzD,8DAA8D;AAE9D,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;CAYpB,CAAA"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare const PRUNE = "Use this tool to remove tool outputs from context entirely. No preservation - pure deletion.\n\nTHE PRUNABLE TOOLS LIST\nA `<prunable-tools>` section surfaces in context showing outputs eligible for removal. Each line reads `ID: tool, parameter (~token usage)` (e.g., `20: read, /path/to/file.ts (~1500 tokens)`). Reference outputs by their numeric ID - these are your ONLY valid targets for pruning.\n\nTHE WAYS OF PRUNE\n`prune` is surgical deletion - eliminating noise (irrelevant or unhelpful outputs), superseded information (older outputs replaced by newer data), or wrong targets (you accessed something that turned out to be irrelevant). Use it to keep your context lean and focused.\n\nBATCH WISELY! Pruning is most effective when consolidated. Don't prune a single tiny output - accumulate several candidates before acting.\n\nDo NOT prune when:\nNEEDED LATER: You plan to edit the file or reference this context for implementation.\nUNCERTAINTY: If you might need to re-examine the original, keep it.\n\nBefore pruning, ask: _\"Is this noise, or will it serve me?\"_ If the latter, keep it. Pruning that forces re-fetching is a net loss.\n\nTHE FORMAT OF PRUNE\n`ids`: Array of numeric IDs (as strings) from the `<prunable-tools>` list\n";
|
|
2
|
-
//# sourceMappingURL=prune.generated.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prune.generated.d.ts","sourceRoot":"","sources":["../../../../lib/prompts/_codegen/prune.generated.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,KAAK,quCAkBjB,CAAA"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// AUTO-GENERATED FILE - DO NOT EDIT
|
|
2
|
-
// Generated from prune.md by scripts/generate-prompts.ts
|
|
3
|
-
// To modify, edit prune.md and run `npm run generate:prompts`
|
|
4
|
-
export const PRUNE = `Use this tool to remove tool outputs from context entirely. No preservation - pure deletion.
|
|
5
|
-
|
|
6
|
-
THE PRUNABLE TOOLS LIST
|
|
7
|
-
A \`<prunable-tools>\` section surfaces in context showing outputs eligible for removal. Each line reads \`ID: tool, parameter (~token usage)\` (e.g., \`20: read, /path/to/file.ts (~1500 tokens)\`). Reference outputs by their numeric ID - these are your ONLY valid targets for pruning.
|
|
8
|
-
|
|
9
|
-
THE WAYS OF PRUNE
|
|
10
|
-
\`prune\` is surgical deletion - eliminating noise (irrelevant or unhelpful outputs), superseded information (older outputs replaced by newer data), or wrong targets (you accessed something that turned out to be irrelevant). Use it to keep your context lean and focused.
|
|
11
|
-
|
|
12
|
-
BATCH WISELY! Pruning is most effective when consolidated. Don't prune a single tiny output - accumulate several candidates before acting.
|
|
13
|
-
|
|
14
|
-
Do NOT prune when:
|
|
15
|
-
NEEDED LATER: You plan to edit the file or reference this context for implementation.
|
|
16
|
-
UNCERTAINTY: If you might need to re-examine the original, keep it.
|
|
17
|
-
|
|
18
|
-
Before pruning, ask: _"Is this noise, or will it serve me?"_ If the latter, keep it. Pruning that forces re-fetching is a net loss.
|
|
19
|
-
|
|
20
|
-
THE FORMAT OF PRUNE
|
|
21
|
-
\`ids\`: Array of numeric IDs (as strings) from the \`<prunable-tools>\` list
|
|
22
|
-
`;
|
|
23
|
-
//# sourceMappingURL=prune.generated.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prune.generated.js","sourceRoot":"","sources":["../../../../lib/prompts/_codegen/prune.generated.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,yDAAyD;AACzD,8DAA8D;AAE9D,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;CAkBpB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"distill.d.ts","sourceRoot":"","sources":["../../../lib/tools/distill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAO/C,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,gBAAgB,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAmDhF"}
|