@cortexkit/opencode-magic-context 0.49.95 → 0.49.97
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/{announcement-4ynkaf0d.js → announcement-8nj2jd87.js} +5 -5
- package/dist/auto-search-worker.js +5 -5
- package/dist/chunk-embedding-write-worker.js +16 -16
- package/dist/{compaction-marker-candidates-1ndjqh9k.js → compaction-marker-candidates-a4b0anvv.js} +3 -3
- package/dist/compaction-marker-candidates-worker.js +1 -1
- package/dist/{compartment-chunk-embedding-4nn3hsw2.js → compartment-chunk-embedding-re2cw7y3.js} +8 -8
- package/dist/config/removed-agent-config.d.ts +1 -1
- package/dist/config/removed-agent-config.d.ts.map +1 -1
- package/dist/config/schema/magic-context.d.ts +0 -75
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/{conflict-warning-hook-exf96bpt.js → conflict-warning-hook-wcq55y61.js} +8 -8
- package/dist/{context-h9x9m2p3.js → context-br04s0b6.js} +86 -104
- package/dist/{derive-budgets-hzzq71rm.js → derive-budgets-g1sy72e8.js} +5 -5
- package/dist/embedding-backfill-pdymqbnh.js +29 -0
- package/dist/embedding-worker-process.js +2 -2
- package/dist/embedding-worker.js +8 -8
- package/dist/features/magic-context/dreamer/token-budget.d.ts +2 -2
- package/dist/features/magic-context/dreamer/token-budget.d.ts.map +1 -1
- package/dist/features/magic-context/search-rerank.d.ts +2 -2
- package/dist/features/magic-context/search-rerank.d.ts.map +1 -1
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/features/magic-context/storage-native-replay.d.ts +7 -0
- package/dist/features/magic-context/storage-native-replay.d.ts.map +1 -1
- package/dist/{history-owner-xqfsvf9k.js → history-owner-74826t4n.js} +3 -3
- package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts +6 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-messages.d.ts +11 -1
- package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts +2 -1
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +1 -0
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +2 -0
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-3ywyr4zx.js → index-0bjj9yf3.js} +2 -2
- package/dist/{index-7skgrbsg.js → index-0sqhg9nf.js} +41 -21
- package/dist/{index-nxxzeq4y.js → index-0ve29s6f.js} +1 -1
- package/dist/{index-ywrz4wy2.js → index-3fhb0j32.js} +1 -1
- package/dist/{index-gqf8r04r.js → index-3n4j5rqc.js} +1 -1
- package/dist/{index-xsqw8kbd.js → index-45qgkg8j.js} +2 -2
- package/dist/{index-5df2fw5b.js → index-6mryx739.js} +1 -1
- package/dist/{index-tedck05r.js → index-7m2tnk8q.js} +10 -10
- package/dist/{index-r4y0dczp.js → index-7sdns2ww.js} +2 -2
- package/dist/{index-mjy2k9jr.js → index-880a24vd.js} +1 -1
- package/dist/{index-esacb9d0.js → index-89bkkgcn.js} +4 -4
- package/dist/{index-s32f8y67.js → index-89xg64wb.js} +2 -2
- package/dist/{index-pc49a7zt.js → index-8v1brm5n.js} +13 -11
- package/dist/{index-qmm8xpbc.js → index-910gahfb.js} +6 -6
- package/dist/{index-47hst5me.js → index-9jvxq5rt.js} +4 -4
- package/dist/{index-832w615x.js → index-azkfw78y.js} +1 -1
- package/dist/{index-wh9fxds5.js → index-c205x7xd.js} +1 -1
- package/dist/{index-mg9s2rc3.js → index-cpbr0xvk.js} +2 -2
- package/dist/{index-cr483vx6.js → index-dj64gzg5.js} +2 -2
- package/dist/{index-jba6ny4m.js → index-dnpcv1rg.js} +4 -4
- package/dist/{index-z4p0ry94.js → index-dt7cyqfe.js} +2 -1
- package/dist/{index-tm799pq7.js → index-e6ay1gez.js} +1 -1
- package/dist/{index-j7n64sg4.js → index-fgw241hh.js} +2 -2
- package/dist/{index-yzzxb5e1.js → index-h7kta6cn.js} +3 -3
- package/dist/{index-q7q6qp1f.js → index-hedgz8an.js} +1 -1
- package/dist/{index-5pgyqgmx.js → index-hj78hvhm.js} +2 -2
- package/dist/{index-7r11k4xr.js → index-hp46xe93.js} +7 -7
- package/dist/{index-ejgp0z9p.js → index-j4dcjb8t.js} +4 -4
- package/dist/{index-e6ncz7a6.js → index-jzrvdqb8.js} +1 -1
- package/dist/{index-sp5pvs95.js → index-k34hc455.js} +2 -2
- package/dist/{index-9ffntwyr.js → index-kj4bprep.js} +4 -4
- package/dist/{index-xe34pwb6.js → index-mgy7g740.js} +1 -1
- package/dist/{index-2v9qpmb3.js → index-mmf6e740.js} +7 -7
- package/dist/{index-3tmbvn0z.js → index-pkxkeezb.js} +27 -19
- package/dist/{index-jm62g83a.js → index-qdjxrbnr.js} +71 -44
- package/dist/{index-xjaf9g90.js → index-r1d45dsr.js} +4 -4
- package/dist/{index-y915t3ey.js → index-r3f85n7y.js} +5 -1
- package/dist/{index-wqwjawer.js → index-tbdy1hk0.js} +6 -6
- package/dist/{index-m0pwswv9.js → index-tqtpgnhr.js} +1 -1
- package/dist/{index-zk6gtf43.js → index-w7n7qkpf.js} +5 -5
- package/dist/{index-ewta5h87.js → index-w9hxgntq.js} +5 -5
- package/dist/{index-2gewejcz.js → index-x49x59ar.js} +145 -32
- package/dist/{index-7dzaamqg.js → index-xcej5kpt.js} +4 -4
- package/dist/{index-s7460efs.js → index-zfx7mtqa.js} +1 -1
- package/dist/{index-c81tggen.js → index-zkjx8gq3.js} +11 -11
- package/dist/{index-et39x9k3.js → index-zmgp0tr6.js} +3 -3
- package/dist/index.js +58 -55
- package/dist/{logger-d7c8akh9.js → logger-nmb2508f.js} +2 -2
- package/dist/{message-fts-rowid-map-0xx8ge09.js → message-fts-rowid-map-vcatdan0.js} +5 -5
- package/dist/{message-index-bounded-d3x8rhpz.js → message-index-bounded-abhwe610.js} +12 -12
- package/dist/{message-time-backfill-pz5981mf.js → message-time-backfill-zc5rsvhv.js} +3 -3
- package/dist/migration-worker.js +13 -13
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/{project-embedding-registry-az68q792.js → project-embedding-registry-e566q4bg.js} +15 -15
- package/dist/raw-ordinal-warmup-worker.js +8 -8
- package/dist/{read-session-chunk-70r1snq3.js → read-session-chunk-sde0wym3.js} +10 -10
- package/dist/{read-session-raw-3sc9231y.js → read-session-raw-trhdgc9z.js} +3 -3
- package/dist/{recomp-orchestrator-cn4r2gz6.js → recomp-orchestrator-dapm3e4v.js} +33 -33
- package/dist/render-6vmqzcem.js +43 -0
- package/dist/{safe-notification-target-d21swr3n.js → safe-notification-target-54ns7dv9.js} +3 -3
- package/dist/{search-b0cb342r.js → search-11aw8wpq.js} +27 -27
- package/dist/{search-archive-s9t3exc1.js → search-archive-4bbn3ztv.js} +13 -13
- package/dist/{send-session-notification-0779tyd9.js → send-session-notification-gxrj4w1r.js} +6 -6
- package/dist/shared/host-sqlite-runtime.d.ts +3 -0
- package/dist/shared/host-sqlite-runtime.d.ts.map +1 -0
- package/dist/shared/redaction.d.ts.map +1 -1
- package/dist/shared/transcript.d.ts +14 -0
- package/dist/shared/transcript.d.ts.map +1 -1
- package/dist/{storage-tags-xvbje7jm.js → storage-tags-jq0c0zsn.js} +7 -7
- package/dist/{store-91kawq9a.js → store-29ksp6vy.js} +3 -3
- package/dist/{transform-postprocess-phase-r1xhsjrh.js → transform-postprocess-phase-1xrjg6be.js} +34 -34
- package/dist/v2/auto-search-worker.js +5 -5
- package/dist/v2/chunk-embedding-write-worker.js +16 -16
- package/dist/v2/{compaction-marker-candidates-bp1bn579.js → compaction-marker-candidates-6nypmsr3.js} +3 -3
- package/dist/v2/compaction-marker-candidates-worker.js +1 -1
- package/dist/v2/{compartment-chunk-embedding-a7ddvz7v.js → compartment-chunk-embedding-jthtfhcd.js} +8 -8
- package/dist/v2/{context-2hssw26q.js → context-43r0mzkp.js} +127 -111
- package/dist/v2/{derive-budgets-hr4qqrnv.js → derive-budgets-wj0q7s7d.js} +6 -6
- package/dist/v2/embedding-backfill-16b16m38.js +29 -0
- package/dist/v2/embedding-worker-process.js +2 -2
- package/dist/v2/embedding-worker.js +8 -8
- package/dist/v2/fold/native-replay.d.ts +2 -1
- package/dist/v2/fold/native-replay.d.ts.map +1 -1
- package/dist/v2/hidden-child-native.d.ts.map +1 -1
- package/dist/v2/hidden-child-record.d.ts +8 -0
- package/dist/v2/hidden-child-record.d.ts.map +1 -1
- package/dist/v2/hidden-completion.d.ts.map +1 -1
- package/dist/v2/hidden-run-holder.d.ts +8 -2
- package/dist/v2/hidden-run-holder.d.ts.map +1 -1
- package/dist/v2/{history-owner-260djmv5.js → history-owner-8pd5ax3n.js} +3 -3
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/hidden-child.d.ts +3 -0
- package/dist/v2/hooks/hidden-child.d.ts.map +1 -1
- package/dist/v2/{logger-zyf43np1.js → logger-58jfese9.js} +2 -2
- package/dist/v2/{message-fts-rowid-map-n8mcvcpz.js → message-fts-rowid-map-ax4vk78j.js} +5 -5
- package/dist/v2/{message-index-bounded-tbwrff24.js → message-index-bounded-qh794qxx.js} +12 -12
- package/dist/v2/{message-time-backfill-ynb3vg6r.js → message-time-backfill-yj773saf.js} +3 -3
- package/dist/v2/migration-worker.js +13 -13
- package/dist/v2/{project-embedding-registry-2zeycxek.js → project-embedding-registry-z05xvckg.js} +15 -15
- package/dist/v2/raw-ordinal-warmup-worker.js +8 -8
- package/dist/v2/{read-session-chunk-cvgsfsgr.js → read-session-chunk-8tn2dbn1.js} +10 -10
- package/dist/v2/{read-session-raw-wg5zc29f.js → read-session-raw-ywebck9q.js} +3 -3
- package/dist/v2/recomp-orchestrator-vzygyqwn.js +69 -0
- package/dist/v2/render-9b5dxp9e.js +43 -0
- package/dist/v2/{safe-notification-target-y55z2zat.js → safe-notification-target-zrwbh6k7.js} +3 -3
- package/dist/v2/{search-x1cac8t6.js → search-35cz80x0.js} +26 -26
- package/dist/v2/{search-archive-k2yh0jj3.js → search-archive-8zqsf9e6.js} +13 -13
- package/dist/v2/{send-session-notification-v69y04f5.js → send-session-notification-8x146x5y.js} +6 -6
- package/dist/v2/{server-gj259dqy.js → server-11ra1pmx.js} +5 -5
- package/dist/v2/{server-6nh36020.js → server-1fnsfm3a.js} +132 -33
- package/dist/v2/{server-gs2251jr.js → server-2cq3e1c1.js} +4 -4
- package/dist/v2/{server-39bcszk4.js → server-2qvnr3t7.js} +1 -1
- package/dist/v2/{server-jkj1dq6j.js → server-2sare4qg.js} +4 -4
- package/dist/v2/{server-jdfe07mp.js → server-2wz6y46g.js} +1 -1
- package/dist/v2/{server-at0v0z4t.js → server-379fd3n7.js} +1 -1
- package/dist/v2/{server-ds8vpfkr.js → server-40vdz8sf.js} +2 -2
- package/dist/v2/{server-qntmqaca.js → server-4yrvbnnm.js} +2 -2
- package/dist/v2/{server-x69fqsvz.js → server-5t4nzfpt.js} +1 -1
- package/dist/v2/{server-npdey91q.js → server-63ree5ns.js} +1 -1
- package/dist/v2/{server-gqkdfdvw.js → server-6qax5pds.js} +2 -2
- package/dist/v2/{server-qb3s0mnc.js → server-73bqw5c0.js} +1 -1
- package/dist/v2/{server-qy58c11s.js → server-7h4gwphm.js} +4 -4
- package/dist/v2/{server-476anw1w.js → server-7tj8yzrv.js} +1 -1
- package/dist/v2/{server-e6xneh68.js → server-arfzfxe8.js} +5 -1
- package/dist/v2/{server-6ash6z8z.js → server-av3p9c8k.js} +1 -1
- package/dist/v2/{server-5hwf5c7r.js → server-bx5k66qc.js} +1 -1
- package/dist/v2/{server-s81b3nct.js → server-db91dxwc.js} +7 -7
- package/dist/v2/{server-z4p0ry94.js → server-dt7cyqfe.js} +2 -1
- package/dist/v2/{server-zc8s06gx.js → server-ganavh75.js} +2 -2
- package/dist/v2/{server-cvm1qrqc.js → server-gh2w75fn.js} +3 -3
- package/dist/v2/{server-y0pd600x.js → server-j1gxs1gj.js} +1 -1
- package/dist/v2/{server-xepfjgv5.js → server-k3ntgf6n.js} +2 -2
- package/dist/v2/{server-j8376q08.js → server-kzrrdjp5.js} +1 -1
- package/dist/v2/{server-1rrmxhd1.js → server-n33hyq9t.js} +2 -2
- package/dist/v2/{server-0tv6kytx.js → server-n34vzyfm.js} +1 -1
- package/dist/v2/{server-prrx17q3.js → server-nnh81jqy.js} +6 -6
- package/dist/v2/{server-cd93xyyx.js → server-qjjky07w.js} +13 -11
- package/dist/v2/{server-vbr1rdkg.js → server-r3h4fy4k.js} +4 -4
- package/dist/v2/{server-96nm9vk4.js → server-rr5c0xcg.js} +2 -2
- package/dist/v2/{server-j4jjtdc5.js → server-rt8t6s2a.js} +2 -2
- package/dist/v2/{server-srtq37nh.js → server-svccj9rd.js} +4 -4
- package/dist/v2/{server-5sbsnpkn.js → server-tq523gj6.js} +1 -1
- package/dist/v2/{server-00adcfjd.js → server-vj0xbbrc.js} +17 -3
- package/dist/v2/{server-88pjnecb.js → server-vsx9tsks.js} +11 -11
- package/dist/v2/{server-s8mk882p.js → server-xekyjy4w.js} +6 -6
- package/dist/v2/{server-bfct1yvb.js → server-z2nv8jdv.js} +41 -21
- package/dist/v2/{server-6aj72z52.js → server-z5cv5wm5.js} +10 -10
- package/dist/v2/{server-5016ccyn.js → server-zemnpv92.js} +4 -4
- package/dist/v2/server.js +9 -9
- package/dist/v2/{storage-tags-y20j3jdp.js → storage-tags-pcenytad.js} +7 -7
- package/dist/v2/{store-b95snz31.js → store-gx19qc3a.js} +3 -3
- package/dist/v2/{v2-archive-reader-q92kwkr5.js → v2-archive-reader-hvdyz30c.js} +1 -1
- package/dist/v2/{wrapup-orchestrator-ydqkxkhj.js → wrapup-orchestrator-0d4ceff3.js} +34 -34
- package/dist/{v2-archive-reader-x62hsr4c.js → v2-archive-reader-qs24chs6.js} +1 -1
- package/dist/wrapup-orchestrator-v1mhjw55.js +56 -0
- package/package.json +1 -1
- package/src/config/index.test.ts +23 -5
- package/src/config/live-run-config.test.ts +7 -7
- package/src/config/removed-agent-config.ts +14 -1
- package/src/config/schema/magic-context.ts +5 -1
- package/src/shared/host-sqlite-runtime.test.ts +21 -0
- package/src/shared/host-sqlite-runtime.ts +32 -0
- package/src/shared/redaction.test.ts +11 -8
- package/src/shared/redaction.ts +5 -1
- package/src/shared/tag-transcript.ts +61 -10
- package/src/shared/transcript.ts +16 -0
- package/dist/embedding-backfill-wdrqkw09.js +0 -29
- package/dist/render-g45k3gts.js +0 -43
- package/dist/v2/embedding-backfill-gveter8p.js +0 -29
- package/dist/v2/recomp-orchestrator-k4cj62f2.js +0 -69
- package/dist/v2/render-ys7a3zks.js +0 -43
- package/dist/wrapup-orchestrator-kt81d6et.js +0 -56
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
resolveLegacyConfigSources,
|
|
8
8
|
getProtectedTokensTierOverrides,
|
|
9
9
|
loadPluginConfigDetailed
|
|
10
|
-
} from "./server-
|
|
10
|
+
} from "./server-vj0xbbrc.js";
|
|
11
11
|
import {
|
|
12
12
|
getHarness2,
|
|
13
13
|
harnessOwnsOpenCodeStore2
|
|
@@ -21,25 +21,25 @@ import {
|
|
|
21
21
|
log2,
|
|
22
22
|
sessionLog2,
|
|
23
23
|
getLoggerDiagnostics2
|
|
24
|
-
} from "./server-
|
|
24
|
+
} from "./server-kzrrdjp5.js";
|
|
25
25
|
import {
|
|
26
26
|
sanitizeDiagnosticText,
|
|
27
27
|
hasShareabilitySensitiveText
|
|
28
|
-
} from "./server-
|
|
28
|
+
} from "./server-dt7cyqfe.js";
|
|
29
29
|
import {
|
|
30
30
|
registerOwnRpcServerInstance,
|
|
31
31
|
rpcPortDir,
|
|
32
32
|
rpcPortFilePath,
|
|
33
33
|
parseRpcPortFile,
|
|
34
34
|
inspectProcessesAsync
|
|
35
|
-
} from "./server-
|
|
35
|
+
} from "./server-2wz6y46g.js";
|
|
36
36
|
import {
|
|
37
37
|
shouldEnforcePrivateStoragePermissions,
|
|
38
38
|
ensureStorageDirectorySync,
|
|
39
39
|
writeStorageFileAtomicSync,
|
|
40
40
|
writeStorageFileAsync,
|
|
41
41
|
createStorageWriteStream
|
|
42
|
-
} from "./server-
|
|
42
|
+
} from "./server-n34vzyfm.js";
|
|
43
43
|
import {
|
|
44
44
|
hasTrustedAbsoluteWall,
|
|
45
45
|
applyProvenInputFloor,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
getSdkContextLimit,
|
|
53
53
|
getSdkOutputLimit,
|
|
54
54
|
getModelsDevCacheState
|
|
55
|
-
} from "./server-
|
|
55
|
+
} from "./server-rr5c0xcg.js";
|
|
56
56
|
import {
|
|
57
57
|
COMPACTION_ENABLED_PATH,
|
|
58
58
|
isDreamerRunnable,
|
|
@@ -93,7 +93,7 @@ import {
|
|
|
93
93
|
DEFAULT_HISTORIAN_TIMEOUT_MS,
|
|
94
94
|
DEFAULT_LOCAL_EMBEDDING_MODEL,
|
|
95
95
|
DREAM_TASK_PROMOTION_DEFAULTS
|
|
96
|
-
} from "./server-
|
|
96
|
+
} from "./server-arfzfxe8.js";
|
|
97
97
|
import {
|
|
98
98
|
historianRunConfig,
|
|
99
99
|
dreamerRunConfig,
|
|
@@ -129,18 +129,21 @@ import {
|
|
|
129
129
|
DREAMER_CLASSIFIER_AGENT,
|
|
130
130
|
DREAMER_DOCS_AGENT,
|
|
131
131
|
DREAMER_REVIEWER_AGENT,
|
|
132
|
+
keptUnderRetention,
|
|
133
|
+
roleTitle,
|
|
134
|
+
childCreateInput,
|
|
135
|
+
assistantOutcome,
|
|
136
|
+
withReader,
|
|
137
|
+
errorText,
|
|
138
|
+
supportsHolderArchive,
|
|
132
139
|
supportsQuietHiddenChildren,
|
|
133
140
|
matchesHiddenRunLocation,
|
|
134
141
|
hiddenRunPlacement,
|
|
135
|
-
HIDDEN_HISTORIAN_AGENT,
|
|
136
|
-
HIDDEN_DREAMER_AGENT,
|
|
137
142
|
HIDDEN_CURATE_AGENT,
|
|
138
|
-
hiddenAgentFor,
|
|
139
143
|
hiddenToolLoop,
|
|
140
144
|
HIDDEN_RUN_DISPOSED_REASON,
|
|
141
145
|
noteChildOfDisposedInstance,
|
|
142
146
|
noteTimedOutHiddenChild,
|
|
143
|
-
hiddenChildPermissions,
|
|
144
147
|
registerHiddenChildAgents,
|
|
145
148
|
hiddenToolCallRefusal,
|
|
146
149
|
HiddenAgentStepLimit,
|
|
@@ -246,7 +249,7 @@ import {
|
|
|
246
249
|
startCompartmentAgent,
|
|
247
250
|
setRecompStarting2,
|
|
248
251
|
setRecompTerminal2
|
|
249
|
-
} from "./server-
|
|
252
|
+
} from "./server-1fnsfm3a.js";
|
|
250
253
|
import {
|
|
251
254
|
embedPauseBySession,
|
|
252
255
|
embedRunStateBySession,
|
|
@@ -269,7 +272,7 @@ import {
|
|
|
269
272
|
estimateTokens,
|
|
270
273
|
estimateFixedPromptTokens,
|
|
271
274
|
normalizeText
|
|
272
|
-
} from "./server-
|
|
275
|
+
} from "./server-73bqw5c0.js";
|
|
273
276
|
import {
|
|
274
277
|
SubcClient,
|
|
275
278
|
connectionFileExists,
|
|
@@ -277,9 +280,10 @@ import {
|
|
|
277
280
|
toSynapseLaneDescriptor,
|
|
278
281
|
formatSynapseLaneDescriptor,
|
|
279
282
|
SynapseEmbeddingProvider
|
|
280
|
-
} from "./server-
|
|
283
|
+
} from "./server-k3ntgf6n.js";
|
|
281
284
|
import {
|
|
282
285
|
inRootAsyncContext2,
|
|
286
|
+
detectSqliteRuntime2,
|
|
283
287
|
getTagIdentityWriteGeneration2,
|
|
284
288
|
Database2,
|
|
285
289
|
getSqliteDatabasePath2,
|
|
@@ -306,11 +310,11 @@ import {
|
|
|
306
310
|
buildInMemoryTailRawMessages2,
|
|
307
311
|
RawOrdinalsNotReady2,
|
|
308
312
|
runSessionWarmupWorker
|
|
309
|
-
} from "./server-
|
|
310
|
-
import"./server-
|
|
313
|
+
} from "./server-av3p9c8k.js";
|
|
314
|
+
import"./server-40vdz8sf.js";
|
|
311
315
|
import {
|
|
312
316
|
deleteChunkEmbedBackoffForSession2
|
|
313
|
-
} from "./server-
|
|
317
|
+
} from "./server-zemnpv92.js";
|
|
314
318
|
import {
|
|
315
319
|
acquireCompartmentLease,
|
|
316
320
|
releaseCompartmentLeaseBestEffort,
|
|
@@ -436,12 +440,12 @@ import {
|
|
|
436
440
|
saveSourceContent,
|
|
437
441
|
replaceSourceContent,
|
|
438
442
|
getSourceContents
|
|
439
|
-
} from "./server-
|
|
443
|
+
} from "./server-qjjky07w.js";
|
|
440
444
|
import {
|
|
441
445
|
cleanSearchText,
|
|
442
446
|
matchedSearchSnippet,
|
|
443
447
|
getLastIndexedOrdinal
|
|
444
|
-
} from "./server-
|
|
448
|
+
} from "./server-svccj9rd.js";
|
|
445
449
|
import {
|
|
446
450
|
ensureSessionMetaRow,
|
|
447
451
|
clearCachedM0M1,
|
|
@@ -700,7 +704,7 @@ import {
|
|
|
700
704
|
adoptNullOwnerToolTag2,
|
|
701
705
|
getCandidateToolOwners2,
|
|
702
706
|
pickNearestPriorOwner2
|
|
703
|
-
} from "./server-
|
|
707
|
+
} from "./server-11ra1pmx.js";
|
|
704
708
|
import {
|
|
705
709
|
BoundedSessionMap,
|
|
706
710
|
getTableColumnNames,
|
|
@@ -714,7 +718,7 @@ import {
|
|
|
714
718
|
freezeTemporalDecisions,
|
|
715
719
|
tagRevisionKey,
|
|
716
720
|
tagIdentityRevisionKey
|
|
717
|
-
} from "./server-
|
|
721
|
+
} from "./server-4yrvbnnm.js";
|
|
718
722
|
import {
|
|
719
723
|
resolveHistorianModel2
|
|
720
724
|
} from "./server-5kym00ag.js";
|
|
@@ -732,7 +736,7 @@ import {
|
|
|
732
736
|
shouldBypassFailClosedBlock,
|
|
733
737
|
resolveAgentNameFromMessages,
|
|
734
738
|
createFailClosedController
|
|
735
|
-
} from "./server-
|
|
739
|
+
} from "./server-2qvnr3t7.js";
|
|
736
740
|
import {
|
|
737
741
|
pruneMissingProjectIdentities,
|
|
738
742
|
setHomeProjectPermission,
|
|
@@ -750,7 +754,7 @@ import {
|
|
|
750
754
|
storedPathBelongsToIdentity,
|
|
751
755
|
beginBootQuietPeriod,
|
|
752
756
|
scheduleAfterBootQuiet
|
|
753
|
-
} from "./server-
|
|
757
|
+
} from "./server-n33hyq9t.js";
|
|
754
758
|
import {
|
|
755
759
|
resolveModelCalibration,
|
|
756
760
|
calibrateBuckets,
|
|
@@ -771,7 +775,7 @@ import {
|
|
|
771
775
|
latestRealUserTurnIdFromOpenCodeDb,
|
|
772
776
|
getMessageTimesFromOpenCodeDb,
|
|
773
777
|
findLastAssistantModelFromOpenCodeDb
|
|
774
|
-
} from "./server-
|
|
778
|
+
} from "./server-bx5k66qc.js";
|
|
775
779
|
import {
|
|
776
780
|
askAnswerLines,
|
|
777
781
|
estimateTrueRawMessageTokens,
|
|
@@ -814,7 +818,7 @@ import {
|
|
|
814
818
|
readRawSessionMessageOrdinalById2,
|
|
815
819
|
readSessionChunk2,
|
|
816
820
|
readRawSessionSeedTail2
|
|
817
|
-
} from "./server-
|
|
821
|
+
} from "./server-db91dxwc.js";
|
|
818
822
|
import {
|
|
819
823
|
getMessageIndexEpoch,
|
|
820
824
|
isMessageIndexSearchable,
|
|
@@ -840,7 +844,7 @@ import {
|
|
|
840
844
|
resolveMemoriesByIdsForSearch2,
|
|
841
845
|
unifiedSearch2,
|
|
842
846
|
formatSearchResults2
|
|
843
|
-
} from "./server-
|
|
847
|
+
} from "./server-z2nv8jdv.js";
|
|
844
848
|
import {
|
|
845
849
|
startBootDeadline,
|
|
846
850
|
getUnconfirmedMigrationHolders,
|
|
@@ -856,7 +860,7 @@ import {
|
|
|
856
860
|
openDatabaseAsync,
|
|
857
861
|
isDatabasePersisted,
|
|
858
862
|
getDatabasePersistenceError
|
|
859
|
-
} from "./server-
|
|
863
|
+
} from "./server-vsx9tsks.js";
|
|
860
864
|
import {
|
|
861
865
|
V2_MEMORY_CATEGORIES,
|
|
862
866
|
CATEGORY_PRIORITY
|
|
@@ -869,7 +873,7 @@ import {
|
|
|
869
873
|
resolveStoredPathWorkspaceIdentity,
|
|
870
874
|
storedPathBelongsToWorkspace,
|
|
871
875
|
computeWorkspaceEpochFingerprint
|
|
872
|
-
} from "./server-
|
|
876
|
+
} from "./server-2sare4qg.js";
|
|
873
877
|
import {
|
|
874
878
|
gaDatabasePath2,
|
|
875
879
|
RAW_MESSAGE_TYPES2,
|
|
@@ -904,15 +908,15 @@ import {
|
|
|
904
908
|
createPrimer,
|
|
905
909
|
updatePrimerSupport,
|
|
906
910
|
updatePrimerAnswer
|
|
907
|
-
} from "./server-
|
|
911
|
+
} from "./server-5t4nzfpt.js";
|
|
908
912
|
import {
|
|
909
913
|
deriveTriggerBudget2,
|
|
910
914
|
deriveHistorianChunkTokens2,
|
|
911
915
|
resolveKnownHistorianContextLimit2,
|
|
912
916
|
resolveHistorianProducerLimits2,
|
|
913
917
|
resolveHistorianContextLimit2
|
|
914
|
-
} from "./server-
|
|
915
|
-
import"./server-
|
|
918
|
+
} from "./server-rt8t6s2a.js";
|
|
919
|
+
import"./server-379fd3n7.js";
|
|
916
920
|
import {
|
|
917
921
|
isEmbeddingHostBusy2
|
|
918
922
|
} from "./server-qt1qqasc.js";
|
|
@@ -938,7 +942,7 @@ import {
|
|
|
938
942
|
embedSessionCompartmentChunks2,
|
|
939
943
|
getEmbeddingCoverageStatus2,
|
|
940
944
|
getAutoEmbeddingSessionCoverage2
|
|
941
|
-
} from "./server-
|
|
945
|
+
} from "./server-z5cv5wm5.js";
|
|
942
946
|
import {
|
|
943
947
|
GIT_SWEEP_LEASE_RENEWAL_MS,
|
|
944
948
|
acquireGitSweepLease,
|
|
@@ -948,7 +952,7 @@ import {
|
|
|
948
952
|
releaseGitSweepLease,
|
|
949
953
|
recordSessionProjectIdentity,
|
|
950
954
|
hasRecordedSessionProjectIdentity
|
|
951
|
-
} from "./server-
|
|
955
|
+
} from "./server-6qax5pds.js";
|
|
952
956
|
import {
|
|
953
957
|
saveEmbeddingIfHashMatches,
|
|
954
958
|
invalidateProject2,
|
|
@@ -958,7 +962,7 @@ import {
|
|
|
958
962
|
getCachedLocalEmbeddingPooling,
|
|
959
963
|
preflightLocalEmbeddingPooling,
|
|
960
964
|
getLocalEmbeddingNativeMemoryStats
|
|
961
|
-
} from "./server-
|
|
965
|
+
} from "./server-7h4gwphm.js";
|
|
962
966
|
import {
|
|
963
967
|
renderUserFacingFailure,
|
|
964
968
|
userFacingFailureCode,
|
|
@@ -978,8 +982,8 @@ import {
|
|
|
978
982
|
readGitFileChangeTimesSince,
|
|
979
983
|
verificationFileExists,
|
|
980
984
|
normalizeVerificationFiles
|
|
981
|
-
} from "./server-
|
|
982
|
-
import"./server-
|
|
985
|
+
} from "./server-nnh81jqy.js";
|
|
986
|
+
import"./server-ganavh75.js";
|
|
983
987
|
import {
|
|
984
988
|
computeCueContentHash,
|
|
985
989
|
hasMuralCueColumns,
|
|
@@ -1015,11 +1019,11 @@ import {
|
|
|
1015
1019
|
drainNotifications2,
|
|
1016
1020
|
isTuiConnected2
|
|
1017
1021
|
} from "./server-y14pawe1.js";
|
|
1018
|
-
import"./server-
|
|
1022
|
+
import"./server-63ree5ns.js";
|
|
1019
1023
|
import {
|
|
1020
1024
|
flushIgnoredMessages2,
|
|
1021
1025
|
sendStatusNotification2
|
|
1022
|
-
} from "./server-
|
|
1026
|
+
} from "./server-2cq3e1c1.js";
|
|
1023
1027
|
import {
|
|
1024
1028
|
rememberHostMedia,
|
|
1025
1029
|
hostMediaAsset,
|
|
@@ -1045,7 +1049,7 @@ import {
|
|
|
1045
1049
|
readV2RawMessagePagesForConversion2,
|
|
1046
1050
|
createV2RawMessageReader2,
|
|
1047
1051
|
createV2RawMessageProvider2
|
|
1048
|
-
} from "./server-
|
|
1052
|
+
} from "./server-7tj8yzrv.js";
|
|
1049
1053
|
import {
|
|
1050
1054
|
resolvePromptContext2
|
|
1051
1055
|
} from "./server-fmsr7v69.js";
|
|
@@ -1053,15 +1057,15 @@ import {
|
|
|
1053
1057
|
renderMessageByOrdinal2,
|
|
1054
1058
|
renderVerboseRangeForTool2,
|
|
1055
1059
|
renderItemByTag2
|
|
1056
|
-
} from "./server-
|
|
1057
|
-
import"./server-
|
|
1060
|
+
} from "./server-gh2w75fn.js";
|
|
1061
|
+
import"./server-j1gxs1gj.js";
|
|
1058
1062
|
import {
|
|
1059
1063
|
readV2ArchiveOffThread2
|
|
1060
|
-
} from "./server-
|
|
1064
|
+
} from "./server-r3h4fy4k.js";
|
|
1061
1065
|
import {
|
|
1062
1066
|
unresolvedLiveTailRefusal2,
|
|
1063
1067
|
renderSearchArchiveOffThread2
|
|
1064
|
-
} from "./server-
|
|
1068
|
+
} from "./server-xekyjy4w.js";
|
|
1065
1069
|
import {
|
|
1066
1070
|
markHostInstructionRow,
|
|
1067
1071
|
hostInstructionRow,
|
|
@@ -1097,7 +1101,7 @@ import {
|
|
|
1097
1101
|
} from "./server-8ajstryz.js";
|
|
1098
1102
|
import {
|
|
1099
1103
|
logSlowWriteTransaction
|
|
1100
|
-
} from "./server-
|
|
1104
|
+
} from "./server-tq523gj6.js";
|
|
1101
1105
|
import {
|
|
1102
1106
|
sameProjectDirectory,
|
|
1103
1107
|
canonicalProjectDirectory
|
|
@@ -8303,6 +8307,8 @@ function planNewToolDrop(target, options, prepare, plannedRemovals) {
|
|
|
8303
8307
|
})
|
|
8304
8308
|
};
|
|
8305
8309
|
}
|
|
8310
|
+
if (prepare && target.prepareRemoval?.() === false)
|
|
8311
|
+
return;
|
|
8306
8312
|
return {
|
|
8307
8313
|
mode: "full",
|
|
8308
8314
|
apply: () => {
|
|
@@ -8369,7 +8375,6 @@ function prepareLegacyToolSkeletonConversions(db, sessionId, targets, options =
|
|
|
8369
8375
|
});
|
|
8370
8376
|
};
|
|
8371
8377
|
const rows = readRows(db);
|
|
8372
|
-
options.prepareRemovals?.(rows);
|
|
8373
8378
|
const converted = new Map;
|
|
8374
8379
|
for (const row of rows) {
|
|
8375
8380
|
const target = targets.get(row.tagNumber);
|
|
@@ -8388,6 +8393,7 @@ function prepareLegacyToolSkeletonConversions(db, sessionId, targets, options =
|
|
|
8388
8393
|
}
|
|
8389
8394
|
converted.set(row.tagNumber, mode);
|
|
8390
8395
|
}
|
|
8396
|
+
options.prepareRemovals?.(rows.filter((row) => converted.get(row.tagNumber) !== "skeleton_real"));
|
|
8391
8397
|
return {
|
|
8392
8398
|
converted,
|
|
8393
8399
|
isCurrent: (connection) => {
|
|
@@ -8426,7 +8432,6 @@ function prepareAgedToolSkeletonConversions(db, sessionId, targets, options = {}
|
|
|
8426
8432
|
return { window, rows };
|
|
8427
8433
|
};
|
|
8428
8434
|
const snapshot = readRows(db);
|
|
8429
|
-
options.prepareRemovals?.(snapshot.rows);
|
|
8430
8435
|
const converted = new Map;
|
|
8431
8436
|
const plannedRemovals = new Set;
|
|
8432
8437
|
for (const row of snapshot.rows) {
|
|
@@ -8445,6 +8450,13 @@ function prepareAgedToolSkeletonConversions(db, sessionId, targets, options = {}
|
|
|
8445
8450
|
converted.set(row.tagNumber, "full");
|
|
8446
8451
|
target.notePlannedRemoval?.(plannedRemovals);
|
|
8447
8452
|
}
|
|
8453
|
+
const retired = snapshot.rows.filter((row) => converted.has(row.tagNumber));
|
|
8454
|
+
options.prepareRemovals?.(retired);
|
|
8455
|
+
for (const row of retired) {
|
|
8456
|
+
const target = targets.get(row.tagNumber);
|
|
8457
|
+
if (target?.prepareRemoval?.() === false)
|
|
8458
|
+
converted.delete(row.tagNumber);
|
|
8459
|
+
}
|
|
8448
8460
|
return {
|
|
8449
8461
|
converted,
|
|
8450
8462
|
isCurrent: (connection) => JSON.stringify(readRows(connection)) === JSON.stringify(snapshot),
|
|
@@ -12710,7 +12722,7 @@ async function runPostTransformPhase(args) {
|
|
|
12710
12722
|
if (args.pendingCompartmentInjection.compartmentEndMessageId === null) {
|
|
12711
12723
|
const nextCount = (degradedCacheCountBySession.get(args.sessionId) ?? 0) + 1;
|
|
12712
12724
|
degradedCacheCountBySession.set(args.sessionId, nextCount);
|
|
12713
|
-
if (nextCount === DEGRADE_CACHE_WARNING_THRESHOLD) {
|
|
12725
|
+
if (nextCount === DEGRADE_CACHE_WARNING_THRESHOLD && !args.expectedAbsentCompartmentBoundary) {
|
|
12714
12726
|
sessionLog2(args.sessionId, `WARNING: compartment injection cache has rebuilt with a degraded null boundary ${nextCount} consecutive times; investigate missing boundary messages`);
|
|
12715
12727
|
}
|
|
12716
12728
|
} else {
|
|
@@ -20788,7 +20800,7 @@ async function runCompartmentPhaseImpl(args) {
|
|
|
20788
20800
|
function refreshCompartmentCoverage() {
|
|
20789
20801
|
sessionLog2(args.sessionId, "transform: compartment agent completed, refreshing compartment coverage");
|
|
20790
20802
|
const historyReprepareShouldBust = published && args.deferredHistoryRefreshSessions.has(args.sessionId);
|
|
20791
|
-
pendingCompartmentInjection = prepareCompartmentInjection(args.db, args.resolvedSessionId, args.messages, historyReprepareShouldBust, args.coveredInstructions, args.projectPath, args.injectionBudgetTokens, args.experimentalTemporalAwareness);
|
|
20803
|
+
pendingCompartmentInjection = prepareCompartmentInjection(args.db, args.resolvedSessionId, args.messages, historyReprepareShouldBust, args.coveredInstructions, args.projectPath, args.injectionBudgetTokens, args.experimentalTemporalAwareness, undefined, args.restoredBoundaryDiagnostic);
|
|
20792
20804
|
if (historyReprepareShouldBust) {
|
|
20793
20805
|
rebuiltHistoryThisPass = true;
|
|
20794
20806
|
}
|
|
@@ -22027,6 +22039,8 @@ ${notice}`, notificationParams));
|
|
|
22027
22039
|
logTransformTiming(sessionId, "compartmentTrigger", tTrigger);
|
|
22028
22040
|
}
|
|
22029
22041
|
let pendingCompartmentInjection = null;
|
|
22042
|
+
const restoredAfterId = deps.restoredAfterSummaryBoundary?.(sessionId);
|
|
22043
|
+
const restoredBoundaryDiagnostic = restoredAfterId ? { restoredAfterId, expectedAbsence: false } : undefined;
|
|
22030
22044
|
let rebuiltHistoryFromInitialPrepare = false;
|
|
22031
22045
|
let hiddenMessagesAtCompactionSeam = [];
|
|
22032
22046
|
let trimmedMessagesAtCompactionBoundary = [];
|
|
@@ -22037,7 +22051,7 @@ ${notice}`, notificationParams));
|
|
|
22037
22051
|
hasCachedM0: sessionMeta.cachedM0Bytes !== null,
|
|
22038
22052
|
boundary: sessionMeta.cachedM0TrimBoundaryId,
|
|
22039
22053
|
partial: sessionMeta.cachedM0TrimBoundaryPartial ?? true
|
|
22040
|
-
});
|
|
22054
|
+
}, restoredBoundaryDiagnostic);
|
|
22041
22055
|
if (messagesBeforeInitialPrepare) {
|
|
22042
22056
|
const skippedVisibleMessages = pendingCompartmentInjection?.skippedVisibleMessages ?? 0;
|
|
22043
22057
|
trimmedMessagesAtCompactionBoundary = messagesBeforeInitialPrepare.slice(0, skippedVisibleMessages);
|
|
@@ -22282,6 +22296,7 @@ ${notice}`, notificationParams));
|
|
|
22282
22296
|
messages,
|
|
22283
22297
|
coveredInstructions: coveredHostInstructions,
|
|
22284
22298
|
pendingCompartmentInjection,
|
|
22299
|
+
restoredBoundaryDiagnostic,
|
|
22285
22300
|
fallbackModelId,
|
|
22286
22301
|
projectPath: projectIdentity,
|
|
22287
22302
|
injectionBudgetTokens: deps.memoryConfig?.injectionBudgetTokens,
|
|
@@ -22618,6 +22633,7 @@ ${notice}`, notificationParams));
|
|
|
22618
22633
|
},
|
|
22619
22634
|
deferredHistoryWasPendingAtPassStart,
|
|
22620
22635
|
compartmentInjectionRebuiltFromDb: pendingCompartmentInjection?.rebuiltFromDb === true,
|
|
22636
|
+
expectedAbsentCompartmentBoundary: restoredBoundaryDiagnostic?.expectedAbsence,
|
|
22621
22637
|
rebuiltHistoryFromInitialPrepare,
|
|
22622
22638
|
historyRebuiltThisPass,
|
|
22623
22639
|
canConsumeDeferredLate,
|
|
@@ -26579,7 +26595,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
26579
26595
|
return { count: buildCompartmentCount(db, sessionId, moduleStatus) };
|
|
26580
26596
|
});
|
|
26581
26597
|
const buildManagedCtx = async (db) => {
|
|
26582
|
-
const { deriveHistorianChunkTokens, resolveHistorianContextLimit } = await importPluginModule(() => import("./derive-budgets-
|
|
26598
|
+
const { deriveHistorianChunkTokens, resolveHistorianContextLimit } = await importPluginModule(() => import("./derive-budgets-wj0q7s7d.js"));
|
|
26583
26599
|
const { resolveHistorianModel } = await importPluginModule(() => import("./model-resolution-280gmqvd.js"));
|
|
26584
26600
|
const { userObservationCollectionEnabled, userObservationsRequested } = await importPluginModule(() => import("./task-config-4nqq2s0w.js"));
|
|
26585
26601
|
const DEFAULT_HISTORIAN_TIMEOUT_MS = 10 * 60 * 1000;
|
|
@@ -26612,7 +26628,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
26612
26628
|
return { ok: false, error: "no session" };
|
|
26613
26629
|
const readDirectory = args.readSessionDirectory;
|
|
26614
26630
|
if (readDirectory) {
|
|
26615
|
-
const { handoffHistoryWork } = await import("./history-owner-
|
|
26631
|
+
const { handoffHistoryWork } = await import("./history-owner-8pd5ax3n.js");
|
|
26616
26632
|
const handed = await handoffHistoryWork({
|
|
26617
26633
|
storageDir: args.storageDir ?? getMagicContextStorageDir(),
|
|
26618
26634
|
directory,
|
|
@@ -26631,8 +26647,8 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
26631
26647
|
const db = readDatabase();
|
|
26632
26648
|
if (!db)
|
|
26633
26649
|
return { ok: false, error: "db unavailable" };
|
|
26634
|
-
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-
|
|
26635
|
-
const { sendIgnoredMessage } = await importPluginModule(() => import("./send-session-notification-
|
|
26650
|
+
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-vzygyqwn.js"));
|
|
26651
|
+
const { sendIgnoredMessage } = await importPluginModule(() => import("./send-session-notification-8x146x5y.js"));
|
|
26636
26652
|
log2(`[rpc] recomp requested for session ${sessionId}`);
|
|
26637
26653
|
if (!args.client && !args.hiddenCompletionExecutor) {
|
|
26638
26654
|
return {
|
|
@@ -26690,7 +26706,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
26690
26706
|
rpcServer.handle("wrapup", async (params) => {
|
|
26691
26707
|
const readDirectory = args.readSessionDirectory;
|
|
26692
26708
|
if (readDirectory && params.sessionId) {
|
|
26693
|
-
const { handoffHistoryWork } = await import("./history-owner-
|
|
26709
|
+
const { handoffHistoryWork } = await import("./history-owner-8pd5ax3n.js");
|
|
26694
26710
|
const sessionId = String(params.sessionId);
|
|
26695
26711
|
const handed = await handoffHistoryWork({
|
|
26696
26712
|
storageDir: args.storageDir ?? getMagicContextStorageDir(),
|
|
@@ -26716,7 +26732,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
26716
26732
|
const db = readDatabase();
|
|
26717
26733
|
if (!db)
|
|
26718
26734
|
return { ok: false, error: "db unavailable" };
|
|
26719
|
-
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-
|
|
26735
|
+
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-0d4ceff3.js"));
|
|
26720
26736
|
const model = await args.readSelectedSessionModel?.(sessionId) ?? liveSessionState.liveModelBySession.get(sessionId);
|
|
26721
26737
|
const window = resolveOpenCodeWrapupWindow(db, sessionId, model);
|
|
26722
26738
|
if (!window)
|
|
@@ -27100,6 +27116,28 @@ function readOmoDisabledHooks(directory) {
|
|
|
27100
27116
|
return disabled;
|
|
27101
27117
|
}
|
|
27102
27118
|
|
|
27119
|
+
// src/shared/host-sqlite-runtime.ts
|
|
27120
|
+
var RECORDED = Symbol.for("magic-context.host-sqlite-runtime-recorded");
|
|
27121
|
+
function recordHostSqliteRuntime(db, harness, write = (line) => sessionLog2("global", line)) {
|
|
27122
|
+
const processGlobals = globalThis;
|
|
27123
|
+
if (processGlobals[RECORDED])
|
|
27124
|
+
return;
|
|
27125
|
+
try {
|
|
27126
|
+
const row = db.prepare("SELECT sqlite_version() AS version").get();
|
|
27127
|
+
if (!row?.version)
|
|
27128
|
+
return;
|
|
27129
|
+
const bun = detectSqliteRuntime2() === "Bun";
|
|
27130
|
+
const electron = !bun && process.versions.electron;
|
|
27131
|
+
const runtime = bun ? "Bun" : electron ? "Electron" : "Node.js";
|
|
27132
|
+
const version = bun ? process.versions.bun : electron || process.versions.node;
|
|
27133
|
+
if (!version)
|
|
27134
|
+
return;
|
|
27135
|
+
const binding = bun ? "bun:sqlite" : "node:sqlite";
|
|
27136
|
+
processGlobals[RECORDED] = true;
|
|
27137
|
+
write(`host SQLite runtime harness=${harness} sqlite=${row.version} runtime=${runtime} version=${version} binding=${binding}`);
|
|
27138
|
+
} catch {}
|
|
27139
|
+
}
|
|
27140
|
+
|
|
27103
27141
|
// src/shared/rpc-server.ts
|
|
27104
27142
|
import { randomBytes, timingSafeEqual } from "node:crypto";
|
|
27105
27143
|
import { readdirSync, readFileSync as readFileSync4, rmdirSync, unlinkSync } from "node:fs";
|
|
@@ -30359,6 +30397,8 @@ ${cached}
|
|
|
30359
30397
|
}
|
|
30360
30398
|
if (replay) {
|
|
30361
30399
|
await this.retainReplay(sessionID, replay, model, cut.seq - 1, passSource);
|
|
30400
|
+
if (result && replay.floor.kind === "summary" && after === replay.floor.seq && after < cut.seq)
|
|
30401
|
+
options.onRestoredAfterSummary?.(replay.floor.id);
|
|
30362
30402
|
return result && insertControls(result, controls, nativeRowID);
|
|
30363
30403
|
}
|
|
30364
30404
|
return result;
|
|
@@ -30434,7 +30474,7 @@ ${cached}
|
|
|
30434
30474
|
}
|
|
30435
30475
|
return messages;
|
|
30436
30476
|
}
|
|
30437
|
-
async restoreRead(sessionID, cut, model, passSource) {
|
|
30477
|
+
async restoreRead(sessionID, cut, model, passSource, onRestoredAfterSummary) {
|
|
30438
30478
|
const reader = this.openReader(sessionID);
|
|
30439
30479
|
try {
|
|
30440
30480
|
if (reader.hostIdentity() !== passSource)
|
|
@@ -30452,6 +30492,8 @@ ${cached}
|
|
|
30452
30492
|
bindNativeRowID(message, row.id, row.seq);
|
|
30453
30493
|
return messages;
|
|
30454
30494
|
});
|
|
30495
|
+
if (replay?.floor.kind === "summary" && after === replay.floor.seq && after < cut.seq)
|
|
30496
|
+
onRestoredAfterSummary?.(replay.floor.id);
|
|
30455
30497
|
return replay ? insertControls(messages, controlsThrough(replay.controls, reader, sessionID, cut.seq - 1), nativeRowID) : messages;
|
|
30456
30498
|
} finally {
|
|
30457
30499
|
reader.close();
|
|
@@ -30846,57 +30888,6 @@ function seedV2ForkFromParent(args) {
|
|
|
30846
30888
|
return { kind: "seeded", parentSessionID, pairedRows: idMap.parentToFork.size, result };
|
|
30847
30889
|
}
|
|
30848
30890
|
|
|
30849
|
-
// src/v2/hidden-child-record.ts
|
|
30850
|
-
function keptUnderRetention(keepSubagents, child) {
|
|
30851
|
-
return keepSubagents && (child.ever_settled === true || child.role === "historian");
|
|
30852
|
-
}
|
|
30853
|
-
function roleTitle(role) {
|
|
30854
|
-
return role === "historian" ? "Magic Context historian" : "Magic Context dreamer";
|
|
30855
|
-
}
|
|
30856
|
-
function roleAgent(role) {
|
|
30857
|
-
if (role === "historian")
|
|
30858
|
-
return HIDDEN_HISTORIAN_AGENT;
|
|
30859
|
-
return role === "dreamer-curate" ? HIDDEN_CURATE_AGENT : HIDDEN_DREAMER_AGENT;
|
|
30860
|
-
}
|
|
30861
|
-
function childCreateInput(identity, role, model) {
|
|
30862
|
-
const agent = hiddenToolLoop(identity) ? hiddenAgentFor(identity) : roleAgent(role);
|
|
30863
|
-
return {
|
|
30864
|
-
title: roleTitle(role),
|
|
30865
|
-
agent,
|
|
30866
|
-
model: {
|
|
30867
|
-
providerID: model.providerID,
|
|
30868
|
-
id: model.modelID,
|
|
30869
|
-
...model.variant ? { variant: model.variant } : {}
|
|
30870
|
-
},
|
|
30871
|
-
location: { directory: identity.directory },
|
|
30872
|
-
metadata: { magic_context: "hidden-run", role },
|
|
30873
|
-
permissions: hiddenChildPermissions(agent, model.providerID)
|
|
30874
|
-
};
|
|
30875
|
-
}
|
|
30876
|
-
function assistantOutcome(row) {
|
|
30877
|
-
const outcome = row?.data.outcome;
|
|
30878
|
-
return outcome === "succeeded" || outcome === "failed" || outcome === "interrupted" ? outcome : undefined;
|
|
30879
|
-
}
|
|
30880
|
-
function withReader(openReader, read) {
|
|
30881
|
-
const reader = openReader();
|
|
30882
|
-
try {
|
|
30883
|
-
return read(reader);
|
|
30884
|
-
} finally {
|
|
30885
|
-
reader.close?.();
|
|
30886
|
-
}
|
|
30887
|
-
}
|
|
30888
|
-
function errorText(value) {
|
|
30889
|
-
if (value instanceof Error)
|
|
30890
|
-
return value.message;
|
|
30891
|
-
if (typeof value === "string")
|
|
30892
|
-
return value;
|
|
30893
|
-
try {
|
|
30894
|
-
return JSON.stringify(value);
|
|
30895
|
-
} catch {
|
|
30896
|
-
return String(value);
|
|
30897
|
-
}
|
|
30898
|
-
}
|
|
30899
|
-
|
|
30900
30891
|
// src/v2/hidden-child-sweep.ts
|
|
30901
30892
|
var PREFIX = "hidden_child:";
|
|
30902
30893
|
var HIDDEN_CHILD_MAX_AGE_MS = 60 * 60 * 1000;
|
|
@@ -31017,6 +31008,7 @@ function isSessionNotFound(error) {
|
|
|
31017
31008
|
}
|
|
31018
31009
|
function createNativeHiddenChildren(host, removeSession, options) {
|
|
31019
31010
|
const quiet = supportsQuietHiddenChildren(options.hostVersion);
|
|
31011
|
+
const archiveHolder = host.archiveHolder && supportsHolderArchive(options.hostVersion) ? { update: host.archiveHolder, log: options.log } : undefined;
|
|
31020
31012
|
const removing = new Map;
|
|
31021
31013
|
const removeBounded = async (id, timeoutMs = options.removalTimeoutMs ?? 5000) => {
|
|
31022
31014
|
let timer;
|
|
@@ -31085,7 +31077,7 @@ function createNativeHiddenChildren(host, removeSession, options) {
|
|
|
31085
31077
|
const input = childCreateInput(identity, role, model);
|
|
31086
31078
|
const directory = identity.directory;
|
|
31087
31079
|
if (quiet && host.createHolder) {
|
|
31088
|
-
const placement = await hiddenRunPlacement(host.createHolder, directory, budget);
|
|
31080
|
+
const placement = await hiddenRunPlacement(host.createHolder, directory, budget, archiveHolder);
|
|
31089
31081
|
input.id = placement.id;
|
|
31090
31082
|
input.parentID = placement.parentID;
|
|
31091
31083
|
delete input.location;
|
|
@@ -32078,6 +32070,7 @@ async function createV2HiddenCompletionExecutor(host, options) {
|
|
|
32078
32070
|
throw new DreamTokenBudgetExceeded(run.child.id, budget.snapshot().spent);
|
|
32079
32071
|
}
|
|
32080
32072
|
let usageSeq = baseline;
|
|
32073
|
+
let finishedSteps = 0;
|
|
32081
32074
|
let budgetPoll;
|
|
32082
32075
|
let budgetReject;
|
|
32083
32076
|
const budgetStopped = new Promise((_resolve, reject) => {
|
|
@@ -32093,7 +32086,15 @@ async function createV2HiddenCompletionExecutor(host, options) {
|
|
|
32093
32086
|
break;
|
|
32094
32087
|
usageSeq = row.seq;
|
|
32095
32088
|
const tokens = row.data.tokens;
|
|
32096
|
-
const
|
|
32089
|
+
const hasUsage = [
|
|
32090
|
+
tokens?.input,
|
|
32091
|
+
tokens?.output,
|
|
32092
|
+
tokens?.cache?.read,
|
|
32093
|
+
tokens?.cache?.write,
|
|
32094
|
+
tokens?.reasoning
|
|
32095
|
+
].some((value) => typeof value === "number" && Number.isFinite(value));
|
|
32096
|
+
const estimatedInput = attempt.requestTokenEstimates?.[finishedSteps++] ?? 0;
|
|
32097
|
+
const decision = budget.charge(hasUsage ? Math.max(0, tokens?.input ?? 0) : estimatedInput, hasUsage ? Math.max(0, tokens?.cache?.read ?? 0) : 0, hasUsage ? Math.max(0, tokens?.cache?.write ?? 0) : 0, row.data.finish === "stop" && !(row.data.content ?? []).some((part) => part.type === "tool-call"), false);
|
|
32097
32098
|
const onBudgetUpdate = run.identity.metadata?.onBudgetUpdate;
|
|
32098
32099
|
if (typeof onBudgetUpdate === "function")
|
|
32099
32100
|
onBudgetUpdate({ ...budget.snapshot(), sessionId: run.child.id });
|
|
@@ -58516,6 +58517,8 @@ async function setupContext(context, config, nativeRemove, compactionOff, cleanu
|
|
|
58516
58517
|
};
|
|
58517
58518
|
const wrapperStorageGuard = { failClosed, failClosedBlockingEnabled };
|
|
58518
58519
|
let db = await probeV2StorageAtBoot(storage);
|
|
58520
|
+
if (db)
|
|
58521
|
+
recordHostSqliteRuntime(db, "opencode2");
|
|
58519
58522
|
const storageOpenedAtBoot = db !== undefined;
|
|
58520
58523
|
let legacyCleanupStarted = false;
|
|
58521
58524
|
const hiddenChildSweep = createHiddenChildSweeper(nativeRemove, log2, {
|
|
@@ -58664,6 +58667,7 @@ async function setupContext(context, config, nativeRemove, compactionOff, cleanu
|
|
|
58664
58667
|
return createV2HiddenCompletionExecutor({
|
|
58665
58668
|
...context.session,
|
|
58666
58669
|
createHolder: (input) => context.session.create(input),
|
|
58670
|
+
archiveHolder: (input) => context.session.update.call(context.session, input),
|
|
58667
58671
|
watchModelActivity: (sessionID, onOutput) => hiddenModelActivity.watch(sessionID, onOutput),
|
|
58668
58672
|
get: async (input) => {
|
|
58669
58673
|
const session = await context.session.get(input);
|
|
@@ -59471,6 +59475,9 @@ async function setupContext(context, config, nativeRemove, compactionOff, cleanu
|
|
|
59471
59475
|
sessionLog2(draft.sessionID, `v2 restore: from the module boundary ${moduleBoundaryID} to the host checkpoint`);
|
|
59472
59476
|
const present = new Set(args.messages.map((message) => message.id));
|
|
59473
59477
|
const restored = restoredRows.rows(reader, draft.sessionID, boundary, cut.seq).filter((row) => !retiredInstructions(row)).filter((row) => !present.has(row.id)).flatMap((row) => restoreRow(row, draft.model, readerRestoreMedia(reader, (detail) => sessionLog2(draft.sessionID, `v2 restore: attachment replaced by a note row=${detail.rowID} name=${JSON.stringify(detail.name ?? null)} mediaType=${detail.mediaType} reason=${JSON.stringify(detail.reason)}`))));
|
|
59478
|
+
const pass = contextPass.getStore();
|
|
59479
|
+
if (args.canRebuild && pass?.sessionID === draft.sessionID && floorRow && floorRow.id === boundaryID && boundary === floorRow.seq && boundary < cut.seq)
|
|
59480
|
+
pass.restoredAfterSummaryId = floorRow.id;
|
|
59474
59481
|
return [
|
|
59475
59482
|
...rustModeModuleClient ? [] : coveredInstructionRows(reader, draft.sessionID, Math.min(boundary, cut.seq), draft.model, retiredInstructions),
|
|
59476
59483
|
...restored,
|
|
@@ -59493,6 +59500,10 @@ async function setupContext(context, config, nativeRemove, compactionOff, cleanu
|
|
|
59493
59500
|
pushLiveNotification2("toast", { message, variant: "warning" }, sessionID);
|
|
59494
59501
|
},
|
|
59495
59502
|
hostInputEstimate: (sessionID) => checkpointInputEstimates.get(sessionID),
|
|
59503
|
+
restoredAfterSummaryBoundary: (sessionID) => {
|
|
59504
|
+
const pass = contextPass.getStore();
|
|
59505
|
+
return pass?.sessionID === sessionID ? pass.restoredAfterSummaryId : undefined;
|
|
59506
|
+
},
|
|
59496
59507
|
onPassPermission: (sessionID, permission) => {
|
|
59497
59508
|
checkpointPassPermissions.set(sessionID, permission);
|
|
59498
59509
|
},
|
|
@@ -59933,14 +59944,18 @@ async function setupContext(context, config, nativeRemove, compactionOff, cleanu
|
|
|
59933
59944
|
}
|
|
59934
59945
|
}
|
|
59935
59946
|
let nativeRestored = localCut ? nativeFoldReplay?.legacyUpgradeInput(draft.sessionID, draft.model) : undefined;
|
|
59947
|
+
let nativeRestoredAfterSummaryId;
|
|
59936
59948
|
if (nativeRestored === undefined && cut && nativeFoldReplay && draftSourceIdentity !== undefined && await nativeFoldReplay.admits(draft.sessionID, cut, reader)) {
|
|
59937
59949
|
const passSource = draftSourceIdentity;
|
|
59950
|
+
const onRestoredAfterSummary = (id) => {
|
|
59951
|
+
nativeRestoredAfterSummaryId = id;
|
|
59952
|
+
};
|
|
59938
59953
|
try {
|
|
59939
|
-
nativeRestored = await nativeFoldReplay.restore(draft.sessionID, cut, `${draft.model.providerID}/${draft.model.id}`, passSource, { bounded: !rustModeModuleClient });
|
|
59954
|
+
nativeRestored = await nativeFoldReplay.restore(draft.sessionID, cut, `${draft.model.providerID}/${draft.model.id}`, passSource, { bounded: !rustModeModuleClient, onRestoredAfterSummary });
|
|
59940
59955
|
} catch (error) {
|
|
59941
59956
|
nativeFoldReplay.invalidate(draft.sessionID, true);
|
|
59942
59957
|
sessionLog2(draft.sessionID, "v2 host fold: cache unavailable; restoring host rows", error);
|
|
59943
|
-
nativeRestored = await nativeFoldReplay.restoreRead(draft.sessionID, cut, draft.model, passSource);
|
|
59958
|
+
nativeRestored = await nativeFoldReplay.restoreRead(draft.sessionID, cut, draft.model, passSource, onRestoredAfterSummary);
|
|
59944
59959
|
}
|
|
59945
59960
|
if (nativeRestored)
|
|
59946
59961
|
pass.nativeReplayCheckpointID = cut.id;
|
|
@@ -59954,6 +59969,7 @@ async function setupContext(context, config, nativeRemove, compactionOff, cleanu
|
|
|
59954
59969
|
requestPendingMaterialization(pendingMaterializationSessions, draft.sessionID, "host_history_change");
|
|
59955
59970
|
}
|
|
59956
59971
|
if (cut && incoming && nativeRestored) {
|
|
59972
|
+
pass.restoredAfterSummaryId = nativeRestoredAfterSummaryId;
|
|
59957
59973
|
draft.messages.splice(0, draft.messages.length, ...restoreNativeCheckpointInput(draft.messages, incoming, nativeRestored, reader, draft.sessionID));
|
|
59958
59974
|
} else if (!compactionOff && localCut && cut && incoming) {
|
|
59959
59975
|
const legacy = await folds.read(draft.sessionID);
|