@cortexkit/opencode-magic-context 0.49.6 → 0.49.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auto-search-worker.js +10 -7
- package/dist/compaction-marker-candidates-worker.js +2 -2
- package/dist/{compaction-marker-candidates-cz72pm1t.js → compaction-marker-candidates-xxz35vwp.js} +3 -3
- package/dist/{conflict-warning-hook-1jq1rxx7.js → conflict-warning-hook-w3crzrar.js} +8 -8
- package/dist/{context-ae3gxdye.js → context-x0ccfv0f.js} +88 -53
- package/dist/{derive-budgets-j4ry8j8n.js → derive-budgets-3nbxsyss.js} +2 -2
- package/dist/embedding-backfill-3h2m5n0q.js +21 -0
- package/dist/embedding-worker-process.js +6 -2
- package/dist/embedding-worker.js +6 -5
- package/dist/features/magic-context/compaction-marker-candidates.d.ts.map +1 -1
- package/dist/features/magic-context/compaction-marker.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/cron.d.ts +2 -0
- package/dist/features/magic-context/dreamer/cron.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/hidden-single-shot.d.ts +6 -3
- package/dist/features/magic-context/dreamer/hidden-single-shot.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/map-memories-prompt.d.ts +7 -1
- package/dist/features/magic-context/dreamer/map-memories-prompt.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/map-memories.d.ts +2 -2
- package/dist/features/magic-context/dreamer/map-memories.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/primer-seed.d.ts +2 -0
- package/dist/features/magic-context/dreamer/primer-seed.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/provider-output-failure.d.ts +1 -0
- package/dist/features/magic-context/dreamer/provider-output-failure.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/refresh-primers.d.ts +2 -2
- package/dist/features/magic-context/memory/embedding-local.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-worker-client.d.ts.map +1 -1
- package/dist/features/magic-context/message-index-async.d.ts.map +1 -1
- package/dist/features/magic-context/migration-worker-client.d.ts.map +1 -1
- package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
- package/dist/features/magic-context/smart-notes/wake-plane.d.ts.map +1 -1
- package/dist/features/magic-context/storage-clone.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +10 -3
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-session.d.ts.map +1 -1
- package/dist/features/magic-context/storage-replay-document.d.ts +4 -0
- package/dist/features/magic-context/storage-replay-document.d.ts.map +1 -1
- package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -1
- package/dist/history-owner-ty29fz0f.js +244 -0
- package/dist/hooks/auto-update-checker/checker.d.ts.map +1 -1
- package/dist/hooks/magic-context/apply-operations.d.ts +7 -0
- package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-worker-client.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-recomp.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/edit-marker.d.ts +2 -0
- package/dist/hooks/magic-context/edit-marker.d.ts.map +1 -1
- package/dist/hooks/magic-context/heuristic-cleanup.d.ts.map +1 -1
- package/dist/hooks/magic-context/history-boundary-repair.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-persist.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-transport.d.ts +1 -0
- package/dist/hooks/magic-context/module-transport.d.ts.map +1 -1
- package/dist/hooks/magic-context/note-nudger.d.ts +5 -3
- package/dist/hooks/magic-context/note-nudger.d.ts.map +1 -1
- package/dist/hooks/magic-context/postprocess-read-cache.d.ts.map +1 -1
- package/dist/hooks/magic-context/raw-ordinal-warmup.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-chunk.d.ts +15 -4
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
- package/dist/hooks/magic-context/replay-committed-drops.d.ts +9 -0
- package/dist/hooks/magic-context/replay-committed-drops.d.ts.map +1 -0
- package/dist/hooks/magic-context/rust-lkg-freeze-registry.d.ts +2 -2
- package/dist/hooks/magic-context/rust-lkg-freeze-registry.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-mode-transform.d.ts +4 -0
- package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-refusal-recovery.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-served-raw.d.ts +29 -0
- package/dist/hooks/magic-context/rust-served-raw.d.ts.map +1 -0
- package/dist/hooks/magic-context/strip-content.d.ts +23 -24
- package/dist/hooks/magic-context/strip-content.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-messages.d.ts +2 -0
- package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
- package/dist/hooks/magic-context/tool-drop-target.d.ts +2 -0
- package/dist/hooks/magic-context/tool-drop-target.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/unresolved-history-boundary.d.ts +5 -1
- package/dist/hooks/magic-context/unresolved-history-boundary.d.ts.map +1 -1
- package/dist/hooks/magic-context/wrapup-orchestrator.d.ts.map +1 -1
- package/dist/{index-g9exahnx.js → index-0jz47061.js} +6 -3
- package/dist/{index-4mjhqadz.js → index-150zz6fh.js} +1 -1
- package/dist/{index-ch08qwgd.js → index-2rw244rh.js} +88 -81
- package/dist/{index-6q5h70h2.js → index-4hb8nt93.js} +3 -3
- package/dist/{index-j55vn694.js → index-7bjgyaj1.js} +4 -4
- package/dist/{index-h2wc01qk.js → index-8kk7yh6m.js} +2 -2
- package/dist/{index-vztbgcdk.js → index-9g1c4bt9.js} +304 -92
- package/dist/{index-7q1m1qjk.js → index-a43xq1pg.js} +5 -5
- package/dist/{index-tqf7yg27.js → index-a4b0gbyg.js} +1 -1
- package/dist/{index-vnjhmkwk.js → index-angx1s0k.js} +4 -3
- package/dist/{index-1xaw2pq8.js → index-b4gcb3rk.js} +8 -8
- package/dist/{index-z1tjp257.js → index-b64n4d0h.js} +1 -1
- package/dist/{index-1bt88epp.js → index-bd9cjab3.js} +1 -1
- package/dist/{index-gbmqa9x9.js → index-bmwfzz28.js} +9 -6
- package/dist/{index-qx53vezw.js → index-gjvjh960.js} +1 -1
- package/dist/{index-zgzdm6dg.js → index-gzg9ekc1.js} +155 -103
- package/dist/{index-vh3e2mvr.js → index-hxrvx6cy.js} +121 -51
- package/dist/{index-w23dh319.js → index-jw4gbfkv.js} +1 -1
- package/dist/index-knvkbfvh.js +25 -0
- package/dist/{index-vkbqdnkj.js → index-kvw6xew3.js} +6 -3
- package/dist/{index-bg5qqene.js → index-mp2kghkv.js} +3 -27
- package/dist/{index-nsjyysj0.js → index-mvvephtj.js} +5 -1
- package/dist/{index-cm4hmxyk.js → index-n78avt2p.js} +1 -1
- package/dist/{index-hr64sth2.js → index-pgy3h49n.js} +4 -4
- package/dist/{index-a796ct3s.js → index-pjgzdezw.js} +13 -9
- package/dist/{index-9m7bn21d.js → index-q28hsbpg.js} +15 -3
- package/dist/{index-ab3bgm2m.js → index-q76br5zn.js} +3 -3
- package/dist/{index-xqyj5c85.js → index-qgp5vnt4.js} +5 -5
- package/dist/{index-9s58tq95.js → index-rg1cezmj.js} +22 -22
- package/dist/{index-f3dnvnw6.js → index-s178h9z8.js} +4 -3
- package/dist/{index-mj1fgfrk.js → index-w1ejb9qr.js} +939 -160
- package/dist/{index-k6xvbj2e.js → index-w28y7d0z.js} +2 -0
- package/dist/{index-0nnd4bry.js → index-wafzvyhg.js} +63 -19
- package/dist/{index-ck6y3td2.js → index-xf6k8szp.js} +4 -4
- package/dist/{index-1j8jcjpa.js → index-xpn05jxq.js} +4 -4
- package/dist/{index-s0gsmthp.js → index-ydjgz36f.js} +7 -7
- package/dist/{index-besxhcsh.js → index-zf9nydbd.js} +50 -39
- package/dist/index.js +53 -52
- package/dist/{logger-ewak5q1s.js → logger-wn328tfg.js} +1 -1
- package/dist/{message-index-bounded-630j53ps.js → message-index-bounded-hxjp56qk.js} +16 -16
- package/dist/{message-index-c84wm2g0.js → message-index-zs882h8e.js} +16 -16
- package/dist/{message-time-backfill-8kj57qe3.js → message-time-backfill-nb5hhnrt.js} +3 -3
- package/dist/migration-worker.js +11 -11
- package/dist/plugin/boot-quiet.d.ts.map +1 -1
- package/dist/plugin/dream-timer.d.ts.map +1 -1
- package/dist/plugin/messages-transform.d.ts.map +1 -1
- package/dist/plugin/rpc-handlers.d.ts +2 -0
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/{project-embedding-registry-vv59t7ah.js → project-embedding-registry-vy7sv9jt.js} +11 -11
- package/dist/raw-ordinal-warmup-worker.js +17 -15
- package/dist/{read-session-chunk-t3vjd0h0.js → read-session-chunk-t9r7r0sg.js} +13 -11
- package/dist/{read-session-raw-gf7eytnm.js → read-session-raw-gm6xj30v.js} +3 -3
- package/dist/recomp-orchestrator-gr36zvd2.js +60 -0
- package/dist/{safe-notification-target-q0cyrx3x.js → safe-notification-target-jdynm677.js} +2 -2
- package/dist/{search-kth2p6cc.js → search-qjen1pmz.js} +24 -24
- package/dist/{send-session-notification-3j6krd4w.js → send-session-notification-q8ngbap3.js} +6 -6
- package/dist/shared/history-owner.d.ts +12 -0
- package/dist/shared/history-owner.d.ts.map +1 -0
- package/dist/shared/off-thread-migration-clock.d.ts +8 -1
- package/dist/shared/off-thread-migration-clock.d.ts.map +1 -1
- package/dist/shared/processed-image-eligibility.d.ts +22 -0
- package/dist/shared/processed-image-eligibility.d.ts.map +1 -0
- package/dist/shared/recovery-reasoning-prefix.d.ts +9 -0
- package/dist/shared/recovery-reasoning-prefix.d.ts.map +1 -0
- package/dist/shared/redaction.d.ts.map +1 -1
- package/dist/shared/rpc-server.d.ts.map +1 -1
- package/dist/shared/sqlite.d.ts +3 -1
- package/dist/shared/sqlite.d.ts.map +1 -1
- package/dist/shared/tag-transcript.d.ts +9 -0
- package/dist/shared/tag-transcript.d.ts.map +1 -1
- package/dist/shared/user-facing-codes.d.ts +2 -2
- package/dist/{sqlite-d7edbk1s.js → sqlite-4pqyynrs.js} +3 -1
- package/dist/{storage-memory-af5zdz98.js → storage-memory-j3v3hc83.js} +2 -2
- package/dist/{storage-tags-dyj7mmbq.js → storage-tags-a513rkj3.js} +5 -5
- package/dist/tools/ctx-expand/search-archive.d.ts +4 -0
- package/dist/tools/ctx-expand/search-archive.d.ts.map +1 -0
- package/dist/tools/ctx-expand/tools.d.ts.map +1 -1
- package/dist/{transform-postprocess-phase-bv3kb5s1.js → transform-postprocess-phase-yv463b7y.js} +30 -30
- package/dist/v2/auto-search-worker.js +10 -7
- package/dist/v2/{compaction-marker-candidates-6gqp5wrc.js → compaction-marker-candidates-a15w3mqh.js} +3 -3
- package/dist/v2/compaction-marker-candidates-worker.js +2 -2
- package/dist/v2/{context-p8f2shp1.js → context-wd82v9z6.js} +1133 -278
- package/dist/v2/{derive-budgets-enckmg7y.js → derive-budgets-0rmpmxjw.js} +3 -3
- package/dist/v2/embedding-backfill-vr7wdtrf.js +20 -0
- package/dist/v2/embedding-worker-process.js +6 -2
- package/dist/v2/embedding-worker.js +6 -5
- package/dist/v2/hidden-completion.d.ts.map +1 -1
- package/dist/v2/history-owner-2cr9py37.js +243 -0
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/payload.d.ts.map +1 -1
- package/dist/v2/hooks/store.d.ts +1 -0
- package/dist/v2/hooks/store.d.ts.map +1 -1
- package/dist/v2/{logger-pj02s7sr.js → logger-te6e1j72.js} +1 -1
- package/dist/v2/{message-index-bounded-yzxmf6vp.js → message-index-bounded-madg2kfr.js} +16 -16
- package/dist/v2/{message-index-3ws17x1g.js → message-index-yd94vt9n.js} +16 -16
- package/dist/v2/{message-time-backfill-5nf10c65.js → message-time-backfill-rz1pnpaj.js} +3 -3
- package/dist/v2/migration-worker.js +11 -11
- package/dist/v2/{project-embedding-registry-rsnf2263.js → project-embedding-registry-ja23aygk.js} +11 -11
- package/dist/v2/raw-ordinal-warmup-worker.js +17 -15
- package/dist/v2/{read-session-chunk-vtb0w2kd.js → read-session-chunk-7qs791f3.js} +13 -11
- package/dist/v2/{read-session-raw-gpcddemt.js → read-session-raw-h4azh85b.js} +3 -3
- package/dist/v2/recomp-orchestrator-ee91r9s6.js +59 -0
- package/dist/v2/{safe-notification-target-y3p1hce9.js → safe-notification-target-936374xx.js} +2 -2
- package/dist/v2/search-pn15rr52.js +46 -0
- package/dist/v2/{send-session-notification-5aj2j7vf.js → send-session-notification-6n7chhyp.js} +6 -6
- package/dist/v2/{server-09g9pkvx.js → server-08k4zkfk.js} +50 -39
- package/dist/v2/{server-ras2sxnc.js → server-44ryn9rb.js} +9 -6
- package/dist/v2/{server-158ehmk2.js → server-4easnf78.js} +19 -19
- package/dist/v2/{server-ww9nr8pe.js → server-4gz0xkrc.js} +5 -5
- package/dist/v2/{server-d6g4whc2.js → server-4qr18rfg.js} +3 -3
- package/dist/v2/{server-f9py7s7a.js → server-4rs8sm06.js} +5 -5
- package/dist/v2/{server-yezz0cp2.js → server-63ha7f0f.js} +3 -27
- package/dist/v2/{server-3t0q2cqx.js → server-7dv9wt9r.js} +1 -1
- package/dist/v2/{server-cw6521wn.js → server-7e087rvk.js} +2 -0
- package/dist/v2/{server-hb6xhh9q.js → server-988cqjme.js} +6 -3
- package/dist/v2/{server-keswwkvv.js → server-9a6bwc12.js} +4 -4
- package/dist/v2/{server-t4k4qexw.js → server-9e5r8y60.js} +5 -1
- package/dist/v2/{server-7ekna9zs.js → server-adfte03x.js} +2 -2
- package/dist/v2/{server-9zqewm6g.js → server-ak7w74j9.js} +4 -4
- package/dist/v2/{server-387vkhjq.js → server-bx59ezg6.js} +4 -3
- package/dist/v2/{server-676xw7at.js → server-ckrb5rm8.js} +1 -1
- package/dist/v2/{server-wrem2nmz.js → server-cxsr0ng6.js} +15 -3
- package/dist/v2/{server-t528t8qm.js → server-hn9fb3v0.js} +2 -2
- package/dist/v2/{server-qn23p4h7.js → server-j3dm74ey.js} +9 -9
- package/dist/v2/{server-yd01snxq.js → server-jjsf29aq.js} +4 -4
- package/dist/v2/server-knvkbfvh.js +25 -0
- package/dist/v2/{server-cm4hmxyk.js → server-n78avt2p.js} +1 -1
- package/dist/v2/{server-btgnsv7w.js → server-njnx39q2.js} +6 -3
- package/dist/v2/{server-6a9mxnb2.js → server-npm52h2q.js} +4 -3
- package/dist/v2/{server-vb7pbd9p.js → server-nveratm5.js} +1 -1
- package/dist/v2/{server-7skbfb81.js → server-q360kdb8.js} +121 -51
- package/dist/v2/{server-kzns2hbz.js → server-s6jqh8bj.js} +1 -1
- package/dist/v2/{server-6byqfbqf.js → server-shme41gj.js} +1 -1
- package/dist/v2/{server-0nnd4bry.js → server-wafzvyhg.js} +63 -19
- package/dist/v2/{server-fby0cxbq.js → server-xj4mewze.js} +304 -92
- package/dist/v2/{server-aa9w15cs.js → server-y5g32dhq.js} +88 -81
- package/dist/v2/{server-x2r63c0x.js → server-yak3sxya.js} +7 -7
- package/dist/v2/{server-4tn95znb.js → server-zrwaj29a.js} +2 -2
- package/dist/v2/server.js +9 -8
- package/dist/v2/{sqlite-d7edbk1s.js → sqlite-4pqyynrs.js} +3 -1
- package/dist/v2/{storage-memory-af5zdz98.js → storage-memory-j3v3hc83.js} +2 -2
- package/dist/v2/{storage-tags-d47bpaqa.js → storage-tags-spa92sgj.js} +5 -5
- package/dist/v2/store-reader.d.ts.map +1 -1
- package/dist/v2/{wrapup-orchestrator-cahk37n7.js → wrapup-orchestrator-5wxy1ggv.js} +38 -35
- package/dist/wrapup-orchestrator-gv08c6f9.js +47 -0
- package/package.json +3 -3
- package/src/config/compaction-accessor-guard.test.ts +3 -0
- package/src/features/magic-context/dreamer/cron.ts +8 -0
- package/src/shared/history-owner.test.ts +60 -0
- package/src/shared/history-owner.ts +43 -0
- package/src/shared/host-stall-profiler-node.ts +3 -1
- package/src/shared/host-stall-profiler.ts +3 -1
- package/src/shared/off-thread-migration-clock.test.ts +80 -10
- package/src/shared/off-thread-migration-clock.ts +37 -13
- package/src/shared/processed-image-eligibility.test.ts +68 -0
- package/src/shared/processed-image-eligibility.ts +41 -0
- package/src/shared/processed-image-position-review.json +20 -0
- package/src/shared/processed-image-position-review.test.ts +19 -0
- package/src/shared/recovery-reasoning-prefix.test.ts +34 -0
- package/src/shared/recovery-reasoning-prefix.ts +35 -0
- package/src/shared/redaction.test.ts +16 -0
- package/src/shared/redaction.ts +8 -1
- package/src/shared/root-async-context.probe.mjs +36 -0
- package/src/shared/root-async-context.test.ts +49 -0
- package/src/shared/rpc-server.ts +27 -23
- package/src/shared/sqlite-busy-budget-review.test.ts +291 -0
- package/src/shared/sqlite-foreground-wait.test.ts +253 -1
- package/src/shared/sqlite-writer-diagnostics.test.ts +31 -0
- package/src/shared/sqlite.ts +112 -30
- package/src/shared/tag-transcript.ts +118 -0
- package/src/shared/user-facing-codes.ts +2 -2
- package/dist/embedding-backfill-dtjmyktb.js +0 -21
- package/dist/recomp-orchestrator-1d08g57a.js +0 -60
- package/dist/v2/embedding-backfill-cg4rv90f.js +0 -20
- package/dist/v2/recomp-orchestrator-v64r4s4r.js +0 -59
- package/dist/v2/search-bpa4fxq1.js +0 -46
- package/dist/wrapup-orchestrator-mqp0v195.js +0 -47
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
getTemporalDecisions,
|
|
7
7
|
freezeTemporalDecisions,
|
|
8
8
|
stableStringify
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-bd9cjab3.js";
|
|
10
10
|
import {
|
|
11
11
|
protectedToolTagNumbers,
|
|
12
12
|
byteSize,
|
|
@@ -62,36 +62,38 @@ import {
|
|
|
62
62
|
getTagsByNumbers2,
|
|
63
63
|
getNewestToolTagNumbers2,
|
|
64
64
|
getDroppedTagsByNumbers2,
|
|
65
|
+
getMaxDroppedTagNumber2,
|
|
65
66
|
getTagById2,
|
|
66
67
|
getToolTagNumberByOwner2,
|
|
67
68
|
getNullOwnerToolTag2,
|
|
68
69
|
adoptNullOwnerToolTag2,
|
|
69
70
|
getCandidateToolOwners2,
|
|
70
71
|
pickNearestPriorOwner2
|
|
71
|
-
} from "./index-
|
|
72
|
+
} from "./index-xpn05jxq.js";
|
|
72
73
|
import {
|
|
73
74
|
textMentionsRecentCommit,
|
|
74
75
|
hasMeaningfulUserText2,
|
|
75
76
|
estimateTokens
|
|
76
|
-
} from "./index-
|
|
77
|
+
} from "./index-gjvjh960.js";
|
|
77
78
|
import {
|
|
78
79
|
log2,
|
|
79
80
|
sessionLog2
|
|
80
|
-
} from "./index-
|
|
81
|
+
} from "./index-mvvephtj.js";
|
|
81
82
|
import {
|
|
83
|
+
inRootAsyncContext2,
|
|
82
84
|
getTagIdentityWriteGeneration2,
|
|
83
85
|
getSqliteDatabasePath2,
|
|
84
86
|
assertTransformWrite2,
|
|
85
87
|
isTransientSqliteError2
|
|
86
|
-
} from "./index-
|
|
88
|
+
} from "./index-wafzvyhg.js";
|
|
87
89
|
import {
|
|
88
90
|
isValidLanguageCode
|
|
89
|
-
} from "./index-
|
|
91
|
+
} from "./index-w28y7d0z.js";
|
|
90
92
|
import {
|
|
91
93
|
getProjectEmbeddingSnapshot2,
|
|
92
94
|
embedTextForProject2,
|
|
93
95
|
embedBatchForProject2
|
|
94
|
-
} from "./index-
|
|
96
|
+
} from "./index-rg1cezmj.js";
|
|
95
97
|
import {
|
|
96
98
|
isEmbeddingHostBusy2
|
|
97
99
|
} from "./index-qt1qqasc.js";
|
|
@@ -140,6 +142,7 @@ import {
|
|
|
140
142
|
addTrailingBlankDecisions,
|
|
141
143
|
demoteTrailingBlankKeepDecisions,
|
|
142
144
|
addStaleReduceStrippedIds,
|
|
145
|
+
getProcessedImageMarkers,
|
|
143
146
|
addProcessedImageStrippedIds,
|
|
144
147
|
getPendingCompactionMarkerState,
|
|
145
148
|
loadPostprocessReplaySnapshot,
|
|
@@ -185,7 +188,7 @@ import {
|
|
|
185
188
|
extractToolCallObservation,
|
|
186
189
|
ToolMutationBatch,
|
|
187
190
|
createToolDropTarget
|
|
188
|
-
} from "./index-
|
|
191
|
+
} from "./index-9g1c4bt9.js";
|
|
189
192
|
import {
|
|
190
193
|
getMaxM0MutationId,
|
|
191
194
|
rememberUnpublishedAutoSearchNoHint,
|
|
@@ -219,21 +222,21 @@ import {
|
|
|
219
222
|
peekNoteNudgeText,
|
|
220
223
|
markNoteNudgeDelivered,
|
|
221
224
|
getActiveCompartmentRun
|
|
222
|
-
} from "./index-
|
|
225
|
+
} from "./index-hxrvx6cy.js";
|
|
223
226
|
import {
|
|
224
227
|
runSessionWarmupWorker
|
|
225
|
-
} from "./index-
|
|
228
|
+
} from "./index-angx1s0k.js";
|
|
226
229
|
import {
|
|
227
230
|
openCodeDbExists,
|
|
228
231
|
withReadOnlySessionDb,
|
|
229
232
|
getMessageTimesFromOpenCodeDb
|
|
230
|
-
} from "./index-
|
|
233
|
+
} from "./index-q76br5zn.js";
|
|
231
234
|
import {
|
|
232
235
|
BoundedSessionMap
|
|
233
|
-
} from "./index-
|
|
236
|
+
} from "./index-b4gcb3rk.js";
|
|
234
237
|
import {
|
|
235
238
|
renderUserFacingFailure
|
|
236
|
-
} from "./index-
|
|
239
|
+
} from "./index-ydjgz36f.js";
|
|
237
240
|
import {
|
|
238
241
|
getErrorMessage
|
|
239
242
|
} from "./index-y8v6yerm.js";
|
|
@@ -243,7 +246,7 @@ import {
|
|
|
243
246
|
} from "./index-d9vfe7xq.js";
|
|
244
247
|
import {
|
|
245
248
|
logSlowWriteTransaction
|
|
246
|
-
} from "./index-
|
|
249
|
+
} from "./index-150zz6fh.js";
|
|
247
250
|
|
|
248
251
|
// src/features/magic-context/tagger.ts
|
|
249
252
|
var TOOL_COMPOSITE_KEY_SEP = "\x00";
|
|
@@ -1337,7 +1340,7 @@ function queueAutoSearchBackfill(db, sessionId, projectPath, query) {
|
|
|
1337
1340
|
pending.delete(key);
|
|
1338
1341
|
resolve();
|
|
1339
1342
|
};
|
|
1340
|
-
const queued = setTimeout(() => {
|
|
1343
|
+
const queued = inRootAsyncContext2(() => setTimeout(() => {
|
|
1341
1344
|
lifecycle.signal.removeEventListener("abort", cancel);
|
|
1342
1345
|
if (lifecycle.signal.aborted)
|
|
1343
1346
|
return done();
|
|
@@ -1348,7 +1351,7 @@ function queueAutoSearchBackfill(db, sessionId, projectPath, query) {
|
|
|
1348
1351
|
clearTimeout(timeout);
|
|
1349
1352
|
done();
|
|
1350
1353
|
});
|
|
1351
|
-
}, 0);
|
|
1354
|
+
}, 0));
|
|
1352
1355
|
const cancel = () => {
|
|
1353
1356
|
clearTimeout(queued);
|
|
1354
1357
|
done();
|
|
@@ -1395,7 +1398,7 @@ async function executeAutoSearchWorker(db, sessionId, projectPath, query, option
|
|
|
1395
1398
|
deadlineUnixMs: autoSearchDeadlineUnixMs(deadlineSignal)
|
|
1396
1399
|
};
|
|
1397
1400
|
return new Promise((resolve, reject) => {
|
|
1398
|
-
const worker = new Worker(entry, { workerData: input });
|
|
1401
|
+
const worker = inRootAsyncContext2(() => new Worker(entry, { workerData: input }));
|
|
1399
1402
|
let settled = false;
|
|
1400
1403
|
const finish = (results, error) => {
|
|
1401
1404
|
if (settled)
|
|
@@ -1507,7 +1510,7 @@ function searchMessageHistoryOffThread(db, request, entry = defaultAutoSearchWor
|
|
|
1507
1510
|
deadline.unref?.();
|
|
1508
1511
|
};
|
|
1509
1512
|
try {
|
|
1510
|
-
worker = new Worker(entry, { workerData: input });
|
|
1513
|
+
worker = inRootAsyncContext2(() => new Worker(entry, { workerData: input }));
|
|
1511
1514
|
} catch (error) {
|
|
1512
1515
|
finish(null, "start-failed", error);
|
|
1513
1516
|
return;
|
|
@@ -2765,21 +2768,40 @@ function buildReplacementContent(tagId) {
|
|
|
2765
2768
|
return `[dropped §${tagId}§]`;
|
|
2766
2769
|
}
|
|
2767
2770
|
function applyNewToolDrop(target, options) {
|
|
2768
|
-
if (
|
|
2771
|
+
if (options.persist && (target?.prepareDrop?.() ?? target?.canDrop?.()) === false) {
|
|
2772
|
+
return { result: "incomplete", mode: "full" };
|
|
2773
|
+
}
|
|
2774
|
+
if (!target) {
|
|
2775
|
+
options.persist?.("full");
|
|
2769
2776
|
return { result: "absent", mode: "full" };
|
|
2770
|
-
|
|
2777
|
+
}
|
|
2778
|
+
if (options.inWindow && hasSmallToolInput(target) || options.keepSkeleton === true || target.cannotRemove?.() === true || target.wouldStrandConversationEnd?.() === true) {
|
|
2771
2779
|
const strip = target.hasAttachments?.() === true;
|
|
2780
|
+
options.persist?.(strip ? "skeleton_stripped" : "skeleton_real");
|
|
2772
2781
|
return {
|
|
2773
2782
|
result: (strip ? target.skeletonStripped?.() : target.skeletonReal?.()) ?? "absent",
|
|
2774
2783
|
mode: strip ? "skeleton_stripped" : "skeleton_real"
|
|
2775
2784
|
};
|
|
2776
2785
|
}
|
|
2786
|
+
options.persist?.("full");
|
|
2777
2787
|
const result = target.drop?.() ?? "absent";
|
|
2778
2788
|
if (result === "truncated" && target.hasAttachments?.() === true) {
|
|
2779
2789
|
return { result: target.skeletonStripped?.() ?? "absent", mode: "skeleton_stripped" };
|
|
2780
2790
|
}
|
|
2781
2791
|
return { result, mode: result === "truncated" ? "skeleton_real" : "full" };
|
|
2782
2792
|
}
|
|
2793
|
+
function applyPersistedToolDrop(db, sessionId, tagNumber, target, options, afterWrite) {
|
|
2794
|
+
return applyNewToolDrop(target, {
|
|
2795
|
+
...options,
|
|
2796
|
+
persist: (mode) => {
|
|
2797
|
+
db.transaction(() => {
|
|
2798
|
+
updateTagDropMode2(db, sessionId, tagNumber, mode);
|
|
2799
|
+
updateTagStatus2(db, sessionId, tagNumber, "dropped");
|
|
2800
|
+
afterWrite?.();
|
|
2801
|
+
}).immediate();
|
|
2802
|
+
}
|
|
2803
|
+
});
|
|
2804
|
+
}
|
|
2783
2805
|
function hasSmallToolInput(target) {
|
|
2784
2806
|
const bytes = target?.inputStringBytes?.() ?? null;
|
|
2785
2807
|
return bytes !== null && bytes <= SKELETON_REAL_INPUT_MAX_BYTES;
|
|
@@ -2859,11 +2881,11 @@ function applyPendingOperations(sessionId, db, targets, protectedTagIds, preload
|
|
|
2859
2881
|
diagnostics.reasons[reason] = (diagnostics.reasons[reason] ?? 0) + 1;
|
|
2860
2882
|
};
|
|
2861
2883
|
let admitted = false;
|
|
2862
|
-
let startedAt = 0;
|
|
2863
2884
|
try {
|
|
2864
2885
|
db.transaction(() => {
|
|
2865
2886
|
admitted = true;
|
|
2866
|
-
|
|
2887
|
+
}).immediate();
|
|
2888
|
+
{
|
|
2867
2889
|
const pendingOps = preloadedPendingOps ?? getPendingOps(db, sessionId);
|
|
2868
2890
|
const tags = preloadedTags ?? getTagsByNumbers2(db, sessionId, [
|
|
2869
2891
|
...new Set([
|
|
@@ -2915,10 +2937,31 @@ function applyPendingOperations(sessionId, db, targets, protectedTagIds, preload
|
|
|
2915
2937
|
continue;
|
|
2916
2938
|
}
|
|
2917
2939
|
}
|
|
2940
|
+
const persistDrop = (mode) => {
|
|
2941
|
+
let startedAt = 0;
|
|
2942
|
+
try {
|
|
2943
|
+
db.transaction(() => {
|
|
2944
|
+
startedAt = performance.now();
|
|
2945
|
+
if (mode)
|
|
2946
|
+
updateTagDropMode2(db, sessionId, pendingOp.tagId, mode);
|
|
2947
|
+
updateTagStatus2(db, sessionId, pendingOp.tagId, "dropped");
|
|
2948
|
+
if (!synthetic)
|
|
2949
|
+
removePendingOp(db, sessionId, pendingOp.tagId);
|
|
2950
|
+
}).immediate();
|
|
2951
|
+
} finally {
|
|
2952
|
+
if (startedAt)
|
|
2953
|
+
logSlowWriteTransaction("apply_pending_operation", startedAt);
|
|
2954
|
+
}
|
|
2955
|
+
};
|
|
2918
2956
|
let shouldPersistDrop = false;
|
|
2919
2957
|
if (isToolTag) {
|
|
2920
2958
|
if (editMarkerTagIds.has(pendingOp.tagId)) {
|
|
2921
2959
|
const strip = target?.hasAttachments?.() === true;
|
|
2960
|
+
if (target?.canDrop?.() === false || target?.prepareDrop?.() === false || !target) {
|
|
2961
|
+
reject("edit_marker_incomplete");
|
|
2962
|
+
continue;
|
|
2963
|
+
}
|
|
2964
|
+
persistDrop(strip ? "edit_marker_stripped" : "edit_marker");
|
|
2922
2965
|
const markResult = (strip ? target?.editMarkerStripped?.() : target?.editMarker?.()) ?? "absent";
|
|
2923
2966
|
if (markResult === "incomplete" || markResult === "absent") {
|
|
2924
2967
|
reject(`edit_marker_${markResult}`);
|
|
@@ -2927,11 +2970,11 @@ function applyPendingOperations(sessionId, db, targets, protectedTagIds, preload
|
|
|
2927
2970
|
didMutateMessage = true;
|
|
2928
2971
|
operationMutated = true;
|
|
2929
2972
|
onTagReduced?.({ tagNumber: pendingOp.tagId, mode: "edit_marker" });
|
|
2930
|
-
updateTagDropMode2(db, sessionId, pendingOp.tagId, strip ? "edit_marker_stripped" : "edit_marker");
|
|
2931
2973
|
shouldPersistDrop = true;
|
|
2932
2974
|
} else {
|
|
2933
2975
|
const { result: dropResult, mode: appliedMode } = applyNewToolDrop(target, {
|
|
2934
|
-
inWindow: skeletonWindow.has(pendingOp.tagId)
|
|
2976
|
+
inWindow: skeletonWindow.has(pendingOp.tagId),
|
|
2977
|
+
persist: persistDrop
|
|
2935
2978
|
});
|
|
2936
2979
|
if (dropResult === "incomplete" || synthetic && dropResult !== "removed" && dropResult !== "truncated") {
|
|
2937
2980
|
reject(`drop_${dropResult}`);
|
|
@@ -2947,12 +2990,12 @@ function applyPendingOperations(sessionId, db, targets, protectedTagIds, preload
|
|
|
2947
2990
|
} else {
|
|
2948
2991
|
reject(`drop_${dropResult}`);
|
|
2949
2992
|
}
|
|
2950
|
-
updateTagDropMode2(db, sessionId, pendingOp.tagId, appliedMode);
|
|
2951
2993
|
shouldPersistDrop = true;
|
|
2952
2994
|
}
|
|
2953
2995
|
} else if (target) {
|
|
2954
2996
|
const replacement = buildReplacementContent(pendingOp.tagId);
|
|
2955
2997
|
const priorContent = target.getContent?.();
|
|
2998
|
+
persistDrop();
|
|
2956
2999
|
const changed = target.setContent(replacement);
|
|
2957
3000
|
if (changed) {
|
|
2958
3001
|
didMutateMessage = true;
|
|
@@ -2969,30 +3012,25 @@ function applyPendingOperations(sessionId, db, targets, protectedTagIds, preload
|
|
|
2969
3012
|
shouldPersistDrop = true;
|
|
2970
3013
|
} else if (!synthetic) {
|
|
2971
3014
|
reject("target_absent");
|
|
3015
|
+
persistDrop();
|
|
2972
3016
|
shouldPersistDrop = true;
|
|
2973
3017
|
}
|
|
2974
3018
|
if (!shouldPersistDrop) {
|
|
2975
3019
|
reject("not_persisted");
|
|
2976
3020
|
continue;
|
|
2977
3021
|
}
|
|
2978
|
-
updateTagStatus2(db, sessionId, pendingOp.tagId, "dropped");
|
|
2979
|
-
if (!synthetic)
|
|
2980
|
-
removePendingOp(db, sessionId, pendingOp.tagId);
|
|
2981
3022
|
if (operationMutated)
|
|
2982
3023
|
diagnostics.mutated += 1;
|
|
2983
3024
|
else
|
|
2984
3025
|
diagnostics.persistedWithoutMutation += 1;
|
|
2985
3026
|
}
|
|
2986
|
-
}
|
|
3027
|
+
}
|
|
2987
3028
|
} catch (error) {
|
|
2988
3029
|
if (!admitted && /database (?:table )?is locked|sqlite_(busy|locked)/i.test(String(error))) {
|
|
2989
3030
|
sessionLog2(sessionId, "pending operations write admission busy; retaining prior bytes for retry");
|
|
2990
3031
|
return false;
|
|
2991
3032
|
}
|
|
2992
3033
|
throw error;
|
|
2993
|
-
} finally {
|
|
2994
|
-
if (admitted)
|
|
2995
|
-
logSlowWriteTransaction("apply_pending_operations", startedAt);
|
|
2996
3034
|
}
|
|
2997
3035
|
if (diagnostics) {
|
|
2998
3036
|
onBatchComplete?.(diagnostics);
|
|
@@ -3281,31 +3319,27 @@ function applyHeuristicCleanup(sessionId, db, targets, messageTagNumbers, config
|
|
|
3281
3319
|
if (plan.shouldDrop) {
|
|
3282
3320
|
const toDrop = new Set(plan.tagNumbers);
|
|
3283
3321
|
const newestEmergencyTags = recentTags;
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3322
|
+
for (const tag of tags) {
|
|
3323
|
+
if (!toDrop.has(tag.tagNumber))
|
|
3324
|
+
continue;
|
|
3325
|
+
if (tag.status !== "active" || tag.type !== "tool")
|
|
3326
|
+
continue;
|
|
3327
|
+
const target = targets.get(tag.tagNumber);
|
|
3328
|
+
const recent = (emergency.usagePercentage ?? 0) < 95 && newestEmergencyTags.has(tag.tagNumber);
|
|
3329
|
+
const { result } = applyPersistedToolDrop(db, sessionId, tag.tagNumber, target, {
|
|
3330
|
+
inWindow: recent,
|
|
3331
|
+
keepSkeleton: target?.requiresToolArcSkeleton === true
|
|
3332
|
+
});
|
|
3333
|
+
if (result === "removed" || result === "truncated") {
|
|
3334
|
+
droppedTools++;
|
|
3335
|
+
emergencyDroppedTools++;
|
|
3336
|
+
droppedTokenReductions.push({
|
|
3337
|
+
tagNumber: tag.tagNumber,
|
|
3338
|
+
mode: result === "removed" ? "full" : "truncated"
|
|
3295
3339
|
});
|
|
3296
|
-
|
|
3297
|
-
updateTagStatus2(db, sessionId, tag.tagNumber, "dropped");
|
|
3298
|
-
updateTagDropMode2(db, sessionId, tag.tagNumber, mode);
|
|
3299
|
-
droppedTools++;
|
|
3300
|
-
emergencyDroppedTools++;
|
|
3301
|
-
droppedTokenReductions.push({
|
|
3302
|
-
tagNumber: tag.tagNumber,
|
|
3303
|
-
mode: result === "removed" ? "full" : "truncated"
|
|
3304
|
-
});
|
|
3305
|
-
emergencyReclaimedTokens += estimateEmergencyDropReclaimTokens(measuredByTag.get(tag.tagNumber) ?? tag);
|
|
3306
|
-
}
|
|
3340
|
+
emergencyReclaimedTokens += estimateEmergencyDropReclaimTokens(measuredByTag.get(tag.tagNumber) ?? tag);
|
|
3307
3341
|
}
|
|
3308
|
-
}
|
|
3342
|
+
}
|
|
3309
3343
|
sessionLog2(sessionId, `emergency tiered drop: ${plan.reason}`);
|
|
3310
3344
|
} else {
|
|
3311
3345
|
sessionLog2(sessionId, `emergency tiered drop skipped: ${plan.reason}`);
|
|
@@ -3386,35 +3420,33 @@ function applyHeuristicCleanup(sessionId, db, targets, messageTagNumbers, config
|
|
|
3386
3420
|
group.push(tag);
|
|
3387
3421
|
fingerprintGroups.set(fingerprint, group);
|
|
3388
3422
|
}
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3423
|
+
for (const [, group] of fingerprintGroups) {
|
|
3424
|
+
if (group.length <= 1)
|
|
3425
|
+
continue;
|
|
3426
|
+
group.sort((a, b) => a.tagNumber - b.tagNumber);
|
|
3427
|
+
for (let i = 0;i < group.length - 1; i++) {
|
|
3428
|
+
const tag = group[i];
|
|
3429
|
+
if (config.protectedTagNumbers.has(tag.tagNumber))
|
|
3392
3430
|
continue;
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
deduplicatedTools++;
|
|
3410
|
-
droppedTokenReductions.push({
|
|
3411
|
-
tagNumber: tag.tagNumber,
|
|
3412
|
-
mode: result === "removed" ? "full" : "truncated"
|
|
3413
|
-
});
|
|
3414
|
-
}
|
|
3431
|
+
const target = targets.get(tag.tagNumber);
|
|
3432
|
+
if (protectedTools.has(tag.tagNumber))
|
|
3433
|
+
continue;
|
|
3434
|
+
if (target?.canDrop?.() === false)
|
|
3435
|
+
continue;
|
|
3436
|
+
const { result } = applyPersistedToolDrop(db, sessionId, tag.tagNumber, target, {
|
|
3437
|
+
inWindow: false
|
|
3438
|
+
});
|
|
3439
|
+
if (result === "incomplete")
|
|
3440
|
+
continue;
|
|
3441
|
+
if (result === "removed" || result === "truncated") {
|
|
3442
|
+
deduplicatedTools++;
|
|
3443
|
+
droppedTokenReductions.push({
|
|
3444
|
+
tagNumber: tag.tagNumber,
|
|
3445
|
+
mode: result === "removed" ? "full" : "truncated"
|
|
3446
|
+
});
|
|
3415
3447
|
}
|
|
3416
3448
|
}
|
|
3417
|
-
}
|
|
3449
|
+
}
|
|
3418
3450
|
}
|
|
3419
3451
|
if (droppedTools > 0 || deduplicatedTools > 0 || droppedInjections > 0) {
|
|
3420
3452
|
sessionLog2(sessionId, `heuristic cleanup: dropped ${droppedTools} tool tags, deduplicated ${deduplicatedTools} tool calls, dropped ${droppedInjections} system injections`);
|
|
@@ -3588,6 +3620,7 @@ function postprocessReplaySnapshot(db, sessionId) {
|
|
|
3588
3620
|
...replay,
|
|
3589
3621
|
staleReduceStrippedIds: new Set(replay.staleReduceStrippedIds),
|
|
3590
3622
|
processedImageStrippedIds: new Set(replay.processedImageStrippedIds),
|
|
3623
|
+
processedImageMarkers: new Map(replay.processedImageMarkers),
|
|
3591
3624
|
strippedPlaceholderIds: new Set(replay.strippedPlaceholderIds),
|
|
3592
3625
|
hiddenSeamPlaceholderIds: new Set(replay.hiddenSeamPlaceholderIds),
|
|
3593
3626
|
mergedReasoningStrippedIds: new Set(replay.mergedReasoningStrippedIds),
|
|
@@ -4897,11 +4930,6 @@ function runRustModePostprocess2(args) {
|
|
|
4897
4930
|
for (const anchor of getNoteNudgeAnchors(args.db, args.sessionId)) {
|
|
4898
4931
|
appendReminderToUserMessageById(args.messages, anchor.messageId, anchor.text);
|
|
4899
4932
|
}
|
|
4900
|
-
for (const decision of getAutoSearchHintDecisions(args.db, args.sessionId)) {
|
|
4901
|
-
if (decision.decision === "hint" && getUnpublishedAutoSearchNoHint(args.sessionId, decision.messageId) === undefined) {
|
|
4902
|
-
appendReminderToUserMessageById(args.messages, decision.messageId, decision.text);
|
|
4903
|
-
}
|
|
4904
|
-
}
|
|
4905
4933
|
const trailingBlankDecisions = new Map;
|
|
4906
4934
|
const visibleAssistantIds = args.messages.filter((message) => message.info.role === "assistant").map((message) => message.info.id).filter((id) => typeof id === "string");
|
|
4907
4935
|
if (modelAcceptsEmptyContent(args.resolvedProviderID)) {
|
|
@@ -4939,7 +4967,7 @@ function runRustModePostprocess2(args) {
|
|
|
4939
4967
|
userMessageIds: args.messages.filter((m) => m.info.role === "user" && typeof m.info.id === "string").map((m) => m.info.id),
|
|
4940
4968
|
anchorMessageId: currentUserMessageId,
|
|
4941
4969
|
isLiveTail: args.messages.at(-1)?.info.id === currentUserMessageId,
|
|
4942
|
-
|
|
4970
|
+
prefixRewriteCoversAnchor: false
|
|
4943
4971
|
});
|
|
4944
4972
|
const noteReadStillVisible = hasVisibleNoteReadCall(args.messages);
|
|
4945
4973
|
const deferredNoteText = peekNoteNudgeText(args.db, args.sessionId, currentUserMessageId, args.projectPath, noteReadStillVisible, eligibility);
|
|
@@ -4956,6 +4984,11 @@ function runRustModePostprocess2(args) {
|
|
|
4956
4984
|
sessionLog2(args.sessionId, `rust note-nudge delivery skipped wire append: ${outcome.kind}`);
|
|
4957
4985
|
}
|
|
4958
4986
|
}
|
|
4987
|
+
for (const decision of getAutoSearchHintDecisions(args.db, args.sessionId)) {
|
|
4988
|
+
if (decision.decision === "hint" && getUnpublishedAutoSearchNoHint(args.sessionId, decision.messageId) === undefined) {
|
|
4989
|
+
appendReminderToUserMessageById(args.messages, decision.messageId, decision.text);
|
|
4990
|
+
}
|
|
4991
|
+
}
|
|
4959
4992
|
const { thinkingBindingRecovery, proactiveThinkingStrip } = applyRustModeThinkingStrips(args, noteNudgeAppended || servedMarkerRecord() !== servedMarkerBefore);
|
|
4960
4993
|
const marker = getPersistedCompactionMarkerState(args.db, args.sessionId);
|
|
4961
4994
|
return {
|
|
@@ -5814,15 +5847,32 @@ async function runPostTransformPhase2(args) {
|
|
|
5814
5847
|
sessionLog2(args.sessionId, "transform failed dropping stale ctx_reduce calls:", error);
|
|
5815
5848
|
}
|
|
5816
5849
|
}
|
|
5817
|
-
if (
|
|
5850
|
+
if (!compactionOff && replaySnapshot) {
|
|
5818
5851
|
try {
|
|
5819
5852
|
const tImg = performance.now();
|
|
5853
|
+
const imageWatermark = canEditWholePrefix ? Math.max(args.watermark, getMaxDroppedTagNumber2(args.db, args.sessionId)) : args.watermark;
|
|
5820
5854
|
const frozenImageIds = replaySnapshot.processedImageStrippedIds;
|
|
5855
|
+
const frozenMarkers = replaySnapshot.processedImageMarkers;
|
|
5856
|
+
const replacementText = canUseEmptySentinels ? "" : "[image stripped]";
|
|
5821
5857
|
stripProcessedImages(args.messages, frozenImageIds, {
|
|
5822
|
-
detect: canEditWholePrefix &&
|
|
5823
|
-
watermark:
|
|
5858
|
+
detect: canEditWholePrefix && imageWatermark > 0,
|
|
5859
|
+
watermark: imageWatermark,
|
|
5824
5860
|
messageTagNumbers: args.messageTagNumbers,
|
|
5825
|
-
|
|
5861
|
+
protectedCutoff: args.protectedCutoff,
|
|
5862
|
+
contextPercentage: args.contextUsage.percentage,
|
|
5863
|
+
replacementText,
|
|
5864
|
+
frozenMarkers,
|
|
5865
|
+
protectedMessageIds: new Set([
|
|
5866
|
+
...args.tags.filter((tag) => protectedToolTags.has(tag.tagNumber)).map((tag) => tag.toolOwnerMessageId ?? tag.messageId)
|
|
5867
|
+
]),
|
|
5868
|
+
persistNewIds: (ids, markers) => {
|
|
5869
|
+
if (!addProcessedImageStrippedIds(args.db, args.sessionId, ids, markers))
|
|
5870
|
+
return false;
|
|
5871
|
+
const committed = getProcessedImageMarkers(args.db, args.sessionId);
|
|
5872
|
+
for (const id of ids)
|
|
5873
|
+
frozenMarkers.set(id, committed.get(id) ?? replacementText);
|
|
5874
|
+
return true;
|
|
5875
|
+
},
|
|
5826
5876
|
onFirstApplication: recordFirstApplicationAt
|
|
5827
5877
|
});
|
|
5828
5878
|
logTransformTiming(args.sessionId, "stripProcessedImages", tImg);
|
|
@@ -5950,16 +6000,6 @@ async function runPostTransformPhase2(args) {
|
|
|
5950
6000
|
logTransformTiming(args.sessionId, "pp.placeholderNeutralize", tPlaceholder);
|
|
5951
6001
|
}
|
|
5952
6002
|
const tNudgeBlock = performance.now();
|
|
5953
|
-
if (args.fullFeatureMode && !compactionOff && replaySnapshot) {
|
|
5954
|
-
for (const anchor of replaySnapshot.noteNudgeAnchors) {
|
|
5955
|
-
appendReminderToUserMessageById(args.messages, anchor.messageId, anchor.text);
|
|
5956
|
-
}
|
|
5957
|
-
for (const decision of replaySnapshot.autoSearchHintDecisions) {
|
|
5958
|
-
if (decision.decision === "hint") {
|
|
5959
|
-
appendReminderToUserMessageById(args.messages, decision.messageId, decision.text);
|
|
5960
|
-
}
|
|
5961
|
-
}
|
|
5962
|
-
}
|
|
5963
6003
|
logTransformTiming(args.sessionId, "pp.nudgeAndSticky", tNudgeBlock);
|
|
5964
6004
|
const tMarker = performance.now();
|
|
5965
6005
|
const explicitRebuildHappened = args.historyRefreshExplicitBeforePrepare && args.rebuiltHistoryFromInitialPrepare;
|
|
@@ -6035,13 +6075,15 @@ async function runPostTransformPhase2(args) {
|
|
|
6035
6075
|
const noteReadStillVisible = args.fullFeatureMode ? hasVisibleNoteReadCall(args.messages) : false;
|
|
6036
6076
|
let noteNudgeAppendedThisPass = false;
|
|
6037
6077
|
const noteNudgeUserMessageId = findNoteNudgeUserMessageId(args.messages);
|
|
6078
|
+
const lastServedForNote = canEditWholePrefix && (m0RematerializedThisPass || historyWasConsumedThisPass) ? args.readLastServedMessages?.() : null;
|
|
6079
|
+
const rewrittenHeadCoversNote = !!lastServedForNote && args.messages.slice(0, prependedMessageCount).some((message, index) => isSyntheticHeadMessage2(message) && index < lastServedForNote.length && servedMessageKey(message, args.resolvedProviderID) !== servedMessageKey(lastServedForNote[index], args.resolvedProviderID));
|
|
6038
6080
|
const noteNudgeEligibility = args.fullFeatureMode ? observeNoteNudgeServe({
|
|
6039
6081
|
db: args.db,
|
|
6040
6082
|
sessionId: args.sessionId,
|
|
6041
6083
|
userMessageIds: args.messages.filter((m) => m.info.role === "user" && typeof m.info.id === "string").map((m) => m.info.id),
|
|
6042
6084
|
anchorMessageId: noteNudgeUserMessageId,
|
|
6043
6085
|
isLiveTail: args.messages.at(-1)?.info.id === noteNudgeUserMessageId,
|
|
6044
|
-
|
|
6086
|
+
prefixRewriteCoversAnchor: canEditWholePrefix && rewrittenHeadCoversNote
|
|
6045
6087
|
}) : undefined;
|
|
6046
6088
|
const deferredNoteText = args.fullFeatureMode ? peekNoteNudgeText(args.db, args.sessionId, noteNudgeUserMessageId, args.projectPath, noteReadStillVisible, noteNudgeEligibility) : null;
|
|
6047
6089
|
if (deferredNoteText) {
|
|
@@ -6058,6 +6100,16 @@ async function runPostTransformPhase2(args) {
|
|
|
6058
6100
|
sessionLog2(args.sessionId, `note-nudge delivery skipped wire append: ${outcome.kind}`);
|
|
6059
6101
|
}
|
|
6060
6102
|
}
|
|
6103
|
+
if (args.fullFeatureMode && !compactionOff && replaySnapshot) {
|
|
6104
|
+
for (const anchor of replaySnapshot.noteNudgeAnchors) {
|
|
6105
|
+
appendReminderToUserMessageById(args.messages, anchor.messageId, anchor.text);
|
|
6106
|
+
}
|
|
6107
|
+
for (const decision of replaySnapshot.autoSearchHintDecisions) {
|
|
6108
|
+
if (decision.decision === "hint") {
|
|
6109
|
+
appendReminderToUserMessageById(args.messages, decision.messageId, decision.text);
|
|
6110
|
+
}
|
|
6111
|
+
}
|
|
6112
|
+
}
|
|
6061
6113
|
let todoAnchorMovedThisPass = false;
|
|
6062
6114
|
if (args.fullFeatureMode && !compactionOff) {
|
|
6063
6115
|
const todoAnchorBefore = replaySnapshot ? replaySnapshot.todoSyntheticAnchor : getPersistedTodoSyntheticAnchor(args.db, args.sessionId);
|
|
@@ -6541,4 +6593,4 @@ function checkM0MutationDriftAndSignal2(args) {
|
|
|
6541
6593
|
return false;
|
|
6542
6594
|
}
|
|
6543
6595
|
|
|
6544
|
-
export { createTagger, cavemanWordRulesForLanguage, searchMessageHistoryOffThread, findSessionId, findLastUserMessageId, clearAutoSearchForSession, setCtxReduceRegisteredGlobally, resolveCtxReduceAvailabilityFromMessages, resolveCtxReduceAvailability, primeCtxReduceSpawnPermission, ctxReduceSpawnPermissionReadNeeded, spawnAgentFromMessages, spawnAgentFromOpenCodeDb, todowritePermissionDenied, cachedToolPermissionDenied, clearToolPermissionDenied, resolveTodowriteAvailabilityFromMessages, resolveTodowriteAvailability, canConsumeDeferredOnThisPass, hasReclaimRide, reclaimRideLabel, captureOpencodeReasoningBudgetStatus, reasoningBudgetStatusLine, ENGINE_RECONNECTING_USER_MESSAGE, ENGINE_BUSY_USER_MESSAGE, SIGNED_THINKING_RESET_FENCE_FAILED, contextRefusalError, protectedToolRefusal, outgoingContextRefusal, signedTurnContextRefusal, EmergencyFailClosedError, latestAssistantTurnStart, latestAssistantTurnMessages, hasActiveAnthropicThinkingTurn, replayCavemanCompression, DegradedPassRefusalError, degradedPassError, applyFlushedStatuses, prewarmTagOwners, waitForTagOwners, stripStructuralNoise, logTransformTiming, hasRecentAssistantCommit, tagMessages, resetDegradedCacheCount2, isSyntheticHeadMessage2, applyTodoSynthesis2, freezeReasoningOnBustingPass2, firstServedDivergenceIndex2, rustModeServedKeyAfterPersistedStrips2, replayRustModeBindingMismatchStrips2, RUST_MARKER_LOCK_SKIP_LOG2, applyRustModeDeferredCompactionMarker2, clearRustModeBoundaryRecord2, runRustModePostprocess2, reconcileMarkerRepresentation2, clearPendingCompactionMarkerAfterSuccessfulDrain2, defaultCompactionMarkerStrategy2, abortSessionFailClosed2, evaluateEmergencyFailClosed2, finalizeMessageRepresentation2, runPostTransformPhase2, checkM0MutationDriftAndSignal2 };
|
|
6596
|
+
export { makeToolCompositeKey, createTagger, cavemanWordRulesForLanguage, searchMessageHistoryOffThread, findSessionId, findLastUserMessageId, clearAutoSearchForSession, setCtxReduceRegisteredGlobally, resolveCtxReduceAvailabilityFromMessages, resolveCtxReduceAvailability, primeCtxReduceSpawnPermission, ctxReduceSpawnPermissionReadNeeded, spawnAgentFromMessages, spawnAgentFromOpenCodeDb, todowritePermissionDenied, cachedToolPermissionDenied, clearToolPermissionDenied, resolveTodowriteAvailabilityFromMessages, resolveTodowriteAvailability, canConsumeDeferredOnThisPass, hasReclaimRide, reclaimRideLabel, captureOpencodeReasoningBudgetStatus, reasoningBudgetStatusLine, ENGINE_RECONNECTING_USER_MESSAGE, ENGINE_BUSY_USER_MESSAGE, SIGNED_THINKING_RESET_FENCE_FAILED, contextRefusalError, protectedToolRefusal, outgoingContextRefusal, signedTurnContextRefusal, EmergencyFailClosedError, latestAssistantTurnStart, latestAssistantTurnMessages, hasActiveAnthropicThinkingTurn, replayCavemanCompression, DegradedPassRefusalError, degradedPassError, applyFlushedStatuses, prewarmTagOwners, waitForTagOwners, stripStructuralNoise, logTransformTiming, hasRecentAssistantCommit, tagMessages, resetDegradedCacheCount2, isSyntheticHeadMessage2, applyTodoSynthesis2, freezeReasoningOnBustingPass2, firstServedDivergenceIndex2, rustModeServedKeyAfterPersistedStrips2, replayRustModeBindingMismatchStrips2, RUST_MARKER_LOCK_SKIP_LOG2, applyRustModeDeferredCompactionMarker2, clearRustModeBoundaryRecord2, runRustModePostprocess2, reconcileMarkerRepresentation2, clearPendingCompactionMarkerAfterSuccessfulDrain2, defaultCompactionMarkerStrategy2, abortSessionFailClosed2, evaluateEmergencyFailClosed2, finalizeMessageRepresentation2, runPostTransformPhase2, checkM0MutationDriftAndSignal2 };
|