@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
|
sanitizeDiagnosticText,
|
|
10
10
|
log2,
|
|
11
11
|
sessionLog2
|
|
12
|
-
} from "./server-
|
|
12
|
+
} from "./server-9e5r8y60.js";
|
|
13
13
|
import {
|
|
14
14
|
parseJsoncRecovering,
|
|
15
15
|
detectConfigFile,
|
|
@@ -17,34 +17,32 @@ import {
|
|
|
17
17
|
cortexKitProjectConfigBasePath,
|
|
18
18
|
resolveLegacyConfigSourcesForHarness,
|
|
19
19
|
loadPluginConfigDetailed
|
|
20
|
-
} from "./server-
|
|
20
|
+
} from "./server-4qr18rfg.js";
|
|
21
21
|
import {
|
|
22
22
|
catalogOutputReserve,
|
|
23
23
|
getSdkContextLimit,
|
|
24
24
|
modelSupportsVision,
|
|
25
25
|
getSdkOutputLimit
|
|
26
|
-
} from "./server-
|
|
26
|
+
} from "./server-nveratm5.js";
|
|
27
27
|
import {
|
|
28
28
|
withContentLanguageDirective,
|
|
29
29
|
buildPrimaryLanguageDirective,
|
|
30
30
|
resolvePromptSurface,
|
|
31
31
|
DEFAULT_HISTORIAN_TIMEOUT_MS,
|
|
32
32
|
LIVE_RELOAD_CONFIG_PATHS
|
|
33
|
-
} from "./server-
|
|
33
|
+
} from "./server-7e087rvk.js";
|
|
34
34
|
import {
|
|
35
35
|
hasMeaningfulUserText2,
|
|
36
36
|
estimateTokens,
|
|
37
37
|
estimateFixedPromptTokens
|
|
38
|
-
} from "./server-
|
|
38
|
+
} from "./server-s6jqh8bj.js";
|
|
39
39
|
import {
|
|
40
|
+
inRootAsyncContext2,
|
|
40
41
|
Database2,
|
|
41
42
|
withSqliteBackgroundWriter2,
|
|
42
43
|
withoutSqliteTransformPass2,
|
|
43
44
|
beginSqliteWriterAsync2
|
|
44
|
-
} from "./server-
|
|
45
|
-
import {
|
|
46
|
-
sameProjectDirectory
|
|
47
|
-
} from "./server-brhj8qtd.js";
|
|
45
|
+
} from "./server-wafzvyhg.js";
|
|
48
46
|
import {
|
|
49
47
|
buildCanonicalChunkTextFromFts,
|
|
50
48
|
buildCompartmentSummaryFallbackText,
|
|
@@ -54,10 +52,10 @@ import {
|
|
|
54
52
|
replaceCompartmentChunkEmbeddings,
|
|
55
53
|
deleteChunkEmbedBackoffForSession,
|
|
56
54
|
chunkWindowSourceKey
|
|
57
|
-
} from "./server-
|
|
55
|
+
} from "./server-9a6bwc12.js";
|
|
58
56
|
import {
|
|
59
57
|
isPidAlive
|
|
60
|
-
} from "./server-
|
|
58
|
+
} from "./server-cxsr0ng6.js";
|
|
61
59
|
import {
|
|
62
60
|
BoundedSessionMap,
|
|
63
61
|
clearCompressionDepth,
|
|
@@ -72,7 +70,7 @@ import {
|
|
|
72
70
|
toMessageIndexSource2,
|
|
73
71
|
clearIndexedMessagesInTransaction2,
|
|
74
72
|
indexSourcesAfterOrdinal2
|
|
75
|
-
} from "./server-
|
|
73
|
+
} from "./server-j3dm74ey.js";
|
|
76
74
|
import {
|
|
77
75
|
detectOverflow,
|
|
78
76
|
SESSION_META_SELECT_COLUMNS,
|
|
@@ -161,17 +159,17 @@ import {
|
|
|
161
159
|
getRawSessionTagKeysThrough2,
|
|
162
160
|
getLegacyProtectedTailStartOrdinal2,
|
|
163
161
|
readSessionChunk2
|
|
164
|
-
} from "./server-
|
|
162
|
+
} from "./server-xj4mewze.js";
|
|
165
163
|
import {
|
|
166
164
|
getTableColumnNames
|
|
167
|
-
} from "./server-
|
|
165
|
+
} from "./server-shme41gj.js";
|
|
168
166
|
import {
|
|
169
167
|
FAIL_CLOSED_DOCTOR_COMMAND,
|
|
170
168
|
getSchemaFenceRejection,
|
|
171
169
|
LATEST_SUPPORTED_VERSION,
|
|
172
170
|
getPersistedSchemaVersion,
|
|
173
171
|
openDatabase
|
|
174
|
-
} from "./server-
|
|
172
|
+
} from "./server-08k4zkfk.js";
|
|
175
173
|
import {
|
|
176
174
|
providerMass,
|
|
177
175
|
calibrationForModelKey,
|
|
@@ -189,11 +187,11 @@ import {
|
|
|
189
187
|
foldShrunkPartTags2,
|
|
190
188
|
getTagNumberByMessageId2,
|
|
191
189
|
getActiveTagsBySession2
|
|
192
|
-
} from "./server-
|
|
190
|
+
} from "./server-jjsf29aq.js";
|
|
193
191
|
import {
|
|
194
192
|
isStrictGapHealingMessage2,
|
|
195
193
|
noteRawSessionSummaryRowWritten2
|
|
196
|
-
} from "./server-
|
|
194
|
+
} from "./server-bx59ezg6.js";
|
|
197
195
|
import {
|
|
198
196
|
resolveOpenCodeDbPath,
|
|
199
197
|
assertOpenCodeStoreGeneration,
|
|
@@ -203,10 +201,10 @@ import {
|
|
|
203
201
|
import {
|
|
204
202
|
withReadOnlySessionDb,
|
|
205
203
|
getMessageTimesFromOpenCodeDb
|
|
206
|
-
} from "./server-
|
|
204
|
+
} from "./server-zrwaj29a.js";
|
|
207
205
|
import {
|
|
208
206
|
getMeasuredToolDefinitionTokens
|
|
209
|
-
} from "./server-
|
|
207
|
+
} from "./server-adfte03x.js";
|
|
210
208
|
import {
|
|
211
209
|
V2_MEMORY_CATEGORIES,
|
|
212
210
|
CATEGORY_PRIORITY,
|
|
@@ -222,11 +220,11 @@ import {
|
|
|
222
220
|
resolveStoredPathWorkspaceIdentity,
|
|
223
221
|
sourceNameForMemory,
|
|
224
222
|
computeWorkspaceEpochFingerprint
|
|
225
|
-
} from "./server-
|
|
223
|
+
} from "./server-4gz0xkrc.js";
|
|
226
224
|
import {
|
|
227
225
|
shouldSkipHomeProjectMemory,
|
|
228
226
|
resolveProjectIdentity
|
|
229
|
-
} from "./server-
|
|
227
|
+
} from "./server-njnx39q2.js";
|
|
230
228
|
import {
|
|
231
229
|
drainBackgroundBatches,
|
|
232
230
|
contentSha2562,
|
|
@@ -234,7 +232,7 @@ import {
|
|
|
234
232
|
getProjectChunkEmbeddingModelId2,
|
|
235
233
|
getProjectEmbeddingMaxInputTokens2,
|
|
236
234
|
embedItemsForProject2
|
|
237
|
-
} from "./server-
|
|
235
|
+
} from "./server-4easnf78.js";
|
|
238
236
|
import {
|
|
239
237
|
getSessionNotes,
|
|
240
238
|
getReadySmartNotes,
|
|
@@ -243,13 +241,13 @@ import {
|
|
|
243
241
|
userFacingFailureCode,
|
|
244
242
|
promoteSessionFactsDurable,
|
|
245
243
|
embedPromotedFacts
|
|
246
|
-
} from "./server-
|
|
244
|
+
} from "./server-yak3sxya.js";
|
|
247
245
|
import {
|
|
248
246
|
isMarkerCandidateBasisCurrent2,
|
|
249
247
|
invalidateMarkerCandidateBasis2,
|
|
250
248
|
readMarkerCandidateBasis2,
|
|
251
249
|
prepareMarkerCandidateBasis2
|
|
252
|
-
} from "./server-
|
|
250
|
+
} from "./server-npm52h2q.js";
|
|
253
251
|
import {
|
|
254
252
|
computeCueContentHash,
|
|
255
253
|
getMuralCueState,
|
|
@@ -257,7 +255,7 @@ import {
|
|
|
257
255
|
getMemoriesByProject2,
|
|
258
256
|
getMemoriesByProjects2,
|
|
259
257
|
getMaxMemoryIdForProjects2
|
|
260
|
-
} from "./server-
|
|
258
|
+
} from "./server-n78avt2p.js";
|
|
261
259
|
import {
|
|
262
260
|
pushNotification2
|
|
263
261
|
} from "./server-x8a7jmkh.js";
|
|
@@ -265,10 +263,13 @@ import {
|
|
|
265
263
|
deriveTriggerBudget2,
|
|
266
264
|
resolveHistorianProducerLimits2,
|
|
267
265
|
producerSourceLocalBudget2
|
|
268
|
-
} from "./server-
|
|
266
|
+
} from "./server-hn9fb3v0.js";
|
|
269
267
|
import {
|
|
270
268
|
sendStatusNotification2
|
|
271
|
-
} from "./server-
|
|
269
|
+
} from "./server-ak7w74j9.js";
|
|
270
|
+
import {
|
|
271
|
+
sameProjectDirectory
|
|
272
|
+
} from "./server-knvkbfvh.js";
|
|
272
273
|
import {
|
|
273
274
|
getErrorMessage,
|
|
274
275
|
describeError
|
|
@@ -282,7 +283,7 @@ import {
|
|
|
282
283
|
import {
|
|
283
284
|
logSlowWriteTransaction,
|
|
284
285
|
WriteTransactionSteps
|
|
285
|
-
} from "./server-
|
|
286
|
+
} from "./server-7dv9wt9r.js";
|
|
286
287
|
|
|
287
288
|
// src/config/live-snapshot.ts
|
|
288
289
|
import { createHash } from "node:crypto";
|
|
@@ -1111,7 +1112,7 @@ var V2_MESSAGE_PAGE_SQL = `WITH bounds AS (
|
|
|
1111
1112
|
SELECT seq FROM session_message
|
|
1112
1113
|
WHERE session_id = ? AND type IN (${RAW_MESSAGE_TYPE_PARAMETERS})
|
|
1113
1114
|
ORDER BY seq ASC LIMIT 1 OFFSET ?
|
|
1114
|
-
), -1) END AS after_seq,
|
|
1115
|
+
), (SELECT MAX(seq) FROM session_message WHERE session_id = ?), -1) END AS after_seq,
|
|
1115
1116
|
COALESCE((
|
|
1116
1117
|
SELECT seq FROM session_message
|
|
1117
1118
|
WHERE session_id = ? AND type IN (${RAW_MESSAGE_TYPE_PARAMETERS})
|
|
@@ -1372,7 +1373,7 @@ class V2StoreReader {
|
|
|
1372
1373
|
}
|
|
1373
1374
|
}
|
|
1374
1375
|
const maximumSeq = Number.MAX_SAFE_INTEGER;
|
|
1375
|
-
const rows = this.prepare(V2_MESSAGE_PAGE_SQL).all(afterOrdinal, sessionID, ...RAW_MESSAGE_TYPES, Math.max(0, afterOrdinal - 1), sessionID, ...RAW_MESSAGE_TYPES, finalWatermark - 1, maximumSeq, sessionID, ...RAW_MESSAGE_TYPES, pageSize);
|
|
1376
|
+
const rows = this.prepare(V2_MESSAGE_PAGE_SQL).all(afterOrdinal, sessionID, ...RAW_MESSAGE_TYPES, Math.max(0, afterOrdinal - 1), sessionID, sessionID, ...RAW_MESSAGE_TYPES, finalWatermark - 1, maximumSeq, sessionID, ...RAW_MESSAGE_TYPES, pageSize);
|
|
1376
1377
|
return rows.map(decode);
|
|
1377
1378
|
});
|
|
1378
1379
|
}
|
|
@@ -12991,6 +12992,37 @@ function capturePrefixTrimSourceOrder(messages) {
|
|
|
12991
12992
|
invalidReason
|
|
12992
12993
|
});
|
|
12993
12994
|
}
|
|
12995
|
+
function reanchorStoredBoundary(options, boundary) {
|
|
12996
|
+
if (!options.messages)
|
|
12997
|
+
return;
|
|
12998
|
+
const source = options.prefixTrimSourceOrder ?? capturePrefixTrimSourceOrder(options.messages);
|
|
12999
|
+
if (source.invalidReason)
|
|
13000
|
+
return;
|
|
13001
|
+
try {
|
|
13002
|
+
if (compareRawSessionMessageOrder2(options.sessionId, boundary, boundary) !== 0)
|
|
13003
|
+
return;
|
|
13004
|
+
const messageIds = [...source.messageIds];
|
|
13005
|
+
let previous;
|
|
13006
|
+
let insertion = messageIds.length;
|
|
13007
|
+
for (const [index, id] of messageIds.entries()) {
|
|
13008
|
+
if (previous) {
|
|
13009
|
+
const increasing = compareRawSessionMessageOrder2(options.sessionId, previous, id);
|
|
13010
|
+
if (increasing === null || !Number.isFinite(increasing) || increasing >= 0)
|
|
13011
|
+
return;
|
|
13012
|
+
}
|
|
13013
|
+
const order = compareRawSessionMessageOrder2(options.sessionId, boundary, id);
|
|
13014
|
+
if (order === null || !Number.isFinite(order) || order === 0)
|
|
13015
|
+
return;
|
|
13016
|
+
if (order < 0 && insertion === messageIds.length)
|
|
13017
|
+
insertion = index;
|
|
13018
|
+
previous = id;
|
|
13019
|
+
}
|
|
13020
|
+
messageIds.splice(insertion, 0, boundary);
|
|
13021
|
+
return { ...source, messageIds };
|
|
13022
|
+
} catch {
|
|
13023
|
+
return;
|
|
13024
|
+
}
|
|
13025
|
+
}
|
|
12994
13026
|
function trimToPreparedPrefix(options, prepared) {
|
|
12995
13027
|
if (options.compactionOff || !options.messages)
|
|
12996
13028
|
return "not-attempted";
|
|
@@ -13015,7 +13047,8 @@ function trimToPreparedPrefix(options, prepared) {
|
|
|
13015
13047
|
});
|
|
13016
13048
|
const boundaryPosition = sourcePosition.get(boundary) ?? sourcePosition.get(resolveHostServedBoundaryId2(options.sessionId, boundary));
|
|
13017
13049
|
if (boundaryPosition === undefined) {
|
|
13018
|
-
|
|
13050
|
+
const reanchored = reanchorStoredBoundary(options, boundary);
|
|
13051
|
+
status = reanchored ? trimToPreparedPrefix({ ...options, prefixTrimSourceOrder: reanchored }, prepared) : refuse("boundary absent from immutable source order");
|
|
13019
13052
|
} else {
|
|
13020
13053
|
let lastSourcePosition = -1;
|
|
13021
13054
|
let sawPersistedRow = false;
|
|
@@ -13026,8 +13059,7 @@ function trimToPreparedPrefix(options, prepared) {
|
|
|
13026
13059
|
for (const [index, message] of options.messages.entries()) {
|
|
13027
13060
|
const id = message.info.id;
|
|
13028
13061
|
if (isHostRenderedSystemMessage(message)) {
|
|
13029
|
-
|
|
13030
|
-
retained.push(message);
|
|
13062
|
+
retained.push(message);
|
|
13031
13063
|
continue;
|
|
13032
13064
|
}
|
|
13033
13065
|
if (typeof id !== "string" || id.length === 0) {
|
|
@@ -13070,12 +13102,19 @@ function trimToPreparedPrefix(options, prepared) {
|
|
|
13070
13102
|
} else {
|
|
13071
13103
|
const index = findBoundaryIndex(options.sessionId, options.messages, boundary);
|
|
13072
13104
|
if (index >= 0) {
|
|
13073
|
-
const
|
|
13105
|
+
const cut = index + (isPartialCompartmentEnd(options.db, options.sessionId, boundary) ? 0 : 1);
|
|
13106
|
+
const unplaced = options.messages.slice(0, cut).filter(isHostRenderedSystemMessage);
|
|
13107
|
+
const removed = options.messages.splice(0, cut, ...unplaced);
|
|
13074
13108
|
retireDecisions(removed.map((message) => message.info.id).filter((id) => typeof id === "string"));
|
|
13075
13109
|
resetPrefixTrimFallbackState(options.sessionId);
|
|
13076
13110
|
status = "applied";
|
|
13077
13111
|
} else {
|
|
13078
|
-
|
|
13112
|
+
const reanchored = reanchorStoredBoundary(options, boundary);
|
|
13113
|
+
if (reanchored && reanchored.messageIds[0] !== boundary) {
|
|
13114
|
+
status = trimToPreparedPrefix({ ...options, prefixTrimSourceOrder: reanchored }, prepared);
|
|
13115
|
+
} else {
|
|
13116
|
+
status = classifyAbsentBoundary(options, options.messages, boundary);
|
|
13117
|
+
}
|
|
13079
13118
|
}
|
|
13080
13119
|
}
|
|
13081
13120
|
}
|
|
@@ -18010,6 +18049,7 @@ Historian pass ${passCount + 1}, attempt ${passAttempt} started for messages ${c
|
|
|
18010
18049
|
sequenceOffset: candidateCompartments.length,
|
|
18011
18050
|
dumpLabelBase: `recomp-${sessionId}-${chunk.startIndex}-${chunk.endIndex}-pass-${passCount + 1}`,
|
|
18012
18051
|
timeoutMs: historianTimeoutMs,
|
|
18052
|
+
maxOutputTokens: deps.historianMaxOutputTokens,
|
|
18013
18053
|
model: deps.model,
|
|
18014
18054
|
fallbackModelId: deps.fallbackModelId,
|
|
18015
18055
|
fallbackModels: deps.fallbackModels,
|
|
@@ -18524,7 +18564,6 @@ ${renderUserFacingFailure("recomp_unavailable")}`;
|
|
|
18524
18564
|
}
|
|
18525
18565
|
}
|
|
18526
18566
|
}
|
|
18527
|
-
|
|
18528
18567
|
// src/hooks/magic-context/compartment-runner.ts
|
|
18529
18568
|
var activeRuns = new Map;
|
|
18530
18569
|
function getActiveCompartmentRun(sessionId) {
|
|
@@ -18560,7 +18599,7 @@ function withPublishedCallback(deps) {
|
|
|
18560
18599
|
};
|
|
18561
18600
|
}
|
|
18562
18601
|
function startLeaseRenewal(deps, holderId) {
|
|
18563
|
-
return setInterval(() => {
|
|
18602
|
+
return inRootAsyncContext2(() => setInterval(() => {
|
|
18564
18603
|
try {
|
|
18565
18604
|
if (!renewCompartmentLease(deps.db, deps.sessionId, holderId)) {
|
|
18566
18605
|
sessionLog2(deps.sessionId, "compartment lease renewal failed; publish will be skipped if holder is stale");
|
|
@@ -18568,7 +18607,7 @@ function startLeaseRenewal(deps, holderId) {
|
|
|
18568
18607
|
} catch (err) {
|
|
18569
18608
|
sessionLog2(deps.sessionId, `compartment lease renewal threw; publish will be skipped if holder is stale (${err instanceof Error ? err.message : String(err)})`);
|
|
18570
18609
|
}
|
|
18571
|
-
}, COMPARTMENT_LEASE_RENEWAL_MS);
|
|
18610
|
+
}, COMPARTMENT_LEASE_RENEWAL_MS));
|
|
18572
18611
|
}
|
|
18573
18612
|
function startCompartmentAgent(deps, runAgent = runCompartmentAgent, prepareBoundary) {
|
|
18574
18613
|
withoutSqliteTransformPass2(() => startBackgroundCompartmentAgent(deps, runAgent, prepareBoundary));
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
// src/shared/sqlite.ts
|
|
2
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
+
import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
|
|
3
3
|
import { statSync } from "node:fs";
|
|
4
|
+
var resourceRoot = new AsyncResource("magic-context:root");
|
|
5
|
+
function inRootAsyncContext2(operation) {
|
|
6
|
+
return resourceRoot.runInAsyncScope(operation);
|
|
7
|
+
}
|
|
4
8
|
var reportSlowPrivilegedWrite;
|
|
5
9
|
function registerSlowWriteReporter2(reporter) {
|
|
6
10
|
reportSlowPrivilegedWrite = reporter;
|
|
@@ -191,7 +195,7 @@ function installTransactionRouting(db, readonly) {
|
|
|
191
195
|
return endWriterTransaction(db, () => nativeExec(sql), sql);
|
|
192
196
|
if (!/^\s*(?:SELECT|EXPLAIN|PRAGMA|COMMIT|END|ROLLBACK|SAVEPOINT|RELEASE)\b/i.test(sql)) {
|
|
193
197
|
try {
|
|
194
|
-
return withAutocommitTimeout(db, () => nativeExec(sql));
|
|
198
|
+
return withAutocommitTimeout(db, () => nativeExec(sql), false);
|
|
195
199
|
} finally {
|
|
196
200
|
if (mayChangeTagIdentity(sql))
|
|
197
201
|
tagIdentityWriteGeneration += 1;
|
|
@@ -333,7 +337,7 @@ function trackSqliteConnection(db, filename, options) {
|
|
|
333
337
|
}
|
|
334
338
|
var TrackedDatabase = new Proxy(DatabaseImpl, {
|
|
335
339
|
construct(target, args) {
|
|
336
|
-
const db = Reflect.construct(target, args, target);
|
|
340
|
+
const db = inRootAsyncContext2(() => Reflect.construct(target, args, target));
|
|
337
341
|
return trackSqliteConnection(db, args[0], args[1]);
|
|
338
342
|
}
|
|
339
343
|
});
|
|
@@ -577,29 +581,48 @@ function foregroundWaitLease() {
|
|
|
577
581
|
const lease = transformPassScope.getStore();
|
|
578
582
|
return lease?.active && !admissionScope.getStore() && !backgroundWriterScope.getStore() ? lease : undefined;
|
|
579
583
|
}
|
|
580
|
-
function withAutocommitTimeout(db, operation) {
|
|
584
|
+
function withAutocommitTimeout(db, operation, singleStatement = true) {
|
|
581
585
|
assertTransformWrite2();
|
|
582
586
|
const lease = foregroundWaitLease();
|
|
583
587
|
if (isInTransaction(db))
|
|
584
588
|
return operation();
|
|
585
589
|
const scoped = lease || backgroundWriterScope.getStore();
|
|
586
590
|
const previous = scoped ? pragmaNumber(db, "busy_timeout") : null;
|
|
587
|
-
if (scoped)
|
|
588
|
-
db.exec(`PRAGMA busy_timeout=${lease ? Math.floor(Math.min(lease.remainingWaitMs, lease.guard?.remainingMs() ?? Infinity)) : SHORT_BUSY_TIMEOUT_MS}`);
|
|
589
591
|
const started = performance.now();
|
|
590
592
|
let completed = false;
|
|
591
|
-
|
|
593
|
+
const execute = () => {
|
|
592
594
|
const result = operation();
|
|
593
595
|
completed = true;
|
|
594
596
|
return result;
|
|
597
|
+
};
|
|
598
|
+
try {
|
|
599
|
+
if (!scoped)
|
|
600
|
+
return execute();
|
|
601
|
+
if (singleStatement) {
|
|
602
|
+
db.exec("PRAGMA busy_timeout=0");
|
|
603
|
+
try {
|
|
604
|
+
return execute();
|
|
605
|
+
} catch (error) {
|
|
606
|
+
if (!isTransientSqliteError2(error) || isInTransaction(db))
|
|
607
|
+
throw error;
|
|
608
|
+
}
|
|
609
|
+
assertTransformWrite2();
|
|
610
|
+
}
|
|
611
|
+
const timeout = Math.floor(Math.min(lease?.remainingWaitMs ?? SHORT_BUSY_TIMEOUT_MS, lease?.guard?.remainingMs() ?? Infinity));
|
|
612
|
+
db.exec(`PRAGMA busy_timeout=${timeout}`);
|
|
613
|
+
const waitStarted = performance.now();
|
|
614
|
+
try {
|
|
615
|
+
return execute();
|
|
616
|
+
} finally {
|
|
617
|
+
if (lease)
|
|
618
|
+
lease.remainingWaitMs = Math.max(0, lease.remainingWaitMs - (performance.now() - waitStarted));
|
|
619
|
+
}
|
|
595
620
|
} catch (error) {
|
|
596
621
|
if (lease && isTransientSqliteError2(error))
|
|
597
622
|
throw new SqliteAcquisitionBusyError2(error, "autocommit");
|
|
598
623
|
throw error;
|
|
599
624
|
} finally {
|
|
600
625
|
const elapsed = performance.now() - started;
|
|
601
|
-
if (lease)
|
|
602
|
-
lease.remainingWaitMs = Math.max(0, lease.remainingWaitMs - elapsed);
|
|
603
626
|
if (previous !== null)
|
|
604
627
|
db.exec(`PRAGMA busy_timeout=${previous}`);
|
|
605
628
|
if (elapsed >= SLOW_WRITER_LOG_MS)
|
|
@@ -859,4 +882,4 @@ async function yieldIndexChunk2() {
|
|
|
859
882
|
await yieldIndexTurn();
|
|
860
883
|
}
|
|
861
884
|
|
|
862
|
-
export { registerSlowWriteReporter2, registerSqliteDiagnosticSink2, detectSqliteRuntime2, getTagIdentityWriteGeneration2, Database2, getSqliteDatabasePath2, getSqliteMemoryStats2, prepareCachedStatement2, withSqliteBackgroundWriter2, withSqliteTransformPass2, withoutSqliteTransformPass2, assertTransformWrite2, isTransientSqliteError2, SqliteAcquisitionBusyError2, beginSqliteWriterAsync2, withAsyncPrivilegedWriter2, withPrivilegedWriter2, indexCoordinationInput2, releaseIndexOwner2, withIndexChunk2, yieldIndexChunk2 };
|
|
885
|
+
export { inRootAsyncContext2, registerSlowWriteReporter2, registerSqliteDiagnosticSink2, detectSqliteRuntime2, getTagIdentityWriteGeneration2, Database2, getSqliteDatabasePath2, getSqliteMemoryStats2, prepareCachedStatement2, withSqliteBackgroundWriter2, withSqliteTransformPass2, withoutSqliteTransformPass2, assertTransformWrite2, isTransientSqliteError2, SqliteAcquisitionBusyError2, beginSqliteWriterAsync2, withAsyncPrivilegedWriter2, withPrivilegedWriter2, indexCoordinationInput2, releaseIndexOwner2, withIndexChunk2, yieldIndexChunk2 };
|