@cortexkit/opencode-magic-context 0.34.2 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/agents/magic-context-prompt.d.ts +2 -1
- package/dist/agents/magic-context-prompt.d.ts.map +1 -1
- package/dist/config/index.d.ts +3 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/project-security.d.ts +3 -0
- package/dist/config/project-security.d.ts.map +1 -1
- package/dist/config/schema/magic-context.d.ts +42 -1
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/{conflict-warning-hook-fvpfvt0w.js → conflict-warning-hook-p2pmhvn7.js} +2 -1
- package/dist/features/magic-context/context-authority.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/provider-output-failure.d.ts +15 -0
- package/dist/features/magic-context/dreamer/provider-output-failure.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -1
- package/dist/features/magic-context/mural/compress-cues.d.ts +6 -2
- package/dist/features/magic-context/mural/compress-cues.d.ts.map +1 -1
- package/dist/features/magic-context/mural/storage-mural-cues.d.ts +4 -4
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts +2 -14
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts +16 -2
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-resolvers.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts +10 -3
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-state-sync.d.ts +1 -1
- package/dist/hooks/magic-context/module-state-sync.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-transport.d.ts +2 -1
- package/dist/hooks/magic-context/module-transport.d.ts.map +1 -1
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-chunk.d.ts +5 -0
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts +2 -0
- package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-mode-transform.d.ts +6 -0
- package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-prompt-hash.d.ts +19 -5
- package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +3 -0
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/index-0c9dmw9m.js +116 -0
- package/dist/{index-z70pxrq1.js → index-4anesz49.js} +726 -611
- package/dist/{index-dtas91s5.js → index-8aaadh98.js} +7 -119
- package/dist/{index-b563sga5.js → index-h8mk7vpa.js} +541 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +796 -809
- package/dist/plugin/hooks/create-session-hooks.d.ts +12 -0
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/plugin/rpc-handlers.d.ts +1 -0
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/plugin/tool-registry.d.ts +4 -0
- package/dist/plugin/tool-registry.d.ts.map +1 -1
- package/dist/{recomp-orchestrator-6cd3nrt7.js → recomp-orchestrator-zc915ceq.js} +3 -2
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/prompt-surface-runtime.d.ts +43 -0
- package/dist/shared/prompt-surface-runtime.d.ts.map +1 -0
- package/dist/shared/prompt-surface.d.ts +49 -0
- package/dist/shared/prompt-surface.d.ts.map +1 -0
- package/dist/{storage-meta-session-xt41zbw4.js → storage-meta-session-53cjs6mr.js} +1 -1
- package/dist/tools/ctx-expand/tools.d.ts +1 -0
- package/dist/tools/ctx-expand/tools.d.ts.map +1 -1
- package/dist/tools/ctx-memory/tools.d.ts +1 -0
- package/dist/tools/ctx-memory/tools.d.ts.map +1 -1
- package/dist/tools/ctx-note/tools.d.ts +1 -0
- package/dist/tools/ctx-note/tools.d.ts.map +1 -1
- package/dist/tools/ctx-reduce/tools.d.ts +1 -0
- package/dist/tools/ctx-reduce/tools.d.ts.map +1 -1
- package/dist/tools/ctx-search/tools.d.ts +1 -0
- package/dist/tools/ctx-search/tools.d.ts.map +1 -1
- package/dist/tools/light-descriptions.d.ts +6 -0
- package/dist/tools/light-descriptions.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/agents/magic-context-prompt.test.ts +144 -0
- package/src/agents/magic-context-prompt.ts +53 -2
- package/src/config/index.test.ts +53 -0
- package/src/config/index.ts +4 -0
- package/src/config/project-security.test.ts +20 -0
- package/src/config/project-security.ts +23 -0
- package/src/config/schema/magic-context.test.ts +58 -0
- package/src/config/schema/magic-context.ts +61 -1
- package/src/shared/index.ts +2 -0
- package/src/shared/prompt-surface-a1-golden.md +458 -0
- package/src/shared/prompt-surface-runtime.test.ts +141 -0
- package/src/shared/prompt-surface-runtime.ts +250 -0
- package/src/shared/prompt-surface.test.ts +109 -0
- package/src/shared/prompt-surface.ts +138 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { MagicContextPluginConfig } from "../../config";
|
|
2
2
|
import type { LiveSessionState } from "../../hooks/magic-context/live-session-state";
|
|
3
3
|
import type { RustModeModuleClient } from "../../hooks/magic-context/rust-mode-transform";
|
|
4
|
+
import type { PromptSurfaceRuntime } from "../../shared/prompt-surface-runtime";
|
|
4
5
|
import type { PluginContext } from "../types";
|
|
5
6
|
/**
|
|
6
7
|
* Map the full plugin config down to the per-session hook config. Pure and
|
|
@@ -35,6 +36,7 @@ export declare function buildMagicContextHookConfig(pluginConfig: MagicContextPl
|
|
|
35
36
|
default: string;
|
|
36
37
|
[modelKey: string]: string;
|
|
37
38
|
};
|
|
39
|
+
prompt_surface: import("../../config/schema/magic-context").PromptSurfaceConfig;
|
|
38
40
|
output_reserve?: number | {
|
|
39
41
|
default: number;
|
|
40
42
|
[modelKey: string]: number;
|
|
@@ -104,6 +106,7 @@ export declare function createSessionHooks(args: {
|
|
|
104
106
|
pluginConfig: MagicContextPluginConfig;
|
|
105
107
|
liveSessionState: LiveSessionState;
|
|
106
108
|
rustModeModuleClient?: RustModeModuleClient;
|
|
109
|
+
promptSurfaceRuntime?: PromptSurfaceRuntime;
|
|
107
110
|
}): {
|
|
108
111
|
magicContext: ({
|
|
109
112
|
"experimental.chat.messages.transform": ((_input: Record<string, never>, output: {
|
|
@@ -114,6 +117,10 @@ export declare function createSessionHooks(args: {
|
|
|
114
117
|
};
|
|
115
118
|
"experimental.chat.system.transform": (input: {
|
|
116
119
|
sessionID?: string;
|
|
120
|
+
model?: {
|
|
121
|
+
providerID?: string;
|
|
122
|
+
modelID?: string;
|
|
123
|
+
};
|
|
117
124
|
}, output: {
|
|
118
125
|
system: string[];
|
|
119
126
|
}) => Promise<void>;
|
|
@@ -151,6 +158,7 @@ export declare function createSessionHooksAsync(args: {
|
|
|
151
158
|
pluginConfig: MagicContextPluginConfig;
|
|
152
159
|
liveSessionState: LiveSessionState;
|
|
153
160
|
rustModeModuleClient?: RustModeModuleClient;
|
|
161
|
+
promptSurfaceRuntime?: PromptSurfaceRuntime;
|
|
154
162
|
}): Promise<{
|
|
155
163
|
magicContext: ({
|
|
156
164
|
"experimental.chat.messages.transform": ((_input: Record<string, never>, output: {
|
|
@@ -161,6 +169,10 @@ export declare function createSessionHooksAsync(args: {
|
|
|
161
169
|
};
|
|
162
170
|
"experimental.chat.system.transform": (input: {
|
|
163
171
|
sessionID?: string;
|
|
172
|
+
model?: {
|
|
173
|
+
providerID?: string;
|
|
174
|
+
modelID?: string;
|
|
175
|
+
};
|
|
164
176
|
}, output: {
|
|
165
177
|
system: string[];
|
|
166
178
|
}) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-session-hooks.d.ts","sourceRoot":"","sources":["../../../src/plugin/hooks/create-session-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAO7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,wBAAwB;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"create-session-hooks.d.ts","sourceRoot":"","sources":["../../../src/plugin/hooks/create-session-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAO7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,wBAAwB;;;;;;;;;mBACxD,CAAC;aAA2B,CAAC;aAQnD,CAPC;eAA8B,CAAA;;;;;;;;;;;;;;;;;;;;;eA0Fw4lB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA7E36lB;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACrC,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;IACvC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC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AAE,iBAAiB,EAChC,iBAAiB,UAAO,GACzB,YAAY,CAuNd;AA4BD;;GAEG;AACH,wBAAgB,mBAAmB,CAC/B,SAAS,EAAE,qBAAqB,EAChC,IAAI,EAAE;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC/C,GACF,IAAI,CA2PN"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ToolDefinition } from "@opencode-ai/plugin";
|
|
2
2
|
import type { MagicContextPluginConfig } from "../config";
|
|
3
|
+
import type { PromptSurfaceConfig } from "../shared/prompt-surface";
|
|
4
|
+
import type { PromptSurfaceRuntime } from "../shared/prompt-surface-runtime";
|
|
3
5
|
import type { RustToolBackends } from "./rust-tool-backends";
|
|
4
6
|
import type { PluginContext } from "./types";
|
|
5
7
|
/**
|
|
@@ -14,5 +16,7 @@ export declare function createToolRegistry(args: {
|
|
|
14
16
|
ctx: PluginContext;
|
|
15
17
|
pluginConfig: MagicContextPluginConfig;
|
|
16
18
|
rustToolBackends?: RustToolBackends;
|
|
19
|
+
promptSurfaceRuntime?: PromptSurfaceRuntime;
|
|
20
|
+
registrationPromptSurface?: PromptSurfaceConfig;
|
|
17
21
|
}): Record<string, ToolDefinition>;
|
|
18
22
|
//# sourceMappingURL=tool-registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-registry.d.ts","sourceRoot":"","sources":["../../src/plugin/tool-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-registry.d.ts","sourceRoot":"","sources":["../../src/plugin/tool-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAY1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAU7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAiB7C;;;;;;GAMG;AACH,wBAAgB,8BAA8B,IAAI,SAAS,MAAM,EAAE,CAElE;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACrC,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;IACvC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,yBAAyB,CAAC,EAAE,mBAAmB,CAAC;CACnD,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CA2IjC"}
|
|
@@ -9,12 +9,13 @@ import {
|
|
|
9
9
|
setRecompNote,
|
|
10
10
|
setRecompStarting,
|
|
11
11
|
setRecompTerminal
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-4anesz49.js";
|
|
13
13
|
import"./index-ry8rh8cv.js";
|
|
14
14
|
import"./index-td9depx5.js";
|
|
15
15
|
import"./index-cn960ffd.js";
|
|
16
|
-
import"./index-
|
|
16
|
+
import"./index-h8mk7vpa.js";
|
|
17
17
|
import"./index-fcyvznch.js";
|
|
18
|
+
import"./index-0c9dmw9m.js";
|
|
18
19
|
import"./index-d62ypazr.js";
|
|
19
20
|
import"./index-k1esqfwk.js";
|
|
20
21
|
import"./index-kvrcg31b.js";
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from "./logger";
|
|
2
2
|
export * from "./model-suggestion-retry";
|
|
3
3
|
export * from "./normalize-sdk-response";
|
|
4
|
+
export * from "./prompt-surface";
|
|
5
|
+
export * from "./prompt-surface-runtime";
|
|
4
6
|
export * from "./resolve-fallbacks";
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type ConfigHarness } from "../config/migrate-config-location";
|
|
2
|
+
import { type PromptSurfaceConfig, type PromptSurfacePreset } from "./prompt-surface";
|
|
3
|
+
export declare const PROMPT_SURFACE_TOOL_IDS: readonly ["ctx_reduce", "ctx_expand", "ctx_note", "ctx_memory", "ctx_search"];
|
|
4
|
+
export type PromptSurfaceToolId = (typeof PROMPT_SURFACE_TOOL_IDS)[number];
|
|
5
|
+
export declare const LIGHT_TOOL_DESCRIPTIONS: Readonly<Record<PromptSurfaceToolId, string>>;
|
|
6
|
+
/**
|
|
7
|
+
* Preserve the existing full-preset hash exactly while giving other presets a
|
|
8
|
+
* distinct semantic cache identity, including during any future asset fallback.
|
|
9
|
+
*/
|
|
10
|
+
export declare function promptSurfaceHashMaterial(systemContent: string, preset?: PromptSurfacePreset): string;
|
|
11
|
+
export interface PromptSurfaceGuidanceSelection {
|
|
12
|
+
/** The configured built-in preset. */
|
|
13
|
+
preset: PromptSurfacePreset;
|
|
14
|
+
/** Complete user-authored primary section captured when a model-key epoch starts. */
|
|
15
|
+
primaryOverride?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface PromptSurfaceRegistrationSelection {
|
|
18
|
+
preset: PromptSurfacePreset;
|
|
19
|
+
descriptionFor: (toolId: string, fullDescription: string) => string;
|
|
20
|
+
}
|
|
21
|
+
export interface PromptSurfaceRuntime {
|
|
22
|
+
resolveRegistration: (config: PromptSurfaceConfig | undefined) => PromptSurfaceRegistrationSelection;
|
|
23
|
+
resolveGuidance: (config: PromptSurfaceConfig | undefined, modelKey: string | undefined) => PromptSurfaceGuidanceSelection;
|
|
24
|
+
}
|
|
25
|
+
export interface CreatePromptSurfaceRuntimeOptions {
|
|
26
|
+
harness?: ConfigHarness;
|
|
27
|
+
directory?: string;
|
|
28
|
+
/** Explicit test/integration seam; production derives the USER config directory. */
|
|
29
|
+
userConfigDirectory?: string;
|
|
30
|
+
warn: (message: string) => void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Create one host-registration runtime. Its warning set is shared by tool
|
|
34
|
+
* registration and every guidance epoch, so invalid overrides are reported once
|
|
35
|
+
* instead of on every model call.
|
|
36
|
+
*/
|
|
37
|
+
export declare function createPromptSurfaceRuntime(options: CreatePromptSurfaceRuntimeOptions): PromptSurfaceRuntime;
|
|
38
|
+
/** Freeze preset selection and materialized override bytes for one model-key epoch. */
|
|
39
|
+
export declare function createPromptSurfaceGuidanceEpochCache(runtime: PromptSurfaceRuntime): {
|
|
40
|
+
resolve: (sessionId: string, config: PromptSurfaceConfig | undefined, modelKey: string | undefined) => PromptSurfaceGuidanceSelection;
|
|
41
|
+
clear: (sessionId: string) => void;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=prompt-surface-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-surface-runtime.d.ts","sourceRoot":"","sources":["../../src/shared/prompt-sur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G;AACH,wBAAgB,0BAA0B,CACtC,OAAO,EAAE,iCAAiC,GAC3C,oBAAoB,CAkGtB;AAQD,uFAAuF;AACvF,wBAAgB,qCAAqC,CAAC,OAAO,EAAE,oBAAoB,GAAG;IAClF,OAAO,EAAE,CACL,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,mBAAmB,GAAG,SAAS,EACvC,QAAQ,EAAE,MAAM,GAAG,SAAS,KAC3B,8BAA8B,CAAC;IACpC,KAAK,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC,CAkBA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/** The built-in prompt-surface variants. */
|
|
2
|
+
export type PromptSurfacePreset = "full" | "light";
|
|
3
|
+
/**
|
|
4
|
+
* The configuration consumed by prompt-surface resolution. The schema adds
|
|
5
|
+
* validation and defaults; this structural type keeps the resolver usable by
|
|
6
|
+
* every host without importing a config loader.
|
|
7
|
+
*/
|
|
8
|
+
export interface PromptSurfaceConfig {
|
|
9
|
+
default?: PromptSurfacePreset;
|
|
10
|
+
models?: Readonly<Record<string, PromptSurfacePreset>>;
|
|
11
|
+
guidance_override_path?: string;
|
|
12
|
+
tool_descriptions?: Readonly<Record<string, string>>;
|
|
13
|
+
}
|
|
14
|
+
export type PromptSurfaceResolutionSource = "exact" | "wildcard" | "default";
|
|
15
|
+
/** Validate the literal provider/model and provider/* key grammar. */
|
|
16
|
+
export declare function isValidPromptSurfaceModelKey(key: string): boolean;
|
|
17
|
+
export type ModelKeyLookupSource = PromptSurfaceResolutionSource | "bare";
|
|
18
|
+
export interface ModelKeyCandidate {
|
|
19
|
+
key: string;
|
|
20
|
+
source: ModelKeyLookupSource;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Return the same progressive model-key candidates used by cache_ttl. The
|
|
24
|
+
* provider/model boundary is the first slash; the rest of the string remains
|
|
25
|
+
* the model ID, including additional slashes. Candidates are case-sensitive.
|
|
26
|
+
*
|
|
27
|
+
* Provider wildcards are checked after progressively less-specific model keys,
|
|
28
|
+
* but before the caller's default. That keeps an exact or base-model override
|
|
29
|
+
* authoritative while still allowing `provider/*` to cover otherwise-unlisted
|
|
30
|
+
* models.
|
|
31
|
+
*/
|
|
32
|
+
export declare function modelKeyLookupOrder(modelKey: string | undefined): ModelKeyCandidate[];
|
|
33
|
+
/** Resolve one per-model value using the shared cache_ttl lookup walk. */
|
|
34
|
+
export declare function resolveModelConfigValue<T>(values: Readonly<Record<string, T>> | undefined, modelKey: string | undefined): {
|
|
35
|
+
value: T;
|
|
36
|
+
source: ModelKeyLookupSource;
|
|
37
|
+
} | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Resolve the prompt preset for a model. Invalid or missing model keys use the
|
|
40
|
+
* configured default and are reported as a default resolution rather than a
|
|
41
|
+
* partial match.
|
|
42
|
+
*/
|
|
43
|
+
export declare function resolvePromptSurface(config: PromptSurfaceConfig | undefined, modelKey: string | undefined): {
|
|
44
|
+
preset: PromptSurfacePreset;
|
|
45
|
+
source: PromptSurfaceResolutionSource;
|
|
46
|
+
};
|
|
47
|
+
/** Resolve a cache_ttl-style value with the shared model-key walk. */
|
|
48
|
+
export declare function resolveModelConfigOrDefault<T>(values: Readonly<Record<string, T>>, modelKey: string | undefined, fallback: T): T;
|
|
49
|
+
//# sourceMappingURL=prompt-surface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-surface.d.ts","sourceRoot":"","sources":["../../src/shared/prompt-surface.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,CAAC;AAEnD;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAChC,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC;IACvD,sBAAsB,CAAC,EAAE,MAAM,CA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} from "@opencode-ai/plugin";
|
|
2
2
|
import type { ContextDatabase } from "../../features/magic-context/storage";
|
|
3
|
+
export { CTX_EXPAND_LIGHT_DESCRIPTION } from "../light-descriptions";
|
|
3
4
|
export interface CtxExpandToolDeps {
|
|
4
5
|
db: ContextDatabase;
|
|
5
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-expand/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAEhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAO5E,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,eAAe,CAAC;CACvB;AA4HD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAI5F"}
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-expand/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAEhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAO5E,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,eAAe,CAAC;CACvB;AA4HD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAI5F"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ToolDefinition } from "@opencode-ai/plugin";
|
|
2
2
|
import { type CtxMemoryToolDeps } from "./types";
|
|
3
|
+
export { CTX_MEMORY_LIGHT_DESCRIPTION } from "../light-descriptions";
|
|
3
4
|
export declare function createCtxMemoryTools(deps: CtxMemoryToolDeps): Record<string, ToolDefinition>;
|
|
4
5
|
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-memory/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAkDhE,OAAO,EAKH,KAAK,iBAAiB,EACzB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-memory/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAkDhE,OAAO,EAKH,KAAK,iBAAiB,EACzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAs3BrE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAI5F"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ToolDefinition } from "@opencode-ai/plugin";
|
|
2
2
|
import type { RustToolBackends } from "../../plugin/rust-tool-backends";
|
|
3
3
|
import type { Database } from "../../shared/sqlite";
|
|
4
|
+
export { CTX_NOTE_LIGHT_DESCRIPTION } from "../light-descriptions";
|
|
4
5
|
export interface CtxNoteToolDeps {
|
|
5
6
|
db: Database;
|
|
6
7
|
dreamerEnabled?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-note/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAahE,OAAO,KAAK,EAAuB,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAK7F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAKpD,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,QAAQ,CAAC;IACb,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAC/D,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACvC;AAuaD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAIxF"}
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-note/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAahE,OAAO,KAAK,EAAuB,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAK7F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAKpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,QAAQ,CAAC;IACb,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAC/D,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACvC;AAuaD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAIxF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ToolDefinition } from "@opencode-ai/plugin";
|
|
2
2
|
import type { RustToolBackends } from "../../plugin/rust-tool-backends";
|
|
3
3
|
import type { Database } from "../../shared/sqlite";
|
|
4
|
+
export { CTX_REDUCE_LIGHT_DESCRIPTION } from "../light-descriptions";
|
|
4
5
|
export interface CtxReduceToolDeps {
|
|
5
6
|
db: Database;
|
|
6
7
|
protectedTags: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-reduce/tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAShE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAKpD,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,QAAQ,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IACjD,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACvC;AAkMD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAI5F"}
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-reduce/tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAShE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAKpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,QAAQ,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IACjD,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACvC;AAkMD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAI5F"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ToolDefinition } from "@opencode-ai/plugin";
|
|
2
2
|
import type { CtxSearchToolDeps } from "./types";
|
|
3
|
+
export { CTX_SEARCH_LIGHT_DESCRIPTION } from "../light-descriptions";
|
|
3
4
|
export declare function createCtxSearchTools(deps: CtxSearchToolDeps): Record<string, ToolDefinition>;
|
|
4
5
|
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-search/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAmBhE,OAAO,KAAK,EAAkC,iBAAiB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-search/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAmBhE,OAAO,KAAK,EAAkC,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjF,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAqRrE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAI5F"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const CTX_REDUCE_LIGHT_DESCRIPTION = "For ctx_reduce users, mark spent \u00A7N\u00A7 outputs discardable; release is QUEUED, not immediate, so content stays visible until space is needed. Newest tags stay protected until they age out. Released content becomes a placeholder; recover it only by rerunning the source or recovery tool, so mark only genuinely finished material. Mark analyzed, redundant, persisted, or merely confirmatory outputs; keep user messages, unresolved errors, unextracted evidence, and exact wording. NEVER blanket-mark a large range: review every tag first.";
|
|
2
|
+
export declare const CTX_EXPAND_LIGHT_DESCRIPTION = "For ctx_expand users, recover compacted conversation by passing a session-history heading's inclusive start/end ordinals. Results are raw [N] U:/A: transcript capped near 15K tokens; oversized ranges return the head and a continuation. Use verbose=true to list each message ordinal, part previews, and tool-output sizes; use message=N for one complete stored message and its tool exchanges. NEVER expand ranges after the last compartment because that live tail is already visible.";
|
|
3
|
+
export declare const CTX_NOTE_LIGHT_DESCRIPTION = "For ctx_note users, write saves, read lists, update changes, and dismiss retires future session notes; surface_condition creates a smart note. For smart notes, NEVER use a condition tied to this conversation or an unobservable future action because the background checker can inspect only external GitHub, disk, git, or web signals.";
|
|
4
|
+
export declare const CTX_MEMORY_LIGHT_DESCRIPTION = "For ctx_memory users, write one standalone durable fact with category and content; update one ID, archive one or more IDs, merge two or more IDs, or get one to twenty numeric IDs. get reads memories in every status; list remains dreamer-only, so primary agents must NEVER assume bulk-list access.";
|
|
5
|
+
export declare const CTX_SEARCH_LIGHT_DESCRIPTION = "For ctx_search users, retrieve only hidden recall: memories not already in <project-memory>, compacted messages outside the live tail, commits, and notes. Omit sources for broad search; select memory, message, git_commit, or note to target a source, or pass memory IDs to bypass text search. Message hits continue through ctx_expand.";
|
|
6
|
+
//# sourceMappingURL=light-descriptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"light-descriptions.d.ts","sourceRoot":"","sources":["../../src/tools/light-descriptions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,oiBAA0hB,CAAC;AAEpkB,eAAO,MAAM,4BAA4B,qeAAqe,CAAC;AAE/gB,eAAO,MAAM,0BAA0B,iVAAiV,CAAC;AAEzX,eAAO,MAAM,4BAA4B,6SAA6S,CAAC;AAEvV,eAAO,MAAM,4BAA4B,kVAAkV,CAAC"}
|
package/package.json
CHANGED
|
@@ -290,3 +290,147 @@ describe("buildMagicContextSection — compaction-off guidance variant (#266 S4)
|
|
|
290
290
|
expect(reduce).toContain("tagged with §N§ identifiers");
|
|
291
291
|
});
|
|
292
292
|
});
|
|
293
|
+
|
|
294
|
+
describe("buildMagicContextSection — prompt-surface composition", () => {
|
|
295
|
+
it("keeps full bytes stable while serving compressed light guidance", () => {
|
|
296
|
+
const implicit = buildMagicContextSection(
|
|
297
|
+
null,
|
|
298
|
+
20,
|
|
299
|
+
true,
|
|
300
|
+
true,
|
|
301
|
+
true,
|
|
302
|
+
true,
|
|
303
|
+
false,
|
|
304
|
+
"tr",
|
|
305
|
+
true,
|
|
306
|
+
);
|
|
307
|
+
const explicitFull = buildMagicContextSection(
|
|
308
|
+
null,
|
|
309
|
+
20,
|
|
310
|
+
true,
|
|
311
|
+
true,
|
|
312
|
+
true,
|
|
313
|
+
true,
|
|
314
|
+
false,
|
|
315
|
+
"tr",
|
|
316
|
+
true,
|
|
317
|
+
"full",
|
|
318
|
+
);
|
|
319
|
+
const light = buildMagicContextSection(
|
|
320
|
+
null,
|
|
321
|
+
20,
|
|
322
|
+
true,
|
|
323
|
+
true,
|
|
324
|
+
true,
|
|
325
|
+
true,
|
|
326
|
+
false,
|
|
327
|
+
"tr",
|
|
328
|
+
true,
|
|
329
|
+
"light",
|
|
330
|
+
);
|
|
331
|
+
|
|
332
|
+
expect(explicitFull).toBe(implicit);
|
|
333
|
+
expect(light).not.toBe(implicit);
|
|
334
|
+
expect(light).toContain("In primary sessions with ctx_reduce");
|
|
335
|
+
expect(light).toContain("NEVER narrate ctx_reduce");
|
|
336
|
+
expect(light).toContain("DO NOT mimic this style");
|
|
337
|
+
expect(light).toContain("Keep code, identifiers, file paths");
|
|
338
|
+
expect(light).not.toContain("### Reduction Triggers");
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
it("keeps feature-gated and shared fragments orthogonal to light", () => {
|
|
342
|
+
const light = (options: {
|
|
343
|
+
reduce?: boolean;
|
|
344
|
+
dreamer?: boolean;
|
|
345
|
+
temporal?: boolean;
|
|
346
|
+
caveman?: boolean;
|
|
347
|
+
subagent?: boolean;
|
|
348
|
+
language?: string;
|
|
349
|
+
memory?: boolean;
|
|
350
|
+
}) =>
|
|
351
|
+
buildMagicContextSection(
|
|
352
|
+
null,
|
|
353
|
+
20,
|
|
354
|
+
options.reduce ?? true,
|
|
355
|
+
options.dreamer ?? false,
|
|
356
|
+
options.temporal ?? false,
|
|
357
|
+
options.caveman ?? false,
|
|
358
|
+
options.subagent ?? false,
|
|
359
|
+
options.language,
|
|
360
|
+
options.memory ?? true,
|
|
361
|
+
"light",
|
|
362
|
+
);
|
|
363
|
+
|
|
364
|
+
const memoryOff = light({ memory: false });
|
|
365
|
+
expect(memoryOff).not.toContain("Use `ctx_memory`");
|
|
366
|
+
expect(memoryOff).toContain("ctx_search");
|
|
367
|
+
|
|
368
|
+
const noReduce = light({ reduce: false });
|
|
369
|
+
expect(noReduce).not.toContain("In primary sessions with ctx_reduce");
|
|
370
|
+
expect(noReduce).not.toContain("drop grammar");
|
|
371
|
+
|
|
372
|
+
const gatedOff = light({ dreamer: false, temporal: false, caveman: false });
|
|
373
|
+
expect(gatedOff).not.toContain("surface_condition creates");
|
|
374
|
+
expect(gatedOff).not.toContain("**Temporal awareness**");
|
|
375
|
+
expect(gatedOff).not.toContain("**BEWARE**");
|
|
376
|
+
|
|
377
|
+
const gatedOn = light({ dreamer: true, temporal: true, caveman: true, language: "tr" });
|
|
378
|
+
expect(gatedOn).toContain("surface_condition creates");
|
|
379
|
+
expect(gatedOn).toContain("**Temporal awareness**");
|
|
380
|
+
expect(gatedOn).toContain("**BEWARE**");
|
|
381
|
+
expect(gatedOn).toContain("Keep code, identifiers, file paths");
|
|
382
|
+
|
|
383
|
+
const subagent = light({ subagent: true });
|
|
384
|
+
expect(subagent).toContain("In bounded subagent sessions");
|
|
385
|
+
expect(subagent).toContain("[dropped §N§]");
|
|
386
|
+
expect(subagent).not.toContain("long-term partner");
|
|
387
|
+
expect(subagent).not.toContain("ctx_search");
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
it("appends shared runtime fragments after a complete primary override", () => {
|
|
391
|
+
const override = "## Magic Context\n\nUser-owned primary guidance.";
|
|
392
|
+
const output = buildMagicContextSection(
|
|
393
|
+
null,
|
|
394
|
+
20,
|
|
395
|
+
true,
|
|
396
|
+
true,
|
|
397
|
+
true,
|
|
398
|
+
true,
|
|
399
|
+
false,
|
|
400
|
+
"tr",
|
|
401
|
+
true,
|
|
402
|
+
"full",
|
|
403
|
+
override,
|
|
404
|
+
);
|
|
405
|
+
|
|
406
|
+
expect(output.startsWith(override)).toBe(true);
|
|
407
|
+
expect(output.match(/^## Magic Context$/gm)).toHaveLength(1);
|
|
408
|
+
expect(output).toContain("**Temporal awareness**");
|
|
409
|
+
expect(output).toContain("**BEWARE**: History compression is on");
|
|
410
|
+
expect(output).toContain("Use Turkish (Türkçe) for your natural-language replies");
|
|
411
|
+
expect(output.indexOf("**Temporal awareness**")).toBeGreaterThan(
|
|
412
|
+
output.indexOf("User-owned primary guidance."),
|
|
413
|
+
);
|
|
414
|
+
expect(output).not.toContain("### Reduction Triggers");
|
|
415
|
+
expect(output).not.toContain("surface_condition");
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
it("keeps subagent guidance independent from a primary override", () => {
|
|
419
|
+
const output = buildMagicContextSection(
|
|
420
|
+
null,
|
|
421
|
+
20,
|
|
422
|
+
true,
|
|
423
|
+
false,
|
|
424
|
+
false,
|
|
425
|
+
false,
|
|
426
|
+
true,
|
|
427
|
+
undefined,
|
|
428
|
+
true,
|
|
429
|
+
"full",
|
|
430
|
+
"## Magic Context\n\nPrimary override must not reach subagents.",
|
|
431
|
+
);
|
|
432
|
+
|
|
433
|
+
expect(output).toContain("§N§ identifiers");
|
|
434
|
+
expect(output).not.toContain("Primary override must not reach subagents");
|
|
435
|
+
});
|
|
436
|
+
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Generic magic context system prompt section shared by all agents. */
|
|
2
2
|
|
|
3
|
+
import type { PromptSurfacePreset } from "../shared/prompt-surface";
|
|
3
4
|
import { buildPrimaryLanguageDirective } from "./language-directive";
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -30,6 +31,10 @@ const PARTNER_FRAME_CLOSER_REDUCE = `\nReduction prompts are routine housekeepin
|
|
|
30
31
|
/** Closer for sessions where ctx_reduce is unavailable — context is managed fully automatically. */
|
|
31
32
|
const PARTNER_FRAME_CLOSER_NO_REDUCE = `\nContext is managed for you entirely automatically — there's nothing to prune and no warnings to act on. Stay reasonably concise per operation, and never let context size change *what* work you take on or *how thoroughly* you do it.`;
|
|
32
33
|
|
|
34
|
+
const PARTNER_FRAME_CLOSER_REDUCE_LIGHT = `\nWhen ctx_reduce is available, use it only as routine housekeeping; never cut task scope or depth because context is large.`;
|
|
35
|
+
|
|
36
|
+
const PARTNER_FRAME_CLOSER_NO_REDUCE_LIGHT = `\nWhen ctx_reduce is unavailable, context is automatic; never prune, heed reduction warnings, or cut task scope or depth because context is large.`;
|
|
37
|
+
|
|
33
38
|
/**
|
|
34
39
|
* Shared `ctx_note` guidance for both intro variants. Generalizes two observed
|
|
35
40
|
* misuse patterns: (1) taking a note for work that's only a few turns away — that
|
|
@@ -107,6 +112,23 @@ Use \`ctx_expand\` to recover the raw conversation behind a summary under a \`##
|
|
|
107
112
|
\`ctx_search\` returns ranked results from memories, git commits, and raw message history. Use message ordinals from results with \`ctx_expand\` to retrieve surrounding conversation context.
|
|
108
113
|
${TOOL_HISTORY_GUIDANCE}`;
|
|
109
114
|
|
|
115
|
+
const LIGHT_SEARCH_RECOVERY = `Use ctx_search before asking the user about prior project context; it searches memories, commits, and compacted conversation. When a session-history summary lacks exact wording, values, errors, or reasoning, call ctx_expand with its heading range instead of guessing.`;
|
|
116
|
+
|
|
117
|
+
const BASE_INTRO_LIGHT = (
|
|
118
|
+
protectedTags: number,
|
|
119
|
+
memoryEnabled: boolean,
|
|
120
|
+
): string => `In primary sessions with ctx_reduce, the system tags messages and tool outputs as §N§ (for example §1§ and §42§); never imitate these prefixes in replies because only injected tag numbers are valid ctx_reduce handles.
|
|
121
|
+
In primary sessions, NEVER narrate ctx_reduce; call it silently after extracting a spent output because it marks content discardable and QUEUES release rather than deleting immediately. The last ${protectedTags} tags stay protected until they age out. Use drop grammar "3-5", "1,2,9", or "1-5,8,12-15".
|
|
122
|
+
${CTX_NOTE_GUIDANCE}
|
|
123
|
+
${memoryGuidanceBlock(memoryEnabled)}${LIGHT_SEARCH_RECOVERY}
|
|
124
|
+
${TOOL_HISTORY_GUIDANCE}
|
|
125
|
+
For primary ctx_reduce choices, NEVER blanket-drop a large range because mixed-value evidence may be lost: inspect every tag first. Drop only analyzed reads, searches, diagnostics, or build/test outputs after use. NEVER drop user directives or assistant prose unless exceptionally large; keep requirements, constraints, unresolved errors or decisions, exact wording, raw evidence, and active files or work. Only extracted pasted user payloads may go.
|
|
126
|
+
Consider small targeted drops after acted-on reads or searches, completed logical steps, before context switches, and before the turn ends; this keeps the working set tidy without changing task scope.`;
|
|
127
|
+
|
|
128
|
+
const BASE_INTRO_NO_REDUCE_LIGHT = (memoryEnabled: boolean): string => `${CTX_NOTE_GUIDANCE}
|
|
129
|
+
${memoryGuidanceBlock(memoryEnabled)}${LIGHT_SEARCH_RECOVERY}
|
|
130
|
+
${TOOL_HISTORY_GUIDANCE}`;
|
|
131
|
+
|
|
110
132
|
const GENERIC_SECTION = `
|
|
111
133
|
### Reduction Triggers
|
|
112
134
|
- After reading files or search results you already acted on — drop raw outputs.
|
|
@@ -124,6 +146,8 @@ const GENERIC_SECTION = `
|
|
|
124
146
|
- Recent errors and unresolved decisions.
|
|
125
147
|
- Active work context and files being edited.`;
|
|
126
148
|
|
|
149
|
+
const SMART_NOTE_GUIDANCE_LIGHT = `\nsurface_condition creates a smart note checked nightly against external signals on ctx_note write.`;
|
|
150
|
+
|
|
127
151
|
const TEMPORAL_AWARENESS_GUIDANCE = `\n**Temporal awareness**: User messages may be preceded by HTML comments like \`<!-- +12m -->\`, \`<!-- +2h 15m -->\`, or \`<!-- +3d 4h -->\` indicating time elapsed since the previous message's completion. Compartments in \`<session-history>\` carry \`start-date\` and \`end-date\` attributes (YYYY-MM-DD) showing real-time boundaries. Use these when reasoning about workflow pacing, log durations, build times, or how long ago something happened.`;
|
|
128
152
|
|
|
129
153
|
/**
|
|
@@ -142,6 +166,12 @@ Use \`ctx_reduce\` to drop tool outputs you have already finished with, keeping
|
|
|
142
166
|
Drop silently — do not narrate it. NEVER drop large ranges blindly (e.g., "1-50"); review each tag first. Do not drop user or assistant text messages — only large tool outputs are worth dropping.
|
|
143
167
|
Older tool calls may show \`[dropped §N§]\` sentinels; that is normal context management, not a pattern to copy. ALWAYS make fresh real tool calls when you need data again; never fabricate or inline tool output.`;
|
|
144
168
|
|
|
169
|
+
const SUBAGENT_REDUCE_INTRO_LIGHT = (
|
|
170
|
+
protectedTags: number,
|
|
171
|
+
): string => `In bounded subagent sessions, the system tags messages and tool outputs as §N§; use only those IDs in ctx_reduce drop ranges such as "3-5", "1,2,9", or "1-5,8,12-15". The last ${protectedTags} tags stay protected.
|
|
172
|
+
When dropping, do it silently and NEVER choose a large range before reviewing every tag; drop only finished large tool outputs, never user or assistant messages.
|
|
173
|
+
If older calls show [dropped §N§], never copy that system sentinel because it is not reply syntax; make a fresh real tool call and never fabricate or inline output.`;
|
|
174
|
+
|
|
145
175
|
const CAVEMAN_COMPRESSION_WARNING = `\n**BEWARE**: History compression is on; older user AND assistant text — including your own earlier responses — has been deterministically rewritten in a terse caveman style (dropped articles, missing auxiliaries, \`//\` instead of connectives like \`because\`). This is automatic context compression that runs after the fact, not your actual prior wording or the user's. **DO NOT mimic this style in new turns.** Write fresh responses in normal prose. If you notice your output drifting into caveman cadence, that drift is in-context-learning bleeding from the compressed history — consciously revert to full sentences.`;
|
|
146
176
|
|
|
147
177
|
export function buildMagicContextSection(
|
|
@@ -154,6 +184,8 @@ export function buildMagicContextSection(
|
|
|
154
184
|
subagentMode = false,
|
|
155
185
|
language?: string,
|
|
156
186
|
memoryEnabled = true,
|
|
187
|
+
preset: PromptSurfacePreset = "full",
|
|
188
|
+
primaryOverride?: string,
|
|
157
189
|
): string {
|
|
158
190
|
// Subagent sessions: minimal §N§ + ctx_reduce mechanics only. Bypasses the
|
|
159
191
|
// long-term-partner frame, memory/search/note guidance, and the reduction
|
|
@@ -162,10 +194,16 @@ export function buildMagicContextSection(
|
|
|
162
194
|
// when ctx_reduce is off the subagent gets no §N§ prefix, so describing the
|
|
163
195
|
// tag system would be noise.
|
|
164
196
|
if (subagentMode) {
|
|
165
|
-
|
|
197
|
+
const intro =
|
|
198
|
+
preset === "light"
|
|
199
|
+
? SUBAGENT_REDUCE_INTRO_LIGHT(protectedTags)
|
|
200
|
+
: SUBAGENT_REDUCE_INTRO(protectedTags);
|
|
201
|
+
return `## Magic Context\n\n${intro}`;
|
|
166
202
|
}
|
|
167
203
|
const smartNoteGuidance = dreamerEnabled
|
|
168
|
-
?
|
|
204
|
+
? preset === "light"
|
|
205
|
+
? SMART_NOTE_GUIDANCE_LIGHT
|
|
206
|
+
: `\nWhen \`surface_condition\` is provided with \`write\`, the note becomes a project-scoped smart note.\nThe dreamer evaluates smart note conditions during nightly runs and surfaces them when conditions are met.\nExample: \`ctx_note(action="write", content="Implement X because Y", surface_condition="When PR #42 is merged in this repo")\``
|
|
169
207
|
: "";
|
|
170
208
|
const temporalGuidance = temporalAwarenessEnabled ? TEMPORAL_AWARENESS_GUIDANCE : "";
|
|
171
209
|
// Caveman compression is independent of ctx_reduce availability. Emit the
|
|
@@ -175,8 +213,21 @@ export function buildMagicContextSection(
|
|
|
175
213
|
const languageDirective = buildPrimaryLanguageDirective(language);
|
|
176
214
|
const languageGuidance = languageDirective ? `\n\n${languageDirective}` : "";
|
|
177
215
|
|
|
216
|
+
if (primaryOverride !== undefined) {
|
|
217
|
+
// A user override owns the complete primary section. Runtime clauses stay
|
|
218
|
+
// composer-owned so an override cannot suppress temporal guidance, the
|
|
219
|
+
// warning against overly compressed prose, or the language directive.
|
|
220
|
+
return `${primaryOverride}${temporalGuidance}${cavemanWarning}${languageGuidance}`;
|
|
221
|
+
}
|
|
222
|
+
|
|
178
223
|
if (!ctxReduceCallable) {
|
|
224
|
+
if (preset === "light") {
|
|
225
|
+
return `## Magic Context\n\n${LONG_TERM_PARTNER_FRAME}\n${PARTNER_FRAME_CLOSER_NO_REDUCE_LIGHT}\n\n${BASE_INTRO_NO_REDUCE_LIGHT(memoryEnabled)}${smartNoteGuidance}${temporalGuidance}${cavemanWarning}${languageGuidance}`;
|
|
226
|
+
}
|
|
179
227
|
return `## Magic Context\n\n${LONG_TERM_PARTNER_FRAME}\n${PARTNER_FRAME_CLOSER_NO_REDUCE}\n\n${BASE_INTRO_NO_REDUCE(memoryEnabled)}${smartNoteGuidance}${temporalGuidance}${cavemanWarning}${languageGuidance}`;
|
|
180
228
|
}
|
|
229
|
+
if (preset === "light") {
|
|
230
|
+
return `## Magic Context\n\n${LONG_TERM_PARTNER_FRAME}\n${PARTNER_FRAME_CLOSER_REDUCE_LIGHT}\n\n${BASE_INTRO_LIGHT(protectedTags, memoryEnabled)}${smartNoteGuidance}${temporalGuidance}${cavemanWarning}${languageGuidance}`;
|
|
231
|
+
}
|
|
181
232
|
return `## Magic Context\n\n${LONG_TERM_PARTNER_FRAME}\n${PARTNER_FRAME_CLOSER_REDUCE}\n\n${BASE_INTRO(protectedTags, memoryEnabled)}${smartNoteGuidance}${temporalGuidance}${cavemanWarning}\n${GENERIC_SECTION}\n\nPrefer many small targeted operations over one large blanket operation, and keep the working set tidy as routine maintenance.${languageGuidance}`;
|
|
182
233
|
}
|