@cortexkit/opencode-magic-context 0.17.2 → 0.19.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 +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/features/magic-context/compaction-marker.d.ts +17 -0
- package/dist/features/magic-context/compaction-marker.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-storage.d.ts +11 -0
- package/dist/features/magic-context/compartment-storage.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/queue.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/runner.d.ts +15 -0
- package/dist/features/magic-context/dreamer/runner.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-identity.d.ts +11 -0
- package/dist/features/magic-context/memory/embedding-identity.d.ts.map +1 -0
- package/dist/features/magic-context/memory/embedding-local.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-openai.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding.d.ts.map +1 -1
- package/dist/features/magic-context/migrations.d.ts.map +1 -1
- package/dist/features/magic-context/sidekick/agent.d.ts.map +1 -1
- package/dist/features/magic-context/storage-db.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +70 -0
- 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.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.map +1 -1
- package/dist/features/magic-context/types.d.ts +1 -0
- package/dist/features/magic-context/types.d.ts.map +1 -1
- package/dist/features/magic-context/user-memory/review-user-memories.d.ts +2 -0
- package/dist/features/magic-context/user-memory/review-user-memories.d.ts.map +1 -1
- package/dist/hooks/magic-context/cache-busting-signals.d.ts +10 -0
- package/dist/hooks/magic-context/cache-busting-signals.d.ts.map +1 -0
- package/dist/hooks/magic-context/command-handler.d.ts +2 -0
- package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/compaction-marker-manager.d.ts +50 -0
- package/dist/hooks/magic-context/compaction-marker-manager.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-compressor.d.ts +1 -0
- package/dist/hooks/magic-context/compartment-runner-compressor.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts +7 -0
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.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 +18 -7
- package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner.d.ts +7 -2
- package/dist/hooks/magic-context/compartment-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/historian-state-file.d.ts +25 -11
- package/dist/hooks/magic-context/historian-state-file.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook-handlers.d.ts +11 -4
- 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 +2 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/live-session-state.d.ts +3 -1
- package/dist/hooks/magic-context/live-session-state.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
- package/dist/hooks/magic-context/todo-view.d.ts +102 -0
- package/dist/hooks/magic-context/todo-view.d.ts.map +1 -0
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts +11 -4
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-message-helpers.d.ts +22 -0
- package/dist/hooks/magic-context/transform-message-helpers.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +15 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +4 -0
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/index.js +1789 -711
- 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/rpc-handlers.d.ts +2 -1
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/plugin/sidebar-snapshot-cache.d.ts.map +1 -1
- package/dist/shared/conflict-detector.d.ts +49 -0
- package/dist/shared/conflict-detector.d.ts.map +1 -1
- package/dist/shared/conflict-fixer.d.ts +1 -1
- package/dist/shared/conflict-fixer.d.ts.map +1 -1
- package/dist/shared/data-path.d.ts +84 -0
- package/dist/shared/data-path.d.ts.map +1 -1
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/logger.d.ts +6 -0
- package/dist/shared/logger.d.ts.map +1 -1
- package/dist/shared/model-suggestion-retry.d.ts +37 -0
- package/dist/shared/model-suggestion-retry.d.ts.map +1 -1
- package/dist/shared/models-dev-cache.d.ts.map +1 -1
- package/dist/shared/resolve-fallbacks.d.ts +32 -0
- package/dist/shared/resolve-fallbacks.d.ts.map +1 -0
- package/dist/shared/rpc-client.d.ts +2 -1
- package/dist/shared/rpc-client.d.ts.map +1 -1
- package/dist/shared/rpc-notifications.d.ts +3 -2
- package/dist/shared/rpc-notifications.d.ts.map +1 -1
- package/dist/shared/rpc-server.d.ts +3 -0
- package/dist/shared/rpc-server.d.ts.map +1 -1
- package/dist/shared/rpc-types.d.ts +1 -0
- package/dist/shared/rpc-types.d.ts.map +1 -1
- package/dist/shared/rpc-utils.d.ts +13 -2
- package/dist/shared/rpc-utils.d.ts.map +1 -1
- package/dist/shared/stable-json.d.ts +21 -0
- package/dist/shared/stable-json.d.ts.map +1 -0
- package/dist/shared/tag-transcript.d.ts.map +1 -1
- package/dist/tools/ctx-memory/tools.d.ts.map +1 -1
- package/dist/tui/data/context-db.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/shared/conflict-detector.ts +4 -4
- package/src/shared/conflict-fixer.test.ts +124 -0
- package/src/shared/conflict-fixer.ts +34 -28
- package/src/shared/data-path.test.ts +38 -0
- package/src/shared/data-path.ts +99 -0
- package/src/shared/index.ts +1 -0
- package/src/shared/logger.ts +29 -3
- package/src/shared/model-suggestion-retry.test.ts +251 -0
- package/src/shared/model-suggestion-retry.ts +194 -6
- package/src/shared/models-dev-cache.ts +7 -7
- package/src/shared/resolve-fallbacks.test.ts +136 -0
- package/src/shared/resolve-fallbacks.ts +76 -0
- package/src/shared/rpc-client.test.ts +161 -0
- package/src/shared/rpc-client.ts +82 -22
- package/src/shared/rpc-notifications.test.ts +20 -0
- package/src/shared/rpc-notifications.ts +9 -6
- package/src/shared/rpc-server.ts +42 -4
- package/src/shared/rpc-types.ts +1 -0
- package/src/shared/rpc-utils.ts +59 -3
- package/src/shared/stable-json.test.ts +87 -0
- package/src/shared/stable-json.ts +37 -0
- package/src/shared/tag-transcript.ts +3 -2
- package/src/tui/data/context-db.ts +20 -1
- package/src/tui/index.tsx +114 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dream-timer.d.ts","sourceRoot":"","sources":["../../src/plugin/dream-timer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dream-timer.d.ts","sourceRoot":"","sources":["../../src/plugin/dream-timer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,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CAAC;;;;;;;;;;;;
|
|
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;AAU7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACrC,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;IACvC,gBAAgB,EAAE,gBAAgB,CAAC;CACtC;;;;;;qBAqDyvJ,CAAC;;;;;;;;;;;;qBAAh2C,CAAC;mBAAyB,CAAC;iBAAuB,CAAC;iBAAuB,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;0BAAuttB,CAAC;;;;;;EAD9t0B"}
|
|
@@ -6,8 +6,9 @@ import type { MagicContextConfig } from "../config/schema/magic-context";
|
|
|
6
6
|
import { type ContextDatabase as Database } from "../features/magic-context/storage";
|
|
7
7
|
import type { LiveSessionState } from "../hooks/magic-context/live-session-state";
|
|
8
8
|
import type { MagicContextRpcServer } from "../shared/rpc-server";
|
|
9
|
-
import type { SidebarSnapshot } from "../shared/rpc-types";
|
|
9
|
+
import type { SidebarSnapshot, StatusDetail } from "../shared/rpc-types";
|
|
10
10
|
export declare function buildSidebarSnapshot(db: Database, sessionId: string, directory: string, liveSessionState?: LiveSessionState, injectionBudgetTokens?: number): SidebarSnapshot;
|
|
11
|
+
export declare function buildStatusDetail(db: Database, sessionId: string, directory: string, modelKey?: string, config?: Record<string, unknown>, liveSessionState?: LiveSessionState, injectionBudgetTokens?: number): StatusDetail;
|
|
11
12
|
/**
|
|
12
13
|
* Register all RPC handlers on the server.
|
|
13
14
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-handlers.d.ts","sourceRoot":"","sources":["../../src/plugin/rpc-handlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGzE,OAAO,EAAE,KAAK,eAAe,IAAI,QAAQ,EAAgB,MAAM,mCAAmC,CAAC;AAQnG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AASlF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"rpc-handlers.d.ts","sourceRoot":"","sources":["../../src/plugin/rpc-handlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGzE,OAAO,EAAE,KAAK,eAAe,IAAI,QAAQ,EAAgB,MAAM,mCAAmC,CAAC;AAQnG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AASlF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAmDzE,wBAAgB,oBAAoB,CAChC,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,qBAAqB,CAAC,EAAE,MAAM,GAC/B,eAAe,CAySjB;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,GAC/B,YAAY,CAkKd;AAED;;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;CACtC,GACF,IAAI,CAuIN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar-snapshot-cache.d.ts","sourceRoot":"","sources":["../../src/plugin/sidebar-snapshot-cache.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAY3D;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACpC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,eAAe,GACvB,eAAe,
|
|
1
|
+
{"version":3,"file":"sidebar-snapshot-cache.d.ts","sourceRoot":"","sources":["../../src/plugin/sidebar-snapshot-cache.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAY3D;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACpC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,eAAe,GACvB,eAAe,CA6CjB;AAQD;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAEjE;AAED;;GAEG;AACH,wBAAgB,yBAAyB,IAAI,IAAI,CAEhD"}
|
|
@@ -18,6 +18,55 @@ export interface ConflictResult {
|
|
|
18
18
|
* Checks: OpenCode compaction, DCP plugin, OMO conflicting hooks.
|
|
19
19
|
*/
|
|
20
20
|
export declare function detectConflicts(directory: string): ConflictResult;
|
|
21
|
+
/**
|
|
22
|
+
* Canonical npm package names that represent the conflicting plugin.
|
|
23
|
+
* Matched against the npm-style segment of each plugin entry, so:
|
|
24
|
+
* - "@tarquinen/opencode-dcp" ✓ direct match
|
|
25
|
+
* - "@tarquinen/opencode-dcp@latest" ✓ version suffix stripped
|
|
26
|
+
* - "@tarquinen/opencode-dcp@^3.1.0" ✓ semver suffix stripped
|
|
27
|
+
* - "file:///path/to/opencode-dcp-fork" ✗ unrelated path
|
|
28
|
+
*
|
|
29
|
+
* forks/renames that don't ship the conflicting transform/system hooks are
|
|
30
|
+
* intentionally NOT matched.
|
|
31
|
+
*/
|
|
32
|
+
export declare const DCP_PACKAGE_NAMES: Set<string>;
|
|
33
|
+
/**
|
|
34
|
+
* Match a plugin entry against a set of canonical npm package names.
|
|
35
|
+
*
|
|
36
|
+
* A plugin entry can be:
|
|
37
|
+
* - "pkg-name"
|
|
38
|
+
* - "pkg-name@version"
|
|
39
|
+
* - "@scope/pkg-name"
|
|
40
|
+
* - "@scope/pkg-name@version"
|
|
41
|
+
* - "file://..." or other URL/path forms (never matched here)
|
|
42
|
+
*
|
|
43
|
+
* For the canonical-name path we only match the exact package name (with
|
|
44
|
+
* optional version suffix). file:// paths and forks with different
|
|
45
|
+
* package names are intentionally NOT matched — even if a path string
|
|
46
|
+
* happens to contain a substring like "oh-my-opencode" (e.g. forks like
|
|
47
|
+
* "oh-my-opencode-slim" published under a different package name).
|
|
48
|
+
*/
|
|
49
|
+
export declare function matchesPackageName(entry: string, canonicalNames: Set<string>): boolean;
|
|
50
|
+
/** Extract the package-name string from a plugin entry.
|
|
51
|
+
* OpenCode supports two forms:
|
|
52
|
+
* - plain string: "@scope/pkg@latest"
|
|
53
|
+
* - tuple [name, opts]: ["@scope/pkg@latest", { ... }]
|
|
54
|
+
* Returns null for any other shape (numbers, objects, etc.). */
|
|
55
|
+
export declare function extractPluginName(entry: unknown): string | null;
|
|
56
|
+
/**
|
|
57
|
+
* Canonical OMO npm package names. The plugin publishes under both names as
|
|
58
|
+
* a versioned alias (latest 3.17.5 on npm at time of writing).
|
|
59
|
+
*
|
|
60
|
+
* Forks under a different package name (e.g. `oh-my-opencode-slim`,
|
|
61
|
+
* `oh-my-opencode-cli`, etc.) are intentionally NOT matched here — they
|
|
62
|
+
* don't ship the `preemptive-compaction`, `context-window-monitor`, or
|
|
63
|
+
* `anthropic-context-window-limit-recovery` hooks that conflict with
|
|
64
|
+
* Magic Context. See https://github.com/cortexkit/magic-context/issues/43.
|
|
65
|
+
*
|
|
66
|
+
* The legacy `@code-yeongyu/` scope is no longer used — both names are
|
|
67
|
+
* unscoped on npm.
|
|
68
|
+
*/
|
|
69
|
+
export declare const OMO_PACKAGE_NAMES: Set<string>;
|
|
21
70
|
/**
|
|
22
71
|
* Generate a short conflict summary for ignored message display.
|
|
23
72
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conflict-detector.d.ts","sourceRoot":"","sources":["../../src/shared/conflict-detector.ts"],"names":[],"mappings":"AAiBA,MAAM,WAAW,cAAc;IAC3B,8CAA8C;IAC9C,WAAW,EAAE,OAAO,CAAC;IACrB,+CAA+C;IAC/C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,2DAA2D;IAC3D,SAAS,EAAE;QACP,cAAc,EAAE,OAAO,CAAC;QACxB,eAAe,EAAE,OAAO,CAAC;QACzB,SAAS,EAAE,OAAO,CAAC;QACnB,uBAAuB,EAAE,OAAO,CAAC;QACjC,uBAAuB,EAAE,OAAO,CAAC;QACjC,oBAAoB,EAAE,OAAO,CAAC;KACjC,CAAC;CACL;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,CAyDjE;
|
|
1
|
+
{"version":3,"file":"conflict-detector.d.ts","sourceRoot":"","sources":["../../src/shared/conflict-detector.ts"],"names":[],"mappings":"AAiBA,MAAM,WAAW,cAAc;IAC3B,8CAA8C;IAC9C,WAAW,EAAE,OAAO,CAAC;IACrB,+CAA+C;IAC/C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,2DAA2D;IAC3D,SAAS,EAAE;QACP,cAAc,EAAE,OAAO,CAAC;QACxB,eAAe,EAAE,OAAO,CAAC;QACzB,SAAS,EAAE,OAAO,CAAC;QACnB,uBAAuB,EAAE,OAAO,CAAC;QACjC,uBAAuB,EAAE,OAAO,CAAC;QACjC,oBAAoB,EAAE,OAAO,CAAC;KACjC,CAAC;CACL;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,CAyDjE;AA4ED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,aAAuC,CAAC;AAOtE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,OAAO,CAoBtF;AAED;;;;iEAIiE;AACjE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAI/D;AAwCD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iBAAiB,aAAiD,CAAC;AAoEhF;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAWlE"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ConflictResult } from "./conflict-detector";
|
|
2
2
|
export declare function fixConflicts(directory: string, conflicts: ConflictResult["conflicts"]): string[];
|
|
3
3
|
//# sourceMappingURL=conflict-fixer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conflict-fixer.d.ts","sourceRoot":"","sources":["../../src/shared/conflict-fixer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"conflict-fixer.d.ts","sourceRoot":"","sources":["../../src/shared/conflict-fixer.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,cAAc,EAItB,MAAM,qBAAqB,CAAC;AAqG7B,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,CAAC,WAAW,CAAC,GAAG,MAAM,EAAE,CA+GhG"}
|
|
@@ -1,4 +1,88 @@
|
|
|
1
|
+
import { type HarnessId } from "./harness";
|
|
1
2
|
export declare function getDataDir(): string;
|
|
3
|
+
/**
|
|
4
|
+
* Per-harness scratch directory under the OS temp dir.
|
|
5
|
+
*
|
|
6
|
+
* Layout:
|
|
7
|
+
* - OpenCode: `${os.tmpdir()}/opencode/magic-context/`
|
|
8
|
+
* - Pi: `${os.tmpdir()}/pi/magic-context/`
|
|
9
|
+
*
|
|
10
|
+
* Why a per-harness subtree of `os.tmpdir()`:
|
|
11
|
+
* 1. OpenCode Desktop runs as an Electron app with a permission sandbox.
|
|
12
|
+
* Writing to arbitrary tmp paths can trigger user-visible permission
|
|
13
|
+
* prompts; the `${tmpdir}/opencode/` subtree is allow-listed by
|
|
14
|
+
* OpenCode, so anything we put under it never asks for permission.
|
|
15
|
+
* 2. Splitting OpenCode from Pi keeps their logs and historian dump
|
|
16
|
+
* directories cleanly separated. `doctor --issue` for each harness
|
|
17
|
+
* reports diagnostics from the matching subtree, so an OpenCode
|
|
18
|
+
* issue report never includes Pi log noise (and vice versa).
|
|
19
|
+
* 3. Pi has no permission sandbox, so the path choice is purely
|
|
20
|
+
* cosmetic for Pi — it just keeps the layout symmetric.
|
|
21
|
+
*
|
|
22
|
+
* Pass an explicit `harness` only when the caller already knows the
|
|
23
|
+
* harness without relying on the global `setHarness()` state (e.g. the
|
|
24
|
+
* CLI's doctor commands, which target a specific harness regardless of
|
|
25
|
+
* which plugin is loaded). Production runtime callers should omit it so
|
|
26
|
+
* the helper picks up the boot-time harness automatically.
|
|
27
|
+
*/
|
|
28
|
+
export declare function getMagicContextTempDir(harness?: HarnessId): string;
|
|
29
|
+
/**
|
|
30
|
+
* Standard log file path the plugin writes to. Pi and OpenCode write to
|
|
31
|
+
* SEPARATE logs under their respective harness subtrees so a single
|
|
32
|
+
* machine running both harnesses doesn't interleave session traces.
|
|
33
|
+
*
|
|
34
|
+
* The plugin's buffered logger calls this on every flush rather than
|
|
35
|
+
* caching, so `setHarness("pi")` taking effect after module load is
|
|
36
|
+
* reflected in the next flush.
|
|
37
|
+
*/
|
|
38
|
+
export declare function getMagicContextLogPath(harness?: HarnessId): string;
|
|
39
|
+
/**
|
|
40
|
+
* Directory used for both historian validation-failure dumps and the
|
|
41
|
+
* existing-state offload XMLs that large historian/recomp passes write
|
|
42
|
+
* before invoking the model. Per-harness so dumps from different
|
|
43
|
+
* harnesses don't collide on filename and so `doctor --issue` for each
|
|
44
|
+
* harness reports only its own historian artifacts.
|
|
45
|
+
*/
|
|
46
|
+
export declare function getMagicContextHistorianDir(harness?: HarnessId): string;
|
|
47
|
+
/**
|
|
48
|
+
* Project-local magic-context artifact directory.
|
|
49
|
+
*
|
|
50
|
+
* Layout: `<project-directory>/.opencode/magic-context/`
|
|
51
|
+
*
|
|
52
|
+
* Used for artifacts that the historian/recomp pipeline writes during a run
|
|
53
|
+
* and that the model is asked to read via its native Read tool. OpenCode's
|
|
54
|
+
* `external_directory` permission system asks the user before reading any
|
|
55
|
+
* file outside the project directory or its worktree, which interrupts every
|
|
56
|
+
* historian run when artifacts live under `os.tmpdir()`. Writing under the
|
|
57
|
+
* project's own `.opencode/` subtree falls inside the project boundary and
|
|
58
|
+
* never triggers a permission prompt.
|
|
59
|
+
*
|
|
60
|
+
* The `.opencode/` parent dir is OpenCode's own per-project convention (used
|
|
61
|
+
* for project-local config, plans, dumps, plugin installs). Anchoring
|
|
62
|
+
* magic-context artifacts under `.opencode/magic-context/` keeps them
|
|
63
|
+
* co-located with related OpenCode metadata and makes them easy for users to
|
|
64
|
+
* locate when debugging.
|
|
65
|
+
*
|
|
66
|
+
* Logger does NOT use this — log files stay in the per-harness tmp subtree
|
|
67
|
+
* because they are written by the plugin process itself (no model-side Read
|
|
68
|
+
* tool call, no permission prompt) and span sessions/projects.
|
|
69
|
+
*/
|
|
70
|
+
export declare function getProjectMagicContextDir(directory: string): string;
|
|
71
|
+
/**
|
|
72
|
+
* Project-local historian artifact directory.
|
|
73
|
+
*
|
|
74
|
+
* Layout: `<project-directory>/.opencode/magic-context/historian/`
|
|
75
|
+
*
|
|
76
|
+
* Used for:
|
|
77
|
+
* - existing-state offload XMLs that long historian/recomp passes write
|
|
78
|
+
* before invoking the model (the model reads the file via Read tool)
|
|
79
|
+
* - validation-failure dump XMLs preserved for debugging
|
|
80
|
+
*
|
|
81
|
+
* Callers must `mkdirSync(dir, { recursive: true })` before writing — the
|
|
82
|
+
* `.opencode/` parent may not exist on a fresh project, and write failures
|
|
83
|
+
* here must degrade gracefully (e.g. historian falls back to inline state).
|
|
84
|
+
*/
|
|
85
|
+
export declare function getProjectMagicContextHistorianDir(directory: string): string;
|
|
2
86
|
export declare function getOpenCodeStorageDir(): string;
|
|
3
87
|
/**
|
|
4
88
|
* Resolve the shared magic-context storage directory.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-path.d.ts","sourceRoot":"","sources":["../../src/shared/data-path.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"data-path.d.ts","sourceRoot":"","sources":["../../src/shared/data-path.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAEvD,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,SAAwB,GAAG,MAAM,CAEhF;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,SAAwB,GAAG,MAAM,CAEhF;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,GAAE,SAAwB,GAAG,MAAM,CAErF;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kCAAkC,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAElD;AAED;;;;;;GAMG;AACH,wBAAgB,uCAAuC,IAAI,MAAM,CAEhE;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C"}
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC"}
|
package/dist/shared/logger.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export declare function log(message: string, data?: unknown): void;
|
|
2
2
|
export declare function sessionLog(sessionId: string, message: string, data?: unknown): void;
|
|
3
|
+
/**
|
|
4
|
+
* Resolve the current log file path. The path is harness-aware (see
|
|
5
|
+
* {@link getMagicContextLogPath}) and re-evaluated on every call, so callers
|
|
6
|
+
* who format diagnostic output with this value always see the path the next
|
|
7
|
+
* flush will actually use.
|
|
8
|
+
*/
|
|
3
9
|
export declare function getLogFilePath(): string;
|
|
4
10
|
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/shared/logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/shared/logger.ts"],"names":[],"mappings":"AAuDA,wBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAmBzD;AAED,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAEnF;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC"}
|
|
@@ -19,6 +19,29 @@ export interface PromptRetryOptions {
|
|
|
19
19
|
timeoutMs?: number;
|
|
20
20
|
/** External abort signal — cancels the in-flight LLM prompt immediately when aborted */
|
|
21
21
|
signal?: AbortSignal;
|
|
22
|
+
/**
|
|
23
|
+
* Ordered list of "provider/modelID" alternates to try if the primary call
|
|
24
|
+
* (and its single-suggestion retry) fails. Empty / undefined = no fallback
|
|
25
|
+
* iteration (legacy behavior).
|
|
26
|
+
*
|
|
27
|
+
* Fallback policy:
|
|
28
|
+
* - Each fallback gets the FULL `timeoutMs` budget (per-attempt, not total).
|
|
29
|
+
* - Suggestion-retry runs inside each attempt (so "did you mean X?" errors
|
|
30
|
+
* still self-heal at the primary AND at each fallback).
|
|
31
|
+
* - Iteration stops immediately on abort/timeout/context-overflow errors —
|
|
32
|
+
* fallbacks won't help and the caller's emergency-recovery path needs
|
|
33
|
+
* to handle these.
|
|
34
|
+
* - On all-failed, the LAST error is thrown (matches legacy behavior when
|
|
35
|
+
* `fallbackModels` is empty).
|
|
36
|
+
*/
|
|
37
|
+
fallbackModels?: readonly string[];
|
|
38
|
+
/**
|
|
39
|
+
* Identifier for structured logging (e.g. "dreamer:consolidate",
|
|
40
|
+
* "historian", "compressor", "sidekick"). Helps correlate fallback
|
|
41
|
+
* attempts to a specific call site in `magic-context.log`. Defaults to
|
|
42
|
+
* "subagent" if not provided.
|
|
43
|
+
*/
|
|
44
|
+
callContext?: string;
|
|
22
45
|
}
|
|
23
46
|
export interface ModelSuggestionInfo {
|
|
24
47
|
providerID: string;
|
|
@@ -26,6 +49,20 @@ export interface ModelSuggestionInfo {
|
|
|
26
49
|
suggestion: string;
|
|
27
50
|
}
|
|
28
51
|
export declare function parseModelSuggestion(error: unknown): ModelSuggestionInfo | null;
|
|
52
|
+
/**
|
|
53
|
+
* Run an OpenCode subagent prompt with model fallback support.
|
|
54
|
+
*
|
|
55
|
+
* Attempts the configured primary model first (whatever `args.body.model` or
|
|
56
|
+
* the registered agent default resolves to), then iterates through
|
|
57
|
+
* `options.fallbackModels` if provided. Each attempt internally retries once on
|
|
58
|
+
* the SDK's "model not found, did you mean X?" suggestion. Aborts, timeouts,
|
|
59
|
+
* and context-overflow errors short-circuit the fallback loop because retrying
|
|
60
|
+
* the same prompt against another model won't help.
|
|
61
|
+
*
|
|
62
|
+
* Behavior with `fallbackModels` empty/undefined is identical to the pre-v0.18
|
|
63
|
+
* single-suggestion retry — fully backward-compatible for callers that haven't
|
|
64
|
+
* been updated to thread a chain.
|
|
65
|
+
*/
|
|
29
66
|
export declare function promptSyncWithModelSuggestionRetry(client: Client, args: PromptArgs, options?: PromptRetryOptions): Promise<void>;
|
|
30
67
|
export {};
|
|
31
68
|
//# sourceMappingURL=model-suggestion-retry.d.ts.map
|
|
@@ -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;AAM7D,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEtD,KAAK,UAAU,GAAG;IACd,KAAK,CAAC,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAChD,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B,CAAC;AAEF,KAAK,UAAU,GAAG;IACd,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;AAEF,MAAM,WAAW,kBAAkB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wFAAwF;IACxF,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;;;;;;;;;;;OAcG;IACH,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACtB;AAiBD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,mBAAmB,GAAG,IAAI,CA4C/E;AAuID;;;;;;;;;;;;;GAaG;AACH,wBAAsB,kCAAkC,CACpD,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,UAAU,EAChB,OAAO,GAAE,kBAAuB,GACjC,OAAO,CAAC,IAAI,CAAC,CAgFf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models-dev-cache.d.ts","sourceRoot":"","sources":["../../src/shared/models-dev-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"models-dev-cache.d.ts","sourceRoot":"","sources":["../../src/shared/models-dev-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAUH,UAAU,kBAAkB;IACxB,MAAM,EAAE;QACJ,SAAS,EAAE,MAAM,OAAO,CAAC;YAAE,IAAI,CAAC,EAAE;gBAAE,SAAS,CAAC,EAAE,OAAO,CAAA;aAAE,CAAA;SAAE,CAAC,CAAC;KAChE,CAAC;CACL;AA2MD;;;;;;;;;;GAUG;AACH,wBAAsB,yBAAyB,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmEzF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAchG;AAED,4CAA4C;AAC5C,wBAAgB,mBAAmB,IAAI,IAAI,CAO1C;AAED,oDAAoD;AACpD,wBAAgB,sBAAsB,IAAI;IACtC,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACrB,CAOA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve the final fallback model list to attempt for an OpenCode subagent
|
|
3
|
+
* call.
|
|
4
|
+
*
|
|
5
|
+
* Policy (decided 2026-05-10):
|
|
6
|
+
* - If user configured explicit `fallback_models` in their magic-context.jsonc
|
|
7
|
+
* for this agent: use ONLY those. Respects user intent, no surprise
|
|
8
|
+
* providers.
|
|
9
|
+
* - If user did NOT configure any: fall back to the plugin's builtin
|
|
10
|
+
* provider-agnostic chain (`AGENT_MODEL_REQUIREMENTS`).
|
|
11
|
+
*
|
|
12
|
+
* The returned list does NOT include the primary model — it's the ordered
|
|
13
|
+
* list of *alternates* to try after the primary fails. Each entry is
|
|
14
|
+
* "provider/modelID" form.
|
|
15
|
+
*
|
|
16
|
+
* Duplicates and empty strings are filtered. Entries that don't match the
|
|
17
|
+
* "provider/modelID" shape (must contain a "/" with non-empty parts) are
|
|
18
|
+
* also dropped — defensive guard against malformed user config.
|
|
19
|
+
*/
|
|
20
|
+
export declare function resolveFallbackChain(agentName: string, userFallbacks: readonly string[] | string | undefined): string[];
|
|
21
|
+
/**
|
|
22
|
+
* Parse a "provider/modelID" string into the OpenCode `model` object shape.
|
|
23
|
+
* Returns null on invalid input.
|
|
24
|
+
*
|
|
25
|
+
* Note: only splits on the FIRST "/" — modelID can legitimately contain slashes
|
|
26
|
+
* (e.g. `lemonade/GLM-4.7-Flash-GGUF/main`).
|
|
27
|
+
*/
|
|
28
|
+
export declare function parseProviderModel(spec: string): {
|
|
29
|
+
providerID: string;
|
|
30
|
+
modelID: string;
|
|
31
|
+
} | null;
|
|
32
|
+
//# sourceMappingURL=resolve-fallbacks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-fallbacks.d.ts","sourceRoot":"","sources":["../../src/shared/resolve-fallbacks.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAChC,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,GACtD,MAAM,EAAE,CAUV;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"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare class MagicContextRpcClient {
|
|
2
2
|
private port;
|
|
3
|
-
private
|
|
3
|
+
private portDir;
|
|
4
|
+
private legacyPortFilePath;
|
|
4
5
|
private healthChecked;
|
|
5
6
|
constructor(storageDir: string, directory: string);
|
|
6
7
|
/** Call an RPC method. Retries port resolution if the server isn't ready yet. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-client.d.ts","sourceRoot":"","sources":["../../src/shared/rpc-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rpc-client.d.ts","sourceRoot":"","sources":["../../src/shared/rpc-client.ts"],"names":[],"mappings":"AAiBA,qBAAa,qBAAqB;IAC9B,OAAO,CAAC,IAAI,CAAuB;IACnC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,kBAAkB,CAAS;IACnC,OAAO,CAAC,aAAa,CAAS;gBAElB,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAKjD,iFAAiF;IAC3E,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,MAAM,EAAE,MAAM,EACd,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACrC,OAAO,CAAC,CAAC,CAAC;IAiDb,4CAA4C;IACtC,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;YASvB,WAAW;IAkCzB,OAAO,CAAC,YAAY;YA4BN,WAAW;YAWX,gBAAgB;IAU9B,KAAK,IAAI,IAAI;CAIhB"}
|
|
@@ -7,15 +7,16 @@
|
|
|
7
7
|
* because the server runs in a separate process from the TUI client.
|
|
8
8
|
*/
|
|
9
9
|
export interface RpcNotification {
|
|
10
|
+
id: number;
|
|
10
11
|
type: string;
|
|
11
12
|
payload: Record<string, unknown>;
|
|
12
13
|
sessionId?: string;
|
|
13
14
|
}
|
|
14
15
|
/** Push a notification for TUI to pick up via polling. */
|
|
15
16
|
export declare function pushNotification(type: string, payload: Record<string, unknown>, sessionId?: string): void;
|
|
16
|
-
/**
|
|
17
|
+
/** Return pending notifications after acking the client's last received id.
|
|
17
18
|
* Updates lastDrainAt so isTuiConnected() reflects recent activity. */
|
|
18
|
-
export declare function drainNotifications(): RpcNotification[];
|
|
19
|
+
export declare function drainNotifications(lastReceivedId?: number): RpcNotification[];
|
|
19
20
|
/** Whether a TUI client is actively polling for notifications.
|
|
20
21
|
* Returns true only if the TUI has drained within the last 3 seconds.
|
|
21
22
|
* This prevents stale-connected state after TUI closes or disconnects. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-notifications.d.ts","sourceRoot":"","sources":["../../src/shared/rpc-notifications.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;
|
|
1
|
+
{"version":3,"file":"rpc-notifications.d.ts","sourceRoot":"","sources":["../../src/shared/rpc-notifications.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAUD,0DAA0D;AAC1D,wBAAgB,gBAAgB,CAC5B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,SAAS,CAAC,EAAE,MAAM,GACnB,IAAI,CAMN;AAED;wEACwE;AACxE,wBAAgB,kBAAkB,CAAC,cAAc,SAAI,GAAG,eAAe,EAAE,CAMxE;AAED;;2EAE2E;AAC3E,wBAAgB,cAAc,IAAI,OAAO,CAExC"}
|
|
@@ -4,11 +4,14 @@ export declare class MagicContextRpcServer {
|
|
|
4
4
|
private port;
|
|
5
5
|
private handlers;
|
|
6
6
|
private portFilePath;
|
|
7
|
+
private portDir;
|
|
8
|
+
private startedAt;
|
|
7
9
|
constructor(storageDir: string, directory: string);
|
|
8
10
|
/** Register an RPC method handler. */
|
|
9
11
|
handle(method: string, handler: RpcHandler): void;
|
|
10
12
|
/** Start the server on a random port, write port to disk. */
|
|
11
13
|
start(): Promise<number>;
|
|
14
|
+
private warnIfOtherLiveInstance;
|
|
12
15
|
/** Stop the server and clean up port file. */
|
|
13
16
|
stop(): void;
|
|
14
17
|
private dispatch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-server.d.ts","sourceRoot":"","sources":["../../src/shared/rpc-server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rpc-server.d.ts","sourceRoot":"","sources":["../../src/shared/rpc-server.ts"],"names":[],"mappings":"AAaA,KAAK,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAExF,qBAAa,qBAAqB;IAC9B,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,IAAI,CAAK;IACjB,OAAO,CAAC,QAAQ,CAAiC;IACjD,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,SAAS,CAAc;gBAEnB,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAKjD,sCAAsC;IACtC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,IAAI;IAIjD,6DAA6D;IACvD,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC;IAkD9B,OAAO,CAAC,uBAAuB;IAgB/B,8CAA8C;IAC9C,IAAI,IAAI,IAAI;IAYZ,OAAO,CAAC,QAAQ;CA4DnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-types.d.ts","sourceRoot":"","sources":["../../src/shared/rpc-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,eAAe;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACz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AAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
+
export interface RpcPortFileRecord {
|
|
2
|
+
port: number;
|
|
3
|
+
pid: number;
|
|
4
|
+
started_at: number;
|
|
5
|
+
}
|
|
1
6
|
/**
|
|
2
7
|
* Stable hash for a project directory — scopes RPC port files per-project
|
|
3
8
|
* so multiple OpenCode instances don't collide.
|
|
4
9
|
*/
|
|
5
10
|
export declare function projectHash(directory: string): string;
|
|
6
|
-
/**
|
|
7
|
-
export declare function
|
|
11
|
+
/** Directory containing per-process RPC discovery files for a project. */
|
|
12
|
+
export declare function rpcPortDir(storageDir: string, directory: string): string;
|
|
13
|
+
/** Per-process RPC port file path. */
|
|
14
|
+
export declare function rpcPortFilePath(storageDir: string, directory: string, pid?: number): string;
|
|
15
|
+
/** Legacy single-port file used by v0.18.0 and earlier. */
|
|
16
|
+
export declare function legacyRpcPortFilePath(storageDir: string, directory: string): string;
|
|
17
|
+
export declare function isPidAlive(pid: number): boolean;
|
|
18
|
+
export declare function parseRpcPortFile(content: string, fallbackPid?: number): RpcPortFileRecord | null;
|
|
8
19
|
//# sourceMappingURL=rpc-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-utils.d.ts","sourceRoot":"","sources":["../../src/shared/rpc-utils.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED,sCAAsC;AACtC,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"rpc-utils.d.ts","sourceRoot":"","sources":["../../src/shared/rpc-utils.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED,0EAA0E;AAC1E,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAExE;AAED,sCAAsC;AACtC,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,SAAc,GAAG,MAAM,CAEhG;AAED,2DAA2D;AAC3D,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAEnF;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAQ/C;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,SAAI,GAAG,iBAAiB,GAAG,IAAI,CAwB3F"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Process-local deterministic JSON serialization for JSON-like plain
|
|
3
|
+
* objects. Keys are sorted by code-point order (NOT locale-sensitive).
|
|
4
|
+
*
|
|
5
|
+
* Contract:
|
|
6
|
+
* - Stable for plain objects, arrays, primitives, and `null`.
|
|
7
|
+
* - `undefined` serialized as the string "undefined".
|
|
8
|
+
* - Circular references serialized as the string `"[Circular]"`.
|
|
9
|
+
* - **NOT** a canonical cross-runtime / cross-locale JSON serializer.
|
|
10
|
+
* Two different runtimes that disagree on `JSON.stringify` of primitives
|
|
11
|
+
* (none known today) would produce different output.
|
|
12
|
+
*
|
|
13
|
+
* Used for:
|
|
14
|
+
* - `tool_definition_measurements` fingerprint hashing
|
|
15
|
+
* - `pending_compaction_marker_state` CAS comparison
|
|
16
|
+
*
|
|
17
|
+
* If a future use case needs true canonical JSON (e.g. cross-process
|
|
18
|
+
* signing), build a separate utility — do NOT widen this contract.
|
|
19
|
+
*/
|
|
20
|
+
export declare function stableStringify(value: unknown, seen?: WeakSet<object>): string;
|
|
21
|
+
//# sourceMappingURL=stable-json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stable-json.d.ts","sourceRoot":"","sources":["../../src/shared/stable-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,kBAAwB,GAAG,MAAM,CAiBpF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag-transcript.d.ts","sourceRoot":"","sources":["../../src/shared/tag-transcript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAGzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAM/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,KAAK,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAC;AAE/D,MAAM,WAAW,oBAAoB;IACjC;;;;;;;OAOG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACnC;AAyDD,wBAAgB,aAAa,CACzB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,eAAe,EACnB,OAAO,GAAE,oBAAyB,GACnC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"tag-transcript.d.ts","sourceRoot":"","sources":["../../src/shared/tag-transcript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAGzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAM/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,KAAK,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAC;AAE/D,MAAM,WAAW,oBAAoB;IACjC;;;;;;;OAOG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACnC;AAyDD,wBAAgB,aAAa,CACzB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,eAAe,EACnB,OAAO,GAAE,oBAAyB,GACnC,mBAAmB,CAqKrB"}
|
|
@@ -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;AAsBhE,OAAO,EAIH,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;AAsBhE,OAAO,EAIH,KAAK,iBAAiB,EACzB,MAAM,SAAS,CAAC;AA8djB,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAI5F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-db.d.ts","sourceRoot":"","sources":["../../../src/tui/data/context-db.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAA0B,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEpG,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"context-db.d.ts","sourceRoot":"","sources":["../../../src/tui/data/context-db.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAA0B,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEpG,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,CAAC;AAc9C,2DAA2D;AAC3D,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAGrD;AAED,+BAA+B;AAC/B,wBAAgB,QAAQ,IAAI,IAAI,CAI/B;AAsFD,sDAAsD;AACtD,wBAAsB,mBAAmB,CACrC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAClB,OAAO,CAAC,eAAe,CAAC,CA4B1B;AAED,wDAAwD;AACxD,wBAAsB,gBAAgB,CAClC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,YAAY,CAAC,CA4CvB;AAED,qCAAqC;AACrC,wBAAsB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQ5E;AAED,6CAA6C;AAC7C,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAQvE;AAED,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,yDAAyD;AACzD,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC,CAqBhE"}
|
package/package.json
CHANGED
|
@@ -179,7 +179,7 @@ function readUserCompaction(): { auto: boolean; prune: boolean; resolved: boolea
|
|
|
179
179
|
* forks/renames that don't ship the conflicting transform/system hooks are
|
|
180
180
|
* intentionally NOT matched.
|
|
181
181
|
*/
|
|
182
|
-
const DCP_PACKAGE_NAMES = new Set(["@tarquinen/opencode-dcp"]);
|
|
182
|
+
export const DCP_PACKAGE_NAMES = new Set(["@tarquinen/opencode-dcp"]);
|
|
183
183
|
|
|
184
184
|
function checkDcpPlugin(directory: string): boolean {
|
|
185
185
|
const plugins = collectPluginEntries(directory);
|
|
@@ -202,7 +202,7 @@ function checkDcpPlugin(directory: string): boolean {
|
|
|
202
202
|
* happens to contain a substring like "oh-my-opencode" (e.g. forks like
|
|
203
203
|
* "oh-my-opencode-slim" published under a different package name).
|
|
204
204
|
*/
|
|
205
|
-
function matchesPackageName(entry: string, canonicalNames: Set<string>): boolean {
|
|
205
|
+
export function matchesPackageName(entry: string, canonicalNames: Set<string>): boolean {
|
|
206
206
|
// Skip URL/path forms — only npm-style entries can be canonically matched.
|
|
207
207
|
// (Local file:// checkouts of canonical plugins are rare; users running
|
|
208
208
|
// those need to ensure the path itself doesn't match a fork's name.)
|
|
@@ -229,7 +229,7 @@ function matchesPackageName(entry: string, canonicalNames: Set<string>): boolean
|
|
|
229
229
|
* - plain string: "@scope/pkg@latest"
|
|
230
230
|
* - tuple [name, opts]: ["@scope/pkg@latest", { ... }]
|
|
231
231
|
* Returns null for any other shape (numbers, objects, etc.). */
|
|
232
|
-
function extractPluginName(entry:
|
|
232
|
+
export function extractPluginName(entry: unknown): string | null {
|
|
233
233
|
if (typeof entry === "string") return entry;
|
|
234
234
|
if (Array.isArray(entry) && typeof entry[0] === "string") return entry[0];
|
|
235
235
|
return null;
|
|
@@ -286,7 +286,7 @@ function collectPluginEntries(directory: string): string[] {
|
|
|
286
286
|
* The legacy `@code-yeongyu/` scope is no longer used — both names are
|
|
287
287
|
* unscoped on npm.
|
|
288
288
|
*/
|
|
289
|
-
const OMO_PACKAGE_NAMES = new Set(["oh-my-opencode", "oh-my-openagent"]);
|
|
289
|
+
export const OMO_PACKAGE_NAMES = new Set(["oh-my-opencode", "oh-my-openagent"]);
|
|
290
290
|
|
|
291
291
|
function checkOmoHooks(directory: string): {
|
|
292
292
|
preemptiveCompaction: boolean;
|