@cortexkit/opencode-magic-context 0.49.19 → 0.49.20
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-b2q30cft.js} +3 -3
- package/dist/compaction-marker-candidates-worker.js +2 -2
- package/dist/compartment-chunk-embedding-va090as0.js +65 -0
- package/dist/config/schema/magic-context.d.ts +6 -6
- package/dist/{conflict-warning-hook-4pmz879v.js → conflict-warning-hook-frp3z2wk.js} +9 -8
- package/dist/{context-j31m2dv7.js → context-mkece1db.js} +455 -134
- package/dist/{derive-budgets-zn7yzd2d.js → derive-budgets-pqybnx09.js} +2 -2
- package/dist/embedding-backfill-gy3p78py.js +25 -0
- package/dist/embedding-worker-process.js +2 -2
- package/dist/embedding-worker.js +5 -5
- 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/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-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/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.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.map +1 -1
- package/dist/features/magic-context/search.d.ts +27 -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-meta-persisted.d.ts +1 -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 +5 -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/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-messages.d.ts +2 -0
- package/dist/hooks/magic-context/tag-messages.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.map +1 -1
- package/dist/{index-bjcnntmz.js → index-0wthn7fp.js} +468 -18
- package/dist/{index-kq82mtg0.js → index-11zf2wwc.js} +3 -3
- package/dist/{index-b5vqckbw.js → index-153r2q6z.js} +314 -127
- package/dist/{index-3h4dp9wb.js → index-1pefp8ar.js} +5 -5
- package/dist/{index-beht37jy.js → index-1zx2pa5d.js} +1 -1
- package/dist/{index-ze7mvk54.js → index-2yhtnfcf.js} +75 -57
- package/dist/{index-cf74k5ak.js → index-305y133n.js} +4 -4
- package/dist/{index-s734jcsr.js → index-35qc6606.js} +9 -3
- package/dist/{index-se4m2g6w.js → index-48stjd56.js} +105 -19
- package/dist/{index-4911rn0b.js → index-4n7w9rad.js} +6 -6
- package/dist/{index-kee4kn5j.js → index-4pnsgvfk.js} +1 -1
- package/dist/{v2/server-8cd2j99z.js → index-5kym00ag.js} +32 -13
- package/dist/{index-4s3t0nd0.js → index-616rsjrv.js} +2 -2
- package/dist/{index-jhghdnsm.js → index-67nyj0gy.js} +485 -202
- package/dist/{index-6x57ar45.js → index-adk2z5d8.js} +3 -3
- package/dist/{index-c5pytzne.js → index-b88dwwrh.js} +1 -1
- package/dist/{index-rr2bb45z.js → index-c4b76d4t.js} +2 -2
- package/dist/{index-nj7yykkx.js → index-c7phnbvk.js} +1 -1
- package/dist/index-cpjk5jd2.js +82 -0
- package/dist/{index-edmpdxcw.js → index-d6rp4dxh.js} +5 -5
- package/dist/{index-dxmq29t1.js → index-dc8hy95c.js} +69 -17
- package/dist/{index-j75v2476.js → index-h7tgn49j.js} +12 -15
- package/dist/{index-ke416mdc.js → index-j76ah6d7.js} +2 -2
- package/dist/{index-c1p88z1y.js → index-jfh3cktr.js} +4 -4
- package/dist/{index-a6mc0v4d.js → index-jmycsey7.js} +3 -3
- package/dist/{index-24fezq97.js → index-jr5na10t.js} +4 -4
- package/dist/{index-s74zqahq.js → index-kc9pn495.js} +4 -4
- package/dist/{index-p5y3k4g7.js → index-nda0zgna.js} +2 -1
- package/dist/{index-jn12fvvh.js → index-neb2jaed.js} +3 -3
- package/dist/{index-63k48rv9.js → index-pnjwa6qa.js} +5 -5
- package/dist/{index-jrr131e0.js → index-rmd0069m.js} +11 -11
- package/dist/{index-y9f76s3f.js → index-rrv26qjz.js} +1 -1
- package/dist/{index-v10f1rjv.js → index-spwjbkc7.js} +1 -1
- package/dist/{index-k29z4aqh.js → index-t5pck3ss.js} +1 -1
- package/dist/{index-3esx8tkf.js → index-t7hx3qcb.js} +318 -104
- package/dist/{index-rpxdjkm0.js → index-v7r4td4c.js} +306 -59
- package/dist/{index-2vxtcb95.js → index-vkc1ca9p.js} +2 -2
- package/dist/{index-9zcsy3hh.js → index-x4k3f4mf.js} +17 -9
- package/dist/{index-bp5083x2.js → index-x9k3mqrf.js} +1 -1
- package/dist/{index-n37sebck.js → index-y4a3nhtk.js} +1 -1
- package/dist/index.js +52 -49
- package/dist/{logger-jm3sqqzr.js → logger-94kew5wm.js} +1 -1
- package/dist/{message-fts-rowid-map-17s0dfn4.js → message-fts-rowid-map-22tevnnj.js} +6 -5
- package/dist/{message-index-gtpqnj8w.js → message-index-5qxcz6h7.js} +16 -15
- package/dist/{message-index-bounded-zyc8h32y.js → message-index-bounded-n0m0t7tv.js} +16 -15
- package/dist/{message-time-backfill-73mmm76q.js → message-time-backfill-0myx7fz3.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 +3 -1
- package/dist/plugin/embedding-bootstrap.d.ts.map +1 -1
- 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/{project-embedding-registry-z74mhqkf.js → project-embedding-registry-s2pqgec9.js} +13 -12
- package/dist/raw-ordinal-warmup-worker.js +136 -101
- package/dist/{read-session-chunk-jjb48bt9.js → read-session-chunk-0a8vdyqp.js} +11 -10
- package/dist/{read-session-raw-rsc8c7qy.js → read-session-raw-y5cszf0b.js} +4 -3
- package/dist/recomp-orchestrator-61vyha9j.js +62 -0
- package/dist/{safe-notification-target-1szv1k5k.js → safe-notification-target-mkr9yzvr.js} +2 -2
- package/dist/{search-archive-6vm0e2f5.js → search-archive-8q9s49p5.js} +12 -11
- package/dist/{search-xsqk1bj4.js → search-v1y9ejws.js} +25 -24
- package/dist/{send-session-notification-6ve0e8p4.js → send-session-notification-0k6qzydk.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 +1 -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/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-1rpvw2rj.js} +1 -1
- package/dist/{storage-memory-y3qmy00r.js → storage-memory-nm7v82mj.js} +2 -2
- package/dist/{storage-tags-r7k9tjcv.js → storage-tags-r6nk29n4.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/{transform-postprocess-phase-jj99r7z2.js → transform-postprocess-phase-vtrgb7m6.js} +34 -31
- 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-cfab70cs.js} +3 -3
- package/dist/v2/compaction-marker-candidates-worker.js +2 -2
- package/dist/v2/compartment-chunk-embedding-nbdqx1td.js +64 -0
- package/dist/v2/{context-y5yamxak.js → context-cc33tv2z.js} +1189 -386
- package/dist/v2/{derive-budgets-2zh4gm2c.js → derive-budgets-knf763tt.js} +3 -3
- package/dist/v2/embedding-backfill-yxv2h5mc.js +24 -0
- package/dist/v2/embedding-worker-process.js +2 -2
- package/dist/v2/embedding-worker.js +5 -5
- 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/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/{logger-7qt02bnb.js → logger-p34mjtja.js} +1 -1
- package/dist/v2/{message-fts-rowid-map-wfx67gfd.js → message-fts-rowid-map-dg12wymk.js} +6 -5
- package/dist/v2/{message-index-bounded-spd8r7pj.js → message-index-bounded-f4e01xk0.js} +16 -15
- package/dist/v2/{message-index-8vz2pq76.js → message-index-ydzrp6y6.js} +16 -15
- package/dist/v2/{message-time-backfill-04t0km1z.js → message-time-backfill-ddh8n9gy.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-deza9ksw.js} +13 -12
- package/dist/v2/raw-ordinal-warmup-worker.js +136 -101
- package/dist/v2/{read-session-chunk-cwkxrmns.js → read-session-chunk-8cxfagky.js} +11 -10
- package/dist/v2/{read-session-raw-yaegtjzh.js → read-session-raw-1nrrecvx.js} +4 -3
- package/dist/v2/recomp-orchestrator-47m4hv5g.js +61 -0
- package/dist/v2/{safe-notification-target-qg7n2s77.js → safe-notification-target-khnzg57c.js} +2 -2
- package/dist/v2/{search-archive-wve3tq1k.js → search-archive-e80cvc09.js} +12 -11
- package/dist/v2/{search-hwg7jfbj.js → search-fjz746zr.js} +25 -24
- package/dist/v2/{send-session-notification-3pxn658x.js → send-session-notification-nwvrv34d.js} +7 -6
- package/dist/v2/{server-8by8qfec.js → server-0epqaxhd.js} +75 -57
- package/dist/v2/{server-pwv4ezb0.js → server-168pb207.js} +1 -1
- package/dist/v2/{server-h0410h0v.js → server-1bw1wcbp.js} +1 -1
- package/dist/v2/{server-beht37jy.js → server-1zx2pa5d.js} +1 -1
- package/dist/v2/{server-a9xqj88f.js → server-230fnbws.js} +4 -4
- package/dist/v2/{server-tbe1femw.js → server-29qp8nz4.js} +1 -1
- package/dist/v2/{server-tgnbmwah.js → server-3mz2qh5a.js} +1 -1
- package/dist/v2/{server-hy3d3vsx.js → server-4nw4fqhr.js} +2 -2
- package/dist/v2/{server-45q69hkq.js → server-4sxjs6hn.js} +5 -5
- package/dist/v2/{server-34kwfsr4.js → server-53eh1r8r.js} +2 -2
- package/dist/v2/{server-xj136kt8.js → server-55rgxfrw.js} +9 -3
- package/dist/v2/{server-nj659894.js → server-5arr9ecn.js} +2 -2
- package/dist/{index-8cd2j99z.js → v2/server-5kym00ag.js} +32 -13
- package/dist/v2/{server-2ar62dyx.js → server-63fqdghs.js} +106 -20
- package/dist/v2/{server-f2xf5gcb.js → server-6495nmn9.js} +12 -15
- package/dist/v2/{server-qd11g795.js → server-92g7d776.js} +2 -1
- package/dist/v2/{server-xq7dfjke.js → server-9x0kmta4.js} +5 -5
- package/dist/v2/{server-27gq4mfz.js → server-a3dwxfgd.js} +4 -4
- package/dist/v2/{server-6tmj0s7j.js → server-af2pght7.js} +3 -3
- package/dist/v2/{server-1wy7b9de.js → server-br1x0tev.js} +3 -3
- package/dist/v2/{server-n1prf1g6.js → server-brj8j2gk.js} +2 -2
- package/dist/v2/{server-6vdzn1td.js → server-c7dxxsj7.js} +308 -61
- package/dist/v2/server-cpjk5jd2.js +82 -0
- package/dist/v2/{server-g3qma5c0.js → server-dj7tz4ph.js} +2 -2
- package/dist/v2/{server-9hx7g5jp.js → server-ej96a39v.js} +17 -9
- package/dist/v2/{server-6pmqg9m4.js → server-gyy4k6mf.js} +1 -1
- package/dist/v2/{server-bmymkx73.js → server-hqzyq8n4.js} +11 -11
- package/dist/v2/{server-h1v0pyxb.js → server-j4jnp9b5.js} +468 -18
- package/dist/v2/{server-da07v4xp.js → server-k3t06fxr.js} +1 -1
- package/dist/v2/{server-gsxjv2q2.js → server-m91f9m5s.js} +69 -17
- package/dist/v2/{server-rmygf5pn.js → server-ne8arh8t.js} +2 -2
- package/dist/v2/{server-hm38q7r0.js → server-vn2nwcv6.js} +5 -5
- package/dist/v2/{server-46neh5fa.js → server-wyawsa88.js} +314 -127
- package/dist/v2/{server-zzkj2fch.js → server-xsryvyf6.js} +4 -4
- package/dist/v2/{server-n37sebck.js → server-y4a3nhtk.js} +1 -1
- package/dist/v2/{server-d04vrx0j.js → server-ygtykank.js} +2 -2
- package/dist/v2/server.js +6 -6
- package/dist/v2/{sqlite-zf72c52d.js → sqlite-1rpvw2rj.js} +1 -1
- package/dist/v2/{storage-memory-y3qmy00r.js → storage-memory-nm7v82mj.js} +2 -2
- package/dist/v2/{storage-tags-3wdb8zph.js → storage-tags-ss08kj5r.js} +5 -5
- package/dist/v2/store-reader.d.ts +8 -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-639whfhq.js} +32 -31
- package/dist/wrapup-orchestrator-mnvt2g8m.js +49 -0
- package/package.json +1 -1
- package/src/config/index.test.ts +28 -6
- 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 +1 -1
- 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.ts +4 -2
- package/src/shared/subagent-runner.ts +2 -0
- 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/v2/embedding-backfill-7c7yr69y.js +0 -23
- package/dist/v2/recomp-orchestrator-f6m9jr7p.js +0 -60
- package/dist/wrapup-orchestrator-whhbjmaz.js +0 -48
|
@@ -97,7 +97,7 @@ import {
|
|
|
97
97
|
getRawSessionTagKeysThrough2,
|
|
98
98
|
getLegacyProtectedTailStartOrdinal2,
|
|
99
99
|
readSessionChunk2
|
|
100
|
-
} from "./index-
|
|
100
|
+
} from "./index-x4k3f4mf.js";
|
|
101
101
|
import {
|
|
102
102
|
getHarness2,
|
|
103
103
|
harnessOwnsOpenCodeStore2
|
|
@@ -111,7 +111,7 @@ import {
|
|
|
111
111
|
sanitizeDiagnosticText,
|
|
112
112
|
log2,
|
|
113
113
|
sessionLog2
|
|
114
|
-
} from "./index-
|
|
114
|
+
} from "./index-h7tgn49j.js";
|
|
115
115
|
import {
|
|
116
116
|
createScanner,
|
|
117
117
|
parseTree,
|
|
@@ -134,7 +134,7 @@ import {
|
|
|
134
134
|
deriveTriggerBudget2,
|
|
135
135
|
resolveHistorianProducerLimits2,
|
|
136
136
|
producerSourceLocalBudget2
|
|
137
|
-
} from "./index-
|
|
137
|
+
} from "./index-spwjbkc7.js";
|
|
138
138
|
import {
|
|
139
139
|
withContentLanguageDirective,
|
|
140
140
|
buildPrimaryLanguageDirective,
|
|
@@ -157,14 +157,14 @@ import {
|
|
|
157
157
|
hasMeaningfulUserText2,
|
|
158
158
|
estimateTokens,
|
|
159
159
|
estimateFixedPromptTokens
|
|
160
|
-
} from "./index-
|
|
160
|
+
} from "./index-b88dwwrh.js";
|
|
161
161
|
import {
|
|
162
162
|
FAIL_CLOSED_DOCTOR_COMMAND,
|
|
163
163
|
getSchemaFenceRejection,
|
|
164
164
|
LATEST_SUPPORTED_VERSION,
|
|
165
165
|
getPersistedSchemaVersion,
|
|
166
166
|
openDatabase
|
|
167
|
-
} from "./index-
|
|
167
|
+
} from "./index-rmd0069m.js";
|
|
168
168
|
import {
|
|
169
169
|
inRootAsyncContext2,
|
|
170
170
|
Database2,
|
|
@@ -172,20 +172,20 @@ import {
|
|
|
172
172
|
withSqliteBackgroundWriter2,
|
|
173
173
|
withoutSqliteTransformPass2,
|
|
174
174
|
beginSqliteWriterAsync2
|
|
175
|
-
} from "./index-
|
|
175
|
+
} from "./index-1zx2pa5d.js";
|
|
176
176
|
import {
|
|
177
177
|
shouldSkipHomeProjectMemory,
|
|
178
178
|
resolveProjectIdentity
|
|
179
|
-
} from "./index-
|
|
179
|
+
} from "./index-vkc1ca9p.js";
|
|
180
180
|
import {
|
|
181
181
|
isPidAlive
|
|
182
|
-
} from "./index-
|
|
182
|
+
} from "./index-c7phnbvk.js";
|
|
183
183
|
import {
|
|
184
184
|
isStrictGapHealingMessage2,
|
|
185
185
|
noteRawSessionSummaryRowWritten2,
|
|
186
186
|
RawOrdinalsNotReady2,
|
|
187
187
|
runSessionWarmupWorker
|
|
188
|
-
} from "./index-
|
|
188
|
+
} from "./index-35qc6606.js";
|
|
189
189
|
import {
|
|
190
190
|
layoutLkgPrefix,
|
|
191
191
|
assembleLkgPrefix,
|
|
@@ -196,10 +196,10 @@ import {
|
|
|
196
196
|
resolveStoredPathWorkspaceIdentity,
|
|
197
197
|
sourceNameForMemory,
|
|
198
198
|
computeWorkspaceEpochFingerprint
|
|
199
|
-
} from "./index-
|
|
199
|
+
} from "./index-pnjwa6qa.js";
|
|
200
200
|
import {
|
|
201
201
|
getTableColumnNames
|
|
202
|
-
} from "./index-
|
|
202
|
+
} from "./index-x9k3mqrf.js";
|
|
203
203
|
import {
|
|
204
204
|
V2_MEMORY_CATEGORIES,
|
|
205
205
|
CATEGORY_PRIORITY,
|
|
@@ -213,7 +213,7 @@ import {
|
|
|
213
213
|
} from "./index-58e3y90n.js";
|
|
214
214
|
import {
|
|
215
215
|
getMeasuredToolDefinitionTokens
|
|
216
|
-
} from "./index-
|
|
216
|
+
} from "./index-j76ah6d7.js";
|
|
217
217
|
import {
|
|
218
218
|
invalidateAutoEmbedSession,
|
|
219
219
|
drainBackgroundBatches,
|
|
@@ -222,17 +222,17 @@ import {
|
|
|
222
222
|
getProjectChunkEmbeddingModelId2,
|
|
223
223
|
getProjectEmbeddingMaxInputTokens2,
|
|
224
224
|
embedItemsForProject2
|
|
225
|
-
} from "./index-
|
|
225
|
+
} from "./index-2yhtnfcf.js";
|
|
226
226
|
import {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
} from "./index-
|
|
227
|
+
buildCanonicalChunkTextFromFts2,
|
|
228
|
+
buildCompartmentSummaryFallbackText2,
|
|
229
|
+
canonicalizeInMemoryChunkTextForEmbedding2,
|
|
230
|
+
chunkCanonicalText2,
|
|
231
|
+
chunkEmbeddingWindowsAreCurrent2,
|
|
232
|
+
replaceCompartmentChunkEmbeddings2,
|
|
233
|
+
deleteChunkEmbedBackoffForSession2,
|
|
234
|
+
chunkWindowSourceKey2
|
|
235
|
+
} from "./index-153r2q6z.js";
|
|
236
236
|
import {
|
|
237
237
|
BoundedSessionMap,
|
|
238
238
|
clearCompressionDepth,
|
|
@@ -249,7 +249,7 @@ import {
|
|
|
249
249
|
toMessageIndexSource2,
|
|
250
250
|
clearIndexedMessagesInTransaction2,
|
|
251
251
|
indexSourcesAfterOrdinal2
|
|
252
|
-
} from "./index-
|
|
252
|
+
} from "./index-48stjd56.js";
|
|
253
253
|
import {
|
|
254
254
|
stripWellFormedLeadingTagPrefix,
|
|
255
255
|
stripTagPrefix,
|
|
@@ -262,12 +262,12 @@ import {
|
|
|
262
262
|
foldShrunkPartTags2,
|
|
263
263
|
getTagNumberByMessageId2,
|
|
264
264
|
getActiveTagsBySession2
|
|
265
|
-
} from "./index-
|
|
265
|
+
} from "./index-305y133n.js";
|
|
266
266
|
import {
|
|
267
267
|
openCodeDbExists,
|
|
268
268
|
withReadOnlySessionDb,
|
|
269
269
|
getMessageTimesFromOpenCodeDb
|
|
270
|
-
} from "./index-
|
|
270
|
+
} from "./index-11zf2wwc.js";
|
|
271
271
|
import {
|
|
272
272
|
renderUserFacingFailure,
|
|
273
273
|
userFacingFailureCode,
|
|
@@ -276,7 +276,7 @@ import {
|
|
|
276
276
|
insertPrimerCandidates,
|
|
277
277
|
promoteSessionFactsDurable,
|
|
278
278
|
embedPromotedFacts
|
|
279
|
-
} from "./index-
|
|
279
|
+
} from "./index-1pefp8ar.js";
|
|
280
280
|
import {
|
|
281
281
|
pushNotification2
|
|
282
282
|
} from "./index-x8a7jmkh.js";
|
|
@@ -287,16 +287,16 @@ import {
|
|
|
287
287
|
getMemoriesByProject2,
|
|
288
288
|
getMemoriesByProjects2,
|
|
289
289
|
getMaxMemoryIdForProjects2
|
|
290
|
-
} from "./index-
|
|
290
|
+
} from "./index-y4a3nhtk.js";
|
|
291
291
|
import {
|
|
292
292
|
isMarkerCandidateBasisCurrent2,
|
|
293
293
|
invalidateMarkerCandidateBasis2,
|
|
294
294
|
readMarkerCandidateBasis2,
|
|
295
295
|
prepareMarkerCandidateBasis2
|
|
296
|
-
} from "./index-
|
|
296
|
+
} from "./index-616rsjrv.js";
|
|
297
297
|
import {
|
|
298
298
|
sendStatusNotification2
|
|
299
|
-
} from "./index-
|
|
299
|
+
} from "./index-kc9pn495.js";
|
|
300
300
|
import {
|
|
301
301
|
isCompactionEnabled,
|
|
302
302
|
migrateLegacyAgentEnabledInMemory
|
|
@@ -314,7 +314,7 @@ import {
|
|
|
314
314
|
import {
|
|
315
315
|
logSlowWriteTransaction,
|
|
316
316
|
WriteTransactionSteps
|
|
317
|
-
} from "./index-
|
|
317
|
+
} from "./index-t5pck3ss.js";
|
|
318
318
|
import {
|
|
319
319
|
ensureStorageDirectorySync,
|
|
320
320
|
writeStorageFileAtomicSync
|
|
@@ -9032,7 +9032,7 @@ async function promptWithTimeout(client, args, timeoutMs, signal, transport, fir
|
|
|
9032
9032
|
if (!activity.monitored || activity.received)
|
|
9033
9033
|
return;
|
|
9034
9034
|
silent = true;
|
|
9035
|
-
controller.abort();
|
|
9035
|
+
controller.abort(new ModelProducedNoOutputError(firstOutputTimeoutMs));
|
|
9036
9036
|
}, firstOutputTimeoutMs) : undefined;
|
|
9037
9037
|
const timeoutError = () => silent && firstOutputTimeoutMs !== undefined ? new ModelProducedNoOutputError(firstOutputTimeoutMs) : new Error(`prompt timed out after ${timeoutMs}ms`);
|
|
9038
9038
|
const onExternalAbort = () => controller.abort();
|
|
@@ -9445,6 +9445,152 @@ function normalizeSDKResponse(response, fallback, options) {
|
|
|
9445
9445
|
return fallback;
|
|
9446
9446
|
}
|
|
9447
9447
|
// src/features/magic-context/subagent-token-capture.ts
|
|
9448
|
+
var warnedUnknownModels = new Set;
|
|
9449
|
+
var loggedModelReroutes = new Set;
|
|
9450
|
+
var MAX_SUBAGENT_INVOCATION_ERROR_CHARS = 1000;
|
|
9451
|
+
var invocationErrorDetails = new WeakMap;
|
|
9452
|
+
function annotateSubagentInvocationError(error, details) {
|
|
9453
|
+
if (error && typeof error === "object") {
|
|
9454
|
+
const previous = invocationErrorDetails.get(error) ?? {};
|
|
9455
|
+
invocationErrorDetails.set(error, {
|
|
9456
|
+
...previous,
|
|
9457
|
+
...details,
|
|
9458
|
+
hostError: details.hostError ?? previous.hostError
|
|
9459
|
+
});
|
|
9460
|
+
}
|
|
9461
|
+
return error;
|
|
9462
|
+
}
|
|
9463
|
+
function errorDetailsOf(error) {
|
|
9464
|
+
const seen = new Set;
|
|
9465
|
+
const visit = (value, depth) => {
|
|
9466
|
+
if (!value || typeof value !== "object" || depth > 4 || seen.has(value))
|
|
9467
|
+
return {};
|
|
9468
|
+
seen.add(value);
|
|
9469
|
+
const direct = invocationErrorDetails.get(value) ?? {};
|
|
9470
|
+
const record = value;
|
|
9471
|
+
const nested = visit(record.hostError, depth + 1);
|
|
9472
|
+
const cause = visit(record.cause, depth + 1);
|
|
9473
|
+
return {
|
|
9474
|
+
...cause,
|
|
9475
|
+
...nested,
|
|
9476
|
+
...direct,
|
|
9477
|
+
hostError: direct.hostError ?? nested.hostError ?? cause.hostError ?? record.hostError
|
|
9478
|
+
};
|
|
9479
|
+
};
|
|
9480
|
+
return visit(error, 0);
|
|
9481
|
+
}
|
|
9482
|
+
function modelRef(value) {
|
|
9483
|
+
const reference = typeof value === "string" ? value : value?.model;
|
|
9484
|
+
return typeof reference === "string" && reference.trim().length > 0 ? reference.trim() : undefined;
|
|
9485
|
+
}
|
|
9486
|
+
function splitModelRef(value) {
|
|
9487
|
+
if (!value)
|
|
9488
|
+
return { providerId: null, modelId: null };
|
|
9489
|
+
const slash = value.indexOf("/");
|
|
9490
|
+
return slash > 0 && slash < value.length - 1 ? { providerId: value.slice(0, slash), modelId: value.slice(slash + 1) } : { providerId: null, modelId: value };
|
|
9491
|
+
}
|
|
9492
|
+
function cleanOneLine(value) {
|
|
9493
|
+
const oneLine = sanitizeDiagnosticText(value).replaceAll("\r", " ").replaceAll(`
|
|
9494
|
+
`, " ").replaceAll("\t", " ").replace(/\s+/g, " ").trim();
|
|
9495
|
+
return oneLine.length <= MAX_SUBAGENT_INVOCATION_ERROR_CHARS ? oneLine : `${oneLine.slice(0, MAX_SUBAGENT_INVOCATION_ERROR_CHARS - 1)}…`;
|
|
9496
|
+
}
|
|
9497
|
+
function recordMessage(error) {
|
|
9498
|
+
if (typeof error === "string")
|
|
9499
|
+
return error;
|
|
9500
|
+
if (!error || typeof error !== "object")
|
|
9501
|
+
return String(error ?? "");
|
|
9502
|
+
const record = error;
|
|
9503
|
+
const data = record.data && typeof record.data === "object" ? record.data : undefined;
|
|
9504
|
+
const message = typeof data?.message === "string" ? data.message : typeof record.message === "string" ? record.message : typeof record.description === "string" ? record.description : "";
|
|
9505
|
+
const name = typeof record.name === "string" ? record.name : typeof record.type === "string" ? record.type : "";
|
|
9506
|
+
return [name, message].filter(Boolean).join(": ") || "The host reported an error without a message.";
|
|
9507
|
+
}
|
|
9508
|
+
function modelNotFoundDetail(error, attemptedModel) {
|
|
9509
|
+
const seen = new Set;
|
|
9510
|
+
const visit = (value, depth) => {
|
|
9511
|
+
if (typeof value === "string") {
|
|
9512
|
+
const modelMatch = value.match(/model not found:\s*(.+?)(?=(?:\.?\s*did you mean|$))/i);
|
|
9513
|
+
if (!modelMatch)
|
|
9514
|
+
return null;
|
|
9515
|
+
const model = modelMatch[1].trim().replace(/[.,;(]+$/, "");
|
|
9516
|
+
const suggestion = value.match(/did you mean:?\s*\(?\s*([^?);]+)/i)?.[1]?.trim();
|
|
9517
|
+
const message = `Model not found: ${model}${suggestion ? ` (did you mean ${suggestion}?)` : ""}`;
|
|
9518
|
+
return { model, ...suggestion ? { suggestion } : {}, message };
|
|
9519
|
+
}
|
|
9520
|
+
if (!value || typeof value !== "object" || depth > 4 || seen.has(value))
|
|
9521
|
+
return null;
|
|
9522
|
+
seen.add(value);
|
|
9523
|
+
const record = value;
|
|
9524
|
+
const data = record.data && typeof record.data === "object" ? record.data : undefined;
|
|
9525
|
+
const modelRecord = data?.model ?? record.model;
|
|
9526
|
+
const modelId = (typeof data?.modelID === "string" ? data.modelID : undefined) ?? (typeof modelRecord?.modelID === "string" ? modelRecord.modelID : undefined) ?? (typeof modelRecord?.id === "string" ? modelRecord.id : undefined);
|
|
9527
|
+
const providerId = (typeof data?.providerID === "string" ? data.providerID : undefined) ?? (typeof modelRecord?.providerID === "string" ? modelRecord.providerID : undefined);
|
|
9528
|
+
const suggestions = data?.suggestions;
|
|
9529
|
+
const suggestion = Array.isArray(suggestions) && typeof suggestions[0] === "string" ? suggestions[0] : typeof data?.suggestion === "string" ? data.suggestion : undefined;
|
|
9530
|
+
const rawMessage = recordMessage(value);
|
|
9531
|
+
const fromMessage = visit(rawMessage, depth + 1);
|
|
9532
|
+
if (fromMessage)
|
|
9533
|
+
return fromMessage.suggestion || !suggestion ? fromMessage : {
|
|
9534
|
+
...fromMessage,
|
|
9535
|
+
suggestion,
|
|
9536
|
+
message: `Model not found: ${fromMessage.model} (did you mean ${suggestion}?)`
|
|
9537
|
+
};
|
|
9538
|
+
const name = `${String(record.name ?? "")} ${String(record.type ?? "")}`;
|
|
9539
|
+
if (/ProviderModelNotFoundError|model not found/i.test(name) && modelId) {
|
|
9540
|
+
const model = providerId ? `${providerId}/${modelId}` : modelId;
|
|
9541
|
+
const detail = `Model not found: ${model}${suggestion ? ` (did you mean ${suggestion}?)` : ""}`;
|
|
9542
|
+
return { model, ...suggestion ? { suggestion } : {}, message: detail };
|
|
9543
|
+
}
|
|
9544
|
+
for (const key of ["data", "error", "cause", "hostError"]) {
|
|
9545
|
+
const match = visit(record[key], depth + 1);
|
|
9546
|
+
if (match)
|
|
9547
|
+
return match;
|
|
9548
|
+
}
|
|
9549
|
+
return null;
|
|
9550
|
+
};
|
|
9551
|
+
const found = visit(error, 0);
|
|
9552
|
+
if (!found && attemptedModel && (typeof error === "string" && /ProviderModelNotFoundError/i.test(error) || error !== null && typeof error === "object" && /ProviderModelNotFoundError/i.test(`${String(error.name ?? "")} ${String(error.type ?? "")}`))) {
|
|
9553
|
+
return { model: attemptedModel, message: `Model not found: ${attemptedModel}` };
|
|
9554
|
+
}
|
|
9555
|
+
return found;
|
|
9556
|
+
}
|
|
9557
|
+
function hostLabel(harness) {
|
|
9558
|
+
switch (harness) {
|
|
9559
|
+
case "opencode2":
|
|
9560
|
+
return "OpenCode 2";
|
|
9561
|
+
case "opencode":
|
|
9562
|
+
return "OpenCode";
|
|
9563
|
+
case "pi":
|
|
9564
|
+
return "Pi";
|
|
9565
|
+
case "omp":
|
|
9566
|
+
return "Oh My Pi";
|
|
9567
|
+
}
|
|
9568
|
+
}
|
|
9569
|
+
function invocationErrorText(input, details, attemptedModel) {
|
|
9570
|
+
if (input.error == null && input.hostError == null && details.hostError == null)
|
|
9571
|
+
return null;
|
|
9572
|
+
const rawHostError = input.hostError ?? details.hostError;
|
|
9573
|
+
const modelError = modelNotFoundDetail(rawHostError ?? input.error, attemptedModel);
|
|
9574
|
+
if (modelError) {
|
|
9575
|
+
return cleanOneLine(`No reply: ${hostLabel(input.harness)} refused the model: ${modelError.message}`);
|
|
9576
|
+
}
|
|
9577
|
+
if (rawHostError != null) {
|
|
9578
|
+
return cleanOneLine(`No reply: ${hostLabel(input.harness)} reported a child-session error: ${recordMessage(rawHostError)}`);
|
|
9579
|
+
}
|
|
9580
|
+
return cleanOneLine(describeError(input.error).brief);
|
|
9581
|
+
}
|
|
9582
|
+
function warnUnknownModel(input, details, attemptedModel, modelConfigKey) {
|
|
9583
|
+
if (!attemptedModel)
|
|
9584
|
+
return;
|
|
9585
|
+
const issue = modelNotFoundDetail(input.hostError ?? details.hostError ?? input.error, attemptedModel);
|
|
9586
|
+
if (!issue || warnedUnknownModels.has(attemptedModel))
|
|
9587
|
+
return;
|
|
9588
|
+
if (!modelConfigKey)
|
|
9589
|
+
return;
|
|
9590
|
+
warnedUnknownModels.add(attemptedModel);
|
|
9591
|
+
const suggestion = issue.suggestion ? `provider suggests ${cleanOneLine(issue.suggestion)}` : "provider gave no model suggestion";
|
|
9592
|
+
log2(`[magic-context] WARNING: ${modelConfigKey} configured ${attemptedModel}, but ${hostLabel(input.harness)} does not know that model; ${suggestion}`);
|
|
9593
|
+
}
|
|
9448
9594
|
function asNumber(value) {
|
|
9449
9595
|
return typeof value === "number" && Number.isFinite(value) ? value : 0;
|
|
9450
9596
|
}
|
|
@@ -9515,8 +9661,11 @@ function sumTokensFromChildMessages(messages) {
|
|
|
9515
9661
|
function findLastAssistantModel(messages) {
|
|
9516
9662
|
for (let index = messages.length - 1;index >= 0; index -= 1) {
|
|
9517
9663
|
const message = messages[index];
|
|
9518
|
-
if (isAssistantMessage(message))
|
|
9519
|
-
|
|
9664
|
+
if (isAssistantMessage(message)) {
|
|
9665
|
+
const model = modelFromMessage(message);
|
|
9666
|
+
if (model.providerId || model.modelId)
|
|
9667
|
+
return model;
|
|
9668
|
+
}
|
|
9520
9669
|
}
|
|
9521
9670
|
return { providerId: null, modelId: null };
|
|
9522
9671
|
}
|
|
@@ -9525,10 +9674,25 @@ function recordChildInvocation(input) {
|
|
|
9525
9674
|
return null;
|
|
9526
9675
|
const tokens = input.tokens ?? sumTokensFromChildMessages(input.messages ?? []);
|
|
9527
9676
|
const observedModel = findLastAssistantModel(input.messages ?? []);
|
|
9677
|
+
const details = errorDetailsOf(input.error);
|
|
9678
|
+
const attemptedModel = details.attemptedModel ?? modelRef(input.attemptedModel);
|
|
9679
|
+
const attemptConfig = [input.attemptedModel, ...input.configuredModels ?? []].find((candidate) => modelRef(candidate) === attemptedModel);
|
|
9680
|
+
const modelConfigKey = details.modelConfigKey ?? input.modelConfigKey ?? (typeof attemptConfig === "object" ? attemptConfig?.sourceConfigKey : undefined);
|
|
9681
|
+
const attemptedParts = splitModelRef(attemptedModel);
|
|
9528
9682
|
const model = {
|
|
9529
|
-
providerId: input.providerId ??
|
|
9530
|
-
modelId: input.modelId ??
|
|
9683
|
+
providerId: observedModel.providerId ?? input.providerId ?? attemptedParts.providerId,
|
|
9684
|
+
modelId: observedModel.modelId ?? input.modelId ?? attemptedParts.modelId
|
|
9531
9685
|
};
|
|
9686
|
+
const reportedModelRef = observedModel.providerId && observedModel.modelId ? `${observedModel.providerId}/${observedModel.modelId}` : input.providerId && input.modelId ? `${input.providerId}/${input.modelId}` : undefined;
|
|
9687
|
+
if (attemptedModel && reportedModelRef && attemptedModel !== reportedModelRef && (observedModel.providerId !== null || input.providerId !== undefined)) {
|
|
9688
|
+
const rerouteKey = `${input.harness}\x00${attemptedModel}\x00${reportedModelRef}`;
|
|
9689
|
+
if (!loggedModelReroutes.has(rerouteKey)) {
|
|
9690
|
+
loggedModelReroutes.add(rerouteKey);
|
|
9691
|
+
sessionLog2(input.parentSessionId, `subagent model rerouted by host: attempted=${attemptedModel} reported=${reportedModelRef}`);
|
|
9692
|
+
}
|
|
9693
|
+
}
|
|
9694
|
+
warnUnknownModel(input, details, attemptedModel, modelConfigKey);
|
|
9695
|
+
const errorText = invocationErrorText(input, details, attemptedModel);
|
|
9532
9696
|
try {
|
|
9533
9697
|
return recordSubagentInvocation(input.db, {
|
|
9534
9698
|
sessionId: input.parentSessionId,
|
|
@@ -9544,7 +9708,7 @@ function recordChildInvocation(input) {
|
|
|
9544
9708
|
outputTokens: tokens.output,
|
|
9545
9709
|
cacheReadTokens: tokens.cacheRead,
|
|
9546
9710
|
cacheWriteTokens: tokens.cacheWrite,
|
|
9547
|
-
error:
|
|
9711
|
+
error: errorText,
|
|
9548
9712
|
parentInvocationId: input.parentInvocationId ?? null
|
|
9549
9713
|
});
|
|
9550
9714
|
} catch (error) {
|
|
@@ -9578,6 +9742,17 @@ var HOST_SESSION_ERROR = Symbol("promptAsyncHostSessionError");
|
|
|
9578
9742
|
function isHostSessionError(error) {
|
|
9579
9743
|
return error !== null && typeof error === "object" && error[HOST_SESSION_ERROR] === true;
|
|
9580
9744
|
}
|
|
9745
|
+
function hostSessionErrorOf(error) {
|
|
9746
|
+
if (!isHostSessionError(error))
|
|
9747
|
+
return;
|
|
9748
|
+
return error.hostError;
|
|
9749
|
+
}
|
|
9750
|
+
function requestModelRef(request) {
|
|
9751
|
+
const model = request.body?.model;
|
|
9752
|
+
if (model && typeof model.providerID === "string" && typeof model.modelID === "string")
|
|
9753
|
+
return `${model.providerID}/${model.modelID}`;
|
|
9754
|
+
return;
|
|
9755
|
+
}
|
|
9581
9756
|
function supportsPromptAsync(client) {
|
|
9582
9757
|
const session = sessionApi(client);
|
|
9583
9758
|
return typeof session?.promptAsync === "function" && typeof session?.status === "function" && typeof session?.messages === "function";
|
|
@@ -9732,11 +9907,29 @@ async function promptAsyncAndWaitForIdle(client, request, options = {}) {
|
|
|
9732
9907
|
const initialBaseline = new Set(completionBaseline);
|
|
9733
9908
|
activeSessionErrors.set(sessionId, undefined);
|
|
9734
9909
|
try {
|
|
9735
|
-
|
|
9910
|
+
let sent;
|
|
9911
|
+
try {
|
|
9912
|
+
sent = await session.promptAsync?.(request);
|
|
9913
|
+
} catch (error) {
|
|
9914
|
+
annotateSubagentInvocationError(error, {
|
|
9915
|
+
attemptedModel: requestModelRef(request),
|
|
9916
|
+
modelConfigKey: options.modelConfigKey,
|
|
9917
|
+
hostError: error
|
|
9918
|
+
});
|
|
9919
|
+
throw error;
|
|
9920
|
+
}
|
|
9736
9921
|
if (sent && typeof sent === "object" && "error" in sent) {
|
|
9737
9922
|
const rejection = sent.error;
|
|
9738
9923
|
if (rejection) {
|
|
9739
|
-
|
|
9924
|
+
const error = new Error(`prompt_async was rejected: ${describeRejection(rejection)}`, {
|
|
9925
|
+
cause: rejection
|
|
9926
|
+
});
|
|
9927
|
+
annotateSubagentInvocationError(error, {
|
|
9928
|
+
attemptedModel: requestModelRef(request),
|
|
9929
|
+
modelConfigKey: options.modelConfigKey,
|
|
9930
|
+
hostError: rejection
|
|
9931
|
+
});
|
|
9932
|
+
throw error;
|
|
9740
9933
|
}
|
|
9741
9934
|
}
|
|
9742
9935
|
let sentAt = Date.now();
|
|
@@ -9751,7 +9944,13 @@ async function promptAsyncAndWaitForIdle(client, request, options = {}) {
|
|
|
9751
9944
|
Object.assign(error, {
|
|
9752
9945
|
name: "DreamerProviderOutputFailureError",
|
|
9753
9946
|
transient: true,
|
|
9754
|
-
[HOST_SESSION_ERROR]: true
|
|
9947
|
+
[HOST_SESSION_ERROR]: true,
|
|
9948
|
+
hostError
|
|
9949
|
+
});
|
|
9950
|
+
annotateSubagentInvocationError(error, {
|
|
9951
|
+
attemptedModel: requestModelRef(request),
|
|
9952
|
+
modelConfigKey: options.modelConfigKey,
|
|
9953
|
+
hostError
|
|
9755
9954
|
});
|
|
9756
9955
|
throw error;
|
|
9757
9956
|
}
|
|
@@ -17274,6 +17473,8 @@ function resolveHiddenCompletionExecutor(executor, client, db, directory, entryP
|
|
|
17274
17473
|
}
|
|
17275
17474
|
function createV1HiddenCompletionExecutor(client, db, directory) {
|
|
17276
17475
|
const historianChildren = new Set;
|
|
17476
|
+
const hostErrors = new Map;
|
|
17477
|
+
const runIdentities = new Map;
|
|
17277
17478
|
return {
|
|
17278
17479
|
capabilities: { tools: true, harness: "opencode" },
|
|
17279
17480
|
async open(run) {
|
|
@@ -17290,23 +17491,49 @@ function createV1HiddenCompletionExecutor(client, db, directory) {
|
|
|
17290
17491
|
preferResponseOnMissingData: true
|
|
17291
17492
|
});
|
|
17292
17493
|
const id = typeof created?.id === "string" ? created.id : "";
|
|
17293
|
-
if (id)
|
|
17494
|
+
if (id) {
|
|
17294
17495
|
rememberV1HiddenRun(id, run);
|
|
17496
|
+
runIdentities.set(id, run);
|
|
17497
|
+
}
|
|
17295
17498
|
if (id && run.kind !== "dreamer-task") {
|
|
17296
17499
|
historianChildren.add(id);
|
|
17297
17500
|
rememberHistorianOutputCap(id, run.maxOutputTokens);
|
|
17298
17501
|
}
|
|
17299
|
-
|
|
17502
|
+
const configured = toModelEntry(run.model);
|
|
17503
|
+
return {
|
|
17504
|
+
id,
|
|
17505
|
+
childSessionId: id || undefined,
|
|
17506
|
+
...configured ? { attemptedModel: configured.model } : {},
|
|
17507
|
+
...configured?.sourceConfigKey ? { modelConfigKey: configured.sourceConfigKey } : {}
|
|
17508
|
+
};
|
|
17300
17509
|
},
|
|
17301
17510
|
async attempt(handle, request) {
|
|
17302
17511
|
if (!client)
|
|
17303
17512
|
throw new Error("Hidden completion client is unavailable");
|
|
17513
|
+
const identity = runIdentities.get(handle.id);
|
|
17514
|
+
const requestedModel = request.body?.model;
|
|
17515
|
+
const requestedRef = requestedModel && typeof requestedModel.providerID === "string" && typeof requestedModel.modelID === "string" ? `${requestedModel.providerID}/${requestedModel.modelID}` : undefined;
|
|
17516
|
+
const matchingConfigured = (identity?.configuredModels ?? []).map(toModelEntry).find((entry) => entry?.model === requestedRef);
|
|
17517
|
+
const configured = matchingConfigured ?? (requestedRef && identity?.model && toModelEntry(identity.model)?.model === requestedRef ? toModelEntry(identity.model) : toModelEntry(identity?.model));
|
|
17518
|
+
handle.attemptedModel = requestedRef ?? configured?.model ?? handle.attemptedModel;
|
|
17519
|
+
handle.modelConfigKey = configured?.sourceConfigKey ?? handle.modelConfigKey;
|
|
17304
17520
|
if (supportsPromptAsync(client)) {
|
|
17305
17521
|
try {
|
|
17306
|
-
await promptAsyncAndWaitForIdle(client, request
|
|
17522
|
+
await promptAsyncAndWaitForIdle(client, request, {
|
|
17523
|
+
modelConfigKey: handle.modelConfigKey
|
|
17524
|
+
});
|
|
17307
17525
|
} catch (error) {
|
|
17308
|
-
if (
|
|
17309
|
-
|
|
17526
|
+
if (isHostSessionError(error)) {
|
|
17527
|
+
const hostError = hostSessionErrorOf(error);
|
|
17528
|
+
hostErrors.set(handle.id, hostError);
|
|
17529
|
+
annotateSubagentInvocationError(error, {
|
|
17530
|
+
attemptedModel: handle.attemptedModel,
|
|
17531
|
+
modelConfigKey: handle.modelConfigKey,
|
|
17532
|
+
hostError
|
|
17533
|
+
});
|
|
17534
|
+
if (historianChildren.has(handle.id))
|
|
17535
|
+
return;
|
|
17536
|
+
}
|
|
17310
17537
|
throw error;
|
|
17311
17538
|
}
|
|
17312
17539
|
return;
|
|
@@ -17324,9 +17551,16 @@ function createV1HiddenCompletionExecutor(client, db, directory) {
|
|
|
17324
17551
|
preferResponseOnMissingData: true
|
|
17325
17552
|
});
|
|
17326
17553
|
const assistantFailure = extractLatestAssistantFailure(messages);
|
|
17554
|
+
const hostError = hostErrors.get(handle.id);
|
|
17327
17555
|
if (assistantFailure) {
|
|
17328
17556
|
const finish = assistantFailure.finish ? ` (finish=${assistantFailure.finish})` : "";
|
|
17329
|
-
|
|
17557
|
+
const error = new Error(`Historian host recorded an assistant error${finish}: ${describeAssistantFailure(assistantFailure.error)}`, hostError === undefined ? undefined : { cause: hostError });
|
|
17558
|
+
annotateSubagentInvocationError(error, {
|
|
17559
|
+
attemptedModel: handle.attemptedModel,
|
|
17560
|
+
modelConfigKey: handle.modelConfigKey,
|
|
17561
|
+
hostError
|
|
17562
|
+
});
|
|
17563
|
+
throw error;
|
|
17330
17564
|
}
|
|
17331
17565
|
const text = extractLatestAssistantText(messages);
|
|
17332
17566
|
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;
|
|
@@ -17337,13 +17571,18 @@ function createV1HiddenCompletionExecutor(client, db, directory) {
|
|
|
17337
17571
|
reasoning: text ? null : extractLatestHistorianReasoning(messages),
|
|
17338
17572
|
lengthCapped: hasLengthCappedOutput(messages),
|
|
17339
17573
|
usage: sumTokensFromChildMessages(messages),
|
|
17340
|
-
tokenLog: runTokenLog(info.tokens, undefined, info.finish ?? info.finish_reason ?? info.finishReason)
|
|
17574
|
+
tokenLog: runTokenLog(info.tokens, undefined, info.finish ?? info.finish_reason ?? info.finishReason),
|
|
17575
|
+
attemptedModel: handle.attemptedModel,
|
|
17576
|
+
modelConfigKey: handle.modelConfigKey,
|
|
17577
|
+
...hostError === undefined ? {} : { hostError }
|
|
17341
17578
|
};
|
|
17342
17579
|
},
|
|
17343
17580
|
async close(handle, settlement) {
|
|
17344
17581
|
if (handle?.id) {
|
|
17345
17582
|
rememberV1HiddenRun(handle.id, undefined);
|
|
17346
17583
|
historianChildren.delete(handle.id);
|
|
17584
|
+
hostErrors.delete(handle.id);
|
|
17585
|
+
runIdentities.delete(handle.id);
|
|
17347
17586
|
forgetHistorianOutputCap(handle.id);
|
|
17348
17587
|
}
|
|
17349
17588
|
if (!client)
|
|
@@ -17498,7 +17737,8 @@ async function runHistorianPrompt(args) {
|
|
|
17498
17737
|
if (invocationRecorded)
|
|
17499
17738
|
return null;
|
|
17500
17739
|
invocationRecorded = true;
|
|
17501
|
-
const
|
|
17740
|
+
const configuredModel = toModelEntry(modelOverride);
|
|
17741
|
+
const actualModelRef = completion?.providerId && completion.modelId ? `${completion.providerId}/${completion.modelId}` : handle?.attemptedModel ?? configuredModel?.model ?? null;
|
|
17502
17742
|
const usedConfiguredFallback = actualModelRef !== null && (fallbackModels ?? []).some((candidate) => toModelEntry(candidate)?.model === actualModelRef);
|
|
17503
17743
|
return recordChildInvocation({
|
|
17504
17744
|
db: openDatabase(),
|
|
@@ -17514,6 +17754,10 @@ async function runHistorianPrompt(args) {
|
|
|
17514
17754
|
providerId: completion.providerId,
|
|
17515
17755
|
modelId: completion.modelId
|
|
17516
17756
|
} : {},
|
|
17757
|
+
attemptedModel: handle?.attemptedModel ?? modelOverride,
|
|
17758
|
+
configuredModels: fallbackModels,
|
|
17759
|
+
modelConfigKey: handle?.modelConfigKey ?? configuredModel?.sourceConfigKey,
|
|
17760
|
+
hostError: params.hostError ?? completion?.hostError,
|
|
17517
17761
|
error: params.error,
|
|
17518
17762
|
parentInvocationId: agentId === HISTORIAN_EDITOR_AGENT ? parentInvocationId ?? null : null
|
|
17519
17763
|
});
|
|
@@ -17627,7 +17871,8 @@ async function runHistorianPrompt(args) {
|
|
|
17627
17871
|
const invocationId = recordInvocation({
|
|
17628
17872
|
status: emptyError ? "empty" : "completed",
|
|
17629
17873
|
messages: completion.messages,
|
|
17630
|
-
error: emptyError
|
|
17874
|
+
error: emptyError,
|
|
17875
|
+
hostError: completion.hostError
|
|
17631
17876
|
});
|
|
17632
17877
|
if (emptyError && (!reasoningResult || lengthCapped)) {
|
|
17633
17878
|
return {
|
|
@@ -17834,19 +18079,19 @@ async function embedAndStoreCompartmentChunks(db, sessionId, projectPath, compar
|
|
|
17834
18079
|
const maxInputTokens = getProjectEmbeddingMaxInputTokens2(projectPath);
|
|
17835
18080
|
for (const compartment of compartments) {
|
|
17836
18081
|
try {
|
|
17837
|
-
const fromMemory = compartment.sourceChunkText ?
|
|
17838
|
-
const mappedText = fromMemory ? fromMemory :
|
|
18082
|
+
const fromMemory = compartment.sourceChunkText ? canonicalizeInMemoryChunkTextForEmbedding2(compartment.sourceChunkText, compartment.startMessage, compartment.endMessage) : "";
|
|
18083
|
+
const mappedText = fromMemory ? fromMemory : buildCanonicalChunkTextFromFts2(db, sessionId, compartment.startMessage, compartment.endMessage);
|
|
17839
18084
|
if (mappedText === null)
|
|
17840
18085
|
continue;
|
|
17841
|
-
const canonicalText = mappedText ||
|
|
18086
|
+
const canonicalText = mappedText || buildCompartmentSummaryFallbackText2(db, compartment.id);
|
|
17842
18087
|
if (canonicalText.length === 0)
|
|
17843
18088
|
continue;
|
|
17844
|
-
const windows =
|
|
18089
|
+
const windows = chunkCanonicalText2(canonicalText, compartment.startMessage, compartment.endMessage, maxInputTokens);
|
|
17845
18090
|
if (windows.length === 0)
|
|
17846
18091
|
continue;
|
|
17847
|
-
const windowSourceKey =
|
|
18092
|
+
const windowSourceKey = chunkWindowSourceKey2(canonicalText, compartment.startMessage, compartment.endMessage, maxInputTokens);
|
|
17848
18093
|
const currentModelId = getProjectChunkEmbeddingModelId2(projectPath);
|
|
17849
|
-
if (currentModelId !== "off" &&
|
|
18094
|
+
if (currentModelId !== "off" && chunkEmbeddingWindowsAreCurrent2(db, compartment.id, currentModelId, windows, projectPath)) {
|
|
17850
18095
|
continue;
|
|
17851
18096
|
}
|
|
17852
18097
|
const result = await embedItemsForProject2(projectPath, windows.map((window) => ({
|
|
@@ -17856,7 +18101,7 @@ async function embedAndStoreCompartmentChunks(db, sessionId, projectPath, compar
|
|
|
17856
18101
|
})), undefined, db, sessionId);
|
|
17857
18102
|
if (!result)
|
|
17858
18103
|
continue;
|
|
17859
|
-
if (
|
|
18104
|
+
if (chunkEmbeddingWindowsAreCurrent2(db, compartment.id, currentModelId, windows, projectPath)) {
|
|
17860
18105
|
continue;
|
|
17861
18106
|
}
|
|
17862
18107
|
const rows = [];
|
|
@@ -17874,7 +18119,7 @@ async function embedAndStoreCompartmentChunks(db, sessionId, projectPath, compar
|
|
|
17874
18119
|
});
|
|
17875
18120
|
}
|
|
17876
18121
|
if (rows.length === windows.length) {
|
|
17877
|
-
|
|
18122
|
+
replaceCompartmentChunkEmbeddings2(db, rows, windowSourceKey);
|
|
17878
18123
|
enqueueShadowEmbeddingItems2(projectPath, "chunk", [String(compartment.id)]);
|
|
17879
18124
|
}
|
|
17880
18125
|
} catch (error) {
|
|
@@ -19327,7 +19572,8 @@ function resolveProtectedTailBoundary(ctx) {
|
|
|
19327
19572
|
break;
|
|
19328
19573
|
}
|
|
19329
19574
|
livePromptFloor.ordinal = lastMeaningfulUserOrdinal || null;
|
|
19330
|
-
|
|
19575
|
+
livePromptFloor.messageId = boundaryMessageId(index, lastMeaningfulUserOrdinal);
|
|
19576
|
+
if (!ctx.liftLivePromptFloor && lastMeaningfulUserOrdinal >= offset) {
|
|
19331
19577
|
protectedTailStart = Math.min(protectedTailStart, lastMeaningfulUserOrdinal);
|
|
19332
19578
|
}
|
|
19333
19579
|
}
|
|
@@ -19455,6 +19701,7 @@ function resolveBoundaryContext(args) {
|
|
|
19455
19701
|
protectedTailPolicyVersion: meta.protectedTailPolicyVersion,
|
|
19456
19702
|
migrationFloorActive,
|
|
19457
19703
|
emergencyTailScale: args.emergencyTailScale,
|
|
19704
|
+
liftLivePromptFloor: args.liftLivePromptFloor,
|
|
19458
19705
|
providerShapeVersion: args.providerShapeVersion ?? "opencode-v1",
|
|
19459
19706
|
cacheNamespace: args.cacheNamespace ?? `opencode:${args.sessionId}`,
|
|
19460
19707
|
storedTokenTotalsForMessages,
|
|
@@ -20566,7 +20813,7 @@ function promoteRecompStagingWithM0Mutation(db, sessionId, holderId) {
|
|
|
20566
20813
|
finished = true;
|
|
20567
20814
|
return null;
|
|
20568
20815
|
}
|
|
20569
|
-
|
|
20816
|
+
deleteChunkEmbedBackoffForSession2(db, sessionId);
|
|
20570
20817
|
db.prepare("DELETE FROM compartments WHERE session_id = ?").run(sessionId);
|
|
20571
20818
|
db.prepare("DELETE FROM session_facts WHERE session_id = ?").run(sessionId);
|
|
20572
20819
|
insertRecompCompartmentRows(db, sessionId, staging.compartments, now);
|
|
@@ -21516,4 +21763,4 @@ async function executeContextRecomp(deps, options = {}) {
|
|
|
21516
21763
|
return (await executeContextRecompWithResult(deps, options)).message;
|
|
21517
21764
|
}
|
|
21518
21765
|
|
|
21519
|
-
export { denyTaskRoutingToCallerAgents, buildHiddenAgentRegistrations, buildZenReadAgentRegistrations, buildHiddenAgentConfig, getMagicContextBuiltinCommands, formatConfigParseStatusLine, claimConfigParseFailuresOnce, cortexKitUserConfigBasePath, cortexKitProjectConfigBasePath, resolveLegacyConfigSources, migrateMagicContextConfigLocations, getProtectedTokensTierOverrides, loadPluginConfigDetailed, historianRunConfig, dreamerRunConfig, pluginConfigReader, currentPluginConfigReader, withLiveDreamerOutputCap, createDreamerOutputCapSampler, COMPARTMENT_AGENT_SYSTEM_PROMPT, HISTORIAN_EDITOR_SYSTEM_PROMPT, COMPARTMENT_STRUCTURAL_SYSTEM_PROMPT, clampProducerAtomChars, producerInputTokenLimit, historianProducerReserve, producerPromptFailureReason, DREAMER_AGENT, DREAMER_RETROSPECTIVE_AGENT, DREAMER_PRIMER_INVESTIGATOR_AGENT, DREAMER_MEMORY_MAPPER_AGENT, DREAMER_CLASSIFIER_AGENT, DREAMER_DOCS_AGENT, DREAMER_REVIEWER_AGENT, COMPARTMENT_LEASE_RENEWAL_MS, acquireCompartmentLease, renewCompartmentLease, releaseCompartmentLeaseBestEffort, isCompartmentLeaseHeld, queueM0Mutation, getMaxM0MutationId, getCompartments, getLastCompartmentEndMessage, getLastCompartmentEndMessageId, getUncoveredCompartmentEndsThrough, providerResponseFailed, isSuccessfulProviderCompletion, rememberUnpublishedAutoSearchNoHint, getUnpublishedAutoSearchNoHint, forgetUnpublishedAutoSearchNoHint, registerAutoSearchWork, cancelAutoSearchWork, 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, createDbLkgPersistence, resolveLkgModelKeys, createLkgEntryProjector, captureLkgSlot, validateAnthropicReasoningRuns, validateLkgSeam, replayLkg, coldStartRawServedIndex, coldStartUncapturedReplay, noteUncertifiedNormalLkg, hasProcessLocalLkgProof, lkgDirtyRevision, rememberLkgDirtyRevision, readPersistedLkgUntaggedInputIds, persistLkgUntaggedInputIds, noteLkgRecoveryPrefix, readLkgRecoveryPrefix, noteLkgHealthyPrefix, lkgRecoveryReplayUnproven, lkgRecoveryEntryUnproven, registerLkgPersistence, 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, createChildSessionWithFence, HiddenCompletionRefusal, DreamerProviderOutputFailureError, withDreamerModelCooldown, providerOutputFailureFromInvalidManifest, 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, recordPromptSessionError, createPromptAsyncTransport, CTX_NOTE_LIGHT_DESCRIPTION, ACTIVE_TOOL_IDS, systemPromptFingerprint, createPromptSurfaceRuntime, createPromptSurfaceGuidanceEpochCache, setKeepSubagents, teardownChildSession, getCompartmentEvents, runTokenLog, formatRunTokenLog, buildMagicContextSection, getMuralIdentity, getMural, modelKeyAcceptsImages, resolveMuralWire, USER_MEMORY_CANDIDATE_TTL_MS, insertUserMemoryCandidates, getUserMemoryCandidates, deleteUserMemoryCandidates, pruneExpiredUserMemoryCandidates, insertUserMemory, getActiveUserMemories, updateUserMemoryContent, dismissUserMemory, getOpenCodeDbPath, compareOpenCodeMessagesByCanonicalOrder, prepareCompactionMarkerCandidates, removeMcOwnedCompactionMarkers, MARKER_SUMMARY_TEXT, markerUpdateDefinitelyDidNotCut, applyDeferredCompactionMarker, removeCompactionMarkerForSession, checkCompactionMarkerConsistency, 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, resolveHiddenCompletionExecutor, createV1HiddenCompletionExecutor, readCoordinateGeneration, readCoordinateRebaseNotice, formatCoordinateRebaseNotice, rebaseSessionCoordinatesAsync, EMPTY_READ_REPLY, noteTouchedAt, renderGlance, renderNotesById, formatWriteReply, observeNoteNudgeServe, onNoteTrigger, peekNoteNudgeText, markNoteNudgeDelivered, clearNoteNudgeTriggerAndCooldown, resetNoteNudgeCooldownOnly, clearNoteNudgeTriggerOnly, omitIncompleteFileTokenTotals, describeBoundaryDiagnostics, RECOVERY_NO_HEAD_LIMIT, deriveProtectedTailTokenTarget, selectPerRunCap, resolveOpenCodeProtectedTailBoundary, resolveWrapupProtectedTailBoundary, getRawHistoryEligibility, hasRunnableCompartmentWindow, recordHighPressureNoEligibleHead, noteTransformPassForExactOrdinalReads, runCompartmentAgent, snapRangeToCompartments, getActiveCompartmentRun, markActiveCompartmentRunPublished, registerActiveCompartmentRun, startCompartmentAgent, executeContextRecomp };
|
|
21766
|
+
export { denyTaskRoutingToCallerAgents, buildHiddenAgentRegistrations, buildZenReadAgentRegistrations, buildHiddenAgentConfig, getMagicContextBuiltinCommands, formatConfigParseStatusLine, claimConfigParseFailuresOnce, cortexKitUserConfigBasePath, cortexKitProjectConfigBasePath, resolveLegacyConfigSources, migrateMagicContextConfigLocations, getProtectedTokensTierOverrides, loadPluginConfigDetailed, historianRunConfig, dreamerRunConfig, pluginConfigReader, currentPluginConfigReader, withLiveDreamerOutputCap, createDreamerOutputCapSampler, COMPARTMENT_AGENT_SYSTEM_PROMPT, HISTORIAN_EDITOR_SYSTEM_PROMPT, COMPARTMENT_STRUCTURAL_SYSTEM_PROMPT, clampProducerAtomChars, producerInputTokenLimit, historianProducerReserve, producerPromptFailureReason, DREAMER_AGENT, DREAMER_RETROSPECTIVE_AGENT, DREAMER_PRIMER_INVESTIGATOR_AGENT, DREAMER_MEMORY_MAPPER_AGENT, DREAMER_CLASSIFIER_AGENT, DREAMER_DOCS_AGENT, DREAMER_REVIEWER_AGENT, COMPARTMENT_LEASE_RENEWAL_MS, acquireCompartmentLease, renewCompartmentLease, releaseCompartmentLeaseBestEffort, isCompartmentLeaseHeld, queueM0Mutation, getMaxM0MutationId, getCompartments, getLastCompartmentEndMessage, getLastCompartmentEndMessageId, getUncoveredCompartmentEndsThrough, providerResponseFailed, isSuccessfulProviderCompletion, rememberUnpublishedAutoSearchNoHint, getUnpublishedAutoSearchNoHint, forgetUnpublishedAutoSearchNoHint, registerAutoSearchWork, cancelAutoSearchWork, 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, createDbLkgPersistence, resolveLkgModelKeys, createLkgEntryProjector, captureLkgSlot, validateAnthropicReasoningRuns, validateLkgSeam, replayLkg, coldStartRawServedIndex, coldStartUncapturedReplay, noteUncertifiedNormalLkg, hasProcessLocalLkgProof, lkgDirtyRevision, rememberLkgDirtyRevision, readPersistedLkgUntaggedInputIds, persistLkgUntaggedInputIds, noteLkgRecoveryPrefix, readLkgRecoveryPrefix, noteLkgHealthyPrefix, lkgRecoveryReplayUnproven, lkgRecoveryEntryUnproven, registerLkgPersistence, 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, createChildSessionWithFence, HiddenCompletionRefusal, DreamerProviderOutputFailureError, withDreamerModelCooldown, providerOutputFailureFromInvalidManifest, 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, recordPromptSessionError, createPromptAsyncTransport, CTX_NOTE_LIGHT_DESCRIPTION, ACTIVE_TOOL_IDS, systemPromptFingerprint, createPromptSurfaceRuntime, createPromptSurfaceGuidanceEpochCache, setKeepSubagents, teardownChildSession, getCompartmentEvents, runTokenLog, formatRunTokenLog, buildMagicContextSection, getMuralIdentity, getMural, modelKeyAcceptsImages, resolveMuralWire, USER_MEMORY_CANDIDATE_TTL_MS, insertUserMemoryCandidates, getUserMemoryCandidates, deleteUserMemoryCandidates, pruneExpiredUserMemoryCandidates, insertUserMemory, getActiveUserMemories, updateUserMemoryContent, dismissUserMemory, getOpenCodeDbPath, compareOpenCodeMessagesByCanonicalOrder, prepareCompactionMarkerCandidates, removeMcOwnedCompactionMarkers, MARKER_SUMMARY_TEXT, markerUpdateDefinitelyDidNotCut, applyDeferredCompactionMarker, removeCompactionMarkerForSession, checkCompactionMarkerConsistency, 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, resolveHiddenCompletionExecutor, createV1HiddenCompletionExecutor, readCoordinateGeneration, readCoordinateRebaseNotice, formatCoordinateRebaseNotice, rebaseSessionCoordinatesAsync, EMPTY_READ_REPLY, noteTouchedAt, renderGlance, renderNotesById, formatWriteReply, observeNoteNudgeServe, onNoteTrigger, peekNoteNudgeText, markNoteNudgeDelivered, clearNoteNudgeTriggerAndCooldown, resetNoteNudgeCooldownOnly, clearNoteNudgeTriggerOnly, omitIncompleteFileTokenTotals, describeBoundaryDiagnostics, RECOVERY_NO_HEAD_LIMIT, deriveProtectedTailTokenTarget, selectPerRunCap, resolveOpenCodeProtectedTailBoundary, resolveWrapupProtectedTailBoundary, getRawHistoryEligibility, hasRunnableCompartmentWindow, recordHighPressureNoEligibleHead, noteTransformPassForExactOrdinalReads, runCompartmentAgent, snapRangeToCompartments, getActiveCompartmentRun, markActiveCompartmentRunPublished, registerActiveCompartmentRun, startCompartmentAgent, executeContextRecomp };
|