@cortexkit/opencode-magic-context 0.49.95 → 0.49.96
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-gtjdrp8f.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/{history-owner-xqfsvf9k.js → history-owner-74826t4n.js} +3 -3
- 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/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-7dzaamqg.js → index-2afrmgy3.js} +4 -4
- 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-2v9qpmb3.js → index-8sgv96kq.js} +7 -7
- 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-3tmbvn0z.js → index-cq8znmyw.js} +17 -17
- 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-jm62g83a.js → index-f154w8m4.js} +71 -44
- package/dist/{index-j7n64sg4.js → index-fgw241hh.js} +2 -2
- package/dist/{index-wqwjawer.js → index-fvfnq8n6.js} +6 -6
- package/dist/{index-pc49a7zt.js → index-gnrwgvn7.js} +10 -10
- 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-2gewejcz.js → index-nqdwpdje.js} +145 -32
- package/dist/{index-xjaf9g90.js → index-r1d45dsr.js} +4 -4
- package/dist/{index-y915t3ey.js → index-r3f85n7y.js} +5 -1
- package/dist/{index-ewta5h87.js → index-t2e10rag.js} +5 -5
- package/dist/{index-m0pwswv9.js → index-tqtpgnhr.js} +1 -1
- package/dist/{index-zk6gtf43.js → index-w7n7qkpf.js} +5 -5
- 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-d3rbpa59.js} +33 -33
- package/dist/render-6cf1dgc4.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-s9m5szf0.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/{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-376xn40x.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-vm09agrs.js} +117 -109
- 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-pfjpzdrb.js +69 -0
- package/dist/v2/render-7t5d7hkv.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-5dpxv0ck.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-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-s8mk882p.js → server-pcq2d1wh.js} +6 -6
- package/dist/v2/{server-vbr1rdkg.js → server-ppy2dj7g.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-cd93xyyx.js → server-vntc961c.js} +10 -10
- package/dist/v2/{server-88pjnecb.js → server-vsx9tsks.js} +11 -11
- package/dist/v2/{server-6nh36020.js → server-w35ep6wn.js} +132 -33
- 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-jqrwz7b8.js} +1 -1
- package/dist/v2/{wrapup-orchestrator-ydqkxkhj.js → wrapup-orchestrator-kcq3cv7y.js} +34 -34
- package/dist/{v2-archive-reader-x62hsr4c.js → v2-archive-reader-64h2gtam.js} +1 -1
- package/dist/wrapup-orchestrator-knyac7jp.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/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-w35ep6wn.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-vntc961c.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-ppy2dj7g.js";
|
|
1061
1065
|
import {
|
|
1062
1066
|
unresolvedLiveTailRefusal2,
|
|
1063
1067
|
renderSearchArchiveOffThread2
|
|
1064
|
-
} from "./server-
|
|
1068
|
+
} from "./server-pcq2d1wh.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
|
|
@@ -12710,7 +12714,7 @@ async function runPostTransformPhase(args) {
|
|
|
12710
12714
|
if (args.pendingCompartmentInjection.compartmentEndMessageId === null) {
|
|
12711
12715
|
const nextCount = (degradedCacheCountBySession.get(args.sessionId) ?? 0) + 1;
|
|
12712
12716
|
degradedCacheCountBySession.set(args.sessionId, nextCount);
|
|
12713
|
-
if (nextCount === DEGRADE_CACHE_WARNING_THRESHOLD) {
|
|
12717
|
+
if (nextCount === DEGRADE_CACHE_WARNING_THRESHOLD && !args.expectedAbsentCompartmentBoundary) {
|
|
12714
12718
|
sessionLog2(args.sessionId, `WARNING: compartment injection cache has rebuilt with a degraded null boundary ${nextCount} consecutive times; investigate missing boundary messages`);
|
|
12715
12719
|
}
|
|
12716
12720
|
} else {
|
|
@@ -20788,7 +20792,7 @@ async function runCompartmentPhaseImpl(args) {
|
|
|
20788
20792
|
function refreshCompartmentCoverage() {
|
|
20789
20793
|
sessionLog2(args.sessionId, "transform: compartment agent completed, refreshing compartment coverage");
|
|
20790
20794
|
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);
|
|
20795
|
+
pendingCompartmentInjection = prepareCompartmentInjection(args.db, args.resolvedSessionId, args.messages, historyReprepareShouldBust, args.coveredInstructions, args.projectPath, args.injectionBudgetTokens, args.experimentalTemporalAwareness, undefined, args.restoredBoundaryDiagnostic);
|
|
20792
20796
|
if (historyReprepareShouldBust) {
|
|
20793
20797
|
rebuiltHistoryThisPass = true;
|
|
20794
20798
|
}
|
|
@@ -22027,6 +22031,8 @@ ${notice}`, notificationParams));
|
|
|
22027
22031
|
logTransformTiming(sessionId, "compartmentTrigger", tTrigger);
|
|
22028
22032
|
}
|
|
22029
22033
|
let pendingCompartmentInjection = null;
|
|
22034
|
+
const restoredAfterId = deps.restoredAfterSummaryBoundary?.(sessionId);
|
|
22035
|
+
const restoredBoundaryDiagnostic = restoredAfterId ? { restoredAfterId, expectedAbsence: false } : undefined;
|
|
22030
22036
|
let rebuiltHistoryFromInitialPrepare = false;
|
|
22031
22037
|
let hiddenMessagesAtCompactionSeam = [];
|
|
22032
22038
|
let trimmedMessagesAtCompactionBoundary = [];
|
|
@@ -22037,7 +22043,7 @@ ${notice}`, notificationParams));
|
|
|
22037
22043
|
hasCachedM0: sessionMeta.cachedM0Bytes !== null,
|
|
22038
22044
|
boundary: sessionMeta.cachedM0TrimBoundaryId,
|
|
22039
22045
|
partial: sessionMeta.cachedM0TrimBoundaryPartial ?? true
|
|
22040
|
-
});
|
|
22046
|
+
}, restoredBoundaryDiagnostic);
|
|
22041
22047
|
if (messagesBeforeInitialPrepare) {
|
|
22042
22048
|
const skippedVisibleMessages = pendingCompartmentInjection?.skippedVisibleMessages ?? 0;
|
|
22043
22049
|
trimmedMessagesAtCompactionBoundary = messagesBeforeInitialPrepare.slice(0, skippedVisibleMessages);
|
|
@@ -22282,6 +22288,7 @@ ${notice}`, notificationParams));
|
|
|
22282
22288
|
messages,
|
|
22283
22289
|
coveredInstructions: coveredHostInstructions,
|
|
22284
22290
|
pendingCompartmentInjection,
|
|
22291
|
+
restoredBoundaryDiagnostic,
|
|
22285
22292
|
fallbackModelId,
|
|
22286
22293
|
projectPath: projectIdentity,
|
|
22287
22294
|
injectionBudgetTokens: deps.memoryConfig?.injectionBudgetTokens,
|
|
@@ -22618,6 +22625,7 @@ ${notice}`, notificationParams));
|
|
|
22618
22625
|
},
|
|
22619
22626
|
deferredHistoryWasPendingAtPassStart,
|
|
22620
22627
|
compartmentInjectionRebuiltFromDb: pendingCompartmentInjection?.rebuiltFromDb === true,
|
|
22628
|
+
expectedAbsentCompartmentBoundary: restoredBoundaryDiagnostic?.expectedAbsence,
|
|
22621
22629
|
rebuiltHistoryFromInitialPrepare,
|
|
22622
22630
|
historyRebuiltThisPass,
|
|
22623
22631
|
canConsumeDeferredLate,
|
|
@@ -26579,7 +26587,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
26579
26587
|
return { count: buildCompartmentCount(db, sessionId, moduleStatus) };
|
|
26580
26588
|
});
|
|
26581
26589
|
const buildManagedCtx = async (db) => {
|
|
26582
|
-
const { deriveHistorianChunkTokens, resolveHistorianContextLimit } = await importPluginModule(() => import("./derive-budgets-
|
|
26590
|
+
const { deriveHistorianChunkTokens, resolveHistorianContextLimit } = await importPluginModule(() => import("./derive-budgets-wj0q7s7d.js"));
|
|
26583
26591
|
const { resolveHistorianModel } = await importPluginModule(() => import("./model-resolution-280gmqvd.js"));
|
|
26584
26592
|
const { userObservationCollectionEnabled, userObservationsRequested } = await importPluginModule(() => import("./task-config-4nqq2s0w.js"));
|
|
26585
26593
|
const DEFAULT_HISTORIAN_TIMEOUT_MS = 10 * 60 * 1000;
|
|
@@ -26612,7 +26620,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
26612
26620
|
return { ok: false, error: "no session" };
|
|
26613
26621
|
const readDirectory = args.readSessionDirectory;
|
|
26614
26622
|
if (readDirectory) {
|
|
26615
|
-
const { handoffHistoryWork } = await import("./history-owner-
|
|
26623
|
+
const { handoffHistoryWork } = await import("./history-owner-8pd5ax3n.js");
|
|
26616
26624
|
const handed = await handoffHistoryWork({
|
|
26617
26625
|
storageDir: args.storageDir ?? getMagicContextStorageDir(),
|
|
26618
26626
|
directory,
|
|
@@ -26631,8 +26639,8 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
26631
26639
|
const db = readDatabase();
|
|
26632
26640
|
if (!db)
|
|
26633
26641
|
return { ok: false, error: "db unavailable" };
|
|
26634
|
-
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-
|
|
26635
|
-
const { sendIgnoredMessage } = await importPluginModule(() => import("./send-session-notification-
|
|
26642
|
+
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-pfjpzdrb.js"));
|
|
26643
|
+
const { sendIgnoredMessage } = await importPluginModule(() => import("./send-session-notification-8x146x5y.js"));
|
|
26636
26644
|
log2(`[rpc] recomp requested for session ${sessionId}`);
|
|
26637
26645
|
if (!args.client && !args.hiddenCompletionExecutor) {
|
|
26638
26646
|
return {
|
|
@@ -26690,7 +26698,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
26690
26698
|
rpcServer.handle("wrapup", async (params) => {
|
|
26691
26699
|
const readDirectory = args.readSessionDirectory;
|
|
26692
26700
|
if (readDirectory && params.sessionId) {
|
|
26693
|
-
const { handoffHistoryWork } = await import("./history-owner-
|
|
26701
|
+
const { handoffHistoryWork } = await import("./history-owner-8pd5ax3n.js");
|
|
26694
26702
|
const sessionId = String(params.sessionId);
|
|
26695
26703
|
const handed = await handoffHistoryWork({
|
|
26696
26704
|
storageDir: args.storageDir ?? getMagicContextStorageDir(),
|
|
@@ -26716,7 +26724,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
26716
26724
|
const db = readDatabase();
|
|
26717
26725
|
if (!db)
|
|
26718
26726
|
return { ok: false, error: "db unavailable" };
|
|
26719
|
-
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-
|
|
26727
|
+
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-kcq3cv7y.js"));
|
|
26720
26728
|
const model = await args.readSelectedSessionModel?.(sessionId) ?? liveSessionState.liveModelBySession.get(sessionId);
|
|
26721
26729
|
const window = resolveOpenCodeWrapupWindow(db, sessionId, model);
|
|
26722
26730
|
if (!window)
|
|
@@ -27100,6 +27108,28 @@ function readOmoDisabledHooks(directory) {
|
|
|
27100
27108
|
return disabled;
|
|
27101
27109
|
}
|
|
27102
27110
|
|
|
27111
|
+
// src/shared/host-sqlite-runtime.ts
|
|
27112
|
+
var RECORDED = Symbol.for("magic-context.host-sqlite-runtime-recorded");
|
|
27113
|
+
function recordHostSqliteRuntime(db, harness, write = (line) => sessionLog2("global", line)) {
|
|
27114
|
+
const processGlobals = globalThis;
|
|
27115
|
+
if (processGlobals[RECORDED])
|
|
27116
|
+
return;
|
|
27117
|
+
try {
|
|
27118
|
+
const row = db.prepare("SELECT sqlite_version() AS version").get();
|
|
27119
|
+
if (!row?.version)
|
|
27120
|
+
return;
|
|
27121
|
+
const bun = detectSqliteRuntime2() === "Bun";
|
|
27122
|
+
const electron = !bun && process.versions.electron;
|
|
27123
|
+
const runtime = bun ? "Bun" : electron ? "Electron" : "Node.js";
|
|
27124
|
+
const version = bun ? process.versions.bun : electron || process.versions.node;
|
|
27125
|
+
if (!version)
|
|
27126
|
+
return;
|
|
27127
|
+
const binding = bun ? "bun:sqlite" : "node:sqlite";
|
|
27128
|
+
processGlobals[RECORDED] = true;
|
|
27129
|
+
write(`host SQLite runtime harness=${harness} sqlite=${row.version} runtime=${runtime} version=${version} binding=${binding}`);
|
|
27130
|
+
} catch {}
|
|
27131
|
+
}
|
|
27132
|
+
|
|
27103
27133
|
// src/shared/rpc-server.ts
|
|
27104
27134
|
import { randomBytes, timingSafeEqual } from "node:crypto";
|
|
27105
27135
|
import { readdirSync, readFileSync as readFileSync4, rmdirSync, unlinkSync } from "node:fs";
|
|
@@ -30359,6 +30389,8 @@ ${cached}
|
|
|
30359
30389
|
}
|
|
30360
30390
|
if (replay) {
|
|
30361
30391
|
await this.retainReplay(sessionID, replay, model, cut.seq - 1, passSource);
|
|
30392
|
+
if (result && replay.floor.kind === "summary" && after === replay.floor.seq && after < cut.seq)
|
|
30393
|
+
options.onRestoredAfterSummary?.(replay.floor.id);
|
|
30362
30394
|
return result && insertControls(result, controls, nativeRowID);
|
|
30363
30395
|
}
|
|
30364
30396
|
return result;
|
|
@@ -30434,7 +30466,7 @@ ${cached}
|
|
|
30434
30466
|
}
|
|
30435
30467
|
return messages;
|
|
30436
30468
|
}
|
|
30437
|
-
async restoreRead(sessionID, cut, model, passSource) {
|
|
30469
|
+
async restoreRead(sessionID, cut, model, passSource, onRestoredAfterSummary) {
|
|
30438
30470
|
const reader = this.openReader(sessionID);
|
|
30439
30471
|
try {
|
|
30440
30472
|
if (reader.hostIdentity() !== passSource)
|
|
@@ -30452,6 +30484,8 @@ ${cached}
|
|
|
30452
30484
|
bindNativeRowID(message, row.id, row.seq);
|
|
30453
30485
|
return messages;
|
|
30454
30486
|
});
|
|
30487
|
+
if (replay?.floor.kind === "summary" && after === replay.floor.seq && after < cut.seq)
|
|
30488
|
+
onRestoredAfterSummary?.(replay.floor.id);
|
|
30455
30489
|
return replay ? insertControls(messages, controlsThrough(replay.controls, reader, sessionID, cut.seq - 1), nativeRowID) : messages;
|
|
30456
30490
|
} finally {
|
|
30457
30491
|
reader.close();
|
|
@@ -30846,57 +30880,6 @@ function seedV2ForkFromParent(args) {
|
|
|
30846
30880
|
return { kind: "seeded", parentSessionID, pairedRows: idMap.parentToFork.size, result };
|
|
30847
30881
|
}
|
|
30848
30882
|
|
|
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
30883
|
// src/v2/hidden-child-sweep.ts
|
|
30901
30884
|
var PREFIX = "hidden_child:";
|
|
30902
30885
|
var HIDDEN_CHILD_MAX_AGE_MS = 60 * 60 * 1000;
|
|
@@ -31017,6 +31000,7 @@ function isSessionNotFound(error) {
|
|
|
31017
31000
|
}
|
|
31018
31001
|
function createNativeHiddenChildren(host, removeSession, options) {
|
|
31019
31002
|
const quiet = supportsQuietHiddenChildren(options.hostVersion);
|
|
31003
|
+
const archiveHolder = host.archiveHolder && supportsHolderArchive(options.hostVersion) ? { update: host.archiveHolder, log: options.log } : undefined;
|
|
31020
31004
|
const removing = new Map;
|
|
31021
31005
|
const removeBounded = async (id, timeoutMs = options.removalTimeoutMs ?? 5000) => {
|
|
31022
31006
|
let timer;
|
|
@@ -31085,7 +31069,7 @@ function createNativeHiddenChildren(host, removeSession, options) {
|
|
|
31085
31069
|
const input = childCreateInput(identity, role, model);
|
|
31086
31070
|
const directory = identity.directory;
|
|
31087
31071
|
if (quiet && host.createHolder) {
|
|
31088
|
-
const placement = await hiddenRunPlacement(host.createHolder, directory, budget);
|
|
31072
|
+
const placement = await hiddenRunPlacement(host.createHolder, directory, budget, archiveHolder);
|
|
31089
31073
|
input.id = placement.id;
|
|
31090
31074
|
input.parentID = placement.parentID;
|
|
31091
31075
|
delete input.location;
|
|
@@ -32078,6 +32062,7 @@ async function createV2HiddenCompletionExecutor(host, options) {
|
|
|
32078
32062
|
throw new DreamTokenBudgetExceeded(run.child.id, budget.snapshot().spent);
|
|
32079
32063
|
}
|
|
32080
32064
|
let usageSeq = baseline;
|
|
32065
|
+
let finishedSteps = 0;
|
|
32081
32066
|
let budgetPoll;
|
|
32082
32067
|
let budgetReject;
|
|
32083
32068
|
const budgetStopped = new Promise((_resolve, reject) => {
|
|
@@ -32093,7 +32078,15 @@ async function createV2HiddenCompletionExecutor(host, options) {
|
|
|
32093
32078
|
break;
|
|
32094
32079
|
usageSeq = row.seq;
|
|
32095
32080
|
const tokens = row.data.tokens;
|
|
32096
|
-
const
|
|
32081
|
+
const hasUsage = [
|
|
32082
|
+
tokens?.input,
|
|
32083
|
+
tokens?.output,
|
|
32084
|
+
tokens?.cache?.read,
|
|
32085
|
+
tokens?.cache?.write,
|
|
32086
|
+
tokens?.reasoning
|
|
32087
|
+
].some((value) => typeof value === "number" && Number.isFinite(value));
|
|
32088
|
+
const estimatedInput = attempt.requestTokenEstimates?.[finishedSteps++] ?? 0;
|
|
32089
|
+
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
32090
|
const onBudgetUpdate = run.identity.metadata?.onBudgetUpdate;
|
|
32098
32091
|
if (typeof onBudgetUpdate === "function")
|
|
32099
32092
|
onBudgetUpdate({ ...budget.snapshot(), sessionId: run.child.id });
|
|
@@ -58516,6 +58509,8 @@ async function setupContext(context, config, nativeRemove, compactionOff, cleanu
|
|
|
58516
58509
|
};
|
|
58517
58510
|
const wrapperStorageGuard = { failClosed, failClosedBlockingEnabled };
|
|
58518
58511
|
let db = await probeV2StorageAtBoot(storage);
|
|
58512
|
+
if (db)
|
|
58513
|
+
recordHostSqliteRuntime(db, "opencode2");
|
|
58519
58514
|
const storageOpenedAtBoot = db !== undefined;
|
|
58520
58515
|
let legacyCleanupStarted = false;
|
|
58521
58516
|
const hiddenChildSweep = createHiddenChildSweeper(nativeRemove, log2, {
|
|
@@ -58664,6 +58659,7 @@ async function setupContext(context, config, nativeRemove, compactionOff, cleanu
|
|
|
58664
58659
|
return createV2HiddenCompletionExecutor({
|
|
58665
58660
|
...context.session,
|
|
58666
58661
|
createHolder: (input) => context.session.create(input),
|
|
58662
|
+
archiveHolder: (input) => context.session.update.call(context.session, input),
|
|
58667
58663
|
watchModelActivity: (sessionID, onOutput) => hiddenModelActivity.watch(sessionID, onOutput),
|
|
58668
58664
|
get: async (input) => {
|
|
58669
58665
|
const session = await context.session.get(input);
|
|
@@ -59471,6 +59467,9 @@ async function setupContext(context, config, nativeRemove, compactionOff, cleanu
|
|
|
59471
59467
|
sessionLog2(draft.sessionID, `v2 restore: from the module boundary ${moduleBoundaryID} to the host checkpoint`);
|
|
59472
59468
|
const present = new Set(args.messages.map((message) => message.id));
|
|
59473
59469
|
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)}`))));
|
|
59470
|
+
const pass = contextPass.getStore();
|
|
59471
|
+
if (args.canRebuild && pass?.sessionID === draft.sessionID && floorRow && floorRow.id === boundaryID && boundary === floorRow.seq && boundary < cut.seq)
|
|
59472
|
+
pass.restoredAfterSummaryId = floorRow.id;
|
|
59474
59473
|
return [
|
|
59475
59474
|
...rustModeModuleClient ? [] : coveredInstructionRows(reader, draft.sessionID, Math.min(boundary, cut.seq), draft.model, retiredInstructions),
|
|
59476
59475
|
...restored,
|
|
@@ -59493,6 +59492,10 @@ async function setupContext(context, config, nativeRemove, compactionOff, cleanu
|
|
|
59493
59492
|
pushLiveNotification2("toast", { message, variant: "warning" }, sessionID);
|
|
59494
59493
|
},
|
|
59495
59494
|
hostInputEstimate: (sessionID) => checkpointInputEstimates.get(sessionID),
|
|
59495
|
+
restoredAfterSummaryBoundary: (sessionID) => {
|
|
59496
|
+
const pass = contextPass.getStore();
|
|
59497
|
+
return pass?.sessionID === sessionID ? pass.restoredAfterSummaryId : undefined;
|
|
59498
|
+
},
|
|
59496
59499
|
onPassPermission: (sessionID, permission) => {
|
|
59497
59500
|
checkpointPassPermissions.set(sessionID, permission);
|
|
59498
59501
|
},
|
|
@@ -59933,14 +59936,18 @@ async function setupContext(context, config, nativeRemove, compactionOff, cleanu
|
|
|
59933
59936
|
}
|
|
59934
59937
|
}
|
|
59935
59938
|
let nativeRestored = localCut ? nativeFoldReplay?.legacyUpgradeInput(draft.sessionID, draft.model) : undefined;
|
|
59939
|
+
let nativeRestoredAfterSummaryId;
|
|
59936
59940
|
if (nativeRestored === undefined && cut && nativeFoldReplay && draftSourceIdentity !== undefined && await nativeFoldReplay.admits(draft.sessionID, cut, reader)) {
|
|
59937
59941
|
const passSource = draftSourceIdentity;
|
|
59942
|
+
const onRestoredAfterSummary = (id) => {
|
|
59943
|
+
nativeRestoredAfterSummaryId = id;
|
|
59944
|
+
};
|
|
59938
59945
|
try {
|
|
59939
|
-
nativeRestored = await nativeFoldReplay.restore(draft.sessionID, cut, `${draft.model.providerID}/${draft.model.id}`, passSource, { bounded: !rustModeModuleClient });
|
|
59946
|
+
nativeRestored = await nativeFoldReplay.restore(draft.sessionID, cut, `${draft.model.providerID}/${draft.model.id}`, passSource, { bounded: !rustModeModuleClient, onRestoredAfterSummary });
|
|
59940
59947
|
} catch (error) {
|
|
59941
59948
|
nativeFoldReplay.invalidate(draft.sessionID, true);
|
|
59942
59949
|
sessionLog2(draft.sessionID, "v2 host fold: cache unavailable; restoring host rows", error);
|
|
59943
|
-
nativeRestored = await nativeFoldReplay.restoreRead(draft.sessionID, cut, draft.model, passSource);
|
|
59950
|
+
nativeRestored = await nativeFoldReplay.restoreRead(draft.sessionID, cut, draft.model, passSource, onRestoredAfterSummary);
|
|
59944
59951
|
}
|
|
59945
59952
|
if (nativeRestored)
|
|
59946
59953
|
pass.nativeReplayCheckpointID = cut.id;
|
|
@@ -59954,6 +59961,7 @@ async function setupContext(context, config, nativeRemove, compactionOff, cleanu
|
|
|
59954
59961
|
requestPendingMaterialization(pendingMaterializationSessions, draft.sessionID, "host_history_change");
|
|
59955
59962
|
}
|
|
59956
59963
|
if (cut && incoming && nativeRestored) {
|
|
59964
|
+
pass.restoredAfterSummaryId = nativeRestoredAfterSummaryId;
|
|
59957
59965
|
draft.messages.splice(0, draft.messages.length, ...restoreNativeCheckpointInput(draft.messages, incoming, nativeRestored, reader, draft.sessionID));
|
|
59958
59966
|
} else if (!compactionOff && localCut && cut && incoming) {
|
|
59959
59967
|
const legacy = await folds.read(draft.sessionID);
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
resolveHistorianProducerLimits2,
|
|
6
6
|
resolveHistorianContextLimit2,
|
|
7
7
|
producerSourceLocalBudget2
|
|
8
|
-
} from "./server-
|
|
8
|
+
} from "./server-rt8t6s2a.js";
|
|
9
9
|
import"./server-1zx87sdm.js";
|
|
10
|
-
import"./server-
|
|
11
|
-
import"./server-
|
|
12
|
-
import"./server-
|
|
13
|
-
import"./server-
|
|
10
|
+
import"./server-rr5c0xcg.js";
|
|
11
|
+
import"./server-n34vzyfm.js";
|
|
12
|
+
import"./server-2wz6y46g.js";
|
|
13
|
+
import"./server-kzrrdjp5.js";
|
|
14
14
|
import"./server-pavzsdc6.js";
|
|
15
|
-
import"./server-
|
|
15
|
+
import"./server-dt7cyqfe.js";
|
|
16
16
|
export {
|
|
17
17
|
deriveHistorianChunkTokens2 as deriveHistorianChunkTokens,
|
|
18
18
|
deriveTriggerBudget2 as deriveTriggerBudget,
|