@cortexkit/opencode-magic-context 0.49.81 → 0.49.83
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/dist/auto-search-worker.js +3 -3
- package/dist/chunk-embedding-write-worker.js +4 -4
- package/dist/{conflict-warning-hook-8s8r0c0v.js → conflict-warning-hook-a0wrnzch.js} +2 -2
- package/dist/{context-359s1ncq.js → context-xmyke353.js} +258 -31
- package/dist/{embedding-backfill-0tvprmrn.js → embedding-backfill-k994xdas.js} +4 -4
- package/dist/features/magic-context/dreamer/map-memories-retry.d.ts +18 -0
- package/dist/features/magic-context/dreamer/map-memories-retry.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/map-memories.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/retrospective-raw-provider.d.ts +2 -0
- package/dist/features/magic-context/dreamer/retrospective-raw-provider.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-gates.d.ts +1 -1
- package/dist/features/magic-context/dreamer/task-gates.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-registry.d.ts +7 -0
- package/dist/features/magic-context/dreamer/task-registry.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts +9 -0
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts.map +1 -1
- package/dist/features/magic-context/memory/identity-merge-command.d.ts +4 -0
- package/dist/features/magic-context/memory/identity-merge-command.d.ts.map +1 -0
- package/dist/features/magic-context/memory/project-binding-notice.d.ts +5 -0
- package/dist/features/magic-context/memory/project-binding-notice.d.ts.map +1 -0
- package/dist/features/magic-context/memory/project-identity.d.ts +1 -0
- package/dist/features/magic-context/memory/project-identity.d.ts.map +1 -1
- package/dist/features/magic-context/storage-clone.d.ts +17 -0
- package/dist/features/magic-context/storage-clone.d.ts.map +1 -1
- package/dist/features/magic-context/store-generation-rebase.d.ts +13 -0
- package/dist/features/magic-context/store-generation-rebase.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts +1 -7
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
- package/dist/hooks/magic-context/execute-status.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/stored-compartment-gaps.d.ts +16 -0
- package/dist/hooks/magic-context/stored-compartment-gaps.d.ts.map +1 -0
- package/dist/hooks/magic-context/transform.d.ts +1 -0
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-m4q6ptgz.js → index-2xhzmwf6.js} +4 -4
- package/dist/{index-jhhkb4jv.js → index-2ygw6q5s.js} +1 -1
- package/dist/{index-v0epndb8.js → index-93rezfvc.js} +22 -2
- package/dist/{index-1rx9bfrk.js → index-b2787fk6.js} +111 -40
- package/dist/{index-tebcx987.js → index-bd34njzg.js} +1 -1
- package/dist/{index-zpd4pxnp.js → index-dg5jvh9r.js} +6 -6
- package/dist/{index-6athgjba.js → index-e21n48yd.js} +34 -2
- package/dist/{index-726b5jh5.js → index-eptthgkw.js} +5 -5
- package/dist/{index-6sckwxjj.js → index-eyk7msgw.js} +344 -159
- package/dist/{index-9554nr2q.js → index-fgy6hnr3.js} +6 -1
- package/dist/{index-tzy5h4x6.js → index-fpqdbb67.js} +1 -1
- package/dist/{index-x8a7jmkh.js → index-fzgyvsb1.js} +15 -4
- package/dist/{index-1sq1krqw.js → index-g6hfh4h4.js} +4 -4
- package/dist/{index-wwzamy3j.js → index-hz1xdb15.js} +3 -3
- package/dist/{index-nda0zgna.js → index-kknjvmpx.js} +2 -1
- package/dist/{index-m6rkq3t4.js → index-rnyaa7cj.js} +1 -1
- package/dist/{index-yfn52pb6.js → index-shpyv8gq.js} +2 -2
- package/dist/{index-7jefmy0g.js → index-stx8zd81.js} +2 -2
- package/dist/{index-jg7sbt3v.js → index-vpw46557.js} +1 -1
- package/dist/{index-xx05vta0.js → index-w2wpx7t5.js} +1 -1
- package/dist/{index-177yv84k.js → index-w8dcjt7f.js} +1 -1
- package/dist/{index-ma258g0g.js → index-wxxcfpxh.js} +5 -5
- package/dist/{index-xsdaz3mq.js → index-x8qgqnym.js} +30 -11
- package/dist/{index-aawwdt26.js → index-zvane1rq.js} +2 -2
- package/dist/index.js +32 -32
- package/dist/migration-worker.js +3 -3
- package/dist/plugin/rpc-handlers.d.ts +2 -0
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/{project-embedding-registry-sw4z2ptg.js → project-embedding-registry-y3z36mjy.js} +3 -3
- package/dist/raw-ordinal-warmup-worker.js +2 -2
- package/dist/{recomp-orchestrator-ar3xw3f4.js → recomp-orchestrator-fjdp3t1d.js} +14 -14
- package/dist/{render-bjxgkrk6.js → render-c9fjwrad.js} +6 -6
- package/dist/{rpc-notifications-3hed126v.js → rpc-notifications-t9q0ynq7.js} +3 -1
- package/dist/{search-z56487n8.js → search-1jejx5cx.js} +9 -9
- package/dist/{search-archive-p3jhx9wc.js → search-archive-s2jas2jb.js} +2 -2
- package/dist/{send-session-notification-ykvt5k2s.js → send-session-notification-7x518gew.js} +1 -1
- package/dist/shared/prompt-surface-runtime.d.ts +1 -1
- package/dist/shared/rpc-notifications.d.ts +8 -3
- package/dist/shared/rpc-notifications.d.ts.map +1 -1
- package/dist/shared/rpc-types.d.ts +4 -0
- package/dist/shared/rpc-types.d.ts.map +1 -1
- package/dist/shared/status-summary.d.ts +2 -0
- package/dist/shared/status-summary.d.ts.map +1 -1
- package/dist/shared/status-view-check.d.ts.map +1 -1
- package/dist/shared/status-view.d.ts +1 -0
- package/dist/shared/status-view.d.ts.map +1 -1
- package/dist/shared/user-facing-codes.d.ts +5 -0
- package/dist/shared/user-facing-codes.d.ts.map +1 -1
- package/dist/{store-8trkpmtx.js → store-ggrq9e14.js} +6 -2
- package/dist/{store-reader-3eh1s1m8.js → store-reader-tr64nxyy.js} +1 -1
- package/dist/{task-config-t6bpyka7.js → task-config-qt6n4bxm.js} +1 -1
- package/dist/tools/ctx-memory/constants.d.ts +1 -1
- package/dist/tools/ctx-memory/constants.d.ts.map +1 -1
- package/dist/tools/light-descriptions.d.ts +1 -1
- package/dist/tools/light-descriptions.d.ts.map +1 -1
- package/dist/tools/parameter-descriptions.d.ts +6 -6
- package/dist/tools/parameter-descriptions.d.ts.map +1 -1
- package/dist/{transform-postprocess-phase-6kyqctnq.js → transform-postprocess-phase-p2egg02g.js} +15 -15
- package/dist/v2/auto-search-worker.js +3 -3
- package/dist/v2/chunk-embedding-write-worker.js +4 -4
- package/dist/v2/{context-dpe94zcx.js → context-zn18k0yk.js} +648 -245
- package/dist/v2/{embedding-backfill-qnaswpmb.js → embedding-backfill-hjvjxp7d.js} +4 -4
- package/dist/v2/fork-inheritance.d.ts +25 -17
- package/dist/v2/fork-inheritance.d.ts.map +1 -1
- package/dist/v2/hidden-child-native.d.ts +6 -6
- package/dist/v2/hidden-child-native.d.ts.map +1 -1
- package/dist/v2/hidden-child-record.d.ts +21 -3
- package/dist/v2/hidden-child-record.d.ts.map +1 -1
- package/dist/v2/hidden-child-sweep.d.ts +1 -1
- package/dist/v2/hidden-child-sweep.d.ts.map +1 -1
- package/dist/v2/hidden-completion.d.ts +1 -0
- package/dist/v2/hidden-completion.d.ts.map +1 -1
- package/dist/v2/hidden-run-holder.d.ts +16 -0
- package/dist/v2/hidden-run-holder.d.ts.map +1 -0
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/dream-timer.d.ts +5 -7
- package/dist/v2/hooks/dream-timer.d.ts.map +1 -1
- package/dist/v2/hooks/fork-history-status.d.ts +10 -0
- package/dist/v2/hooks/fork-history-status.d.ts.map +1 -0
- package/dist/v2/hooks/hidden-child.d.ts.map +1 -1
- package/dist/v2/hooks/store.d.ts +4 -0
- package/dist/v2/hooks/store.d.ts.map +1 -1
- package/dist/v2/hooks/types.d.ts +5 -26
- package/dist/v2/hooks/types.d.ts.map +1 -1
- package/dist/v2/migration-worker.js +3 -3
- package/dist/v2/{project-embedding-registry-52f2jept.js → project-embedding-registry-mzsvyads.js} +3 -3
- package/dist/v2/raw-ordinal-warmup-worker.js +2 -2
- package/dist/v2/{recomp-orchestrator-7t6fkpbb.js → recomp-orchestrator-jn39mxh0.js} +13 -13
- package/dist/v2/{render-hwqk0d8t.js → render-q2aj9bgy.js} +6 -6
- package/dist/v2/retrospective-raw-provider.d.ts.map +1 -1
- package/dist/v2/{rpc-notifications-3hed126v.js → rpc-notifications-t9q0ynq7.js} +3 -1
- package/dist/v2/{search-eftsvbg7.js → search-9xn6ds9x.js} +8 -8
- package/dist/v2/{search-archive-mdxzvgpm.js → search-archive-fj59gjv1.js} +2 -2
- package/dist/v2/{send-session-notification-8g4r97bp.js → send-session-notification-p52rhjzy.js} +1 -1
- package/dist/v2/{server-ma9jwnas.js → server-1cn3kryt.js} +4 -4
- package/dist/v2/{server-34pvhvxt.js → server-1efjj215.js} +22 -2
- package/dist/v2/{server-92g7d776.js → server-2kswss3d.js} +2 -1
- package/dist/v2/{server-jn4pktdk.js → server-2ktxmtbd.js} +1 -1
- package/dist/v2/{server-zw1e3wq5.js → server-2w1rdttn.js} +1 -1
- package/dist/v2/{server-jtq03rkb.js → server-4z964n1c.js} +1 -1
- package/dist/v2/{server-pxdpwycq.js → server-53n8hv5q.js} +6 -6
- package/dist/v2/{server-rbtx6q5v.js → server-569he5mh.js} +1 -1
- package/dist/v2/{server-rthnpmbp.js → server-5yfq912a.js} +34 -2
- package/dist/v2/{server-mhrgymcs.js → server-68q80y27.js} +2 -2
- package/dist/v2/{server-afsz3cmx.js → server-bt546axy.js} +1 -1
- package/dist/v2/{server-dhdn8mwq.js → server-c8mqs0v5.js} +30 -11
- package/dist/v2/{server-x8a7jmkh.js → server-fzgyvsb1.js} +15 -4
- package/dist/v2/{server-76v5y7zm.js → server-g1a0nhtk.js} +2 -2
- package/dist/v2/{server-25qtxt4d.js → server-gx1s06dx.js} +6 -1
- package/dist/v2/{server-x8ksqcw7.js → server-pejjj0nv.js} +1 -1
- package/dist/v2/{server-a1zp7exh.js → server-vt6nj2hn.js} +106 -35
- package/dist/v2/{server-qjff96a6.js → server-wdq85mxj.js} +4 -4
- package/dist/v2/server.js +3 -3
- package/dist/v2/{store-m3zny7q2.js → store-qdgzd38f.js} +6 -2
- package/dist/v2/{store-reader-yaxtdy6f.js → store-reader-83tka051.js} +1 -1
- package/dist/v2/store-reader.d.ts +15 -8
- package/dist/v2/store-reader.d.ts.map +1 -1
- package/dist/v2/{task-config-7md27rx8.js → task-config-ex2vajr2.js} +1 -1
- package/dist/v2/tui/index.d.ts +1 -1
- package/dist/v2/tui/index.d.ts.map +1 -1
- package/dist/v2/{v2-archive-reader-p89x05hj.js → v2-archive-reader-9z8z97db.js} +1 -1
- package/dist/v2/{wrapup-orchestrator-c0bwb0wa.js → wrapup-orchestrator-vd5zfp3v.js} +13 -13
- package/dist/{v2-archive-reader-vzmzb245.js → v2-archive-reader-r0xpxsb1.js} +1 -1
- package/dist/{wrapup-orchestrator-548q5y55.js → wrapup-orchestrator-k29zqfp9.js} +15 -15
- package/package.json +1 -1
- package/src/agents/smart-notes-dreamer-gate.golden.json +169 -169
- package/src/features/magic-context/dreamer/task-registry.ts +8 -0
- package/src/shared/prompt-surface-a1-golden.md +8 -7
- package/src/shared/rpc-notifications.test.ts +29 -0
- package/src/shared/rpc-notifications.ts +24 -5
- package/src/shared/rpc-types.ts +4 -0
- package/src/shared/status-summary.ts +9 -1
- package/src/shared/status-view-check.ts +2 -0
- package/src/shared/status-view.test.ts +9 -0
- package/src/shared/status-view.ts +4 -0
- package/src/shared/user-facing-codes.ts +5 -0
- package/src/tui/slots/sidebar-content.tsx +11 -5
- package/src/tui-compiled/slots/sidebar-content.tsx +191 -176
- package/src/v2/tui/index.ts +7 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Magic Context agent-facing surface (exported from source)
|
|
2
2
|
|
|
3
|
-
Generated by `packages/plugin/scripts/export-agent-surface.ts` at 2026-
|
|
3
|
+
Generated by `packages/plugin/scripts/export-agent-surface.ts` at 2026-11-26.
|
|
4
4
|
Token counts are Claude BPE estimates on the raw text.
|
|
5
5
|
|
|
6
6
|
## 1. System-prompt guidance section
|
|
@@ -278,7 +278,7 @@ First line is the title (under 80 chars), followed by detail. Operations:
|
|
|
278
278
|
}
|
|
279
279
|
```
|
|
280
280
|
|
|
281
|
-
### ctx_memory — description ~
|
|
281
|
+
### ctx_memory — description ~343 tokens, params ~212 tokens (total ~555)
|
|
282
282
|
|
|
283
283
|
**Description:**
|
|
284
284
|
|
|
@@ -289,10 +289,11 @@ Your active memories are already in <project-memory> as `#id: fact` lines. Write
|
|
|
289
289
|
|
|
290
290
|
Actions:
|
|
291
291
|
- write: new memory (content + category).
|
|
292
|
-
- update: rewrite one memory whose fact changed (ids: [one], content; category
|
|
292
|
+
- update: rewrite one memory whose fact changed (ids: [one], content; category: the current one to keep, a new one to recategorize).
|
|
293
293
|
- archive: retire wrong or obsolete memories (ids: [one or more], optional reason).
|
|
294
|
-
- merge: collapse duplicates into one (ids: [two or more], content).
|
|
294
|
+
- merge: collapse duplicates into one (ids: [two or more distinct ids of memories in the same category], content).
|
|
295
295
|
- get: fetch by id (ids: 1–20), readable in every status.
|
|
296
|
+
The call form that works on every host sends action, content, category and ids every time: argument-dropping providers only emit required fields. For get and archive pass content="" and any valid category; for write pass ids=[].
|
|
296
297
|
Examples: category="CONFIG_VALUES", content="OpenCode source is at ~/Work/OSS/opencode" · category="CONSTRAINTS", content="Dashboard Tauri build needs RGBA PNGs, not grayscale"
|
|
297
298
|
```
|
|
298
299
|
|
|
@@ -312,11 +313,11 @@ Examples: category="CONFIG_VALUES", content="OpenCode source is at ~/Work/OSS/op
|
|
|
312
313
|
]
|
|
313
314
|
},
|
|
314
315
|
"content": {
|
|
315
|
-
"description": "
|
|
316
|
+
"description": "Send on every call — the memory text for write, update and merge; pass an empty string for archive and get.",
|
|
316
317
|
"type": "string"
|
|
317
318
|
},
|
|
318
319
|
"category": {
|
|
319
|
-
"description": "
|
|
320
|
+
"description": "Send on every call — the fact's kind for write; on update/merge, the memory's current category to keep it; archive and get ignore it, so pass any valid category.",
|
|
320
321
|
"type": "string",
|
|
321
322
|
"enum": [
|
|
322
323
|
"PROJECT_RULES",
|
|
@@ -327,7 +328,7 @@ Examples: category="CONFIG_VALUES", content="OpenCode source is at ~/Work/OSS/op
|
|
|
327
328
|
]
|
|
328
329
|
},
|
|
329
330
|
"ids": {
|
|
330
|
-
"description": "
|
|
331
|
+
"description": "Send on every call — one id for update, one or more for archive, two or more distinct ids of memories in the same category for merge, 1–20 for get; write takes an empty list.",
|
|
331
332
|
"type": "array",
|
|
332
333
|
"items": {
|
|
333
334
|
"type": "number"
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
drainNotifications,
|
|
4
4
|
isTuiConnected,
|
|
5
5
|
type NotificationSink,
|
|
6
|
+
pushLiveNotification,
|
|
6
7
|
pushNotification,
|
|
7
8
|
registerNotificationSink,
|
|
8
9
|
} from "./rpc-notifications";
|
|
@@ -110,6 +111,34 @@ describe("rpc notifications", () => {
|
|
|
110
111
|
unregister();
|
|
111
112
|
});
|
|
112
113
|
|
|
114
|
+
test("live-only notices are scoped to an attached session and never enter replay", () => {
|
|
115
|
+
const sessionId = "ses_display_only";
|
|
116
|
+
const attached: string[] = [];
|
|
117
|
+
const other: string[] = [];
|
|
118
|
+
pushLiveNotification("display-only", { message: "before attach" }, sessionId);
|
|
119
|
+
const unregister = registerNotificationSink({
|
|
120
|
+
sessionId,
|
|
121
|
+
send: ({ payload }) => attached.push(String(payload.message)),
|
|
122
|
+
});
|
|
123
|
+
const unregisterOther = registerNotificationSink({
|
|
124
|
+
sessionId: "ses_other_session",
|
|
125
|
+
send: ({ payload }) => other.push(String(payload.message)),
|
|
126
|
+
});
|
|
127
|
+
const unregisterUnscoped = registerNotificationSink({
|
|
128
|
+
send: ({ payload }) => other.push(String(payload.message)),
|
|
129
|
+
});
|
|
130
|
+
try {
|
|
131
|
+
pushLiveNotification("display-only", { message: "while attached" }, sessionId);
|
|
132
|
+
expect(attached).toEqual(["while attached"]);
|
|
133
|
+
expect(other).toEqual([]);
|
|
134
|
+
expect(drainNotifications(0, sessionId, { sessionOnly: true })).toEqual([]);
|
|
135
|
+
} finally {
|
|
136
|
+
unregister();
|
|
137
|
+
unregisterOther();
|
|
138
|
+
unregisterUnscoped();
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
|
|
113
142
|
test("a dead sink (throwing send) does not block delivery to other sinks", () => {
|
|
114
143
|
drainNotifications(Number.MAX_SAFE_INTEGER);
|
|
115
144
|
const live: string[] = [];
|
|
@@ -58,18 +58,37 @@ function notificationMatchesSink(notification: RpcNotification, sink: Notificati
|
|
|
58
58
|
return sink.protocol !== 2;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
/** Display-only notices go to the terminal showing the session, never to the replay queue. */
|
|
62
|
+
export function pushLiveNotification(
|
|
63
|
+
type: string,
|
|
64
|
+
payload: Record<string, unknown>,
|
|
65
|
+
sessionId: string,
|
|
66
|
+
): void {
|
|
67
|
+
const notification: RpcNotification = { id: nextNotificationId++, type, payload, sessionId };
|
|
68
|
+
for (const sink of sinks) {
|
|
69
|
+
if (sink.sessionId !== sessionId) continue;
|
|
70
|
+
try {
|
|
71
|
+
sink.send(notification);
|
|
72
|
+
} catch {
|
|
73
|
+
// A socket that closed during the send has no live terminal to notify.
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
61
78
|
/** Push a notification to the TUI. Fans out to any live WS sink immediately and
|
|
62
|
-
*
|
|
79
|
+
* normally enqueues it so a TUI that is momentarily disconnected (reconnecting, or
|
|
63
80
|
* not yet connected) still receives it on its next hello via the backlog drain.
|
|
64
81
|
* At-least-once: a live push that the socket drops is re-delivered from the
|
|
65
|
-
* queue on reconnect (pruned only when the client acknowledges it).
|
|
82
|
+
* queue on reconnect (pruned only when the client acknowledges it). Live-only
|
|
83
|
+
* notifications are not kept for replay. */
|
|
66
84
|
export function pushNotification(
|
|
67
85
|
type: string,
|
|
68
86
|
payload: Record<string, unknown>,
|
|
69
87
|
sessionId?: string,
|
|
88
|
+
options?: { liveOnly?: boolean },
|
|
70
89
|
): void {
|
|
71
90
|
const notification: RpcNotification = { id: nextNotificationId++, type, payload, sessionId };
|
|
72
|
-
queue.push(notification);
|
|
91
|
+
if (!options?.liveOnly) queue.push(notification);
|
|
73
92
|
// Fan out to every live sink this notification is scoped to. A delivery throw
|
|
74
93
|
// (dead socket mid-send) must not block other sinks or the caller.
|
|
75
94
|
for (const sink of sinks) {
|
|
@@ -78,14 +97,14 @@ export function pushNotification(
|
|
|
78
97
|
sink.send(notification);
|
|
79
98
|
} catch {
|
|
80
99
|
// Socket died between liveness check and send; the close handler will
|
|
81
|
-
// unregister it
|
|
100
|
+
// unregister it. Only queued notifications replay on reconnect.
|
|
82
101
|
}
|
|
83
102
|
}
|
|
84
103
|
// Keep a strict global bound. Reserve the newest item for at most 25 recently
|
|
85
104
|
// active scopes, then evict the oldest unreserved item. This protects a quiet
|
|
86
105
|
// session from one noisy peer without allowing one item per session to grow
|
|
87
106
|
// the queue without limit.
|
|
88
|
-
if (queue.length > 100) {
|
|
107
|
+
if (!options?.liveOnly && queue.length > 100) {
|
|
89
108
|
const reservedIds = new Set<number>();
|
|
90
109
|
const reservedScopes = new Set<string>();
|
|
91
110
|
for (let i = queue.length - 1; i >= 0 && reservedScopes.size < 25; i -= 1) {
|
package/src/shared/rpc-types.ts
CHANGED
|
@@ -62,8 +62,12 @@ export interface SidebarSnapshot {
|
|
|
62
62
|
cacheTtl: string;
|
|
63
63
|
/** Persistent runtime failure shown directly in the sidebar when non-null. */
|
|
64
64
|
lastTransformError: string | null;
|
|
65
|
+
/** Display-only warning remembered by the running plugin after a project change. */
|
|
66
|
+
projectBindingWarning?: string;
|
|
65
67
|
/** Durable history-compression failure count used to select the stable summary warning. */
|
|
66
68
|
historianFailureCount?: number;
|
|
69
|
+
/** The current saved history of this OpenCode 2 fork needs a rebuild. */
|
|
70
|
+
forkHistoryGap?: boolean;
|
|
67
71
|
lastDreamerRunAt: number | null;
|
|
68
72
|
projectIdentity: string | null;
|
|
69
73
|
compartmentTokens: number;
|
|
@@ -37,6 +37,7 @@ export interface UserStatusSummary {
|
|
|
37
37
|
dreamerRunner?: RunnerStatus;
|
|
38
38
|
warnings: UserFacingFailureKey[];
|
|
39
39
|
hiddenVariantWarnings?: string[];
|
|
40
|
+
projectBindingWarning?: string;
|
|
40
41
|
dreamerSkipped?: readonly string[];
|
|
41
42
|
dreamerQuotas?: readonly string[];
|
|
42
43
|
hiddenModelSkips?: readonly string[];
|
|
@@ -50,6 +51,7 @@ export interface UserStatusSummary {
|
|
|
50
51
|
export interface StatusWarningInput {
|
|
51
52
|
readonly lastTransformError?: string | null;
|
|
52
53
|
readonly historianFailureCount?: number;
|
|
54
|
+
readonly forkHistoryGap?: boolean;
|
|
53
55
|
readonly configParseFailures?: readonly unknown[];
|
|
54
56
|
readonly embedding?: { readonly state: string };
|
|
55
57
|
readonly loggerDiagnostics?: { readonly swallowedWriteCount?: number };
|
|
@@ -65,7 +67,8 @@ export interface StatusWarningInput {
|
|
|
65
67
|
export function statusWarningsFromDetail(detail: StatusWarningInput): UserFacingFailureKey[] {
|
|
66
68
|
const warnings: UserFacingFailureKey[] = [];
|
|
67
69
|
if (detail.lastTransformError) warnings.push("transform_update_failed");
|
|
68
|
-
if (
|
|
70
|
+
if (detail.forkHistoryGap) warnings.push("fork_history_gap");
|
|
71
|
+
else if ((detail.historianFailureCount ?? 0) > 0) warnings.push("historian_unavailable");
|
|
69
72
|
if ((detail.configParseFailures?.length ?? 0) > 0) warnings.push("configuration_warning");
|
|
70
73
|
if (detail.embedding?.state === "stopped") warnings.push("embedding_unavailable");
|
|
71
74
|
if ((detail.loggerDiagnostics?.swallowedWriteCount ?? 0) > 0) {
|
|
@@ -131,6 +134,7 @@ export function statusSummaryFromDetail(detail: StatusDetail): UserStatusSummary
|
|
|
131
134
|
compactionMarker: detail.compactionMarker,
|
|
132
135
|
warnings: statusWarningsFromDetail(detail),
|
|
133
136
|
hiddenVariantWarnings: detail.hiddenVariantWarnings ?? [],
|
|
137
|
+
projectBindingWarning: detail.projectBindingWarning,
|
|
134
138
|
dreamerSkipped: detail.dreamerSkipped,
|
|
135
139
|
hiddenModelSkips: detail.hiddenModelSkips,
|
|
136
140
|
dreamerQuotas: [
|
|
@@ -258,6 +262,10 @@ export function renderUserStatusSummary(
|
|
|
258
262
|
for (const warning of summary.hiddenVariantWarnings ?? []) {
|
|
259
263
|
lines.push(style === "markdown" ? `- **Warning:** ${warning}` : `Warning: ${warning}`);
|
|
260
264
|
}
|
|
265
|
+
if (summary.projectBindingWarning) {
|
|
266
|
+
const label = style === "markdown" ? "- **Warning:**" : "Warning:";
|
|
267
|
+
lines.push(`${label} ${summary.projectBindingWarning}`);
|
|
268
|
+
}
|
|
261
269
|
for (const warning of summary.warnings) {
|
|
262
270
|
lines.push(
|
|
263
271
|
style === "markdown"
|
|
@@ -336,6 +336,7 @@ export function checkStatusViewSource(candidate: unknown):
|
|
|
336
336
|
// dropped rather than rendered as a crash.
|
|
337
337
|
warnings: optional.readArray("warnings", isUserFacingFailureKey),
|
|
338
338
|
hiddenVariantWarnings: optional.readArray("hiddenVariantWarnings", isString),
|
|
339
|
+
projectBindingWarning: optional.read("projectBindingWarning", isString),
|
|
339
340
|
unconfirmedMigrationHolders: optional.read(
|
|
340
341
|
"unconfirmedMigrationHolders",
|
|
341
342
|
isUnconfirmedMigrationHolders,
|
|
@@ -394,6 +395,7 @@ function warningInputFrom(raw: Fields, optional: OptionalFields): StatusWarningI
|
|
|
394
395
|
return {
|
|
395
396
|
lastTransformError: optional.read("lastTransformError", isNullableString) ?? null,
|
|
396
397
|
historianFailureCount: optional.read("historianFailureCount", isNumber),
|
|
398
|
+
forkHistoryGap: raw.forkHistoryGap === true,
|
|
397
399
|
configParseFailures: optional.readArray("configParseFailures", isConfigParseFailure),
|
|
398
400
|
embedding:
|
|
399
401
|
isRecord(raw.embedding) && isString(raw.embedding.state)
|
|
@@ -93,6 +93,15 @@ function rowLabels(sectionTitle: string, overrides: Partial<StatusViewSource> =
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
describe("status view model", () => {
|
|
96
|
+
test("shows the previous-project memory warning with its pasteable command", () => {
|
|
97
|
+
const text =
|
|
98
|
+
"2 memories stayed under this session's previous project. Nothing was moved.\nReview the merge first:\nnpx @cortexkit/magic-context@latest doctor merge-identities --from dir:old --to git:new\nIt shows what would move. Add --apply to move them.";
|
|
99
|
+
expect(view({ projectBindingWarning: text }).warnings).toContainEqual({
|
|
100
|
+
text,
|
|
101
|
+
tone: "warning",
|
|
102
|
+
});
|
|
103
|
+
expect(view().warnings).toEqual([]);
|
|
104
|
+
});
|
|
96
105
|
test("shows dropped hidden-run variants as warnings", () => {
|
|
97
106
|
expect(
|
|
98
107
|
view({ hiddenVariantWarnings: ["variant 'medium' not offered by example/model"] })
|
|
@@ -185,6 +185,7 @@ export interface StatusViewSource {
|
|
|
185
185
|
readonly toVersion: number;
|
|
186
186
|
};
|
|
187
187
|
readonly hiddenVariantWarnings?: readonly string[];
|
|
188
|
+
readonly projectBindingWarning?: string;
|
|
188
189
|
}
|
|
189
190
|
|
|
190
191
|
declare const checkedStatusViewSource: unique symbol;
|
|
@@ -706,6 +707,9 @@ function warningBlock(source: StatusViewSource): StatusWarning[] {
|
|
|
706
707
|
]
|
|
707
708
|
: []),
|
|
708
709
|
...(source.hiddenVariantWarnings ?? []).map((text) => ({ text, tone: "warning" as const })),
|
|
710
|
+
...(source.projectBindingWarning
|
|
711
|
+
? [{ text: source.projectBindingWarning, tone: "warning" as const }]
|
|
712
|
+
: []),
|
|
709
713
|
...(source.configReloadFailure
|
|
710
714
|
? [
|
|
711
715
|
{
|
|
@@ -14,6 +14,11 @@ export const USER_FACING_FAILURES = {
|
|
|
14
14
|
"History compression is paused because this session's saved summaries no longer line up with its messages.",
|
|
15
15
|
action: "Run /ctx-recomp to rebuild them.",
|
|
16
16
|
},
|
|
17
|
+
fork_history_gap: {
|
|
18
|
+
code: "MC-H09",
|
|
19
|
+
sentence: "This fork's saved history has a gap.",
|
|
20
|
+
action: "Run /ctx-recomp to rebuild its history.",
|
|
21
|
+
},
|
|
17
22
|
history_boundary_unresolved: {
|
|
18
23
|
code: "MC-H04",
|
|
19
24
|
sentence:
|
|
@@ -784,11 +784,17 @@ const SidebarContent = (props: {
|
|
|
784
784
|
</box>
|
|
785
785
|
)}
|
|
786
786
|
|
|
787
|
-
{
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
787
|
+
{s()?.projectBindingWarning && (
|
|
788
|
+
<box marginTop={1} width="100%">
|
|
789
|
+
<text fg={props.theme.warning}>⚠ {s()?.projectBindingWarning}</text>
|
|
790
|
+
</box>
|
|
791
|
+
)}
|
|
792
|
+
|
|
793
|
+
{/* Long-lived host limitations and the current fork diagnosis are
|
|
794
|
+
visible independently of the one-shot toast. */}
|
|
795
|
+
<For each={s()?.forkHistoryGap === true
|
|
796
|
+
? [...(s()?.hostLimitations ?? []), "fork_history_gap" as const]
|
|
797
|
+
: s()?.hostLimitations ?? []}>
|
|
792
798
|
{(limitation) => (
|
|
793
799
|
<box marginTop={1} width="100%">
|
|
794
800
|
<text fg={props.theme.warning}>⚠ {renderUserFacingFailure(limitation, "plain")}</text>
|