@tarquinen/opencode-dcp 1.3.0-beta.1 → 1.3.1-beta1
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 +1 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -17
- package/dist/index.js.map +1 -1
- package/dist/lib/config.d.ts +0 -5
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +0 -30
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/hooks.d.ts.map +1 -1
- package/dist/lib/hooks.js +2 -15
- package/dist/lib/hooks.js.map +1 -1
- package/dist/lib/messages/inject.d.ts.map +1 -1
- package/dist/lib/messages/inject.js +40 -74
- package/dist/lib/messages/inject.js.map +1 -1
- package/dist/lib/messages/prune.d.ts.map +1 -1
- package/dist/lib/messages/prune.js +1 -42
- package/dist/lib/messages/prune.js.map +1 -1
- package/dist/lib/messages/utils.d.ts +21 -3
- package/dist/lib/messages/utils.d.ts.map +1 -1
- package/dist/lib/messages/utils.js +52 -27
- package/dist/lib/messages/utils.js.map +1 -1
- package/dist/lib/prompts/discard-tool-spec.d.ts +1 -1
- package/dist/lib/prompts/discard-tool-spec.d.ts.map +1 -1
- package/dist/lib/prompts/discard-tool-spec.js +40 -17
- package/dist/lib/prompts/discard-tool-spec.js.map +1 -1
- package/dist/lib/prompts/extract-tool-spec.d.ts +1 -1
- package/dist/lib/prompts/extract-tool-spec.d.ts.map +1 -1
- package/dist/lib/prompts/extract-tool-spec.js +47 -22
- package/dist/lib/prompts/extract-tool-spec.js.map +1 -1
- package/dist/lib/prompts/index.d.ts.map +1 -1
- package/dist/lib/prompts/index.js +4 -22
- package/dist/lib/prompts/index.js.map +1 -1
- package/dist/lib/prompts/nudge/both.d.ts +2 -0
- package/dist/lib/prompts/nudge/both.d.ts.map +1 -0
- package/dist/lib/prompts/nudge/both.js +11 -0
- package/dist/lib/prompts/nudge/both.js.map +1 -0
- package/dist/lib/prompts/nudge/discard.d.ts +1 -1
- package/dist/lib/prompts/nudge/discard.d.ts.map +1 -1
- package/dist/lib/prompts/nudge/discard.js +7 -5
- package/dist/lib/prompts/nudge/discard.js.map +1 -1
- package/dist/lib/prompts/nudge/extract.d.ts +1 -1
- package/dist/lib/prompts/nudge/extract.d.ts.map +1 -1
- package/dist/lib/prompts/nudge/extract.js +7 -5
- package/dist/lib/prompts/nudge/extract.js.map +1 -1
- package/dist/lib/prompts/nudge.generated.d.ts +2 -0
- package/dist/lib/prompts/nudge.generated.d.ts.map +1 -0
- package/dist/lib/prompts/nudge.generated.js +17 -0
- package/dist/lib/prompts/nudge.generated.js.map +1 -0
- package/dist/lib/prompts/system/both.d.ts +2 -0
- package/dist/lib/prompts/system/both.d.ts.map +1 -0
- package/dist/lib/prompts/system/both.js +61 -0
- package/dist/lib/prompts/system/both.js.map +1 -0
- package/dist/lib/prompts/system/discard.d.ts +1 -1
- package/dist/lib/prompts/system/discard.d.ts.map +1 -1
- package/dist/lib/prompts/system/discard.js +43 -18
- package/dist/lib/prompts/system/discard.js.map +1 -1
- package/dist/lib/prompts/system/extract.d.ts +1 -1
- package/dist/lib/prompts/system/extract.d.ts.map +1 -1
- package/dist/lib/prompts/system/extract.js +43 -18
- package/dist/lib/prompts/system/extract.js.map +1 -1
- package/dist/lib/prompts/system.generated.d.ts +2 -0
- package/dist/lib/prompts/system.generated.d.ts.map +1 -0
- package/dist/lib/prompts/system.generated.js +90 -0
- package/dist/lib/prompts/system.generated.js.map +1 -0
- package/dist/lib/shared-utils.d.ts +1 -1
- package/dist/lib/shared-utils.d.ts.map +1 -1
- package/dist/lib/shared-utils.js +3 -10
- package/dist/lib/shared-utils.js.map +1 -1
- package/dist/lib/state/persistence.d.ts +1 -2
- package/dist/lib/state/persistence.d.ts.map +1 -1
- package/dist/lib/state/persistence.js +0 -1
- package/dist/lib/state/persistence.js.map +1 -1
- package/dist/lib/state/state.d.ts +1 -0
- package/dist/lib/state/state.d.ts.map +1 -1
- package/dist/lib/state/state.js +29 -10
- 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 +2 -4
- package/dist/lib/state/tool-cache.js.map +1 -1
- package/dist/lib/state/types.d.ts +0 -6
- package/dist/lib/state/types.d.ts.map +1 -1
- package/dist/lib/state/utils.d.ts +0 -4
- package/dist/lib/state/utils.d.ts.map +1 -1
- package/dist/lib/state/utils.js +0 -33
- package/dist/lib/state/utils.js.map +1 -1
- package/dist/lib/strategies/index.d.ts +1 -1
- package/dist/lib/strategies/index.d.ts.map +1 -1
- package/dist/lib/strategies/index.js +1 -1
- package/dist/lib/strategies/index.js.map +1 -1
- package/dist/lib/{tools/types.d.ts → strategies/tools.d.ts} +4 -1
- package/dist/lib/strategies/tools.d.ts.map +1 -0
- package/dist/lib/strategies/tools.js +135 -0
- package/dist/lib/strategies/tools.js.map +1 -0
- package/dist/lib/strategies/utils.d.ts +0 -1
- package/dist/lib/strategies/utils.d.ts.map +1 -1
- package/dist/lib/strategies/utils.js +4 -5
- package/dist/lib/strategies/utils.js.map +1 -1
- package/dist/lib/ui/notification.d.ts +0 -1
- package/dist/lib/ui/notification.d.ts.map +1 -1
- package/dist/lib/ui/notification.js +1 -29
- package/dist/lib/ui/notification.js.map +1 -1
- package/dist/lib/ui/utils.d.ts +0 -1
- package/dist/lib/ui/utils.d.ts.map +1 -1
- package/dist/lib/ui/utils.js +0 -16
- package/dist/lib/ui/utils.js.map +1 -1
- package/package.json +1 -2
- package/dist/lib/auth.d.ts +0 -4
- package/dist/lib/auth.d.ts.map +0 -1
- package/dist/lib/auth.js +0 -32
- package/dist/lib/auth.js.map +0 -1
- package/dist/lib/prompts/nudge/all.d.ts +0 -2
- package/dist/lib/prompts/nudge/all.d.ts.map +0 -1
- package/dist/lib/prompts/nudge/all.js +0 -9
- package/dist/lib/prompts/nudge/all.js.map +0 -1
- package/dist/lib/prompts/nudge/discard-extract.d.ts +0 -2
- package/dist/lib/prompts/nudge/discard-extract.d.ts.map +0 -1
- package/dist/lib/prompts/nudge/discard-extract.js +0 -8
- package/dist/lib/prompts/nudge/discard-extract.js.map +0 -1
- package/dist/lib/prompts/nudge/discard-squash.d.ts +0 -2
- package/dist/lib/prompts/nudge/discard-squash.d.ts.map +0 -1
- package/dist/lib/prompts/nudge/discard-squash.js +0 -8
- package/dist/lib/prompts/nudge/discard-squash.js.map +0 -1
- package/dist/lib/prompts/nudge/extract-squash.d.ts +0 -2
- package/dist/lib/prompts/nudge/extract-squash.d.ts.map +0 -1
- package/dist/lib/prompts/nudge/extract-squash.js +0 -8
- package/dist/lib/prompts/nudge/extract-squash.js.map +0 -1
- package/dist/lib/prompts/nudge/squash.d.ts +0 -2
- package/dist/lib/prompts/nudge/squash.d.ts.map +0 -1
- package/dist/lib/prompts/nudge/squash.js +0 -8
- package/dist/lib/prompts/nudge/squash.js.map +0 -1
- package/dist/lib/prompts/squash-tool-spec.d.ts +0 -2
- package/dist/lib/prompts/squash-tool-spec.d.ts.map +0 -1
- package/dist/lib/prompts/squash-tool-spec.js +0 -33
- package/dist/lib/prompts/squash-tool-spec.js.map +0 -1
- package/dist/lib/prompts/system/all.d.ts +0 -2
- package/dist/lib/prompts/system/all.d.ts.map +0 -1
- package/dist/lib/prompts/system/all.js +0 -26
- package/dist/lib/prompts/system/all.js.map +0 -1
- package/dist/lib/prompts/system/discard-extract.d.ts +0 -2
- package/dist/lib/prompts/system/discard-extract.d.ts.map +0 -1
- package/dist/lib/prompts/system/discard-extract.js +0 -26
- package/dist/lib/prompts/system/discard-extract.js.map +0 -1
- package/dist/lib/prompts/system/discard-squash.d.ts +0 -2
- package/dist/lib/prompts/system/discard-squash.d.ts.map +0 -1
- package/dist/lib/prompts/system/discard-squash.js +0 -25
- package/dist/lib/prompts/system/discard-squash.js.map +0 -1
- package/dist/lib/prompts/system/extract-squash.d.ts +0 -2
- package/dist/lib/prompts/system/extract-squash.d.ts.map +0 -1
- package/dist/lib/prompts/system/extract-squash.js +0 -25
- package/dist/lib/prompts/system/extract-squash.js.map +0 -1
- package/dist/lib/prompts/system/squash.d.ts +0 -2
- package/dist/lib/prompts/system/squash.d.ts.map +0 -1
- package/dist/lib/prompts/system/squash.js +0 -27
- package/dist/lib/prompts/system/squash.js.map +0 -1
- package/dist/lib/tools/discard.d.ts +0 -4
- package/dist/lib/tools/discard.d.ts.map +0 -1
- package/dist/lib/tools/discard.js +0 -21
- package/dist/lib/tools/discard.js.map +0 -1
- package/dist/lib/tools/extract.d.ts +0 -4
- package/dist/lib/tools/extract.d.ts.map +0 -1
- package/dist/lib/tools/extract.js +0 -30
- package/dist/lib/tools/extract.js.map +0 -1
- package/dist/lib/tools/index.d.ts +0 -5
- package/dist/lib/tools/index.d.ts.map +0 -1
- package/dist/lib/tools/index.js +0 -4
- package/dist/lib/tools/index.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 -107
- package/dist/lib/tools/prune-shared.js.map +0 -1
- package/dist/lib/tools/squash.d.ts +0 -4
- package/dist/lib/tools/squash.d.ts.map +0 -1
- package/dist/lib/tools/squash.js +0 -81
- package/dist/lib/tools/squash.js.map +0 -1
- package/dist/lib/tools/types.d.ts.map +0 -1
- package/dist/lib/tools/types.js +0 -2
- package/dist/lib/tools/types.js.map +0 -1
- package/dist/lib/tools/utils.d.ts +0 -26
- package/dist/lib/tools/utils.d.ts.map +0 -1
- package/dist/lib/tools/utils.js +0 -121
- package/dist/lib/tools/utils.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prune.js","sourceRoot":"","sources":["../../../lib/messages/prune.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"prune.js","sourceRoot":"","sources":["../../../lib/messages/prune.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAA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AE,CAAC;YACjC,SAAQ;QACZ,CAAC;QAED,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;QACvD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACvB,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;gBACvB,SAAQ;YACZ,CAAC;YACD,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC7C,SAAQ;YACZ,CAAC;YACD,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;gBAChC,SAAQ;YACZ,CAAC;YAED,4CAA4C;YAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAA;YAC9B,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBACrC,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;oBACnC,IAAI,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE,CAAC;wBACjC,KAAK,CAAC,GAAG,CAAC,GAAG,mCAAmC,CAAA;oBACpD,CAAC;gBACL,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;AACL,CAAC,CAAA"}
|
|
@@ -1,13 +1,31 @@
|
|
|
1
1
|
import { Logger } from "../logger";
|
|
2
2
|
import type { SessionState, WithParts } from "../state";
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const isDeepSeekOrKimi: (providerID: string, modelID: string) => boolean;
|
|
4
4
|
export declare const createSyntheticUserMessage: (baseMessage: WithParts, content: string, variant?: string) => WithParts;
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const createSyntheticAssistantMessage: (baseMessage: WithParts, content: string, variant?: string) => WithParts;
|
|
6
|
+
export declare const createSyntheticToolPart: (baseMessage: WithParts, content: string) => {
|
|
7
|
+
id: string;
|
|
8
|
+
sessionID: string;
|
|
9
|
+
messageID: string;
|
|
10
|
+
type: "tool";
|
|
11
|
+
callID: string;
|
|
12
|
+
tool: string;
|
|
13
|
+
state: {
|
|
14
|
+
status: "completed";
|
|
15
|
+
input: {};
|
|
16
|
+
output: string;
|
|
17
|
+
title: string;
|
|
18
|
+
metadata: {};
|
|
19
|
+
time: {
|
|
20
|
+
start: number;
|
|
21
|
+
end: number;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
6
25
|
/**
|
|
7
26
|
* Extracts a human-readable key from tool metadata for display purposes.
|
|
8
27
|
*/
|
|
9
28
|
export declare const extractParameterKey: (tool: string, parameters: any) => string;
|
|
10
29
|
export declare function buildToolIdList(state: SessionState, messages: WithParts[], logger: Logger): string[];
|
|
11
30
|
export declare const isIgnoredUserMessage: (message: WithParts) => boolean;
|
|
12
|
-
export declare const findMessageIndex: (messages: WithParts[], messageId: string) => number;
|
|
13
31
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../lib/messages/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../lib/messages/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAElC,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAOvD,eAAO,MAAM,gBAAgB,GAAI,YAAY,MAAM,EAAE,SAAS,MAAM,KAAG,OAStE,CAAA;AAED,eAAO,MAAM,0BAA0B,GACnC,aAAa,SAAS,EACtB,SAAS,MAAM,EACf,UAAU,MAAM,KACjB,SAwBF,CAAA;AAED,eAAO,MAAM,+BAA+B,GACxC,aAAa,SAAS,EACtB,SAAS,MAAM,EACf,UAAU,MAAM,KACjB,SAiCF,CAAA;AAED,eAAO,MAAM,uBAAuB,GAAI,aAAa,SAAS,EAAE,SAAS,MAAM;;;;;;;;;;;;;;;;;;CAoB9E,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,MAAM,EAAE,YAAY,GAAG,KAAG,MAkHnE,CAAA;AAED,wBAAgB,eAAe,CAC3B,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,SAAS,EAAE,EACrB,MAAM,EAAE,MAAM,GACf,MAAM,EAAE,CAgBV;AAED,eAAO,MAAM,oBAAoB,GAAI,SAAS,SAAS,KAAG,OAazD,CAAA"}
|
|
@@ -1,52 +1,81 @@
|
|
|
1
|
-
import { ulid } from "ulid";
|
|
2
1
|
import { isMessageCompacted } from "../shared-utils";
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
2
|
+
const SYNTHETIC_MESSAGE_ID = "msg_01234567890123456789012345";
|
|
3
|
+
const SYNTHETIC_PART_ID = "prt_01234567890123456789012345";
|
|
4
|
+
const SYNTHETIC_CALL_ID = "call_01234567890123456789012345";
|
|
5
|
+
export const isDeepSeekOrKimi = (providerID, modelID) => {
|
|
6
|
+
const lowerProviderID = providerID.toLowerCase();
|
|
6
7
|
const lowerModelID = modelID.toLowerCase();
|
|
7
|
-
return
|
|
8
|
+
return (lowerProviderID.includes("deepseek") ||
|
|
9
|
+
lowerProviderID.includes("kimi") ||
|
|
10
|
+
lowerModelID.includes("deepseek") ||
|
|
11
|
+
lowerModelID.includes("kimi"));
|
|
8
12
|
};
|
|
9
13
|
export const createSyntheticUserMessage = (baseMessage, content, variant) => {
|
|
10
14
|
const userInfo = baseMessage.info;
|
|
11
15
|
const now = Date.now();
|
|
12
|
-
const messageId = generateUniqueId("msg");
|
|
13
|
-
const partId = generateUniqueId("prt");
|
|
14
16
|
return {
|
|
15
17
|
info: {
|
|
16
|
-
id:
|
|
18
|
+
id: SYNTHETIC_MESSAGE_ID,
|
|
17
19
|
sessionID: userInfo.sessionID,
|
|
18
20
|
role: "user",
|
|
19
|
-
agent: userInfo.agent,
|
|
21
|
+
agent: userInfo.agent || "code",
|
|
20
22
|
model: userInfo.model,
|
|
21
23
|
time: { created: now },
|
|
22
24
|
...(variant !== undefined && { variant }),
|
|
23
25
|
},
|
|
24
26
|
parts: [
|
|
25
27
|
{
|
|
26
|
-
id:
|
|
28
|
+
id: SYNTHETIC_PART_ID,
|
|
27
29
|
sessionID: userInfo.sessionID,
|
|
28
|
-
messageID:
|
|
30
|
+
messageID: SYNTHETIC_MESSAGE_ID,
|
|
29
31
|
type: "text",
|
|
30
32
|
text: content,
|
|
31
33
|
},
|
|
32
34
|
],
|
|
33
35
|
};
|
|
34
36
|
};
|
|
35
|
-
export const
|
|
37
|
+
export const createSyntheticAssistantMessage = (baseMessage, content, variant) => {
|
|
38
|
+
const userInfo = baseMessage.info;
|
|
36
39
|
const now = Date.now();
|
|
37
|
-
const partId = generateUniqueId("prt");
|
|
38
|
-
const callId = generateUniqueId("call");
|
|
39
|
-
const modelID = assistantMessage.info.modelID || "";
|
|
40
|
-
// For Gemini models, add thoughtSignature bypass to avoid validation errors
|
|
41
|
-
const toolPartMetadata = isGeminiModel(modelID)
|
|
42
|
-
? { google: { thoughtSignature: "skip_thought_signature_validator" } }
|
|
43
|
-
: undefined;
|
|
44
40
|
return {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
info: {
|
|
42
|
+
id: SYNTHETIC_MESSAGE_ID,
|
|
43
|
+
sessionID: userInfo.sessionID,
|
|
44
|
+
role: "assistant",
|
|
45
|
+
agent: userInfo.agent || "code",
|
|
46
|
+
parentID: userInfo.id,
|
|
47
|
+
modelID: userInfo.model.modelID,
|
|
48
|
+
providerID: userInfo.model.providerID,
|
|
49
|
+
mode: "default",
|
|
50
|
+
path: {
|
|
51
|
+
cwd: "/",
|
|
52
|
+
root: "/",
|
|
53
|
+
},
|
|
54
|
+
time: { created: now, completed: now },
|
|
55
|
+
cost: 0,
|
|
56
|
+
tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } },
|
|
57
|
+
...(variant !== undefined && { variant }),
|
|
58
|
+
},
|
|
59
|
+
parts: [
|
|
60
|
+
{
|
|
61
|
+
id: SYNTHETIC_PART_ID,
|
|
62
|
+
sessionID: userInfo.sessionID,
|
|
63
|
+
messageID: SYNTHETIC_MESSAGE_ID,
|
|
64
|
+
type: "text",
|
|
65
|
+
text: content,
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
export const createSyntheticToolPart = (baseMessage, content) => {
|
|
71
|
+
const userInfo = baseMessage.info;
|
|
72
|
+
const now = Date.now();
|
|
73
|
+
return {
|
|
74
|
+
id: SYNTHETIC_PART_ID,
|
|
75
|
+
sessionID: userInfo.sessionID,
|
|
76
|
+
messageID: baseMessage.info.id,
|
|
48
77
|
type: "tool",
|
|
49
|
-
callID:
|
|
78
|
+
callID: SYNTHETIC_CALL_ID,
|
|
50
79
|
tool: "context_info",
|
|
51
80
|
state: {
|
|
52
81
|
status: "completed",
|
|
@@ -56,7 +85,6 @@ export const createSyntheticToolPart = (assistantMessage, content) => {
|
|
|
56
85
|
metadata: {},
|
|
57
86
|
time: { start: now, end: now },
|
|
58
87
|
},
|
|
59
|
-
...(toolPartMetadata && { metadata: toolPartMetadata }),
|
|
60
88
|
};
|
|
61
89
|
};
|
|
62
90
|
/**
|
|
@@ -197,7 +225,4 @@ export const isIgnoredUserMessage = (message) => {
|
|
|
197
225
|
}
|
|
198
226
|
return true;
|
|
199
227
|
};
|
|
200
|
-
export const findMessageIndex = (messages, messageId) => {
|
|
201
|
-
return messages.findIndex((msg) => msg.info.id === messageId);
|
|
202
|
-
};
|
|
203
228
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../lib/messages/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C,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;IAC/D,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,IAAI,CAAA;IACf,CAAC;IAED,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,IAAI,CAAE,IAAY,CAAC,OAAO,EAAE,CAAC;YACzB,OAAO,KAAK,CAAA;QAChB,CAAC;IACL,CAAC;IAED,OAAO,IAAI,CAAA;AACf,CAAC,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const DISCARD_TOOL_SPEC = "
|
|
1
|
+
export declare const DISCARD_TOOL_SPEC = "Discards tool outputs from context to manage conversation size and reduce noise.\n\n## IMPORTANT: The Prunable List\nA `<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.\n\n## When to Use This Tool\n\nUse `discard` for removing tool content that is no longer needed\n\n- **Noise:** Irrelevant, unhelpful, or superseded outputs that provide no value.\n- **Task Completion:** Work is complete and there's no valuable information worth preserving.\n\n## When NOT to Use This Tool\n\n- **If the output contains useful information:** Keep it in context rather than discarding.\n- **If you'll need the output later:** Don't discard files you plan to edit or context you'll need for implementation.\n\n## Best Practices\n- **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.\n- **Think ahead:** Before discarding, ask: \"Will I need this output for an upcoming task?\" If yes, keep it.\n\n## Format\n\n- `ids`: Array where the first element is the reason, followed by numeric IDs from the `<prunable-tools>` list\n\nReasons: `noise` | `completion`\n\n## Example\n\n<example_noise>\nAssistant: [Reads 'wrong_file.ts']\nThis file isn't relevant to the auth system. I'll remove it to clear the context.\n[Uses discard with ids: [\"noise\", \"5\"]]\n</example_noise>\n\n<example_completion>\nAssistant: [Runs tests, they pass]\nThe tests passed and I don't need to preserve any details. I'll clean up now.\n[Uses discard with ids: [\"completion\", \"20\", \"21\"]]\n</example_completion>";
|
|
2
2
|
//# sourceMappingURL=discard-tool-spec.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discard-tool-spec.d.ts","sourceRoot":"","sources":["../../../lib/prompts/discard-tool-spec.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"discard-tool-spec.d.ts","sourceRoot":"","sources":["../../../lib/prompts/discard-tool-spec.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,g1DAuCR,CAAA"}
|
|
@@ -1,18 +1,41 @@
|
|
|
1
|
-
export const DISCARD_TOOL_SPEC =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
-
|
|
11
|
-
**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
export const DISCARD_TOOL_SPEC = `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:** Keep it in context rather than discarding.
|
|
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>`;
|
|
18
41
|
//# sourceMappingURL=discard-tool-spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discard-tool-spec.js","sourceRoot":"","sources":["../../../lib/prompts/discard-tool-spec.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG
|
|
1
|
+
{"version":3,"file":"discard-tool-spec.js","sourceRoot":"","sources":["../../../lib/prompts/discard-tool-spec.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAuCX,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const EXTRACT_TOOL_SPEC = "
|
|
1
|
+
export declare const EXTRACT_TOOL_SPEC = "Extracts key findings from tool outputs into distilled knowledge, then removes the raw outputs from context.\n\n## IMPORTANT: The Prunable List\nA `<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.\n\n## When to Use This Tool\n\nUse `extract` when you have gathered useful information that you want to **preserve in distilled form** before removing the raw outputs:\n\n- **Task Completion:** You completed a unit of work and want to preserve key findings.\n- **Knowledge Preservation:** You have context that contains valuable information, but also a lot of unnecessary detail - you only need to preserve some specifics.\n\n## When NOT to Use This Tool\n\n- **If you need precise syntax:** If you'll edit a file or grep for exact strings, keep the raw output.\n- **If uncertain:** Prefer keeping over re-fetching.\n\n\n## Best Practices\n- **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.\n- **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.\n\n## Format\n\n- `ids`: Array of numeric IDs as strings from the `<prunable-tools>` list\n- `distillation`: Array of strings, one per ID (positional: distillation[0] is for ids[0], etc.)\n\nEach 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.\n\n## Example\n\n<example_extraction>\nAssistant: [Reads auth service and user types]\nI'll preserve the key details before extracting.\n[Uses extract with:\n ids: [\"10\", \"11\"],\n distillation: [\n \"auth.ts: validateToken(token: string) -> User|null checks cache first (5min TTL) then OIDC. hashPassword uses bcrypt 12 rounds. Tokens must be 128+ chars.\",\n \"user.ts: interface User { id: string; email: string; permissions: ('read'|'write'|'admin')[]; status: 'active'|'suspended' }\"\n ]\n]\n</example_extraction>\n\n<example_keep>\nAssistant: [Reads 'auth.ts' to understand the login flow]\nI'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.\n</example_keep>";
|
|
2
2
|
//# sourceMappingURL=extract-tool-spec.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-tool-spec.d.ts","sourceRoot":"","sources":["../../../lib/prompts/extract-tool-spec.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"extract-tool-spec.d.ts","sourceRoot":"","sources":["../../../lib/prompts/extract-tool-spec.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,kkFA8Cd,CAAA"}
|
|
@@ -1,23 +1,48 @@
|
|
|
1
|
-
export const EXTRACT_TOOL_SPEC =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
export const EXTRACT_TOOL_SPEC = `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>`;
|
|
23
48
|
//# sourceMappingURL=extract-tool-spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-tool-spec.js","sourceRoot":"","sources":["../../../lib/prompts/extract-tool-spec.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG
|
|
1
|
+
{"version":3,"file":"extract-tool-spec.js","sourceRoot":"","sources":["../../../lib/prompts/extract-tool-spec.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA8CjB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/prompts/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/prompts/index.ts"],"names":[],"mappings":"AAyBA,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAW9E"}
|
|
@@ -1,41 +1,23 @@
|
|
|
1
1
|
// Tool specs
|
|
2
2
|
import { DISCARD_TOOL_SPEC } from "./discard-tool-spec";
|
|
3
3
|
import { EXTRACT_TOOL_SPEC } from "./extract-tool-spec";
|
|
4
|
-
import { SQUASH_TOOL_SPEC } from "./squash-tool-spec";
|
|
5
4
|
// System prompts
|
|
5
|
+
import { SYSTEM_PROMPT_BOTH } from "./system/both";
|
|
6
6
|
import { SYSTEM_PROMPT_DISCARD } from "./system/discard";
|
|
7
7
|
import { SYSTEM_PROMPT_EXTRACT } from "./system/extract";
|
|
8
|
-
import { SYSTEM_PROMPT_SQUASH } from "./system/squash";
|
|
9
|
-
import { SYSTEM_PROMPT_DISCARD_EXTRACT } from "./system/discard-extract";
|
|
10
|
-
import { SYSTEM_PROMPT_DISCARD_SQUASH } from "./system/discard-squash";
|
|
11
|
-
import { SYSTEM_PROMPT_EXTRACT_SQUASH } from "./system/extract-squash";
|
|
12
|
-
import { SYSTEM_PROMPT_ALL } from "./system/all";
|
|
13
8
|
// Nudge prompts
|
|
9
|
+
import { NUDGE_BOTH } from "./nudge/both";
|
|
14
10
|
import { NUDGE_DISCARD } from "./nudge/discard";
|
|
15
11
|
import { NUDGE_EXTRACT } from "./nudge/extract";
|
|
16
|
-
import { NUDGE_SQUASH } from "./nudge/squash";
|
|
17
|
-
import { NUDGE_DISCARD_EXTRACT } from "./nudge/discard-extract";
|
|
18
|
-
import { NUDGE_DISCARD_SQUASH } from "./nudge/discard-squash";
|
|
19
|
-
import { NUDGE_EXTRACT_SQUASH } from "./nudge/extract-squash";
|
|
20
|
-
import { NUDGE_ALL } from "./nudge/all";
|
|
21
12
|
const PROMPTS = {
|
|
22
13
|
"discard-tool-spec": DISCARD_TOOL_SPEC,
|
|
23
14
|
"extract-tool-spec": EXTRACT_TOOL_SPEC,
|
|
24
|
-
"
|
|
15
|
+
"system/system-prompt-both": SYSTEM_PROMPT_BOTH,
|
|
25
16
|
"system/system-prompt-discard": SYSTEM_PROMPT_DISCARD,
|
|
26
17
|
"system/system-prompt-extract": SYSTEM_PROMPT_EXTRACT,
|
|
27
|
-
"
|
|
28
|
-
"system/system-prompt-discard-extract": SYSTEM_PROMPT_DISCARD_EXTRACT,
|
|
29
|
-
"system/system-prompt-discard-squash": SYSTEM_PROMPT_DISCARD_SQUASH,
|
|
30
|
-
"system/system-prompt-extract-squash": SYSTEM_PROMPT_EXTRACT_SQUASH,
|
|
31
|
-
"system/system-prompt-all": SYSTEM_PROMPT_ALL,
|
|
18
|
+
"nudge/nudge-both": NUDGE_BOTH,
|
|
32
19
|
"nudge/nudge-discard": NUDGE_DISCARD,
|
|
33
20
|
"nudge/nudge-extract": NUDGE_EXTRACT,
|
|
34
|
-
"nudge/nudge-squash": NUDGE_SQUASH,
|
|
35
|
-
"nudge/nudge-discard-extract": NUDGE_DISCARD_EXTRACT,
|
|
36
|
-
"nudge/nudge-discard-squash": NUDGE_DISCARD_SQUASH,
|
|
37
|
-
"nudge/nudge-extract-squash": NUDGE_EXTRACT_SQUASH,
|
|
38
|
-
"nudge/nudge-all": NUDGE_ALL,
|
|
39
21
|
};
|
|
40
22
|
export function loadPrompt(name, vars) {
|
|
41
23
|
let content = PROMPTS[name];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/prompts/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/prompts/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAEvD,iBAAiB;AACjB,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AAExD,gBAAgB;AAChB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C,MAAM,OAAO,GAA2B;IACpC,mBAAmB,EAAE,iBAAiB;IACtC,mBAAmB,EAAE,iBAAiB;IACtC,2BAA2B,EAAE,kBAAkB;IAC/C,8BAA8B,EAAE,qBAAqB;IACrD,8BAA8B,EAAE,qBAAqB;IACrD,kBAAkB,EAAE,UAAU;IAC9B,qBAAqB,EAAE,aAAa;IACpC,qBAAqB,EAAE,aAAa;CACvC,CAAA;AAED,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,IAA6B;IAClE,IAAI,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3B,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,EAAE,CAAC,CAAA;IAChD,CAAC;IACD,IAAI,IAAI,EAAE,CAAC;QACP,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9C,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,SAAS,GAAG,QAAQ,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,CAAA;QAC3E,CAAC;IACL,CAAC;IACD,OAAO,OAAO,CAAA;AAClB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const NUDGE_BOTH = "<instruction name=context_management_required>\n**CRITICAL CONTEXT WARNING:** Your context window is filling with tool outputs. Strict adherence to context hygiene is required.\n\n**Immediate Actions Required:**\n1. **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.\n2. **Noise Removal:** If you read files or ran commands that yielded no value, use `discard` to remove them.\n3. **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.\n\n**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.\n</instruction>";
|
|
2
|
+
//# sourceMappingURL=both.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"both.d.ts","sourceRoot":"","sources":["../../../../lib/prompts/nudge/both.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,s2BASR,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const NUDGE_BOTH = `<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>`;
|
|
11
|
+
//# sourceMappingURL=both.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"both.js","sourceRoot":"","sources":["../../../../lib/prompts/nudge/both.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG;;;;;;;;;eASX,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const NUDGE_DISCARD = "<instruction name=context_management_required>\n**CONTEXT WARNING:**
|
|
1
|
+
export declare const NUDGE_DISCARD = "<instruction name=context_management_required>\n**CRITICAL CONTEXT WARNING:** Your context window is filling with tool outputs. Strict adherence to context hygiene is required.\n\n**Immediate Actions Required:**\n1. **Task Completion:** If a sub-task is complete, use the `discard` tool to remove the tools used.\n2. **Noise Removal:** If you read files or ran commands that yielded no value, use the `discard` tool to remove them.\n\n**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.\n</instruction>";
|
|
2
2
|
//# sourceMappingURL=discard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discard.d.ts","sourceRoot":"","sources":["../../../../lib/prompts/nudge/discard.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"discard.d.ts","sourceRoot":"","sources":["../../../../lib/prompts/nudge/discard.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,0oBAQX,CAAA"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export const NUDGE_DISCARD = `<instruction name=context_management_required>
|
|
2
|
-
**CONTEXT WARNING:**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
**
|
|
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.
|
|
7
9
|
</instruction>`;
|
|
8
10
|
//# sourceMappingURL=discard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discard.js","sourceRoot":"","sources":["../../../../lib/prompts/nudge/discard.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG
|
|
1
|
+
{"version":3,"file":"discard.js","sourceRoot":"","sources":["../../../../lib/prompts/nudge/discard.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;eAQd,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const NUDGE_EXTRACT = "<instruction name=context_management_required>\n**CONTEXT WARNING:**
|
|
1
|
+
export declare const NUDGE_EXTRACT = "<instruction name=context_management_required>\n**CRITICAL CONTEXT WARNING:** Your context window is filling with tool outputs. Strict adherence to context hygiene is required.\n\n**Immediate Actions Required:**\n1. **Task Completion:** If you have completed work, extract key findings from the tools used. Scale distillation depth to the value of the content.\n2. **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.\n\n**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.\n</instruction>";
|
|
2
2
|
//# sourceMappingURL=extract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../../../lib/prompts/nudge/extract.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../../../lib/prompts/nudge/extract.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,gyBAQX,CAAA"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export const NUDGE_EXTRACT = `<instruction name=context_management_required>
|
|
2
|
-
**CONTEXT WARNING:**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
**
|
|
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.
|
|
7
9
|
</instruction>`;
|
|
8
10
|
//# sourceMappingURL=extract.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../../../../lib/prompts/nudge/extract.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG
|
|
1
|
+
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../../../../lib/prompts/nudge/extract.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;eAQd,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
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<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<compress>PHASE COMPLETION: If a phase is complete, use the `compress` tool to condense the entire sequence into a detailed summary</compress>\n</instruction>\n";
|
|
2
|
+
//# sourceMappingURL=nudge.generated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nudge.generated.d.ts","sourceRoot":"","sources":["../../../lib/prompts/nudge.generated.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,KAAK,+6BAYjB,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
<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>
|
|
14
|
+
<compress>PHASE COMPLETION: If a phase is complete, use the \`compress\` tool to condense the entire sequence into a detailed summary</compress>
|
|
15
|
+
</instruction>
|
|
16
|
+
`;
|
|
17
|
+
//# sourceMappingURL=nudge.generated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nudge.generated.js","sourceRoot":"","sources":["../../../lib/prompts/nudge.generated.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,yDAAyD;AACzD,8DAA8D;AAE9D,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;CAYpB,CAAA"}
|