@cortexkit/opencode-magic-context 0.49.33 → 0.49.35
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 +11 -6
- package/dist/chunk-embedding-write-worker.js +16 -14
- package/dist/{compaction-marker-candidates-31h86ph0.js → compaction-marker-candidates-g0p67ced.js} +3 -2
- package/dist/compaction-marker-candidates-worker.js +1 -1
- package/dist/{compartment-chunk-embedding-5q5gj67r.js → compartment-chunk-embedding-y4136are.js} +8 -7
- package/dist/{conflict-warning-hook-xgskea1v.js → conflict-warning-hook-hhw8z5ak.js} +9 -8
- package/dist/{context-jyzkstnr.js → context-fk8e3h9p.js} +1400 -701
- package/dist/{derive-budgets-pqybnx09.js → derive-budgets-htj16n4x.js} +3 -2
- package/dist/embedding-backfill-q6n72sy0.js +27 -0
- package/dist/embedding-worker-process.js +2 -1
- package/dist/embedding-worker.js +5 -4
- package/dist/expand-attachments-h33jbgyz.js +21 -0
- package/dist/features/magic-context/auto-search-diagnostics.d.ts +21 -0
- package/dist/features/magic-context/auto-search-diagnostics.d.ts.map +1 -0
- package/dist/features/magic-context/compaction-marker.d.ts +22 -6
- package/dist/features/magic-context/compaction-marker.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts +1 -1
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts.map +1 -1
- package/dist/features/magic-context/search.d.ts +4 -0
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +7 -0
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/features/magic-context/store-generation-rebase-labels.d.ts +6 -0
- package/dist/features/magic-context/store-generation-rebase-labels.d.ts.map +1 -0
- package/dist/features/magic-context/store-generation-rebase.d.ts.map +1 -1
- package/dist/{history-owner-36wp3mkb.js → history-owner-0z620wgz.js} +3 -2
- package/dist/hooks/magic-context/apply-operations.d.ts +20 -3
- package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-observation.d.ts +13 -0
- package/dist/hooks/magic-context/auto-search-observation.d.ts.map +1 -0
- package/dist/hooks/magic-context/auto-search-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-worker-client.d.ts +5 -1
- package/dist/hooks/magic-context/auto-search-worker-client.d.ts.map +1 -1
- package/dist/hooks/magic-context/compaction-marker-manager.d.ts +5 -5
- package/dist/hooks/magic-context/compaction-marker-manager.d.ts.map +1 -1
- package/dist/hooks/magic-context/compaction-marker-publication.d.ts +9 -0
- package/dist/hooks/magic-context/compaction-marker-publication.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-commit-hashes.d.ts +4 -0
- package/dist/hooks/magic-context/compartment-commit-hashes.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts +1 -0
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-resolvers.d.ts.map +1 -1
- package/dist/hooks/magic-context/final-wire-completeness.d.ts +15 -0
- package/dist/hooks/magic-context/final-wire-completeness.d.ts.map +1 -0
- package/dist/hooks/magic-context/final-wire-token-estimate.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/raw-ordinal-warmup.d.ts +1 -0
- package/dist/hooks/magic-context/raw-ordinal-warmup.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-chunk.d.ts +11 -0
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-formatting.d.ts +2 -0
- package/dist/hooks/magic-context/read-session-formatting.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-as2amvn3.js → index-0c7p8mq5.js} +6 -531
- package/dist/{index-51rdvtkz.js → index-1rhgxqs8.js} +2 -2
- package/dist/index-2amn2s73.js +123 -0
- package/dist/{index-c7phnbvk.js → index-2p37txes.js} +1 -1
- package/dist/index-2qbtqg1w.js +529 -0
- package/dist/{index-waktfbjy.js → index-2v6nvy3k.js} +4 -4
- package/dist/{index-dq5xzeb9.js → index-3d3872c6.js} +7 -5
- package/dist/{index-qr2mb02j.js → index-3j9t1v4n.js} +55 -21
- package/dist/{index-2xh37qn5.js → index-4bgk5ztz.js} +576 -5524
- package/dist/{index-b88dwwrh.js → index-4xyjr62e.js} +1 -1
- package/dist/index-66a50f3e.js +777 -0
- package/dist/{index-94ef0qe2.js → index-87ctnzz9.js} +33 -5
- package/dist/{index-xrnsygfq.js → index-9wnbnx8f.js} +1 -1
- package/dist/{index-3fkk2gwj.js → index-b6xz3qbe.js} +246 -420
- package/dist/{index-0fe4q77z.js → index-brg2w6qc.js} +146 -134
- package/dist/{index-spwjbkc7.js → index-dnqqqc5f.js} +1 -1
- package/dist/index-dy7w6wm4.js +194 -0
- package/dist/{index-3jmx3fae.js → index-ezv6dz3y.js} +37 -7
- package/dist/index-f297z1n8.js +4557 -0
- package/dist/{index-qgh1qwjj.js → index-f9b3vtt1.js} +1 -1
- package/dist/{index-v15ne3a3.js → index-faxb7mck.js} +2 -2
- package/dist/{index-rrv26qjz.js → index-fw42ms3m.js} +1 -1
- package/dist/{index-t5pck3ss.js → index-fxbk7gk3.js} +1 -1
- package/dist/{index-wfybj1dw.js → index-g4t7850m.js} +2 -2
- package/dist/{index-hbt0sbv2.js → index-gyaa159j.js} +18 -276
- package/dist/{index-4pnsgvfk.js → index-hacf2tyx.js} +1 -1
- package/dist/{index-s1n8dd2n.js → index-jkanybgq.js} +2 -2
- package/dist/{index-2743x98y.js → index-jn0ddrhp.js} +29 -138
- package/dist/{index-h7tgn49j.js → index-jrfre9ah.js} +5 -222
- package/dist/{index-kfyb3k6n.js → index-jz5bk7xd.js} +2 -2
- package/dist/{index-np3rgfw4.js → index-ksv0a31x.js} +3 -3
- package/dist/{index-7kkphb6c.js → index-nj360hcs.js} +4 -4
- package/dist/{index-gkee6p4g.js → index-p56dszfp.js} +3 -3
- package/dist/{index-4s4zq97n.js → index-pq0dpwrc.js} +4 -4
- package/dist/{index-rfxzazzy.js → index-pswsyf1w.js} +4 -4
- package/dist/{index-y1qwzvxn.js → index-pztqab6k.js} +2 -2
- package/dist/{index-rverk2vz.js → index-qncw9hey.js} +1 -1
- package/dist/index-qx8j6kds.js +270 -0
- package/dist/{index-kq5w68dp.js → index-txs8tce6.js} +1 -1
- package/dist/index-vzhhr1ht.js +532 -0
- package/dist/index-wh9fxds5.js +265 -0
- package/dist/{index-b7w46fp2.js → index-x2mrq5xv.js} +170 -48
- package/dist/{index-43vqx0za.js → index-xwwsbsd3.js} +15 -13
- package/dist/index-z4p0ry94.js +222 -0
- package/dist/index-z9zygwse.js +89 -0
- package/dist/{index-v7287tzq.js → index-zhqwda72.js} +19 -8
- package/dist/index.js +83 -72
- package/dist/{logger-94kew5wm.js → logger-qwnbcfj9.js} +2 -1
- package/dist/{message-fts-rowid-map-va36knh4.js → message-fts-rowid-map-xg7hr0mk.js} +5 -4
- package/dist/{message-index-bounded-zq7a5nm6.js → message-index-bounded-narw7bnz.js} +12 -11
- package/dist/{message-time-backfill-4qva0b4f.js → message-time-backfill-39bm498k.js} +3 -2
- package/dist/migration-worker.js +13 -11
- package/dist/{project-embedding-registry-6yex0r9f.js → project-embedding-registry-tdz7985n.js} +13 -11
- package/dist/raw-ordinal-warmup-worker.js +12 -7
- package/dist/{read-session-chunk-1ndphmb8.js → read-session-chunk-vmg1zjg0.js} +15 -10
- package/dist/{read-session-raw-b2sd67v4.js → read-session-raw-mncmzbm9.js} +3 -2
- package/dist/recomp-orchestrator-qyyhnc9b.js +68 -0
- package/dist/render-c5p0k846.js +43 -0
- package/dist/{safe-notification-target-mkr9yzvr.js → safe-notification-target-wztd7bgk.js} +3 -2
- package/dist/{search-archive-sr07c6aj.js → search-archive-0ny7p3bw.js} +13 -11
- package/dist/{search-040pac3a.js → search-f6hwvcxk.js} +26 -23
- package/dist/{send-session-notification-vz86nt79.js → send-session-notification-0gwcz3fw.js} +7 -6
- package/dist/{storage-tags-6hvkk01c.js → storage-tags-zx1023km.js} +5 -4
- package/dist/store-620rjzt9.js +21 -0
- package/dist/store-reader-yh19h38c.js +14 -0
- package/dist/tools/ctx-expand/render.d.ts +5 -3
- package/dist/tools/ctx-expand/render.d.ts.map +1 -1
- package/dist/tools/ctx-expand/search-archive.d.ts.map +1 -1
- package/dist/tools/ctx-expand/tools.d.ts +2 -0
- package/dist/tools/ctx-expand/tools.d.ts.map +1 -1
- package/dist/tools/ctx-expand/v2-archive-reader.d.ts +33 -0
- package/dist/tools/ctx-expand/v2-archive-reader.d.ts.map +1 -0
- package/dist/{transform-postprocess-phase-zx1peqma.js → transform-postprocess-phase-807ff6t2.js} +36 -30
- package/dist/v2/auto-search-worker.js +11 -6
- package/dist/v2/chunk-embedding-write-worker.js +16 -14
- package/dist/v2/{compaction-marker-candidates-m4vmye3w.js → compaction-marker-candidates-t1aq6gsj.js} +3 -2
- package/dist/v2/compaction-marker-candidates-worker.js +1 -1
- package/dist/v2/{compartment-chunk-embedding-rc31e6md.js → compartment-chunk-embedding-ncsk0r9e.js} +8 -7
- package/dist/v2/{context-3c4z2wj5.js → context-znqfkap4.js} +1725 -1095
- package/dist/v2/{derive-budgets-knf763tt.js → derive-budgets-sa0v7bz0.js} +4 -3
- package/dist/v2/embedding-backfill-11j425e0.js +26 -0
- package/dist/v2/embedding-worker-process.js +2 -1
- package/dist/v2/embedding-worker.js +5 -4
- package/dist/v2/expand-attachments-h33jbgyz.js +21 -0
- package/dist/v2/fold/idle.d.ts +15 -0
- package/dist/v2/fold/idle.d.ts.map +1 -0
- package/dist/v2/fold/native-replay-v3.d.ts +68 -0
- package/dist/v2/fold/native-replay-v3.d.ts.map +1 -0
- package/dist/v2/fold/native-replay.d.ts +58 -2
- package/dist/v2/fold/native-replay.d.ts.map +1 -1
- package/dist/v2/fold/policy.d.ts +2 -1
- package/dist/v2/fold/policy.d.ts.map +1 -1
- package/dist/v2/{history-owner-ad0crnrn.js → history-owner-fpka43cn.js} +3 -2
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/expand-attachments.d.ts +8 -0
- package/dist/v2/hooks/expand-attachments.d.ts.map +1 -0
- package/dist/v2/hooks/overflow-recovery.d.ts +45 -0
- package/dist/v2/hooks/overflow-recovery.d.ts.map +1 -0
- package/dist/v2/hooks/store.d.ts +7 -2
- package/dist/v2/hooks/store.d.ts.map +1 -1
- package/dist/v2/{logger-p34mjtja.js → logger-4cj6d03m.js} +2 -1
- package/dist/v2/{message-fts-rowid-map-78awh03v.js → message-fts-rowid-map-rmk571mb.js} +5 -4
- package/dist/v2/{message-index-bounded-jvgz7vk9.js → message-index-bounded-620bppw7.js} +12 -11
- package/dist/v2/{message-time-backfill-zvthw6xb.js → message-time-backfill-0c4h7sg6.js} +3 -2
- package/dist/v2/migration-worker.js +13 -11
- package/dist/v2/ordinal-range.fixture.d.ts +7 -0
- package/dist/v2/ordinal-range.fixture.d.ts.map +1 -0
- package/dist/v2/{project-embedding-registry-1x5qe2fy.js → project-embedding-registry-bm5fe1a8.js} +13 -11
- package/dist/v2/raw-ordinal-warmup-worker.js +12 -7
- package/dist/v2/{read-session-chunk-djzgm4jg.js → read-session-chunk-qfwv1k71.js} +15 -10
- package/dist/v2/{read-session-raw-5x088amc.js → read-session-raw-q294t8xs.js} +3 -2
- package/dist/v2/recomp-orchestrator-fcnjref7.js +67 -0
- package/dist/v2/render-98a1qv0b.js +42 -0
- package/dist/v2/{safe-notification-target-khnzg57c.js → safe-notification-target-gphhast7.js} +3 -2
- package/dist/v2/{search-archive-n3dhns4r.js → search-archive-r0y1bafr.js} +13 -11
- package/dist/v2/{search-q3wkpe8t.js → search-z1zqzsmh.js} +25 -22
- package/dist/v2/{send-session-notification-x5nzy34v.js → send-session-notification-fst6hkg7.js} +7 -6
- package/dist/v2/{server-rb8m4vry.js → server-1xesqm5h.js} +146 -134
- package/dist/v2/server-2amn2s73.js +123 -0
- package/dist/v2/{server-6g98c227.js → server-3schkz95.js} +4 -4
- package/dist/v2/server-468mya5v.js +209 -0
- package/dist/v2/server-55v5hpth.js +270 -0
- package/dist/v2/server-5jp38p98.js +532 -0
- package/dist/v2/{server-qjvk4a9t.js → server-69m30b21.js} +1 -1
- package/dist/v2/{server-d01pe8q5.js → server-7ccxt4nq.js} +14 -216
- package/dist/v2/{server-3mz2qh5a.js → server-969cdpmg.js} +1 -1
- package/dist/v2/{server-835q39kd.js → server-9k0mjef7.js} +2 -2
- package/dist/v2/{server-qc915kw2.js → server-bez34e60.js} +4 -4
- package/dist/v2/{server-nxas8v1d.js → server-bpvsvtph.js} +3 -3
- package/dist/v2/{server-ab8017gw.js → server-bxpz2dcn.js} +29 -138
- package/dist/v2/{server-bsgd4dk1.js → server-dcws5831.js} +2 -2
- package/dist/v2/server-ef1mskas.js +777 -0
- package/dist/v2/{server-1bw1wcbp.js → server-f0j864ma.js} +1 -1
- package/dist/v2/{server-aqbm9c8d.js → server-fqj6ddpr.js} +632 -5540
- package/dist/v2/{server-rr4cbkr0.js → server-hnknwaz8.js} +37 -7
- package/dist/v2/{server-h1byrhwx.js → server-hsf0qsn5.js} +19 -8
- package/dist/v2/{server-6495nmn9.js → server-jb6tjyeb.js} +5 -222
- package/dist/v2/{server-2aasmpsp.js → server-kkxzwa6w.js} +4 -4
- package/dist/v2/{server-a7x00tw8.js → server-mfn1yf9d.js} +1 -1
- package/dist/v2/{server-tkdabx8q.js → server-q0z2q2dx.js} +5 -530
- package/dist/v2/{server-n14edf07.js → server-qa74bj91.js} +77 -17
- package/dist/v2/server-qf2kzsh2.js +4513 -0
- package/dist/v2/{server-gyy4k6mf.js → server-qmmkhz2z.js} +1 -1
- package/dist/v2/{server-29qp8nz4.js → server-qxzbmtqt.js} +1 -1
- package/dist/v2/{server-hwag0khr.js → server-r3chnxs5.js} +4 -4
- package/dist/v2/{server-vr4szghm.js → server-rktnzs89.js} +2 -2
- package/dist/v2/{server-6vd2n183.js → server-s9xgyyj9.js} +1 -1
- package/dist/v2/{server-53eh1r8r.js → server-sd8hvzte.js} +2 -2
- package/dist/v2/{server-k3t06fxr.js → server-sefxj8k1.js} +1 -1
- package/dist/v2/{server-v77xa5wj.js → server-tpt7bwq8.js} +1 -1
- package/dist/v2/{server-awr8qa4c.js → server-ws5exe6q.js} +2 -2
- package/dist/v2/server-x4m6xcn4.js +194 -0
- package/dist/v2/{server-806rzhs6.js → server-xbtw0p9t.js} +1 -1
- package/dist/v2/{server-cqjvxyrp.js → server-xy7w7hrd.js} +2 -2
- package/dist/v2/server-ypf1ap0v.js +529 -0
- package/dist/v2/server-z4p0ry94.js +222 -0
- package/dist/v2/server-z9zygwse.js +89 -0
- package/dist/v2/{server-ab1g0wn9.js → server-zzgtgqmd.js} +2 -2
- package/dist/v2/server.js +6 -5
- package/dist/v2/{storage-tags-18nbaanf.js → storage-tags-19s0ebf0.js} +5 -4
- package/dist/v2/store-reader-cgx47zkp.js +14 -0
- package/dist/v2/store-reader.d.ts +9 -2
- package/dist/v2/store-reader.d.ts.map +1 -1
- package/dist/v2/store-vdm8v3jd.js +21 -0
- package/dist/v2/v2-archive-reader-t2c0eypn.js +11 -0
- package/dist/v2/{wrapup-orchestrator-ga5vfmwr.js → wrapup-orchestrator-aqpqsveg.js} +46 -39
- package/dist/v2-archive-reader-tm2eayp2.js +11 -0
- package/dist/wrapup-orchestrator-k5yp19a6.js +55 -0
- package/package.json +1 -1
- package/src/shared/sqlite-transaction-mode-guard.test.ts +4 -0
- package/dist/embedding-backfill-0jgtqxen.js +0 -25
- package/dist/recomp-orchestrator-skqzzvby.js +0 -62
- package/dist/v2/embedding-backfill-f43hd8y6.js +0 -24
- package/dist/v2/recomp-orchestrator-qfqdvbta.js +0 -61
- package/dist/wrapup-orchestrator-dy8r3gp8.js +0 -49
|
@@ -25,13 +25,15 @@ import {
|
|
|
25
25
|
} from "./index-g2q4htwp.js";
|
|
26
26
|
import {
|
|
27
27
|
sanitizeDiagnosticText,
|
|
28
|
-
hasShareabilitySensitiveText
|
|
28
|
+
hasShareabilitySensitiveText
|
|
29
|
+
} from "./index-z4p0ry94.js";
|
|
30
|
+
import {
|
|
29
31
|
classifyStalePluginBuild,
|
|
30
32
|
importPluginModule,
|
|
31
33
|
log2,
|
|
32
34
|
sessionLog2,
|
|
33
35
|
getLoggerDiagnostics2
|
|
34
|
-
} from "./index-
|
|
36
|
+
} from "./index-jrfre9ah.js";
|
|
35
37
|
import {
|
|
36
38
|
resolveOpenCodeDbPath,
|
|
37
39
|
assertOpenCodeStoreGeneration,
|
|
@@ -46,6 +48,7 @@ import {
|
|
|
46
48
|
import {
|
|
47
49
|
inRootAsyncContext2,
|
|
48
50
|
Database2,
|
|
51
|
+
getSqliteDatabasePath2,
|
|
49
52
|
getSqliteMemoryStats2,
|
|
50
53
|
withSqliteBackgroundWriter2,
|
|
51
54
|
withSqliteTransformPass2,
|
|
@@ -69,7 +72,7 @@ import {
|
|
|
69
72
|
storedPathBelongsToIdentity,
|
|
70
73
|
beginBootQuietPeriod,
|
|
71
74
|
scheduleAfterBootQuiet
|
|
72
|
-
} from "./index-
|
|
75
|
+
} from "./index-txs8tce6.js";
|
|
73
76
|
import {
|
|
74
77
|
recordSessionProjectIdentity,
|
|
75
78
|
hasRecordedSessionProjectIdentity,
|
|
@@ -79,7 +82,7 @@ import {
|
|
|
79
82
|
markGitSweepSuccessAndRelease,
|
|
80
83
|
parkGitSweepNonIndexable,
|
|
81
84
|
releaseGitSweepLease
|
|
82
|
-
} from "./index-
|
|
85
|
+
} from "./index-jz5bk7xd.js";
|
|
83
86
|
import {
|
|
84
87
|
getMagicContextBuiltinCommands,
|
|
85
88
|
formatConfigParseStatusLine,
|
|
@@ -101,82 +104,6 @@ import {
|
|
|
101
104
|
DREAMER_CLASSIFIER_AGENT,
|
|
102
105
|
DREAMER_DOCS_AGENT,
|
|
103
106
|
DREAMER_REVIEWER_AGENT,
|
|
104
|
-
getCompartments,
|
|
105
|
-
getLastCompartmentEndMessage,
|
|
106
|
-
getLastCompartmentEndMessageId,
|
|
107
|
-
providerResponseFailed,
|
|
108
|
-
LkgRecoveryFenceError,
|
|
109
|
-
lkgServedArrayDigest,
|
|
110
|
-
hasCleanLkgRecoveryFence,
|
|
111
|
-
dirtyLkgRecoveryRevision,
|
|
112
|
-
ownsLkgDirtyFence,
|
|
113
|
-
invalidateCleanLkgRecoveryFence,
|
|
114
|
-
prepareLkgCaptureFence,
|
|
115
|
-
certifyCommittedLkgCapture,
|
|
116
|
-
markLkgRecoveryDirty,
|
|
117
|
-
getOrCreateSessionMeta,
|
|
118
|
-
updateSessionMeta,
|
|
119
|
-
retryPendingSessionCleanups,
|
|
120
|
-
retryPendingRustSessionCleanupsForProject,
|
|
121
|
-
requestPendingMaterialization,
|
|
122
|
-
hasPendingMaterializationOrigin,
|
|
123
|
-
clearPendingMaterialization,
|
|
124
|
-
recordSystemPromptForRequest,
|
|
125
|
-
recordHeldHeadForRequest,
|
|
126
|
-
isHeldHeadForRequest,
|
|
127
|
-
deferDeliveredSystemRefresh,
|
|
128
|
-
retirePendingSystemPromptDelivery,
|
|
129
|
-
claimLkgRequestIdentity,
|
|
130
|
-
currentLkgRequestIdentity,
|
|
131
|
-
noteCapturedLkgRequest,
|
|
132
|
-
measuredLkgPrefix,
|
|
133
|
-
saveLkgSlotToDb,
|
|
134
|
-
clearPersistedLkgSlotStrict,
|
|
135
|
-
loadPersistedLkgSlot,
|
|
136
|
-
drainStaleLkgSlots,
|
|
137
|
-
resolveLkgModelKeys,
|
|
138
|
-
createLkgEntryProjector,
|
|
139
|
-
captureLkgSlot,
|
|
140
|
-
validateAnthropicReasoningRuns,
|
|
141
|
-
validateLkgSeam,
|
|
142
|
-
replayLkg,
|
|
143
|
-
coldStartRawServedIndex,
|
|
144
|
-
coldStartUncapturedReplay,
|
|
145
|
-
noteUncertifiedNormalLkg,
|
|
146
|
-
hasProcessLocalLkgProof,
|
|
147
|
-
lkgDirtyRevision,
|
|
148
|
-
rememberLkgDirtyRevision,
|
|
149
|
-
readPersistedLkgUntaggedInputIds,
|
|
150
|
-
persistLkgUntaggedInputIds,
|
|
151
|
-
noteLkgRecoveryPrefix,
|
|
152
|
-
readLkgRecoveryPrefix,
|
|
153
|
-
noteLkgHealthyPrefix,
|
|
154
|
-
lkgRecoveryReplayUnproven,
|
|
155
|
-
lkgRecoveryEntryUnproven,
|
|
156
|
-
lkgInputIdentity,
|
|
157
|
-
beginLkgPass,
|
|
158
|
-
visitMessageContentFields,
|
|
159
|
-
contentSnapshotValue,
|
|
160
|
-
messageContentFields,
|
|
161
|
-
signatureForFields,
|
|
162
|
-
exactReusablePrefix,
|
|
163
|
-
incrementalLkgContentDigests,
|
|
164
|
-
lkgSlotRejection,
|
|
165
|
-
captureSlot,
|
|
166
|
-
getInMemorySlot,
|
|
167
|
-
getSlot,
|
|
168
|
-
forgetInMemorySlot,
|
|
169
|
-
dropSlot,
|
|
170
|
-
noteEntry,
|
|
171
|
-
getLkgSlotHeapStats,
|
|
172
|
-
TOOL_SWEEP_SCOPED_MARKER,
|
|
173
|
-
useScopedToolSweep,
|
|
174
|
-
createPreAdoptionToolSweepResolver,
|
|
175
|
-
queueMemoryMutation,
|
|
176
|
-
getMaxMemoryMutationIdForProjects,
|
|
177
|
-
GLOBAL_USER_PROFILE_PROJECT_PATH,
|
|
178
|
-
getProjectState,
|
|
179
|
-
bumpProjectUserProfileVersion,
|
|
180
107
|
createChildSessionWithFence,
|
|
181
108
|
HiddenCompletionRefusal,
|
|
182
109
|
DreamerProviderOutputFailureError,
|
|
@@ -264,7 +191,7 @@ import {
|
|
|
264
191
|
snapRangeToCompartments,
|
|
265
192
|
getActiveCompartmentRun,
|
|
266
193
|
startCompartmentAgent
|
|
267
|
-
} from "./index-
|
|
194
|
+
} from "./index-4bgk5ztz.js";
|
|
268
195
|
import {
|
|
269
196
|
hasTrustedAbsoluteWall,
|
|
270
197
|
applyProvenInputFloor,
|
|
@@ -276,7 +203,7 @@ import {
|
|
|
276
203
|
deriveTriggerBudget2,
|
|
277
204
|
resolveKnownHistorianContextLimit2,
|
|
278
205
|
resolveHistorianProducerLimits2
|
|
279
|
-
} from "./index-
|
|
206
|
+
} from "./index-dnqqqc5f.js";
|
|
280
207
|
import {
|
|
281
208
|
resolveModelCalibration,
|
|
282
209
|
calibrateBuckets,
|
|
@@ -290,7 +217,7 @@ import {
|
|
|
290
217
|
estimateTokens,
|
|
291
218
|
estimateFixedPromptTokens,
|
|
292
219
|
normalizeText
|
|
293
|
-
} from "./index-
|
|
220
|
+
} from "./index-4xyjr62e.js";
|
|
294
221
|
import {
|
|
295
222
|
protectedToolTokenCount,
|
|
296
223
|
peelLeadingMcTagNotation,
|
|
@@ -325,13 +252,12 @@ import {
|
|
|
325
252
|
getDroppedTagsBySession2,
|
|
326
253
|
getTagsByNumbers2,
|
|
327
254
|
getDroppedTagsByNumbers2,
|
|
328
|
-
getMaxDroppedTagNumber2
|
|
329
|
-
|
|
330
|
-
} from "./index-np3rgfw4.js";
|
|
255
|
+
getMaxDroppedTagNumber2
|
|
256
|
+
} from "./index-ksv0a31x.js";
|
|
331
257
|
import {
|
|
332
258
|
observeTemporalDecisions,
|
|
333
259
|
stableStringify
|
|
334
|
-
} from "./index-
|
|
260
|
+
} from "./index-9wnbnx8f.js";
|
|
335
261
|
import {
|
|
336
262
|
withContentLanguageDirective,
|
|
337
263
|
parseCron,
|
|
@@ -351,7 +277,7 @@ import {
|
|
|
351
277
|
extractInMemoryMessageViews2,
|
|
352
278
|
buildInMemoryTailRawMessages2,
|
|
353
279
|
RawOrdinalsNotReady2
|
|
354
|
-
} from "./index-
|
|
280
|
+
} from "./index-qncw9hey.js";
|
|
355
281
|
import {
|
|
356
282
|
openCodeDbExists,
|
|
357
283
|
withReadOnlySessionDb,
|
|
@@ -359,17 +285,15 @@ import {
|
|
|
359
285
|
latestPersistedMessageForRecovery,
|
|
360
286
|
latestRealUserTurnIdFromOpenCodeDb,
|
|
361
287
|
findLastAssistantModelFromOpenCodeDb
|
|
362
|
-
} from "./index-
|
|
288
|
+
} from "./index-pztqab6k.js";
|
|
363
289
|
import {
|
|
364
|
-
expandToolPart,
|
|
365
290
|
askAnswerLines,
|
|
366
|
-
takeCoveredInstructionRows,
|
|
367
|
-
cloneKeepingCoveredInstructionMarks,
|
|
368
291
|
estimateTrueRawMessageTokens,
|
|
369
292
|
isTextPart,
|
|
370
293
|
toolPartHasUserAnswer,
|
|
371
294
|
DreamTokenBudgetExceeded,
|
|
372
295
|
isEditTool,
|
|
296
|
+
createFinalWireIncompleteLogger,
|
|
373
297
|
decodeMergedReasoningParts,
|
|
374
298
|
MAX_EXECUTE_THRESHOLD,
|
|
375
299
|
escalationBands,
|
|
@@ -466,6 +390,7 @@ import {
|
|
|
466
390
|
extractToolCallObservation,
|
|
467
391
|
ToolMutationBatch,
|
|
468
392
|
createToolDropTarget,
|
|
393
|
+
rawMessageWorkerSource2,
|
|
469
394
|
setRawMessageProvider2,
|
|
470
395
|
cleanUserText2,
|
|
471
396
|
withRawSessionMessageCache2,
|
|
@@ -484,35 +409,37 @@ import {
|
|
|
484
409
|
readRawSessionMessageById2,
|
|
485
410
|
readSessionChunk2,
|
|
486
411
|
readRawSessionSeedTail2
|
|
487
|
-
} from "./index-
|
|
412
|
+
} from "./index-brg2w6qc.js";
|
|
488
413
|
import {
|
|
489
414
|
BoundedSessionMap,
|
|
490
415
|
getMeasuredToolDefinitionTokens
|
|
491
|
-
} from "./index-
|
|
416
|
+
} from "./index-jkanybgq.js";
|
|
492
417
|
import {
|
|
493
418
|
isFailClosedBlockingError,
|
|
494
419
|
shouldBypassFailClosedBlock,
|
|
495
|
-
resolveAgentNameFromMessages
|
|
496
|
-
|
|
497
|
-
getSchemaFenceRejection,
|
|
498
|
-
getMigrationOnOpenRefusal,
|
|
499
|
-
LATEST_SUPPORTED_VERSION,
|
|
500
|
-
getDatabasePath,
|
|
501
|
-
getPersistedSchemaVersion,
|
|
502
|
-
runSqliteOptimize,
|
|
503
|
-
openDatabase,
|
|
504
|
-
openCurrentDatabase
|
|
505
|
-
} from "./index-hbt0sbv2.js";
|
|
420
|
+
resolveAgentNameFromMessages
|
|
421
|
+
} from "./index-wh9fxds5.js";
|
|
506
422
|
import {
|
|
507
423
|
registerOwnRpcServerInstance,
|
|
508
424
|
rpcPortDir,
|
|
509
425
|
rpcPortFilePath,
|
|
510
426
|
parseRpcPortFile,
|
|
511
427
|
inspectProcessesAsync
|
|
512
|
-
} from "./index-
|
|
428
|
+
} from "./index-2p37txes.js";
|
|
513
429
|
import {
|
|
514
430
|
configureContextDatabasePragmas2
|
|
515
431
|
} from "./index-fb3zxn06.js";
|
|
432
|
+
import {
|
|
433
|
+
getUnconfirmedMigrationHolders,
|
|
434
|
+
getSchemaFenceRejection,
|
|
435
|
+
getMigrationOnOpenRefusal,
|
|
436
|
+
LATEST_SUPPORTED_VERSION,
|
|
437
|
+
getDatabasePath,
|
|
438
|
+
getPersistedSchemaVersion,
|
|
439
|
+
runSqliteOptimize,
|
|
440
|
+
openDatabase,
|
|
441
|
+
openCurrentDatabase
|
|
442
|
+
} from "./index-gyaa159j.js";
|
|
516
443
|
import {
|
|
517
444
|
unescapeXml,
|
|
518
445
|
resolveWorkspaceShareCategories,
|
|
@@ -521,7 +448,7 @@ import {
|
|
|
521
448
|
resolveStoredPathWorkspaceIdentity,
|
|
522
449
|
storedPathBelongsToWorkspace,
|
|
523
450
|
computeWorkspaceEpochFingerprint
|
|
524
|
-
} from "./index-
|
|
451
|
+
} from "./index-nj360hcs.js";
|
|
525
452
|
import {
|
|
526
453
|
V2_MEMORY_CATEGORIES,
|
|
527
454
|
CATEGORY_PRIORITY
|
|
@@ -534,26 +461,8 @@ import {
|
|
|
534
461
|
autoEmbedIdentityBySession,
|
|
535
462
|
autoEmbedRetryAfterBySession,
|
|
536
463
|
invalidateAutoEmbedSession,
|
|
537
|
-
getEmbedDrainUiStatus
|
|
538
|
-
|
|
539
|
-
markProjectLoadUntrusted2,
|
|
540
|
-
drainProjectEmbeddingIdentityMaintenance2,
|
|
541
|
-
drainStaleEmbeddingIdentitiesForProject2,
|
|
542
|
-
registerProjectEmbedding2,
|
|
543
|
-
registerProjectShadowEmbedding2,
|
|
544
|
-
enqueueShadowEmbeddingItems2,
|
|
545
|
-
registerProjectInObservationMode2,
|
|
546
|
-
unregisterProjectShadowEmbedding2,
|
|
547
|
-
getProjectEmbeddingSnapshot2,
|
|
548
|
-
embedTextForProject2,
|
|
549
|
-
embedBatchForProject2,
|
|
550
|
-
embedUnembeddedMemoriesForProject2,
|
|
551
|
-
embedUnembeddedMemoriesForProjectOutcome2,
|
|
552
|
-
drainCommitBacklogForProject2,
|
|
553
|
-
embedSessionCompartmentChunks2,
|
|
554
|
-
getEmbeddingCoverageStatus2,
|
|
555
|
-
getAutoEmbeddingSessionCoverage2
|
|
556
|
-
} from "./index-2743x98y.js";
|
|
464
|
+
getEmbedDrainUiStatus
|
|
465
|
+
} from "./index-2amn2s73.js";
|
|
557
466
|
import {
|
|
558
467
|
SubcClient,
|
|
559
468
|
connectionFileExists,
|
|
@@ -561,18 +470,89 @@ import {
|
|
|
561
470
|
toSynapseLaneDescriptor,
|
|
562
471
|
formatSynapseLaneDescriptor,
|
|
563
472
|
SynapseEmbeddingProvider
|
|
564
|
-
} from "./index-
|
|
473
|
+
} from "./index-g4t7850m.js";
|
|
474
|
+
import {
|
|
475
|
+
getCompartments,
|
|
476
|
+
getLastCompartmentEndMessage,
|
|
477
|
+
getLastCompartmentEndMessageId,
|
|
478
|
+
providerResponseFailed,
|
|
479
|
+
LkgRecoveryFenceError,
|
|
480
|
+
lkgServedArrayDigest,
|
|
481
|
+
hasCleanLkgRecoveryFence,
|
|
482
|
+
dirtyLkgRecoveryRevision,
|
|
483
|
+
ownsLkgDirtyFence,
|
|
484
|
+
invalidateCleanLkgRecoveryFence,
|
|
485
|
+
prepareLkgCaptureFence,
|
|
486
|
+
certifyCommittedLkgCapture,
|
|
487
|
+
markLkgRecoveryDirty,
|
|
488
|
+
getOrCreateSessionMeta,
|
|
489
|
+
updateSessionMeta,
|
|
490
|
+
retryPendingSessionCleanups,
|
|
491
|
+
retryPendingRustSessionCleanupsForProject,
|
|
492
|
+
requestPendingMaterialization,
|
|
493
|
+
hasPendingMaterializationOrigin,
|
|
494
|
+
clearPendingMaterialization,
|
|
495
|
+
recordSystemPromptForRequest,
|
|
496
|
+
recordHeldHeadForRequest,
|
|
497
|
+
isHeldHeadForRequest,
|
|
498
|
+
deferDeliveredSystemRefresh,
|
|
499
|
+
retirePendingSystemPromptDelivery,
|
|
500
|
+
claimLkgRequestIdentity,
|
|
501
|
+
currentLkgRequestIdentity,
|
|
502
|
+
noteCapturedLkgRequest,
|
|
503
|
+
measuredLkgPrefix,
|
|
504
|
+
saveLkgSlotToDb,
|
|
505
|
+
clearPersistedLkgSlotStrict,
|
|
506
|
+
loadPersistedLkgSlot,
|
|
507
|
+
drainStaleLkgSlots,
|
|
508
|
+
resolveLkgModelKeys,
|
|
509
|
+
createLkgEntryProjector,
|
|
510
|
+
captureLkgSlot,
|
|
511
|
+
validateAnthropicReasoningRuns,
|
|
512
|
+
validateLkgSeam,
|
|
513
|
+
replayLkg,
|
|
514
|
+
coldStartRawServedIndex,
|
|
515
|
+
coldStartUncapturedReplay,
|
|
516
|
+
noteUncertifiedNormalLkg,
|
|
517
|
+
hasProcessLocalLkgProof,
|
|
518
|
+
lkgDirtyRevision,
|
|
519
|
+
rememberLkgDirtyRevision,
|
|
520
|
+
readPersistedLkgUntaggedInputIds,
|
|
521
|
+
persistLkgUntaggedInputIds,
|
|
522
|
+
noteLkgRecoveryPrefix,
|
|
523
|
+
readLkgRecoveryPrefix,
|
|
524
|
+
noteLkgHealthyPrefix,
|
|
525
|
+
lkgRecoveryReplayUnproven,
|
|
526
|
+
lkgRecoveryEntryUnproven,
|
|
527
|
+
lkgInputIdentity,
|
|
528
|
+
beginLkgPass,
|
|
529
|
+
visitMessageContentFields,
|
|
530
|
+
contentSnapshotValue,
|
|
531
|
+
messageContentFields,
|
|
532
|
+
signatureForFields,
|
|
533
|
+
exactReusablePrefix,
|
|
534
|
+
incrementalLkgContentDigests,
|
|
535
|
+
lkgSlotRejection,
|
|
536
|
+
captureSlot,
|
|
537
|
+
getInMemorySlot,
|
|
538
|
+
getSlot,
|
|
539
|
+
forgetInMemorySlot,
|
|
540
|
+
dropSlot,
|
|
541
|
+
noteEntry,
|
|
542
|
+
getLkgSlotHeapStats,
|
|
543
|
+
TOOL_SWEEP_SCOPED_MARKER,
|
|
544
|
+
useScopedToolSweep,
|
|
545
|
+
createPreAdoptionToolSweepResolver,
|
|
546
|
+
queueMemoryMutation,
|
|
547
|
+
getMaxMemoryMutationIdForProjects,
|
|
548
|
+
GLOBAL_USER_PROFILE_PROJECT_PATH,
|
|
549
|
+
getProjectState,
|
|
550
|
+
bumpProjectUserProfileVersion
|
|
551
|
+
} from "./index-f297z1n8.js";
|
|
565
552
|
import {
|
|
566
553
|
getLastIndexedOrdinal
|
|
567
|
-
} from "./index-
|
|
554
|
+
} from "./index-pq0dpwrc.js";
|
|
568
555
|
import {
|
|
569
|
-
renderUserFacingFailure,
|
|
570
|
-
userFacingFailureCode,
|
|
571
|
-
renderCapabilityRefusal,
|
|
572
|
-
capabilityRefusalCode,
|
|
573
|
-
renderDreamFailure,
|
|
574
|
-
dreamFailureCode,
|
|
575
|
-
renderEmbeddingFailure,
|
|
576
556
|
SESSION_NOTE_CONDITION_ERROR,
|
|
577
557
|
getNoteByIdInScope,
|
|
578
558
|
getNotes,
|
|
@@ -596,19 +576,8 @@ import {
|
|
|
596
576
|
getActivePrimers,
|
|
597
577
|
createPrimer,
|
|
598
578
|
updatePrimerSupport,
|
|
599
|
-
updatePrimerAnswer
|
|
600
|
-
|
|
601
|
-
recordMemoryVerifications,
|
|
602
|
-
getUnmappedMemoryIds,
|
|
603
|
-
clearMemoryVerifications,
|
|
604
|
-
getMemoryVerifications,
|
|
605
|
-
resolveGitTopLevel,
|
|
606
|
-
readGitHead,
|
|
607
|
-
readGitChangedFilesSince,
|
|
608
|
-
readGitFileChangeTimesSince,
|
|
609
|
-
verificationFileExists,
|
|
610
|
-
normalizeVerificationFiles
|
|
611
|
-
} from "./index-as2amvn3.js";
|
|
579
|
+
updatePrimerAnswer
|
|
580
|
+
} from "./index-2qbtqg1w.js";
|
|
612
581
|
import {
|
|
613
582
|
registerNotificationSink2,
|
|
614
583
|
pushNotification2,
|
|
@@ -620,7 +589,27 @@ import {
|
|
|
620
589
|
getCachedLocalEmbeddingPooling,
|
|
621
590
|
preflightLocalEmbeddingPooling,
|
|
622
591
|
getLocalEmbeddingNativeMemoryStats
|
|
623
|
-
} from "./index-
|
|
592
|
+
} from "./index-1rhgxqs8.js";
|
|
593
|
+
import {
|
|
594
|
+
describeShadowBackfillWriteRefusal2,
|
|
595
|
+
markProjectLoadUntrusted2,
|
|
596
|
+
drainProjectEmbeddingIdentityMaintenance2,
|
|
597
|
+
drainStaleEmbeddingIdentitiesForProject2,
|
|
598
|
+
registerProjectEmbedding2,
|
|
599
|
+
registerProjectShadowEmbedding2,
|
|
600
|
+
enqueueShadowEmbeddingItems2,
|
|
601
|
+
registerProjectInObservationMode2,
|
|
602
|
+
unregisterProjectShadowEmbedding2,
|
|
603
|
+
getProjectEmbeddingSnapshot2,
|
|
604
|
+
embedTextForProject2,
|
|
605
|
+
embedBatchForProject2,
|
|
606
|
+
embedUnembeddedMemoriesForProject2,
|
|
607
|
+
embedUnembeddedMemoriesForProjectOutcome2,
|
|
608
|
+
drainCommitBacklogForProject2,
|
|
609
|
+
embedSessionCompartmentChunks2,
|
|
610
|
+
getEmbeddingCoverageStatus2,
|
|
611
|
+
getAutoEmbeddingSessionCoverage2
|
|
612
|
+
} from "./index-jn0ddrhp.js";
|
|
624
613
|
import {
|
|
625
614
|
saveEmbeddingIfHashMatches,
|
|
626
615
|
invalidateProject2,
|
|
@@ -628,7 +617,7 @@ import {
|
|
|
628
617
|
} from "./index-4dhv7mqz.js";
|
|
629
618
|
import {
|
|
630
619
|
cosineSimilarity
|
|
631
|
-
} from "./index-
|
|
620
|
+
} from "./index-pswsyf1w.js";
|
|
632
621
|
import {
|
|
633
622
|
computeCueContentHash,
|
|
634
623
|
hasMuralCueColumns,
|
|
@@ -654,6 +643,26 @@ import {
|
|
|
654
643
|
archiveMemory2,
|
|
655
644
|
getMemoryCountsByStatus2
|
|
656
645
|
} from "./index-jjvbk92s.js";
|
|
646
|
+
import {
|
|
647
|
+
renderUserFacingFailure,
|
|
648
|
+
userFacingFailureCode,
|
|
649
|
+
renderCapabilityRefusal,
|
|
650
|
+
capabilityRefusalCode,
|
|
651
|
+
renderDreamFailure,
|
|
652
|
+
dreamFailureCode,
|
|
653
|
+
renderEmbeddingFailure,
|
|
654
|
+
recordMemoryMapping,
|
|
655
|
+
recordMemoryVerifications,
|
|
656
|
+
getUnmappedMemoryIds,
|
|
657
|
+
clearMemoryVerifications,
|
|
658
|
+
getMemoryVerifications,
|
|
659
|
+
resolveGitTopLevel,
|
|
660
|
+
readGitHead,
|
|
661
|
+
readGitChangedFilesSince,
|
|
662
|
+
readGitFileChangeTimesSince,
|
|
663
|
+
verificationFileExists,
|
|
664
|
+
normalizeVerificationFiles
|
|
665
|
+
} from "./index-0c7p8mq5.js";
|
|
657
666
|
import {
|
|
658
667
|
renderSingleStoreMigrationRequiredRefusal,
|
|
659
668
|
SingleStoreMigrationRequiredError,
|
|
@@ -674,23 +683,23 @@ import {
|
|
|
674
683
|
resolveMemoriesByIdsForSearch2,
|
|
675
684
|
unifiedSearch2,
|
|
676
685
|
formatSearchResults2
|
|
677
|
-
} from "./index-
|
|
686
|
+
} from "./index-3j9t1v4n.js";
|
|
678
687
|
import {
|
|
679
688
|
scheduleReconciliation,
|
|
680
689
|
scheduleIncrementalIndex,
|
|
681
690
|
getMessageIndexQueueHeapStats,
|
|
682
691
|
clearSessionTracking
|
|
683
|
-
} from "./index-
|
|
692
|
+
} from "./index-87ctnzz9.js";
|
|
684
693
|
import {
|
|
685
694
|
flushIgnoredMessages2,
|
|
686
695
|
clearIgnoredMessages2,
|
|
687
696
|
observeIgnoredNotificationEvent2,
|
|
688
697
|
sendStatusNotification2
|
|
689
|
-
} from "./index-
|
|
698
|
+
} from "./index-2v6nvy3k.js";
|
|
690
699
|
import {
|
|
691
700
|
setRecompStarting2,
|
|
692
701
|
setRecompTerminal2
|
|
693
|
-
} from "./index-
|
|
702
|
+
} from "./index-3d3872c6.js";
|
|
694
703
|
import {
|
|
695
704
|
makeToolCompositeKey,
|
|
696
705
|
searchMessageHistoryOffThread,
|
|
@@ -753,7 +762,7 @@ import {
|
|
|
753
762
|
abortSessionFailClosed2,
|
|
754
763
|
evaluateEmergencyFailClosed2,
|
|
755
764
|
runPostTransformPhase2
|
|
756
|
-
} from "./index-
|
|
765
|
+
} from "./index-x2mrq5xv.js";
|
|
757
766
|
import {
|
|
758
767
|
ANNOUNCEMENT_VERSION2,
|
|
759
768
|
ANNOUNCEMENT_FEATURES2,
|
|
@@ -764,14 +773,26 @@ import {
|
|
|
764
773
|
import {
|
|
765
774
|
resolvePromptContext2
|
|
766
775
|
} from "./index-fmsr7v69.js";
|
|
776
|
+
import {
|
|
777
|
+
renderMessageByOrdinal2,
|
|
778
|
+
renderVerboseRangeForTool2,
|
|
779
|
+
renderItemByTag2
|
|
780
|
+
} from "./index-qx8j6kds.js";
|
|
781
|
+
import {
|
|
782
|
+
readV2ArchiveOffThread2
|
|
783
|
+
} from "./index-dy7w6wm4.js";
|
|
767
784
|
import {
|
|
768
785
|
renderSearchArchiveOffThread2
|
|
769
|
-
} from "./index-
|
|
786
|
+
} from "./index-ezv6dz3y.js";
|
|
770
787
|
import {
|
|
771
788
|
COMPACTION_ENABLED_PATH,
|
|
772
789
|
isDreamerRunnable,
|
|
773
790
|
isCompactionEnabled
|
|
774
791
|
} from "./index-ksdyrrav.js";
|
|
792
|
+
import {
|
|
793
|
+
takeCoveredInstructionRows,
|
|
794
|
+
cloneKeepingCoveredInstructionMarks
|
|
795
|
+
} from "./index-z9zygwse.js";
|
|
775
796
|
import {
|
|
776
797
|
__toESM
|
|
777
798
|
} from "./index-22jkk6wg.js";
|
|
@@ -796,7 +817,7 @@ import {
|
|
|
796
817
|
} from "./index-8ajstryz.js";
|
|
797
818
|
import {
|
|
798
819
|
logSlowWriteTransaction
|
|
799
|
-
} from "./index-
|
|
820
|
+
} from "./index-fxbk7gk3.js";
|
|
800
821
|
import {
|
|
801
822
|
shouldEnforcePrivateStoragePermissions,
|
|
802
823
|
ensureStorageDirectorySync,
|
|
@@ -12433,13 +12454,19 @@ function modelMatchedPersistedUsage(db, sessionID, modelKey) {
|
|
|
12433
12454
|
return;
|
|
12434
12455
|
}
|
|
12435
12456
|
function modelMatchedProvenContextLimit(db, sessionID, modelKey) {
|
|
12436
|
-
|
|
12437
|
-
|
|
12457
|
+
if (!db || !sessionID || !modelKey)
|
|
12458
|
+
return;
|
|
12459
|
+
try {
|
|
12460
|
+
const provenLimit = resolveOpenCodeProvenInputFloor(db, sessionID, modelKey);
|
|
12461
|
+
return isSaneLimit(provenLimit) ? provenLimit : undefined;
|
|
12462
|
+
} catch {
|
|
12463
|
+
return;
|
|
12464
|
+
}
|
|
12438
12465
|
}
|
|
12439
|
-
function applySessionProvenFloor(geometry,
|
|
12440
|
-
const provenLimit = isSaneLimit(persisted?.observedSafeInputTokens) ? persisted.observedSafeInputTokens : undefined;
|
|
12466
|
+
function applySessionProvenFloor(geometry, provenLimit, ctx) {
|
|
12441
12467
|
const result = applyProvenInputFloor(geometry, provenLimit);
|
|
12442
12468
|
if (result.refused && ctx?.db && ctx.sessionID) {
|
|
12469
|
+
const persisted = loadPersistedUsage(ctx.db, ctx.sessionID);
|
|
12443
12470
|
const impossiblePressure = persisted?.usage.inputTokens ? persisted.usage.inputTokens > result.refused.absoluteWall : false;
|
|
12444
12471
|
updateSessionMeta(ctx.db, ctx.sessionID, {
|
|
12445
12472
|
observedSafeInputTokens: 0,
|
|
@@ -12473,7 +12500,7 @@ function resolveContextWindowGeometry(providerID, modelID, ctx) {
|
|
|
12473
12500
|
});
|
|
12474
12501
|
if (!geometry || detected !== undefined)
|
|
12475
12502
|
return geometry;
|
|
12476
|
-
return applySessionProvenFloor(geometry,
|
|
12503
|
+
return applySessionProvenFloor(geometry, modelMatchedProvenContextLimit(ctx?.db, ctx?.sessionID, modelKey), ctx);
|
|
12477
12504
|
}
|
|
12478
12505
|
function resolveContextLimit(providerID, modelID, ctx) {
|
|
12479
12506
|
const modelKey = resolveModelKey(providerID, modelID);
|
|
@@ -16153,7 +16180,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
16153
16180
|
return { count: buildCompartmentCount(db, sessionId, moduleStatus) };
|
|
16154
16181
|
});
|
|
16155
16182
|
const buildManagedCtx = async (db) => {
|
|
16156
|
-
const { deriveHistorianChunkTokens, resolveHistorianContextLimit } = await importPluginModule(() => import("./derive-budgets-
|
|
16183
|
+
const { deriveHistorianChunkTokens, resolveHistorianContextLimit } = await importPluginModule(() => import("./derive-budgets-htj16n4x.js"));
|
|
16157
16184
|
const { resolveHistorianModel } = await importPluginModule(() => import("./model-resolution-280gmqvd.js"));
|
|
16158
16185
|
const { userObservationCollectionEnabled, userObservationsRequested } = await importPluginModule(() => import("./task-config-t6bpyka7.js"));
|
|
16159
16186
|
const DEFAULT_HISTORIAN_TIMEOUT_MS = 10 * 60 * 1000;
|
|
@@ -16186,7 +16213,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
16186
16213
|
return { ok: false, error: "no session" };
|
|
16187
16214
|
const readDirectory = args.readSessionDirectory;
|
|
16188
16215
|
if (readDirectory) {
|
|
16189
|
-
const { handoffHistoryWork } = await import("./history-owner-
|
|
16216
|
+
const { handoffHistoryWork } = await import("./history-owner-0z620wgz.js");
|
|
16190
16217
|
const handed = await handoffHistoryWork({
|
|
16191
16218
|
storageDir: args.storageDir ?? getMagicContextStorageDir(),
|
|
16192
16219
|
directory,
|
|
@@ -16205,8 +16232,8 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
16205
16232
|
const db = readDatabase();
|
|
16206
16233
|
if (!db)
|
|
16207
16234
|
return { ok: false, error: "db unavailable" };
|
|
16208
|
-
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-
|
|
16209
|
-
const { sendIgnoredMessage } = await importPluginModule(() => import("./send-session-notification-
|
|
16235
|
+
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-qyyhnc9b.js"));
|
|
16236
|
+
const { sendIgnoredMessage } = await importPluginModule(() => import("./send-session-notification-0gwcz3fw.js"));
|
|
16210
16237
|
log2(`[rpc] recomp requested for session ${sessionId}`);
|
|
16211
16238
|
if (!args.client && !args.hiddenCompletionExecutor) {
|
|
16212
16239
|
return {
|
|
@@ -16264,7 +16291,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
16264
16291
|
rpcServer.handle("wrapup", async (params) => {
|
|
16265
16292
|
const readDirectory = args.readSessionDirectory;
|
|
16266
16293
|
if (readDirectory && params.sessionId) {
|
|
16267
|
-
const { handoffHistoryWork } = await import("./history-owner-
|
|
16294
|
+
const { handoffHistoryWork } = await import("./history-owner-0z620wgz.js");
|
|
16268
16295
|
const sessionId = String(params.sessionId);
|
|
16269
16296
|
const handed = await handoffHistoryWork({
|
|
16270
16297
|
storageDir: args.storageDir ?? getMagicContextStorageDir(),
|
|
@@ -16290,7 +16317,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
16290
16317
|
const db = readDatabase();
|
|
16291
16318
|
if (!db)
|
|
16292
16319
|
return { ok: false, error: "db unavailable" };
|
|
16293
|
-
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-
|
|
16320
|
+
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-k5yp19a6.js"));
|
|
16294
16321
|
const model = liveSessionState.liveModelBySession.get(sessionId);
|
|
16295
16322
|
const contextLimit = model ? resolveContextLimit(model.providerID, model.modelID, { db, sessionID: sessionId }) : 128000;
|
|
16296
16323
|
const ctx = {
|
|
@@ -23930,7 +23957,7 @@ async function runCompartmentPhaseImpl(args) {
|
|
|
23930
23957
|
awaitedCompartmentRun = true;
|
|
23931
23958
|
compartmentInProgress = false;
|
|
23932
23959
|
} else {
|
|
23933
|
-
sessionLog2(args.sessionId, "transform:
|
|
23960
|
+
sessionLog2(args.sessionId, "transform: historian join timed out — reclaim and final fit checks continue; historian keeps running in the background");
|
|
23934
23961
|
}
|
|
23935
23962
|
}
|
|
23936
23963
|
}
|
|
@@ -25218,6 +25245,7 @@ Historian previously failed ${historianFailureState.failureCount} time(s), so Ma
|
|
|
25218
25245
|
postTransformResult.bustedThisPass = true;
|
|
25219
25246
|
passOutcome.markFinalized();
|
|
25220
25247
|
const finalWireTail = describeFinalWireTail(messages);
|
|
25248
|
+
const logIncompleteFinalWire = createFinalWireIncompleteLogger(sessionId);
|
|
25221
25249
|
const signedFitPreviouslyRefused = !compactionOff && activeThinkingPrefixHold && getMergedReasoningStrippedIds(db, sessionId).has(SIGNED_FIT_REFUSED_MARKER);
|
|
25222
25250
|
let finalWireEstimate;
|
|
25223
25251
|
if (postTransformResult.bustedThisPass) {
|
|
@@ -25247,6 +25275,7 @@ Historian previously failed ${historianFailureState.failureCount} time(s), so Ma
|
|
|
25247
25275
|
systemPromptHash: sessionMeta.systemPromptHash
|
|
25248
25276
|
}, boundaryContextLimit) : undefined);
|
|
25249
25277
|
if (finalWireEstimate) {
|
|
25278
|
+
logIncompleteFinalWire(finalWireEstimate, messages);
|
|
25250
25279
|
sessionLog2(sessionId, `transform: final-wire telemetry estimate=${finalWireEstimate.tokens} trusted=${finalWireEstimate.trusted} conversation=${finalWireEstimate.messageTokens.conversation} tools=${finalWireEstimate.messageTokens.toolCall} system=${finalWireEstimate.systemTokens} toolDefinitions=${finalWireEstimate.toolDefinitionTokens ?? "unknown"} tail=${finalWireTail}`);
|
|
25251
25280
|
}
|
|
25252
25281
|
if ((finalWireEstimate?.refusalGrade || finalWireEstimate?.refusalBasis === "byte-bound" && finalWireEstimate.refusalTokens !== undefined) && boundaryContextLimit > 0 && (finalWireEstimate.refusalTokens ?? finalWireEstimate.tokens) > boundaryContextLimit) {
|
|
@@ -25385,6 +25414,7 @@ Historian previously failed ${historianFailureState.failureCount} time(s), so Ma
|
|
|
25385
25414
|
}
|
|
25386
25415
|
}
|
|
25387
25416
|
}
|
|
25417
|
+
logIncompleteFinalWire(finalWireEstimate, messages);
|
|
25388
25418
|
if (!finalWireEstimate) {
|
|
25389
25419
|
sessionLog2(sessionId, `transform: final-wire telemetry estimate=unavailable trusted=false conversation=unknown tools=unknown system=unknown toolDefinitions=unknown tail=${finalWireTail}`);
|
|
25390
25420
|
}
|
|
@@ -26844,236 +26874,6 @@ function resolveCtxExpandMode(args, domain) {
|
|
|
26844
26874
|
return { kind: "error", message: rangeError(domain) };
|
|
26845
26875
|
}
|
|
26846
26876
|
|
|
26847
|
-
// src/tools/ctx-expand/render.ts
|
|
26848
|
-
import { createHash as createHash14 } from "node:crypto";
|
|
26849
|
-
function isRecord4(value) {
|
|
26850
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
26851
|
-
}
|
|
26852
|
-
function roleLabel(role) {
|
|
26853
|
-
if (role === "assistant")
|
|
26854
|
-
return "A (assistant)";
|
|
26855
|
-
if (role === "user")
|
|
26856
|
-
return "U (user)";
|
|
26857
|
-
return role;
|
|
26858
|
-
}
|
|
26859
|
-
function verboseRoleLabel(msg) {
|
|
26860
|
-
if (msg.role === "user" && msg.parts.length > 0 && msg.parts.every((part) => {
|
|
26861
|
-
if (!isRecord4(part))
|
|
26862
|
-
return false;
|
|
26863
|
-
if (part.type === "tool_result")
|
|
26864
|
-
return true;
|
|
26865
|
-
return part.type === "tool" && asToolPart(part)?.output != null;
|
|
26866
|
-
}))
|
|
26867
|
-
return "tool results";
|
|
26868
|
-
return roleLabel(msg.role);
|
|
26869
|
-
}
|
|
26870
|
-
function truncate2(value, max) {
|
|
26871
|
-
const t = value.trim();
|
|
26872
|
-
return t.length <= max ? t : `${t.slice(0, max)}…`;
|
|
26873
|
-
}
|
|
26874
|
-
function keyArg(input) {
|
|
26875
|
-
if (!input)
|
|
26876
|
-
return "";
|
|
26877
|
-
for (const k of ["filePath", "path", "pattern", "query", "symbol", "module", "action"]) {
|
|
26878
|
-
const v = input[k];
|
|
26879
|
-
if (typeof v === "string" && v.length > 0)
|
|
26880
|
-
return truncate2(v, 60);
|
|
26881
|
-
}
|
|
26882
|
-
if (typeof input.description === "string")
|
|
26883
|
-
return truncate2(input.description, 60);
|
|
26884
|
-
return "";
|
|
26885
|
-
}
|
|
26886
|
-
function asToolPart(part) {
|
|
26887
|
-
const type = typeof part.type === "string" ? part.type : "";
|
|
26888
|
-
if (type === "tool") {
|
|
26889
|
-
const state = isRecord4(part.state) ? part.state : null;
|
|
26890
|
-
const output = state && typeof state.output === "string" ? state.output : state && state.output != null ? JSON.stringify(state.output) : null;
|
|
26891
|
-
const metadata = state && isRecord4(state.metadata) ? state.metadata : null;
|
|
26892
|
-
const title = state && typeof state.title === "string" && state.title || metadata && typeof metadata.title === "string" && metadata.title || null;
|
|
26893
|
-
return {
|
|
26894
|
-
name: typeof part.tool === "string" ? part.tool : "tool",
|
|
26895
|
-
callId: typeof part.callID === "string" ? part.callID : "",
|
|
26896
|
-
title,
|
|
26897
|
-
input: state && isRecord4(state.input) ? state.input : null,
|
|
26898
|
-
output
|
|
26899
|
-
};
|
|
26900
|
-
}
|
|
26901
|
-
if (type === "tool_use") {
|
|
26902
|
-
return {
|
|
26903
|
-
name: typeof part.name === "string" ? part.name : "tool",
|
|
26904
|
-
callId: typeof part.id === "string" ? part.id : "",
|
|
26905
|
-
title: null,
|
|
26906
|
-
input: isRecord4(part.input) ? part.input : null,
|
|
26907
|
-
output: null
|
|
26908
|
-
};
|
|
26909
|
-
}
|
|
26910
|
-
if (type === "tool_result") {
|
|
26911
|
-
const content = part.content;
|
|
26912
|
-
const output = typeof content === "string" ? content : content != null ? JSON.stringify(content) : null;
|
|
26913
|
-
return {
|
|
26914
|
-
name: "tool_result",
|
|
26915
|
-
callId: typeof part.tool_use_id === "string" ? part.tool_use_id : "",
|
|
26916
|
-
title: null,
|
|
26917
|
-
input: null,
|
|
26918
|
-
output
|
|
26919
|
-
};
|
|
26920
|
-
}
|
|
26921
|
-
return null;
|
|
26922
|
-
}
|
|
26923
|
-
function textOf(part) {
|
|
26924
|
-
if (part.type === "text" && typeof part.text === "string")
|
|
26925
|
-
return part.text;
|
|
26926
|
-
return null;
|
|
26927
|
-
}
|
|
26928
|
-
function reasoningOf(part) {
|
|
26929
|
-
if ((part.type === "reasoning" || part.type === "thinking") && typeof part.text === "string") {
|
|
26930
|
-
return part.text;
|
|
26931
|
-
}
|
|
26932
|
-
return null;
|
|
26933
|
-
}
|
|
26934
|
-
function renderPartPreview(part, expandTools) {
|
|
26935
|
-
if (!isRecord4(part))
|
|
26936
|
-
return null;
|
|
26937
|
-
const expansion = expandToolPart(part, expandTools, true);
|
|
26938
|
-
if (expansion !== null)
|
|
26939
|
-
return ` • tool ${part.tool}: ${expansion}`;
|
|
26940
|
-
const text = textOf(part);
|
|
26941
|
-
if (text !== null) {
|
|
26942
|
-
const t = truncate2(text, 200);
|
|
26943
|
-
return t.length > 0 ? ` • ${t}` : null;
|
|
26944
|
-
}
|
|
26945
|
-
const tool = asToolPart(part);
|
|
26946
|
-
if (tool) {
|
|
26947
|
-
const arg = keyArg(tool.input);
|
|
26948
|
-
const head = arg ? `${tool.name}(${arg})` : tool.name;
|
|
26949
|
-
return tool.output !== null ? ` • tool ${head} → output ~${estimateTokens(tool.output)} tok` : ` • tool ${head}`;
|
|
26950
|
-
}
|
|
26951
|
-
const reasoning = reasoningOf(part);
|
|
26952
|
-
if (reasoning !== null)
|
|
26953
|
-
return ` • [reasoning] ${truncate2(reasoning, 120)}`;
|
|
26954
|
-
const type = typeof part.type === "string" ? part.type : "part";
|
|
26955
|
-
if (type === "file")
|
|
26956
|
-
return " • [file]";
|
|
26957
|
-
if (type === "step-start" || type === "step-finish")
|
|
26958
|
-
return null;
|
|
26959
|
-
return ` • [${type}]`;
|
|
26960
|
-
}
|
|
26961
|
-
function renderPartFull(part) {
|
|
26962
|
-
if (!isRecord4(part))
|
|
26963
|
-
return null;
|
|
26964
|
-
const text = textOf(part);
|
|
26965
|
-
if (text !== null) {
|
|
26966
|
-
return text.trim().length > 0 ? ` [text]
|
|
26967
|
-
${text}` : null;
|
|
26968
|
-
}
|
|
26969
|
-
const tool = asToolPart(part);
|
|
26970
|
-
if (tool) {
|
|
26971
|
-
const lines = [];
|
|
26972
|
-
const idSuffix = tool.callId ? ` #${tool.callId}` : "";
|
|
26973
|
-
lines.push(` [tool: ${tool.name}${idSuffix}]`);
|
|
26974
|
-
if (tool.title && tool.title.trim().length > 0) {
|
|
26975
|
-
lines.push(` description: ${tool.title.trim()}`);
|
|
26976
|
-
}
|
|
26977
|
-
if (tool.input)
|
|
26978
|
-
lines.push(` input: ${JSON.stringify(tool.input)}`);
|
|
26979
|
-
if (tool.output !== null)
|
|
26980
|
-
lines.push(` output:
|
|
26981
|
-
${tool.output}`);
|
|
26982
|
-
return lines.join(`
|
|
26983
|
-
`);
|
|
26984
|
-
}
|
|
26985
|
-
const type = typeof part.type === "string" ? part.type : "part";
|
|
26986
|
-
if (type === "file") {
|
|
26987
|
-
const name = typeof part.filename === "string" && part.filename || typeof part.url === "string" && part.url || "";
|
|
26988
|
-
return ` [file]${name ? ` ${name}` : ""}`;
|
|
26989
|
-
}
|
|
26990
|
-
return null;
|
|
26991
|
-
}
|
|
26992
|
-
function renderMessageByOrdinal(sessionId, ordinal) {
|
|
26993
|
-
const found = [];
|
|
26994
|
-
visitRawSessionMessages2(sessionId, ordinal, ordinal, (m) => {
|
|
26995
|
-
if (m.ordinal === ordinal)
|
|
26996
|
-
found.push(m);
|
|
26997
|
-
return false;
|
|
26998
|
-
});
|
|
26999
|
-
const msg = found[0];
|
|
27000
|
-
if (!msg) {
|
|
27001
|
-
return `No message at ordinal ${ordinal} in this session's stored history — it was deleted ` + `(session prune/revert) or the ordinal is wrong, so it can't be recovered. ` + `Re-run the tool if you still need the data.`;
|
|
27002
|
-
}
|
|
27003
|
-
const rendered = msg.parts.map(renderPartFull).filter((l) => l !== null);
|
|
27004
|
-
const lines = [`[${msg.ordinal}] ${roleLabel(msg.role)} — full recovery:`, ""];
|
|
27005
|
-
if (rendered.length === 0) {
|
|
27006
|
-
lines.push(" (no recoverable content — message had only structural/reasoning parts)");
|
|
27007
|
-
} else {
|
|
27008
|
-
lines.push(...rendered);
|
|
27009
|
-
}
|
|
27010
|
-
return lines.join(`
|
|
27011
|
-
`);
|
|
27012
|
-
}
|
|
27013
|
-
function renderVerboseRange(sessionId, start, end, tokenBudget, expandTools) {
|
|
27014
|
-
const out = [];
|
|
27015
|
-
let usedTokens = 0;
|
|
27016
|
-
let lastOrdinal = start - 1;
|
|
27017
|
-
let truncated = false;
|
|
27018
|
-
visitRawSessionMessages2(sessionId, start, end, (msg) => {
|
|
27019
|
-
const header = `[${msg.ordinal}] ${verboseRoleLabel(msg)}`;
|
|
27020
|
-
const partLines = msg.parts.map((part) => renderPartPreview(part, expandTools)).filter((l) => l !== null);
|
|
27021
|
-
const block = partLines.length > 0 ? `${header}
|
|
27022
|
-
${partLines.join(`
|
|
27023
|
-
`)}` : header;
|
|
27024
|
-
const blockTokens = estimateTokens(block);
|
|
27025
|
-
if (usedTokens + blockTokens > tokenBudget && out.length > 0) {
|
|
27026
|
-
truncated = true;
|
|
27027
|
-
return false;
|
|
27028
|
-
}
|
|
27029
|
-
out.push(block);
|
|
27030
|
-
usedTokens += blockTokens;
|
|
27031
|
-
lastOrdinal = msg.ordinal;
|
|
27032
|
-
return true;
|
|
27033
|
-
});
|
|
27034
|
-
return { text: out.join(`
|
|
27035
|
-
|
|
27036
|
-
`), lastOrdinal, truncated };
|
|
27037
|
-
}
|
|
27038
|
-
function renderItemByTag(db, sessionId, number, textIndexDomain = "part") {
|
|
27039
|
-
const tag = getTagById2(db, sessionId, number);
|
|
27040
|
-
if (!tag)
|
|
27041
|
-
return `no tag ${number} in this session; if ${number} came from a <session-history> heading or a ctx_search hit, it is an ordinal: use message=${number}`;
|
|
27042
|
-
if (tag.type === "tool") {
|
|
27043
|
-
const owner = tag.toolOwnerMessageId;
|
|
27044
|
-
if (!owner)
|
|
27045
|
-
return `Tag ${number}'s tool owner is unknown; its original call cannot be resolved safely.`;
|
|
27046
|
-
const message = readRawSessionMessageById2(sessionId, owner);
|
|
27047
|
-
if (!message)
|
|
27048
|
-
return `Tag ${number}'s original tool owner is no longer in stored history.`;
|
|
27049
|
-
const parts = message?.parts.filter((part) => isRecord4(part) && asToolPart(part)?.callId === tag.messageId) ?? [];
|
|
27050
|
-
if (!parts.some((part) => isRecord4(part) && asToolPart(part)?.output !== null)) {
|
|
27051
|
-
visitRawSessionMessages2(sessionId, message.ordinal + 1, Number.MAX_SAFE_INTEGER, (candidate) => {
|
|
27052
|
-
const matching = candidate.parts.filter((part) => isRecord4(part) && asToolPart(part)?.callId === tag.messageId);
|
|
27053
|
-
if (matching.some((part) => isRecord4(part) && part.type === "tool_use"))
|
|
27054
|
-
return false;
|
|
27055
|
-
parts.push(...matching);
|
|
27056
|
-
return matching.length === 0;
|
|
27057
|
-
});
|
|
27058
|
-
}
|
|
27059
|
-
const rendered = parts.map(renderPartFull).filter((part) => part !== null);
|
|
27060
|
-
return rendered.length ? rendered.join(`
|
|
27061
|
-
`) : `Tag ${number}'s original tool call is no longer in stored history.`;
|
|
27062
|
-
}
|
|
27063
|
-
const scoped = /^(.*):p(\d+)$/.exec(tag.messageId);
|
|
27064
|
-
const derived = /^(.*):mc-text-v1:([a-f0-9]+):([a-f0-9]+):o(\d+)$/.exec(tag.messageId);
|
|
27065
|
-
const owner = scoped?.[1] ?? derived?.[1] ?? tag.messageId;
|
|
27066
|
-
const message = readRawSessionMessageById2(sessionId, owner);
|
|
27067
|
-
if (!message)
|
|
27068
|
-
return `Tag ${number}'s original text is no longer in stored history.`;
|
|
27069
|
-
const index = scoped ? Number(scoped[2]) : 0;
|
|
27070
|
-
const piText = message.parts.filter((part) => isRecord4(part) && part.type === "text");
|
|
27071
|
-
const part = message.parts[index];
|
|
27072
|
-
const matching = derived ? piText.filter((part) => isRecord4(part) && typeof part.text === "string" && createHash14("sha256").update(part.text).digest("hex") === derived[3]) : [];
|
|
27073
|
-
const selected = derived ? matching[Number(derived[4])] : textIndexDomain === "text" ? piText[index] : part;
|
|
27074
|
-
return selected ? renderPartFull(selected) ?? "" : `Tag ${number}'s original text part is no longer in stored history.`;
|
|
27075
|
-
}
|
|
27076
|
-
|
|
27077
26877
|
// src/tools/ctx-expand/tools.ts
|
|
27078
26878
|
var CTX_EXPAND_RUST_TAG_REFUSAL = "Tag lookup isn't available on this session: its §N§ tags are numbered by the Rust transform engine and ctx_expand cannot resolve those numbers, so no content was returned. Expand by message instead: ctx_expand(message=<ordinal>) or ctx_expand(start=<ordinal>, end=<ordinal>), using ordinals from a <session-history> heading or a ctx_search hit.";
|
|
27079
26879
|
var ctxExpandArgsShape = {
|
|
@@ -27107,11 +26907,36 @@ function createCtxExpandTool(deps) {
|
|
|
27107
26907
|
if (mode.kind === "error") {
|
|
27108
26908
|
return mode.message;
|
|
27109
26909
|
}
|
|
26910
|
+
const source = rawMessageWorkerSource2(sessionId);
|
|
26911
|
+
const path = getSqliteDatabasePath2(deps.db);
|
|
27110
26912
|
if (mode.kind === "tag") {
|
|
27111
|
-
|
|
26913
|
+
if (source) {
|
|
26914
|
+
if (!path)
|
|
26915
|
+
throw new Error("Search archive worker unavailable: private archive has no off-thread source");
|
|
26916
|
+
const text = await readV2ArchiveOffThread2(path, source.path, sessionId, {
|
|
26917
|
+
kind: "tag",
|
|
26918
|
+
tag: mode.tag
|
|
26919
|
+
});
|
|
26920
|
+
if (text === null)
|
|
26921
|
+
throw new Error("Search archive worker unavailable: unexpected tag reply");
|
|
26922
|
+
return text;
|
|
26923
|
+
}
|
|
26924
|
+
return renderItemByTag2(deps.db, sessionId, mode.tag, "part", deps.recoveryAttachments);
|
|
27112
26925
|
}
|
|
27113
26926
|
if (mode.kind === "message") {
|
|
27114
|
-
|
|
26927
|
+
if (source) {
|
|
26928
|
+
if (!path)
|
|
26929
|
+
throw new Error("Search archive worker unavailable: private archive has no off-thread source");
|
|
26930
|
+
const text = await readV2ArchiveOffThread2(path, source.path, sessionId, {
|
|
26931
|
+
kind: "message",
|
|
26932
|
+
message: mode.message,
|
|
26933
|
+
tokenBudget: CTX_EXPAND_TOKEN_BUDGET
|
|
26934
|
+
});
|
|
26935
|
+
if (text === null)
|
|
26936
|
+
throw new Error("Search archive worker unavailable: unexpected message reply");
|
|
26937
|
+
return text;
|
|
26938
|
+
}
|
|
26939
|
+
return await renderSearchArchiveOffThread2(deps.db, sessionId, mode.message, mode.message, CTX_EXPAND_TOKEN_BUDGET) ?? renderMessageByOrdinal2(sessionId, mode.message, deps.recoveryAttachments);
|
|
27115
26940
|
}
|
|
27116
26941
|
const { start, end, verbose } = mode;
|
|
27117
26942
|
const lastCompartmentEnd = getLastCompartmentEndMessage(deps.db, sessionId);
|
|
@@ -27119,24 +26944,25 @@ function createCtxExpandTool(deps) {
|
|
|
27119
26944
|
return `Range ${start}-${end} is entirely within the live tail (after the last compacted message ${lastCompartmentEnd}); those messages are already visible in context.`;
|
|
27120
26945
|
}
|
|
27121
26946
|
const effectiveEnd = lastCompartmentEnd >= 0 ? Math.min(end, lastCompartmentEnd) : end;
|
|
26947
|
+
if (verbose && source) {
|
|
26948
|
+
if (!path)
|
|
26949
|
+
throw new Error("Search archive worker unavailable: private archive has no off-thread source");
|
|
26950
|
+
const text = await readV2ArchiveOffThread2(path, source.path, sessionId, {
|
|
26951
|
+
kind: "verbose",
|
|
26952
|
+
start,
|
|
26953
|
+
end: effectiveEnd,
|
|
26954
|
+
tokenBudget: CTX_EXPAND_TOKEN_BUDGET,
|
|
26955
|
+
expandTools: deps.expandTools
|
|
26956
|
+
});
|
|
26957
|
+
if (text === null)
|
|
26958
|
+
throw new Error("Search archive worker unavailable: unexpected verbose reply");
|
|
26959
|
+
return text;
|
|
26960
|
+
}
|
|
27122
26961
|
const archived = await renderSearchArchiveOffThread2(deps.db, sessionId, start, effectiveEnd, CTX_EXPAND_TOKEN_BUDGET);
|
|
27123
26962
|
if (archived)
|
|
27124
26963
|
return archived;
|
|
27125
26964
|
if (verbose) {
|
|
27126
|
-
|
|
27127
|
-
if (!v.text) {
|
|
27128
|
-
return `No messages found in range ${start}-${effectiveEnd}. The range may be outside this session's history.`;
|
|
27129
|
-
}
|
|
27130
|
-
const out = [
|
|
27131
|
-
`Messages ${start}-${v.lastOrdinal} (verbose). Recover any one in full with ctx_expand(message=<ordinal>):`,
|
|
27132
|
-
"",
|
|
27133
|
-
v.text
|
|
27134
|
-
];
|
|
27135
|
-
if (v.truncated) {
|
|
27136
|
-
out.push("", `Truncated at message ${v.lastOrdinal} (budget: ~${CTX_EXPAND_TOKEN_BUDGET} tokens). Call again with start=${v.lastOrdinal + 1} end=${effectiveEnd} verbose=true for more.`);
|
|
27137
|
-
}
|
|
27138
|
-
return out.join(`
|
|
27139
|
-
`);
|
|
26965
|
+
return renderVerboseRangeForTool2(sessionId, start, effectiveEnd, CTX_EXPAND_TOKEN_BUDGET, deps.expandTools, deps.recoveryAttachments);
|
|
27140
26966
|
}
|
|
27141
26967
|
const chunk = readSessionChunk2(sessionId, CTX_EXPAND_TOKEN_BUDGET, start, effectiveEnd + 1, { expand: false });
|
|
27142
26968
|
if (!chunk.text || chunk.messageCount === 0) {
|
|
@@ -28630,7 +28456,7 @@ function formatCtxReduceReply(stampedCount, selfStampCount = 0) {
|
|
|
28630
28456
|
return parts.join(" ");
|
|
28631
28457
|
}
|
|
28632
28458
|
// src/tools/ctx-reduce/tools.ts
|
|
28633
|
-
import { createHash as
|
|
28459
|
+
import { createHash as createHash14 } from "node:crypto";
|
|
28634
28460
|
import { tool as tool4 } from "@opencode-ai/plugin";
|
|
28635
28461
|
|
|
28636
28462
|
// src/features/magic-context/range-parser.ts
|
|
@@ -28694,11 +28520,11 @@ function createCtxReduceTool(deps) {
|
|
|
28694
28520
|
const stableId = `oc-${sessionId}-${callId}`;
|
|
28695
28521
|
if (Buffer.byteLength(stableId) <= 128)
|
|
28696
28522
|
return stableId;
|
|
28697
|
-
return `oc-${
|
|
28523
|
+
return `oc-${createHash14("sha256").update(stableId).digest("hex")}`;
|
|
28698
28524
|
}
|
|
28699
28525
|
fallbackCommandSequence += 1;
|
|
28700
28526
|
const monotonicId = `oc-${sessionId}-${fallbackCommandSequence}`;
|
|
28701
|
-
return Buffer.byteLength(monotonicId) <= 128 ? monotonicId : `oc-${
|
|
28527
|
+
return Buffer.byteLength(monotonicId) <= 128 ? monotonicId : `oc-${createHash14("sha256").update(monotonicId).digest("hex")}`;
|
|
28702
28528
|
};
|
|
28703
28529
|
return tool4({
|
|
28704
28530
|
description: CTX_REDUCE_DESCRIPTION,
|
|
@@ -29555,4 +29381,4 @@ function applyHiddenSubagentTemperature(input, output, log) {
|
|
|
29555
29381
|
output.temperature = temperature;
|
|
29556
29382
|
}
|
|
29557
29383
|
|
|
29558
|
-
export { logConfigDependencyNotesOnce, openOpenCodeDb, DREAMER_SYSTEM_PROMPT, runSessionProjectBackfill, SMART_NOTE_COMPILER_SYSTEM_PROMPT, createLiveSessionState, RETROSPECTIVE_MAX_USER_MESSAGE_CHARS, RETROSPECTIVE_MESSAGE_TRUNCATION_MARKER, OpenCodeRetrospectiveRawProvider, createDreamTaskExecutor, runManualDream, runDueTasksForProject, startDreamScheduleTimer, createDreamTimerModuleClient, ensureProjectRegisteredFromOpenCodeDirectory, recordOpenCodeProvenInputFloor, resolveOpenCodeProvenInputFloor, resolveContextWindowGeometry, resolveContextLimit, resolveExecuteThresholdDetail, resolveModelKey, resolveSessionId, createScheduler, describeStorageUnavailability, resolveSessionCacheTtl, runEmbedHistoryDrain, pauseEmbedHistoryDrain, formatEmbedStatusText, getSessionProperties, getSessionCreatedInfo, getMessageUpdatedAssistantInfo, getMessageUpdatedInfo, getSessionErrorInfo, getMessageRemovedInfo, summarizeManualDream, createMagicContextCommandHandler, getLiveNotificationParams, createChatMessageHook, createEventHook, createCommandExecuteBeforeHook, createToolExecuteAfterHook, recordHiddenVariantWarning, buildStatusDetail, isDebugRpcEnabled, registerRpcHandlers, maybeAutoEmbedSessionBackfill, clearTransformDecisionSession, scheduleOpenCodeTransformDecisionWrite, stageOpenCodeV2TransformDecision, bindOpenCodeV2TransformDecision, maybeDeliverChannel2, armLatestThinkingRecovery, armBindingRecoverySafely, armLatestThinkingRecoveryFromError, createM0RenderOptions, lkgReplayLimit, measureLkgReplay, STORAGE_BUSY_MESSAGE, StorageBusyRefusalError, bindSystemDateRequestIdentity, bindSystemDateOutput, registerSystemDateRefresh, rustWrapupHistorianFields, UnmanagedOverWindowError, UnresolvedHistoryBoundaryError, clearMessageTokensCache, createTransform, createSubcModuleClient, createModuleToolBackends, createRustRefusalRecovery, createSystemPromptHashHandler, tryMessagesTransformLkgReplay, createMessagesTransformHandler, primaryOnlyToolIds, subagentToolRefusal, guardSubagentTools, hideSubagentTools, removePrimaryOnlyTools, storedSubagentMode, createCtxExpandTools, CTX_MEMORY_LIST_TOOL_NAME, CTX_MEMORY_ACTIONS, createCtxMemoryTools, createCtxMemoryListTools, CTX_NOTE_DESCRIPTION, withoutSmartNoteText, createCtxNoteTools, createCtxReduceTools, createCtxSearchTools, parameterDescriptionsFor, applyJsonSchemaParameterDescriptions, MagicContextRpcServer, subagentTemperature, applyHiddenSubagentTemperature };
|
|
29384
|
+
export { logConfigDependencyNotesOnce, openOpenCodeDb, DREAMER_SYSTEM_PROMPT, runSessionProjectBackfill, SMART_NOTE_COMPILER_SYSTEM_PROMPT, createLiveSessionState, RETROSPECTIVE_MAX_USER_MESSAGE_CHARS, RETROSPECTIVE_MESSAGE_TRUNCATION_MARKER, OpenCodeRetrospectiveRawProvider, createDreamTaskExecutor, runManualDream, runDueTasksForProject, startDreamScheduleTimer, createDreamTimerModuleClient, ensureProjectRegisteredFromOpenCodeDirectory, recordOpenCodeProvenInputFloor, resolveOpenCodeProvenInputFloor, resolveContextWindowGeometry, resolveContextLimit, resolveExecuteThresholdDetail, resolveModelKey, resolveSessionId, parseCacheTtl, createScheduler, computeHardCacheExpired, describeStorageUnavailability, resolveSessionCacheTtl, runEmbedHistoryDrain, pauseEmbedHistoryDrain, formatEmbedStatusText, getSessionProperties, getSessionCreatedInfo, getMessageUpdatedAssistantInfo, getMessageUpdatedInfo, getSessionErrorInfo, getMessageRemovedInfo, summarizeManualDream, createMagicContextCommandHandler, getLiveNotificationParams, createChatMessageHook, createEventHook, createCommandExecuteBeforeHook, createToolExecuteAfterHook, recordHiddenVariantWarning, buildStatusDetail, isDebugRpcEnabled, registerRpcHandlers, maybeAutoEmbedSessionBackfill, clearTransformDecisionSession, scheduleOpenCodeTransformDecisionWrite, stageOpenCodeV2TransformDecision, bindOpenCodeV2TransformDecision, maybeDeliverChannel2, armLatestThinkingRecovery, armBindingRecoverySafely, armLatestThinkingRecoveryFromError, createM0RenderOptions, lkgReplayLimit, measureLkgReplay, STORAGE_BUSY_MESSAGE, StorageBusyRefusalError, bindSystemDateRequestIdentity, bindSystemDateOutput, registerSystemDateRefresh, rustWrapupHistorianFields, UnmanagedOverWindowError, UnresolvedHistoryBoundaryError, clearMessageTokensCache, createTransform, createSubcModuleClient, createModuleToolBackends, createRustRefusalRecovery, createSystemPromptHashHandler, tryMessagesTransformLkgReplay, createMessagesTransformHandler, primaryOnlyToolIds, subagentToolRefusal, guardSubagentTools, hideSubagentTools, removePrimaryOnlyTools, storedSubagentMode, createCtxExpandTools, CTX_MEMORY_LIST_TOOL_NAME, CTX_MEMORY_ACTIONS, createCtxMemoryTools, createCtxMemoryListTools, CTX_NOTE_DESCRIPTION, withoutSmartNoteText, createCtxNoteTools, createCtxReduceTools, createCtxSearchTools, parameterDescriptionsFor, applyJsonSchemaParameterDescriptions, MagicContextRpcServer, subagentTemperature, applyHiddenSubagentTemperature };
|