@cortexkit/opencode-magic-context 0.49.81 → 0.49.82
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-00f1hdz2.js} +251 -29
- package/dist/{embedding-backfill-0tvprmrn.js → embedding-backfill-k994xdas.js} +4 -4
- 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-9554nr2q.js → index-fgy6hnr3.js} +6 -1
- package/dist/{index-tzy5h4x6.js → index-fpqdbb67.js} +1 -1
- package/dist/{v2/server-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-6sckwxjj.js → index-jvr9ba9y.js} +151 -37
- 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 +31 -31
- 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/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-gwkgh0wd.js} +368 -43
- 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/{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-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/{index-x8a7jmkh.js → v2/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/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/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
|
@@ -27,11 +27,11 @@ serveWorkerJobs(async (initial, port) => {
|
|
|
27
27
|
{ Database, registerSqliteDiagnosticSink },
|
|
28
28
|
{ log }
|
|
29
29
|
] = await Promise.all([
|
|
30
|
-
import("./embedding-backfill-
|
|
30
|
+
import("./embedding-backfill-k994xdas.js"),
|
|
31
31
|
import("./embedding-cache-mgyr73ef.js"),
|
|
32
32
|
import("./storage-memory-e6a7mb0k.js"),
|
|
33
|
-
import("./project-embedding-registry-
|
|
34
|
-
import("./search-
|
|
33
|
+
import("./project-embedding-registry-y3z36mjy.js"),
|
|
34
|
+
import("./search-1jejx5cx.js"),
|
|
35
35
|
import("./compartment-chunk-embedding-ymc9mtwv.js"),
|
|
36
36
|
import("./embedding-activity-g1dhes6g.js"),
|
|
37
37
|
import("./harness-e4avh192.js"),
|
|
@@ -30,15 +30,15 @@ import {
|
|
|
30
30
|
acquireGitSweepLease,
|
|
31
31
|
renewGitSweepLease,
|
|
32
32
|
releaseGitSweepLease
|
|
33
|
-
} from "./index-
|
|
34
|
-
import"./index-
|
|
33
|
+
} from "./index-vpw46557.js";
|
|
34
|
+
import"./index-fpqdbb67.js";
|
|
35
35
|
import"./index-gqf8r04r.js";
|
|
36
36
|
import {
|
|
37
37
|
LATEST_SUPPORTED_VERSION,
|
|
38
38
|
enforceSchemaFence
|
|
39
|
-
} from "./index-
|
|
39
|
+
} from "./index-zvane1rq.js";
|
|
40
40
|
import"./index-wh9fxds5.js";
|
|
41
|
-
import"./index-
|
|
41
|
+
import"./index-w2wpx7t5.js";
|
|
42
42
|
import"./index-jrj95cce.js";
|
|
43
43
|
import"./index-fr0wbhdn.js";
|
|
44
44
|
import"./index-58e3y90n.js";
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
cleanupConflictWarnings2,
|
|
5
5
|
sendSchemaFenceWarning2,
|
|
6
6
|
sendStartupAnnouncement2
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-stx8zd81.js";
|
|
8
8
|
import"./index-nxxzeq4y.js";
|
|
9
9
|
import"./index-sd3egckz.js";
|
|
10
|
-
import"./index-
|
|
10
|
+
import"./index-g6hfh4h4.js";
|
|
11
11
|
import"./index-qt1qqasc.js";
|
|
12
12
|
import"./index-x40zr813.js";
|
|
13
13
|
import"./index-e6ncz7a6.js";
|
|
@@ -7,6 +7,9 @@ import {
|
|
|
7
7
|
pluginConfigReader,
|
|
8
8
|
withLiveDreamerOutputCap,
|
|
9
9
|
HiddenCompletionRefusal,
|
|
10
|
+
supportsQuietHiddenChildren,
|
|
11
|
+
matchesHiddenRunLocation,
|
|
12
|
+
hiddenRunPlacement,
|
|
10
13
|
HIDDEN_HISTORIAN_AGENT,
|
|
11
14
|
HIDDEN_DREAMER_AGENT,
|
|
12
15
|
HIDDEN_CURATE_AGENT,
|
|
@@ -30,6 +33,7 @@ import {
|
|
|
30
33
|
ACTIVE_TOOL_IDS,
|
|
31
34
|
createPromptSurfaceRuntime,
|
|
32
35
|
runTokenLog,
|
|
36
|
+
validateStoredCompartments,
|
|
33
37
|
v2ToolDefinitionsHash,
|
|
34
38
|
v2RequestToolsFingerprint,
|
|
35
39
|
clearInjectionCache,
|
|
@@ -37,8 +41,9 @@ import {
|
|
|
37
41
|
resetPrefixTrimFallbackState,
|
|
38
42
|
rebaseSessionCoordinatesAsync,
|
|
39
43
|
resolveOpenCodeProtectedTailBoundary,
|
|
44
|
+
nonNarrativeStoredGapRanges,
|
|
40
45
|
getActiveCompartmentRun
|
|
41
|
-
} from "./index-
|
|
46
|
+
} from "./index-b2787fk6.js";
|
|
42
47
|
import"./index-sd3egckz.js";
|
|
43
48
|
import {
|
|
44
49
|
getHarness2
|
|
@@ -132,7 +137,7 @@ import {
|
|
|
132
137
|
applyJsonSchemaParameterDescriptions,
|
|
133
138
|
MagicContextRpcServer,
|
|
134
139
|
subagentTemperature
|
|
135
|
-
} from "./index-
|
|
140
|
+
} from "./index-jvr9ba9y.js";
|
|
136
141
|
import {
|
|
137
142
|
resolveHistorianModel2
|
|
138
143
|
} from "./index-5kym00ag.js";
|
|
@@ -148,7 +153,7 @@ import {
|
|
|
148
153
|
setHomeProjectPermission,
|
|
149
154
|
resolveProjectIdentityForSession,
|
|
150
155
|
scheduleAfterBootQuiet
|
|
151
|
-
} from "./index-
|
|
156
|
+
} from "./index-fpqdbb67.js";
|
|
152
157
|
import"./index-v0p37hm2.js";
|
|
153
158
|
import {
|
|
154
159
|
inRootAsyncContext2,
|
|
@@ -222,7 +227,7 @@ import"./index-zzvd4a9z.js";
|
|
|
222
227
|
import"./index-s32f8y67.js";
|
|
223
228
|
import {
|
|
224
229
|
scheduleClearAndReindex
|
|
225
|
-
} from "./index-
|
|
230
|
+
} from "./index-rnyaa7cj.js";
|
|
226
231
|
import {
|
|
227
232
|
invalidateAutoEmbedSession,
|
|
228
233
|
clearEmbedSessionState
|
|
@@ -266,7 +271,7 @@ import {
|
|
|
266
271
|
getSlot,
|
|
267
272
|
dropSlot,
|
|
268
273
|
copySessionStateForClone
|
|
269
|
-
} from "./index-
|
|
274
|
+
} from "./index-x8qgqnym.js";
|
|
270
275
|
import {
|
|
271
276
|
startBootDeadline,
|
|
272
277
|
getSchemaFenceRejection,
|
|
@@ -276,17 +281,17 @@ import {
|
|
|
276
281
|
openDatabaseAsync,
|
|
277
282
|
isDatabasePersisted,
|
|
278
283
|
getDatabasePersistenceError
|
|
279
|
-
} from "./index-
|
|
284
|
+
} from "./index-zvane1rq.js";
|
|
280
285
|
import"./index-fr0wbhdn.js";
|
|
281
|
-
import"./index-
|
|
286
|
+
import"./index-w2wpx7t5.js";
|
|
282
287
|
import {
|
|
283
288
|
gaDatabasePath2,
|
|
284
289
|
RAW_MESSAGE_TYPES2,
|
|
285
290
|
V2StoreReaderPool2,
|
|
286
291
|
V2StoreReader2
|
|
287
|
-
} from "./index-
|
|
292
|
+
} from "./index-e21n48yd.js";
|
|
288
293
|
import"./index-fb3zxn06.js";
|
|
289
|
-
import"./index-
|
|
294
|
+
import"./index-bd34njzg.js";
|
|
290
295
|
import {
|
|
291
296
|
createTagger,
|
|
292
297
|
cavemanWordRulesForLanguage,
|
|
@@ -299,29 +304,30 @@ import {
|
|
|
299
304
|
servedHeadChanged,
|
|
300
305
|
noteHostCheckpointCommit,
|
|
301
306
|
isSyntheticHeadMessage2
|
|
302
|
-
} from "./index-
|
|
307
|
+
} from "./index-wxxcfpxh.js";
|
|
303
308
|
import"./index-832w615x.js";
|
|
304
309
|
import"./index-qt1qqasc.js";
|
|
305
310
|
import {
|
|
306
311
|
retainProjectEmbedding2
|
|
307
|
-
} from "./index-
|
|
308
|
-
import"./index-
|
|
312
|
+
} from "./index-shpyv8gq.js";
|
|
313
|
+
import"./index-vpw46557.js";
|
|
309
314
|
import"./index-4dhv7mqz.js";
|
|
310
315
|
import"./index-zb4h9nrk.js";
|
|
311
316
|
import {
|
|
312
317
|
renderUserFacingFailure,
|
|
313
318
|
userFacingFailureCode
|
|
314
|
-
} from "./index-
|
|
315
|
-
import"./index-
|
|
319
|
+
} from "./index-fgy6hnr3.js";
|
|
320
|
+
import"./index-w8dcjt7f.js";
|
|
316
321
|
import"./index-jjvbk92s.js";
|
|
317
322
|
import {
|
|
323
|
+
pushLiveNotification2,
|
|
318
324
|
pushNotification2,
|
|
319
325
|
isTuiConnected2
|
|
320
|
-
} from "./index-
|
|
326
|
+
} from "./index-fzgyvsb1.js";
|
|
321
327
|
import"./index-e6ncz7a6.js";
|
|
322
|
-
import"./index-
|
|
323
|
-
import"./index-
|
|
324
|
-
import"./index-
|
|
328
|
+
import"./index-g6hfh4h4.js";
|
|
329
|
+
import"./index-dg5jvh9r.js";
|
|
330
|
+
import"./index-hz1xdb15.js";
|
|
325
331
|
import"./index-98qy103c.js";
|
|
326
332
|
import {
|
|
327
333
|
detectConflicts
|
|
@@ -341,18 +347,20 @@ import {
|
|
|
341
347
|
toolErrorText,
|
|
342
348
|
toolStateContent,
|
|
343
349
|
rawMessagePage2,
|
|
350
|
+
readV2MessageRange2,
|
|
351
|
+
iterateV2MessageRange2,
|
|
344
352
|
servedBoundaryRow2,
|
|
345
353
|
resolveV2BoundaryUserMessage2,
|
|
346
354
|
readAllV2RawMessagesForConversion2,
|
|
347
355
|
readV2RawMessagePagesForConversion2,
|
|
348
356
|
createV2RawMessageReader2,
|
|
349
357
|
createV2RawMessageProvider2
|
|
350
|
-
} from "./index-
|
|
358
|
+
} from "./index-93rezfvc.js";
|
|
351
359
|
import"./index-fmsr7v69.js";
|
|
352
360
|
import"./index-twmeey4h.js";
|
|
353
361
|
import"./index-52x68mj4.js";
|
|
354
|
-
import"./index-
|
|
355
|
-
import"./index-
|
|
362
|
+
import"./index-2xhzmwf6.js";
|
|
363
|
+
import"./index-2ygw6q5s.js";
|
|
356
364
|
import {
|
|
357
365
|
isDreamerRunnable,
|
|
358
366
|
isSmartNoteSurfaceAvailable,
|
|
@@ -3510,7 +3518,123 @@ function splitMessageScopedId(id) {
|
|
|
3510
3518
|
return { messageId: id, suffix: "" };
|
|
3511
3519
|
return { messageId: id.slice(0, -match[1].length), suffix: match[1] };
|
|
3512
3520
|
}
|
|
3513
|
-
function
|
|
3521
|
+
function selectForkCompartments(source, map, proof) {
|
|
3522
|
+
const rows = new Map;
|
|
3523
|
+
const forkId = (id) => map.parentToFork.get(id) ?? "";
|
|
3524
|
+
const ordinal = (id) => map.forkOrdinals.get(forkId(id));
|
|
3525
|
+
let matchingPrefix;
|
|
3526
|
+
const provePrefix = () => {
|
|
3527
|
+
const matching = proof.matchingBodies();
|
|
3528
|
+
let length = 0;
|
|
3529
|
+
for (const [position, id] of map.parentOrdinals) {
|
|
3530
|
+
if (ordinal(id) !== position || matching.get(id) !== forkId(id))
|
|
3531
|
+
break;
|
|
3532
|
+
length = position;
|
|
3533
|
+
}
|
|
3534
|
+
return length;
|
|
3535
|
+
};
|
|
3536
|
+
let stopped = false;
|
|
3537
|
+
let lastEnd = 0;
|
|
3538
|
+
let acceptedGaps;
|
|
3539
|
+
const conversionGaps = [];
|
|
3540
|
+
const inheritedGaps = [];
|
|
3541
|
+
for (const [i, row] of source.entries()) {
|
|
3542
|
+
const { sequence, startMessage, endMessage, startMessageId, endMessageId } = row;
|
|
3543
|
+
const start = ordinal(startMessageId);
|
|
3544
|
+
const end = ordinal(endMessageId);
|
|
3545
|
+
let reason;
|
|
3546
|
+
if (stopped) {
|
|
3547
|
+
reason = "after first skipped compartment";
|
|
3548
|
+
} else {
|
|
3549
|
+
const startSeq = start === undefined ? proof.sequenceForId(startMessageId) : undefined;
|
|
3550
|
+
const endSeq = end === undefined ? proof.sequenceForId(endMessageId) : undefined;
|
|
3551
|
+
const previous = source[i - 1];
|
|
3552
|
+
const next = source[i + 1];
|
|
3553
|
+
if ((startSeq ?? -1) > map.throughSeq || (endSeq ?? -1) > map.throughSeq) {
|
|
3554
|
+
reason = "outside the fork boundary";
|
|
3555
|
+
} else if (startSeq !== undefined || endSeq !== undefined) {
|
|
3556
|
+
reason = "a live endpoint was not copied";
|
|
3557
|
+
} else if (row.rebaseStatus === "unresolved") {
|
|
3558
|
+
reason = "parent coordinates are unresolved";
|
|
3559
|
+
} else if (!Number.isSafeInteger(startMessage) || !Number.isSafeInteger(endMessage) || startMessage < 1 || endMessage < startMessage) {
|
|
3560
|
+
reason = "invalid message range";
|
|
3561
|
+
} else if (startMessage <= lastEnd) {
|
|
3562
|
+
reason = "range overlaps the inherited prefix";
|
|
3563
|
+
} else if (startMessage > lastEnd + 1 && validateStoredCompartments(lastEnd > 0 ? [{ startMessage: 1, endMessage: lastEnd }, row] : [row], acceptedGaps ??= proof.acceptedGaps(source, (gap) => conversionGaps.push(gap))) !== null) {
|
|
3564
|
+
reason = "gap before range";
|
|
3565
|
+
} else if (start !== undefined && start !== startMessage || end !== undefined && end !== endMessage) {
|
|
3566
|
+
reason = "live endpoint conflicts with the stored position";
|
|
3567
|
+
} else if (start === undefined && previous && ordinal(previous.endMessageId) !== lastEnd || end === undefined && (!next || next.startMessage !== endMessage + 1 || ordinal(next.startMessageId) !== endMessage + 1)) {
|
|
3568
|
+
reason = "live neighboring anchors do not prove the stored range";
|
|
3569
|
+
} else if ((end === undefined ? endMessage + 1 : endMessage) > (matchingPrefix ??= provePrefix())) {
|
|
3570
|
+
reason = "parent and fork raw prefixes do not match in order and body";
|
|
3571
|
+
} else {
|
|
3572
|
+
rows.set(sequence, {
|
|
3573
|
+
sequence,
|
|
3574
|
+
startMessage,
|
|
3575
|
+
endMessage,
|
|
3576
|
+
startMessageId: forkId(map.parentOrdinals.get(startMessage) ?? ""),
|
|
3577
|
+
endMessageId: forkId(map.parentOrdinals.get(endMessage) ?? "")
|
|
3578
|
+
});
|
|
3579
|
+
const conversionGap = conversionGaps.find(({ start, end }) => start === lastEnd + 1 && end === startMessage - 1);
|
|
3580
|
+
if (conversionGap)
|
|
3581
|
+
inheritedGaps.push(conversionGap);
|
|
3582
|
+
lastEnd = endMessage;
|
|
3583
|
+
continue;
|
|
3584
|
+
}
|
|
3585
|
+
stopped = true;
|
|
3586
|
+
}
|
|
3587
|
+
sessionLog2(proof.sessionId, `v2 fork skipped compartment ${sequence} (${startMessage}-${endMessage}): ${reason}`);
|
|
3588
|
+
}
|
|
3589
|
+
const keepRaw = new Set;
|
|
3590
|
+
if (stopped) {
|
|
3591
|
+
const count = map.parentOrdinals.size;
|
|
3592
|
+
const changes = new Int32Array(count + 2);
|
|
3593
|
+
const markCovered = (from, to) => {
|
|
3594
|
+
const start = Math.max(1, from);
|
|
3595
|
+
const end = Math.min(count, to);
|
|
3596
|
+
if (!Number.isSafeInteger(start) || !Number.isSafeInteger(end) || start > end)
|
|
3597
|
+
return;
|
|
3598
|
+
changes[start] = (changes[start] ?? 0) + 1;
|
|
3599
|
+
changes[end + 1] = (changes[end + 1] ?? 0) - 1;
|
|
3600
|
+
};
|
|
3601
|
+
const parentPositions = new Map([...map.parentOrdinals].map(([position, id]) => [id, position]));
|
|
3602
|
+
const liveOrdinal = (id) => {
|
|
3603
|
+
const position = parentPositions.get(id);
|
|
3604
|
+
if (position !== undefined)
|
|
3605
|
+
return position;
|
|
3606
|
+
return (proof.sequenceForId(id) ?? -1) > map.throughSeq ? count + 1 : undefined;
|
|
3607
|
+
};
|
|
3608
|
+
const live = source.map((row) => ({
|
|
3609
|
+
start: liveOrdinal(row.startMessageId),
|
|
3610
|
+
end: liveOrdinal(row.endMessageId)
|
|
3611
|
+
}));
|
|
3612
|
+
for (const [index, row] of source.entries()) {
|
|
3613
|
+
if (rows.has(row.sequence))
|
|
3614
|
+
continue;
|
|
3615
|
+
markCovered(row.startMessage, row.endMessage);
|
|
3616
|
+
const { start, end } = live[index] ?? {};
|
|
3617
|
+
if (start === undefined && end === undefined)
|
|
3618
|
+
continue;
|
|
3619
|
+
const previousEnd = live[index - 1]?.end;
|
|
3620
|
+
const nextStart = live[index + 1]?.start;
|
|
3621
|
+
const from = start ?? (previousEnd !== undefined ? previousEnd + 1 : index === 0 ? 1 : undefined);
|
|
3622
|
+
const to = end ?? (nextStart !== undefined ? nextStart - 1 : undefined);
|
|
3623
|
+
if (from !== undefined && to !== undefined)
|
|
3624
|
+
markCovered(from, to);
|
|
3625
|
+
else
|
|
3626
|
+
markCovered(Math.min(row.startMessage, from ?? row.startMessage), Math.max(row.endMessage, to ?? row.endMessage));
|
|
3627
|
+
}
|
|
3628
|
+
let covering = 0;
|
|
3629
|
+
for (const [position, id] of map.parentOrdinals) {
|
|
3630
|
+
covering += changes[position] ?? 0;
|
|
3631
|
+
if (covering > 0)
|
|
3632
|
+
keepRaw.add(id);
|
|
3633
|
+
}
|
|
3634
|
+
}
|
|
3635
|
+
return { rows, keepRaw, inheritedGaps };
|
|
3636
|
+
}
|
|
3637
|
+
function forkCloneFilter(idMap, copiedToolCallIds, proof, toolOwners) {
|
|
3514
3638
|
const mapMessageScoped = (id) => {
|
|
3515
3639
|
const direct = idMap.parentToFork.get(id);
|
|
3516
3640
|
if (direct)
|
|
@@ -3521,14 +3645,28 @@ function forkCloneFilter(idMap, copiedToolCallIds) {
|
|
|
3521
3645
|
const mapped = idMap.parentToFork.get(messageId);
|
|
3522
3646
|
return mapped ? `${mapped}${suffix}` : undefined;
|
|
3523
3647
|
};
|
|
3648
|
+
let keepRaw;
|
|
3649
|
+
let inheritedGaps = [];
|
|
3650
|
+
const includeMessageId = (messageId) => mapMessageScoped(messageId) !== undefined || copiedToolCallIds.has(messageId);
|
|
3524
3651
|
return {
|
|
3652
|
+
selectCompartments: proof && ((source) => {
|
|
3653
|
+
const plan = selectForkCompartments(source, idMap, proof);
|
|
3654
|
+
keepRaw = plan.keepRaw;
|
|
3655
|
+
inheritedGaps = plan.inheritedGaps;
|
|
3656
|
+
return plan.rows;
|
|
3657
|
+
}),
|
|
3658
|
+
inheritedCoordinateGaps: proof && (() => inheritedGaps),
|
|
3525
3659
|
resolveBoundaryOrdinal: (messageId) => {
|
|
3526
3660
|
const forkId = idMap.parentToFork.get(messageId);
|
|
3527
3661
|
return forkId ? idMap.forkOrdinals.get(forkId) : undefined;
|
|
3528
3662
|
},
|
|
3529
|
-
includeMessageId
|
|
3663
|
+
includeMessageId,
|
|
3664
|
+
includeReplayMessageId: (messageId) => includeMessageId(messageId) && !keepRaw?.has(splitMessageScopedId(messageId).messageId) && !toolOwners?.get(messageId)?.some((owner) => keepRaw?.has(owner)),
|
|
3530
3665
|
mapMessageId: (messageId) => mapMessageScoped(messageId) ?? messageId,
|
|
3531
3666
|
includeTag: (tag) => {
|
|
3667
|
+
const owner = tag.type === "tool" ? tag.toolOwnerMessageId : splitMessageScopedId(tag.messageId).messageId;
|
|
3668
|
+
if (owner && keepRaw?.has(owner))
|
|
3669
|
+
return false;
|
|
3532
3670
|
if (tag.type === "tool") {
|
|
3533
3671
|
return tag.toolOwnerMessageId !== null && idMap.parentToFork.has(tag.toolOwnerMessageId);
|
|
3534
3672
|
}
|
|
@@ -3572,7 +3710,20 @@ function seedV2ForkFromParent(args) {
|
|
|
3572
3710
|
return { kind: "parent-missing", parentSessionID, reason: "no copied rows pair up" };
|
|
3573
3711
|
const toolTags = db.prepare("SELECT message_id, tool_owner_message_id FROM tags WHERE session_id = ? AND type = 'tool'").all(parentSessionID);
|
|
3574
3712
|
const copiedToolCallIds = new Set(toolTags.filter((row) => row.tool_owner_message_id !== null && idMap.parentToFork.has(row.tool_owner_message_id)).map((row) => row.message_id));
|
|
3575
|
-
const
|
|
3713
|
+
const toolOwners = new Map;
|
|
3714
|
+
for (const row of toolTags) {
|
|
3715
|
+
if (!row.tool_owner_message_id)
|
|
3716
|
+
continue;
|
|
3717
|
+
const owners = toolOwners.get(row.message_id) ?? [];
|
|
3718
|
+
owners.push(row.tool_owner_message_id);
|
|
3719
|
+
toolOwners.set(row.message_id, owners);
|
|
3720
|
+
}
|
|
3721
|
+
const result = copySessionStateForClone(db, parentSessionID, sessionId, forkCloneFilter(idMap, copiedToolCallIds, {
|
|
3722
|
+
sessionId,
|
|
3723
|
+
sequenceForId: (id) => store.sequenceForId(parentSessionID, id),
|
|
3724
|
+
matchingBodies: () => store.matchingForkBodies(parentSessionID, sessionId, throughSeq),
|
|
3725
|
+
acceptedGaps: (source, onConversionGap) => nonNarrativeStoredGapRanges(db, parentSessionID, source, (start, end) => readV2MessageRange2(store, parentSessionID, start, Math.min(end, idMap.parentOrdinals.size)), onConversionGap)
|
|
3726
|
+
}, toolOwners));
|
|
3576
3727
|
if (result.kind === "destination-not-empty")
|
|
3577
3728
|
return { kind: "destination-not-empty", parentSessionID };
|
|
3578
3729
|
return { kind: "seeded", parentSessionID, pairedRows: idMap.parentToFork.size, result };
|
|
@@ -3743,6 +3894,7 @@ function isSessionNotFound(error) {
|
|
|
3743
3894
|
return /not\s*found/i.test(label);
|
|
3744
3895
|
}
|
|
3745
3896
|
function createNativeHiddenChildren(host, removeSession, options) {
|
|
3897
|
+
const quiet = supportsQuietHiddenChildren(options.hostVersion);
|
|
3746
3898
|
const removing = new Map;
|
|
3747
3899
|
const remove = (child) => {
|
|
3748
3900
|
const inFlight = removing.get(child.id);
|
|
@@ -3785,6 +3937,15 @@ function createNativeHiddenChildren(host, removeSession, options) {
|
|
|
3785
3937
|
};
|
|
3786
3938
|
const create = async (identity, role, model) => {
|
|
3787
3939
|
const input = childCreateInput(identity, role, model);
|
|
3940
|
+
const directory = identity.directory;
|
|
3941
|
+
if (quiet) {
|
|
3942
|
+
if (!host.createHolder)
|
|
3943
|
+
throw new Error("OpenCode 2 background holder API is not wired");
|
|
3944
|
+
const placement = await hiddenRunPlacement(host.createHolder, directory);
|
|
3945
|
+
input.id = placement.id;
|
|
3946
|
+
input.parentID = placement.parentID;
|
|
3947
|
+
delete input.location;
|
|
3948
|
+
}
|
|
3788
3949
|
const created = await host.create(input);
|
|
3789
3950
|
if (!created.id)
|
|
3790
3951
|
throw new Error("OpenCode 2 did not return a child session id");
|
|
@@ -3794,7 +3955,7 @@ function createNativeHiddenChildren(host, removeSession, options) {
|
|
|
3794
3955
|
try {
|
|
3795
3956
|
recordHiddenChild(options.db, {
|
|
3796
3957
|
id: created.id,
|
|
3797
|
-
directory
|
|
3958
|
+
directory,
|
|
3798
3959
|
created_at: createdAt,
|
|
3799
3960
|
deadline_at: createdAt + identity.timeoutMs
|
|
3800
3961
|
});
|
|
@@ -3820,17 +3981,22 @@ function createNativeHiddenChildren(host, removeSession, options) {
|
|
|
3820
3981
|
throw storeError;
|
|
3821
3982
|
}
|
|
3822
3983
|
}
|
|
3823
|
-
|
|
3824
|
-
options.log(`[magic-context] hidden child ${created.id} created role=${role} keep_subagents=${options.keepSubagents}`);
|
|
3825
|
-
return {
|
|
3984
|
+
const child = {
|
|
3826
3985
|
id: created.id,
|
|
3827
3986
|
role,
|
|
3828
3987
|
generation: options.generation,
|
|
3829
3988
|
title: roleTitle(role),
|
|
3830
3989
|
model,
|
|
3831
3990
|
created_at: createdAt,
|
|
3832
|
-
directory
|
|
3991
|
+
directory
|
|
3833
3992
|
};
|
|
3993
|
+
if (input.parentID && (created.id !== input.id || created.parentID !== input.parentID || !matchesHiddenRunLocation(directory, created.location?.directory))) {
|
|
3994
|
+
await remove(child);
|
|
3995
|
+
throw new Error(`OpenCode created a background run outside its holder at ${directory}`);
|
|
3996
|
+
}
|
|
3997
|
+
options.hook.registerChild(created.id, input.agent);
|
|
3998
|
+
options.log(`[magic-context] hidden child ${created.id} created role=${role} keep_subagents=${options.keepSubagents}`);
|
|
3999
|
+
return child;
|
|
3834
4000
|
};
|
|
3835
4001
|
const kept = (child) => keptUnderRetention(options.keepSubagents, child);
|
|
3836
4002
|
return {
|
|
@@ -4224,6 +4390,7 @@ async function createV2HiddenCompletionExecutor(host, options) {
|
|
|
4224
4390
|
db: options.db,
|
|
4225
4391
|
hook: options.hook,
|
|
4226
4392
|
generation,
|
|
4393
|
+
hostVersion: options.hostVersion,
|
|
4227
4394
|
keepSubagents: options.keepSubagents === true,
|
|
4228
4395
|
log: note,
|
|
4229
4396
|
removalTimeoutMs: options.removalTimeoutMs
|
|
@@ -5445,6 +5612,55 @@ function createV2EmbeddingScope(initialProject) {
|
|
|
5445
5612
|
};
|
|
5446
5613
|
}
|
|
5447
5614
|
|
|
5615
|
+
// src/v2/hooks/fork-history-status.ts
|
|
5616
|
+
var logged = new Set;
|
|
5617
|
+
var toasted = new Set;
|
|
5618
|
+
var isGap = (error) => error?.startsWith("gap before message ") === true;
|
|
5619
|
+
var diagnoses = new WeakMap;
|
|
5620
|
+
function readForkHistoryGap(db, openReader, sessionID) {
|
|
5621
|
+
const rows = db.prepare(`SELECT sequence, start_message AS startMessage, end_message AS endMessage,
|
|
5622
|
+
rebase_status AS rebaseStatus FROM compartments WHERE session_id = ? ORDER BY sequence`).all(sessionID);
|
|
5623
|
+
if (!isGap(validateStoredCompartments(rows)) || rows.some(({ rebaseStatus }) => rebaseStatus === "unresolved")) {
|
|
5624
|
+
diagnoses.get(db)?.delete(sessionID);
|
|
5625
|
+
return false;
|
|
5626
|
+
}
|
|
5627
|
+
let cache = diagnoses.get(db);
|
|
5628
|
+
if (!cache) {
|
|
5629
|
+
cache = new BoundedSessionMap(1000);
|
|
5630
|
+
diagnoses.set(db, cache);
|
|
5631
|
+
}
|
|
5632
|
+
const notice = db.prepare("SELECT coordinate_rebase_notice AS text FROM session_meta WHERE session_id = ?").get(sessionID);
|
|
5633
|
+
const reader = openReader();
|
|
5634
|
+
let gap;
|
|
5635
|
+
try {
|
|
5636
|
+
const key = JSON.stringify([
|
|
5637
|
+
rows,
|
|
5638
|
+
notice?.text ?? null,
|
|
5639
|
+
reader.messageCountAndNewestId(sessionID)
|
|
5640
|
+
]);
|
|
5641
|
+
const cached = cache.get(sessionID);
|
|
5642
|
+
if (cached?.key === key) {
|
|
5643
|
+
gap = cached.gap;
|
|
5644
|
+
} else {
|
|
5645
|
+
gap = Boolean(reader.forkOrigin(sessionID)) && isGap(validateStoredCompartments(rows, nonNarrativeStoredGapRanges(db, sessionID, rows, (from, to) => iterateV2MessageRange2(reader, sessionID, from, to))));
|
|
5646
|
+
cache.set(sessionID, { key, gap });
|
|
5647
|
+
}
|
|
5648
|
+
} finally {
|
|
5649
|
+
reader.close();
|
|
5650
|
+
}
|
|
5651
|
+
if (!gap)
|
|
5652
|
+
return false;
|
|
5653
|
+
if (!logged.has(sessionID)) {
|
|
5654
|
+
logged.add(sessionID);
|
|
5655
|
+
sessionLog2(sessionID, "v2 fork saved history has a gap; /ctx-recomp repairs this fork");
|
|
5656
|
+
}
|
|
5657
|
+
if (!toasted.has(sessionID) && isTuiConnected2(sessionID)) {
|
|
5658
|
+
toasted.add(sessionID);
|
|
5659
|
+
pushNotification2("toast", { message: renderUserFacingFailure("fork_history_gap", "plain"), variant: "warning" }, sessionID, { liveOnly: true });
|
|
5660
|
+
}
|
|
5661
|
+
return true;
|
|
5662
|
+
}
|
|
5663
|
+
|
|
5448
5664
|
// src/v2/hooks/generate.ts
|
|
5449
5665
|
import { createHash as createHash2 } from "node:crypto";
|
|
5450
5666
|
var typedArrayName = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype), Symbol.toStringTag)?.get;
|
|
@@ -6960,6 +7176,7 @@ async function registerContext(context) {
|
|
|
6960
7176
|
await cleanupLegacyOnce(database);
|
|
6961
7177
|
return createV2HiddenCompletionExecutor({
|
|
6962
7178
|
...context.session,
|
|
7179
|
+
createHolder: (input) => context.session.create(input),
|
|
6963
7180
|
watchModelActivity: (sessionID, onOutput) => hiddenModelActivity.watch(sessionID, onOutput),
|
|
6964
7181
|
get: async (input) => {
|
|
6965
7182
|
const session = await context.session.get(input);
|
|
@@ -6986,6 +7203,7 @@ async function registerContext(context) {
|
|
|
6986
7203
|
projectIdentity: resolveProjectIdentityForSession(directory, config.allow_home_project) ?? "",
|
|
6987
7204
|
directory,
|
|
6988
7205
|
hook: hiddenChildHook,
|
|
7206
|
+
hostVersion: context.app?.version,
|
|
6989
7207
|
keepSubagents: config.keep_subagents === true,
|
|
6990
7208
|
ensureAgent: () => hiddenAgentsReady ??= context.agent.reload(),
|
|
6991
7209
|
modelCatalog: () => Promise.resolve(context.model.list()),
|
|
@@ -7699,6 +7917,9 @@ async function registerContext(context) {
|
|
|
7699
7917
|
tagger,
|
|
7700
7918
|
...createV2ThresholdDeps(config),
|
|
7701
7919
|
contextUsageMap: usage,
|
|
7920
|
+
hostProjectBindingNotice: (sessionID, message) => {
|
|
7921
|
+
pushLiveNotification2("toast", { message, variant: "warning" }, sessionID);
|
|
7922
|
+
},
|
|
7702
7923
|
hostInputEstimate: (sessionID) => checkpointInputEstimates.get(sessionID),
|
|
7703
7924
|
onPassPermission: (sessionID, permission) => {
|
|
7704
7925
|
checkpointPassPermissions.set(sessionID, permission);
|
|
@@ -8464,6 +8685,7 @@ async function registerContext(context) {
|
|
|
8464
8685
|
hiddenCompletionExecutor: storageOpenedAtBoot ? hiddenCompletionExecutor : lateHiddenExecutor,
|
|
8465
8686
|
compactionMarkerStrategy: v2CompactionMarkerStrategy,
|
|
8466
8687
|
prepareHistorySession,
|
|
8688
|
+
readForkHistoryGap: (database, sessionID) => readForkHistoryGap(database, openStoreReader, sessionID),
|
|
8467
8689
|
readSessionDirectory: async (sessionID) => {
|
|
8468
8690
|
try {
|
|
8469
8691
|
return (await context.session.get({ sessionID })).location?.directory ?? null;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureMemoryEmbeddings2
|
|
3
|
-
} from "./index-
|
|
4
|
-
import"./index-
|
|
3
|
+
} from "./index-w8dcjt7f.js";
|
|
4
|
+
import"./index-shpyv8gq.js";
|
|
5
5
|
import"./index-4dhv7mqz.js";
|
|
6
6
|
import"./index-2amn2s73.js";
|
|
7
7
|
import"./index-qt1qqasc.js";
|
|
8
8
|
import"./index-zb4h9nrk.js";
|
|
9
9
|
import"./index-6nqz8hsz.js";
|
|
10
|
-
import"./index-
|
|
10
|
+
import"./index-vpw46557.js";
|
|
11
11
|
import"./index-snbpdpa3.js";
|
|
12
12
|
import"./index-pxnzyvjc.js";
|
|
13
|
-
import"./index-
|
|
13
|
+
import"./index-fpqdbb67.js";
|
|
14
14
|
import"./index-s32f8y67.js";
|
|
15
15
|
import"./index-q7q6qp1f.js";
|
|
16
16
|
import"./index-96ztjvkn.js";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const IDENTITY_MERGE_COMMAND = "npx @cortexkit/magic-context@latest doctor merge-identities";
|
|
2
|
+
export declare const IDENTITY_MERGE_PREVIEW_HINT = "It shows what would move. Add --apply to move them.";
|
|
3
|
+
export declare function identityMergeCommand(from: string, to?: string, platform?: NodeJS.Platform): string;
|
|
4
|
+
//# sourceMappingURL=identity-merge-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity-merge-command.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/memory/identity-merge-command.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,gEAAgE,CAAC;AACpG,eAAO,MAAM,2BAA2B,wDAAwD,CAAC;AAQjG,wBAAgB,oBAAoB,CAChC,IAAI,EAAE,MAAM,EACZ,EAAE,CAAC,EAAE,MAAM,EACX,QAAQ,kBAAmB,GAC5B,MAAM,CAER"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Database } from "../../../shared/sqlite";
|
|
2
|
+
/** Observe a host-owned binding on its request path. Background repairs do not have a user to notify. */
|
|
3
|
+
export declare function observeSessionProjectBinding(db: Database, sessionId: string, identity: string, directory: string, notify?: (text: string) => void): void;
|
|
4
|
+
export declare function getProjectBindingWarning(db: Database, sessionId: string): string | undefined;
|
|
5
|
+
//# sourceMappingURL=project-binding-notice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-binding-notice.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/memory/project-binding-notice.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAwBvD,yGAAyG;AACzG,wBAAgB,4BAA4B,CACxC,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAChC,IAAI,CAyDN;AAED,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE5F"}
|
|
@@ -25,6 +25,7 @@ export declare class ProjectIdentityError extends Error {
|
|
|
25
25
|
readonly rawDirectory: string;
|
|
26
26
|
constructor(errorClass: ProjectIdentityErrorClass, rawDirectory: string, message: string, cause?: Error);
|
|
27
27
|
}
|
|
28
|
+
export declare function directoryFallback(directory: string): string;
|
|
28
29
|
/**
|
|
29
30
|
* Strictly resolve the project identity for a filesystem directory.
|
|
30
31
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-identity.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/memory/project-identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAmDlD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAE/D;AAED,0FAA0F;AAC1F,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAgBtE;AAOD,qHAAqH;AACrH,MAAM,MAAM,yBAAyB,GAC/B,uBAAuB,GACvB,0BAA0B,GAC1B,cAAc,GACd,YAAY,GACZ,aAAa,GACb,aAAa,GACb,mBAAmB,GACnB,mBAAmB,GACnB,SAAS,CAAC;AAEhB;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,UAAU,EAAE,yBAAyB,CAAC;IAC/C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;gBAG1B,UAAU,EAAE,yBAAyB,EACrC,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,KAAK;CAUpB;
|
|
1
|
+
{"version":3,"file":"project-identity.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/memory/project-identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAmDlD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAE/D;AAED,0FAA0F;AAC1F,wBAAgB,2BAA2B,CAAC,SAAS,EAA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AAM,GAAG,IAAI,GAAG,SAAS,GAAG,QAAQ,IAAI,MAAM,CAE/F;AAED,wBAAgB,gCAAgC,CAC5C,SAAS,EAAE,MAAM,EACjB,gBAAgB,UAAwB,GACzC,MAAM,GAAG,SAAS,CA6DpB;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAWtE;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CACvC,iBAAiB,EAAE,MAAM,EACzB,eAAe,EAAE,MAAM,GACxB,OAAO,CAKT;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CA6B9D;AAED,wBAAgB,6BAA6B,CAAC,KAAK,EAAE;IACjD,YAAY,CAAC,EAAE,OAAO,YAAY,CAAC;IACnC,aAAa,CAAC,EAAE,MAAM,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB,GAAG,IAAI,CAMP;AAED,wBAAgB,+CAA+C,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAWxF;AAED,wBAAgB,6CAA6C,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAWtF;AAED,wBAAgB,8BAA8B,IAAI,IAAI,CAoBrD"}
|
|
@@ -12,12 +12,29 @@ export interface CloneTagRow {
|
|
|
12
12
|
tagNumber: number;
|
|
13
13
|
toolOwnerMessageId: string | null;
|
|
14
14
|
}
|
|
15
|
+
export interface CloneCompartmentBoundary extends CloneCompartmentRow {
|
|
16
|
+
rebaseStatus: string | null;
|
|
17
|
+
}
|
|
15
18
|
export interface CloneSessionStateFilter {
|
|
16
19
|
/** Require no destination metadata, even if the child has no compartments or tags yet. */
|
|
17
20
|
requireEmptyDestinationMeta?: boolean;
|
|
18
21
|
resolveBoundaryOrdinal(messageId: string): number | undefined;
|
|
22
|
+
/** Override compartment inheritance without changing other message identity lookups. */
|
|
23
|
+
selectCompartments?: (source: readonly CloneCompartmentBoundary[]) => ReadonlyMap<number, CloneCompartmentRow>;
|
|
24
|
+
/**
|
|
25
|
+
* Gaps between the copied summaries that the parent may have only because
|
|
26
|
+
* it was converted from OpenCode 1 (see `inheritedGaps` on
|
|
27
|
+
* `CoordinateRebaseNotice`). The fork records them, so its own summarizer
|
|
28
|
+
* accepts exactly these gaps and no others.
|
|
29
|
+
*/
|
|
30
|
+
inheritedCoordinateGaps?: () => readonly {
|
|
31
|
+
start: number;
|
|
32
|
+
end: number;
|
|
33
|
+
}[];
|
|
19
34
|
includeTag(tag: CloneTagRow): boolean;
|
|
20
35
|
includeMessageId(messageId: string): boolean;
|
|
36
|
+
/** Filter saved content-removal decisions independently of copied message and note IDs. */
|
|
37
|
+
includeReplayMessageId?: (messageId: string) => boolean;
|
|
21
38
|
/** Map a source message/content id into the destination session. */
|
|
22
39
|
mapMessageId?: (messageId: string) => string;
|
|
23
40
|
/** Opt into remapping globally keyed tag ids; leave undefined for Pi compatibility. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-clone.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/storage-clone.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAyBpD,MAAM,WAAW,mBAAmB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,WAAW;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED,MAAM,W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AE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAC3D,qBAAqB,CACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,kBAAkB,EAAE,SAAS,mBAAmB,EAAE,GACnD,MAAM,GAAG,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,8BAA8B;IAC3C,IAAI,EAAE,UAAU,GAAG,uBAAuB,CAAC;IAC3C,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB,EAAE,OAAO,CAAC;CAClC;AAkZD;;;;GAIG;AACH,wBAAgB,wBAAwB,CACpC,EAAE,EAAE,QAAQ,EACZ,eAAe,EAAE,MAAM,EACvB,oBAAoB,EAAE,MAAM,EAC5B,MAAM,EAAE,uBAAuB,GAChC,8BAA8B,CA0WhC"}
|
|
@@ -70,6 +70,19 @@ export interface CoordinateRebaseNotice {
|
|
|
70
70
|
* of sessions stamped by an older build from running again.
|
|
71
71
|
*/
|
|
72
72
|
neighbourRecoveryAt: number | null;
|
|
73
|
+
/**
|
|
74
|
+
* Set only on a fork. Summaries must normally follow each other without a
|
|
75
|
+
* gap. A session converted from OpenCode 1 is allowed gaps, because the
|
|
76
|
+
* conversion renumbered its messages; this notice is what records that
|
|
77
|
+
* conversion. A fork was never converted itself, so it lists the gaps it
|
|
78
|
+
* copied from such a parent, and only those are allowed. An empty list
|
|
79
|
+
* allows none.
|
|
80
|
+
*/
|
|
81
|
+
inheritedGaps?: InheritedCoordinateGap[];
|
|
82
|
+
}
|
|
83
|
+
export interface InheritedCoordinateGap {
|
|
84
|
+
start: number;
|
|
85
|
+
end: number;
|
|
73
86
|
}
|
|
74
87
|
/** One compartment named in the rebase notice: its sequence and message range. */
|
|
75
88
|
export interface CompartmentRangeNote {
|