@cortexkit/opencode-magic-context 0.49.19 → 0.49.21
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 +48 -9
- package/dist/chunk-embedding-write-worker.js +30 -23
- package/dist/{compaction-marker-candidates-n4krhat4.js → compaction-marker-candidates-31h86ph0.js} +3 -3
- package/dist/compaction-marker-candidates-worker.js +2 -2
- package/dist/compartment-chunk-embedding-he60aaa2.js +65 -0
- package/dist/config/project-security.d.ts.map +1 -1
- package/dist/config/schema/magic-context.d.ts +43 -9
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/{conflict-warning-hook-4pmz879v.js → conflict-warning-hook-2r32hyx6.js} +9 -8
- package/dist/{context-j31m2dv7.js → context-j7hp43a0.js} +576 -185
- package/dist/{derive-budgets-zn7yzd2d.js → derive-budgets-pqybnx09.js} +2 -2
- package/dist/embedding-backfill-dtke6tck.js +25 -0
- package/dist/embedding-worker-process.js +2 -2
- package/dist/embedding-worker.js +6 -6
- package/dist/features/magic-context/chunk-embedding-writer.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts +44 -1
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/docs-proposals.d.ts +1 -0
- package/dist/features/magic-context/dreamer/docs-proposals.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/hidden-single-shot.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-config.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts +2 -0
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-identity.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-local.d.ts +1 -0
- package/dist/features/magic-context/memory/embedding-local.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-synapse.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-worker-client.d.ts +7 -1
- package/dist/features/magic-context/memory/embedding-worker-client.d.ts.map +1 -1
- package/dist/features/magic-context/memory/local-embedding-pooling.d.ts +22 -0
- package/dist/features/magic-context/memory/local-embedding-pooling.d.ts.map +1 -0
- package/dist/features/magic-context/message-index-async.d.ts +7 -2
- package/dist/features/magic-context/message-index-async.d.ts.map +1 -1
- package/dist/features/magic-context/message-index.d.ts +2 -0
- package/dist/features/magic-context/message-index.d.ts.map +1 -1
- package/dist/features/magic-context/mural/compress-cues.d.ts.map +1 -1
- package/dist/features/magic-context/project-embedding-registry.d.ts +2 -0
- package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
- package/dist/features/magic-context/search-rerank.d.ts +9 -2
- package/dist/features/magic-context/search-rerank.d.ts.map +1 -1
- package/dist/features/magic-context/search.d.ts +29 -0
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/features/magic-context/smart-notes/compiler.d.ts.map +1 -1
- package/dist/features/magic-context/storage-db.d.ts +2 -0
- package/dist/features/magic-context/storage-db.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +2 -0
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/features/magic-context/subagent-token-capture.d.ts +20 -0
- package/dist/features/magic-context/subagent-token-capture.d.ts.map +1 -1
- package/dist/features/magic-context/user-memory/review-user-memories.d.ts.map +1 -1
- package/dist/{history-owner-xp3pngv7.js → history-owner-36wp3mkb.js} +2 -2
- package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-embed-session.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-hint.d.ts +7 -1
- package/dist/hooks/magic-context/auto-search-hint.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-worker-client.d.ts +33 -6
- package/dist/hooks/magic-context/auto-search-worker-client.d.ts.map +1 -1
- package/dist/hooks/magic-context/cache-busting-signals.d.ts +6 -2
- package/dist/hooks/magic-context/cache-busting-signals.d.ts.map +1 -1
- package/dist/hooks/magic-context/channel2-delivery.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-types.d.ts +5 -0
- package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-trigger.d.ts +1 -1
- package/dist/hooks/magic-context/compartment-trigger.d.ts.map +1 -1
- package/dist/hooks/magic-context/diagnostic-log-state.d.ts +4 -0
- package/dist/hooks/magic-context/diagnostic-log-state.d.ts.map +1 -0
- package/dist/hooks/magic-context/execute-reclaim.d.ts +35 -0
- package/dist/hooks/magic-context/execute-reclaim.d.ts.map +1 -0
- package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts +1 -3
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/latest-assistant-turn.d.ts +8 -0
- package/dist/hooks/magic-context/latest-assistant-turn.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-recovery-fence.d.ts +5 -0
- package/dist/hooks/magic-context/lkg-recovery-fence.d.ts.map +1 -1
- package/dist/hooks/magic-context/nudge-evaluation-log.d.ts +3 -0
- package/dist/hooks/magic-context/nudge-evaluation-log.d.ts.map +1 -0
- package/dist/hooks/magic-context/pending-drop-eligibility.d.ts.map +1 -1
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts +4 -0
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts.map +1 -1
- package/dist/hooks/magic-context/raw-ordinal-warmup.d.ts.map +1 -1
- package/dist/hooks/magic-context/served-shape-repair.d.ts +19 -0
- package/dist/hooks/magic-context/served-shape-repair.d.ts.map +1 -0
- package/dist/hooks/magic-context/strip-content.d.ts +4 -2
- package/dist/hooks/magic-context/strip-content.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-date-refresh.d.ts +5 -5
- package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-prompt-sticky-date.d.ts +10 -0
- package/dist/hooks/magic-context/system-prompt-sticky-date.d.ts.map +1 -0
- package/dist/hooks/magic-context/tag-content-primitives.d.ts +1 -1
- package/dist/hooks/magic-context/tag-content-primitives.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-messages.d.ts +4 -1
- package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
- package/dist/hooks/magic-context/text-complete.d.ts +1 -1
- package/dist/hooks/magic-context/text-complete.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +21 -6
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +2 -2
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-3esx8tkf.js → index-11gzxvf4.js} +394 -125
- package/dist/{index-jn12fvvh.js → index-1gtfne2c.js} +3 -3
- package/dist/{index-jhghdnsm.js → index-1kbznkft.js} +521 -214
- package/dist/{index-3h4dp9wb.js → index-3svaejkh.js} +5 -5
- package/dist/{index-kee4kn5j.js → index-4pnsgvfk.js} +1 -1
- package/dist/{index-bjcnntmz.js → index-51rdvtkz.js} +501 -20
- package/dist/{v2/server-8cd2j99z.js → index-5kym00ag.js} +32 -13
- package/dist/{index-s74zqahq.js → index-66eby7hx.js} +4 -4
- package/dist/{index-63k48rv9.js → index-9q1g3c5q.js} +5 -5
- package/dist/{index-jrr131e0.js → index-a9zvn5fe.js} +29 -15
- package/dist/{index-c5pytzne.js → index-b88dwwrh.js} +1 -1
- package/dist/{index-nj7yykkx.js → index-c7phnbvk.js} +1 -1
- package/dist/index-cpjk5jd2.js +82 -0
- package/dist/{index-c1p88z1y.js → index-ffzhwfzy.js} +4 -4
- package/dist/{v2/server-beht37jy.js → index-gzy5w8ya.js} +194 -5
- package/dist/{index-j75v2476.js → index-h7tgn49j.js} +12 -15
- package/dist/{index-edmpdxcw.js → index-j32jj2t8.js} +5 -5
- package/dist/{index-ke416mdc.js → index-j76ah6d7.js} +2 -2
- package/dist/{index-s734jcsr.js → index-jfem3dgz.js} +9 -3
- package/dist/{index-n37sebck.js → index-jjvbk92s.js} +1 -1
- package/dist/{index-4911rn0b.js → index-jmq8kfe7.js} +6 -6
- package/dist/{index-rr2bb45z.js → index-kfyb3k6n.js} +2 -2
- package/dist/{index-2vxtcb95.js → index-kq5w68dp.js} +2 -2
- package/dist/{index-kq82mtg0.js → index-ksq50rg0.js} +3 -3
- package/dist/{index-b5vqckbw.js → index-m32esgmj.js} +314 -127
- package/dist/{index-9zcsy3hh.js → index-mnhcdfxg.js} +161 -13
- package/dist/{index-se4m2g6w.js → index-mnnkgq0q.js} +111 -19
- package/dist/{index-p5y3k4g7.js → index-nda0zgna.js} +2 -1
- package/dist/{index-wgypt3cs.js → index-nxrsns5x.js} +2466 -1290
- package/dist/{index-4s3t0nd0.js → index-qgh1qwjj.js} +2 -2
- package/dist/{index-y9f76s3f.js → index-rrv26qjz.js} +1 -1
- package/dist/{index-24fezq97.js → index-rxqr723x.js} +5 -5
- package/dist/{index-v10f1rjv.js → index-spwjbkc7.js} +1 -1
- package/dist/{index-dxmq29t1.js → index-syaazvy2.js} +182 -47
- package/dist/{index-k29z4aqh.js → index-t5pck3ss.js} +1 -1
- package/dist/{index-6x57ar45.js → index-wfybj1dw.js} +4 -6
- package/dist/{index-cf74k5ak.js → index-whcgcfrv.js} +9 -6
- package/dist/{index-a6mc0v4d.js → index-x6cbrv9h.js} +3 -3
- package/dist/{index-bp5083x2.js → index-x9k3mqrf.js} +1 -1
- package/dist/{index-rpxdjkm0.js → index-y76rhsnr.js} +319 -61
- package/dist/{index-ze7mvk54.js → index-zy67whjr.js} +95 -59
- package/dist/index.js +58 -54
- package/dist/{logger-jm3sqqzr.js → logger-94kew5wm.js} +1 -1
- package/dist/{message-fts-rowid-map-17s0dfn4.js → message-fts-rowid-map-e79b7b6x.js} +6 -5
- package/dist/{message-index-gtpqnj8w.js → message-index-4q8ek2fc.js} +17 -16
- package/dist/{message-index-bounded-zyc8h32y.js → message-index-bounded-rydsg9r5.js} +17 -16
- package/dist/{message-time-backfill-73mmm76q.js → message-time-backfill-4qva0b4f.js} +3 -3
- package/dist/migration-worker.js +13 -12
- package/dist/{model-resolution-nx97z3x7.js → model-resolution-280gmqvd.js} +1 -1
- package/dist/plugin/embedding-bootstrap.d.ts +4 -1
- package/dist/plugin/embedding-bootstrap.d.ts.map +1 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts +1 -0
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/plugin/rpc-handlers.d.ts +8 -0
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/plugin/subagent-tool-policy.d.ts +9 -0
- package/dist/plugin/subagent-tool-policy.d.ts.map +1 -1
- package/dist/plugin/tool-registry.d.ts.map +1 -1
- package/dist/{project-embedding-registry-z74mhqkf.js → project-embedding-registry-hn529988.js} +16 -13
- package/dist/raw-ordinal-warmup-worker.js +136 -101
- package/dist/{read-session-chunk-jjb48bt9.js → read-session-chunk-t039f0m5.js} +12 -11
- package/dist/{read-session-raw-rsc8c7qy.js → read-session-raw-aw6jgvwg.js} +4 -3
- package/dist/recomp-orchestrator-hbm53jj5.js +62 -0
- package/dist/{safe-notification-target-1szv1k5k.js → safe-notification-target-mkr9yzvr.js} +2 -2
- package/dist/search-archive-weh164mh.js +26 -0
- package/dist/search-hea079d7.js +50 -0
- package/dist/{send-session-notification-6ve0e8p4.js → send-session-notification-gqzkz7da.js} +7 -6
- package/dist/shared/logger.d.ts.map +1 -1
- package/dist/shared/model-resolution.d.ts +2 -0
- package/dist/shared/model-resolution.d.ts.map +1 -1
- package/dist/shared/prompt-async-transport.d.ts +3 -0
- package/dist/shared/prompt-async-transport.d.ts.map +1 -1
- package/dist/shared/rpc-types.d.ts +7 -0
- package/dist/shared/rpc-types.d.ts.map +1 -1
- package/dist/shared/sqlite.d.ts +6 -1
- package/dist/shared/sqlite.d.ts.map +1 -1
- package/dist/shared/subagent-runner.d.ts +2 -0
- package/dist/shared/subagent-runner.d.ts.map +1 -1
- package/dist/shared/tag-transcript.d.ts +2 -0
- package/dist/shared/tag-transcript.d.ts.map +1 -1
- package/dist/shared/worker-shutdown.d.ts +68 -0
- package/dist/shared/worker-shutdown.d.ts.map +1 -0
- package/dist/shared/worker-shutdown.fixture.d.ts +2 -0
- package/dist/shared/worker-shutdown.fixture.d.ts.map +1 -0
- package/dist/{sqlite-zf72c52d.js → sqlite-zdgm52sv.js} +5 -1
- package/dist/{storage-memory-y3qmy00r.js → storage-memory-e6a7mb0k.js} +2 -2
- package/dist/{storage-tags-r7k9tjcv.js → storage-tags-a77q4v77.js} +5 -5
- package/dist/{task-config-x3qmayd2.js → task-config-t6bpyka7.js} +2 -2
- package/dist/tools/ctx-search/tools.d.ts.map +1 -1
- package/dist/tools/ctx-search/types.d.ts +1 -0
- package/dist/tools/ctx-search/types.d.ts.map +1 -1
- package/dist/{transform-postprocess-phase-jj99r7z2.js → transform-postprocess-phase-0b04tm1p.js} +35 -32
- package/dist/v2/auto-search-worker.js +48 -9
- package/dist/v2/chunk-embedding-write-worker.js +30 -23
- package/dist/v2/{compaction-marker-candidates-ebx3388k.js → compaction-marker-candidates-m4vmye3w.js} +3 -3
- package/dist/v2/compaction-marker-candidates-worker.js +2 -2
- package/dist/v2/compartment-chunk-embedding-8jjmcgeg.js +64 -0
- package/dist/v2/{context-y5yamxak.js → context-ea3x7smm.js} +1797 -810
- package/dist/v2/{derive-budgets-2zh4gm2c.js → derive-budgets-knf763tt.js} +3 -3
- package/dist/v2/embedding-backfill-5e74ae0m.js +24 -0
- package/dist/v2/embedding-worker-process.js +2 -2
- package/dist/v2/embedding-worker.js +6 -6
- package/dist/v2/hidden-child-record.d.ts +2 -0
- package/dist/v2/hidden-child-record.d.ts.map +1 -1
- package/dist/v2/hidden-completion.d.ts +2 -0
- package/dist/v2/hidden-completion.d.ts.map +1 -1
- package/dist/v2/hidden-model-activity.d.ts +7 -0
- package/dist/v2/hidden-model-activity.d.ts.map +1 -0
- package/dist/v2/{history-owner-42e16w0n.js → history-owner-ad0crnrn.js} +2 -2
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/copied-tag-notation.d.ts +1 -1
- package/dist/v2/hooks/copied-tag-notation.d.ts.map +1 -1
- package/dist/v2/hooks/dream-timer.d.ts +2 -0
- package/dist/v2/hooks/dream-timer.d.ts.map +1 -1
- package/dist/v2/hooks/embedding-lifecycle.d.ts +7 -0
- package/dist/v2/hooks/embedding-lifecycle.d.ts.map +1 -0
- package/dist/v2/hooks/generate.d.ts +36 -1
- package/dist/v2/hooks/generate.d.ts.map +1 -1
- package/dist/v2/hooks/lkg-system.d.ts +35 -4
- package/dist/v2/hooks/lkg-system.d.ts.map +1 -1
- package/dist/v2/hooks/payload.d.ts +16 -1
- package/dist/v2/hooks/payload.d.ts.map +1 -1
- package/dist/v2/hooks/store.d.ts +2 -0
- package/dist/v2/hooks/store.d.ts.map +1 -1
- package/dist/v2/hooks/tools.d.ts +2 -1
- package/dist/v2/hooks/tools.d.ts.map +1 -1
- package/dist/v2/hooks/transform-features.d.ts +2 -2
- package/dist/v2/hooks/transform-features.d.ts.map +1 -1
- package/dist/v2/{logger-7qt02bnb.js → logger-p34mjtja.js} +1 -1
- package/dist/v2/{message-fts-rowid-map-wfx67gfd.js → message-fts-rowid-map-n8fdg2ja.js} +6 -5
- package/dist/v2/{message-index-bounded-spd8r7pj.js → message-index-bounded-8rcd7qq9.js} +17 -16
- package/dist/v2/{message-index-8vz2pq76.js → message-index-qz9wdp82.js} +17 -16
- package/dist/v2/{message-time-backfill-04t0km1z.js → message-time-backfill-zvthw6xb.js} +3 -3
- package/dist/v2/migration-worker.js +13 -12
- package/dist/v2/{model-resolution-nx97z3x7.js → model-resolution-280gmqvd.js} +1 -1
- package/dist/v2/{project-embedding-registry-gnkj56xp.js → project-embedding-registry-v38q4xd5.js} +16 -13
- package/dist/v2/raw-ordinal-warmup-worker.js +136 -101
- package/dist/v2/{read-session-chunk-cwkxrmns.js → read-session-chunk-wazfyxcg.js} +12 -11
- package/dist/v2/{read-session-raw-yaegtjzh.js → read-session-raw-b70cpwzj.js} +4 -3
- package/dist/v2/recomp-orchestrator-b12zaptj.js +61 -0
- package/dist/v2/{safe-notification-target-qg7n2s77.js → safe-notification-target-khnzg57c.js} +2 -2
- package/dist/v2/search-archive-x64rtz1z.js +25 -0
- package/dist/v2/search-hza9x72a.js +49 -0
- package/dist/v2/{send-session-notification-3pxn658x.js → send-session-notification-8eqe259v.js} +7 -6
- package/dist/v2/{server-45q69hkq.js → server-132h8twc.js} +5 -5
- package/dist/v2/{server-h0410h0v.js → server-1bw1wcbp.js} +1 -1
- package/dist/v2/{server-271qxsf5.js → server-24g8r2d0.js} +2466 -1290
- package/dist/v2/{server-tbe1femw.js → server-29qp8nz4.js} +1 -1
- package/dist/v2/{server-gsxjv2q2.js → server-33nqbqkw.js} +182 -47
- package/dist/v2/{server-tgnbmwah.js → server-3mz2qh5a.js} +1 -1
- package/dist/v2/{server-n1prf1g6.js → server-3vhxy2k5.js} +2 -2
- package/dist/v2/{server-xj136kt8.js → server-4kjmrjn4.js} +9 -3
- package/dist/v2/{server-34kwfsr4.js → server-53eh1r8r.js} +2 -2
- package/dist/{index-8cd2j99z.js → v2/server-5kym00ag.js} +32 -13
- package/dist/v2/{server-46neh5fa.js → server-62g58aaz.js} +314 -127
- package/dist/v2/{server-f2xf5gcb.js → server-6495nmn9.js} +12 -15
- package/dist/v2/{server-a9xqj88f.js → server-6v3cdzsx.js} +4 -4
- package/dist/v2/{server-d04vrx0j.js → server-806rzhs6.js} +2 -2
- package/dist/v2/{server-qd11g795.js → server-92g7d776.js} +2 -1
- package/dist/v2/{server-nj659894.js → server-94wk1ey3.js} +14 -3
- package/dist/v2/{server-6tmj0s7j.js → server-ab1g0wn9.js} +4 -6
- package/dist/v2/{server-8by8qfec.js → server-ad18djzs.js} +95 -59
- package/dist/v2/{server-hy3d3vsx.js → server-bsgd4dk1.js} +2 -2
- package/dist/v2/server-cpjk5jd2.js +82 -0
- package/dist/v2/{server-g3qma5c0.js → server-d1dzgvwd.js} +2 -2
- package/dist/v2/{server-hm38q7r0.js → server-d48x3m4x.js} +5 -5
- package/dist/v2/{server-1wy7b9de.js → server-dtp8hcjh.js} +3 -3
- package/dist/v2/{server-27gq4mfz.js → server-fa7vtp40.js} +9 -6
- package/dist/v2/{server-6pmqg9m4.js → server-gyy4k6mf.js} +1 -1
- package/dist/{index-beht37jy.js → v2/server-gzy5w8ya.js} +194 -5
- package/dist/v2/{server-bmymkx73.js → server-j8h7bsca.js} +29 -15
- package/dist/v2/{server-n37sebck.js → server-jjvbk92s.js} +1 -1
- package/dist/v2/{server-da07v4xp.js → server-k3t06fxr.js} +1 -1
- package/dist/v2/{server-9hx7g5jp.js → server-m4bfaevz.js} +1197 -1049
- package/dist/v2/{server-2ar62dyx.js → server-ppcd1qxh.js} +191 -99
- package/dist/v2/{server-rmygf5pn.js → server-qjvk4a9t.js} +2 -2
- package/dist/v2/{server-zzkj2fch.js → server-qteg2kt9.js} +5 -5
- package/dist/v2/{server-pwv4ezb0.js → server-rqebawx1.js} +2 -2
- package/dist/v2/{server-h1v0pyxb.js → server-vr4szghm.js} +501 -20
- package/dist/v2/{server-xq7dfjke.js → server-wwaw5npa.js} +5 -5
- package/dist/v2/{server-6vdzn1td.js → server-zg5y109h.js} +323 -76
- package/dist/v2/server.js +8 -8
- package/dist/v2/{sqlite-zf72c52d.js → sqlite-zdgm52sv.js} +5 -1
- package/dist/v2/{storage-memory-y3qmy00r.js → storage-memory-e6a7mb0k.js} +2 -2
- package/dist/v2/{storage-tags-3wdb8zph.js → storage-tags-q71rnr9f.js} +5 -5
- package/dist/v2/store-reader.d.ts +10 -0
- package/dist/v2/store-reader.d.ts.map +1 -1
- package/dist/v2/{task-config-nvz8mapa.js → task-config-7md27rx8.js} +2 -2
- package/dist/v2/{wrapup-orchestrator-embdz8gj.js → wrapup-orchestrator-3ssd5yy1.js} +33 -32
- package/dist/wrapup-orchestrator-5vpcd1zx.js +49 -0
- package/package.json +2 -2
- package/src/config/index.test.ts +72 -6
- package/src/config/project-security.ts +15 -0
- package/src/config/rerank.test.ts +60 -0
- package/src/config/schema/magic-context.ts +57 -0
- package/src/shared/logger.test.ts +42 -1
- package/src/shared/logger.ts +11 -13
- package/src/shared/model-resolution.test.ts +67 -12
- package/src/shared/model-resolution.ts +43 -16
- package/src/shared/model-suggestion-retry.ts +2 -2
- package/src/shared/prompt-async-transport.ts +47 -3
- package/src/shared/rpc-types.ts +7 -0
- package/src/shared/sqlite-busy-budget-review.test.ts +6 -1
- package/src/shared/sqlite-turn-deadline.test.ts +270 -0
- package/src/shared/sqlite.ts +239 -9
- package/src/shared/subagent-runner.ts +2 -0
- package/src/shared/tag-transcript.ts +9 -1
- package/src/shared/worker-shutdown-fence.test.ts +87 -0
- package/src/shared/worker-shutdown.fixture.ts +25 -0
- package/src/shared/worker-shutdown.test.ts +127 -0
- package/src/shared/worker-shutdown.ts +160 -0
- package/dist/embedding-backfill-fmz50tsy.js +0 -24
- package/dist/recomp-orchestrator-999jj4bc.js +0 -61
- package/dist/search-archive-6vm0e2f5.js +0 -25
- package/dist/search-xsqk1bj4.js +0 -49
- package/dist/v2/embedding-backfill-7c7yr69y.js +0 -23
- package/dist/v2/recomp-orchestrator-f6m9jr7p.js +0 -60
- package/dist/v2/search-archive-wve3tq1k.js +0 -24
- package/dist/v2/search-hwg7jfbj.js +0 -48
- package/dist/wrapup-orchestrator-whhbjmaz.js +0 -48
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
sanitizeDiagnosticText,
|
|
10
10
|
log2,
|
|
11
11
|
sessionLog2
|
|
12
|
-
} from "./server-
|
|
12
|
+
} from "./server-6495nmn9.js";
|
|
13
13
|
import {
|
|
14
14
|
parseTree,
|
|
15
15
|
parseJsoncRecovering,
|
|
@@ -18,20 +18,20 @@ import {
|
|
|
18
18
|
cortexKitProjectConfigBasePath,
|
|
19
19
|
resolveLegacyConfigSourcesForHarness,
|
|
20
20
|
loadPluginConfigDetailed
|
|
21
|
-
} from "./server-
|
|
21
|
+
} from "./server-94wk1ey3.js";
|
|
22
22
|
import {
|
|
23
23
|
catalogOutputReserve,
|
|
24
24
|
getSdkContextLimit,
|
|
25
25
|
modelSupportsVision,
|
|
26
26
|
getSdkOutputLimit
|
|
27
|
-
} from "./server-
|
|
27
|
+
} from "./server-29qp8nz4.js";
|
|
28
28
|
import {
|
|
29
29
|
withContentLanguageDirective,
|
|
30
30
|
buildPrimaryLanguageDirective,
|
|
31
31
|
resolvePromptSurface,
|
|
32
32
|
DEFAULT_HISTORIAN_TIMEOUT_MS,
|
|
33
33
|
LIVE_RELOAD_CONFIG_PATHS
|
|
34
|
-
} from "./server-
|
|
34
|
+
} from "./server-24g8r2d0.js";
|
|
35
35
|
import {
|
|
36
36
|
invalidateAutoEmbedSession,
|
|
37
37
|
drainBackgroundBatches,
|
|
@@ -40,12 +40,12 @@ import {
|
|
|
40
40
|
getProjectChunkEmbeddingModelId2,
|
|
41
41
|
getProjectEmbeddingMaxInputTokens2,
|
|
42
42
|
embedItemsForProject2
|
|
43
|
-
} from "./server-
|
|
43
|
+
} from "./server-ad18djzs.js";
|
|
44
44
|
import {
|
|
45
45
|
hasMeaningfulUserText2,
|
|
46
46
|
estimateTokens,
|
|
47
47
|
estimateFixedPromptTokens
|
|
48
|
-
} from "./server-
|
|
48
|
+
} from "./server-3mz2qh5a.js";
|
|
49
49
|
import {
|
|
50
50
|
inRootAsyncContext2,
|
|
51
51
|
Database2,
|
|
@@ -53,30 +53,28 @@ import {
|
|
|
53
53
|
withSqliteBackgroundWriter2,
|
|
54
54
|
withoutSqliteTransformPass2,
|
|
55
55
|
beginSqliteWriterAsync2
|
|
56
|
-
} from "./server-
|
|
56
|
+
} from "./server-gzy5w8ya.js";
|
|
57
57
|
import {
|
|
58
58
|
isStrictGapHealingMessage2,
|
|
59
59
|
noteRawSessionSummaryRowWritten2,
|
|
60
60
|
RawOrdinalsNotReady2,
|
|
61
61
|
runSessionWarmupWorker
|
|
62
|
-
} from "./server-
|
|
62
|
+
} from "./server-4kjmrjn4.js";
|
|
63
63
|
import {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
} from "./server-
|
|
64
|
+
buildCanonicalChunkTextFromFts2,
|
|
65
|
+
buildCompartmentSummaryFallbackText2,
|
|
66
|
+
canonicalizeInMemoryChunkTextForEmbedding2,
|
|
67
|
+
chunkCanonicalText2,
|
|
68
|
+
chunkEmbeddingWindowsAreCurrent2,
|
|
69
|
+
replaceCompartmentChunkEmbeddings2,
|
|
70
|
+
deleteChunkEmbedBackoffForSession2,
|
|
71
|
+
chunkWindowSourceKey2
|
|
72
|
+
} from "./server-62g58aaz.js";
|
|
73
73
|
import {
|
|
74
74
|
isPidAlive
|
|
75
|
-
} from "./server-
|
|
75
|
+
} from "./server-k3t06fxr.js";
|
|
76
76
|
import {
|
|
77
77
|
BoundedSessionMap,
|
|
78
|
-
clearCompressionDepth,
|
|
79
|
-
clearCompressionDepthRange,
|
|
80
78
|
clearLkgFenceProcessState,
|
|
81
79
|
lkgFenceRequiresRebuild,
|
|
82
80
|
lkgRecoveryFenceUnclean,
|
|
@@ -85,23 +83,14 @@ import {
|
|
|
85
83
|
clearLkgRecoveryFence,
|
|
86
84
|
gaDatabasePath,
|
|
87
85
|
V2StoreReader,
|
|
86
|
+
clearCompressionDepth,
|
|
87
|
+
clearCompressionDepthRange,
|
|
88
88
|
deleteSessionScopedRows,
|
|
89
89
|
toMessageIndexSource2,
|
|
90
90
|
clearIndexedMessagesInTransaction2,
|
|
91
91
|
indexSourcesAfterOrdinal2
|
|
92
|
-
} from "./server-
|
|
92
|
+
} from "./server-ppcd1qxh.js";
|
|
93
93
|
import {
|
|
94
|
-
detectOverflow,
|
|
95
|
-
SESSION_META_SELECT_COLUMNS,
|
|
96
|
-
META_COLUMNS,
|
|
97
|
-
BOOLEAN_META_KEYS,
|
|
98
|
-
NULL_BIND_META_KEYS,
|
|
99
|
-
isSessionMetaRow,
|
|
100
|
-
getDefaultSessionMeta,
|
|
101
|
-
ensureSessionMetaRow,
|
|
102
|
-
toSessionMeta,
|
|
103
|
-
persistCachedM0,
|
|
104
|
-
clearCachedM0M1,
|
|
105
94
|
retreatPastHostUnservedRows,
|
|
106
95
|
snapTerminalCompartmentToServedRow,
|
|
107
96
|
isHostRenderedSystemMessage,
|
|
@@ -127,6 +116,16 @@ import {
|
|
|
127
116
|
decodeMergedReasoningParts,
|
|
128
117
|
escalationBands,
|
|
129
118
|
sessionDecisionCalibration,
|
|
119
|
+
SESSION_META_SELECT_COLUMNS,
|
|
120
|
+
META_COLUMNS,
|
|
121
|
+
BOOLEAN_META_KEYS,
|
|
122
|
+
NULL_BIND_META_KEYS,
|
|
123
|
+
isSessionMetaRow,
|
|
124
|
+
getDefaultSessionMeta,
|
|
125
|
+
ensureSessionMetaRow,
|
|
126
|
+
toSessionMeta,
|
|
127
|
+
persistCachedM0,
|
|
128
|
+
clearCachedM0M1,
|
|
130
129
|
isRustMarkerAdmissionFenced,
|
|
131
130
|
readReplayEnvelope,
|
|
132
131
|
readReplayDocument,
|
|
@@ -171,6 +170,7 @@ import {
|
|
|
171
170
|
clearPendingCompactionMarkerStateIf,
|
|
172
171
|
getPendingPiCompactionMarkerState,
|
|
173
172
|
logPiCompactionMarkerClear,
|
|
173
|
+
detectOverflow,
|
|
174
174
|
resolveHostServedBoundaryId2,
|
|
175
175
|
hasRawMessageProvider2,
|
|
176
176
|
withRawSessionMessageCache2,
|
|
@@ -187,17 +187,17 @@ import {
|
|
|
187
187
|
getRawSessionTagKeysThrough2,
|
|
188
188
|
getLegacyProtectedTailStartOrdinal2,
|
|
189
189
|
readSessionChunk2
|
|
190
|
-
} from "./server-
|
|
190
|
+
} from "./server-m4bfaevz.js";
|
|
191
191
|
import {
|
|
192
192
|
getTableColumnNames
|
|
193
|
-
} from "./server-
|
|
193
|
+
} from "./server-rqebawx1.js";
|
|
194
194
|
import {
|
|
195
195
|
FAIL_CLOSED_DOCTOR_COMMAND,
|
|
196
196
|
getSchemaFenceRejection,
|
|
197
197
|
LATEST_SUPPORTED_VERSION,
|
|
198
198
|
getPersistedSchemaVersion,
|
|
199
199
|
openDatabase
|
|
200
|
-
} from "./server-
|
|
200
|
+
} from "./server-j8h7bsca.js";
|
|
201
201
|
import {
|
|
202
202
|
providerMass,
|
|
203
203
|
calibrationForModelKey,
|
|
@@ -215,7 +215,7 @@ import {
|
|
|
215
215
|
foldShrunkPartTags2,
|
|
216
216
|
getTagNumberByMessageId2,
|
|
217
217
|
getActiveTagsBySession2
|
|
218
|
-
} from "./server-
|
|
218
|
+
} from "./server-fa7vtp40.js";
|
|
219
219
|
import {
|
|
220
220
|
resolveOpenCodeDbPath,
|
|
221
221
|
assertOpenCodeStoreGeneration,
|
|
@@ -226,10 +226,10 @@ import {
|
|
|
226
226
|
openCodeDbExists,
|
|
227
227
|
withReadOnlySessionDb,
|
|
228
228
|
getMessageTimesFromOpenCodeDb
|
|
229
|
-
} from "./server-
|
|
229
|
+
} from "./server-3vhxy2k5.js";
|
|
230
230
|
import {
|
|
231
231
|
getMeasuredToolDefinitionTokens
|
|
232
|
-
} from "./server-
|
|
232
|
+
} from "./server-d1dzgvwd.js";
|
|
233
233
|
import {
|
|
234
234
|
V2_MEMORY_CATEGORIES,
|
|
235
235
|
CATEGORY_PRIORITY,
|
|
@@ -245,11 +245,11 @@ import {
|
|
|
245
245
|
resolveStoredPathWorkspaceIdentity,
|
|
246
246
|
sourceNameForMemory,
|
|
247
247
|
computeWorkspaceEpochFingerprint
|
|
248
|
-
} from "./server-
|
|
248
|
+
} from "./server-wwaw5npa.js";
|
|
249
249
|
import {
|
|
250
250
|
shouldSkipHomeProjectMemory,
|
|
251
251
|
resolveProjectIdentity
|
|
252
|
-
} from "./server-
|
|
252
|
+
} from "./server-qjvk4a9t.js";
|
|
253
253
|
import {
|
|
254
254
|
getSessionNotes,
|
|
255
255
|
getReadySmartNotes,
|
|
@@ -258,13 +258,13 @@ import {
|
|
|
258
258
|
userFacingFailureCode,
|
|
259
259
|
promoteSessionFactsDurable,
|
|
260
260
|
embedPromotedFacts
|
|
261
|
-
} from "./server-
|
|
261
|
+
} from "./server-d48x3m4x.js";
|
|
262
262
|
import {
|
|
263
263
|
isMarkerCandidateBasisCurrent2,
|
|
264
264
|
invalidateMarkerCandidateBasis2,
|
|
265
265
|
readMarkerCandidateBasis2,
|
|
266
266
|
prepareMarkerCandidateBasis2
|
|
267
|
-
} from "./server-
|
|
267
|
+
} from "./server-806rzhs6.js";
|
|
268
268
|
import {
|
|
269
269
|
computeCueContentHash,
|
|
270
270
|
getMuralCueState,
|
|
@@ -272,7 +272,7 @@ import {
|
|
|
272
272
|
getMemoriesByProject2,
|
|
273
273
|
getMemoriesByProjects2,
|
|
274
274
|
getMaxMemoryIdForProjects2
|
|
275
|
-
} from "./server-
|
|
275
|
+
} from "./server-jjvbk92s.js";
|
|
276
276
|
import {
|
|
277
277
|
pushNotification2
|
|
278
278
|
} from "./server-x8a7jmkh.js";
|
|
@@ -280,10 +280,10 @@ import {
|
|
|
280
280
|
deriveTriggerBudget2,
|
|
281
281
|
resolveHistorianProducerLimits2,
|
|
282
282
|
producerSourceLocalBudget2
|
|
283
|
-
} from "./server-
|
|
283
|
+
} from "./server-53eh1r8r.js";
|
|
284
284
|
import {
|
|
285
285
|
sendStatusNotification2
|
|
286
|
-
} from "./server-
|
|
286
|
+
} from "./server-6v3cdzsx.js";
|
|
287
287
|
import {
|
|
288
288
|
piModelRefToCanonical
|
|
289
289
|
} from "./server-avwt563y.js";
|
|
@@ -297,7 +297,7 @@ import {
|
|
|
297
297
|
import {
|
|
298
298
|
logSlowWriteTransaction,
|
|
299
299
|
WriteTransactionSteps
|
|
300
|
-
} from "./server-
|
|
300
|
+
} from "./server-gyy4k6mf.js";
|
|
301
301
|
|
|
302
302
|
// src/config/live-snapshot.ts
|
|
303
303
|
import { createHash } from "node:crypto";
|
|
@@ -5618,19 +5618,19 @@ async function embedAndStoreCompartmentChunks(db, sessionId, projectPath, compar
|
|
|
5618
5618
|
const maxInputTokens = getProjectEmbeddingMaxInputTokens2(projectPath);
|
|
5619
5619
|
for (const compartment of compartments) {
|
|
5620
5620
|
try {
|
|
5621
|
-
const fromMemory = compartment.sourceChunkText ?
|
|
5622
|
-
const mappedText = fromMemory ? fromMemory :
|
|
5621
|
+
const fromMemory = compartment.sourceChunkText ? canonicalizeInMemoryChunkTextForEmbedding2(compartment.sourceChunkText, compartment.startMessage, compartment.endMessage) : "";
|
|
5622
|
+
const mappedText = fromMemory ? fromMemory : buildCanonicalChunkTextFromFts2(db, sessionId, compartment.startMessage, compartment.endMessage);
|
|
5623
5623
|
if (mappedText === null)
|
|
5624
5624
|
continue;
|
|
5625
|
-
const canonicalText = mappedText ||
|
|
5625
|
+
const canonicalText = mappedText || buildCompartmentSummaryFallbackText2(db, compartment.id);
|
|
5626
5626
|
if (canonicalText.length === 0)
|
|
5627
5627
|
continue;
|
|
5628
|
-
const windows =
|
|
5628
|
+
const windows = chunkCanonicalText2(canonicalText, compartment.startMessage, compartment.endMessage, maxInputTokens);
|
|
5629
5629
|
if (windows.length === 0)
|
|
5630
5630
|
continue;
|
|
5631
|
-
const windowSourceKey =
|
|
5631
|
+
const windowSourceKey = chunkWindowSourceKey2(canonicalText, compartment.startMessage, compartment.endMessage, maxInputTokens);
|
|
5632
5632
|
const currentModelId = getProjectChunkEmbeddingModelId2(projectPath);
|
|
5633
|
-
if (currentModelId !== "off" &&
|
|
5633
|
+
if (currentModelId !== "off" && chunkEmbeddingWindowsAreCurrent2(db, compartment.id, currentModelId, windows, projectPath)) {
|
|
5634
5634
|
continue;
|
|
5635
5635
|
}
|
|
5636
5636
|
const result = await embedItemsForProject2(projectPath, windows.map((window) => ({
|
|
@@ -5640,7 +5640,7 @@ async function embedAndStoreCompartmentChunks(db, sessionId, projectPath, compar
|
|
|
5640
5640
|
})), undefined, db, sessionId);
|
|
5641
5641
|
if (!result)
|
|
5642
5642
|
continue;
|
|
5643
|
-
if (
|
|
5643
|
+
if (chunkEmbeddingWindowsAreCurrent2(db, compartment.id, currentModelId, windows, projectPath)) {
|
|
5644
5644
|
continue;
|
|
5645
5645
|
}
|
|
5646
5646
|
const rows = [];
|
|
@@ -5658,7 +5658,7 @@ async function embedAndStoreCompartmentChunks(db, sessionId, projectPath, compar
|
|
|
5658
5658
|
});
|
|
5659
5659
|
}
|
|
5660
5660
|
if (rows.length === windows.length) {
|
|
5661
|
-
|
|
5661
|
+
replaceCompartmentChunkEmbeddings2(db, rows, windowSourceKey);
|
|
5662
5662
|
enqueueShadowEmbeddingItems2(projectPath, "chunk", [String(compartment.id)]);
|
|
5663
5663
|
}
|
|
5664
5664
|
} catch (error) {
|
|
@@ -6621,7 +6621,7 @@ async function promptWithTimeout(client, args, timeoutMs, signal, transport, fir
|
|
|
6621
6621
|
if (!activity.monitored || activity.received)
|
|
6622
6622
|
return;
|
|
6623
6623
|
silent = true;
|
|
6624
|
-
controller.abort();
|
|
6624
|
+
controller.abort(new ModelProducedNoOutputError(firstOutputTimeoutMs));
|
|
6625
6625
|
}, firstOutputTimeoutMs) : undefined;
|
|
6626
6626
|
const timeoutError = () => silent && firstOutputTimeoutMs !== undefined ? new ModelProducedNoOutputError(firstOutputTimeoutMs) : new Error(`prompt timed out after ${timeoutMs}ms`);
|
|
6627
6627
|
const onExternalAbort = () => controller.abort();
|
|
@@ -6961,7 +6961,7 @@ async function promptSyncWithValidatedOutputRetry(client, args, options) {
|
|
|
6961
6961
|
throwWithPromptFailure(failure.error, failedAttempts, args, timeoutMs, options.transport);
|
|
6962
6962
|
}
|
|
6963
6963
|
if (!cooledPrimary && !quota)
|
|
6964
|
-
log2(`[${callContext}] primary (${explicitPrimaryLabel}) failed validation/prompt: ${shortErr(failure.error)};
|
|
6964
|
+
log2(`[${callContext}] primary (${explicitPrimaryLabel}) failed validation/prompt: ${shortErr(failure.error)}; ${fallbacks.length} fallback(s) configured, subject to remaining budget`);
|
|
6965
6965
|
}
|
|
6966
6966
|
for (let i = 0;i < fallbacks.length; i += 1) {
|
|
6967
6967
|
const fallback = toModelEntry(fallbacks[i]);
|
|
@@ -7170,6 +7170,152 @@ function buildHiddenAgentRegistrations(args) {
|
|
|
7170
7170
|
}
|
|
7171
7171
|
|
|
7172
7172
|
// src/features/magic-context/subagent-token-capture.ts
|
|
7173
|
+
var warnedUnknownModels = new Set;
|
|
7174
|
+
var loggedModelReroutes = new Set;
|
|
7175
|
+
var MAX_SUBAGENT_INVOCATION_ERROR_CHARS = 1000;
|
|
7176
|
+
var invocationErrorDetails = new WeakMap;
|
|
7177
|
+
function annotateSubagentInvocationError(error, details) {
|
|
7178
|
+
if (error && typeof error === "object") {
|
|
7179
|
+
const previous = invocationErrorDetails.get(error) ?? {};
|
|
7180
|
+
invocationErrorDetails.set(error, {
|
|
7181
|
+
...previous,
|
|
7182
|
+
...details,
|
|
7183
|
+
hostError: details.hostError ?? previous.hostError
|
|
7184
|
+
});
|
|
7185
|
+
}
|
|
7186
|
+
return error;
|
|
7187
|
+
}
|
|
7188
|
+
function errorDetailsOf(error) {
|
|
7189
|
+
const seen = new Set;
|
|
7190
|
+
const visit = (value, depth) => {
|
|
7191
|
+
if (!value || typeof value !== "object" || depth > 4 || seen.has(value))
|
|
7192
|
+
return {};
|
|
7193
|
+
seen.add(value);
|
|
7194
|
+
const direct = invocationErrorDetails.get(value) ?? {};
|
|
7195
|
+
const record = value;
|
|
7196
|
+
const nested = visit(record.hostError, depth + 1);
|
|
7197
|
+
const cause = visit(record.cause, depth + 1);
|
|
7198
|
+
return {
|
|
7199
|
+
...cause,
|
|
7200
|
+
...nested,
|
|
7201
|
+
...direct,
|
|
7202
|
+
hostError: direct.hostError ?? nested.hostError ?? cause.hostError ?? record.hostError
|
|
7203
|
+
};
|
|
7204
|
+
};
|
|
7205
|
+
return visit(error, 0);
|
|
7206
|
+
}
|
|
7207
|
+
function modelRef(value) {
|
|
7208
|
+
const reference = typeof value === "string" ? value : value?.model;
|
|
7209
|
+
return typeof reference === "string" && reference.trim().length > 0 ? reference.trim() : undefined;
|
|
7210
|
+
}
|
|
7211
|
+
function splitModelRef(value) {
|
|
7212
|
+
if (!value)
|
|
7213
|
+
return { providerId: null, modelId: null };
|
|
7214
|
+
const slash = value.indexOf("/");
|
|
7215
|
+
return slash > 0 && slash < value.length - 1 ? { providerId: value.slice(0, slash), modelId: value.slice(slash + 1) } : { providerId: null, modelId: value };
|
|
7216
|
+
}
|
|
7217
|
+
function cleanOneLine(value) {
|
|
7218
|
+
const oneLine = sanitizeDiagnosticText(value).replaceAll("\r", " ").replaceAll(`
|
|
7219
|
+
`, " ").replaceAll("\t", " ").replace(/\s+/g, " ").trim();
|
|
7220
|
+
return oneLine.length <= MAX_SUBAGENT_INVOCATION_ERROR_CHARS ? oneLine : `${oneLine.slice(0, MAX_SUBAGENT_INVOCATION_ERROR_CHARS - 1)}…`;
|
|
7221
|
+
}
|
|
7222
|
+
function recordMessage(error) {
|
|
7223
|
+
if (typeof error === "string")
|
|
7224
|
+
return error;
|
|
7225
|
+
if (!error || typeof error !== "object")
|
|
7226
|
+
return String(error ?? "");
|
|
7227
|
+
const record = error;
|
|
7228
|
+
const data = record.data && typeof record.data === "object" ? record.data : undefined;
|
|
7229
|
+
const message = typeof data?.message === "string" ? data.message : typeof record.message === "string" ? record.message : typeof record.description === "string" ? record.description : "";
|
|
7230
|
+
const name = typeof record.name === "string" ? record.name : typeof record.type === "string" ? record.type : "";
|
|
7231
|
+
return [name, message].filter(Boolean).join(": ") || "The host reported an error without a message.";
|
|
7232
|
+
}
|
|
7233
|
+
function modelNotFoundDetail(error, attemptedModel) {
|
|
7234
|
+
const seen = new Set;
|
|
7235
|
+
const visit = (value, depth) => {
|
|
7236
|
+
if (typeof value === "string") {
|
|
7237
|
+
const modelMatch = value.match(/model not found:\s*(.+?)(?=(?:\.?\s*did you mean|$))/i);
|
|
7238
|
+
if (!modelMatch)
|
|
7239
|
+
return null;
|
|
7240
|
+
const model = modelMatch[1].trim().replace(/[.,;(]+$/, "");
|
|
7241
|
+
const suggestion = value.match(/did you mean:?\s*\(?\s*([^?);]+)/i)?.[1]?.trim();
|
|
7242
|
+
const message = `Model not found: ${model}${suggestion ? ` (did you mean ${suggestion}?)` : ""}`;
|
|
7243
|
+
return { model, ...suggestion ? { suggestion } : {}, message };
|
|
7244
|
+
}
|
|
7245
|
+
if (!value || typeof value !== "object" || depth > 4 || seen.has(value))
|
|
7246
|
+
return null;
|
|
7247
|
+
seen.add(value);
|
|
7248
|
+
const record = value;
|
|
7249
|
+
const data = record.data && typeof record.data === "object" ? record.data : undefined;
|
|
7250
|
+
const modelRecord = data?.model ?? record.model;
|
|
7251
|
+
const modelId = (typeof data?.modelID === "string" ? data.modelID : undefined) ?? (typeof modelRecord?.modelID === "string" ? modelRecord.modelID : undefined) ?? (typeof modelRecord?.id === "string" ? modelRecord.id : undefined);
|
|
7252
|
+
const providerId = (typeof data?.providerID === "string" ? data.providerID : undefined) ?? (typeof modelRecord?.providerID === "string" ? modelRecord.providerID : undefined);
|
|
7253
|
+
const suggestions = data?.suggestions;
|
|
7254
|
+
const suggestion = Array.isArray(suggestions) && typeof suggestions[0] === "string" ? suggestions[0] : typeof data?.suggestion === "string" ? data.suggestion : undefined;
|
|
7255
|
+
const rawMessage = recordMessage(value);
|
|
7256
|
+
const fromMessage = visit(rawMessage, depth + 1);
|
|
7257
|
+
if (fromMessage)
|
|
7258
|
+
return fromMessage.suggestion || !suggestion ? fromMessage : {
|
|
7259
|
+
...fromMessage,
|
|
7260
|
+
suggestion,
|
|
7261
|
+
message: `Model not found: ${fromMessage.model} (did you mean ${suggestion}?)`
|
|
7262
|
+
};
|
|
7263
|
+
const name = `${String(record.name ?? "")} ${String(record.type ?? "")}`;
|
|
7264
|
+
if (/ProviderModelNotFoundError|model not found/i.test(name) && modelId) {
|
|
7265
|
+
const model = providerId ? `${providerId}/${modelId}` : modelId;
|
|
7266
|
+
const detail = `Model not found: ${model}${suggestion ? ` (did you mean ${suggestion}?)` : ""}`;
|
|
7267
|
+
return { model, ...suggestion ? { suggestion } : {}, message: detail };
|
|
7268
|
+
}
|
|
7269
|
+
for (const key of ["data", "error", "cause", "hostError"]) {
|
|
7270
|
+
const match = visit(record[key], depth + 1);
|
|
7271
|
+
if (match)
|
|
7272
|
+
return match;
|
|
7273
|
+
}
|
|
7274
|
+
return null;
|
|
7275
|
+
};
|
|
7276
|
+
const found = visit(error, 0);
|
|
7277
|
+
if (!found && attemptedModel && (typeof error === "string" && /ProviderModelNotFoundError/i.test(error) || error !== null && typeof error === "object" && /ProviderModelNotFoundError/i.test(`${String(error.name ?? "")} ${String(error.type ?? "")}`))) {
|
|
7278
|
+
return { model: attemptedModel, message: `Model not found: ${attemptedModel}` };
|
|
7279
|
+
}
|
|
7280
|
+
return found;
|
|
7281
|
+
}
|
|
7282
|
+
function hostLabel(harness) {
|
|
7283
|
+
switch (harness) {
|
|
7284
|
+
case "opencode2":
|
|
7285
|
+
return "OpenCode 2";
|
|
7286
|
+
case "opencode":
|
|
7287
|
+
return "OpenCode";
|
|
7288
|
+
case "pi":
|
|
7289
|
+
return "Pi";
|
|
7290
|
+
case "omp":
|
|
7291
|
+
return "Oh My Pi";
|
|
7292
|
+
}
|
|
7293
|
+
}
|
|
7294
|
+
function invocationErrorText(input, details, attemptedModel) {
|
|
7295
|
+
if (input.error == null && input.hostError == null && details.hostError == null)
|
|
7296
|
+
return null;
|
|
7297
|
+
const rawHostError = input.hostError ?? details.hostError;
|
|
7298
|
+
const modelError = modelNotFoundDetail(rawHostError ?? input.error, attemptedModel);
|
|
7299
|
+
if (modelError) {
|
|
7300
|
+
return cleanOneLine(`No reply: ${hostLabel(input.harness)} refused the model: ${modelError.message}`);
|
|
7301
|
+
}
|
|
7302
|
+
if (rawHostError != null) {
|
|
7303
|
+
return cleanOneLine(`No reply: ${hostLabel(input.harness)} reported a child-session error: ${recordMessage(rawHostError)}`);
|
|
7304
|
+
}
|
|
7305
|
+
return cleanOneLine(describeError(input.error).brief);
|
|
7306
|
+
}
|
|
7307
|
+
function warnUnknownModel(input, details, attemptedModel, modelConfigKey) {
|
|
7308
|
+
if (!attemptedModel)
|
|
7309
|
+
return;
|
|
7310
|
+
const issue = modelNotFoundDetail(input.hostError ?? details.hostError ?? input.error, attemptedModel);
|
|
7311
|
+
if (!issue || warnedUnknownModels.has(attemptedModel))
|
|
7312
|
+
return;
|
|
7313
|
+
if (!modelConfigKey)
|
|
7314
|
+
return;
|
|
7315
|
+
warnedUnknownModels.add(attemptedModel);
|
|
7316
|
+
const suggestion = issue.suggestion ? `provider suggests ${cleanOneLine(issue.suggestion)}` : "provider gave no model suggestion";
|
|
7317
|
+
log2(`[magic-context] WARNING: ${modelConfigKey} configured ${attemptedModel}, but ${hostLabel(input.harness)} does not know that model; ${suggestion}`);
|
|
7318
|
+
}
|
|
7173
7319
|
function asNumber(value) {
|
|
7174
7320
|
return typeof value === "number" && Number.isFinite(value) ? value : 0;
|
|
7175
7321
|
}
|
|
@@ -7240,8 +7386,11 @@ function sumTokensFromChildMessages(messages) {
|
|
|
7240
7386
|
function findLastAssistantModel(messages) {
|
|
7241
7387
|
for (let index = messages.length - 1;index >= 0; index -= 1) {
|
|
7242
7388
|
const message = messages[index];
|
|
7243
|
-
if (isAssistantMessage(message))
|
|
7244
|
-
|
|
7389
|
+
if (isAssistantMessage(message)) {
|
|
7390
|
+
const model = modelFromMessage(message);
|
|
7391
|
+
if (model.providerId || model.modelId)
|
|
7392
|
+
return model;
|
|
7393
|
+
}
|
|
7245
7394
|
}
|
|
7246
7395
|
return { providerId: null, modelId: null };
|
|
7247
7396
|
}
|
|
@@ -7250,10 +7399,25 @@ function recordChildInvocation(input) {
|
|
|
7250
7399
|
return null;
|
|
7251
7400
|
const tokens = input.tokens ?? sumTokensFromChildMessages(input.messages ?? []);
|
|
7252
7401
|
const observedModel = findLastAssistantModel(input.messages ?? []);
|
|
7402
|
+
const details = errorDetailsOf(input.error);
|
|
7403
|
+
const attemptedModel = details.attemptedModel ?? modelRef(input.attemptedModel);
|
|
7404
|
+
const attemptConfig = [input.attemptedModel, ...input.configuredModels ?? []].find((candidate) => modelRef(candidate) === attemptedModel);
|
|
7405
|
+
const modelConfigKey = details.modelConfigKey ?? input.modelConfigKey ?? (typeof attemptConfig === "object" ? attemptConfig?.sourceConfigKey : undefined);
|
|
7406
|
+
const attemptedParts = splitModelRef(attemptedModel);
|
|
7253
7407
|
const model = {
|
|
7254
|
-
providerId: input.providerId ??
|
|
7255
|
-
modelId: input.modelId ??
|
|
7408
|
+
providerId: observedModel.providerId ?? input.providerId ?? attemptedParts.providerId,
|
|
7409
|
+
modelId: observedModel.modelId ?? input.modelId ?? attemptedParts.modelId
|
|
7256
7410
|
};
|
|
7411
|
+
const reportedModelRef = observedModel.providerId && observedModel.modelId ? `${observedModel.providerId}/${observedModel.modelId}` : input.providerId && input.modelId ? `${input.providerId}/${input.modelId}` : undefined;
|
|
7412
|
+
if (attemptedModel && reportedModelRef && attemptedModel !== reportedModelRef && (observedModel.providerId !== null || input.providerId !== undefined)) {
|
|
7413
|
+
const rerouteKey = `${input.harness}\x00${attemptedModel}\x00${reportedModelRef}`;
|
|
7414
|
+
if (!loggedModelReroutes.has(rerouteKey)) {
|
|
7415
|
+
loggedModelReroutes.add(rerouteKey);
|
|
7416
|
+
sessionLog2(input.parentSessionId, `subagent model rerouted by host: attempted=${attemptedModel} reported=${reportedModelRef}`);
|
|
7417
|
+
}
|
|
7418
|
+
}
|
|
7419
|
+
warnUnknownModel(input, details, attemptedModel, modelConfigKey);
|
|
7420
|
+
const errorText = invocationErrorText(input, details, attemptedModel);
|
|
7257
7421
|
try {
|
|
7258
7422
|
return recordSubagentInvocation(input.db, {
|
|
7259
7423
|
sessionId: input.parentSessionId,
|
|
@@ -7269,7 +7433,7 @@ function recordChildInvocation(input) {
|
|
|
7269
7433
|
outputTokens: tokens.output,
|
|
7270
7434
|
cacheReadTokens: tokens.cacheRead,
|
|
7271
7435
|
cacheWriteTokens: tokens.cacheWrite,
|
|
7272
|
-
error:
|
|
7436
|
+
error: errorText,
|
|
7273
7437
|
parentInvocationId: input.parentInvocationId ?? null
|
|
7274
7438
|
});
|
|
7275
7439
|
} catch (error) {
|
|
@@ -7297,6 +7461,17 @@ var HOST_SESSION_ERROR = Symbol("promptAsyncHostSessionError");
|
|
|
7297
7461
|
function isHostSessionError(error) {
|
|
7298
7462
|
return error !== null && typeof error === "object" && error[HOST_SESSION_ERROR] === true;
|
|
7299
7463
|
}
|
|
7464
|
+
function hostSessionErrorOf(error) {
|
|
7465
|
+
if (!isHostSessionError(error))
|
|
7466
|
+
return;
|
|
7467
|
+
return error.hostError;
|
|
7468
|
+
}
|
|
7469
|
+
function requestModelRef(request) {
|
|
7470
|
+
const model = request.body?.model;
|
|
7471
|
+
if (model && typeof model.providerID === "string" && typeof model.modelID === "string")
|
|
7472
|
+
return `${model.providerID}/${model.modelID}`;
|
|
7473
|
+
return;
|
|
7474
|
+
}
|
|
7300
7475
|
function supportsPromptAsync(client) {
|
|
7301
7476
|
const session = sessionApi(client);
|
|
7302
7477
|
return typeof session?.promptAsync === "function" && typeof session?.status === "function" && typeof session?.messages === "function";
|
|
@@ -7451,11 +7626,29 @@ async function promptAsyncAndWaitForIdle(client, request, options = {}) {
|
|
|
7451
7626
|
const initialBaseline = new Set(completionBaseline);
|
|
7452
7627
|
activeSessionErrors.set(sessionId, undefined);
|
|
7453
7628
|
try {
|
|
7454
|
-
|
|
7629
|
+
let sent;
|
|
7630
|
+
try {
|
|
7631
|
+
sent = await session.promptAsync?.(request);
|
|
7632
|
+
} catch (error) {
|
|
7633
|
+
annotateSubagentInvocationError(error, {
|
|
7634
|
+
attemptedModel: requestModelRef(request),
|
|
7635
|
+
modelConfigKey: options.modelConfigKey,
|
|
7636
|
+
hostError: error
|
|
7637
|
+
});
|
|
7638
|
+
throw error;
|
|
7639
|
+
}
|
|
7455
7640
|
if (sent && typeof sent === "object" && "error" in sent) {
|
|
7456
7641
|
const rejection = sent.error;
|
|
7457
7642
|
if (rejection) {
|
|
7458
|
-
|
|
7643
|
+
const error = new Error(`prompt_async was rejected: ${describeRejection(rejection)}`, {
|
|
7644
|
+
cause: rejection
|
|
7645
|
+
});
|
|
7646
|
+
annotateSubagentInvocationError(error, {
|
|
7647
|
+
attemptedModel: requestModelRef(request),
|
|
7648
|
+
modelConfigKey: options.modelConfigKey,
|
|
7649
|
+
hostError: rejection
|
|
7650
|
+
});
|
|
7651
|
+
throw error;
|
|
7459
7652
|
}
|
|
7460
7653
|
}
|
|
7461
7654
|
let sentAt = Date.now();
|
|
@@ -7470,7 +7663,13 @@ async function promptAsyncAndWaitForIdle(client, request, options = {}) {
|
|
|
7470
7663
|
Object.assign(error, {
|
|
7471
7664
|
name: "DreamerProviderOutputFailureError",
|
|
7472
7665
|
transient: true,
|
|
7473
|
-
[HOST_SESSION_ERROR]: true
|
|
7666
|
+
[HOST_SESSION_ERROR]: true,
|
|
7667
|
+
hostError
|
|
7668
|
+
});
|
|
7669
|
+
annotateSubagentInvocationError(error, {
|
|
7670
|
+
attemptedModel: requestModelRef(request),
|
|
7671
|
+
modelConfigKey: options.modelConfigKey,
|
|
7672
|
+
hostError
|
|
7474
7673
|
});
|
|
7475
7674
|
throw error;
|
|
7476
7675
|
}
|
|
@@ -15223,6 +15422,8 @@ function resolveHiddenCompletionExecutor(executor, client, db, directory, entryP
|
|
|
15223
15422
|
}
|
|
15224
15423
|
function createV1HiddenCompletionExecutor(client, db, directory) {
|
|
15225
15424
|
const historianChildren = new Set;
|
|
15425
|
+
const hostErrors = new Map;
|
|
15426
|
+
const runIdentities = new Map;
|
|
15226
15427
|
return {
|
|
15227
15428
|
capabilities: { tools: true, harness: "opencode" },
|
|
15228
15429
|
async open(run) {
|
|
@@ -15239,23 +15440,49 @@ function createV1HiddenCompletionExecutor(client, db, directory) {
|
|
|
15239
15440
|
preferResponseOnMissingData: true
|
|
15240
15441
|
});
|
|
15241
15442
|
const id = typeof created?.id === "string" ? created.id : "";
|
|
15242
|
-
if (id)
|
|
15443
|
+
if (id) {
|
|
15243
15444
|
rememberV1HiddenRun(id, run);
|
|
15445
|
+
runIdentities.set(id, run);
|
|
15446
|
+
}
|
|
15244
15447
|
if (id && run.kind !== "dreamer-task") {
|
|
15245
15448
|
historianChildren.add(id);
|
|
15246
15449
|
rememberHistorianOutputCap(id, run.maxOutputTokens);
|
|
15247
15450
|
}
|
|
15248
|
-
|
|
15451
|
+
const configured = toModelEntry(run.model);
|
|
15452
|
+
return {
|
|
15453
|
+
id,
|
|
15454
|
+
childSessionId: id || undefined,
|
|
15455
|
+
...configured ? { attemptedModel: configured.model } : {},
|
|
15456
|
+
...configured?.sourceConfigKey ? { modelConfigKey: configured.sourceConfigKey } : {}
|
|
15457
|
+
};
|
|
15249
15458
|
},
|
|
15250
15459
|
async attempt(handle, request) {
|
|
15251
15460
|
if (!client)
|
|
15252
15461
|
throw new Error("Hidden completion client is unavailable");
|
|
15462
|
+
const identity = runIdentities.get(handle.id);
|
|
15463
|
+
const requestedModel = request.body?.model;
|
|
15464
|
+
const requestedRef = requestedModel && typeof requestedModel.providerID === "string" && typeof requestedModel.modelID === "string" ? `${requestedModel.providerID}/${requestedModel.modelID}` : undefined;
|
|
15465
|
+
const matchingConfigured = (identity?.configuredModels ?? []).map(toModelEntry).find((entry) => entry?.model === requestedRef);
|
|
15466
|
+
const configured = matchingConfigured ?? (requestedRef && identity?.model && toModelEntry(identity.model)?.model === requestedRef ? toModelEntry(identity.model) : toModelEntry(identity?.model));
|
|
15467
|
+
handle.attemptedModel = requestedRef ?? configured?.model ?? handle.attemptedModel;
|
|
15468
|
+
handle.modelConfigKey = configured?.sourceConfigKey ?? handle.modelConfigKey;
|
|
15253
15469
|
if (supportsPromptAsync(client)) {
|
|
15254
15470
|
try {
|
|
15255
|
-
await promptAsyncAndWaitForIdle(client, request
|
|
15471
|
+
await promptAsyncAndWaitForIdle(client, request, {
|
|
15472
|
+
modelConfigKey: handle.modelConfigKey
|
|
15473
|
+
});
|
|
15256
15474
|
} catch (error) {
|
|
15257
|
-
if (
|
|
15258
|
-
|
|
15475
|
+
if (isHostSessionError(error)) {
|
|
15476
|
+
const hostError = hostSessionErrorOf(error);
|
|
15477
|
+
hostErrors.set(handle.id, hostError);
|
|
15478
|
+
annotateSubagentInvocationError(error, {
|
|
15479
|
+
attemptedModel: handle.attemptedModel,
|
|
15480
|
+
modelConfigKey: handle.modelConfigKey,
|
|
15481
|
+
hostError
|
|
15482
|
+
});
|
|
15483
|
+
if (historianChildren.has(handle.id))
|
|
15484
|
+
return;
|
|
15485
|
+
}
|
|
15259
15486
|
throw error;
|
|
15260
15487
|
}
|
|
15261
15488
|
return;
|
|
@@ -15273,9 +15500,16 @@ function createV1HiddenCompletionExecutor(client, db, directory) {
|
|
|
15273
15500
|
preferResponseOnMissingData: true
|
|
15274
15501
|
});
|
|
15275
15502
|
const assistantFailure = extractLatestAssistantFailure(messages);
|
|
15503
|
+
const hostError = hostErrors.get(handle.id);
|
|
15276
15504
|
if (assistantFailure) {
|
|
15277
15505
|
const finish = assistantFailure.finish ? ` (finish=${assistantFailure.finish})` : "";
|
|
15278
|
-
|
|
15506
|
+
const error = new Error(`Historian host recorded an assistant error${finish}: ${describeAssistantFailure(assistantFailure.error)}`, hostError === undefined ? undefined : { cause: hostError });
|
|
15507
|
+
annotateSubagentInvocationError(error, {
|
|
15508
|
+
attemptedModel: handle.attemptedModel,
|
|
15509
|
+
modelConfigKey: handle.modelConfigKey,
|
|
15510
|
+
hostError
|
|
15511
|
+
});
|
|
15512
|
+
throw error;
|
|
15279
15513
|
}
|
|
15280
15514
|
const text = extractLatestAssistantText(messages);
|
|
15281
15515
|
const latest = Array.isArray(messages) ? messages.filter((message) => isRecord(message) && isRecord(message.info) && message.info.role === "assistant").sort((left, right) => historianMessageCreatedAt(right) - historianMessageCreatedAt(left))[0] : undefined;
|
|
@@ -15286,13 +15520,18 @@ function createV1HiddenCompletionExecutor(client, db, directory) {
|
|
|
15286
15520
|
reasoning: text ? null : extractLatestHistorianReasoning(messages),
|
|
15287
15521
|
lengthCapped: hasLengthCappedOutput(messages),
|
|
15288
15522
|
usage: sumTokensFromChildMessages(messages),
|
|
15289
|
-
tokenLog: runTokenLog(info.tokens, undefined, info.finish ?? info.finish_reason ?? info.finishReason)
|
|
15523
|
+
tokenLog: runTokenLog(info.tokens, undefined, info.finish ?? info.finish_reason ?? info.finishReason),
|
|
15524
|
+
attemptedModel: handle.attemptedModel,
|
|
15525
|
+
modelConfigKey: handle.modelConfigKey,
|
|
15526
|
+
...hostError === undefined ? {} : { hostError }
|
|
15290
15527
|
};
|
|
15291
15528
|
},
|
|
15292
15529
|
async close(handle, settlement) {
|
|
15293
15530
|
if (handle?.id) {
|
|
15294
15531
|
rememberV1HiddenRun(handle.id, undefined);
|
|
15295
15532
|
historianChildren.delete(handle.id);
|
|
15533
|
+
hostErrors.delete(handle.id);
|
|
15534
|
+
runIdentities.delete(handle.id);
|
|
15296
15535
|
forgetHistorianOutputCap(handle.id);
|
|
15297
15536
|
}
|
|
15298
15537
|
if (!client)
|
|
@@ -15447,7 +15686,8 @@ async function runHistorianPrompt(args) {
|
|
|
15447
15686
|
if (invocationRecorded)
|
|
15448
15687
|
return null;
|
|
15449
15688
|
invocationRecorded = true;
|
|
15450
|
-
const
|
|
15689
|
+
const configuredModel = toModelEntry(modelOverride);
|
|
15690
|
+
const actualModelRef = completion?.providerId && completion.modelId ? `${completion.providerId}/${completion.modelId}` : handle?.attemptedModel ?? configuredModel?.model ?? null;
|
|
15451
15691
|
const usedConfiguredFallback = actualModelRef !== null && (fallbackModels ?? []).some((candidate) => toModelEntry(candidate)?.model === actualModelRef);
|
|
15452
15692
|
return recordChildInvocation({
|
|
15453
15693
|
db: openDatabase(),
|
|
@@ -15463,6 +15703,10 @@ async function runHistorianPrompt(args) {
|
|
|
15463
15703
|
providerId: completion.providerId,
|
|
15464
15704
|
modelId: completion.modelId
|
|
15465
15705
|
} : {},
|
|
15706
|
+
attemptedModel: handle?.attemptedModel ?? modelOverride,
|
|
15707
|
+
configuredModels: fallbackModels,
|
|
15708
|
+
modelConfigKey: handle?.modelConfigKey ?? configuredModel?.sourceConfigKey,
|
|
15709
|
+
hostError: params.hostError ?? completion?.hostError,
|
|
15466
15710
|
error: params.error,
|
|
15467
15711
|
parentInvocationId: agentId === HISTORIAN_EDITOR_AGENT ? parentInvocationId ?? null : null
|
|
15468
15712
|
});
|
|
@@ -15576,7 +15820,8 @@ async function runHistorianPrompt(args) {
|
|
|
15576
15820
|
const invocationId = recordInvocation({
|
|
15577
15821
|
status: emptyError ? "empty" : "completed",
|
|
15578
15822
|
messages: completion.messages,
|
|
15579
|
-
error: emptyError
|
|
15823
|
+
error: emptyError,
|
|
15824
|
+
hostError: completion.hostError
|
|
15580
15825
|
});
|
|
15581
15826
|
if (emptyError && (!reasoningResult || lengthCapped)) {
|
|
15582
15827
|
return {
|
|
@@ -16482,7 +16727,8 @@ function resolveProtectedTailBoundary(ctx) {
|
|
|
16482
16727
|
break;
|
|
16483
16728
|
}
|
|
16484
16729
|
livePromptFloor.ordinal = lastMeaningfulUserOrdinal || null;
|
|
16485
|
-
|
|
16730
|
+
livePromptFloor.messageId = boundaryMessageId(index, lastMeaningfulUserOrdinal);
|
|
16731
|
+
if (!ctx.liftLivePromptFloor && lastMeaningfulUserOrdinal >= offset) {
|
|
16486
16732
|
protectedTailStart = Math.min(protectedTailStart, lastMeaningfulUserOrdinal);
|
|
16487
16733
|
}
|
|
16488
16734
|
}
|
|
@@ -16610,6 +16856,7 @@ function resolveBoundaryContext(args) {
|
|
|
16610
16856
|
protectedTailPolicyVersion: meta.protectedTailPolicyVersion,
|
|
16611
16857
|
migrationFloorActive,
|
|
16612
16858
|
emergencyTailScale: args.emergencyTailScale,
|
|
16859
|
+
liftLivePromptFloor: args.liftLivePromptFloor,
|
|
16613
16860
|
providerShapeVersion: args.providerShapeVersion ?? "opencode-v1",
|
|
16614
16861
|
cacheNamespace: args.cacheNamespace ?? `opencode:${args.sessionId}`,
|
|
16615
16862
|
storedTokenTotalsForMessages,
|
|
@@ -17721,7 +17968,7 @@ function promoteRecompStagingWithM0Mutation(db, sessionId, holderId) {
|
|
|
17721
17968
|
finished = true;
|
|
17722
17969
|
return null;
|
|
17723
17970
|
}
|
|
17724
|
-
|
|
17971
|
+
deleteChunkEmbedBackoffForSession2(db, sessionId);
|
|
17725
17972
|
db.prepare("DELETE FROM compartments WHERE session_id = ?").run(sessionId);
|
|
17726
17973
|
db.prepare("DELETE FROM session_facts WHERE session_id = ?").run(sessionId);
|
|
17727
17974
|
insertRecompCompartmentRows(db, sessionId, staging.compartments, now);
|
|
@@ -18796,4 +19043,4 @@ ${failure}`;
|
|
|
18796
19043
|
}
|
|
18797
19044
|
}
|
|
18798
19045
|
|
|
18799
|
-
export { historianRunConfig, dreamerRunConfig, pluginConfigReader, currentPluginConfigReader, withLiveDreamerOutputCap, COMPARTMENT_LEASE_RENEWAL_MS, acquireCompartmentLease, renewCompartmentLease, releaseCompartmentLeaseBestEffort, isCompartmentLeaseHeld, queueM0Mutation, getMaxM0MutationId, getCompartments, getLastCompartmentEndMessage, getLastCompartmentEndMessageId, getUncoveredCompartmentEndsThrough, providerResponseFailed, isSuccessfulProviderCompletion, rememberUnpublishedAutoSearchNoHint, getUnpublishedAutoSearchNoHint, forgetUnpublishedAutoSearchNoHint, registerAutoSearchWork, getOrCreateSessionMeta, updateSessionMeta, advanceToolReclaimWatermark, markSessionCleanupPending, retryPendingSessionCleanups, retryPendingRustSessionCleanupsForProject, clearSession, requestPendingMaterialization, pendingMaterializationOrigin, hasPendingMaterializationOrigin, clearPendingMaterialization, recordSystemPromptForRequest, recordHeldHeadForRequest, bindSystemPromptResponse, isHeldHeadForRequest, deferDeliveredSystemRefresh, retirePendingSystemPromptDelivery, lkgProviderInputTotal, beginV2LkgRequest, claimLkgRequestIdentity, currentLkgRequestIdentity, noteCapturedLkgRequest, noteLkgProviderResponse, measuredLkgPrefix, clearLkgMeasuredRequest, saveLkgSlotToDb, clearPersistedLkgSlotStrict, loadPersistedLkgSlot, drainStaleLkgSlots, resolveLkgModelKeys, createLkgEntryProjector, captureLkgSlot, validateAnthropicReasoningRuns, validateLkgSeam, replayLkg, coldStartRawServedIndex, coldStartUncapturedReplay, noteUncertifiedNormalLkg, hasProcessLocalLkgProof, lkgDirtyRevision, rememberLkgDirtyRevision, readPersistedLkgUntaggedInputIds, persistLkgUntaggedInputIds, noteLkgRecoveryPrefix, readLkgRecoveryPrefix, noteLkgHealthyPrefix, lkgRecoveryReplayUnproven, lkgRecoveryEntryUnproven, beginLkgPass, visitMessageContentFields, contentSnapshotValue, messageContentFields, signatureForFields, exactReusablePrefix, incrementalLkgContentDigests, lkgSlotRejection, captureSlot, getInMemorySlot, getSlot, forgetInMemorySlot, dropSlot, noteEntry, getLkgSlotHeapStats, TOOL_SWEEP_SCOPED_MARKER, useScopedToolSweep, createPreAdoptionToolSweepResolver, copySessionStateForClone, queueMemoryMutation, getMaxMemoryMutationIdForProjects, GLOBAL_USER_PROFILE_PROJECT_PATH, getProjectState, bumpProjectUserProfileVersion, saveSourceContent, replaceSourceContent, getSourceContents, readCoordinateGeneration, rebaseSessionCoordinatesAsync, HiddenCompletionRefusal, getOpenCodeDbPath, compareOpenCodeMessagesByCanonicalOrder, prepareCompactionMarkerCandidates, removeMcOwnedCompactionMarkers, getCompartmentEvents, USER_MEMORY_CANDIDATE_TTL_MS, insertUserMemoryCandidates, getUserMemoryCandidates, deleteUserMemoryCandidates, pruneExpiredUserMemoryCandidates, insertUserMemory, getActiveUserMemories, updateUserMemoryContent, dismissUserMemory, DreamerProviderOutputFailureError, withDreamerModelCooldown, providerOutputFailureFromInvalidManifest, DREAMER_AGENT, DREAMER_RETROSPECTIVE_AGENT, DREAMER_PRIMER_INVESTIGATOR_AGENT, DREAMER_MEMORY_MAPPER_AGENT, DREAMER_CLASSIFIER_AGENT, DREAMER_DOCS_AGENT, DREAMER_REVIEWER_AGENT, HIDDEN_HISTORIAN_AGENT, HIDDEN_DREAMER_AGENT, HIDDEN_CURATE_AGENT, hiddenAgentFor, hiddenToolLoop, HIDDEN_RUN_DISPOSED_REASON, noteChildOfDisposedInstance, hiddenChildPermissions, registerHiddenChildAgents, hiddenToolCallRefusal, HiddenAgentStepLimit, HiddenChildHook, extractLatestAssistantText, hasLengthCappedOutput, parseProviderModel, modelBodyField, toModelEntry, isPromptTimeoutError, getPromptFailureDetail, raceWithSignal, promptSyncWithValidatedOutputRetry, normalizeSDKResponse, failedInvocationStatus, sumTokensFromChildMessages, recordChildInvocation, createPromptAsyncTransport, CTX_NOTE_LIGHT_DESCRIPTION, ACTIVE_TOOL_IDS, systemPromptFingerprint, createPromptSurfaceRuntime, createPromptSurfaceGuidanceEpochCache, MARKER_SUMMARY_TEXT, markerUpdateDefinitelyDidNotCut, applyDeferredCompactionMarker, teardownChildSession, runTokenLog, formatRunTokenLog, createChildSessionWithFence, buildMagicContextSection, getMuralIdentity, getMural, modelKeyAcceptsImages, resolveMuralWire, extractM0Block, formatDate, TEMPORAL_MARKER_REPLAY_PATTERN, collectTemporalCandidates, injectTemporalMarkers, clearInjectionCache, getVisibleMemoryIds, selectHiddenMessagesAtCompactionSeam, prepareCompartmentInjection, renderCompartmentInjection, MaterializeContentionError, mustMaterialize, trimMemoriesToBudgetV2, renderMemoryBlockV2, materializeM0, hydrateCachedM0Mural, resetPrefixTrimFallbackState, findHostCompactionWindow, capturePrefixTrimSourceOrder, prepareCachedM0M1Replay, hasCompleteCachedM0M1, injectM0M1, clampProducerAtomChars, producerInputTokenLimit, historianProducerReserve, producerPromptFailureReason, resolveHiddenCompletionExecutor, createV1HiddenCompletionExecutor, EMPTY_READ_REPLY, noteTouchedAt, renderGlance, renderNotesById, formatWriteReply, observeNoteNudgeServe, onNoteTrigger, peekNoteNudgeText, markNoteNudgeDelivered, clearNoteNudgeTriggerAndCooldown, omitIncompleteFileTokenTotals, describeBoundaryDiagnostics, RECOVERY_NO_HEAD_LIMIT, deriveProtectedTailTokenTarget, selectPerRunCap, resolveOpenCodeProtectedTailBoundary, resolveWrapupProtectedTailBoundary, getRawHistoryEligibility, hasRunnableCompartmentWindow, recordHighPressureNoEligibleHead, noteTransformPassForExactOrdinalReads, runCompartmentAgent, getActiveCompartmentRun, markActiveCompartmentRunPublished, registerActiveCompartmentRun, startCompartmentAgent, isRecompFailure2, isRecompSkip2, extractRecompReason2, setRecompStarting2, setRecompNote2, setRecompTerminal2, buildRecompDeps2, runManagedRecomp2 };
|
|
19046
|
+
export { historianRunConfig, dreamerRunConfig, pluginConfigReader, currentPluginConfigReader, withLiveDreamerOutputCap, COMPARTMENT_LEASE_RENEWAL_MS, acquireCompartmentLease, renewCompartmentLease, releaseCompartmentLeaseBestEffort, isCompartmentLeaseHeld, queueM0Mutation, getMaxM0MutationId, getCompartments, getLastCompartmentEndMessage, getLastCompartmentEndMessageId, getUncoveredCompartmentEndsThrough, providerResponseFailed, isSuccessfulProviderCompletion, rememberUnpublishedAutoSearchNoHint, getUnpublishedAutoSearchNoHint, forgetUnpublishedAutoSearchNoHint, registerAutoSearchWork, getOrCreateSessionMeta, updateSessionMeta, advanceToolReclaimWatermark, markSessionCleanupPending, retryPendingSessionCleanups, retryPendingRustSessionCleanupsForProject, clearSession, requestPendingMaterialization, pendingMaterializationOrigin, hasPendingMaterializationOrigin, clearPendingMaterialization, recordSystemPromptForRequest, recordHeldHeadForRequest, bindSystemPromptResponse, isHeldHeadForRequest, deferDeliveredSystemRefresh, retirePendingSystemPromptDelivery, lkgProviderInputTotal, beginV2LkgRequest, claimLkgRequestIdentity, currentLkgRequestIdentity, noteCapturedLkgRequest, noteLkgProviderResponse, measuredLkgPrefix, clearLkgMeasuredRequest, saveLkgSlotToDb, clearPersistedLkgSlotStrict, loadPersistedLkgSlot, drainStaleLkgSlots, resolveLkgModelKeys, createLkgEntryProjector, captureLkgSlot, validateAnthropicReasoningRuns, validateLkgSeam, replayLkg, coldStartRawServedIndex, coldStartUncapturedReplay, noteUncertifiedNormalLkg, hasProcessLocalLkgProof, lkgDirtyRevision, rememberLkgDirtyRevision, readPersistedLkgUntaggedInputIds, persistLkgUntaggedInputIds, noteLkgRecoveryPrefix, readLkgRecoveryPrefix, noteLkgHealthyPrefix, lkgRecoveryReplayUnproven, lkgRecoveryEntryUnproven, beginLkgPass, visitMessageContentFields, contentSnapshotValue, messageContentFields, signatureForFields, exactReusablePrefix, incrementalLkgContentDigests, lkgSlotRejection, captureSlot, getInMemorySlot, getSlot, forgetInMemorySlot, dropSlot, noteEntry, getLkgSlotHeapStats, TOOL_SWEEP_SCOPED_MARKER, useScopedToolSweep, createPreAdoptionToolSweepResolver, copySessionStateForClone, queueMemoryMutation, getMaxMemoryMutationIdForProjects, GLOBAL_USER_PROFILE_PROJECT_PATH, getProjectState, bumpProjectUserProfileVersion, saveSourceContent, replaceSourceContent, getSourceContents, readCoordinateGeneration, rebaseSessionCoordinatesAsync, HiddenCompletionRefusal, getOpenCodeDbPath, compareOpenCodeMessagesByCanonicalOrder, prepareCompactionMarkerCandidates, removeMcOwnedCompactionMarkers, getCompartmentEvents, USER_MEMORY_CANDIDATE_TTL_MS, insertUserMemoryCandidates, getUserMemoryCandidates, deleteUserMemoryCandidates, pruneExpiredUserMemoryCandidates, insertUserMemory, getActiveUserMemories, updateUserMemoryContent, dismissUserMemory, DreamerProviderOutputFailureError, withDreamerModelCooldown, providerOutputFailureFromInvalidManifest, DREAMER_AGENT, DREAMER_RETROSPECTIVE_AGENT, DREAMER_PRIMER_INVESTIGATOR_AGENT, DREAMER_MEMORY_MAPPER_AGENT, DREAMER_CLASSIFIER_AGENT, DREAMER_DOCS_AGENT, DREAMER_REVIEWER_AGENT, HIDDEN_HISTORIAN_AGENT, HIDDEN_DREAMER_AGENT, HIDDEN_CURATE_AGENT, hiddenAgentFor, hiddenToolLoop, HIDDEN_RUN_DISPOSED_REASON, noteChildOfDisposedInstance, hiddenChildPermissions, registerHiddenChildAgents, hiddenToolCallRefusal, HiddenAgentStepLimit, HiddenChildHook, extractLatestAssistantText, hasLengthCappedOutput, parseProviderModel, modelBodyField, toModelEntry, ModelProducedNoOutputError, noteModelActivityMonitored, noteModelOutputReceived, isPromptTimeoutError, getPromptFailureDetail, raceWithSignal, promptSyncWithValidatedOutputRetry, normalizeSDKResponse, annotateSubagentInvocationError, failedInvocationStatus, sumTokensFromChildMessages, recordChildInvocation, createPromptAsyncTransport, CTX_NOTE_LIGHT_DESCRIPTION, ACTIVE_TOOL_IDS, systemPromptFingerprint, createPromptSurfaceRuntime, createPromptSurfaceGuidanceEpochCache, MARKER_SUMMARY_TEXT, markerUpdateDefinitelyDidNotCut, applyDeferredCompactionMarker, teardownChildSession, runTokenLog, formatRunTokenLog, createChildSessionWithFence, buildMagicContextSection, getMuralIdentity, getMural, modelKeyAcceptsImages, resolveMuralWire, extractM0Block, formatDate, TEMPORAL_MARKER_REPLAY_PATTERN, collectTemporalCandidates, injectTemporalMarkers, clearInjectionCache, getVisibleMemoryIds, selectHiddenMessagesAtCompactionSeam, prepareCompartmentInjection, renderCompartmentInjection, MaterializeContentionError, mustMaterialize, trimMemoriesToBudgetV2, renderMemoryBlockV2, materializeM0, hydrateCachedM0Mural, resetPrefixTrimFallbackState, findHostCompactionWindow, capturePrefixTrimSourceOrder, prepareCachedM0M1Replay, hasCompleteCachedM0M1, injectM0M1, clampProducerAtomChars, producerInputTokenLimit, historianProducerReserve, producerPromptFailureReason, resolveHiddenCompletionExecutor, createV1HiddenCompletionExecutor, EMPTY_READ_REPLY, noteTouchedAt, renderGlance, renderNotesById, formatWriteReply, observeNoteNudgeServe, onNoteTrigger, peekNoteNudgeText, markNoteNudgeDelivered, clearNoteNudgeTriggerAndCooldown, omitIncompleteFileTokenTotals, describeBoundaryDiagnostics, RECOVERY_NO_HEAD_LIMIT, deriveProtectedTailTokenTarget, selectPerRunCap, resolveOpenCodeProtectedTailBoundary, resolveWrapupProtectedTailBoundary, getRawHistoryEligibility, hasRunnableCompartmentWindow, recordHighPressureNoEligibleHead, noteTransformPassForExactOrdinalReads, runCompartmentAgent, getActiveCompartmentRun, markActiveCompartmentRunPublished, registerActiveCompartmentRun, startCompartmentAgent, isRecompFailure2, isRecompSkip2, extractRecompReason2, setRecompStarting2, setRecompNote2, setRecompTerminal2, buildRecompDeps2, runManagedRecomp2 };
|