@cortexkit/opencode-magic-context 0.34.2 → 0.35.1

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.
Files changed (109) hide show
  1. package/README.md +3 -1
  2. package/dist/agents/hidden-agent-registrations.d.ts +10 -2
  3. package/dist/agents/hidden-agent-registrations.d.ts.map +1 -1
  4. package/dist/agents/magic-context-prompt.d.ts +2 -1
  5. package/dist/agents/magic-context-prompt.d.ts.map +1 -1
  6. package/dist/agents/permissions.d.ts +4 -3
  7. package/dist/agents/permissions.d.ts.map +1 -1
  8. package/dist/config/index.d.ts +3 -0
  9. package/dist/config/index.d.ts.map +1 -1
  10. package/dist/config/project-security.d.ts +3 -0
  11. package/dist/config/project-security.d.ts.map +1 -1
  12. package/dist/config/schema/agent-overrides.d.ts +1 -1
  13. package/dist/config/schema/magic-context.d.ts +51 -10
  14. package/dist/config/schema/magic-context.d.ts.map +1 -1
  15. package/dist/{conflict-warning-hook-fvpfvt0w.js → conflict-warning-hook-p2pmhvn7.js} +2 -1
  16. package/dist/features/magic-context/context-authority.d.ts.map +1 -1
  17. package/dist/features/magic-context/dreamer/provider-output-failure.d.ts +15 -0
  18. package/dist/features/magic-context/dreamer/provider-output-failure.d.ts.map +1 -0
  19. package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
  20. package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -1
  21. package/dist/features/magic-context/mural/compress-cues.d.ts +6 -2
  22. package/dist/features/magic-context/mural/compress-cues.d.ts.map +1 -1
  23. package/dist/features/magic-context/mural/storage-mural-cues.d.ts +4 -4
  24. package/dist/hooks/magic-context/compartment-prompt.d.ts +6 -6
  25. package/dist/hooks/magic-context/compartment-prompt.d.ts.map +1 -1
  26. package/dist/hooks/magic-context/compartment-runner-historian.d.ts +2 -14
  27. package/dist/hooks/magic-context/compartment-runner-historian.d.ts.map +1 -1
  28. package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
  29. package/dist/hooks/magic-context/compartment-runner-validation.d.ts +16 -2
  30. package/dist/hooks/magic-context/compartment-runner-validation.d.ts.map +1 -1
  31. package/dist/hooks/magic-context/event-resolvers.d.ts.map +1 -1
  32. package/dist/hooks/magic-context/hook.d.ts +10 -3
  33. package/dist/hooks/magic-context/hook.d.ts.map +1 -1
  34. package/dist/hooks/magic-context/module-state-sync.d.ts +1 -1
  35. package/dist/hooks/magic-context/module-state-sync.d.ts.map +1 -1
  36. package/dist/hooks/magic-context/module-transport.d.ts +2 -1
  37. package/dist/hooks/magic-context/module-transport.d.ts.map +1 -1
  38. package/dist/hooks/magic-context/protected-tail-boundary.d.ts.map +1 -1
  39. package/dist/hooks/magic-context/read-session-chunk.d.ts +5 -0
  40. package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
  41. package/dist/hooks/magic-context/read-session-formatting.d.ts.map +1 -1
  42. package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts +2 -0
  43. package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts.map +1 -1
  44. package/dist/hooks/magic-context/rust-mode-transform.d.ts +6 -0
  45. package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
  46. package/dist/hooks/magic-context/system-prompt-hash.d.ts +19 -5
  47. package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
  48. package/dist/hooks/magic-context/transform.d.ts +3 -0
  49. package/dist/hooks/magic-context/transform.d.ts.map +1 -1
  50. package/dist/index-0c9dmw9m.js +116 -0
  51. package/dist/{index-dtas91s5.js → index-8aaadh98.js} +7 -119
  52. package/dist/index-dpdnjawy.js +2892 -0
  53. package/dist/{index-z70pxrq1.js → index-fkyamz2w.js} +732 -613
  54. package/dist/{index-cn960ffd.js → index-h5zjfesc.js} +1 -1
  55. package/dist/{index-fcyvznch.js → index-w0nygb4p.js} +45 -2
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +843 -818
  58. package/dist/plugin/hooks/create-session-hooks.d.ts +12 -0
  59. package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
  60. package/dist/plugin/rpc-handlers.d.ts +1 -0
  61. package/dist/plugin/rpc-handlers.d.ts.map +1 -1
  62. package/dist/plugin/tool-registry.d.ts +4 -0
  63. package/dist/plugin/tool-registry.d.ts.map +1 -1
  64. package/dist/{recomp-orchestrator-6cd3nrt7.js → recomp-orchestrator-29f4rqax.js} +5 -4
  65. package/dist/{send-session-notification-6njqewzk.js → send-session-notification-sr5g06hz.js} +2 -2
  66. package/dist/shared/index.d.ts +2 -0
  67. package/dist/shared/index.d.ts.map +1 -1
  68. package/dist/shared/prompt-surface-a1-golden.d.ts +28 -0
  69. package/dist/shared/prompt-surface-a1-golden.d.ts.map +1 -0
  70. package/dist/shared/prompt-surface-runtime.d.ts +43 -0
  71. package/dist/shared/prompt-surface-runtime.d.ts.map +1 -0
  72. package/dist/shared/prompt-surface.d.ts +49 -0
  73. package/dist/shared/prompt-surface.d.ts.map +1 -0
  74. package/dist/shared/sqlite.d.ts +13 -0
  75. package/dist/shared/sqlite.d.ts.map +1 -1
  76. package/dist/{storage-meta-session-xt41zbw4.js → storage-meta-session-ev8b55a9.js} +2 -2
  77. package/dist/tools/ctx-expand/tools.d.ts +1 -0
  78. package/dist/tools/ctx-expand/tools.d.ts.map +1 -1
  79. package/dist/tools/ctx-memory/tools.d.ts +1 -0
  80. package/dist/tools/ctx-memory/tools.d.ts.map +1 -1
  81. package/dist/tools/ctx-note/tools.d.ts +1 -0
  82. package/dist/tools/ctx-note/tools.d.ts.map +1 -1
  83. package/dist/tools/ctx-reduce/tools.d.ts +1 -0
  84. package/dist/tools/ctx-reduce/tools.d.ts.map +1 -1
  85. package/dist/tools/ctx-search/tools.d.ts +1 -0
  86. package/dist/tools/ctx-search/tools.d.ts.map +1 -1
  87. package/dist/tools/light-descriptions.d.ts +6 -0
  88. package/dist/tools/light-descriptions.d.ts.map +1 -0
  89. package/package.json +1 -1
  90. package/src/agents/hidden-agent-registrations.ts +49 -1
  91. package/src/agents/magic-context-prompt.test.ts +144 -0
  92. package/src/agents/magic-context-prompt.ts +53 -2
  93. package/src/agents/permissions.ts +4 -3
  94. package/src/config/index.test.ts +53 -0
  95. package/src/config/index.ts +4 -0
  96. package/src/config/project-security.test.ts +20 -0
  97. package/src/config/project-security.ts +23 -0
  98. package/src/config/schema/magic-context.test.ts +58 -0
  99. package/src/config/schema/magic-context.ts +61 -1
  100. package/src/shared/index.ts +2 -0
  101. package/src/shared/prompt-surface-a1-golden.md +458 -0
  102. package/src/shared/prompt-surface-a1-golden.ts +41 -0
  103. package/src/shared/prompt-surface-runtime.test.ts +141 -0
  104. package/src/shared/prompt-surface-runtime.ts +250 -0
  105. package/src/shared/prompt-surface.test.ts +109 -0
  106. package/src/shared/prompt-surface.ts +138 -0
  107. package/src/shared/sqlite.test.ts +32 -0
  108. package/src/shared/sqlite.ts +85 -9
  109. package/dist/index-b563sga5.js +0 -134784
@@ -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;;;;;;;;;mBAC5C,CAAC;aAA2B,CAAC;aACnD,CAAC;eAA6B,CAAC;;;;;;;;;;;;;;;;;;;;eAsFq9gB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAzEpghB;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;;;;;;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;IAC5C,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC/C;;;;;;;;;qBAqEmpJ,CAAC;iBAA2B,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;;;;;;;;qBAApoE,CAAC;mBAAyB,CAAC;iBAAuB,CAAC;iBAAuB,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;0BAAujzD,CAAC;;;;;;;;;EAvCjv4D;AAED,wBAAsB,uBAAuB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;IACvC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC/C;;;;;;;;;qBA+BmpJ,CAAC;iBAA2B,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;;;;;;;;qBAApoE,CAAC;mBAAyB,CAAC;iBAAuB,CAAC;iBAAuB,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;0BAAujzD,CAAC;;;;;;;;;GADjv4D"}
@@ -14,6 +14,7 @@ export interface RustSessionStatus {
14
14
  compartment_count?: number;
15
15
  compartment_tokens?: number;
16
16
  pending_drop_count?: number;
17
+ tag_count?: number;
17
18
  pending_m1_delta?: boolean;
18
19
  pending_m1_age_ms?: number | null;
19
20
  wrapup_active?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"rpc-handlers.d.ts","sourceRoot":"","sources":["../../src/plugin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EAC9B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,YAAY,CAAC,EAAE,iBAAiB,EAChC,iBAAiB,UAAO,GACzB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAezB;AAED,wBAAgB,iBAAiB,CAC7B,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,qBAAqB,CAAC,EAAE,MAAM,EAC9B,YAAY,CAAC,EAAE,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;AAoB1D,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;CACvC,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAoHjC"}
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-z70pxrq1.js";
12
+ } from "./index-fkyamz2w.js";
13
13
  import"./index-ry8rh8cv.js";
14
14
  import"./index-td9depx5.js";
15
- import"./index-cn960ffd.js";
16
- import"./index-b563sga5.js";
17
- import"./index-fcyvznch.js";
15
+ import"./index-h5zjfesc.js";
16
+ import"./index-dpdnjawy.js";
17
+ import"./index-w0nygb4p.js";
18
+ import"./index-0c9dmw9m.js";
18
19
  import"./index-d62ypazr.js";
19
20
  import"./index-k1esqfwk.js";
20
21
  import"./index-kvrcg31b.js";
@@ -5,8 +5,8 @@ import {
5
5
  flushIgnoredMessages,
6
6
  sendIgnoredMessage,
7
7
  sendUserPrompt
8
- } from "./index-cn960ffd.js";
9
- import"./index-fcyvznch.js";
8
+ } from "./index-h5zjfesc.js";
9
+ import"./index-w0nygb4p.js";
10
10
  import"./index-k1esqfwk.js";
11
11
  import"./index-kvrcg31b.js";
12
12
  import"./index-wckvcay0.js";
@@ -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,28 @@
1
+ /**
2
+ * Shared accessors for the A1 prompt-surface golden.
3
+ *
4
+ * The golden (`prompt-surface-a1-golden.md`, generated by
5
+ * `scripts/export-agent-surface.ts`) is read by tests in BOTH packages, and its
6
+ * section headings are the contract between the generator and those readers.
7
+ * Keeping the path, the heading strings, and the offset guard here means a
8
+ * change to the golden's section format is a one-file edit rather than a hunt
9
+ * across packages.
10
+ *
11
+ * This module resolves the golden relative to ITSELF, so consumers never carry
12
+ * their own `../..` path arithmetic — that arithmetic differs per package and is
13
+ * exactly the kind of thing that rots silently when files move.
14
+ */
15
+ export declare const A1_TOOL_SECTION_HEADING = "## 2. Tool surface";
16
+ export declare const A1_HASH_BASELINE_HEADING = "## 3. System-prompt hash baseline";
17
+ export declare function readA1GoldenDocument(): string;
18
+ /**
19
+ * Locate a golden section heading, refusing to continue when it is absent.
20
+ *
21
+ * A bare `indexOf` returns -1 for a missing heading, and `slice(start, -1)`
22
+ * silently yields an empty (or truncated) section rather than failing: the
23
+ * golden then parses as ZERO tools and the consuming test passes by comparing
24
+ * empty to empty. Failing loudly here keeps a malformed golden from reading as a
25
+ * clean run.
26
+ */
27
+ export declare function a1GoldenSectionOffset(document: string, heading: string): number;
28
+ //# sourceMappingURL=prompt-surface-a1-golden.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-surface-a1-golden.d.ts","sourceRoot":"","sources":["../../src/shared/prompt-surface-a1-golden.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,uBAAuB,uBAAuB,CAAC;AAC5D,eAAO,MAAM,wBAAwB,sCAAsC,CAAC;AAE5E,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAM/E"}
@@ -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-surface-runtime.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,KAAK,aAAa,EAGrB,MAAM,mCAAmC,CAAC;AAS3C,OAAO,EACH,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EAE3B,MAAM,kBAAkB,CAAC;AAK1B,eAAO,MAAM,uBAAuB,+EAM1B,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3E,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAMjF,CAAC;AAEF;;;GAGG;AACH,wBAAgB,yBAAyB,CACrC,aAAa,EAAE,MAAM,EACrB,MAAM,GAAE,mBAA4B,GACrC,MAAM,CAIR;AAID,MAAM,WAAW,8BAA8B;IAC3C,sCAAsC;IACtC,MAAM,EAAE,mBAAmB,CAAC;IAC5B,qFAAqF;IACrF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,kCAAkC;IAC/C,MAAM,EAAE,mBAAmB,CAAC;IAC5B,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,KAAK,MAAM,CAAC;CACvE;AAED,MAAM,WAAW,oBAAoB;IACjC,mBAAmB,EAAE,CACjB,MAAM,EAAE,mBAAmB,GAAG,SAAS,KACtC,kCAAkC,CAAC;IACxC,eAAe,EAAE,CACb,MAAM,EAAE,mBAAmB,GAAG,SAAS,EACvC,QAAQ,EAAE,MAAM,GAAG,SAAS,KAC3B,8BAA8B,CAAC;CACvC;AAED,MAAM,WAAW,iCAAiC;IAC9C,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oFAAoF;IACpF,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAwBD;;;;GAIG;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,CAA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6 +39,18 @@
39
39
  * `run()` → {changes,lastInsertRowid}) is identical and was verified directly.
40
40
  */
41
41
  import type BetterSqlite3 from "better-sqlite3";
42
+ export type SqliteRuntime = "Bun" | "Node.js";
43
+ type SqliteModule = {
44
+ Database?: unknown;
45
+ DatabaseSync?: unknown;
46
+ };
47
+ export declare function detectSqliteRuntime(): SqliteRuntime;
48
+ export declare class SqliteRuntimeUnavailableError extends Error {
49
+ readonly runtime: SqliteRuntime;
50
+ readonly specifier: string;
51
+ constructor(runtime: SqliteRuntime, specifier: string, cause: unknown);
52
+ }
53
+ export declare function loadSqliteModule(runtime?: SqliteRuntime, importer?: (specifier: string) => Promise<SqliteModule>): Promise<SqliteModule>;
42
54
  export declare const Database: typeof BetterSqlite3;
43
55
  /** Instance type alias used by helpers and storage modules. */
44
56
  export type Database = BetterSqlite3.Database;
@@ -65,4 +77,5 @@ export type Statement = BetterSqlite3.Statement<unknown[], unknown>;
65
77
  * flag, so an inner scope releasing does not drop permission out from under its caller.
66
78
  */
67
79
  export declare function withPrivilegedWriter<T>(db: Database, operation: () => T): T;
80
+ export {};
68
81
  //# sourceMappingURL=sqlite.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../../src/shared/sqlite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAMH,OAAO,KAAK,aAAa,MAAM,gBAAgB,CAAC;AA4IhD,eAAO,MAAM,QAAQ,EAAE,OAAO,aAA4B,CAAC;AAE3D,+DAA+D;AAC/D,MAAM,MAAM,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC;AAE9C;;;;;;;;;GASG;AACH,MAAM,MAAM,SAAS,GAAG,aAAa,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;AASpE;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,EAA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ionCleanups,
7
7
  updateSessionMeta
8
- } from "./index-b563sga5.js";
9
- import"./index-fcyvznch.js";
8
+ } from "./index-dpdnjawy.js";
9
+ import"./index-w0nygb4p.js";
10
10
  import"./index-k1esqfwk.js";
11
11
  import"./index-kvrcg31b.js";
12
12
  import"./index-wckvcay0.js";
@@ -1,5 +1,6 @@
1
1
  import { type ToolDefinition } 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;AAu3BjB,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-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;AAqRjF,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-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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/opencode-magic-context",
3
- "version": "0.34.2",
3
+ "version": "0.35.1",
4
4
  "type": "module",
5
5
  "description": "OpenCode plugin for Magic Context — cross-session memory and context management",
6
6
  "main": "dist/index.js",
@@ -54,8 +54,18 @@ function clampHiddenAgentStepLimit(value: unknown, cap: number): number {
54
54
  * byte-identical to the canonical exported constants so they can't silently
55
55
  * diverge.
56
56
  */
57
+ export const HIDDEN_AGENT_DESCRIPTION_MARKER = "Internal Magic Context";
58
+ const HIDDEN_AGENT_DESCRIPTION =
59
+ "Internal Magic Context maintenance agent. Not for general tasks — do not select for user work.";
60
+
57
61
  export interface HiddenAgentRegistration {
58
62
  id: string;
63
+ /** OpenCode's task registry excludes primary agents from general subagent routing. */
64
+ mode: "primary";
65
+ /** Hidden agents stay out of the UI picker while remaining directly resolvable. */
66
+ hidden: true;
67
+ /** Description used by OpenCode's automatic name/description-based task router; keep it generic so this hidden agent is not selected for unrelated tasks. */
68
+ description: string;
59
69
  prompt: string | undefined;
60
70
  allowedTools: readonly string[];
61
71
  maxSteps: number;
@@ -90,6 +100,9 @@ export function buildHiddenAgentRegistrations(args: {
90
100
  return [
91
101
  {
92
102
  id: "dreamer",
103
+ mode: "primary",
104
+ hidden: true,
105
+ description: HIDDEN_AGENT_DESCRIPTION,
93
106
  prompt: args.dreamerPrompt,
94
107
  // CURATE-ONLY now. Curate edits the memory store via ctx_memory and
95
108
  // never reads code (a separate verify task owns memory-vs-code
@@ -111,6 +124,9 @@ export function buildHiddenAgentRegistrations(args: {
111
124
  },
112
125
  {
113
126
  id: "dreamer-docs",
127
+ mode: "primary",
128
+ hidden: true,
129
+ description: HIDDEN_AGENT_DESCRIPTION,
114
130
  prompt: args.dreamerPrompt,
115
131
  // maintain-docs: explore code + write/edit ARCHITECTURE.md/STRUCTURE.md
116
132
  // + bash (git log, find). NO ctx_memory/ctx_search/ctx_note — it edits
@@ -136,6 +152,9 @@ export function buildHiddenAgentRegistrations(args: {
136
152
  },
137
153
  {
138
154
  id: "dreamer-reviewer",
155
+ mode: "primary",
156
+ hidden: true,
157
+ description: HIDDEN_AGENT_DESCRIPTION,
139
158
  prompt: args.dreamerPrompt,
140
159
  // review-user-memories: a pure JSON reviewer of behavioral observations.
141
160
  // It calls NO tools — the host applies its verdict — so zero tools,
@@ -147,6 +166,9 @@ export function buildHiddenAgentRegistrations(args: {
147
166
  },
148
167
  {
149
168
  id: "dreamer-retrospective",
169
+ mode: "primary",
170
+ hidden: true,
171
+ description: HIDDEN_AGENT_DESCRIPTION,
150
172
  prompt: args.dreamerPrompt,
151
173
  allowedTools: ["ctx_search"],
152
174
  maxSteps: 40,
@@ -158,6 +180,9 @@ export function buildHiddenAgentRegistrations(args: {
158
180
  },
159
181
  {
160
182
  id: "dreamer-primer-investigator",
183
+ mode: "primary",
184
+ hidden: true,
185
+ description: HIDDEN_AGENT_DESCRIPTION,
161
186
  prompt: args.dreamerPrompt,
162
187
  // Read-only code investigation: read/navigate/search the CURRENT
163
188
  // source to answer a primer. Deliberately NO write/edit/bash (could
@@ -184,6 +209,9 @@ export function buildHiddenAgentRegistrations(args: {
184
209
  },
185
210
  {
186
211
  id: "dreamer-memory-mapper",
212
+ mode: "primary",
213
+ hidden: true,
214
+ description: HIDDEN_AGENT_DESCRIPTION,
187
215
  prompt: args.dreamerPrompt,
188
216
  // Read-only local-source reader for map-memories / verify: open and
189
217
  // check the CURRENT source. NO write/edit/bash (could corrupt user
@@ -203,6 +231,9 @@ export function buildHiddenAgentRegistrations(args: {
203
231
  },
204
232
  {
205
233
  id: "dreamer-classifier",
234
+ mode: "primary",
235
+ hidden: true,
236
+ description: HIDDEN_AGENT_DESCRIPTION,
206
237
  prompt: args.dreamerPrompt,
207
238
  // ZERO tools: classify scores importance/scope/shareable from the
208
239
  // memory text alone (no code inspection), emits ONE XML manifest, and
@@ -215,6 +246,9 @@ export function buildHiddenAgentRegistrations(args: {
215
246
  },
216
247
  {
217
248
  id: "smart-note-compiler",
249
+ mode: "primary",
250
+ hidden: true,
251
+ description: HIDDEN_AGENT_DESCRIPTION,
218
252
  prompt: args.smartNoteCompilerPrompt,
219
253
  allowedTools: [],
220
254
  maxSteps: 8,
@@ -225,6 +259,9 @@ export function buildHiddenAgentRegistrations(args: {
225
259
  },
226
260
  {
227
261
  id: "historian",
262
+ mode: "primary",
263
+ hidden: true,
264
+ description: HIDDEN_AGENT_DESCRIPTION,
228
265
  prompt: args.historianPrompt,
229
266
  allowedTools: historianAllowedTools,
230
267
  maxSteps: 40,
@@ -232,6 +269,9 @@ export function buildHiddenAgentRegistrations(args: {
232
269
  },
233
270
  {
234
271
  id: "historian-recomp",
272
+ mode: "primary",
273
+ hidden: true,
274
+ description: HIDDEN_AGENT_DESCRIPTION,
235
275
  prompt: args.historianRecompPrompt ?? args.historianPrompt,
236
276
  allowedTools: historianAllowedTools,
237
277
  maxSteps: 40,
@@ -239,6 +279,9 @@ export function buildHiddenAgentRegistrations(args: {
239
279
  },
240
280
  {
241
281
  id: "historian-editor",
282
+ mode: "primary",
283
+ hidden: true,
284
+ description: HIDDEN_AGENT_DESCRIPTION,
242
285
  prompt: args.historianEditorPrompt,
243
286
  allowedTools: historianAllowedTools,
244
287
  maxSteps: 40,
@@ -246,6 +289,9 @@ export function buildHiddenAgentRegistrations(args: {
246
289
  },
247
290
  {
248
291
  id: "sidekick",
292
+ mode: "primary",
293
+ hidden: true,
294
+ description: HIDDEN_AGENT_DESCRIPTION,
249
295
  prompt: args.sidekickPrompt,
250
296
  allowedTools: ["ctx_search", "aft_outline", "aft_zoom"],
251
297
  maxSteps: 40,
@@ -266,6 +312,7 @@ export function buildHiddenAgentConfig(
266
312
  overrides?: Record<string, unknown>,
267
313
  agentLabel?: string,
268
314
  lockPermissions = false,
315
+ description?: string,
269
316
  ) {
270
317
  const {
271
318
  permission: overridePermission,
@@ -325,7 +372,8 @@ export function buildHiddenAgentConfig(
325
372
  ...basePermission,
326
373
  ...(lockPermissions ? {} : (overridePermission ?? {})),
327
374
  },
328
- mode: "subagent" as const,
375
+ mode: "primary" as const,
329
376
  hidden: true,
377
+ ...(description !== undefined ? { description } : {}),
330
378
  };
331
379
  }