@dev4s/opencode-dcp 0.1.2 → 0.1.5
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 +9 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +87 -68
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/prompt.d.ts.map +1 -1
- package/dist/lib/prompt.js +8 -6
- package/dist/lib/prompt.js.map +1 -1
- package/dist/lib/prompts/generated.d.ts +7 -0
- package/dist/lib/prompts/generated.d.ts.map +1 -0
- package/dist/lib/prompts/generated.js +309 -0
- package/dist/lib/prompts/generated.js.map +1 -0
- package/dist/lib/timing.d.ts +13 -0
- package/dist/lib/timing.d.ts.map +1 -0
- package/dist/lib/timing.js +44 -0
- package/dist/lib/timing.js.map +1 -0
- package/package.json +3 -3
- package/dist/lib/prompts/discard-tool-spec.txt +0 -41
- package/dist/lib/prompts/extract-tool-spec.txt +0 -47
- package/dist/lib/prompts/on-idle-analysis.txt +0 -30
- package/dist/lib/prompts/user/nudge/nudge-both.txt +0 -10
- package/dist/lib/prompts/user/nudge/nudge-discard.txt +0 -9
- package/dist/lib/prompts/user/nudge/nudge-extract.txt +0 -9
- package/dist/lib/prompts/user/system/system-prompt-both.txt +0 -58
- package/dist/lib/prompts/user/system/system-prompt-discard.txt +0 -49
- package/dist/lib/prompts/user/system/system-prompt-extract.txt +0 -49
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAUjD,QAAA,MAAM,MAAM,EAAE,MA8FK,CAAA;AAEnB,eAAe,MAAM,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
|
+
import { timeStart, timeEnd } from "./lib/timing";
|
|
2
|
+
timeStart("module-imports");
|
|
1
3
|
import { getConfig } from "./lib/config";
|
|
2
4
|
import { Logger } from "./lib/logger";
|
|
3
5
|
import { loadPrompt } from "./lib/prompt";
|
|
4
6
|
import { createSessionState } from "./lib/state";
|
|
5
7
|
import { createDiscardTool, createExtractTool } from "./lib/strategies";
|
|
6
8
|
import { createChatMessageTransformHandler, createEventHandler } from "./lib/hooks";
|
|
9
|
+
timeEnd("module-imports");
|
|
7
10
|
const plugin = (async (ctx) => {
|
|
11
|
+
timeStart("plugin-init-total");
|
|
12
|
+
timeStart("getConfig");
|
|
8
13
|
const config = getConfig(ctx);
|
|
14
|
+
timeEnd("getConfig");
|
|
9
15
|
if (!config.enabled) {
|
|
10
16
|
return {};
|
|
11
17
|
}
|
|
@@ -19,7 +25,7 @@ const plugin = (async (ctx) => {
|
|
|
19
25
|
logger.info("DCP initialized", {
|
|
20
26
|
strategies: config.strategies,
|
|
21
27
|
});
|
|
22
|
-
|
|
28
|
+
const result = {
|
|
23
29
|
"experimental.chat.system.transform": async (_input, output) => {
|
|
24
30
|
const discardEnabled = config.tools.discard.enabled;
|
|
25
31
|
const extractEnabled = config.tools.extract.enabled;
|
|
@@ -79,6 +85,8 @@ const plugin = (async (ctx) => {
|
|
|
79
85
|
},
|
|
80
86
|
event: createEventHandler(ctx.client, config, state, logger, ctx.directory),
|
|
81
87
|
};
|
|
88
|
+
timeEnd("plugin-init-total");
|
|
89
|
+
return result;
|
|
82
90
|
});
|
|
83
91
|
export default plugin;
|
|
84
92
|
//# sourceMappingURL=index.js.map
|
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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UAAU,GAAa,EAAE,CAAA;YAC/B,IAAI,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO;gBAAE,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;YAC5D,IAAI,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO;gBAAE,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;YAE5D,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACxB,MAAM,oBAAoB,GAAG,cAAc,CAAC,YAAY,EAAE,aAAa,IAAI,EAAE,CAAA;gBAC7E,cAAc,CAAC,YAAY,GAAG;oBAC1B,GAAG,cAAc,CAAC,YAAY;oBAC9B,aAAa,EAAE,CAAC,GAAG,oBAAoB,EAAE,GAAG,UAAU,CAAC;iBAC1D,CAAA;gBACD,MAAM,CAAC,IAAI,CACP,SAAS,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,oDAAoD,CAC7G,CAAA;YACL,CAAC;QACL,CAAC;QACD,KAAK,EAAE,kBAAkB,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,SAAS,CAAC;KAC9E,CAAA;IAED,OAAO,CAAC,mBAAmB,CAAC,CAAA;IAC5B,OAAO,MAAM,CAAA;AACjB,CAAC,CAAkB,CAAA;AAEnB,eAAe,MAAM,CAAA"}
|
package/dist/lib/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../lib/config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../lib/config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,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,EAAE,aAAa,CAAA;QAC5B,eAAe,EAAE,eAAe,CAAA;QAChC,WAAW,EAAE,WAAW,CAAA;QACxB,MAAM,EAAE,MAAM,CAAA;KACjB,CAAA;CACJ;AAKD,eAAO,MAAM,iBAAiB,aAuC5B,CAAA;AAgBF,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,EAAE,CAG9E;AA6mBD,wBAAgB,SAAS,CAAC,GAAG,EAAE,WAAW,GAAG,YAAY,CAkHxD"}
|
package/dist/lib/config.js
CHANGED
|
@@ -2,6 +2,7 @@ import { readFileSync, writeFileSync, existsSync, mkdirSync, statSync } from "fs
|
|
|
2
2
|
import { join, dirname } from "path";
|
|
3
3
|
import { homedir } from "os";
|
|
4
4
|
import { parse } from "jsonc-parser";
|
|
5
|
+
import { timeStart, timeEnd } from "./timing";
|
|
5
6
|
const DEFAULT_PROTECTED_TOOLS = ["task", "todowrite", "todoread", "discard", "extract", "batch"];
|
|
6
7
|
// Valid config keys for validation against user config
|
|
7
8
|
export const VALID_CONFIG_KEYS = new Set([
|
|
@@ -341,11 +342,15 @@ const defaultConfig = {
|
|
|
341
342
|
const GLOBAL_CONFIG_DIR = join(homedir(), ".config", "opencode");
|
|
342
343
|
const GLOBAL_CONFIG_PATH_JSONC = join(GLOBAL_CONFIG_DIR, "dcp.jsonc");
|
|
343
344
|
const GLOBAL_CONFIG_PATH_JSON = join(GLOBAL_CONFIG_DIR, "dcp.json");
|
|
345
|
+
// Module-level config cache to avoid repeated file I/O on startup
|
|
346
|
+
let cachedConfig = null;
|
|
344
347
|
function findOpencodeDir(startDir) {
|
|
348
|
+
timeStart("findOpencodeDir");
|
|
345
349
|
let current = startDir;
|
|
346
350
|
while (current !== "/") {
|
|
347
351
|
const candidate = join(current, ".opencode");
|
|
348
352
|
if (existsSync(candidate) && statSync(candidate).isDirectory()) {
|
|
353
|
+
timeEnd("findOpencodeDir");
|
|
349
354
|
return candidate;
|
|
350
355
|
}
|
|
351
356
|
const parent = dirname(current);
|
|
@@ -353,9 +358,11 @@ function findOpencodeDir(startDir) {
|
|
|
353
358
|
break;
|
|
354
359
|
current = parent;
|
|
355
360
|
}
|
|
361
|
+
timeEnd("findOpencodeDir");
|
|
356
362
|
return null;
|
|
357
363
|
}
|
|
358
364
|
function getConfigPaths(ctx) {
|
|
365
|
+
timeStart("getConfigPaths");
|
|
359
366
|
// Global: ~/.config/opencode/dcp.jsonc|json
|
|
360
367
|
let globalPath = null;
|
|
361
368
|
if (existsSync(GLOBAL_CONFIG_PATH_JSONC)) {
|
|
@@ -392,99 +399,105 @@ function getConfigPaths(ctx) {
|
|
|
392
399
|
}
|
|
393
400
|
}
|
|
394
401
|
}
|
|
402
|
+
timeEnd("getConfigPaths");
|
|
395
403
|
return { global: globalPath, configDir: configDirPath, project: projectPath };
|
|
396
404
|
}
|
|
397
405
|
function createDefaultConfig() {
|
|
398
406
|
if (!existsSync(GLOBAL_CONFIG_DIR)) {
|
|
399
407
|
mkdirSync(GLOBAL_CONFIG_DIR, { recursive: true });
|
|
400
408
|
}
|
|
401
|
-
const configContent = `{
|
|
402
|
-
// Enable or disable the plugin
|
|
403
|
-
"enabled": true,
|
|
404
|
-
// Enable debug logging to ~/.config/opencode/logs/dcp/
|
|
405
|
-
"debug": false,
|
|
406
|
-
// Notification display: "off", "minimal", or "detailed"
|
|
407
|
-
"pruneNotification": "detailed",
|
|
408
|
-
// Protect from pruning for <turns> message turns
|
|
409
|
-
"turnProtection": {
|
|
410
|
-
"enabled": false,
|
|
411
|
-
"turns": 4
|
|
412
|
-
},
|
|
413
|
-
// LLM-driven context pruning tools
|
|
414
|
-
"tools": {
|
|
415
|
-
// Shared settings for all prune tools
|
|
416
|
-
"settings": {
|
|
417
|
-
// Nudge the LLM to use prune tools (every <nudgeFrequency> tool results)
|
|
418
|
-
"nudgeEnabled": true,
|
|
419
|
-
"nudgeFrequency": 10,
|
|
420
|
-
// Additional tools to protect from pruning
|
|
421
|
-
"protectedTools": []
|
|
422
|
-
},
|
|
423
|
-
// Removes tool content from context without preservation (for completed tasks or noise)
|
|
424
|
-
"discard": {
|
|
425
|
-
"enabled": true
|
|
426
|
-
},
|
|
427
|
-
// Distills key findings into preserved knowledge before removing raw content
|
|
428
|
-
"extract": {
|
|
429
|
-
"enabled": true,
|
|
430
|
-
// Show distillation content as an ignored message notification
|
|
431
|
-
"showDistillation": false
|
|
432
|
-
}
|
|
433
|
-
},
|
|
434
|
-
// Automatic pruning strategies
|
|
435
|
-
"strategies": {
|
|
436
|
-
// Remove duplicate tool calls (same tool with same arguments)
|
|
437
|
-
"deduplication": {
|
|
438
|
-
"enabled": true,
|
|
439
|
-
// Additional tools to protect from pruning
|
|
440
|
-
"protectedTools": []
|
|
441
|
-
},
|
|
442
|
-
// Prune write tool inputs when the file has been subsequently read
|
|
443
|
-
"supersedeWrites": {
|
|
444
|
-
"enabled": true
|
|
445
|
-
},
|
|
446
|
-
// Prune tool inputs for errored tools after X turns
|
|
447
|
-
"purgeErrors": {
|
|
448
|
-
"enabled": true,
|
|
449
|
-
// Number of turns before errored tool inputs are pruned
|
|
450
|
-
"turns": 4,
|
|
451
|
-
// Additional tools to protect from pruning
|
|
452
|
-
"protectedTools": []
|
|
453
|
-
},
|
|
454
|
-
// (Legacy) Run an LLM to analyze what tool calls are no longer relevant on idle
|
|
455
|
-
"onIdle": {
|
|
456
|
-
"enabled": false,
|
|
457
|
-
// Additional tools to protect from pruning
|
|
458
|
-
"protectedTools": [],
|
|
459
|
-
// Override model for analysis (format: "provider/model")
|
|
460
|
-
// "model": "anthropic/claude-haiku-4-5",
|
|
461
|
-
// Show toast notifications when model selection fails
|
|
462
|
-
"showModelErrorToasts": true,
|
|
463
|
-
// When true, fallback models are not permitted
|
|
464
|
-
"strictModelSelection": false
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
}
|
|
409
|
+
const configContent = `{
|
|
410
|
+
// Enable or disable the plugin
|
|
411
|
+
"enabled": true,
|
|
412
|
+
// Enable debug logging to ~/.config/opencode/logs/dcp/
|
|
413
|
+
"debug": false,
|
|
414
|
+
// Notification display: "off", "minimal", or "detailed"
|
|
415
|
+
"pruneNotification": "detailed",
|
|
416
|
+
// Protect from pruning for <turns> message turns
|
|
417
|
+
"turnProtection": {
|
|
418
|
+
"enabled": false,
|
|
419
|
+
"turns": 4
|
|
420
|
+
},
|
|
421
|
+
// LLM-driven context pruning tools
|
|
422
|
+
"tools": {
|
|
423
|
+
// Shared settings for all prune tools
|
|
424
|
+
"settings": {
|
|
425
|
+
// Nudge the LLM to use prune tools (every <nudgeFrequency> tool results)
|
|
426
|
+
"nudgeEnabled": true,
|
|
427
|
+
"nudgeFrequency": 10,
|
|
428
|
+
// Additional tools to protect from pruning
|
|
429
|
+
"protectedTools": []
|
|
430
|
+
},
|
|
431
|
+
// Removes tool content from context without preservation (for completed tasks or noise)
|
|
432
|
+
"discard": {
|
|
433
|
+
"enabled": true
|
|
434
|
+
},
|
|
435
|
+
// Distills key findings into preserved knowledge before removing raw content
|
|
436
|
+
"extract": {
|
|
437
|
+
"enabled": true,
|
|
438
|
+
// Show distillation content as an ignored message notification
|
|
439
|
+
"showDistillation": false
|
|
440
|
+
}
|
|
441
|
+
},
|
|
442
|
+
// Automatic pruning strategies
|
|
443
|
+
"strategies": {
|
|
444
|
+
// Remove duplicate tool calls (same tool with same arguments)
|
|
445
|
+
"deduplication": {
|
|
446
|
+
"enabled": true,
|
|
447
|
+
// Additional tools to protect from pruning
|
|
448
|
+
"protectedTools": []
|
|
449
|
+
},
|
|
450
|
+
// Prune write tool inputs when the file has been subsequently read
|
|
451
|
+
"supersedeWrites": {
|
|
452
|
+
"enabled": true
|
|
453
|
+
},
|
|
454
|
+
// Prune tool inputs for errored tools after X turns
|
|
455
|
+
"purgeErrors": {
|
|
456
|
+
"enabled": true,
|
|
457
|
+
// Number of turns before errored tool inputs are pruned
|
|
458
|
+
"turns": 4,
|
|
459
|
+
// Additional tools to protect from pruning
|
|
460
|
+
"protectedTools": []
|
|
461
|
+
},
|
|
462
|
+
// (Legacy) Run an LLM to analyze what tool calls are no longer relevant on idle
|
|
463
|
+
"onIdle": {
|
|
464
|
+
"enabled": false,
|
|
465
|
+
// Additional tools to protect from pruning
|
|
466
|
+
"protectedTools": [],
|
|
467
|
+
// Override model for analysis (format: "provider/model")
|
|
468
|
+
// "model": "anthropic/claude-haiku-4-5",
|
|
469
|
+
// Show toast notifications when model selection fails
|
|
470
|
+
"showModelErrorToasts": true,
|
|
471
|
+
// When true, fallback models are not permitted
|
|
472
|
+
"strictModelSelection": false
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
468
476
|
`;
|
|
469
477
|
writeFileSync(GLOBAL_CONFIG_PATH_JSONC, configContent, "utf-8");
|
|
470
478
|
}
|
|
471
479
|
function loadConfigFile(configPath) {
|
|
480
|
+
timeStart("loadConfigFile");
|
|
472
481
|
let fileContent;
|
|
473
482
|
try {
|
|
474
483
|
fileContent = readFileSync(configPath, "utf-8");
|
|
475
484
|
}
|
|
476
485
|
catch {
|
|
477
486
|
// File doesn't exist or can't be read - not a parse error
|
|
487
|
+
timeEnd("loadConfigFile");
|
|
478
488
|
return { data: null };
|
|
479
489
|
}
|
|
480
490
|
try {
|
|
481
491
|
const parsed = parse(fileContent);
|
|
482
492
|
if (parsed === undefined || parsed === null) {
|
|
493
|
+
timeEnd("loadConfigFile");
|
|
483
494
|
return { data: null, parseError: "Config file is empty or invalid" };
|
|
484
495
|
}
|
|
496
|
+
timeEnd("loadConfigFile");
|
|
485
497
|
return { data: parsed };
|
|
486
498
|
}
|
|
487
499
|
catch (error) {
|
|
500
|
+
timeEnd("loadConfigFile");
|
|
488
501
|
return { data: null, parseError: error.message || "Failed to parse config" };
|
|
489
502
|
}
|
|
490
503
|
}
|
|
@@ -583,6 +596,10 @@ function deepCloneConfig(config) {
|
|
|
583
596
|
};
|
|
584
597
|
}
|
|
585
598
|
export function getConfig(ctx) {
|
|
599
|
+
// Return cached config if available (avoids repeated file I/O)
|
|
600
|
+
if (cachedConfig) {
|
|
601
|
+
return deepCloneConfig(cachedConfig);
|
|
602
|
+
}
|
|
586
603
|
let config = deepCloneConfig(defaultConfig);
|
|
587
604
|
const configPaths = getConfigPaths(ctx);
|
|
588
605
|
// Load and merge global config
|
|
@@ -691,6 +708,8 @@ export function getConfig(ctx) {
|
|
|
691
708
|
};
|
|
692
709
|
}
|
|
693
710
|
}
|
|
694
|
-
|
|
711
|
+
// Cache the config for subsequent calls
|
|
712
|
+
cachedConfig = config;
|
|
713
|
+
return deepCloneConfig(config);
|
|
695
714
|
}
|
|
696
715
|
//# sourceMappingURL=config.js.map
|
package/dist/lib/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../lib/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAA;AACjF,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAA;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAkEpC,MAAM,uBAAuB,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;AAEhG,uDAAuD;AACvD,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC;IACrC,iBAAiB;IACjB,SAAS;IACT,OAAO;IACP,kBAAkB,EAAE,kDAAkD;IACtE,mBAAmB;IACnB,gBAAgB;IAChB,wBAAwB;IACxB,sBAAsB;IACtB,OAAO;IACP,gBAAgB;IAChB,6BAA6B;IAC7B,+BAA+B;IAC/B,+BAA+B;IAC/B,eAAe;IACf,uBAAuB;IACvB,eAAe;IACf,uBAAuB;IACvB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G,EAAE,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;YACzE,MAAM,GAAG;gBACL,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO;gBAC9C,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK;gBACxC,iBAAiB,EAAE,MAAM,CAAC,IAAI,CAAC,iBAAiB,IAAI,MAAM,CAAC,iBAAiB;gBAC5E,cAAc,EAAE;oBACZ,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,IAAI,MAAM,CAAC,cAAc,CAAC,OAAO;oBAC7E,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,KAAK,IAAI,MAAM,CAAC,cAAc,CAAC,KAAK;iBAC1E;gBACD,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,KAAY,CAAC;gBACzD,UAAU,EAAE,eAAe,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,UAAiB,CAAC;aAChF,CAAA;QACL,CAAC;IACL,CAAC;IAED,wCAAwC;IACxC,YAAY,GAAG,MAAM,CAAA;IACrB,OAAO,eAAe,CAAC,MAAM,CAAC,CAAA;AAClC,CAAC"}
|
package/dist/lib/prompt.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../lib/prompt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../lib/prompt.ts"],"names":[],"mappings":"AAEA,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAY9E;AA2HD,wBAAgB,mBAAmB,CAC/B,mBAAmB,EAAE,MAAM,EAAE,EAC7B,QAAQ,EAAE,GAAG,EAAE,EACf,gBAAgB,CAAC,EAAE,MAAM,EAAE,EAC3B,oBAAoB,CAAC,EAAE,MAAM,EAAE,GAChC,MAAM,CAQR"}
|
package/dist/lib/prompt.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { join } from "path";
|
|
1
|
+
import { PROMPTS } from "./prompts/generated";
|
|
3
2
|
export function loadPrompt(name, vars) {
|
|
4
|
-
const
|
|
5
|
-
|
|
3
|
+
const content = PROMPTS[name];
|
|
4
|
+
if (!content) {
|
|
5
|
+
throw new Error(`Prompt not found: ${name}. Run 'npm run generate-prompts' to regenerate.`);
|
|
6
|
+
}
|
|
7
|
+
let result = content;
|
|
6
8
|
if (vars) {
|
|
7
9
|
for (const [key, value] of Object.entries(vars)) {
|
|
8
|
-
|
|
10
|
+
result = result.replace(new RegExp(`\\{\\{${key}\\}\\}`, "g"), value);
|
|
9
11
|
}
|
|
10
12
|
}
|
|
11
|
-
return
|
|
13
|
+
return result;
|
|
12
14
|
}
|
|
13
15
|
function minimizeMessages(messages, alreadyPrunedIds, protectedToolCallIds) {
|
|
14
16
|
const prunedIdsSet = alreadyPrunedIds
|
package/dist/lib/prompt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../lib/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../lib/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAE7C,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,IAA6B;IAClE,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC7B,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,iDA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;QAClC,uBAAuB,EAAE,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC;QACvD,eAAe,EAAE,YAAY;KAChC,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated.d.ts","sourceRoot":"","sources":["../../../lib/prompts/generated.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA8S1C,CAAA"}
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-generated file - DO NOT EDIT
|
|
3
|
+
* Generated by scripts/generate-prompts.js
|
|
4
|
+
* Contains all prompt templates bundled at build time
|
|
5
|
+
*/
|
|
6
|
+
export const PROMPTS = {
|
|
7
|
+
"discard-tool-spec": `Discards tool outputs from context to manage conversation size and reduce noise.
|
|
8
|
+
|
|
9
|
+
## IMPORTANT: The Prunable List
|
|
10
|
+
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.
|
|
11
|
+
|
|
12
|
+
## When to Use This Tool
|
|
13
|
+
|
|
14
|
+
Use \`discard\` for removing tool content that is no longer needed
|
|
15
|
+
|
|
16
|
+
- **Noise:** Irrelevant, unhelpful, or superseded outputs that provide no value.
|
|
17
|
+
- **Task Completion:** Work is complete and there's no valuable information worth preserving.
|
|
18
|
+
|
|
19
|
+
## When NOT to Use This Tool
|
|
20
|
+
|
|
21
|
+
- **If the output contains useful information:** Use \`extract\` instead to preserve key findings.
|
|
22
|
+
- **If you'll need the output later:** Don't discard files you plan to edit or context you'll need for implementation.
|
|
23
|
+
|
|
24
|
+
## Best Practices
|
|
25
|
+
- **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.
|
|
26
|
+
- **Think ahead:** Before discarding, ask: "Will I need this output for an upcoming task?" If yes, keep it.
|
|
27
|
+
|
|
28
|
+
## Format
|
|
29
|
+
|
|
30
|
+
- \`ids\`: Array where the first element is the reason, followed by numeric IDs from the \`<prunable-tools>\` list
|
|
31
|
+
|
|
32
|
+
Reasons: \`noise\` | \`completion\`
|
|
33
|
+
|
|
34
|
+
## Example
|
|
35
|
+
|
|
36
|
+
<example_noise>
|
|
37
|
+
Assistant: [Reads 'wrong_file.ts']
|
|
38
|
+
This file isn't relevant to the auth system. I'll remove it to clear the context.
|
|
39
|
+
[Uses discard with ids: ["noise", "5"]]
|
|
40
|
+
</example_noise>
|
|
41
|
+
|
|
42
|
+
<example_completion>
|
|
43
|
+
Assistant: [Runs tests, they pass]
|
|
44
|
+
The tests passed and I don't need to preserve any details. I'll clean up now.
|
|
45
|
+
[Uses discard with ids: ["completion", "20", "21"]]
|
|
46
|
+
</example_completion>`,
|
|
47
|
+
"extract-tool-spec": `Extracts key findings from tool outputs into distilled knowledge, then removes the raw outputs from context.
|
|
48
|
+
|
|
49
|
+
## IMPORTANT: The Prunable List
|
|
50
|
+
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.
|
|
51
|
+
|
|
52
|
+
## When to Use This Tool
|
|
53
|
+
|
|
54
|
+
Use \`extract\` when you have gathered useful information that you want to **preserve in distilled form** before removing the raw outputs:
|
|
55
|
+
|
|
56
|
+
- **Task Completion:** You completed a unit of work and want to preserve key findings.
|
|
57
|
+
- **Knowledge Preservation:** You have context that contains valuable information, but also a lot of unnecessary detail - you only need to preserve some specifics.
|
|
58
|
+
|
|
59
|
+
## When NOT to Use This Tool
|
|
60
|
+
|
|
61
|
+
- **If you need precise syntax:** If you'll edit a file or grep for exact strings, keep the raw output.
|
|
62
|
+
- **If uncertain:** Prefer keeping over re-fetching.
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
## Best Practices
|
|
66
|
+
- **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.
|
|
67
|
+
- **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.
|
|
68
|
+
|
|
69
|
+
## Format
|
|
70
|
+
|
|
71
|
+
- \`ids\`: Array of numeric IDs as strings from the \`<prunable-tools>\` list
|
|
72
|
+
- \`distillation\`: Array of strings, one per ID (positional: distillation[0] is for ids[0], etc.)
|
|
73
|
+
|
|
74
|
+
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.
|
|
75
|
+
|
|
76
|
+
## Example
|
|
77
|
+
|
|
78
|
+
<example_extraction>
|
|
79
|
+
Assistant: [Reads auth service and user types]
|
|
80
|
+
I'll preserve the key details before extracting.
|
|
81
|
+
[Uses extract with:
|
|
82
|
+
ids: ["10", "11"],
|
|
83
|
+
distillation: [
|
|
84
|
+
"auth.ts: validateToken(token: string) -> User|null checks cache first (5min TTL) then OIDC. hashPassword uses bcrypt 12 rounds. Tokens must be 128+ chars.",
|
|
85
|
+
"user.ts: interface User { id: string; email: string; permissions: ('read'|'write'|'admin')[]; status: 'active'|'suspended' }"
|
|
86
|
+
]
|
|
87
|
+
]
|
|
88
|
+
</example_extraction>
|
|
89
|
+
|
|
90
|
+
<example_keep>
|
|
91
|
+
Assistant: [Reads 'auth.ts' to understand the login flow]
|
|
92
|
+
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 extracting.
|
|
93
|
+
</example_keep>`,
|
|
94
|
+
"on-idle-analysis": `You are a conversation analyzer that identifies obsolete tool outputs in a coding session.
|
|
95
|
+
|
|
96
|
+
Your task: Analyze the session history and identify tool call IDs whose outputs are NO LONGER RELEVANT to the current conversation context.
|
|
97
|
+
|
|
98
|
+
Guidelines for identifying obsolete tool calls:
|
|
99
|
+
1. Exploratory reads that didn't lead to actual edits or meaningful discussion AND were not explicitly requested to be retained
|
|
100
|
+
2. Tool outputs from debugging/fixing an error that has now been resolved
|
|
101
|
+
3. Failed or incorrect tool attempts that were immediately corrected (e.g., reading a file from the wrong path, then reading from the correct path)
|
|
102
|
+
|
|
103
|
+
DO NOT prune:
|
|
104
|
+
- Tool calls whose outputs are actively being discussed
|
|
105
|
+
- Tool calls that produced errors still being debugged
|
|
106
|
+
- Tool calls that are the MOST RECENT activity in the conversation (these may be intended for future use)
|
|
107
|
+
|
|
108
|
+
IMPORTANT: Available tool call IDs for analysis: {{available_tool_call_ids}}
|
|
109
|
+
|
|
110
|
+
The session history below may contain tool calls with IDs not in the available list above, these cannot be pruned. These are either:
|
|
111
|
+
1. Protected tools (marked with toolCallID "<protected>")
|
|
112
|
+
2. Already-pruned tools (marked with toolCallID "<already-pruned>")
|
|
113
|
+
|
|
114
|
+
ONLY return IDs from the available list above.
|
|
115
|
+
|
|
116
|
+
Session history (each tool call has a "toolCallID" field):
|
|
117
|
+
{{session_history}}
|
|
118
|
+
|
|
119
|
+
You MUST respond with valid JSON matching this exact schema:
|
|
120
|
+
{
|
|
121
|
+
"pruned_tool_call_ids": ["id1", "id2", ...],
|
|
122
|
+
"reasoning": "explanation of why these IDs were selected"
|
|
123
|
+
}`,
|
|
124
|
+
"user/nudge/nudge-both": `<instruction name=context_management_required>
|
|
125
|
+
**CRITICAL CONTEXT WARNING:** Your context window is filling with tool outputs. Strict adherence to context hygiene is required.
|
|
126
|
+
|
|
127
|
+
**Immediate Actions Required:**
|
|
128
|
+
1. **Task Completion:** If a sub-task is complete, decide: use \`discard\` if no valuable context to preserve (default), or use \`extract\` if insights are worth keeping.
|
|
129
|
+
2. **Noise Removal:** If you read files or ran commands that yielded no value, use \`discard\` to remove them.
|
|
130
|
+
3. **Knowledge Preservation:** If you are holding valuable raw data you'll need to reference later, use \`extract\` to distill the insights and remove the raw entry.
|
|
131
|
+
|
|
132
|
+
**Protocol:** You should prioritize this cleanup, but do not interrupt a critical atomic operation if one is in progress. Once the immediate step is done, you must perform context management.
|
|
133
|
+
</instruction>`,
|
|
134
|
+
"user/nudge/nudge-discard": `<instruction name=context_management_required>
|
|
135
|
+
**CRITICAL CONTEXT WARNING:** Your context window is filling with tool outputs. Strict adherence to context hygiene is required.
|
|
136
|
+
|
|
137
|
+
**Immediate Actions Required:**
|
|
138
|
+
1. **Task Completion:** If a sub-task is complete, use the \`discard\` tool to remove the tools used.
|
|
139
|
+
2. **Noise Removal:** If you read files or ran commands that yielded no value, use the \`discard\` tool to remove them.
|
|
140
|
+
|
|
141
|
+
**Protocol:** You should prioritize this cleanup, but do not interrupt a critical atomic operation if one is in progress. Once the immediate step is done, you must discard unneeded tool outputs.
|
|
142
|
+
</instruction>`,
|
|
143
|
+
"user/nudge/nudge-extract": `<instruction name=context_management_required>
|
|
144
|
+
**CRITICAL CONTEXT WARNING:** Your context window is filling with tool outputs. Strict adherence to context hygiene is required.
|
|
145
|
+
|
|
146
|
+
**Immediate Actions Required:**
|
|
147
|
+
1. **Task Completion:** If you have completed work, extract key findings from the tools used. Scale distillation depth to the value of the content.
|
|
148
|
+
2. **Knowledge Preservation:** If you are holding valuable raw data you'll need to reference later, use the \`extract\` tool with high-fidelity distillation to preserve the insights and remove the raw entry.
|
|
149
|
+
|
|
150
|
+
**Protocol:** You should prioritize this cleanup, but do not interrupt a critical atomic operation if one is in progress. Once the immediate step is done, you must extract valuable findings from tool outputs.
|
|
151
|
+
</instruction>`,
|
|
152
|
+
"user/system/system-prompt-both": `<system-reminder>
|
|
153
|
+
<instruction name=context_management_protocol policy_level=critical>
|
|
154
|
+
|
|
155
|
+
ENVIRONMENT
|
|
156
|
+
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 a user message, and always contains up to date information. Use this information when deciding what to prune.
|
|
157
|
+
|
|
158
|
+
TWO TOOLS FOR CONTEXT MANAGEMENT
|
|
159
|
+
- \`discard\`: Remove tool outputs that are no longer needed (completed tasks, noise, outdated info). No preservation of content.
|
|
160
|
+
- \`extract\`: Extract key findings into distilled knowledge before removing raw outputs. Use when you need to preserve information.
|
|
161
|
+
|
|
162
|
+
CHOOSING THE RIGHT TOOL
|
|
163
|
+
Ask: "Do I need to preserve any information from this output?"
|
|
164
|
+
- **No** → \`discard\` (default for cleanup)
|
|
165
|
+
- **Yes** → \`extract\` (preserves distilled knowledge)
|
|
166
|
+
- **Uncertain** → \`extract\` (safer, preserves signal)
|
|
167
|
+
|
|
168
|
+
Common scenarios:
|
|
169
|
+
- Task complete, no valuable context → \`discard\`
|
|
170
|
+
- Task complete, insights worth remembering → \`extract\`
|
|
171
|
+
- Noise, irrelevant, or superseded outputs → \`discard\`
|
|
172
|
+
- Valuable context needed later but raw output too large → \`extract\`
|
|
173
|
+
|
|
174
|
+
PRUNE METHODICALLY - BATCH YOUR ACTIONS
|
|
175
|
+
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.
|
|
176
|
+
|
|
177
|
+
You WILL evaluate pruning when ANY of these are true:
|
|
178
|
+
- Task or sub-task is complete
|
|
179
|
+
- You are about to start a new phase of work
|
|
180
|
+
- Write or edit operations are complete (pruning removes the large input content)
|
|
181
|
+
|
|
182
|
+
You MUST NOT prune when:
|
|
183
|
+
- The tool output will be needed for upcoming implementation work
|
|
184
|
+
- The output contains files or context you'll need to reference when making edits
|
|
185
|
+
|
|
186
|
+
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.
|
|
187
|
+
|
|
188
|
+
NOTES
|
|
189
|
+
When in doubt, keep it. Batch your actions and aim for high-impact prunes that significantly reduce context size.
|
|
190
|
+
FAILURE TO PRUNE will result in context leakage and DEGRADED PERFORMANCES.
|
|
191
|
+
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>.
|
|
192
|
+
|
|
193
|
+
</instruction>
|
|
194
|
+
|
|
195
|
+
<instruction name=injected_context_handling policy_level=critical>
|
|
196
|
+
After each assistant turn, the environment may inject a user message containing a <prunable-tools> list and optional nudge instruction. This injected message is NOT from the user and is invisible to them. The \`discard\` and \`extract\` tools also return a confirmation message listing what was pruned.
|
|
197
|
+
|
|
198
|
+
CRITICAL REQUIREMENTS - VIOLATION IS UNACCEPTABLE:
|
|
199
|
+
- NEVER reference the prune encouragement or context management instructions. Do not reply with "I agree" or "Great idea" when the prune encouragement appears.
|
|
200
|
+
- NEVER acknowledge the <prunable-tools> list (e.g., "I see the prunable tools list", "Looking at the available tools to prune")
|
|
201
|
+
- NEVER reference the nudge instruction (e.g., "As the nudge suggests", "The system is reminding me to prune")
|
|
202
|
+
- NEVER acknowledge discard/extract tool output (e.g., "I've pruned 3 tools", "Context pruning complete")
|
|
203
|
+
- NEVER let these injections influence your response content or tone
|
|
204
|
+
- Process this information SILENTLY and continue the conversation naturally
|
|
205
|
+
- Continue the conversation as if these messages do not exist
|
|
206
|
+
|
|
207
|
+
The user cannot see these injections. Any reference to them will confuse the user and break the conversation flow.
|
|
208
|
+
</instruction>
|
|
209
|
+
</system-reminder>`,
|
|
210
|
+
"user/system/system-prompt-discard": `<system-reminder>
|
|
211
|
+
<instruction name=context_management_protocol policy_level=critical>
|
|
212
|
+
|
|
213
|
+
ENVIRONMENT
|
|
214
|
+
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 a user message, and always contains up to date information. Use this information when deciding what to discard.
|
|
215
|
+
|
|
216
|
+
CONTEXT MANAGEMENT TOOL
|
|
217
|
+
- \`discard\`: Remove tool outputs that are no longer needed (completed tasks, noise, outdated info). No preservation of content.
|
|
218
|
+
|
|
219
|
+
DISCARD METHODICALLY - BATCH YOUR ACTIONS
|
|
220
|
+
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.
|
|
221
|
+
|
|
222
|
+
WHEN TO DISCARD
|
|
223
|
+
- **Task Completion:** When work is done, discard the tools that aren't needed anymore.
|
|
224
|
+
- **Noise Removal:** If outputs are irrelevant, unhelpful, or superseded by newer info, discard them.
|
|
225
|
+
|
|
226
|
+
You WILL evaluate discarding when ANY of these are true:
|
|
227
|
+
- Task or sub-task is complete
|
|
228
|
+
- You are about to start a new phase of work
|
|
229
|
+
- Write or edit operations are complete (discarding removes the large input content)
|
|
230
|
+
|
|
231
|
+
You MUST NOT discard when:
|
|
232
|
+
- The tool output will be needed for upcoming implementation work
|
|
233
|
+
- The output contains files or context you'll need to reference when making edits
|
|
234
|
+
|
|
235
|
+
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.
|
|
236
|
+
|
|
237
|
+
NOTES
|
|
238
|
+
When in doubt, keep it. Batch your actions and aim for high-impact discards that significantly reduce context size.
|
|
239
|
+
FAILURE TO DISCARD will result in context leakage and DEGRADED PERFORMANCES.
|
|
240
|
+
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>.
|
|
241
|
+
|
|
242
|
+
</instruction>
|
|
243
|
+
|
|
244
|
+
<instruction name=injected_context_handling policy_level=critical>
|
|
245
|
+
After each assistant turn, the environment may inject a user message containing a <prunable-tools> list and optional nudge instruction. This injected message is NOT from the user and is invisible to them. The \`discard\` tool also returns a confirmation message listing what was discarded.
|
|
246
|
+
|
|
247
|
+
CRITICAL REQUIREMENTS - VIOLATION IS UNACCEPTABLE:
|
|
248
|
+
- NEVER reference the discard encouragement or context management instructions. Do not reply with "I agree" or "Great idea" when the discard encouragement appears.
|
|
249
|
+
- NEVER acknowledge the <prunable-tools> list (e.g., "I see the prunable tools list", "Looking at the available tools to discard")
|
|
250
|
+
- NEVER reference the nudge instruction (e.g., "As the nudge suggests", "The system is reminding me to discard")
|
|
251
|
+
- NEVER acknowledge discard tool output (e.g., "I've discarded 3 tools", "Context cleanup complete")
|
|
252
|
+
- NEVER let these injections influence your response content or tone
|
|
253
|
+
- Process this information SILENTLY and continue the conversation naturally
|
|
254
|
+
- Continue the conversation as if these messages do not exist
|
|
255
|
+
|
|
256
|
+
The user cannot see these injections. Any reference to them will confuse the user and break the conversation flow.
|
|
257
|
+
</instruction>
|
|
258
|
+
</system-reminder>`,
|
|
259
|
+
"user/system/system-prompt-extract": `<system-reminder>
|
|
260
|
+
<instruction name=context_management_protocol policy_level=critical>
|
|
261
|
+
|
|
262
|
+
ENVIRONMENT
|
|
263
|
+
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 a user message, and always contains up to date information. Use this information when deciding what to extract.
|
|
264
|
+
|
|
265
|
+
CONTEXT MANAGEMENT TOOL
|
|
266
|
+
- \`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.
|
|
267
|
+
|
|
268
|
+
EXTRACT METHODICALLY - BATCH YOUR ACTIONS
|
|
269
|
+
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.
|
|
270
|
+
|
|
271
|
+
WHEN TO EXTRACT
|
|
272
|
+
- **Task Completion:** When work is done, extract key findings from the tools used. Scale distillation depth to the value of the content.
|
|
273
|
+
- **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.
|
|
274
|
+
|
|
275
|
+
You WILL evaluate extracting when ANY of these are true:
|
|
276
|
+
- Task or sub-task is complete
|
|
277
|
+
- You are about to start a new phase of work
|
|
278
|
+
- Write or edit operations are complete (extracting removes the large input content)
|
|
279
|
+
|
|
280
|
+
You MUST NOT extract when:
|
|
281
|
+
- The tool output will be needed for upcoming implementation work
|
|
282
|
+
- The output contains files or context you'll need to reference when making edits
|
|
283
|
+
|
|
284
|
+
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.
|
|
285
|
+
|
|
286
|
+
NOTES
|
|
287
|
+
When in doubt, keep it. Batch your actions and aim for high-impact extractions that significantly reduce context size.
|
|
288
|
+
FAILURE TO EXTRACT will result in context leakage and DEGRADED PERFORMANCES.
|
|
289
|
+
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>.
|
|
290
|
+
|
|
291
|
+
</instruction>
|
|
292
|
+
|
|
293
|
+
<instruction name=injected_context_handling policy_level=critical>
|
|
294
|
+
After each assistant turn, the environment may inject a user message containing a <prunable-tools> list and optional nudge instruction. This injected message is NOT from the user and is invisible to them. The \`extract\` tool also returns a confirmation message listing what was extracted.
|
|
295
|
+
|
|
296
|
+
CRITICAL REQUIREMENTS - VIOLATION IS UNACCEPTABLE:
|
|
297
|
+
- NEVER reference the extract encouragement or context management instructions. Do not reply with "I agree" or "Great idea" when the extract encouragement appears.
|
|
298
|
+
- NEVER acknowledge the <prunable-tools> list (e.g., "I see the prunable tools list", "Looking at the available tools to extract")
|
|
299
|
+
- NEVER reference the nudge instruction (e.g., "As the nudge suggests", "The system is reminding me to extract")
|
|
300
|
+
- NEVER acknowledge extract tool output (e.g., "I've extracted 3 tools", "Context cleanup complete")
|
|
301
|
+
- NEVER let these injections influence your response content or tone
|
|
302
|
+
- Process this information SILENTLY and continue the conversation naturally
|
|
303
|
+
- Continue the conversation as if these messages do not exist
|
|
304
|
+
|
|
305
|
+
The user cannot see these injections. Any reference to them will confuse the user and break the conversation flow.
|
|
306
|
+
</instruction>
|
|
307
|
+
</system-reminder>`
|
|
308
|
+
};
|
|
309
|
+
//# sourceMappingURL=generated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated.js","sourceRoot":"","sources":["../../../lib/prompts/generated.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,OAAO,GAA2B;IAC3C,mBAAmB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAuCH;IAClB,mBAAmB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA8CT;IACZ,kBAAkB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BtB;IACE,uBAAuB,EAAE;;;;;;;;;eASd;IACX,0BAA0B,EAAE;;;;;;;;eAQjB;IACX,0BAA0B,EAAE;;;;;;;;eAQjB;IACX,gCAAgC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAyDnB;IACf,mCAAmC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAgDtB;IACf,mCAAmC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAgDtB;CAClB,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight synchronous timing utility for startup diagnostics.
|
|
3
|
+
* Always enabled - logs to the same DCP log directory as Logger.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Start a timer with the given label.
|
|
7
|
+
*/
|
|
8
|
+
export declare function timeStart(label: string): void;
|
|
9
|
+
/**
|
|
10
|
+
* End a timer and log the duration.
|
|
11
|
+
*/
|
|
12
|
+
export declare function timeEnd(label: string): void;
|
|
13
|
+
//# sourceMappingURL=timing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timing.d.ts","sourceRoot":"","sources":["../../lib/timing.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAE7C;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAM3C"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight synchronous timing utility for startup diagnostics.
|
|
3
|
+
* Always enabled - logs to the same DCP log directory as Logger.
|
|
4
|
+
*/
|
|
5
|
+
import { appendFileSync, mkdirSync, existsSync } from "fs";
|
|
6
|
+
import { join } from "path";
|
|
7
|
+
import { homedir } from "os";
|
|
8
|
+
const timers = new Map();
|
|
9
|
+
const LOG_DIR = join(homedir(), ".config", "opencode", "logs", "dcp", "daily");
|
|
10
|
+
/**
|
|
11
|
+
* Start a timer with the given label.
|
|
12
|
+
*/
|
|
13
|
+
export function timeStart(label) {
|
|
14
|
+
timers.set(label, performance.now());
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* End a timer and log the duration.
|
|
18
|
+
*/
|
|
19
|
+
export function timeEnd(label) {
|
|
20
|
+
const start = timers.get(label);
|
|
21
|
+
if (start === undefined)
|
|
22
|
+
return;
|
|
23
|
+
const duration = performance.now() - start;
|
|
24
|
+
timers.delete(label);
|
|
25
|
+
logTiming(label, duration);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Write timing log entry synchronously to the DCP daily log file.
|
|
29
|
+
*/
|
|
30
|
+
function logTiming(label, durationMs) {
|
|
31
|
+
try {
|
|
32
|
+
if (!existsSync(LOG_DIR)) {
|
|
33
|
+
mkdirSync(LOG_DIR, { recursive: true });
|
|
34
|
+
}
|
|
35
|
+
const timestamp = new Date().toISOString();
|
|
36
|
+
const logFile = join(LOG_DIR, `${timestamp.split("T")[0]}.log`);
|
|
37
|
+
const logLine = `${timestamp} TIME timing: ${label} | duration=${durationMs.toFixed(2)}ms\n`;
|
|
38
|
+
appendFileSync(logFile, logLine);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
// Silently ignore logging errors to avoid breaking startup
|
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AI,EAAE,CAAC,WAAW,EAAE,CAAA;QAC1C,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;QAC/D,MAAM,OAAO,GAAG,GAAG,SAAS,kBAAkB,KAAK,eAAe,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAA;QAC7F,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IACpC,CAAC;IAAC,MAAM,CAAC;QACL,2DAA2D;IAC/D,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@dev4s/opencode-dcp",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.5",
|
|
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",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"clean": "rimraf dist",
|
|
11
|
-
"build": "npm run clean &&
|
|
11
|
+
"build": "npm run clean && npm run generate-prompts && tsc",
|
|
12
|
+
"generate-prompts": "node scripts/generate-prompts.cjs",
|
|
12
13
|
"postbuild": "rimraf dist/logs",
|
|
13
14
|
"prepublishOnly": "npm run build",
|
|
14
15
|
"dev": "opencode plugin dev",
|
|
@@ -42,7 +43,6 @@
|
|
|
42
43
|
"devDependencies": {
|
|
43
44
|
"@opencode-ai/plugin": "^1.0.224",
|
|
44
45
|
"@types/node": "^25.0.3",
|
|
45
|
-
"cpy-cli": "^6.0.0",
|
|
46
46
|
"prettier": "^3.7.4",
|
|
47
47
|
"rimraf": "^6.1.2",
|
|
48
48
|
"tsx": "^4.21.0",
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
Discards tool outputs from context to manage conversation size and reduce noise.
|
|
2
|
-
|
|
3
|
-
## IMPORTANT: The Prunable List
|
|
4
|
-
A `<prunable-tools>` list is provided to you showing available tool outputs you can 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.
|
|
5
|
-
|
|
6
|
-
## When to Use This Tool
|
|
7
|
-
|
|
8
|
-
Use `discard` for removing tool content that is no longer needed
|
|
9
|
-
|
|
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.
|
|
12
|
-
|
|
13
|
-
## When NOT to Use This Tool
|
|
14
|
-
|
|
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.
|
|
17
|
-
|
|
18
|
-
## Best Practices
|
|
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.
|
|
20
|
-
- **Think ahead:** Before discarding, ask: "Will I need this output for an upcoming task?" If yes, keep it.
|
|
21
|
-
|
|
22
|
-
## Format
|
|
23
|
-
|
|
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
|
|
29
|
-
|
|
30
|
-
<example_noise>
|
|
31
|
-
Assistant: [Reads 'wrong_file.ts']
|
|
32
|
-
This file isn't relevant to the auth system. I'll remove it to clear the context.
|
|
33
|
-
[Uses discard with ids: ["noise", "5"]]
|
|
34
|
-
</example_noise>
|
|
35
|
-
|
|
36
|
-
<example_completion>
|
|
37
|
-
Assistant: [Runs tests, they pass]
|
|
38
|
-
The tests passed and I don't need to preserve any details. I'll clean up now.
|
|
39
|
-
[Uses discard with ids: ["completion", "20", "21"]]
|
|
40
|
-
</example_completion>
|
|
41
|
-
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
Extracts key findings from tool outputs into distilled knowledge, then removes the raw outputs from context.
|
|
2
|
-
|
|
3
|
-
## IMPORTANT: The Prunable List
|
|
4
|
-
A `<prunable-tools>` list is provided to you showing available tool outputs you can 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
|
-
|
|
6
|
-
## When to Use This Tool
|
|
7
|
-
|
|
8
|
-
Use `extract` when you have gathered useful information that you want to **preserve in distilled form** before removing the raw outputs:
|
|
9
|
-
|
|
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.
|
|
12
|
-
|
|
13
|
-
## When NOT to Use This Tool
|
|
14
|
-
|
|
15
|
-
- **If you need precise syntax:** If you'll edit a file or grep for exact strings, keep the raw output.
|
|
16
|
-
- **If uncertain:** Prefer keeping over re-fetching.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
## Best Practices
|
|
20
|
-
- **Strategic Batching:** Wait until you have several items or a few large outputs to extract, rather than doing tiny, frequent extractions. Aim for high-impact extractions that significantly reduce context size.
|
|
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.
|
|
22
|
-
|
|
23
|
-
## Format
|
|
24
|
-
|
|
25
|
-
- `ids`: Array of numeric IDs as strings from the `<prunable-tools>` list
|
|
26
|
-
- `distillation`: Array of strings, one per ID (positional: distillation[0] is for ids[0], etc.)
|
|
27
|
-
|
|
28
|
-
Each distillation string should capture the essential information you need to preserve - function signatures, logic, constraints, values, etc. Be as detailed as needed for your task.
|
|
29
|
-
|
|
30
|
-
## Example
|
|
31
|
-
|
|
32
|
-
<example_extraction>
|
|
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
|
-
]
|
|
42
|
-
</example_extraction>
|
|
43
|
-
|
|
44
|
-
<example_keep>
|
|
45
|
-
Assistant: [Reads 'auth.ts' to understand the login flow]
|
|
46
|
-
I've understood the auth flow. I'll need to modify this file to add the new validation, so I'm keeping this read in context rather than extracting.
|
|
47
|
-
</example_keep>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
You are a conversation analyzer that identifies obsolete tool outputs in a coding session.
|
|
2
|
-
|
|
3
|
-
Your task: Analyze the session history and identify tool call IDs whose outputs are NO LONGER RELEVANT to the current conversation context.
|
|
4
|
-
|
|
5
|
-
Guidelines for identifying obsolete tool calls:
|
|
6
|
-
1. Exploratory reads that didn't lead to actual edits or meaningful discussion AND were not explicitly requested to be retained
|
|
7
|
-
2. Tool outputs from debugging/fixing an error that has now been resolved
|
|
8
|
-
3. Failed or incorrect tool attempts that were immediately corrected (e.g., reading a file from the wrong path, then reading from the correct path)
|
|
9
|
-
|
|
10
|
-
DO NOT prune:
|
|
11
|
-
- Tool calls whose outputs are actively being discussed
|
|
12
|
-
- Tool calls that produced errors still being debugged
|
|
13
|
-
- Tool calls that are the MOST RECENT activity in the conversation (these may be intended for future use)
|
|
14
|
-
|
|
15
|
-
IMPORTANT: Available tool call IDs for analysis: {{available_tool_call_ids}}
|
|
16
|
-
|
|
17
|
-
The session history below may contain tool calls with IDs not in the available list above, these cannot be pruned. These are either:
|
|
18
|
-
1. Protected tools (marked with toolCallID "<protected>")
|
|
19
|
-
2. Already-pruned tools (marked with toolCallID "<already-pruned>")
|
|
20
|
-
|
|
21
|
-
ONLY return IDs from the available list above.
|
|
22
|
-
|
|
23
|
-
Session history (each tool call has a "toolCallID" field):
|
|
24
|
-
{{session_history}}
|
|
25
|
-
|
|
26
|
-
You MUST respond with valid JSON matching this exact schema:
|
|
27
|
-
{
|
|
28
|
-
"pruned_tool_call_ids": ["id1", "id2", ...],
|
|
29
|
-
"reasoning": "explanation of why these IDs were selected"
|
|
30
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<instruction name=context_management_required>
|
|
2
|
-
**CRITICAL CONTEXT WARNING:** Your context window is filling with tool outputs. Strict adherence to context hygiene is required.
|
|
3
|
-
|
|
4
|
-
**Immediate Actions Required:**
|
|
5
|
-
1. **Task Completion:** If a sub-task is complete, decide: use `discard` if no valuable context to preserve (default), or use `extract` if insights are worth keeping.
|
|
6
|
-
2. **Noise Removal:** If you read files or ran commands that yielded no value, use `discard` to remove them.
|
|
7
|
-
3. **Knowledge Preservation:** If you are holding valuable raw data you'll need to reference later, use `extract` to distill the insights and remove the raw entry.
|
|
8
|
-
|
|
9
|
-
**Protocol:** You should prioritize this cleanup, 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
|
-
</instruction>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<instruction name=context_management_required>
|
|
2
|
-
**CRITICAL CONTEXT WARNING:** Your context window is filling with tool outputs. Strict adherence to context hygiene is required.
|
|
3
|
-
|
|
4
|
-
**Immediate Actions Required:**
|
|
5
|
-
1. **Task Completion:** If a sub-task is complete, use the `discard` tool to remove the tools used.
|
|
6
|
-
2. **Noise Removal:** If you read files or ran commands that yielded no value, use the `discard` tool to remove them.
|
|
7
|
-
|
|
8
|
-
**Protocol:** You should prioritize this cleanup, but do not interrupt a critical atomic operation if one is in progress. Once the immediate step is done, you must discard unneeded tool outputs.
|
|
9
|
-
</instruction>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<instruction name=context_management_required>
|
|
2
|
-
**CRITICAL CONTEXT WARNING:** Your context window is filling with tool outputs. Strict adherence to context hygiene is required.
|
|
3
|
-
|
|
4
|
-
**Immediate Actions Required:**
|
|
5
|
-
1. **Task Completion:** If you have completed work, extract key findings from the tools used. Scale distillation depth to the value of the content.
|
|
6
|
-
2. **Knowledge Preservation:** If you are holding valuable raw data you'll need to reference later, use the `extract` tool with high-fidelity distillation to preserve the insights and remove the raw entry.
|
|
7
|
-
|
|
8
|
-
**Protocol:** You should prioritize this cleanup, but do not interrupt a critical atomic operation if one is in progress. Once the immediate step is done, you must extract valuable findings from tool outputs.
|
|
9
|
-
</instruction>
|
|
@@ -1,58 +0,0 @@
|
|
|
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 a user 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: "Do I need to preserve any information from this output?"
|
|
13
|
-
- **No** → `discard` (default for cleanup)
|
|
14
|
-
- **Yes** → `extract` (preserves distilled knowledge)
|
|
15
|
-
- **Uncertain** → `extract` (safer, preserves signal)
|
|
16
|
-
|
|
17
|
-
Common scenarios:
|
|
18
|
-
- Task complete, no valuable context → `discard`
|
|
19
|
-
- Task complete, insights worth remembering → `extract`
|
|
20
|
-
- Noise, irrelevant, or superseded outputs → `discard`
|
|
21
|
-
- Valuable context needed later but raw output too large → `extract`
|
|
22
|
-
|
|
23
|
-
PRUNE METHODICALLY - BATCH YOUR ACTIONS
|
|
24
|
-
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.
|
|
25
|
-
|
|
26
|
-
You WILL evaluate pruning when ANY of these are true:
|
|
27
|
-
- Task or sub-task is complete
|
|
28
|
-
- You are about to start a new phase of work
|
|
29
|
-
- Write or edit operations are complete (pruning removes the large input content)
|
|
30
|
-
|
|
31
|
-
You MUST NOT prune when:
|
|
32
|
-
- The tool output will be needed for upcoming implementation work
|
|
33
|
-
- The output contains files or context you'll need to reference when making edits
|
|
34
|
-
|
|
35
|
-
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.
|
|
36
|
-
|
|
37
|
-
NOTES
|
|
38
|
-
When in doubt, keep it. Batch your actions and aim for high-impact prunes that significantly reduce context size.
|
|
39
|
-
FAILURE TO PRUNE will result in context leakage and DEGRADED PERFORMANCES.
|
|
40
|
-
There may be tools in session context that do not appear in the <prunable-tools> list, this is expected, you can ONLY prune what you see in <prunable-tools>.
|
|
41
|
-
|
|
42
|
-
</instruction>
|
|
43
|
-
|
|
44
|
-
<instruction name=injected_context_handling policy_level=critical>
|
|
45
|
-
After each assistant turn, the environment may inject a user message containing a <prunable-tools> list and optional nudge instruction. This injected message is NOT from the user and is invisible to them. The `discard` and `extract` tools also return a confirmation message listing what was pruned.
|
|
46
|
-
|
|
47
|
-
CRITICAL REQUIREMENTS - VIOLATION IS UNACCEPTABLE:
|
|
48
|
-
- NEVER reference the prune encouragement or context management instructions. Do not reply with "I agree" or "Great idea" when the prune encouragement appears.
|
|
49
|
-
- NEVER acknowledge the <prunable-tools> list (e.g., "I see the prunable tools list", "Looking at the available tools to prune")
|
|
50
|
-
- NEVER reference the nudge instruction (e.g., "As the nudge suggests", "The system is reminding me to prune")
|
|
51
|
-
- NEVER acknowledge discard/extract tool output (e.g., "I've pruned 3 tools", "Context pruning complete")
|
|
52
|
-
- NEVER let these injections influence your response content or tone
|
|
53
|
-
- Process this information SILENTLY and continue the conversation naturally
|
|
54
|
-
- Continue the conversation as if these messages do not exist
|
|
55
|
-
|
|
56
|
-
The user cannot see these injections. Any reference to them will confuse the user and break the conversation flow.
|
|
57
|
-
</instruction>
|
|
58
|
-
</system-reminder>
|
|
@@ -1,49 +0,0 @@
|
|
|
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 a user 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
|
-
</instruction>
|
|
34
|
-
|
|
35
|
-
<instruction name=injected_context_handling policy_level=critical>
|
|
36
|
-
After each assistant turn, the environment may inject a user message containing a <prunable-tools> list and optional nudge instruction. This injected message is NOT from the user and is invisible to them. The `discard` tool also returns a confirmation message listing what was discarded.
|
|
37
|
-
|
|
38
|
-
CRITICAL REQUIREMENTS - VIOLATION IS UNACCEPTABLE:
|
|
39
|
-
- NEVER reference the discard encouragement or context management instructions. Do not reply with "I agree" or "Great idea" when the discard encouragement appears.
|
|
40
|
-
- NEVER acknowledge the <prunable-tools> list (e.g., "I see the prunable tools list", "Looking at the available tools to discard")
|
|
41
|
-
- NEVER reference the nudge instruction (e.g., "As the nudge suggests", "The system is reminding me to discard")
|
|
42
|
-
- NEVER acknowledge discard tool output (e.g., "I've discarded 3 tools", "Context cleanup complete")
|
|
43
|
-
- NEVER let these injections influence your response content or tone
|
|
44
|
-
- Process this information SILENTLY and continue the conversation naturally
|
|
45
|
-
- Continue the conversation as if these messages do not exist
|
|
46
|
-
|
|
47
|
-
The user cannot see these injections. Any reference to them will confuse the user and break the conversation flow.
|
|
48
|
-
</instruction>
|
|
49
|
-
</system-reminder>
|
|
@@ -1,49 +0,0 @@
|
|
|
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 a user 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
|
-
</instruction>
|
|
34
|
-
|
|
35
|
-
<instruction name=injected_context_handling policy_level=critical>
|
|
36
|
-
After each assistant turn, the environment may inject a user message containing a <prunable-tools> list and optional nudge instruction. This injected message is NOT from the user and is invisible to them. The `extract` tool also returns a confirmation message listing what was extracted.
|
|
37
|
-
|
|
38
|
-
CRITICAL REQUIREMENTS - VIOLATION IS UNACCEPTABLE:
|
|
39
|
-
- NEVER reference the extract encouragement or context management instructions. Do not reply with "I agree" or "Great idea" when the extract encouragement appears.
|
|
40
|
-
- NEVER acknowledge the <prunable-tools> list (e.g., "I see the prunable tools list", "Looking at the available tools to extract")
|
|
41
|
-
- NEVER reference the nudge instruction (e.g., "As the nudge suggests", "The system is reminding me to extract")
|
|
42
|
-
- NEVER acknowledge extract tool output (e.g., "I've extracted 3 tools", "Context cleanup complete")
|
|
43
|
-
- NEVER let these injections influence your response content or tone
|
|
44
|
-
- Process this information SILENTLY and continue the conversation naturally
|
|
45
|
-
- Continue the conversation as if these messages do not exist
|
|
46
|
-
|
|
47
|
-
The user cannot see these injections. Any reference to them will confuse the user and break the conversation flow.
|
|
48
|
-
</instruction>
|
|
49
|
-
</system-reminder>
|