@cortexkit/opencode-magic-context 0.34.0 → 0.34.2
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 +20 -3
- package/dist/config/migrate-experimental.d.ts +2 -1
- package/dist/config/migrate-experimental.d.ts.map +1 -1
- package/dist/config/project-security.d.ts +2 -0
- package/dist/config/project-security.d.ts.map +1 -1
- package/dist/config/schema/magic-context.d.ts +8 -15
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/classify.d.ts +1 -0
- package/dist/features/magic-context/dreamer/classify.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/map-memories.d.ts +1 -0
- package/dist/features/magic-context/dreamer/map-memories.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/refresh-primers.d.ts +1 -0
- package/dist/features/magic-context/dreamer/refresh-primers.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/storage-dream-runs.d.ts +2 -0
- package/dist/features/magic-context/dreamer/storage-dream-runs.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/storage-task-schedule.d.ts +9 -5
- package/dist/features/magic-context/dreamer/storage-task-schedule.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-executor.d.ts +4 -1
- package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-gates.d.ts +19 -1
- package/dist/features/magic-context/dreamer/task-gates.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-registry.d.ts +28 -0
- package/dist/features/magic-context/dreamer/task-registry.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts +7 -1
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/verify-gate.d.ts +8 -2
- package/dist/features/magic-context/dreamer/verify-gate.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/verify.d.ts +3 -0
- package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -1
- package/dist/features/magic-context/fail-closed-block.d.ts +2 -0
- package/dist/features/magic-context/fail-closed-block.d.ts.map +1 -1
- package/dist/features/magic-context/memory/storage-memory.d.ts.map +1 -1
- package/dist/features/magic-context/migrations.d.ts +23 -1
- package/dist/features/magic-context/migrations.d.ts.map +1 -1
- package/dist/features/magic-context/mural/compress-cues.d.ts +8 -3
- package/dist/features/magic-context/mural/compress-cues.d.ts.map +1 -1
- package/dist/features/magic-context/mural/cue-validation.d.ts +7 -7
- package/dist/features/magic-context/mural/cue-validation.d.ts.map +1 -1
- package/dist/features/magic-context/mural/storage-mural-cues.d.ts +13 -3
- package/dist/features/magic-context/mural/storage-mural-cues.d.ts.map +1 -1
- package/dist/features/magic-context/storage-db.d.ts +24 -5
- package/dist/features/magic-context/storage-db.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +1 -0
- package/dist/features/magic-context/storage-meta-persisted.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/hooks/magic-context/command-handler.d.ts +1 -0
- package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-handler.d.ts +1 -0
- package/dist/hooks/magic-context/event-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/execute-status.d.ts +5 -1
- package/dist/hooks/magic-context/execute-status.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts +3 -5
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts +1 -1
- package/dist/hooks/magic-context/live-session-state.d.ts +3 -0
- package/dist/hooks/magic-context/live-session-state.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-mode-transform.d.ts +16 -0
- package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-context-state.d.ts +1 -0
- package/dist/hooks/magic-context/transform-context-state.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +1 -1
- package/dist/hooks/magic-context/transform.d.ts +3 -2
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-56yjaeb2.js → index-2y0ybv5x.js} +11 -1
- package/dist/{index-s0mdn690.js → index-z70pxrq1.js} +232 -49
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +599 -131
- package/dist/plugin/dream-timer.d.ts +4 -2
- package/dist/plugin/dream-timer.d.ts.map +1 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts +1 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/{recomp-orchestrator-8e82vmvb.js → recomp-orchestrator-6cd3nrt7.js} +1 -1
- package/dist/shared/rpc-types.d.ts +5 -0
- package/dist/shared/rpc-types.d.ts.map +1 -1
- package/dist/shared/rpc-utils.d.ts +19 -0
- package/dist/shared/rpc-utils.d.ts.map +1 -1
- package/dist/shared/tui-runtime-specifiers.d.ts +20 -0
- package/dist/shared/tui-runtime-specifiers.d.ts.map +1 -0
- package/dist/{task-config-5nx3qfz8.js → task-config-gbp7r23g.js} +1 -1
- package/package.json +2 -2
- package/src/config/index.test.ts +32 -0
- package/src/config/migrate-experimental.test.ts +41 -0
- package/src/config/migrate-experimental.ts +36 -10
- package/src/config/project-security.test.ts +22 -0
- package/src/config/project-security.ts +23 -0
- package/src/config/schema/magic-context.test.ts +2 -1
- package/src/config/schema/magic-context.ts +12 -23
- package/src/features/magic-context/dreamer/task-registry.ts +47 -0
- package/src/shared/rpc-types.ts +9 -0
- package/src/shared/rpc-utils.test.ts +157 -0
- package/src/shared/rpc-utils.ts +137 -0
- package/src/shared/tui-runtime-specifiers.ts +32 -0
- package/src/tui/slots/sidebar-content.tsx +50 -8
- package/src/tui/tui-compiled-runtime-imports.test.ts +151 -0
- package/src/tui-compiled/slots/sidebar-content.tsx +234 -145
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { DreamerConfig } from "../config/schema/magic-context";
|
|
2
2
|
import type { ClassifyModuleClient } from "../features/magic-context/dreamer/classify";
|
|
3
3
|
import { type RetrospectiveRawProvider } from "../features/magic-context/dreamer/retrospective-raw-provider";
|
|
4
|
+
import type { DreamTaskName, DreamTaskProgress } from "../features/magic-context/dreamer/task-registry";
|
|
4
5
|
import type { RawMessageProvider } from "../hooks/magic-context/read-session-chunk";
|
|
5
6
|
import type { Database } from "../shared/sqlite";
|
|
6
7
|
import type { PluginContext } from "./types";
|
|
@@ -8,7 +9,7 @@ import type { PluginContext } from "./types";
|
|
|
8
9
|
* Per-project work registered with the timer. The timer is a process-wide
|
|
9
10
|
* singleton, but Desktop OpenCode can load the same plugin once per project
|
|
10
11
|
* within one process — every load needs its directory's git commits indexed,
|
|
11
|
-
* its dream schedule checked, and its
|
|
12
|
+
* its dream schedule checked, and its config respected.
|
|
12
13
|
*/
|
|
13
14
|
interface ProjectRegistration {
|
|
14
15
|
directory: string;
|
|
@@ -23,7 +24,7 @@ interface ProjectRegistration {
|
|
|
23
24
|
};
|
|
24
25
|
memoryEnabled?: boolean;
|
|
25
26
|
memoryInjectionBudgetTokens?: number;
|
|
26
|
-
|
|
27
|
+
mural?: {
|
|
27
28
|
enabled: boolean;
|
|
28
29
|
model?: string;
|
|
29
30
|
};
|
|
@@ -47,6 +48,7 @@ interface ProjectRegistration {
|
|
|
47
48
|
*/
|
|
48
49
|
primerRawProviderFactory?: (sessionId: string) => Promise<RawMessageProvider | null> | RawMessageProvider | null;
|
|
49
50
|
transformMode?: "ts" | "rust";
|
|
51
|
+
onDreamerProgress?: (progress: DreamTaskProgress | null, completedTask?: DreamTaskName) => void;
|
|
50
52
|
moduleClient?: ClassifyModuleClient & {
|
|
51
53
|
authorityStatus?: (args: {
|
|
52
54
|
context_store_uuid: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dream-timer.d.ts","sourceRoot":"","sources":["../../src/plugin/dream-timer.ts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|
26
26
|
enabled: boolean;
|
|
27
27
|
allow_home_project: boolean;
|
|
28
|
-
|
|
28
|
+
mural: import("../../config/schema/magic-context").MuralConfig;
|
|
29
29
|
transform_mode: "ts" | "rust";
|
|
30
30
|
auto_update?: boolean;
|
|
31
31
|
language?: string;
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;
|
|
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;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;CAC/C;;;;;;;;;qBAkE4zI,CAAC;;;;;;;;;;;;qBAA38C,CAAC;mBAAyB,CAAC;iBAAuB,CAAC;iBAAuB,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;0BAAutwD,CAAC;;;;;;;;;EArCtr2D;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;CAC/C;;;;;;;;;qBA8B4zI,CAAC;;;;;;;;;;;;qBAA38C,CAAC;mBAAyB,CAAC;iBAAuB,CAAC;iBAAuB,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;0BAAutwD,CAAC;;;;;;;;;GADtr2D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-handlers.d.ts","sourceRoot":"","sources":["../../src/plugin/rpc-handlers.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"rpc-handlers.d.ts","sourceRoot":"","sources":["../../src/plugin/rpc-handlers.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAWzE,OAAO,EACH,KAAK,eAAe,IAAI,QAAQ,EAGnC,MAAM,mCAAmC,CAAC;AAkB3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAQlF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAA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,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"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Shared types for RPC between server and TUI plugins.
|
|
3
3
|
* Both sides import these — no SQLite dependency.
|
|
4
4
|
*/
|
|
5
|
+
import type { DreamTaskBacklogMap, DreamTaskProgress } from "../features/magic-context/dreamer/task-registry";
|
|
5
6
|
export interface SidebarSnapshot {
|
|
6
7
|
sessionId: string;
|
|
7
8
|
usagePercentage: number;
|
|
@@ -100,6 +101,10 @@ export interface SidebarSnapshot {
|
|
|
100
101
|
* sidebar "Recomp"/"Upgrade" progress bar and the /ctx-status dialog. Mirrors
|
|
101
102
|
* the runtime `RecompProgress` shape from compartment-runner-types.ts.
|
|
102
103
|
*/
|
|
104
|
+
/** Read-only per-task candidate counts; populated by the server RPC. */
|
|
105
|
+
dreamerBacklog?: DreamTaskBacklogMap;
|
|
106
|
+
/** Process-local task progress; absent when no Dreamer task is running. */
|
|
107
|
+
dreamerProgress?: DreamTaskProgress | null;
|
|
103
108
|
recompProgress?: {
|
|
104
109
|
/** "recomp" → "Recomp" labels; "upgrade" → "Upgrade" labels. */
|
|
105
110
|
kind?: "recomp" | "upgrade" | "embed" | "wrapup";
|
|
@@ -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,YAAY,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,+BAA+B,CAAC,EAAE,MAAM,CAAC;IACzC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,oFAAoF;IACpF,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,8EAA8E;IAC9E,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,aAA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;IACnD;;;;;;;OAOG;IACH,gBAAgB,EAAE;QACd;;;;;WAKG;QACH,yBAAyB,EAAE,MAAM,GAAG,IAAI,CAAC;QACzC,oEAAoE;QACpE,wBAAwB,EAAE,MAAM,CAAC;KACpC,CAAC;CACL;AAED,uFAAuF;AACvF,MAAM,WAAW,WAAW;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C,QAAQ,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C,OAAO,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,OAAO,CAAA;KAAE,CAAC;IAClE,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,sBAAsB;IACnC,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"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
1
3
|
export interface RpcPortFileRecord {
|
|
2
4
|
port: number;
|
|
3
5
|
pid: number;
|
|
@@ -26,5 +28,22 @@ export declare function rpcPortFilePath(storageDir: string, directory: string, p
|
|
|
26
28
|
/** Legacy single-port file used by v0.18.0 and earlier. */
|
|
27
29
|
export declare function legacyRpcPortFilePath(storageDir: string, directory: string): string;
|
|
28
30
|
export declare function isPidAlive(pid: number): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Verify that a live PID still belongs to the process that wrote a port record.
|
|
33
|
+
*
|
|
34
|
+
* A PID can be reused after its original process exits. On Linux, procfs gives
|
|
35
|
+
* us a process start time without spawning a helper; other platforms use `ps`
|
|
36
|
+
* only on this cold database-open guard path. Legacy records without a start
|
|
37
|
+
* time use a weaker command-name check, and every probe failure stays live so
|
|
38
|
+
* this identity check cannot weaken the migration guard on uncertainty.
|
|
39
|
+
*/
|
|
40
|
+
export declare function isPidIdentityPlausible(record: RpcPortFileRecord): boolean;
|
|
41
|
+
export declare function __setRpcIdentityTestHooks(hooks: {
|
|
42
|
+
readFileSync?: typeof readFileSync;
|
|
43
|
+
execFileSync?: typeof execFileSync;
|
|
44
|
+
platform?: NodeJS.Platform;
|
|
45
|
+
nowMs?: () => number;
|
|
46
|
+
}): void;
|
|
47
|
+
export declare function __resetRpcIdentityTestHooks(): void;
|
|
29
48
|
export declare function parseRpcPortFile(content: string, fallbackPid?: number): RpcPortFileRecord | null;
|
|
30
49
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"rpc-utils.d.ts","sourceRoot":"","sources":["../../src/shared/rpc-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wFAAwF;IACxF,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;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,CAC3B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,GAAG,SAAc,EACjB,UAAU,CAAC,EAAE,MAAM,GACpB,MAAM,CAGR;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;AAyFD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAkBzE;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE;IAC7C,YAAY,CAAC,EAAE,OAAO,YAAY,CAAC;IACnC,YAAY,CAAC,EAAE,OAAO,YAAY,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,MAAM,CAAC;CACxB,GAAG,IAAI,CAKP;AAED,wBAAgB,2BAA2B,IAAI,IAAI,CAKlD;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,SAAI,GAAG,iBAAiB,GAAG,IAAI,CA2B3F"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The module specifiers the compiled TUI is allowed to resolve through OpenCode's
|
|
3
|
+
* process-wide OpenTUI runtime registry (`opentui:runtime-module:<encoded>`).
|
|
4
|
+
*
|
|
5
|
+
* Single source of truth, shared by `scripts/build-tui.ts` (which rewrites these
|
|
6
|
+
* specifiers during the Solid transform) and
|
|
7
|
+
* `src/tui/tui-compiled-runtime-imports.test.ts` (which verifies every emitted
|
|
8
|
+
* specifier names a real export). Keeping one list means the guard test cannot
|
|
9
|
+
* drift into skipping a specifier the build actually rewrites — a skipped
|
|
10
|
+
* specifier is exactly the silent hole the test exists to close.
|
|
11
|
+
*
|
|
12
|
+
* Lives in `src/shared/` rather than `src/tui/` on purpose: `build-tui.ts` copies
|
|
13
|
+
* every file under `src/tui/` into the shipped `src/tui-compiled/` bundle, and
|
|
14
|
+
* this list is build/test tooling that the runtime bundle must not carry.
|
|
15
|
+
*/
|
|
16
|
+
export declare const TUI_RUNTIME_SPECIFIERS: readonly ["@opentui/core", "@opentui/core/testing", "@opentui/solid", "@opentui/solid/components", "@opentui/solid/jsx-runtime", "@opentui/solid/jsx-dev-runtime", "solid-js", "solid-js/store"];
|
|
17
|
+
export type TuiRuntimeSpecifier = (typeof TUI_RUNTIME_SPECIFIERS)[number];
|
|
18
|
+
/** Virtual module id OpenCode registers for a runtime specifier. */
|
|
19
|
+
export declare function runtimeModuleId(specifier: string): string;
|
|
20
|
+
//# sourceMappingURL=tui-runtime-specifiers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tui-runtime-specifiers.d.ts","sourceRoot":"","sources":["../../src/shared/tui-runtime-specifiers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,sBAAsB,kMASzB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E,oEAAoE;AACpE,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEzD"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/opencode-magic-context",
|
|
3
|
-
"version": "0.34.
|
|
3
|
+
"version": "0.34.2",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "OpenCode plugin for Magic Context
|
|
5
|
+
"description": "OpenCode plugin for Magic Context — cross-session memory and context management",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"author": "ualtinok",
|
package/src/config/index.test.ts
CHANGED
|
@@ -109,6 +109,38 @@ function loadWithUserAndProjectConfig(
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
+
describe("loadPluginConfig — graduated mural config", () => {
|
|
113
|
+
it("adopts legacy experimental.mural at the top-level and warns once", () => {
|
|
114
|
+
const result = loadWithUserConfig(
|
|
115
|
+
JSON.stringify({
|
|
116
|
+
experimental: { mural: { enabled: true, model: "provider/cue-model" } },
|
|
117
|
+
}),
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
expect(result.mural).toEqual({ enabled: true, model: "provider/cue-model" });
|
|
121
|
+
expect((result as Record<string, unknown>).experimental).toBeUndefined();
|
|
122
|
+
expect(
|
|
123
|
+
result.configWarnings?.some((warning) =>
|
|
124
|
+
warning.includes('Deprecated "experimental.mural"; use top-level "mural" instead'),
|
|
125
|
+
),
|
|
126
|
+
).toBe(true);
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it("keeps the top-level mural values when both spellings exist", () => {
|
|
130
|
+
const result = loadWithUserConfig(
|
|
131
|
+
JSON.stringify({
|
|
132
|
+
mural: { enabled: false, model: "provider/new-model" },
|
|
133
|
+
experimental: { mural: { enabled: true, model: "provider/old-model" } },
|
|
134
|
+
}),
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
expect(result.mural).toEqual({ enabled: false, model: "provider/new-model" });
|
|
138
|
+
expect(result.configWarnings ?? []).not.toContain(
|
|
139
|
+
expect.stringContaining('Deprecated "experimental.mural"'),
|
|
140
|
+
);
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
|
|
112
144
|
describe("loadPluginConfig — transform mode resolution", () => {
|
|
113
145
|
it("downgrades rust when compaction is off and emits one boot warning", () => {
|
|
114
146
|
const result = loadWithUserConfig(
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { describe, expect, it } from "bun:test";
|
|
2
|
+
|
|
3
|
+
import { migrateLegacyExperimental } from "./migrate-experimental";
|
|
4
|
+
|
|
5
|
+
describe("migrateLegacyExperimental — mural", () => {
|
|
6
|
+
it("moves a legacy mural object and emits a deprecation warning", () => {
|
|
7
|
+
const warnings: string[] = [];
|
|
8
|
+
const migrated = migrateLegacyExperimental(
|
|
9
|
+
{ experimental: { mural: { enabled: true, model: "provider/cues" } } },
|
|
10
|
+
warnings,
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
expect(migrated).toMatchObject({ mural: { enabled: true, model: "provider/cues" } });
|
|
14
|
+
expect((migrated.experimental as Record<string, unknown>).mural).toBeUndefined();
|
|
15
|
+
expect(warnings).toEqual([
|
|
16
|
+
'Deprecated "experimental.mural"; use top-level "mural" instead (migrated in memory; run `doctor` to persist).',
|
|
17
|
+
]);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("preserves explicit top-level values when both spellings exist", () => {
|
|
21
|
+
const warnings: string[] = [];
|
|
22
|
+
const migrated = migrateLegacyExperimental(
|
|
23
|
+
{
|
|
24
|
+
mural: { enabled: false, model: "provider/new" },
|
|
25
|
+
experimental: { mural: { enabled: true, model: "provider/old" } },
|
|
26
|
+
},
|
|
27
|
+
warnings,
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
expect(migrated.mural).toEqual({ enabled: false, model: "provider/new" });
|
|
31
|
+
expect(warnings).toHaveLength(0);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("coerces a legacy boolean mural into the block shape", () => {
|
|
35
|
+
const warnings: string[] = [];
|
|
36
|
+
const migrated = migrateLegacyExperimental({ experimental: { mural: true } }, warnings);
|
|
37
|
+
|
|
38
|
+
expect(migrated.mural).toEqual({ enabled: true });
|
|
39
|
+
expect(warnings[0]).toContain('use top-level "mural"');
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* `dreamer.user_memories` / `dreamer.pin_key_files`.
|
|
7
7
|
* - this release: `experimental.temporal_awareness` / `caveman_text_compression`
|
|
8
8
|
* → top-level keys; `experimental.auto_search` / `git_commit_indexing` →
|
|
9
|
-
* `memory.auto_search` / `memory.git_commit_indexing
|
|
9
|
+
* `memory.auto_search` / `memory.git_commit_indexing`; and
|
|
10
|
+
* `experimental.mural` → top-level `mural`.
|
|
10
11
|
*
|
|
11
12
|
* Doctor runs an on-disk migration, but users who never run doctor would
|
|
12
13
|
* otherwise lose their opt-in/opt-out because the graduated keys are no longer
|
|
@@ -36,13 +37,16 @@ export function migrateLegacyExperimental(
|
|
|
36
37
|
const exp = experimental as Record<string, unknown>;
|
|
37
38
|
const hasUM = "user_memories" in exp;
|
|
38
39
|
const hasPKF = "pin_key_files" in exp;
|
|
40
|
+
const hasMural = "mural" in exp;
|
|
39
41
|
// Graduated out of the (now retired) `experimental.*` namespace.
|
|
40
42
|
// - temporal_awareness / caveman_text_compression → top-level config keys.
|
|
41
43
|
// - auto_search / git_commit_indexing → under `memory.*` (recall features).
|
|
42
44
|
const TOP_LEVEL_GRADUATED = ["temporal_awareness", "caveman_text_compression"] as const;
|
|
43
45
|
const MEMORY_GRADUATED = ["auto_search", "git_commit_indexing"] as const;
|
|
44
46
|
const hasGraduated =
|
|
45
|
-
TOP_LEVEL_GRADUATED.some((k) => k in exp) ||
|
|
47
|
+
TOP_LEVEL_GRADUATED.some((k) => k in exp) ||
|
|
48
|
+
MEMORY_GRADUATED.some((k) => k in exp) ||
|
|
49
|
+
hasMural;
|
|
46
50
|
if (!hasUM && !hasPKF && !hasGraduated) {
|
|
47
51
|
return rawConfig;
|
|
48
52
|
}
|
|
@@ -59,6 +63,16 @@ export function migrateLegacyExperimental(
|
|
|
59
63
|
: ({} as Record<string, unknown>);
|
|
60
64
|
const newExperimental = { ...exp };
|
|
61
65
|
|
|
66
|
+
const coerceToObject = (value: unknown): Record<string, unknown> | undefined => {
|
|
67
|
+
if (typeof value === "boolean") {
|
|
68
|
+
return { enabled: value };
|
|
69
|
+
}
|
|
70
|
+
if (typeof value === "object" && value !== null) {
|
|
71
|
+
return { ...(value as Record<string, unknown>) };
|
|
72
|
+
}
|
|
73
|
+
return undefined;
|
|
74
|
+
};
|
|
75
|
+
|
|
62
76
|
// Relocate a graduated flag from experimental.* to its new home. The
|
|
63
77
|
// destination value wins when both exist (the user already graduated); for
|
|
64
78
|
// object-shaped flags we merge sub-fields so partial destination settings
|
|
@@ -90,15 +104,27 @@ export function migrateLegacyExperimental(
|
|
|
90
104
|
for (const key of TOP_LEVEL_GRADUATED) relocate(key, patched, "");
|
|
91
105
|
for (const key of MEMORY_GRADUATED) relocate(key, memory, "memory.");
|
|
92
106
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
107
|
+
if (hasMural) {
|
|
108
|
+
const oldMural = coerceToObject(exp.mural);
|
|
109
|
+
const existingMural = patched.mural;
|
|
110
|
+
if (existingMural === undefined) {
|
|
111
|
+
patched.mural = oldMural ?? exp.mural;
|
|
112
|
+
warnings.push(
|
|
113
|
+
'Deprecated "experimental.mural"; use top-level "mural" instead (migrated in memory; run `doctor` to persist).',
|
|
114
|
+
);
|
|
115
|
+
} else if (
|
|
116
|
+
oldMural !== undefined &&
|
|
117
|
+
typeof existingMural === "object" &&
|
|
118
|
+
existingMural !== null &&
|
|
119
|
+
!Array.isArray(existingMural)
|
|
120
|
+
) {
|
|
121
|
+
patched.mural = {
|
|
122
|
+
...oldMural,
|
|
123
|
+
...(existingMural as Record<string, unknown>),
|
|
124
|
+
};
|
|
99
125
|
}
|
|
100
|
-
|
|
101
|
-
}
|
|
126
|
+
delete newExperimental.mural;
|
|
127
|
+
}
|
|
102
128
|
|
|
103
129
|
if (hasUM) {
|
|
104
130
|
const oldUM = coerceToObject(exp.user_memories);
|
|
@@ -150,6 +150,28 @@ describe("stripUnsafeProjectConfigFields", () => {
|
|
|
150
150
|
expect(warnings.some((w) => w.includes("historian.model/fallback_models"))).toBe(true);
|
|
151
151
|
});
|
|
152
152
|
|
|
153
|
+
it("strips mural.model from project config but keeps the feature switch", () => {
|
|
154
|
+
const raw: Record<string, unknown> = {
|
|
155
|
+
mural: { enabled: true, model: "repo-controlled-model" },
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
const warnings = stripUnsafeProjectConfigFields(raw);
|
|
159
|
+
|
|
160
|
+
expect(raw.mural).toEqual({ enabled: true });
|
|
161
|
+
expect(warnings.some((w) => w.includes("mural.model"))).toBe(true);
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
it("strips the legacy experimental mural model before migration", () => {
|
|
165
|
+
const raw: Record<string, unknown> = {
|
|
166
|
+
experimental: { mural: { enabled: true, model: "repo-controlled-model" } },
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
const warnings = stripUnsafeProjectConfigFields(raw);
|
|
170
|
+
|
|
171
|
+
expect(raw.experimental).toEqual({ mural: { enabled: true } });
|
|
172
|
+
expect(warnings.some((w) => w.includes("experimental.mural.model"))).toBe(true);
|
|
173
|
+
});
|
|
174
|
+
|
|
153
175
|
it("strips hidden-agent prompt/permission/tools but keeps benign fields", () => {
|
|
154
176
|
const raw: Record<string, unknown> = {
|
|
155
177
|
dreamer: {
|
|
@@ -213,6 +213,8 @@ function makeProjectThresholdWarning(field: string, reason: string): string {
|
|
|
213
213
|
* requires trusted user-level `subc` configuration before Rust can activate.
|
|
214
214
|
* - `historian.model` / `historian.fallback_models` — historian model spend is
|
|
215
215
|
* user-level only; a cloned repo cannot force extra compaction cost.
|
|
216
|
+
* - `mural.model` — mural cue-compressor model selection is user-level only;
|
|
217
|
+
* a cloned repo cannot choose a model that sends project memory to a provider.
|
|
216
218
|
* - `pi.subagent_extensions` — a cloned repo must not choose which extensions
|
|
217
219
|
* the user's Pi child processes load.
|
|
218
220
|
* - hidden-agent `prompt`/`permission`/`tools` — a repo must not reprogram or
|
|
@@ -339,6 +341,27 @@ export function stripUnsafeProjectConfigFields(projectRaw: Record<string, unknow
|
|
|
339
341
|
}
|
|
340
342
|
}
|
|
341
343
|
|
|
344
|
+
const mural = projectRaw.mural;
|
|
345
|
+
if (isPlainObject(mural) && "model" in mural) {
|
|
346
|
+
delete mural.model;
|
|
347
|
+
warnings.push(
|
|
348
|
+
"Ignoring mural.model from project config (security: the mural cue-compressor model is a user-level setting; a repository cannot choose where project memory is sent).",
|
|
349
|
+
);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
// Keep the same trust boundary while accepting the pre-graduation spelling.
|
|
353
|
+
// This must run before the in-memory migration moves experimental.mural.model
|
|
354
|
+
// to mural.model, otherwise an untrusted project could bypass the user-only
|
|
355
|
+
// model check.
|
|
356
|
+
const experimental = projectRaw.experimental;
|
|
357
|
+
const legacyMural = isPlainObject(experimental) ? experimental.mural : undefined;
|
|
358
|
+
if (isPlainObject(legacyMural) && "model" in legacyMural) {
|
|
359
|
+
delete legacyMural.model;
|
|
360
|
+
warnings.push(
|
|
361
|
+
"Ignoring experimental.mural.model from project config (security: the mural cue-compressor model is a user-level setting; use user-level mural.model).",
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
|
|
342
365
|
for (const agentKey of HIDDEN_AGENT_KEYS) {
|
|
343
366
|
const block = projectRaw[agentKey];
|
|
344
367
|
if (!isPlainObject(block)) continue;
|
|
@@ -43,6 +43,7 @@ describe("MagicContextConfigSchema", () => {
|
|
|
43
43
|
expect(result.dreamer).toBeUndefined();
|
|
44
44
|
expect(result.sidekick).toBeUndefined();
|
|
45
45
|
expect(result.pi).toBeUndefined();
|
|
46
|
+
expect(result.mural).toEqual({ enabled: false });
|
|
46
47
|
});
|
|
47
48
|
});
|
|
48
49
|
|
|
@@ -73,7 +74,7 @@ describe("MagicContextConfigSchema", () => {
|
|
|
73
74
|
enabled: true,
|
|
74
75
|
allow_home_project: false,
|
|
75
76
|
fail_closed_blocking: true,
|
|
76
|
-
|
|
77
|
+
mural: { enabled: false },
|
|
77
78
|
transform_mode: "ts",
|
|
78
79
|
auto_update: false,
|
|
79
80
|
toast_duration_ms: 5000,
|
|
@@ -394,22 +394,18 @@ export interface ShadowEmbeddingConfig {
|
|
|
394
394
|
enabled: boolean;
|
|
395
395
|
}
|
|
396
396
|
|
|
397
|
-
export interface
|
|
397
|
+
export interface MuralConfig {
|
|
398
398
|
enabled: boolean;
|
|
399
399
|
/** The CUE COMPRESSOR model for the compress-cues dreamer task (the mural is
|
|
400
400
|
* now rendered deterministically, so this no longer names an author model). */
|
|
401
401
|
model?: string;
|
|
402
402
|
}
|
|
403
403
|
|
|
404
|
-
export interface ExperimentalConfig {
|
|
405
|
-
mural: ExperimentalMuralConfig;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
404
|
export interface MagicContextConfig {
|
|
409
405
|
enabled: boolean;
|
|
410
406
|
/** User-level setting that lets a session started exactly in the canonical home directory use a deterministic directory identity. */
|
|
411
407
|
allow_home_project: boolean;
|
|
412
|
-
|
|
408
|
+
mural: MuralConfig;
|
|
413
409
|
/** Selects the runtime implementation for this project. Rust mode is experimental and requires user-level subc configuration. */
|
|
414
410
|
transform_mode: "ts" | "rust";
|
|
415
411
|
/** Auto-update the cached OpenCode plugin wrapper when a newer npm version is available.
|
|
@@ -581,28 +577,21 @@ export const MagicContextConfigSchema = z
|
|
|
581
577
|
.describe(
|
|
582
578
|
"Allow Magic Context sessions launched from the exact canonical home directory. The home session uses its deterministic dir: identity so pre-gate memories reconnect. USER-LEVEL ONLY: project config is ignored. The home identity is excluded from registry seed exports, never resolves descendants by containment, and cannot join a workspace.",
|
|
583
579
|
),
|
|
584
|
-
|
|
580
|
+
mural: z
|
|
585
581
|
.object({
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
.min(1)
|
|
593
|
-
.optional()
|
|
594
|
-
.describe(
|
|
595
|
-
"Model for the compress-cues task that compresses each memory into a mural cue. The mural image itself is rendered deterministically (no author model).",
|
|
596
|
-
),
|
|
597
|
-
})
|
|
598
|
-
.default({ enabled: false })
|
|
582
|
+
enabled: z.boolean().default(false),
|
|
583
|
+
model: z
|
|
584
|
+
.string()
|
|
585
|
+
.trim()
|
|
586
|
+
.min(1)
|
|
587
|
+
.optional()
|
|
599
588
|
.describe(
|
|
600
|
-
"
|
|
589
|
+
"Model for the compress-cues task that compresses each memory into a mural cue. The mural image itself is rendered deterministically (no author model).",
|
|
601
590
|
),
|
|
602
591
|
})
|
|
603
|
-
.default({
|
|
592
|
+
.default({ enabled: false })
|
|
604
593
|
.describe(
|
|
605
|
-
"Experimental
|
|
594
|
+
"Experimental mural: a single deterministically-rendered image of project memories that did not fit the context budget. Cues are compressed per-memory by the compress-cues dreamer task.",
|
|
606
595
|
),
|
|
607
596
|
transform_mode: z
|
|
608
597
|
.enum(["ts", "rust"])
|
|
@@ -27,6 +27,53 @@ export const CANONICAL_DREAM_TASKS = [
|
|
|
27
27
|
|
|
28
28
|
export type DreamTaskName = (typeof CANONICAL_DREAM_TASKS)[number];
|
|
29
29
|
|
|
30
|
+
/** Cheap, read-only work counts for one Dreamer task. */
|
|
31
|
+
export interface DreamTaskBacklog {
|
|
32
|
+
/** Items selected by the task's current backlog predicate. */
|
|
33
|
+
pending: number;
|
|
34
|
+
/** Total items in the task's candidate pool. */
|
|
35
|
+
total: number;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Backlog counts keyed by canonical task name. */
|
|
39
|
+
export type DreamTaskBacklogMap = Partial<Record<DreamTaskName, DreamTaskBacklog>>;
|
|
40
|
+
|
|
41
|
+
/** Stable human-readable rendering shared by /ctx-dream and status surfaces. */
|
|
42
|
+
export function formatDreamTaskBacklogs(
|
|
43
|
+
backlogs: DreamTaskBacklogMap,
|
|
44
|
+
tasks: readonly DreamTaskName[] = CANONICAL_DREAM_TASKS,
|
|
45
|
+
): string {
|
|
46
|
+
return tasks
|
|
47
|
+
.filter((task) => backlogs[task] !== undefined)
|
|
48
|
+
.map((task) => {
|
|
49
|
+
const backlog = backlogs[task];
|
|
50
|
+
return `- ${task}: ${backlog?.pending ?? 0} pending / ${backlog?.total ?? 0} total`;
|
|
51
|
+
})
|
|
52
|
+
.join("\n");
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Process-local progress for the task currently applying a run chunk. */
|
|
56
|
+
export interface DreamTaskProgress {
|
|
57
|
+
task: DreamTaskName;
|
|
58
|
+
processed: number;
|
|
59
|
+
total: number;
|
|
60
|
+
startedAt: number;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Persisted per-task run counts used by dream-run history and summaries. */
|
|
64
|
+
export interface DreamTaskRunBacklog {
|
|
65
|
+
pendingAtStart: number;
|
|
66
|
+
totalAtStart: number;
|
|
67
|
+
pendingAtEnd: number;
|
|
68
|
+
totalAtEnd: number;
|
|
69
|
+
processed: number;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** Use the decrease in the persisted backlog between the start and end snapshots as the per-run progress count, clamped to zero when the backlog does not decrease. */
|
|
73
|
+
export function processedDreamTaskItems(startPending: number, endPending: number): number {
|
|
74
|
+
return Math.max(0, startPending - endPending);
|
|
75
|
+
}
|
|
76
|
+
|
|
30
77
|
/**
|
|
31
78
|
* The agentic tasks — those run as a generic dreamer agent session driven by
|
|
32
79
|
* `buildDreamTaskPrompt`. The other canonical tasks (map-memories, verify,
|
package/src/shared/rpc-types.ts
CHANGED
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
* Both sides import these — no SQLite dependency.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import type {
|
|
7
|
+
DreamTaskBacklogMap,
|
|
8
|
+
DreamTaskProgress,
|
|
9
|
+
} from "../features/magic-context/dreamer/task-registry";
|
|
10
|
+
|
|
6
11
|
export interface SidebarSnapshot {
|
|
7
12
|
sessionId: string;
|
|
8
13
|
usagePercentage: number;
|
|
@@ -101,6 +106,10 @@ export interface SidebarSnapshot {
|
|
|
101
106
|
* sidebar "Recomp"/"Upgrade" progress bar and the /ctx-status dialog. Mirrors
|
|
102
107
|
* the runtime `RecompProgress` shape from compartment-runner-types.ts.
|
|
103
108
|
*/
|
|
109
|
+
/** Read-only per-task candidate counts; populated by the server RPC. */
|
|
110
|
+
dreamerBacklog?: DreamTaskBacklogMap;
|
|
111
|
+
/** Process-local task progress; absent when no Dreamer task is running. */
|
|
112
|
+
dreamerProgress?: DreamTaskProgress | null;
|
|
104
113
|
recompProgress?: {
|
|
105
114
|
/** "recomp" → "Recomp" labels; "upgrade" → "Upgrade" labels. */
|
|
106
115
|
kind?: "recomp" | "upgrade" | "embed" | "wrapup";
|