@cortexkit/opencode-magic-context 0.38.1 → 0.39.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 +37 -4
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/project-security.d.ts +11 -6
- package/dist/config/project-security.d.ts.map +1 -1
- package/dist/config/raw-loader.d.ts +42 -0
- package/dist/config/raw-loader.d.ts.map +1 -0
- package/dist/config/schema/magic-context.d.ts +585 -550
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/classify.d.ts +3 -2
- package/dist/features/magic-context/dreamer/classify.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/evaluate-smart-notes.d.ts +9 -2
- package/dist/features/magic-context/dreamer/evaluate-smart-notes.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/map-memories-prompt.d.ts +4 -2
- package/dist/features/magic-context/dreamer/map-memories-prompt.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/map-memories.d.ts +21 -5
- package/dist/features/magic-context/dreamer/map-memories.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/refresh-primers.d.ts +3 -2
- package/dist/features/magic-context/dreamer/refresh-primers.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-config.d.ts +2 -1
- package/dist/features/magic-context/dreamer/task-config.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-executor.d.ts +0 -1
- package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts +3 -2
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/verify-prompt.d.ts +5 -2
- package/dist/features/magic-context/dreamer/verify-prompt.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/verify.d.ts +6 -3
- package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -1
- package/dist/features/magic-context/migrations.d.ts.map +1 -1
- package/dist/features/magic-context/mural/compress-cues.d.ts +3 -2
- package/dist/features/magic-context/mural/compress-cues.d.ts.map +1 -1
- package/dist/features/magic-context/smart-notes/compiler.d.ts +3 -2
- package/dist/features/magic-context/smart-notes/compiler.d.ts.map +1 -1
- package/dist/features/magic-context/smart-notes/condition-compiler.d.ts +2 -0
- package/dist/features/magic-context/smart-notes/condition-compiler.d.ts.map +1 -1
- package/dist/features/magic-context/smart-notes/sandbox-runner.d.ts.map +1 -1
- package/dist/features/magic-context/storage-db.d.ts +1 -1
- package/dist/features/magic-context/storage-db.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +7 -2
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-shared.d.ts +1 -0
- package/dist/features/magic-context/storage-meta-shared.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta.d.ts +1 -1
- package/dist/features/magic-context/storage-meta.d.ts.map +1 -1
- package/dist/features/magic-context/storage-session-tables.d.ts.map +1 -1
- package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
- package/dist/features/magic-context/storage.d.ts +1 -1
- package/dist/features/magic-context/storage.d.ts.map +1 -1
- package/dist/features/magic-context/tool-definition-tokens.d.ts +10 -0
- package/dist/features/magic-context/tool-definition-tokens.d.ts.map +1 -1
- package/dist/features/magic-context/transform-decision-log.d.ts +11 -0
- package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -1
- package/dist/features/magic-context/user-memory/review-user-memories.d.ts +3 -2
- package/dist/features/magic-context/user-memory/review-user-memories.d.ts.map +1 -1
- package/dist/hooks/magic-context/channel2-delivery.d.ts +3 -1
- package/dist/hooks/magic-context/channel2-delivery.d.ts.map +1 -1
- package/dist/hooks/magic-context/command-handler.d.ts +4 -0
- package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts +4 -1
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-partial-recomp.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-recomp.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-types.d.ts +4 -1
- package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
- package/dist/hooks/magic-context/ctx-reduce-nudge.d.ts +14 -2
- package/dist/hooks/magic-context/ctx-reduce-nudge.d.ts.map +1 -1
- package/dist/hooks/magic-context/emergency-fail-closed.d.ts +7 -0
- package/dist/hooks/magic-context/emergency-fail-closed.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts +12 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-persist.d.ts +14 -0
- package/dist/hooks/magic-context/lkg-persist.d.ts.map +1 -0
- package/dist/hooks/magic-context/lkg-slot.d.ts +13 -0
- package/dist/hooks/magic-context/lkg-slot.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-state-sync.d.ts +1 -0
- package/dist/hooks/magic-context/module-state-sync.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-transport.d.ts +12 -0
- package/dist/hooks/magic-context/module-transport.d.ts.map +1 -1
- package/dist/hooks/magic-context/raw-fallback-context-limit.d.ts.map +1 -1
- package/dist/hooks/magic-context/recomp-orchestrator.d.ts +4 -1
- package/dist/hooks/magic-context/recomp-orchestrator.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/tail-hygiene-walk.d.ts +12 -0
- package/dist/hooks/magic-context/tail-hygiene-walk.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts +3 -1
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +4 -0
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +9 -1
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/wrapup-orchestrator.d.ts.map +1 -1
- package/dist/{index-2y0ybv5x.js → index-3dkzzh0t.js} +15 -17
- package/dist/index-ehpzdy0v.js +126 -0
- package/dist/{index-5znjkjws.js → index-k2ts0wk1.js} +486 -106
- package/dist/{index-22mw8km4.js → index-rw0qrkvq.js} +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17186 -14853
- package/dist/model-resolution-r9jbcz86.js +15 -0
- package/dist/plugin/dream-timer.d.ts +3 -0
- package/dist/plugin/dream-timer.d.ts.map +1 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/plugin/messages-transform.d.ts +14 -6
- package/dist/plugin/messages-transform.d.ts.map +1 -1
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/{recomp-orchestrator-p030kxtc.js → recomp-orchestrator-2pncxee7.js} +2 -3
- package/dist/shared/jsonc-edit.d.ts +6 -1
- package/dist/shared/jsonc-edit.d.ts.map +1 -1
- package/dist/shared/model-resolution.d.ts +53 -0
- package/dist/shared/model-resolution.d.ts.map +1 -0
- package/dist/shared/model-suggestion-retry.d.ts +4 -1
- package/dist/shared/model-suggestion-retry.d.ts.map +1 -1
- package/dist/shared/resolve-fallbacks.d.ts +5 -1
- package/dist/shared/resolve-fallbacks.d.ts.map +1 -1
- package/dist/shared/status-detail-text.d.ts +4 -0
- package/dist/shared/status-detail-text.d.ts.map +1 -0
- package/dist/shared/subagent-runner.d.ts +2 -1
- package/dist/shared/subagent-runner.d.ts.map +1 -1
- package/dist/{storage-meta-session-2306t3j7.js → storage-meta-session-yvtbaw7c.js} +1 -1
- package/dist/{task-config-at3adc59.js → task-config-a1qmj9bx.js} +2 -2
- package/package.json +4 -2
- package/src/config/index.test.ts +73 -17
- package/src/config/index.ts +38 -23
- package/src/config/project-security.hostile-matrix.test.ts +471 -0
- package/src/config/project-security.test.ts +26 -5
- package/src/config/project-security.ts +141 -22
- package/src/config/raw-loader.test.ts +424 -0
- package/src/config/raw-loader.ts +490 -0
- package/src/config/schema/magic-context.test.ts +144 -2
- package/src/config/schema/magic-context.ts +253 -49
- package/src/shared/jsonc-edit.ts +74 -1
- package/src/shared/model-resolution.test.ts +170 -0
- package/src/shared/model-resolution.ts +227 -0
- package/src/shared/model-suggestion-retry.test.ts +27 -0
- package/src/shared/model-suggestion-retry.ts +19 -10
- package/src/shared/resolve-fallbacks.test.ts +13 -1
- package/src/shared/resolve-fallbacks.ts +19 -4
- package/src/shared/status-detail-text.test.ts +80 -0
- package/src/shared/status-detail-text.ts +56 -0
- package/src/shared/subagent-runner.ts +3 -1
- package/dist/index-td9depx5.js +0 -46
- package/dist/resolve-fallbacks-qf0ekmz9.js +0 -11
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
normalizeModelEntry,
|
|
3
|
+
resolveDreamerTaskModel,
|
|
4
|
+
resolveFallbackEntries,
|
|
5
|
+
resolveHistorianModel,
|
|
6
|
+
resolveOpenCodeAgentOverrides
|
|
7
|
+
} from "./index-ehpzdy0v.js";
|
|
8
|
+
import"./index-1yh8g550.js";
|
|
9
|
+
export {
|
|
10
|
+
normalizeModelEntry,
|
|
11
|
+
resolveDreamerTaskModel,
|
|
12
|
+
resolveFallbackEntries,
|
|
13
|
+
resolveHistorianModel,
|
|
14
|
+
resolveOpenCodeAgentOverrides
|
|
15
|
+
};
|
|
@@ -3,6 +3,7 @@ import type { ClassifyModuleClient } from "../features/magic-context/dreamer/cla
|
|
|
3
3
|
import { type RetrospectiveRawProvider } from "../features/magic-context/dreamer/retrospective-raw-provider";
|
|
4
4
|
import type { DreamTaskName, DreamTaskProgress } from "../features/magic-context/dreamer/task-registry";
|
|
5
5
|
import type { RawMessageProvider } from "../hooks/magic-context/read-session-chunk";
|
|
6
|
+
import type { ModelHarness } from "../shared/model-resolution";
|
|
6
7
|
import type { Database } from "../shared/sqlite";
|
|
7
8
|
import type { PluginContext } from "./types";
|
|
8
9
|
/**
|
|
@@ -14,6 +15,8 @@ import type { PluginContext } from "./types";
|
|
|
14
15
|
interface ProjectRegistration {
|
|
15
16
|
directory: string;
|
|
16
17
|
projectIdentity: string;
|
|
18
|
+
/** The runtime selecting models for this registration. */
|
|
19
|
+
harness: ModelHarness;
|
|
17
20
|
client: PluginContext["client"];
|
|
18
21
|
dreamerConfig?: DreamerConfig;
|
|
19
22
|
language?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dream-timer.d.ts","sourceRoot":"","sources":["../../src/plugin/dream-timer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAWvF,OAAO,EAEH,KAAK,wBAAwB,EAChC,MAAM,8DAA8D,CAAC;AAOtE,OAAO,KAAK,EACR,aAAa,EACb,iBAAiB,EACpB,MAAM,iDAAiD,CAAC;AA4BzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAGpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAS7C;;;;;GAKG;AACH,UAAU,mBAAmB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChC,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE;QAChB,OAAO,EAAE,OAAO,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,aAAa,CAAC,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,CAAC;gBAAC,UAAU,CAAC,EAAE,MAAM,CAAA;aAAE,GAAG,IAAI,CAAA;SAAE,CAAC,CAAC;KAChF,CAAC;CACL;AAkDD;;;;;;;;;;GAUG;AACH,wBAAsB,uBAAuB,CACzC,IAAI,EAAE,mBAAmB,GAC1B,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC,CAoEnC"}
|
|
@@ -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,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAChF,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;;;;;;;;;mBAEP,CAAC;aACtD,CAAC;aAA2B,CAAC;eAM/C,CALC;;;;;;;;;;;;;;;;;;;;;;;2BAwFwizB,CAAC;;;;eAA6iB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA7E3l0B;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;;;;;;;;;qBAqE+wJ,CAAC;iBAA2B,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;;;;;;;;qBAAzqE,CAAC;mBAAyB,CAAC;iBAAuB,CAAC;iBAAuB,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;0BAA8ogE,CAAC;;;;;;;;;EAvC/5lE;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+B+wJ,CAAC;iBAA2B,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;;;;;;;;qBAAzqE,CAAC;mBAAyB,CAAC;iBAAuB,CAAC;iBAAuB,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;0BAA8ogE,CAAC;;;;;;;;;GAD/5lE"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { type FailClosedController } from "../features/magic-context/fail-closed-block";
|
|
2
|
+
export declare const ASSISTANT_TERMINAL_RETRY_MESSAGE = "The conversation ends with a completed assistant response and cannot be resubmitted as-is \u2014 send a new message to continue.";
|
|
3
|
+
export declare class AssistantTerminalRetryError extends Error {
|
|
4
|
+
readonly code = "ASSISTANT_TERMINAL_RETRY";
|
|
5
|
+
readonly recoverable = true;
|
|
6
|
+
constructor();
|
|
7
|
+
}
|
|
2
8
|
type MessageWithParts = {
|
|
3
9
|
info: import("@opencode-ai/sdk").Message;
|
|
4
10
|
parts: import("@opencode-ai/sdk").Part[];
|
|
@@ -17,9 +23,10 @@ type MagicContextTransformHooks = {
|
|
|
17
23
|
*
|
|
18
24
|
* Error handling is tiered:
|
|
19
25
|
*
|
|
20
|
-
* - **FailClosedBlockingError / EmergencyFailClosedError / RawFallbackContextLimitError
|
|
21
|
-
* Intentional loud aborts. Rethrown so the TUI surfaces the
|
|
22
|
-
* silently fall through to native compaction or a
|
|
26
|
+
* - **FailClosedBlockingError / EmergencyFailClosedError / RawFallbackContextLimitError /
|
|
27
|
+
* AssistantTerminalRetryError**: Intentional loud aborts. Rethrown so the TUI surfaces the
|
|
28
|
+
* message and the turn does not silently fall through to native compaction or a
|
|
29
|
+
* provider-rejected raw prompt.
|
|
23
30
|
*
|
|
24
31
|
* - **SQLITE_BUSY**: Transient, expected from concurrent plugin processes
|
|
25
32
|
* (second OpenCode instance, long dreamer/historian child session, slow
|
|
@@ -40,10 +47,11 @@ type MagicContextTransformHooks = {
|
|
|
40
47
|
*
|
|
41
48
|
* Ordinary transform failures are not rethrown because OpenCode's Effect pipeline
|
|
42
49
|
* turns thrown errors into user-visible prompt failures. FailClosedBlockingError,
|
|
43
|
-
* EmergencyFailClosedError,
|
|
50
|
+
* EmergencyFailClosedError, RawFallbackContextLimitError, and AssistantTerminalRetryError
|
|
51
|
+
* are intentional exceptions.
|
|
44
52
|
* We accept degraded behavior (no injection / no drops this turn) rather than
|
|
45
|
-
* blocking the user for ordinary bugs — but deterministic inoperability
|
|
46
|
-
*
|
|
53
|
+
* blocking the user for ordinary bugs — but deterministic inoperability and an unsafe
|
|
54
|
+
* assistant-terminal retry must block loudly.
|
|
47
55
|
*
|
|
48
56
|
* Correctness is preserved because all persistent state mutations inside
|
|
49
57
|
* the inner transform are idempotent across passes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages-transform.d.ts","sourceRoot":"","sources":["../../src/plugin/messages-transform.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,oBAAoB,EAI5B,MAAM,6CAA6C,CAAC;AAqBrD,KAAK,gBAAgB,GAAG;IACpB,IAAI,EAAE,OAAO,kBAAkB,EAAE,OAAO,CAAC;IACzC,KAAK,EAAE,OAAO,kBAAkB,EAAE,IAAI,EAAE,CAAC;CAC5C,CAAC;AAEF,KAAK,uBAAuB,GAAG;IAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAA;CAAE,CAAC;AAEhE,KAAK,0BAA0B,GAAG;IAC9B,sCAAsC,CAAC,EAAE,CACrC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAC5B,MAAM,EAAE,uBAAuB,KAC9B,OAAO,CAAC,IAAI,CAAC,CAAC;CACtB,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"messages-transform.d.ts","sourceRoot":"","sources":["../../src/plugin/messages-transform.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,oBAAoB,EAI5B,MAAM,6CAA6C,CAAC;AAqBrD,eAAO,MAAM,gCAAgC,qIACoF,CAAC;AAElI,qBAAa,2BAA4B,SAAQ,KAAK;IAClD,QAAQ,CAAC,IAAI,8BAA8B;IAC3C,QAAQ,CAAC,WAAW,QAAQ;;CAM/B;AAED,KAAK,gBAAgB,GAAG;IACpB,IAAI,EAAE,OAAO,kBAAkB,EAAE,OAAO,CAAC;IACzC,KAAK,EAAE,OAAO,kBAAkB,EAAE,IAAI,EAAE,CAAC;CAC5C,CAAC;AAEF,KAAK,uBAAuB,GAAG;IAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAA;CAAE,CAAC;AAEhE,KAAK,0BAA0B,GAAG;IAC9B,sCAAsC,CAAC,EAAE,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M,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,CAiOd;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,CA6PN"}
|
|
@@ -9,11 +9,10 @@ import {
|
|
|
9
9
|
setRecompNote,
|
|
10
10
|
setRecompStarting,
|
|
11
11
|
setRecompTerminal
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-k2ts0wk1.js";
|
|
13
13
|
import"./index-mg1yx1ph.js";
|
|
14
|
-
import"./index-td9depx5.js";
|
|
15
14
|
import"./index-btj2qhmc.js";
|
|
16
|
-
import"./index-
|
|
15
|
+
import"./index-rw0qrkvq.js";
|
|
17
16
|
import"./index-2wchnyk6.js";
|
|
18
17
|
import"./index-sw8gnq34.js";
|
|
19
18
|
import"./index-8mtsfhyg.js";
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import { type JSONPath } from "jsonc-parser";
|
|
1
|
+
import { type JSONPath } from "jsonc-parser/lib/esm/main.js";
|
|
2
2
|
/**
|
|
3
3
|
* Replace one JSONC value without reserializing the rest of the document. New
|
|
4
4
|
* paths use jsonc-parser's structural edit so the original document remains
|
|
5
5
|
* untouched outside the inserted property.
|
|
6
6
|
*/
|
|
7
7
|
export declare function setJsoncValue(text: string, path: JSONPath, value: unknown): string;
|
|
8
|
+
/**
|
|
9
|
+
* Delete an object property without reserializing sibling fields. Comments are
|
|
10
|
+
* retained as JSONC trivia so key migrations do not erase a user's notes.
|
|
11
|
+
*/
|
|
12
|
+
export declare function removeJsoncValue(text: string, path: JSONPath): string;
|
|
8
13
|
/**
|
|
9
14
|
* Remove matching array entries while retaining the exact bytes for survivor
|
|
10
15
|
* comments and surrounding JSONC regions.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonc-edit.d.ts","sourceRoot":"","sources":["../../src/shared/jsonc-edit.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,KAAK,QAAQ,EAKhB,MAAM,
|
|
1
|
+
{"version":3,"file":"jsonc-edit.d.ts","sourceRoot":"","sources":["../../src/shared/jsonc-edit.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,KAAK,QAAQ,EAKhB,MAAM,8BAA8B,CAAC;AA2OtC;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CASlF;AAwDD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,CAMrE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACnC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,QAAQ,EACd,YAAY,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,GAC1C;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAiBpC;AAED,qFAAqF;AACrF,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAY9F"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export type ModelHarness = "opencode" | "pi";
|
|
2
|
+
export interface ResolvedModelEntry {
|
|
3
|
+
/** Canonical provider/model reference used for identity and model selection. */
|
|
4
|
+
model: string;
|
|
5
|
+
/** OpenCode variant or Pi thinking level, selected for the active entry only. */
|
|
6
|
+
qualifier?: string;
|
|
7
|
+
}
|
|
8
|
+
export type ModelInput = string | ResolvedModelEntry;
|
|
9
|
+
/**
|
|
10
|
+
* Collapses the string and object spellings of a harness model entry into the
|
|
11
|
+
* same model identity. Qualifiers stay separate because they alter an attempt,
|
|
12
|
+
* not the configured model identity.
|
|
13
|
+
*/
|
|
14
|
+
export declare function normalizeModelEntry(entry: unknown, harness: ModelHarness): ResolvedModelEntry | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Resolves a configured fallback list in declaration order. Attempts are
|
|
17
|
+
* deduplicated by model plus qualifier: the same model with distinct
|
|
18
|
+
* qualifiers remains two intentional attempts.
|
|
19
|
+
*/
|
|
20
|
+
export declare function resolveFallbackEntries(value: unknown, harness: ModelHarness): ResolvedModelEntry[];
|
|
21
|
+
export interface ResolvedHistorianModel {
|
|
22
|
+
primary?: ResolvedModelEntry;
|
|
23
|
+
fallbacks: ResolvedModelEntry[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Resolve historian model attempts from exactly one harness block. Flat keys
|
|
27
|
+
* and the other harness are deliberately never consulted after cutover.
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolveHistorianModel(config: unknown, harness: ModelHarness): ResolvedHistorianModel;
|
|
30
|
+
export interface ResolvedDreamerTaskModel {
|
|
31
|
+
primary?: ResolvedModelEntry;
|
|
32
|
+
fallbacks: ResolvedModelEntry[];
|
|
33
|
+
schedule?: string;
|
|
34
|
+
timeoutMinutes?: number;
|
|
35
|
+
promotionThreshold?: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Resolve a dreamer task from one harness subtree. Model selection is task →
|
|
39
|
+
* harness default, except compress-cues inserts its harness-independent mural
|
|
40
|
+
* string between those two rungs. Scheduling remains at dreamer.tasks.<task>.
|
|
41
|
+
*/
|
|
42
|
+
export declare function resolveDreamerTaskModel(args: {
|
|
43
|
+
config: unknown;
|
|
44
|
+
harness: ModelHarness;
|
|
45
|
+
task: string;
|
|
46
|
+
muralModel?: unknown;
|
|
47
|
+
}): ResolvedDreamerTaskModel;
|
|
48
|
+
/**
|
|
49
|
+
* Keep non-model agent settings at their original level while replacing only
|
|
50
|
+
* OpenCode's model-resolution fields with the executing harness's primary.
|
|
51
|
+
*/
|
|
52
|
+
export declare function resolveOpenCodeAgentOverrides(agent: unknown): Record<string, unknown>;
|
|
53
|
+
//# sourceMappingURL=model-resolution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-resolution.d.ts","sourceRoot":"","sources":["../../src/shared/model-resolution.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,IAAI,CAAC;AAE7C,MAAM,WAAW,kBAAkB;IAC/B,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;IACd,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,kBAAkB,CAAC;AAoBrD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAC/B,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,YAAY,GACtB,kBAAkB,GAAG,SAAS,CAehC;AAWD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAClC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,YAAY,GACtB,kBAAkB,EAAE,CAUtB;AAaD,MAAM,WAAW,sBAAsB;IACnC,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,SAAS,EAAE,kBAAkB,EAAE,CAAC;CACnC;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACjC,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,YAAY,GACtB,sBAAsB,CAaxB;AAED,MAAM,WAAW,wBAAwB;IACrC,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,SAAS,EAAE,kBAAkB,EAAE,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC1C,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,YAAY,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB,GAAG,wBAAwB,CA0D3B;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAuBrF"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { createOpencodeClient } from "@opencode-ai/sdk";
|
|
2
|
+
import type { ModelInput } from "./model-resolution";
|
|
2
3
|
type Client = ReturnType<typeof createOpencodeClient>;
|
|
3
4
|
export type PromptBody = {
|
|
4
5
|
model?: {
|
|
5
6
|
providerID: string;
|
|
6
7
|
modelID: string;
|
|
7
8
|
};
|
|
9
|
+
/** OpenCode variant; Pi's facade also uses it as the active thinking level. */
|
|
10
|
+
variant?: string;
|
|
8
11
|
[key: string]: unknown;
|
|
9
12
|
};
|
|
10
13
|
export type PromptArgs = {
|
|
@@ -49,7 +52,7 @@ export interface PromptRetryOptions {
|
|
|
49
52
|
* - On all-failed, the LAST error is thrown (matches legacy behavior when
|
|
50
53
|
* `fallbackModels` is empty).
|
|
51
54
|
*/
|
|
52
|
-
fallbackModels?: readonly
|
|
55
|
+
fallbackModels?: readonly ModelInput[];
|
|
53
56
|
/**
|
|
54
57
|
* Identifier for structured logging (e.g. "dreamer:consolidate",
|
|
55
58
|
* "historian", "compressor", "sidekick"). Helps correlate fallback
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-suggestion-retry.d.ts","sourceRoot":"","sources":["../../src/shared/model-suggestion-retry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"model-suggestion-retry.d.ts","sourceRoot":"","sources":["../../src/shared/model-suggestion-retry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAI7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAOtD,MAAM,MAAM,UAAU,GAAG;IACrB,KAAK,CAAC,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAChD,+EAA+E;IAC/E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACrB,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACrB,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B,CAAC;AAWF,MAAM,WAAW,iBAAiB;IAC9B,+EAA+E;IAC/E,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,YAAY,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,UAAU,EAAE,OAAO,CAAC;IACpB,iFAAiF;IACjF,aAAa,EAAE,MAAM,CAAC;IACtB,uEAAuE;IACvE,KAAK,CAAC,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,OAA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ACd,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,2BAA2B,CAAC,OAAO,EAAE,UAAU,CAAC,GAC1D,OAAO,CAAC,0BAA0B,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAwG1D"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ModelInput, ResolvedModelEntry } from "./model-resolution";
|
|
1
2
|
/**
|
|
2
3
|
* Resolve the fallback model list to attempt for a hidden-agent (historian /
|
|
3
4
|
* dreamer / sidekick) call when its configured primary fails.
|
|
@@ -35,10 +36,13 @@ export declare function parseProviderModel(spec: string): {
|
|
|
35
36
|
* unparseable (the session falls back to its default model). Spread into a
|
|
36
37
|
* `client.session.prompt` body.
|
|
37
38
|
*/
|
|
38
|
-
export declare function modelBodyField(spec:
|
|
39
|
+
export declare function modelBodyField(spec: ModelInput | undefined): {
|
|
39
40
|
model?: {
|
|
40
41
|
providerID: string;
|
|
41
42
|
modelID: string;
|
|
42
43
|
};
|
|
44
|
+
variant?: string;
|
|
43
45
|
};
|
|
46
|
+
/** Convert legacy string call sites and resolved entries into one active attempt shape. */
|
|
47
|
+
export declare function toModelEntry(spec: ModelInput | undefined): ResolvedModelEntry | undefined;
|
|
44
48
|
//# sourceMappingURL=resolve-fallbacks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-fallbacks.d.ts","sourceRoot":"","sources":["../../src/shared/resolve-fallbacks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAChC,aAAa,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,GACtD,MAAM,EAAE,CAGV;AA2BD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAO/F;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"resolve-fallbacks.d.ts","sourceRoot":"","sources":["../../src/shared/resolve-fallbacks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAEzE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAChC,aAAa,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,GACtD,MAAM,EAAE,CAGV;AA2BD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAO/F;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,GAAG;IAC1D,KAAK,CAAC,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB,CAOA;AAED,2FAA2F;AAC3F,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,GAAG,kBAAkB,GAAG,SAAS,CAMzF"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { StatusDetail } from "./rpc-types";
|
|
2
|
+
/** Render the same StatusDetail payload that powers the TUI dialog for chat-only clients. */
|
|
3
|
+
export declare function formatStatusDetailMarkdown(detail: StatusDetail): string;
|
|
4
|
+
//# sourceMappingURL=status-detail-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-detail-text.d.ts","sourceRoot":"","sources":["../../src/shared/status-detail-text.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAahD,6FAA6F;AAC7F,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAyCvE"}
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
* OpenCode keeps its existing direct `client.session.*` calls untouched —
|
|
29
29
|
* the runner contract is purely additive on the OpenCode side.
|
|
30
30
|
*/
|
|
31
|
+
import type { ModelInput } from "./model-resolution";
|
|
31
32
|
/**
|
|
32
33
|
* Configuration for one subagent invocation.
|
|
33
34
|
*
|
|
@@ -62,7 +63,7 @@ export interface SubagentRunOptions {
|
|
|
62
63
|
systemPrompt: string;
|
|
63
64
|
userMessage: string;
|
|
64
65
|
model?: string | undefined;
|
|
65
|
-
fallbackModels?: readonly
|
|
66
|
+
fallbackModels?: readonly ModelInput[];
|
|
66
67
|
timeoutMs?: number | undefined;
|
|
67
68
|
cwd?: string | undefined;
|
|
68
69
|
signal?: AbortSignal | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subagent-runner.d.ts","sourceRoot":"","sources":["../../src/shared/subagent-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,WAAW,kBAAkB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,cAAc,CAAC,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"subagent-runner.d.ts","sourceRoot":"","sources":["../../src/shared/subagent-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,WAAW,kBAAkB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,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5,8 @@ import {
|
|
|
5
5
|
summarizeDreamSchedule,
|
|
6
6
|
userMemoryCollectionEnabled,
|
|
7
7
|
userMemoryPromotionThreshold
|
|
8
|
-
} from "./index-
|
|
9
|
-
import"./index-
|
|
8
|
+
} from "./index-3dkzzh0t.js";
|
|
9
|
+
import"./index-ehpzdy0v.js";
|
|
10
10
|
import"./index-1yh8g550.js";
|
|
11
11
|
export {
|
|
12
12
|
buildDreamTaskRuntimeConfigs,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/opencode-magic-context",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "OpenCode plugin for Magic Context — cross-session memory and context management",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -39,7 +39,9 @@
|
|
|
39
39
|
"build:tui": "bun scripts/build-tui.ts",
|
|
40
40
|
"check:tui-compiled": "bun run build:tui && git diff --exit-code -- src/tui-compiled && test -z \"$(git status --porcelain -- src/tui-compiled)\"",
|
|
41
41
|
"typecheck": "tsc -p ../retina-local-fs/tsconfig.build.json && tsc --noEmit && tsc -p tsconfig.scripts.json",
|
|
42
|
-
"test": "bun test --timeout 30000",
|
|
42
|
+
"test": "bun install --frozen-lockfile && bun test --parallel --timeout 30000",
|
|
43
|
+
"test:serial": "bun install --frozen-lockfile && bun test --timeout 30000",
|
|
44
|
+
"test:parallel:probe": "bun scripts/verify-parallel-db-isolation.ts",
|
|
43
45
|
"lint": "biome check .",
|
|
44
46
|
"lint:fix": "biome check --write .",
|
|
45
47
|
"format": "biome format --write .",
|
package/src/config/index.test.ts
CHANGED
|
@@ -342,6 +342,40 @@ describe("loadPluginConfig — secret redaction", () => {
|
|
|
342
342
|
expect(w).toBeDefined();
|
|
343
343
|
});
|
|
344
344
|
|
|
345
|
+
it("prunes only cross-harness qualifier leaves and names their full paths", () => {
|
|
346
|
+
const result = loadWithUserConfig(
|
|
347
|
+
JSON.stringify({
|
|
348
|
+
historian: {
|
|
349
|
+
two_pass: true,
|
|
350
|
+
opencode: {
|
|
351
|
+
model: "anthropic/claude-sonnet",
|
|
352
|
+
variant: "high",
|
|
353
|
+
thinking_level: "minimal",
|
|
354
|
+
},
|
|
355
|
+
pi: {
|
|
356
|
+
model: "github-copilot/gpt-5",
|
|
357
|
+
thinking_level: "medium",
|
|
358
|
+
variant: "fast",
|
|
359
|
+
},
|
|
360
|
+
},
|
|
361
|
+
}),
|
|
362
|
+
);
|
|
363
|
+
|
|
364
|
+
expect(result.historian?.two_pass).toBe(true);
|
|
365
|
+
expect(result.historian?.opencode).toEqual({
|
|
366
|
+
model: "anthropic/claude-sonnet",
|
|
367
|
+
variant: "high",
|
|
368
|
+
});
|
|
369
|
+
expect(result.historian?.pi).toEqual({
|
|
370
|
+
model: "github-copilot/gpt-5",
|
|
371
|
+
thinking_level: "medium",
|
|
372
|
+
});
|
|
373
|
+
const warnings = result.configWarnings?.join("\n") ?? "";
|
|
374
|
+
expect(warnings).toContain("historian.opencode.thinking_level");
|
|
375
|
+
expect(warnings).toContain("historian.pi.variant");
|
|
376
|
+
expect(warnings).not.toContain("invalid agent configuration, ignoring");
|
|
377
|
+
});
|
|
378
|
+
|
|
345
379
|
it("still shows numeric and boolean invalid values (not secrets by nature)", () => {
|
|
346
380
|
// Numbers/booleans in config fields are never secrets — they're
|
|
347
381
|
// plain validation mistakes — so we surface them fully to help
|
|
@@ -740,25 +774,43 @@ describe("loadPluginConfig — user-only settings", () => {
|
|
|
740
774
|
const result = loadWithUserAndProjectConfig(
|
|
741
775
|
JSON.stringify({
|
|
742
776
|
historian: {
|
|
743
|
-
|
|
744
|
-
|
|
777
|
+
opencode: {
|
|
778
|
+
model: "anthropic/user-historian",
|
|
779
|
+
fallback_models: ["anthropic/user-fallback"],
|
|
780
|
+
},
|
|
781
|
+
pi: {
|
|
782
|
+
model: "github-copilot/user-historian",
|
|
783
|
+
fallback_models: ["github-copilot/user-fallback"],
|
|
784
|
+
},
|
|
745
785
|
},
|
|
746
786
|
}),
|
|
747
787
|
JSON.stringify({
|
|
748
788
|
historian: {
|
|
749
|
-
|
|
750
|
-
|
|
789
|
+
opencode: {
|
|
790
|
+
model: "anthropic/project-historian",
|
|
791
|
+
fallback_models: ["anthropic/project-fallback"],
|
|
792
|
+
},
|
|
793
|
+
pi: {
|
|
794
|
+
model: "github-copilot/project-historian",
|
|
795
|
+
fallback_models: ["github-copilot/project-fallback"],
|
|
796
|
+
},
|
|
751
797
|
temperature: 0.2,
|
|
752
798
|
},
|
|
753
799
|
}),
|
|
754
800
|
);
|
|
755
801
|
|
|
756
|
-
expect(result.historian?.
|
|
757
|
-
|
|
802
|
+
expect(result.historian?.opencode).toEqual({
|
|
803
|
+
model: "anthropic/user-historian",
|
|
804
|
+
fallback_models: ["anthropic/user-fallback"],
|
|
805
|
+
});
|
|
806
|
+
expect(result.historian?.pi).toEqual({
|
|
807
|
+
model: "github-copilot/user-historian",
|
|
808
|
+
fallback_models: ["github-copilot/user-fallback"],
|
|
809
|
+
});
|
|
758
810
|
expect(result.historian?.temperature).toBe(0.2);
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
);
|
|
811
|
+
const warnings = result.configWarnings?.join("\n") ?? "";
|
|
812
|
+
expect(warnings).toContain("historian.opencode.model");
|
|
813
|
+
expect(warnings).toContain("historian.pi.model");
|
|
762
814
|
});
|
|
763
815
|
});
|
|
764
816
|
|
|
@@ -877,21 +929,25 @@ describe("loadPluginConfig — raw merge preserves user fields not set in projec
|
|
|
877
929
|
JSON.stringify({ language: "tr" }),
|
|
878
930
|
JSON.stringify({
|
|
879
931
|
dreamer: {
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
932
|
+
tasks: { verify: { schedule: "0 3 * * *" } },
|
|
933
|
+
opencode: {
|
|
934
|
+
model: "anthropic/project-dreamer",
|
|
935
|
+
tasks: { verify: { model: "anthropic/project-verify" } },
|
|
936
|
+
},
|
|
937
|
+
pi: {
|
|
938
|
+
model: "github-copilot/project-dreamer",
|
|
939
|
+
tasks: { verify: { model: "github-copilot/project-verify" } },
|
|
886
940
|
},
|
|
887
941
|
},
|
|
888
942
|
}),
|
|
889
943
|
);
|
|
890
944
|
|
|
891
945
|
expect(result.language).toBe("tr");
|
|
892
|
-
expect(result.dreamer?.model).toBe("anthropic/project-dreamer");
|
|
946
|
+
expect(result.dreamer?.opencode?.model).toBe("anthropic/project-dreamer");
|
|
947
|
+
expect(result.dreamer?.pi?.model).toBe("github-copilot/project-dreamer");
|
|
893
948
|
expect(result.dreamer?.tasks.verify.schedule).toBe("0 3 * * *");
|
|
894
|
-
expect(result.dreamer?.tasks
|
|
949
|
+
expect(result.dreamer?.opencode?.tasks?.verify?.model).toBe("anthropic/project-verify");
|
|
950
|
+
expect(result.dreamer?.pi?.tasks?.verify?.model).toBe("github-copilot/project-verify");
|
|
895
951
|
});
|
|
896
952
|
|
|
897
953
|
it("project boolean override beats user default", () => {
|
package/src/config/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { existsSync
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
2
|
|
|
3
3
|
import { detectConfigFile, isPrototypePollutionKey, parseJsonc } from "../shared/jsonc-parser";
|
|
4
4
|
import { setOutputReserveConfig } from "../shared/models-dev-cache";
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
stripUnsafeProjectConfigFields,
|
|
21
21
|
} from "./project-security";
|
|
22
22
|
import { pruneNestedConfigLeaf } from "./prune-config-leaf";
|
|
23
|
+
import { loadRawConfigFile } from "./raw-loader";
|
|
23
24
|
import { type MagicContextConfig, MagicContextConfigSchema } from "./schema/magic-context";
|
|
24
25
|
import { resolveTransformMode } from "./transform-mode";
|
|
25
26
|
import { substituteConfigVariables } from "./variable";
|
|
@@ -109,8 +110,12 @@ function loadConfigFileDetailed(
|
|
|
109
110
|
}
|
|
110
111
|
|
|
111
112
|
let rawText: string;
|
|
113
|
+
let rawWarnings: string[];
|
|
112
114
|
try {
|
|
113
|
-
|
|
115
|
+
const raw = loadRawConfigFile({ configPath, tier: source });
|
|
116
|
+
if (!raw) return null;
|
|
117
|
+
rawText = raw.text;
|
|
118
|
+
rawWarnings = raw.warnings;
|
|
114
119
|
} catch (error) {
|
|
115
120
|
return {
|
|
116
121
|
config: {},
|
|
@@ -138,7 +143,7 @@ function loadConfigFileDetailed(
|
|
|
138
143
|
);
|
|
139
144
|
return {
|
|
140
145
|
config,
|
|
141
|
-
warnings: [...substituted.warnings, ...unsafeKeyWarnings].map(
|
|
146
|
+
warnings: [...rawWarnings, ...substituted.warnings, ...unsafeKeyWarnings].map(
|
|
142
147
|
(warning) => `${configPath}: ${warning}`,
|
|
143
148
|
),
|
|
144
149
|
outcome:
|
|
@@ -285,8 +290,9 @@ function parsePluginConfig(
|
|
|
285
290
|
}
|
|
286
291
|
|
|
287
292
|
// Full parse failed — recover field-by-field using defaults for invalid fields.
|
|
288
|
-
//
|
|
289
|
-
//
|
|
293
|
+
// Invalid nested leaves are pruned from agent blocks; only root-level or
|
|
294
|
+
// unreachable agent errors drop the block, because guessing a model config
|
|
295
|
+
// could run an expensive unintended model or fail silently.
|
|
290
296
|
const defaults = MagicContextConfigSchema.parse({});
|
|
291
297
|
const warnings: string[] = [];
|
|
292
298
|
|
|
@@ -309,7 +315,13 @@ function parsePluginConfig(
|
|
|
309
315
|
const key = String(topKey);
|
|
310
316
|
errorPaths.add(key);
|
|
311
317
|
const paths = issuePathsByKey.get(key) ?? [];
|
|
312
|
-
|
|
318
|
+
if (issue.code === "unrecognized_keys") {
|
|
319
|
+
for (const unrecognizedKey of issue.keys) {
|
|
320
|
+
paths.push([...issue.path, unrecognizedKey]);
|
|
321
|
+
}
|
|
322
|
+
} else {
|
|
323
|
+
paths.push([...issue.path]);
|
|
324
|
+
}
|
|
313
325
|
issuePathsByKey.set(key, paths);
|
|
314
326
|
const msg = issue.message;
|
|
315
327
|
if (msg && !GENERIC_ZOD_PREFIXES.some((p) => msg.startsWith(p))) {
|
|
@@ -324,21 +336,12 @@ function parsePluginConfig(
|
|
|
324
336
|
for (const key of errorPaths) {
|
|
325
337
|
recoveredTopLevelKeys.push(key);
|
|
326
338
|
const isAgentConfig = key === "historian" || key === "dreamer" || key === "sidekick";
|
|
327
|
-
if (isAgentConfig) {
|
|
328
|
-
// Drop agent configs entirely on error — don't default them
|
|
329
|
-
delete patched[key];
|
|
330
|
-
warnings.push(
|
|
331
|
-
`"${key}": invalid agent configuration, ignoring. Check your magic-context.jsonc.`,
|
|
332
|
-
);
|
|
333
|
-
continue;
|
|
334
|
-
}
|
|
335
339
|
|
|
336
|
-
// For object-valued keys (
|
|
337
|
-
// leaves and keep valid siblings, so one bad
|
|
338
|
-
//
|
|
339
|
-
//
|
|
340
|
-
//
|
|
341
|
-
// isn't a prunable object.
|
|
340
|
+
// For object-valued keys (including agent harness blocks), prune only invalid
|
|
341
|
+
// nested leaves and keep valid siblings, so one bad field does not remove
|
|
342
|
+
// already-migrated keys such as memory.auto_search and
|
|
343
|
+
// memory.git_commit_indexing. Fall back to whole-key deletion when the issue
|
|
344
|
+
// is at the key itself or the value is not a prunable object.
|
|
342
345
|
const issuePaths = issuePathsByKey.get(key) ?? [];
|
|
343
346
|
const rawValue = rawConfig[key];
|
|
344
347
|
const allNested =
|
|
@@ -364,10 +367,22 @@ function parsePluginConfig(
|
|
|
364
367
|
prunedLeaves.push(result.removed);
|
|
365
368
|
}
|
|
366
369
|
}
|
|
367
|
-
|
|
368
|
-
|
|
370
|
+
if (prunedLeaves.length === issuePaths.length) {
|
|
371
|
+
patched[key] = prunedBlock;
|
|
372
|
+
const reason = customMessagesByKey.get(key);
|
|
373
|
+
warnings.push(
|
|
374
|
+
`"${key}": invalid nested field(s) ${prunedLeaves.map((leaf) => `"${key}.${leaf}"`).join(", ")}, using defaults for those.${reason ? ` ${reason}` : ""}`,
|
|
375
|
+
);
|
|
376
|
+
continue;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
// Root-level or unreachable agent errors cannot be repaired safely because
|
|
381
|
+
// guessing a model configuration could select an expensive unintended model.
|
|
382
|
+
if (isAgentConfig) {
|
|
383
|
+
delete patched[key];
|
|
369
384
|
warnings.push(
|
|
370
|
-
`"${key}": invalid
|
|
385
|
+
`"${key}": invalid agent configuration, ignoring. Check your magic-context.jsonc.`,
|
|
371
386
|
);
|
|
372
387
|
continue;
|
|
373
388
|
}
|