@cortexkit/opencode-magic-context 0.49.7 → 0.49.8
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 +6 -6
- package/dist/compaction-marker-candidates-worker.js +2 -2
- package/dist/{compaction-marker-candidates-a0edbqrr.js → compaction-marker-candidates-xxz35vwp.js} +3 -3
- package/dist/{conflict-warning-hook-myk5hbt9.js → conflict-warning-hook-w3crzrar.js} +8 -8
- package/dist/{context-ffr7e0g7.js → context-x0ccfv0f.js} +65 -42
- package/dist/{derive-budgets-j4ry8j8n.js → derive-budgets-3nbxsyss.js} +2 -2
- package/dist/embedding-backfill-3h2m5n0q.js +21 -0
- package/dist/embedding-worker-process.js +6 -2
- package/dist/embedding-worker.js +6 -5
- package/dist/features/magic-context/compaction-marker-candidates.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/cron.d.ts +2 -0
- package/dist/features/magic-context/dreamer/cron.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/provider-output-failure.d.ts +1 -0
- package/dist/features/magic-context/dreamer/provider-output-failure.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-local.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-worker-client.d.ts.map +1 -1
- package/dist/features/magic-context/message-index-async.d.ts.map +1 -1
- package/dist/features/magic-context/migration-worker-client.d.ts.map +1 -1
- package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
- package/dist/features/magic-context/smart-notes/wake-plane.d.ts.map +1 -1
- package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -1
- package/dist/history-owner-ty29fz0f.js +244 -0
- package/dist/hooks/auto-update-checker/checker.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-worker-client.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-recomp.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/edit-marker.d.ts +2 -0
- package/dist/hooks/magic-context/edit-marker.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-transport.d.ts +1 -0
- package/dist/hooks/magic-context/module-transport.d.ts.map +1 -1
- package/dist/hooks/magic-context/raw-ordinal-warmup.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-chunk.d.ts +8 -4
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-mode-transform.d.ts +1 -0
- package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-refusal-recovery.d.ts.map +1 -1
- package/dist/hooks/magic-context/tool-drop-target.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/unresolved-history-boundary.d.ts +5 -1
- package/dist/hooks/magic-context/unresolved-history-boundary.d.ts.map +1 -1
- package/dist/hooks/magic-context/wrapup-orchestrator.d.ts.map +1 -1
- package/dist/{index-g8qbdb03.js → index-0jz47061.js} +6 -3
- package/dist/{index-4mjhqadz.js → index-150zz6fh.js} +1 -1
- package/dist/{index-j58gqrn2.js → index-2rw244rh.js} +31 -24
- package/dist/{index-0gyq3djm.js → index-4hb8nt93.js} +3 -3
- package/dist/{index-ax2jhztn.js → index-7bjgyaj1.js} +4 -4
- package/dist/{index-h2wc01qk.js → index-8kk7yh6m.js} +2 -2
- package/dist/{index-n5a170gs.js → index-9g1c4bt9.js} +81 -58
- package/dist/{index-w6bd03dc.js → index-a43xq1pg.js} +5 -5
- package/dist/{index-tqf7yg27.js → index-a4b0gbyg.js} +1 -1
- package/dist/{index-37q80veb.js → index-angx1s0k.js} +4 -3
- package/dist/{index-wq16ahsn.js → index-b4gcb3rk.js} +8 -8
- package/dist/{index-z1tjp257.js → index-b64n4d0h.js} +1 -1
- package/dist/{index-1bt88epp.js → index-bd9cjab3.js} +1 -1
- package/dist/{index-gbmqa9x9.js → index-bmwfzz28.js} +9 -6
- package/dist/{index-qx53vezw.js → index-gjvjh960.js} +1 -1
- package/dist/{index-ebnngykq.js → index-gzg9ekc1.js} +19 -18
- package/dist/{index-5tbvdff4.js → index-hxrvx6cy.js} +79 -40
- package/dist/{index-w23dh319.js → index-jw4gbfkv.js} +1 -1
- package/dist/index-knvkbfvh.js +25 -0
- package/dist/{index-vkbqdnkj.js → index-kvw6xew3.js} +6 -3
- package/dist/{index-rzmjkdd6.js → index-mp2kghkv.js} +3 -27
- package/dist/{index-nsjyysj0.js → index-mvvephtj.js} +5 -1
- package/dist/{index-9yyqq3mm.js → index-n78avt2p.js} +1 -1
- package/dist/{index-vt4sf4ep.js → index-pgy3h49n.js} +4 -4
- package/dist/{index-w6vr754t.js → index-pjgzdezw.js} +13 -9
- package/dist/{v2/server-1rfgbjfn.js → index-q28hsbpg.js} +15 -3
- package/dist/{index-a8acx4gc.js → index-q76br5zn.js} +3 -3
- package/dist/{index-j5hce1ab.js → index-qgp5vnt4.js} +5 -5
- package/dist/{index-sf94at64.js → index-rg1cezmj.js} +22 -22
- package/dist/{index-sh91t19a.js → index-s178h9z8.js} +4 -3
- package/dist/{index-tagss15p.js → index-w1ejb9qr.js} +105 -58
- package/dist/{index-k6xvbj2e.js → index-w28y7d0z.js} +2 -0
- package/dist/{index-j8epsc0g.js → index-wafzvyhg.js} +33 -10
- package/dist/{index-rwmpkss5.js → index-xf6k8szp.js} +4 -4
- package/dist/{index-tmtty2x5.js → index-xpn05jxq.js} +4 -4
- package/dist/{index-n7kwfw2r.js → index-ydjgz36f.js} +7 -7
- package/dist/{index-4btknbqh.js → index-zf9nydbd.js} +48 -38
- package/dist/index.js +51 -50
- package/dist/{logger-ewak5q1s.js → logger-wn328tfg.js} +1 -1
- package/dist/{message-index-bounded-04rycpx4.js → message-index-bounded-hxjp56qk.js} +16 -16
- package/dist/{message-index-rqtse28y.js → message-index-zs882h8e.js} +16 -16
- package/dist/{message-time-backfill-a5ytnp53.js → message-time-backfill-nb5hhnrt.js} +3 -3
- package/dist/migration-worker.js +11 -11
- package/dist/plugin/boot-quiet.d.ts.map +1 -1
- package/dist/plugin/dream-timer.d.ts.map +1 -1
- package/dist/plugin/rpc-handlers.d.ts +2 -0
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/{project-embedding-registry-k0sd9k7v.js → project-embedding-registry-vy7sv9jt.js} +11 -11
- package/dist/raw-ordinal-warmup-worker.js +6 -6
- package/dist/{read-session-chunk-h1btx938.js → read-session-chunk-t9r7r0sg.js} +11 -11
- package/dist/{read-session-raw-vdf4wh78.js → read-session-raw-gm6xj30v.js} +3 -3
- package/dist/recomp-orchestrator-gr36zvd2.js +60 -0
- package/dist/{safe-notification-target-q0cyrx3x.js → safe-notification-target-jdynm677.js} +2 -2
- package/dist/{search-3rbdx6hw.js → search-qjen1pmz.js} +24 -24
- package/dist/{send-session-notification-2tp44tfa.js → send-session-notification-q8ngbap3.js} +6 -6
- package/dist/shared/history-owner.d.ts +12 -0
- package/dist/shared/history-owner.d.ts.map +1 -0
- package/dist/shared/off-thread-migration-clock.d.ts +8 -1
- package/dist/shared/off-thread-migration-clock.d.ts.map +1 -1
- package/dist/shared/redaction.d.ts.map +1 -1
- package/dist/shared/rpc-server.d.ts.map +1 -1
- package/dist/shared/sqlite.d.ts +2 -0
- package/dist/shared/sqlite.d.ts.map +1 -1
- package/dist/shared/user-facing-codes.d.ts +2 -2
- package/dist/{sqlite-j3tvg8r0.js → sqlite-4pqyynrs.js} +3 -1
- package/dist/{storage-memory-8168bgef.js → storage-memory-j3v3hc83.js} +2 -2
- package/dist/{storage-tags-61z5j2f9.js → storage-tags-a513rkj3.js} +5 -5
- package/dist/{transform-postprocess-phase-7qts7h54.js → transform-postprocess-phase-yv463b7y.js} +30 -30
- package/dist/v2/auto-search-worker.js +6 -6
- package/dist/v2/{compaction-marker-candidates-6nypjkpf.js → compaction-marker-candidates-a15w3mqh.js} +3 -3
- package/dist/v2/compaction-marker-candidates-worker.js +2 -2
- package/dist/v2/{context-xq4rtywr.js → context-wd82v9z6.js} +137 -68
- package/dist/v2/{derive-budgets-enckmg7y.js → derive-budgets-0rmpmxjw.js} +3 -3
- package/dist/v2/embedding-backfill-vr7wdtrf.js +20 -0
- package/dist/v2/embedding-worker-process.js +6 -2
- package/dist/v2/embedding-worker.js +6 -5
- package/dist/v2/hidden-completion.d.ts.map +1 -1
- package/dist/v2/history-owner-2cr9py37.js +243 -0
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/store.d.ts +1 -0
- package/dist/v2/hooks/store.d.ts.map +1 -1
- package/dist/v2/{logger-pj02s7sr.js → logger-te6e1j72.js} +1 -1
- package/dist/v2/{message-index-bounded-5vh1h2g7.js → message-index-bounded-madg2kfr.js} +16 -16
- package/dist/v2/{message-index-8e5z2xx8.js → message-index-yd94vt9n.js} +16 -16
- package/dist/v2/{message-time-backfill-2z365239.js → message-time-backfill-rz1pnpaj.js} +3 -3
- package/dist/v2/migration-worker.js +11 -11
- package/dist/v2/{project-embedding-registry-b77awytr.js → project-embedding-registry-ja23aygk.js} +11 -11
- package/dist/v2/raw-ordinal-warmup-worker.js +6 -6
- package/dist/v2/{read-session-chunk-4sat83cx.js → read-session-chunk-7qs791f3.js} +11 -11
- package/dist/v2/{read-session-raw-a3hw9jsp.js → read-session-raw-h4azh85b.js} +3 -3
- package/dist/v2/recomp-orchestrator-ee91r9s6.js +59 -0
- package/dist/v2/{safe-notification-target-y3p1hce9.js → safe-notification-target-936374xx.js} +2 -2
- package/dist/v2/search-pn15rr52.js +46 -0
- package/dist/v2/{send-session-notification-ppgc8qdz.js → send-session-notification-6n7chhyp.js} +6 -6
- package/dist/v2/{server-v4fwha43.js → server-08k4zkfk.js} +48 -38
- package/dist/v2/{server-ras2sxnc.js → server-44ryn9rb.js} +9 -6
- package/dist/v2/{server-fw31krgq.js → server-4easnf78.js} +19 -19
- package/dist/v2/{server-hcvcxzx7.js → server-4gz0xkrc.js} +5 -5
- package/dist/v2/{server-d6g4whc2.js → server-4qr18rfg.js} +3 -3
- package/dist/v2/{server-sy4b1sra.js → server-4rs8sm06.js} +5 -5
- package/dist/v2/{server-brhj8qtd.js → server-63ha7f0f.js} +3 -27
- package/dist/v2/{server-3t0q2cqx.js → server-7dv9wt9r.js} +1 -1
- package/dist/v2/{server-cw6521wn.js → server-7e087rvk.js} +2 -0
- package/dist/v2/{server-hb6xhh9q.js → server-988cqjme.js} +6 -3
- package/dist/v2/{server-fpqe39as.js → server-9a6bwc12.js} +4 -4
- package/dist/v2/{server-t4k4qexw.js → server-9e5r8y60.js} +5 -1
- package/dist/v2/{server-7ekna9zs.js → server-adfte03x.js} +2 -2
- package/dist/v2/{server-qcw43339.js → server-ak7w74j9.js} +4 -4
- package/dist/v2/{server-dd0nja67.js → server-bx59ezg6.js} +4 -3
- package/dist/v2/{server-676xw7at.js → server-ckrb5rm8.js} +1 -1
- package/dist/{index-w4mw92w3.js → v2/server-cxsr0ng6.js} +15 -3
- package/dist/v2/{server-t528t8qm.js → server-hn9fb3v0.js} +2 -2
- package/dist/v2/{server-7srtwsa4.js → server-j3dm74ey.js} +9 -9
- package/dist/v2/{server-w3zeywp1.js → server-jjsf29aq.js} +4 -4
- package/dist/v2/server-knvkbfvh.js +25 -0
- package/dist/v2/{server-9yyqq3mm.js → server-n78avt2p.js} +1 -1
- package/dist/v2/{server-kdrezdy0.js → server-njnx39q2.js} +6 -3
- package/dist/v2/{server-x08d1xf3.js → server-npm52h2q.js} +4 -3
- package/dist/v2/{server-vb7pbd9p.js → server-nveratm5.js} +1 -1
- package/dist/v2/{server-mv1w7t6z.js → server-q360kdb8.js} +77 -38
- package/dist/v2/{server-kzns2hbz.js → server-s6jqh8bj.js} +1 -1
- package/dist/v2/{server-6byqfbqf.js → server-shme41gj.js} +1 -1
- package/dist/v2/{server-j8epsc0g.js → server-wafzvyhg.js} +33 -10
- package/dist/v2/{server-gtv9wbhq.js → server-xj4mewze.js} +81 -58
- package/dist/v2/{server-nfan6zb6.js → server-y5g32dhq.js} +31 -24
- package/dist/v2/{server-jdwd03ep.js → server-yak3sxya.js} +7 -7
- package/dist/v2/{server-wkdgjjch.js → server-zrwaj29a.js} +2 -2
- package/dist/v2/server.js +7 -6
- package/dist/v2/{sqlite-j3tvg8r0.js → sqlite-4pqyynrs.js} +3 -1
- package/dist/v2/{storage-memory-8168bgef.js → storage-memory-j3v3hc83.js} +2 -2
- package/dist/v2/{storage-tags-j2fzq3sw.js → storage-tags-spa92sgj.js} +5 -5
- package/dist/v2/store-reader.d.ts.map +1 -1
- package/dist/v2/{wrapup-orchestrator-s92ebfzv.js → wrapup-orchestrator-5wxy1ggv.js} +38 -35
- package/dist/wrapup-orchestrator-gv08c6f9.js +47 -0
- package/package.json +1 -1
- package/src/config/compaction-accessor-guard.test.ts +3 -0
- package/src/features/magic-context/dreamer/cron.ts +8 -0
- package/src/shared/history-owner.test.ts +60 -0
- package/src/shared/history-owner.ts +43 -0
- package/src/shared/host-stall-profiler-node.ts +3 -1
- package/src/shared/host-stall-profiler.ts +3 -1
- package/src/shared/off-thread-migration-clock.test.ts +80 -10
- package/src/shared/off-thread-migration-clock.ts +37 -13
- package/src/shared/redaction.test.ts +16 -0
- package/src/shared/redaction.ts +8 -1
- package/src/shared/root-async-context.probe.mjs +36 -0
- package/src/shared/root-async-context.test.ts +49 -0
- package/src/shared/rpc-server.ts +27 -23
- package/src/shared/sqlite-busy-budget-review.test.ts +291 -0
- package/src/shared/sqlite-foreground-wait.test.ts +253 -1
- package/src/shared/sqlite.ts +55 -14
- package/src/shared/user-facing-codes.ts +2 -2
- package/dist/embedding-backfill-re16xncd.js +0 -21
- package/dist/recomp-orchestrator-trcgmm23.js +0 -60
- package/dist/v2/embedding-backfill-xd9ygzgd.js +0 -20
- package/dist/v2/recomp-orchestrator-n11zv1f1.js +0 -59
- package/dist/v2/search-mvgqtkkz.js +0 -46
- package/dist/wrapup-orchestrator-df61jmz9.js +0 -47
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
resolveLegacyConfigSources,
|
|
10
10
|
getProtectedTokensTierOverrides,
|
|
11
11
|
loadPluginConfigDetailed
|
|
12
|
-
} from "./server-
|
|
12
|
+
} from "./server-4qr18rfg.js";
|
|
13
13
|
import {
|
|
14
14
|
getHarness2,
|
|
15
15
|
harnessOwnsOpenCodeStore2
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
log2,
|
|
25
25
|
sessionLog2,
|
|
26
26
|
getLoggerDiagnostics2
|
|
27
|
-
} from "./server-
|
|
27
|
+
} from "./server-9e5r8y60.js";
|
|
28
28
|
import {
|
|
29
29
|
hasTrustedAbsoluteWall,
|
|
30
30
|
applyProvenInputFloor,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
getSdkContextLimit,
|
|
37
37
|
getSdkOutputLimit,
|
|
38
38
|
getModelsDevCacheState
|
|
39
|
-
} from "./server-
|
|
39
|
+
} from "./server-nveratm5.js";
|
|
40
40
|
import {
|
|
41
41
|
withContentLanguageDirective,
|
|
42
42
|
parseCron,
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
DEFAULT_HISTORIAN_TIMEOUT_MS,
|
|
49
49
|
DEFAULT_LOCAL_EMBEDDING_MODEL,
|
|
50
50
|
DREAM_TASK_PROMOTION_DEFAULTS
|
|
51
|
-
} from "./server-
|
|
51
|
+
} from "./server-7e087rvk.js";
|
|
52
52
|
import {
|
|
53
53
|
historianRunConfig,
|
|
54
54
|
dreamerRunConfig,
|
|
@@ -265,7 +265,7 @@ import {
|
|
|
265
265
|
startCompartmentAgent,
|
|
266
266
|
setRecompStarting2,
|
|
267
267
|
setRecompTerminal2
|
|
268
|
-
} from "./server-
|
|
268
|
+
} from "./server-q360kdb8.js";
|
|
269
269
|
import {
|
|
270
270
|
CANONICAL_DREAM_TASKS,
|
|
271
271
|
DREAM_TASK_CAPABILITIES,
|
|
@@ -303,7 +303,7 @@ import {
|
|
|
303
303
|
openDatabaseAsync,
|
|
304
304
|
isDatabasePersisted,
|
|
305
305
|
getDatabasePersistenceError
|
|
306
|
-
} from "./server-
|
|
306
|
+
} from "./server-08k4zkfk.js";
|
|
307
307
|
import {
|
|
308
308
|
setHomeProjectPermission,
|
|
309
309
|
shouldSkipHomeProjectMemory,
|
|
@@ -319,7 +319,7 @@ import {
|
|
|
319
319
|
storedPathBelongsToIdentity,
|
|
320
320
|
beginBootQuietPeriod,
|
|
321
321
|
scheduleAfterBootQuiet
|
|
322
|
-
} from "./server-
|
|
322
|
+
} from "./server-njnx39q2.js";
|
|
323
323
|
import {
|
|
324
324
|
detectLatestTurnThinkingMismatch,
|
|
325
325
|
isPrefixBoundThinkingModel,
|
|
@@ -499,11 +499,12 @@ import {
|
|
|
499
499
|
readRawSessionMessageIdOrdinalsForRange2,
|
|
500
500
|
readRawSessionMessagePartsById2,
|
|
501
501
|
readRawSessionBoundaryEndpoints2,
|
|
502
|
+
hasRawSessionMessageById2,
|
|
502
503
|
readRawSessionMessageOrdinalById2,
|
|
503
504
|
readRawSessionMessageById2,
|
|
504
505
|
readSessionChunk2,
|
|
505
506
|
readRawSessionSeedTail2
|
|
506
|
-
} from "./server-
|
|
507
|
+
} from "./server-xj4mewze.js";
|
|
507
508
|
import {
|
|
508
509
|
textMentionsRecentCommit,
|
|
509
510
|
hasMeaningfulUserText2,
|
|
@@ -514,7 +515,7 @@ import {
|
|
|
514
515
|
estimateTokens,
|
|
515
516
|
estimateFixedPromptTokens,
|
|
516
517
|
normalizeText
|
|
517
|
-
} from "./server-
|
|
518
|
+
} from "./server-s6jqh8bj.js";
|
|
518
519
|
import {
|
|
519
520
|
SubcClient,
|
|
520
521
|
connectionFileExists,
|
|
@@ -522,8 +523,9 @@ import {
|
|
|
522
523
|
toSynapseLaneDescriptor,
|
|
523
524
|
formatSynapseLaneDescriptor,
|
|
524
525
|
SynapseEmbeddingProvider
|
|
525
|
-
} from "./server-
|
|
526
|
+
} from "./server-988cqjme.js";
|
|
526
527
|
import {
|
|
528
|
+
inRootAsyncContext2,
|
|
527
529
|
getTagIdentityWriteGeneration2,
|
|
528
530
|
Database2,
|
|
529
531
|
getSqliteDatabasePath2,
|
|
@@ -535,21 +537,18 @@ import {
|
|
|
535
537
|
isTransientSqliteError2,
|
|
536
538
|
SqliteAcquisitionBusyError2,
|
|
537
539
|
withAsyncPrivilegedWriter2
|
|
538
|
-
} from "./server-
|
|
539
|
-
import
|
|
540
|
-
sameProjectDirectory,
|
|
541
|
-
canonicalProjectDirectory
|
|
542
|
-
} from "./server-brhj8qtd.js";
|
|
540
|
+
} from "./server-wafzvyhg.js";
|
|
541
|
+
import"./server-63ha7f0f.js";
|
|
543
542
|
import {
|
|
544
543
|
deleteChunkEmbedBackoffForSession
|
|
545
|
-
} from "./server-
|
|
544
|
+
} from "./server-9a6bwc12.js";
|
|
546
545
|
import {
|
|
547
546
|
registerOwnRpcServerInstance,
|
|
548
547
|
rpcPortDir,
|
|
549
548
|
rpcPortFilePath,
|
|
550
549
|
parseRpcPortFile,
|
|
551
550
|
inspectProcessesAsync
|
|
552
|
-
} from "./server-
|
|
551
|
+
} from "./server-cxsr0ng6.js";
|
|
553
552
|
import {
|
|
554
553
|
BoundedSessionMap,
|
|
555
554
|
LkgRecoveryFenceError,
|
|
@@ -568,14 +567,14 @@ import {
|
|
|
568
567
|
isMessageIndexReconciledThrough2,
|
|
569
568
|
indexMessagesAfterOrdinal2,
|
|
570
569
|
sweepOrphanedOpenCodeMessageIndexes2
|
|
571
|
-
} from "./server-
|
|
570
|
+
} from "./server-j3dm74ey.js";
|
|
572
571
|
import {
|
|
573
572
|
stableStringify,
|
|
574
573
|
getTemporalDecisions,
|
|
575
574
|
observeTemporalDecisions,
|
|
576
575
|
freezeTemporalDecisions,
|
|
577
576
|
tagIdentityRevisionKey
|
|
578
|
-
} from "./server-
|
|
577
|
+
} from "./server-shme41gj.js";
|
|
579
578
|
import {
|
|
580
579
|
resolveModelCalibration,
|
|
581
580
|
calibrateBuckets,
|
|
@@ -667,14 +666,14 @@ import {
|
|
|
667
666
|
adoptNullOwnerToolTag2,
|
|
668
667
|
getCandidateToolOwners2,
|
|
669
668
|
pickNearestPriorOwner2
|
|
670
|
-
} from "./server-
|
|
669
|
+
} from "./server-jjsf29aq.js";
|
|
671
670
|
import"./server-51779zs2.js";
|
|
672
671
|
import {
|
|
673
672
|
isRawCompactionSummaryInfo2,
|
|
674
673
|
extractInMemoryMessageViews2,
|
|
675
674
|
buildInMemoryTailRawMessages2,
|
|
676
675
|
runSessionWarmupWorker
|
|
677
|
-
} from "./server-
|
|
676
|
+
} from "./server-bx59ezg6.js";
|
|
678
677
|
import {
|
|
679
678
|
resolveOpenCodeDbPath,
|
|
680
679
|
assertOpenCodeStoreGeneration,
|
|
@@ -690,12 +689,12 @@ import {
|
|
|
690
689
|
latestRealUserTurnIdFromOpenCodeDb,
|
|
691
690
|
getMessageTimesFromOpenCodeDb,
|
|
692
691
|
findLastAssistantModelFromOpenCodeDb
|
|
693
|
-
} from "./server-
|
|
692
|
+
} from "./server-zrwaj29a.js";
|
|
694
693
|
import {
|
|
695
694
|
getCurrentToolSetHash,
|
|
696
695
|
recordToolDefinition,
|
|
697
696
|
getMeasuredToolDefinitionTokens
|
|
698
|
-
} from "./server-
|
|
697
|
+
} from "./server-adfte03x.js";
|
|
699
698
|
import {
|
|
700
699
|
V2_MEMORY_CATEGORIES,
|
|
701
700
|
CATEGORY_PRIORITY
|
|
@@ -708,7 +707,7 @@ import {
|
|
|
708
707
|
resolveStoredPathWorkspaceIdentity,
|
|
709
708
|
storedPathBelongsToWorkspace,
|
|
710
709
|
computeWorkspaceEpochFingerprint
|
|
711
|
-
} from "./server-
|
|
710
|
+
} from "./server-4gz0xkrc.js";
|
|
712
711
|
import {
|
|
713
712
|
GIT_SWEEP_LEASE_RENEWAL_MS,
|
|
714
713
|
acquireGitSweepLease,
|
|
@@ -735,7 +734,7 @@ import {
|
|
|
735
734
|
drainCommitBacklogForProject2,
|
|
736
735
|
embedSessionCompartmentChunks2,
|
|
737
736
|
getEmbeddingCoverageStatus2
|
|
738
|
-
} from "./server-
|
|
737
|
+
} from "./server-4easnf78.js";
|
|
739
738
|
import"./server-fb3zxn06.js";
|
|
740
739
|
import {
|
|
741
740
|
SESSION_NOTE_CONDITION_ERROR,
|
|
@@ -779,15 +778,15 @@ import {
|
|
|
779
778
|
readGitFileChangeTimesSince,
|
|
780
779
|
verificationFileExists,
|
|
781
780
|
normalizeVerificationFiles
|
|
782
|
-
} from "./server-
|
|
781
|
+
} from "./server-yak3sxya.js";
|
|
783
782
|
import {
|
|
784
783
|
deriveTriggerBudget2,
|
|
785
784
|
deriveHistorianChunkTokens2,
|
|
786
785
|
resolveKnownHistorianContextLimit2,
|
|
787
786
|
resolveHistorianProducerLimits2,
|
|
788
787
|
resolveHistorianContextLimit2
|
|
789
|
-
} from "./server-
|
|
790
|
-
import"./server-
|
|
788
|
+
} from "./server-hn9fb3v0.js";
|
|
789
|
+
import"./server-npm52h2q.js";
|
|
791
790
|
import {
|
|
792
791
|
isEmbeddingHostBusy2
|
|
793
792
|
} from "./server-qt1qqasc.js";
|
|
@@ -798,10 +797,10 @@ import {
|
|
|
798
797
|
} from "./server-4dhv7mqz.js";
|
|
799
798
|
import {
|
|
800
799
|
getLocalEmbeddingNativeMemoryStats
|
|
801
|
-
} from "./server-
|
|
800
|
+
} from "./server-44ryn9rb.js";
|
|
802
801
|
import {
|
|
803
802
|
cosineSimilarity
|
|
804
|
-
} from "./server-
|
|
803
|
+
} from "./server-4rs8sm06.js";
|
|
805
804
|
import {
|
|
806
805
|
computeCueContentHash,
|
|
807
806
|
hasMuralCueColumns,
|
|
@@ -826,7 +825,7 @@ import {
|
|
|
826
825
|
mergeMemoryStats2,
|
|
827
826
|
archiveMemory2,
|
|
828
827
|
getMemoryCountsByStatus2
|
|
829
|
-
} from "./server-
|
|
828
|
+
} from "./server-n78avt2p.js";
|
|
830
829
|
import {
|
|
831
830
|
registerNotificationSink2,
|
|
832
831
|
pushNotification2,
|
|
@@ -834,11 +833,11 @@ import {
|
|
|
834
833
|
drainNotifications2,
|
|
835
834
|
isTuiConnected2
|
|
836
835
|
} from "./server-x8a7jmkh.js";
|
|
837
|
-
import"./server-
|
|
836
|
+
import"./server-ckrb5rm8.js";
|
|
838
837
|
import {
|
|
839
838
|
flushIgnoredMessages2,
|
|
840
839
|
sendStatusNotification2
|
|
841
|
-
} from "./server-
|
|
840
|
+
} from "./server-ak7w74j9.js";
|
|
842
841
|
import {
|
|
843
842
|
renderSingleStoreMigrationRequiredRefusal,
|
|
844
843
|
SingleStoreMigrationRequiredError,
|
|
@@ -859,7 +858,7 @@ import {
|
|
|
859
858
|
resolveMemoriesByIdsForSearch2,
|
|
860
859
|
unifiedSearch2,
|
|
861
860
|
formatSearchResults2
|
|
862
|
-
} from "./server-
|
|
861
|
+
} from "./server-y5g32dhq.js";
|
|
863
862
|
import {
|
|
864
863
|
resolvePromptContext2
|
|
865
864
|
} from "./server-fmsr7v69.js";
|
|
@@ -873,6 +872,10 @@ import {
|
|
|
873
872
|
import {
|
|
874
873
|
computeNormalizedHash
|
|
875
874
|
} from "./server-2bvekkfy.js";
|
|
875
|
+
import {
|
|
876
|
+
sameProjectDirectory,
|
|
877
|
+
canonicalProjectDirectory
|
|
878
|
+
} from "./server-knvkbfvh.js";
|
|
876
879
|
import {
|
|
877
880
|
getErrorMessage,
|
|
878
881
|
describeError
|
|
@@ -899,7 +902,7 @@ import {
|
|
|
899
902
|
} from "./server-8ajstryz.js";
|
|
900
903
|
import {
|
|
901
904
|
logSlowWriteTransaction
|
|
902
|
-
} from "./server-
|
|
905
|
+
} from "./server-7dv9wt9r.js";
|
|
903
906
|
|
|
904
907
|
// ../../node_modules/.bun/zod@4.1.8/node_modules/zod/v4/classic/external.js
|
|
905
908
|
var exports_external = {};
|
|
@@ -2968,10 +2971,10 @@ async function sourceReady(source, sessionId) {
|
|
|
2968
2971
|
function defer(fn) {
|
|
2969
2972
|
const immediate = globalThis.setImmediate;
|
|
2970
2973
|
if (typeof immediate === "function") {
|
|
2971
|
-
immediate(fn);
|
|
2974
|
+
inRootAsyncContext2(() => immediate(fn));
|
|
2972
2975
|
return;
|
|
2973
2976
|
}
|
|
2974
|
-
setTimeout(fn, 0);
|
|
2977
|
+
inRootAsyncContext2(() => setTimeout(fn, 0));
|
|
2975
2978
|
}
|
|
2976
2979
|
function yieldToEventLoop() {
|
|
2977
2980
|
return new Promise((resolve) => defer(resolve));
|
|
@@ -3055,14 +3058,14 @@ function scheduleReconciliation(db, sessionId, readMessages) {
|
|
|
3055
3058
|
reconcileSessionIndex(db, sessionId, readMessages).then((ran) => {
|
|
3056
3059
|
if (ran)
|
|
3057
3060
|
return;
|
|
3058
|
-
setTimeout(() => {
|
|
3061
|
+
inRootAsyncContext2(() => setTimeout(() => {
|
|
3059
3062
|
heapHolder.reconciliationScheduledSessions.delete(sessionId);
|
|
3060
3063
|
scheduleReconciliation(db, sessionId, readMessages);
|
|
3061
|
-
}, PREPARE_RETRY_MS).unref?.();
|
|
3064
|
+
}, PREPARE_RETRY_MS)).unref?.();
|
|
3062
3065
|
}).catch((error) => {
|
|
3063
3066
|
logIndexingError(sessionId, "reconciliation", error);
|
|
3064
3067
|
if (isDatabaseLockedError(error))
|
|
3065
|
-
setTimeout(() => scheduleReconciliation(db, sessionId, readMessages), 1000).unref();
|
|
3068
|
+
inRootAsyncContext2(() => setTimeout(() => scheduleReconciliation(db, sessionId, readMessages), 1000)).unref();
|
|
3066
3069
|
}).finally(() => {
|
|
3067
3070
|
heapHolder.reconciliationScheduledSessions.delete(sessionId);
|
|
3068
3071
|
});
|
|
@@ -3872,7 +3875,7 @@ function queueAutoSearchBackfill(db, sessionId, projectPath, query) {
|
|
|
3872
3875
|
pending.delete(key);
|
|
3873
3876
|
resolve();
|
|
3874
3877
|
};
|
|
3875
|
-
const queued = setTimeout(() => {
|
|
3878
|
+
const queued = inRootAsyncContext2(() => setTimeout(() => {
|
|
3876
3879
|
lifecycle.signal.removeEventListener("abort", cancel);
|
|
3877
3880
|
if (lifecycle.signal.aborted)
|
|
3878
3881
|
return done();
|
|
@@ -3883,7 +3886,7 @@ function queueAutoSearchBackfill(db, sessionId, projectPath, query) {
|
|
|
3883
3886
|
clearTimeout(timeout);
|
|
3884
3887
|
done();
|
|
3885
3888
|
});
|
|
3886
|
-
}, 0);
|
|
3889
|
+
}, 0));
|
|
3887
3890
|
const cancel = () => {
|
|
3888
3891
|
clearTimeout(queued);
|
|
3889
3892
|
done();
|
|
@@ -3930,7 +3933,7 @@ async function executeAutoSearchWorker(db, sessionId, projectPath, query, option
|
|
|
3930
3933
|
deadlineUnixMs: autoSearchDeadlineUnixMs(deadlineSignal)
|
|
3931
3934
|
};
|
|
3932
3935
|
return new Promise((resolve, reject) => {
|
|
3933
|
-
const worker = new Worker(entry, { workerData: input });
|
|
3936
|
+
const worker = inRootAsyncContext2(() => new Worker(entry, { workerData: input }));
|
|
3934
3937
|
let settled = false;
|
|
3935
3938
|
const finish = (results, error) => {
|
|
3936
3939
|
if (settled)
|
|
@@ -4042,7 +4045,7 @@ function searchMessageHistoryOffThread(db, request, entry = defaultAutoSearchWor
|
|
|
4042
4045
|
deadline.unref?.();
|
|
4043
4046
|
};
|
|
4044
4047
|
try {
|
|
4045
|
-
worker = new Worker(entry, { workerData: input });
|
|
4048
|
+
worker = inRootAsyncContext2(() => new Worker(entry, { workerData: input }));
|
|
4046
4049
|
} catch (error) {
|
|
4047
4050
|
finish(null, "start-failed", error);
|
|
4048
4051
|
return;
|
|
@@ -14159,16 +14162,19 @@ function rustCaptureDigests(inputs, prior, acceptedInputs) {
|
|
|
14159
14162
|
} : undefined);
|
|
14160
14163
|
return { ...incremental, inputContentSignatures };
|
|
14161
14164
|
}
|
|
14165
|
+
var contentSnapshotFieldVisitObserverForTests;
|
|
14162
14166
|
function messageMatchesContentSnapshot(message, snapshot) {
|
|
14163
14167
|
let fieldIndex = 0;
|
|
14164
14168
|
const matched = visitMessageContentFields(contentSnapshotValue(message), {
|
|
14165
14169
|
field(value) {
|
|
14170
|
+
contentSnapshotFieldVisitObserverForTests?.();
|
|
14166
14171
|
if (!Object.is(value, snapshot.fields[fieldIndex]))
|
|
14167
14172
|
return false;
|
|
14168
14173
|
fieldIndex += 1;
|
|
14169
14174
|
return true;
|
|
14170
14175
|
},
|
|
14171
14176
|
beginObject() {
|
|
14177
|
+
contentSnapshotFieldVisitObserverForTests?.();
|
|
14172
14178
|
const expectedCount = snapshot.fields[fieldIndex];
|
|
14173
14179
|
if (typeof expectedCount !== "number")
|
|
14174
14180
|
return;
|
|
@@ -17504,15 +17510,27 @@ class UnmanagedOverWindowError extends Error {
|
|
|
17504
17510
|
}
|
|
17505
17511
|
|
|
17506
17512
|
// src/hooks/magic-context/unresolved-history-boundary.ts
|
|
17513
|
+
function storedHistoryBoundaryPresence(db, sessionId) {
|
|
17514
|
+
try {
|
|
17515
|
+
const row = db.prepare("SELECT cached_m0_last_baseline_end_message_id AS id FROM session_meta WHERE session_id = ?").get(sessionId);
|
|
17516
|
+
return row?.id ? hasRawSessionMessageById2(sessionId, row.id) : undefined;
|
|
17517
|
+
} catch {
|
|
17518
|
+
return;
|
|
17519
|
+
}
|
|
17520
|
+
}
|
|
17521
|
+
|
|
17507
17522
|
class UnresolvedHistoryBoundaryError extends Error {
|
|
17508
17523
|
estimatedTokens;
|
|
17509
17524
|
contextLimitTokens;
|
|
17525
|
+
boundaryPresent;
|
|
17510
17526
|
code = "UNRESOLVED_HISTORY_BOUNDARY";
|
|
17511
17527
|
recoverable = true;
|
|
17512
|
-
constructor(estimatedTokens, contextLimitTokens) {
|
|
17513
|
-
|
|
17528
|
+
constructor(estimatedTokens, contextLimitTokens, boundaryPresent) {
|
|
17529
|
+
const reason = boundaryPresent === true ? "The boundary row is present in the host store but out of order relative to the loaded history. " : boundaryPresent === false ? "The boundary row is missing from the host store. " : "";
|
|
17530
|
+
super(reason + renderUserFacingFailure("history_boundary_unresolved", "plain"));
|
|
17514
17531
|
this.estimatedTokens = estimatedTokens;
|
|
17515
17532
|
this.contextLimitTokens = contextLimitTokens;
|
|
17533
|
+
this.boundaryPresent = boundaryPresent;
|
|
17516
17534
|
this.name = "UnresolvedHistoryBoundaryError";
|
|
17517
17535
|
}
|
|
17518
17536
|
}
|
|
@@ -18669,7 +18687,7 @@ Historian previously failed ${historianFailureState.failureCount} time(s), so Ma
|
|
|
18669
18687
|
});
|
|
18670
18688
|
if (untrimmed.tokens > boundaryContextLimit) {
|
|
18671
18689
|
sessionLog2(sessionId, `history boundary unresolved: prefix trim refused and the untrimmed request estimate ${untrimmed.tokens} (trusted=${untrimmed.trusted}) exceeds the context limit ${boundaryContextLimit}; not sending it`);
|
|
18672
|
-
throw new UnresolvedHistoryBoundaryError(untrimmed.tokens, boundaryContextLimit);
|
|
18690
|
+
throw new UnresolvedHistoryBoundaryError(untrimmed.tokens, boundaryContextLimit, storedHistoryBoundaryPresence(db, sessionId));
|
|
18673
18691
|
}
|
|
18674
18692
|
}
|
|
18675
18693
|
if (unmanagedOverWindowPass) {
|
|
@@ -22059,7 +22077,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
22059
22077
|
const sessionId = String(params.sessionId ?? "");
|
|
22060
22078
|
if (!sessionId)
|
|
22061
22079
|
return { owner: false };
|
|
22062
|
-
const sessionDirectory =
|
|
22080
|
+
const sessionDirectory = args.readSessionDirectory ? await args.readSessionDirectory(sessionId) : await readHostSessionDirectory(args.client, sessionId) ?? liveSessionState.sessionDirectoryBySession.get(sessionId);
|
|
22063
22081
|
if (!sessionDirectory)
|
|
22064
22082
|
return { owner: false };
|
|
22065
22083
|
return {
|
|
@@ -22130,7 +22148,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
22130
22148
|
return { count: buildCompartmentCount(db, sessionId, moduleStatus) };
|
|
22131
22149
|
});
|
|
22132
22150
|
const buildManagedCtx = async (db) => {
|
|
22133
|
-
const { deriveHistorianChunkTokens, resolveHistorianContextLimit } = await importPluginModule(() => import("./derive-budgets-
|
|
22151
|
+
const { deriveHistorianChunkTokens, resolveHistorianContextLimit } = await importPluginModule(() => import("./derive-budgets-0rmpmxjw.js"));
|
|
22134
22152
|
const { resolveHistorianModel } = await importPluginModule(() => import("./model-resolution-nx97z3x7.js"));
|
|
22135
22153
|
const { userMemoryCollectionEnabled } = await importPluginModule(() => import("./task-config-x0hq3qfd.js"));
|
|
22136
22154
|
const DEFAULT_HISTORIAN_TIMEOUT_MS = 10 * 60 * 1000;
|
|
@@ -22145,6 +22163,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
22145
22163
|
directory,
|
|
22146
22164
|
historianChunkTokens: deriveHistorianChunkTokens(resolveHistorianContextLimit(historianModel.primary?.model)),
|
|
22147
22165
|
historianTimeoutMs: runConfig.historian_timeout_ms ?? DEFAULT_HISTORIAN_TIMEOUT_MS,
|
|
22166
|
+
historianMaxOutputTokens: runConfig.historian?.maxTokens,
|
|
22148
22167
|
memoryEnabled: config.memory?.enabled ?? true,
|
|
22149
22168
|
autoPromote: runConfig.memory?.auto_promote ?? true,
|
|
22150
22169
|
historianModel: historianModel.primary,
|
|
@@ -22159,6 +22178,20 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
22159
22178
|
const sessionId = String(params.sessionId ?? "");
|
|
22160
22179
|
if (!sessionId)
|
|
22161
22180
|
return { ok: false, error: "no session" };
|
|
22181
|
+
const readDirectory = args.readSessionDirectory;
|
|
22182
|
+
if (readDirectory) {
|
|
22183
|
+
const { handoffHistoryWork } = await import("./history-owner-2cr9py37.js");
|
|
22184
|
+
const handed = await handoffHistoryWork({
|
|
22185
|
+
storageDir: args.storageDir ?? getMagicContextStorageDir(),
|
|
22186
|
+
directory,
|
|
22187
|
+
sessionId,
|
|
22188
|
+
method: "recomp",
|
|
22189
|
+
params,
|
|
22190
|
+
readDirectory: () => readDirectory(sessionId)
|
|
22191
|
+
});
|
|
22192
|
+
if (handed)
|
|
22193
|
+
return handed;
|
|
22194
|
+
}
|
|
22162
22195
|
const dir = String(params.directory ?? directory);
|
|
22163
22196
|
if (config.transform_mode === "rust") {
|
|
22164
22197
|
return executeRustRecompRpc(rustModeModuleClient, sessionId, dir);
|
|
@@ -22166,8 +22199,8 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
22166
22199
|
const db = readDatabase();
|
|
22167
22200
|
if (!db)
|
|
22168
22201
|
return { ok: false, error: "db unavailable" };
|
|
22169
|
-
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-
|
|
22170
|
-
const { sendIgnoredMessage } = await importPluginModule(() => import("./send-session-notification-
|
|
22202
|
+
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-ee91r9s6.js"));
|
|
22203
|
+
const { sendIgnoredMessage } = await importPluginModule(() => import("./send-session-notification-6n7chhyp.js"));
|
|
22171
22204
|
log2(`[rpc] recomp requested for session ${sessionId}`);
|
|
22172
22205
|
if (!args.client && !args.hiddenCompletionExecutor) {
|
|
22173
22206
|
return {
|
|
@@ -22223,6 +22256,21 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
22223
22256
|
return { ok: true, message };
|
|
22224
22257
|
});
|
|
22225
22258
|
rpcServer.handle("wrapup", async (params) => {
|
|
22259
|
+
const readDirectory = args.readSessionDirectory;
|
|
22260
|
+
if (readDirectory && params.sessionId) {
|
|
22261
|
+
const { handoffHistoryWork } = await import("./history-owner-2cr9py37.js");
|
|
22262
|
+
const sessionId = String(params.sessionId);
|
|
22263
|
+
const handed = await handoffHistoryWork({
|
|
22264
|
+
storageDir: args.storageDir ?? getMagicContextStorageDir(),
|
|
22265
|
+
directory,
|
|
22266
|
+
sessionId,
|
|
22267
|
+
method: "wrapup",
|
|
22268
|
+
params,
|
|
22269
|
+
readDirectory: () => readDirectory(sessionId)
|
|
22270
|
+
});
|
|
22271
|
+
if (handed)
|
|
22272
|
+
return handed;
|
|
22273
|
+
}
|
|
22226
22274
|
const sessionId = String(params.sessionId ?? "");
|
|
22227
22275
|
if (!sessionId)
|
|
22228
22276
|
return { ok: false, error: "no session" };
|
|
@@ -22236,7 +22284,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
22236
22284
|
const db = readDatabase();
|
|
22237
22285
|
if (!db)
|
|
22238
22286
|
return { ok: false, error: "db unavailable" };
|
|
22239
|
-
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-
|
|
22287
|
+
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-5wxy1ggv.js"));
|
|
22240
22288
|
const model = liveSessionState.liveModelBySession.get(sessionId);
|
|
22241
22289
|
const contextLimit = model ? resolveContextLimit(model.providerID, model.modelID, { db, sessionID: sessionId }) : 128000;
|
|
22242
22290
|
const ctx = {
|
|
@@ -22661,7 +22709,7 @@ class MagicContextRpcServer {
|
|
|
22661
22709
|
}
|
|
22662
22710
|
this.startedAt = Date.now();
|
|
22663
22711
|
const self = this;
|
|
22664
|
-
const server = Bun.serve({
|
|
22712
|
+
const server = inRootAsyncContext2(() => Bun.serve({
|
|
22665
22713
|
port: 0,
|
|
22666
22714
|
hostname: "127.0.0.1",
|
|
22667
22715
|
fetch(req, srv) {
|
|
@@ -22684,7 +22732,7 @@ class MagicContextRpcServer {
|
|
|
22684
22732
|
self.sockets.delete(ws);
|
|
22685
22733
|
}
|
|
22686
22734
|
}
|
|
22687
|
-
});
|
|
22735
|
+
}));
|
|
22688
22736
|
this.server = server;
|
|
22689
22737
|
this.port = server.port ?? 0;
|
|
22690
22738
|
try {
|
|
@@ -24817,7 +24865,7 @@ function createNativeHiddenChildren(host, removeSession, options) {
|
|
|
24817
24865
|
}
|
|
24818
24866
|
const directory = stored.location?.directory;
|
|
24819
24867
|
if (options.directory !== undefined && directory !== undefined && !sameProjectDirectory(directory, options.directory)) {
|
|
24820
|
-
throw new HiddenCompletionRefusal("hidden_prompt_unrecognized", `hidden child ${sessionID} is bound to ${directory}, not to this instance's ${options.directory}
|
|
24868
|
+
throw new HiddenCompletionRefusal("hidden_prompt_unrecognized", `hidden child ${sessionID} is bound to ${directory}, not to this instance's ${options.directory}. Reopen the parent session in ${directory}, then run /ctx-recomp so its owning instance can rebuild history.`, true);
|
|
24821
24869
|
}
|
|
24822
24870
|
if (stored.parentID === parentID || parentDroppedNoted)
|
|
24823
24871
|
return;
|
|
@@ -25444,7 +25492,7 @@ async function createV2HiddenCompletionExecutor(host, options) {
|
|
|
25444
25492
|
budgetReject = reject;
|
|
25445
25493
|
});
|
|
25446
25494
|
if (budget) {
|
|
25447
|
-
budgetPoll = setInterval(() => {
|
|
25495
|
+
budgetPoll = inRootAsyncContext2(() => setInterval(() => {
|
|
25448
25496
|
try {
|
|
25449
25497
|
const fresh = withReader(options.openReader, (reader) => reader.assistantSince?.(run.child.id, usageSeq) ?? (() => {
|
|
25450
25498
|
const latest = reader.latestAssistant(run.child.id);
|
|
@@ -25458,7 +25506,10 @@ async function createV2HiddenCompletionExecutor(host, options) {
|
|
|
25458
25506
|
const decision = budget.charge(Math.max(0, tokens?.input ?? 0), Math.max(0, tokens?.cache?.read ?? 0), Math.max(0, tokens?.cache?.write ?? 0), row.data.finish === "stop" && !(row.data.content ?? []).some((part) => part.type === "tool-call"), false);
|
|
25459
25507
|
const onBudgetUpdate = run.identity.metadata?.onBudgetUpdate;
|
|
25460
25508
|
if (typeof onBudgetUpdate === "function")
|
|
25461
|
-
onBudgetUpdate({
|
|
25509
|
+
onBudgetUpdate({
|
|
25510
|
+
...budget.snapshot(),
|
|
25511
|
+
sessionId: run.child.id
|
|
25512
|
+
});
|
|
25462
25513
|
if (decision !== "continue") {
|
|
25463
25514
|
if (budgetPoll)
|
|
25464
25515
|
clearInterval(budgetPoll);
|
|
@@ -25472,7 +25523,7 @@ async function createV2HiddenCompletionExecutor(host, options) {
|
|
|
25472
25523
|
clearInterval(budgetPoll);
|
|
25473
25524
|
budgetReject(error instanceof Error ? error : new Error(String(error)));
|
|
25474
25525
|
}
|
|
25475
|
-
}, POLL_INTERVAL_MS);
|
|
25526
|
+
}, POLL_INTERVAL_MS));
|
|
25476
25527
|
}
|
|
25477
25528
|
let abortReject;
|
|
25478
25529
|
const aborted = new Promise((_resolve, reject) => {
|
|
@@ -26034,7 +26085,7 @@ function startLeaseHeartbeat(db, holderId, leaseKey, onLost, intervalOrAcquisiti
|
|
|
26034
26085
|
}
|
|
26035
26086
|
};
|
|
26036
26087
|
beat();
|
|
26037
|
-
const timer = lost ? undefined : setInterval(() => withSqliteBackgroundWriter2(beat), intervalMs);
|
|
26088
|
+
const timer = lost ? undefined : inRootAsyncContext2(() => setInterval(() => withSqliteBackgroundWriter2(beat), intervalMs));
|
|
26038
26089
|
return {
|
|
26039
26090
|
stop: () => {
|
|
26040
26091
|
if (timer)
|
|
@@ -28837,10 +28888,10 @@ async function probeWakePlaneCatalog() {
|
|
|
28837
28888
|
if (!await connectionFileExists(file)) {
|
|
28838
28889
|
throw new Error("subc connection is not configured");
|
|
28839
28890
|
}
|
|
28840
|
-
const client = await SubcClient.connect({
|
|
28891
|
+
const client = await inRootAsyncContext2(() => SubcClient.connect({
|
|
28841
28892
|
connectionFile: file,
|
|
28842
28893
|
handshakeTimeoutMs: WAKE_PLANE_HANDSHAKE_TIMEOUT_MS
|
|
28843
|
-
});
|
|
28894
|
+
}));
|
|
28844
28895
|
try {
|
|
28845
28896
|
return await client.catalogList();
|
|
28846
28897
|
} finally {
|
|
@@ -34358,7 +34409,7 @@ async function startDreamScheduleTimer(args) {
|
|
|
34358
34409
|
startupTickTimer = null;
|
|
34359
34410
|
runTick("startup");
|
|
34360
34411
|
});
|
|
34361
|
-
const timer = setInterval(() => runTick("interval"), DREAM_TIMER_INTERVAL_MS);
|
|
34412
|
+
const timer = inRootAsyncContext2(() => setInterval(() => runTick("interval"), DREAM_TIMER_INTERVAL_MS));
|
|
34362
34413
|
if (typeof timer === "object" && "unref" in timer) {
|
|
34363
34414
|
timer.unref();
|
|
34364
34415
|
}
|
|
@@ -34654,7 +34705,7 @@ async function runCompiledSmartNoteSweep(reg, db) {
|
|
|
34654
34705
|
}
|
|
34655
34706
|
}
|
|
34656
34707
|
function startGitSweepLeaseRenewal(db, projectIdentity, holderId) {
|
|
34657
|
-
const timer = setInterval(() => {
|
|
34708
|
+
const timer = inRootAsyncContext2(() => setInterval(() => {
|
|
34658
34709
|
try {
|
|
34659
34710
|
if (!renewGitSweepLease(db, projectIdentity, holderId)) {
|
|
34660
34711
|
log2(`[git-commits] sweep lease renewal failed for ${projectIdentity}`);
|
|
@@ -34662,7 +34713,7 @@ function startGitSweepLeaseRenewal(db, projectIdentity, holderId) {
|
|
|
34662
34713
|
} catch (error) {
|
|
34663
34714
|
log2(`[git-commits] sweep lease renewal errored for ${projectIdentity}: ${error instanceof Error ? error.message : String(error)}`);
|
|
34664
34715
|
}
|
|
34665
|
-
}, GIT_SWEEP_LEASE_RENEWAL_MS);
|
|
34716
|
+
}, GIT_SWEEP_LEASE_RENEWAL_MS));
|
|
34666
34717
|
timer.unref?.();
|
|
34667
34718
|
return () => clearInterval(timer);
|
|
34668
34719
|
}
|
|
@@ -35201,12 +35252,12 @@ function createRustRefusalRecovery(options) {
|
|
|
35201
35252
|
watchers.delete(sessionId);
|
|
35202
35253
|
};
|
|
35203
35254
|
const schedule = (sessionId, watcher) => {
|
|
35204
|
-
watcher.timer = setTimeout(() => void poll(sessionId, watcher), pollIntervalMs);
|
|
35255
|
+
watcher.timer = inRootAsyncContext2(() => setTimeout(() => void poll(sessionId, watcher), pollIntervalMs));
|
|
35205
35256
|
};
|
|
35206
35257
|
const probe = async (watcher, sessionId) => {
|
|
35207
35258
|
const controller = new AbortController;
|
|
35208
35259
|
const timeoutError = new Error("rust refusal recovery probe timed out");
|
|
35209
|
-
const timer = setTimeout(() => controller.abort(timeoutError), probeTimeoutMs);
|
|
35260
|
+
const timer = inRootAsyncContext2(() => setTimeout(() => controller.abort(timeoutError), probeTimeoutMs));
|
|
35210
35261
|
try {
|
|
35211
35262
|
await Promise.race([
|
|
35212
35263
|
options.moduleClient.call({
|
|
@@ -35888,6 +35939,14 @@ function createV2RawMessageReader(openReader) {
|
|
|
35888
35939
|
reader.close();
|
|
35889
35940
|
}
|
|
35890
35941
|
},
|
|
35942
|
+
orderOf: (sessionID, messageID) => {
|
|
35943
|
+
const reader = openReader();
|
|
35944
|
+
try {
|
|
35945
|
+
return reader.sequenceForId(sessionID, messageID) ?? null;
|
|
35946
|
+
} finally {
|
|
35947
|
+
reader.close();
|
|
35948
|
+
}
|
|
35949
|
+
},
|
|
35891
35950
|
ordinalMapForRange: (sessionID, fromOrdinal, toOrdinal) => {
|
|
35892
35951
|
const reader = openReader();
|
|
35893
35952
|
try {
|
|
@@ -35945,6 +36004,9 @@ function createV2RawMessageProvider(reader, sessionID) {
|
|
|
35945
36004
|
readMessagePartsById: (messageID) => reader.findPartsById(sessionID, messageID),
|
|
35946
36005
|
hasMessageById: (messageID) => reader.hasById(sessionID, messageID),
|
|
35947
36006
|
readMessageOrdinalById: (messageID) => reader.ordinalOf(sessionID, messageID),
|
|
36007
|
+
...reader.orderOf ? {
|
|
36008
|
+
readMessageOrderById: (messageID) => reader.orderOf?.(sessionID, messageID) ?? null
|
|
36009
|
+
} : {},
|
|
35948
36010
|
readMessageIdOrdinalsForRange: (fromOrdinal, toOrdinal) => reader.ordinalMapForRange(sessionID, fromOrdinal, toOrdinal),
|
|
35949
36011
|
readMessageOrdinalPage: (after, limit) => reader.readOrdinalPage(sessionID, after, limit),
|
|
35950
36012
|
getMessageCount: () => reader.getCount(sessionID),
|
|
@@ -51326,6 +51388,13 @@ ${baseline}
|
|
|
51326
51388
|
hiddenCompletionExecutor: storageOpenedAtBoot ? hiddenCompletionExecutor : lateHiddenExecutor,
|
|
51327
51389
|
compactionMarkerStrategy: v2CompactionMarkerStrategy,
|
|
51328
51390
|
prepareHistorySession,
|
|
51391
|
+
readSessionDirectory: async (sessionID) => {
|
|
51392
|
+
try {
|
|
51393
|
+
return (await context.session.get({ sessionID })).location?.directory ?? null;
|
|
51394
|
+
} catch {
|
|
51395
|
+
return null;
|
|
51396
|
+
}
|
|
51397
|
+
},
|
|
51329
51398
|
storageDir
|
|
51330
51399
|
});
|
|
51331
51400
|
rpcServer.handle("dream", async (params) => {
|
|
@@ -51393,11 +51462,11 @@ ${baseline}
|
|
|
51393
51462
|
directory,
|
|
51394
51463
|
compactionEnabled: !compactionOff
|
|
51395
51464
|
});
|
|
51396
|
-
setTimeout(() => {
|
|
51465
|
+
inRootAsyncContext2(() => setTimeout(() => {
|
|
51397
51466
|
if (rpcStopped)
|
|
51398
51467
|
return;
|
|
51399
51468
|
rpcServer.start().catch((error) => log2("[magic-context] v2 RPC server failed to start", error));
|
|
51400
|
-
}, 0);
|
|
51469
|
+
}, 0));
|
|
51401
51470
|
return {
|
|
51402
51471
|
async dispose() {
|
|
51403
51472
|
rpcStopped = true;
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
resolveHistorianProducerLimits2,
|
|
6
6
|
resolveHistorianContextLimit2,
|
|
7
7
|
producerSourceLocalBudget2
|
|
8
|
-
} from "./server-
|
|
9
|
-
import"./server-
|
|
8
|
+
} from "./server-hn9fb3v0.js";
|
|
9
|
+
import"./server-nveratm5.js";
|
|
10
10
|
import"./server-1zx87sdm.js";
|
|
11
|
-
import"./server-
|
|
11
|
+
import"./server-9e5r8y60.js";
|
|
12
12
|
import"./server-pavzsdc6.js";
|
|
13
13
|
export {
|
|
14
14
|
deriveHistorianChunkTokens2 as deriveHistorianChunkTokens,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ensureMemoryEmbeddings2
|
|
3
|
+
} from "./server-4rs8sm06.js";
|
|
4
|
+
import"./server-4easnf78.js";
|
|
5
|
+
import"./server-9a6bwc12.js";
|
|
6
|
+
import"./server-4dhv7mqz.js";
|
|
7
|
+
import"./server-qt1qqasc.js";
|
|
8
|
+
import"./server-44ryn9rb.js";
|
|
9
|
+
import"./server-988cqjme.js";
|
|
10
|
+
import"./server-njnx39q2.js";
|
|
11
|
+
import"./server-63ha7f0f.js";
|
|
12
|
+
import"./server-7e087rvk.js";
|
|
13
|
+
import"./server-7dv9wt9r.js";
|
|
14
|
+
import"./server-s6jqh8bj.js";
|
|
15
|
+
import"./server-wafzvyhg.js";
|
|
16
|
+
import"./server-9e5r8y60.js";
|
|
17
|
+
import"./server-pavzsdc6.js";
|
|
18
|
+
export {
|
|
19
|
+
ensureMemoryEmbeddings2 as ensureMemoryEmbeddings
|
|
20
|
+
};
|