@cortexkit/opencode-magic-context 0.49.80 → 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-m8yezwdj.js → conflict-warning-hook-a0wrnzch.js} +3 -3
- package/dist/{context-7rkrv5q8.js → context-00f1hdz2.js} +278 -43
- 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/inject-compartments.d.ts +16 -0
- package/dist/hooks/magic-context/inject-compartments.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-exvsw656.js → index-b2787fk6.js} +116 -42
- 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-ezgeq2z7.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-hpmx99e9.js → index-hz1xdb15.js} +3 -3
- package/dist/{index-xjpemea9.js → index-jvr9ba9y.js} +151 -37
- package/dist/{index-esqcwes7.js → index-nxxzeq4y.js} +4 -2
- package/dist/{index-m6rkq3t4.js → index-rnyaa7cj.js} +1 -1
- package/dist/{index-yfn52pb6.js → index-shpyv8gq.js} +2 -2
- package/dist/{index-pzvdf7sr.js → index-stx8zd81.js} +3 -3
- 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-mgvj4vkb.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-n7h0a0tn.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/conflict-detector.d.ts +6 -0
- package/dist/shared/conflict-detector.d.ts.map +1 -1
- package/dist/shared/conflict-fixer.d.ts +1 -0
- package/dist/shared/conflict-fixer.d.ts.map +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-f0wssyce.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-r1swhysg.js → context-gwkgh0wd.js} +398 -58
- package/dist/v2/{embedding-backfill-qnaswpmb.js → embedding-backfill-hjvjxp7d.js} +4 -4
- package/dist/v2/fold/owner.d.ts +8 -0
- package/dist/v2/fold/owner.d.ts.map +1 -1
- 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-4w2w4kd4.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-fqnty3nk.js → server-vt6nj2hn.js} +111 -37
- 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-0f4nwpbv.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-5k9hgb3t.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/conflict-detector.ts +35 -2
- package/src/shared/conflict-fixer.ts +10 -6
- package/src/shared/fold-render-lock-fence.test.ts +2 -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
|
@@ -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-
|
|
8
|
-
import"./index-
|
|
7
|
+
} from "./index-stx8zd81.js";
|
|
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,33 +304,34 @@ 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
|
|
328
|
-
} from "./index-
|
|
334
|
+
} from "./index-nxxzeq4y.js";
|
|
329
335
|
import {
|
|
330
336
|
STORAGE_NOTICE_PREFIX,
|
|
331
337
|
formatStorageRefusalNotice,
|
|
@@ -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,
|
|
@@ -1104,6 +1112,7 @@ ${head}
|
|
|
1104
1112
|
|
|
1105
1113
|
// src/v2/fold/owner.ts
|
|
1106
1114
|
var foldDigest = (value) => createHash("sha256").update(value).digest("hex");
|
|
1115
|
+
var boundToCheckpoint = (record) => record.cutSeq !== undefined || record.rendered !== undefined || record.answered !== undefined;
|
|
1107
1116
|
|
|
1108
1117
|
class FoldOwner {
|
|
1109
1118
|
storage;
|
|
@@ -1144,6 +1153,8 @@ class FoldOwner {
|
|
|
1144
1153
|
submittedSha: foldDigest(args.checkpointText)
|
|
1145
1154
|
};
|
|
1146
1155
|
}
|
|
1156
|
+
if (args.keepBound && previous && boundToCheckpoint(previous))
|
|
1157
|
+
return previous;
|
|
1147
1158
|
const head = args.materialize();
|
|
1148
1159
|
const submitted = args.checkpointText ?? head;
|
|
1149
1160
|
const next = {
|
|
@@ -3507,7 +3518,123 @@ function splitMessageScopedId(id) {
|
|
|
3507
3518
|
return { messageId: id, suffix: "" };
|
|
3508
3519
|
return { messageId: id.slice(0, -match[1].length), suffix: match[1] };
|
|
3509
3520
|
}
|
|
3510
|
-
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) {
|
|
3511
3638
|
const mapMessageScoped = (id) => {
|
|
3512
3639
|
const direct = idMap.parentToFork.get(id);
|
|
3513
3640
|
if (direct)
|
|
@@ -3518,14 +3645,28 @@ function forkCloneFilter(idMap, copiedToolCallIds) {
|
|
|
3518
3645
|
const mapped = idMap.parentToFork.get(messageId);
|
|
3519
3646
|
return mapped ? `${mapped}${suffix}` : undefined;
|
|
3520
3647
|
};
|
|
3648
|
+
let keepRaw;
|
|
3649
|
+
let inheritedGaps = [];
|
|
3650
|
+
const includeMessageId = (messageId) => mapMessageScoped(messageId) !== undefined || copiedToolCallIds.has(messageId);
|
|
3521
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),
|
|
3522
3659
|
resolveBoundaryOrdinal: (messageId) => {
|
|
3523
3660
|
const forkId = idMap.parentToFork.get(messageId);
|
|
3524
3661
|
return forkId ? idMap.forkOrdinals.get(forkId) : undefined;
|
|
3525
3662
|
},
|
|
3526
|
-
includeMessageId
|
|
3663
|
+
includeMessageId,
|
|
3664
|
+
includeReplayMessageId: (messageId) => includeMessageId(messageId) && !keepRaw?.has(splitMessageScopedId(messageId).messageId) && !toolOwners?.get(messageId)?.some((owner) => keepRaw?.has(owner)),
|
|
3527
3665
|
mapMessageId: (messageId) => mapMessageScoped(messageId) ?? messageId,
|
|
3528
3666
|
includeTag: (tag) => {
|
|
3667
|
+
const owner = tag.type === "tool" ? tag.toolOwnerMessageId : splitMessageScopedId(tag.messageId).messageId;
|
|
3668
|
+
if (owner && keepRaw?.has(owner))
|
|
3669
|
+
return false;
|
|
3529
3670
|
if (tag.type === "tool") {
|
|
3530
3671
|
return tag.toolOwnerMessageId !== null && idMap.parentToFork.has(tag.toolOwnerMessageId);
|
|
3531
3672
|
}
|
|
@@ -3569,7 +3710,20 @@ function seedV2ForkFromParent(args) {
|
|
|
3569
3710
|
return { kind: "parent-missing", parentSessionID, reason: "no copied rows pair up" };
|
|
3570
3711
|
const toolTags = db.prepare("SELECT message_id, tool_owner_message_id FROM tags WHERE session_id = ? AND type = 'tool'").all(parentSessionID);
|
|
3571
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));
|
|
3572
|
-
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));
|
|
3573
3727
|
if (result.kind === "destination-not-empty")
|
|
3574
3728
|
return { kind: "destination-not-empty", parentSessionID };
|
|
3575
3729
|
return { kind: "seeded", parentSessionID, pairedRows: idMap.parentToFork.size, result };
|
|
@@ -3740,6 +3894,7 @@ function isSessionNotFound(error) {
|
|
|
3740
3894
|
return /not\s*found/i.test(label);
|
|
3741
3895
|
}
|
|
3742
3896
|
function createNativeHiddenChildren(host, removeSession, options) {
|
|
3897
|
+
const quiet = supportsQuietHiddenChildren(options.hostVersion);
|
|
3743
3898
|
const removing = new Map;
|
|
3744
3899
|
const remove = (child) => {
|
|
3745
3900
|
const inFlight = removing.get(child.id);
|
|
@@ -3782,6 +3937,15 @@ function createNativeHiddenChildren(host, removeSession, options) {
|
|
|
3782
3937
|
};
|
|
3783
3938
|
const create = async (identity, role, model) => {
|
|
3784
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
|
+
}
|
|
3785
3949
|
const created = await host.create(input);
|
|
3786
3950
|
if (!created.id)
|
|
3787
3951
|
throw new Error("OpenCode 2 did not return a child session id");
|
|
@@ -3791,7 +3955,7 @@ function createNativeHiddenChildren(host, removeSession, options) {
|
|
|
3791
3955
|
try {
|
|
3792
3956
|
recordHiddenChild(options.db, {
|
|
3793
3957
|
id: created.id,
|
|
3794
|
-
directory
|
|
3958
|
+
directory,
|
|
3795
3959
|
created_at: createdAt,
|
|
3796
3960
|
deadline_at: createdAt + identity.timeoutMs
|
|
3797
3961
|
});
|
|
@@ -3817,17 +3981,22 @@ function createNativeHiddenChildren(host, removeSession, options) {
|
|
|
3817
3981
|
throw storeError;
|
|
3818
3982
|
}
|
|
3819
3983
|
}
|
|
3820
|
-
|
|
3821
|
-
options.log(`[magic-context] hidden child ${created.id} created role=${role} keep_subagents=${options.keepSubagents}`);
|
|
3822
|
-
return {
|
|
3984
|
+
const child = {
|
|
3823
3985
|
id: created.id,
|
|
3824
3986
|
role,
|
|
3825
3987
|
generation: options.generation,
|
|
3826
3988
|
title: roleTitle(role),
|
|
3827
3989
|
model,
|
|
3828
3990
|
created_at: createdAt,
|
|
3829
|
-
directory
|
|
3991
|
+
directory
|
|
3830
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;
|
|
3831
4000
|
};
|
|
3832
4001
|
const kept = (child) => keptUnderRetention(options.keepSubagents, child);
|
|
3833
4002
|
return {
|
|
@@ -4221,6 +4390,7 @@ async function createV2HiddenCompletionExecutor(host, options) {
|
|
|
4221
4390
|
db: options.db,
|
|
4222
4391
|
hook: options.hook,
|
|
4223
4392
|
generation,
|
|
4393
|
+
hostVersion: options.hostVersion,
|
|
4224
4394
|
keepSubagents: options.keepSubagents === true,
|
|
4225
4395
|
log: note,
|
|
4226
4396
|
removalTimeoutMs: options.removalTimeoutMs
|
|
@@ -5442,6 +5612,55 @@ function createV2EmbeddingScope(initialProject) {
|
|
|
5442
5612
|
};
|
|
5443
5613
|
}
|
|
5444
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
|
+
|
|
5445
5664
|
// src/v2/hooks/generate.ts
|
|
5446
5665
|
import { createHash as createHash2 } from "node:crypto";
|
|
5447
5666
|
var typedArrayName = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype), Symbol.toStringTag)?.get;
|
|
@@ -6957,6 +7176,7 @@ async function registerContext(context) {
|
|
|
6957
7176
|
await cleanupLegacyOnce(database);
|
|
6958
7177
|
return createV2HiddenCompletionExecutor({
|
|
6959
7178
|
...context.session,
|
|
7179
|
+
createHolder: (input) => context.session.create(input),
|
|
6960
7180
|
watchModelActivity: (sessionID, onOutput) => hiddenModelActivity.watch(sessionID, onOutput),
|
|
6961
7181
|
get: async (input) => {
|
|
6962
7182
|
const session = await context.session.get(input);
|
|
@@ -6983,6 +7203,7 @@ async function registerContext(context) {
|
|
|
6983
7203
|
projectIdentity: resolveProjectIdentityForSession(directory, config.allow_home_project) ?? "",
|
|
6984
7204
|
directory,
|
|
6985
7205
|
hook: hiddenChildHook,
|
|
7206
|
+
hostVersion: context.app?.version,
|
|
6986
7207
|
keepSubagents: config.keep_subagents === true,
|
|
6987
7208
|
ensureAgent: () => hiddenAgentsReady ??= context.agent.reload(),
|
|
6988
7209
|
modelCatalog: () => Promise.resolve(context.model.list()),
|
|
@@ -7499,20 +7720,18 @@ async function registerContext(context) {
|
|
|
7499
7720
|
}
|
|
7500
7721
|
}
|
|
7501
7722
|
})();
|
|
7502
|
-
const
|
|
7503
|
-
db = storage.require();
|
|
7504
|
-
const state = getOrCreateSessionMeta(db, draft.sessionID);
|
|
7723
|
+
const m0RenderOptions = (draft, store, state) => {
|
|
7505
7724
|
const modelKey = `${draft.model.providerID}/${draft.model.id}`;
|
|
7506
7725
|
const contextLimit = resolveContextLimit(draft.model.providerID, draft.model.id, {
|
|
7507
|
-
db,
|
|
7726
|
+
db: store,
|
|
7508
7727
|
sessionID: draft.sessionID
|
|
7509
7728
|
}) || draft.model.limit?.context || (state.lastObservedModelKey === modelKey ? state.lastUsageContextLimit : undefined);
|
|
7510
|
-
return
|
|
7729
|
+
return {
|
|
7511
7730
|
...createM0RenderOptions({
|
|
7512
7731
|
...createV2TransformFeatureDeps(config, compactionOff, directory, embeddings.ensureRegistered),
|
|
7513
7732
|
...createV2ThresholdDeps(config)
|
|
7514
7733
|
}, usage.get(draft.sessionID)?.usage ?? { percentage: 0, inputTokens: 0 }, modelKey, contextLimit, resolveProjectIdentityForSession(directory, config.allow_home_project)),
|
|
7515
|
-
db,
|
|
7734
|
+
db: store,
|
|
7516
7735
|
sessionId: draft.sessionID,
|
|
7517
7736
|
state,
|
|
7518
7737
|
projectDirectory: directory,
|
|
@@ -7520,11 +7739,21 @@ async function registerContext(context) {
|
|
|
7520
7739
|
systemHash: state.systemPromptHash ?? "",
|
|
7521
7740
|
toolSetHash: getCurrentToolSetHash(draft.model.providerID, draft.model.id, draft.agent, draft.sessionID),
|
|
7522
7741
|
toolDefinitionsHash: toolDefinitionsHashes.get(draft.sessionID),
|
|
7523
|
-
modelKey
|
|
7742
|
+
modelKey,
|
|
7524
7743
|
cacheExpired: false,
|
|
7525
7744
|
lastResponseTime: state.lastResponseTime
|
|
7526
7745
|
}
|
|
7527
|
-
}
|
|
7746
|
+
};
|
|
7747
|
+
};
|
|
7748
|
+
const materialize = (draft) => {
|
|
7749
|
+
db = storage.require();
|
|
7750
|
+
const state = getOrCreateSessionMeta(db, draft.sessionID);
|
|
7751
|
+
return materializeM0(m0RenderOptions(draft, db, state)).m0Text;
|
|
7752
|
+
};
|
|
7753
|
+
const renderUnkeptBaseline = (draft) => {
|
|
7754
|
+
const store = storage.require();
|
|
7755
|
+
const state = readSessionMeta(store, draft.sessionID);
|
|
7756
|
+
return materializeM0(m0RenderOptions(draft, store, state), { persist: false }).m0Text;
|
|
7528
7757
|
};
|
|
7529
7758
|
await context.session.hook("compaction", async (draft) => {
|
|
7530
7759
|
const hiddenSummary = hiddenChildHook.compactionSummary(draft.sessionID, draft.agent);
|
|
@@ -7547,7 +7776,7 @@ async function registerContext(context) {
|
|
|
7547
7776
|
const source = !rustModeModuleClient ? "typescript" : moduleBaseline === null ? "typescript_fallback" : "module";
|
|
7548
7777
|
if (nativeFoldReplay) {
|
|
7549
7778
|
try {
|
|
7550
|
-
const state = getOrCreateSessionMeta(storage.require(), draft.sessionID);
|
|
7779
|
+
const state = running ? getOrCreateSessionMeta(storage.require(), draft.sessionID) : readSessionMeta(storage.require(), draft.sessionID);
|
|
7551
7780
|
const staged = manual && moduleBaseline == null ? stageManualBaseline(storage.require(), draft.sessionID, () => materialize(draft)) : undefined;
|
|
7552
7781
|
const publishedHistory = Boolean(storage.require().prepare("SELECT 1 FROM compartments WHERE session_id = ? LIMIT 1").get(draft.sessionID));
|
|
7553
7782
|
const owned = await folds.read(draft.sessionID);
|
|
@@ -7596,14 +7825,16 @@ async function registerContext(context) {
|
|
|
7596
7825
|
watermark,
|
|
7597
7826
|
runningCut: running?.seq,
|
|
7598
7827
|
materialize: () => {
|
|
7599
|
-
const summary = moduleBaseline ?? materialize(draft);
|
|
7828
|
+
const summary = moduleBaseline ?? (running ? materialize(draft) : renderUnkeptBaseline(draft));
|
|
7600
7829
|
return hasFoldSummary(summary) ? summary : RAW_HISTORY_ACCOUNT;
|
|
7601
7830
|
},
|
|
7602
7831
|
checkpointText: CHECKPOINT_NOTE,
|
|
7603
|
-
checkpointID: running?.id
|
|
7832
|
+
checkpointID: running?.id,
|
|
7833
|
+
keepBound: running === undefined
|
|
7604
7834
|
});
|
|
7605
|
-
|
|
7606
|
-
draft.
|
|
7835
|
+
const answer = running === undefined && boundToCheckpoint(fold) ? CHECKPOINT_NOTE : fold.submitted;
|
|
7836
|
+
sessionLog2(draft.sessionID, `v2 compaction hook: fired answered=true source=${source} row=${running ? "running" : "none"}`);
|
|
7837
|
+
draft.result = { summary: answer, metadata: { keepID: undefined } };
|
|
7607
7838
|
} catch (cause) {
|
|
7608
7839
|
await refuseBeforeProvider(context.session, draft.sessionID, "compaction-fold", cause);
|
|
7609
7840
|
throw new V2ContextRefusal("Magic Context could not preserve the host checkpoint.", {
|
|
@@ -7686,6 +7917,9 @@ async function registerContext(context) {
|
|
|
7686
7917
|
tagger,
|
|
7687
7918
|
...createV2ThresholdDeps(config),
|
|
7688
7919
|
contextUsageMap: usage,
|
|
7920
|
+
hostProjectBindingNotice: (sessionID, message) => {
|
|
7921
|
+
pushLiveNotification2("toast", { message, variant: "warning" }, sessionID);
|
|
7922
|
+
},
|
|
7689
7923
|
hostInputEstimate: (sessionID) => checkpointInputEstimates.get(sessionID),
|
|
7690
7924
|
onPassPermission: (sessionID, permission) => {
|
|
7691
7925
|
checkpointPassPermissions.set(sessionID, permission);
|
|
@@ -8451,6 +8685,7 @@ async function registerContext(context) {
|
|
|
8451
8685
|
hiddenCompletionExecutor: storageOpenedAtBoot ? hiddenCompletionExecutor : lateHiddenExecutor,
|
|
8452
8686
|
compactionMarkerStrategy: v2CompactionMarkerStrategy,
|
|
8453
8687
|
prepareHistorySession,
|
|
8688
|
+
readForkHistoryGap: (database, sessionID) => readForkHistoryGap(database, openStoreReader, sessionID),
|
|
8454
8689
|
readSessionDirectory: async (sessionID) => {
|
|
8455
8690
|
try {
|
|
8456
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"}
|