@cortexkit/opencode-magic-context 0.48.0 → 0.49.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{announcement-fp14dw0n.js → announcement-hdbkt8v5.js} +1 -1
- package/dist/auto-search-worker.js +3 -3
- package/dist/config/{mural-model-deprecation.d.ts → deprecated-config.d.ts} +4 -1
- package/dist/config/deprecated-config.d.ts.map +1 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/project-security.d.ts +2 -2
- package/dist/config/schema/magic-context.d.ts +4 -4
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/{conflict-warning-hook-w8cykrnf.js → conflict-warning-hook-asnt6hfc.js} +7 -7
- package/dist/{context-m0cy262m.js → context-tfyhtdcs.js} +187 -68
- package/dist/{derive-budgets-sg0xsq7s.js → derive-budgets-j4ry8j8n.js} +2 -2
- package/dist/embedding-backfill-wyc3ykyf.js +21 -0
- package/dist/embedding-worker-process.js +30 -0
- package/dist/embedding-worker.js +6 -6
- package/dist/features/magic-context/dreamer/task-registry.d.ts +2 -3
- package/dist/features/magic-context/dreamer/task-registry.d.ts.map +1 -1
- package/dist/features/magic-context/git-commits/search-git-commits.d.ts +2 -0
- package/dist/features/magic-context/git-commits/search-git-commits.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-worker-client.d.ts +8 -1
- package/dist/features/magic-context/memory/embedding-worker-client.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-worker-process.d.ts +2 -0
- package/dist/features/magic-context/memory/embedding-worker-process.d.ts.map +1 -0
- package/dist/features/magic-context/memory/onnx-telemetry.d.ts +3 -0
- package/dist/features/magic-context/memory/onnx-telemetry.d.ts.map +1 -0
- package/dist/features/magic-context/message-index.d.ts.map +1 -1
- package/dist/features/magic-context/overflow-detection.d.ts +1 -2
- package/dist/features/magic-context/overflow-detection.d.ts.map +1 -1
- package/dist/features/magic-context/pi-content-decisions.d.ts +1 -1
- package/dist/features/magic-context/pi-content-decisions.d.ts.map +1 -1
- package/dist/features/magic-context/search-rerank.d.ts +35 -0
- package/dist/features/magic-context/search-rerank.d.ts.map +1 -0
- package/dist/features/magic-context/search.d.ts +11 -0
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +13 -2
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-session.d.ts +1 -1
- package/dist/features/magic-context/storage-meta-session.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta.d.ts +1 -1
- package/dist/features/magic-context/storage-meta.d.ts.map +1 -1
- package/dist/features/magic-context/storage-session-tables.d.ts +2 -0
- package/dist/features/magic-context/storage-session-tables.d.ts.map +1 -1
- package/dist/features/magic-context/storage-tag-identity-revision.d.ts +29 -9
- package/dist/features/magic-context/storage-tag-identity-revision.d.ts.map +1 -1
- package/dist/features/magic-context/storage-tags.d.ts +9 -0
- package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
- package/dist/features/magic-context/storage.d.ts +1 -1
- package/dist/features/magic-context/storage.d.ts.map +1 -1
- package/dist/features/magic-context/tagger.d.ts +2 -0
- package/dist/features/magic-context/tagger.d.ts.map +1 -1
- package/dist/features/magic-context/transform-decision-log.d.ts +4 -1
- package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -1
- package/dist/features/magic-context/user-memory/storage-user-memory.d.ts +1 -0
- package/dist/features/magic-context/user-memory/storage-user-memory.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-deadline.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-replay.fixture.d.ts +24 -0
- package/dist/hooks/magic-context/auto-search-replay.fixture.d.ts.map +1 -0
- package/dist/hooks/magic-context/auto-search-runner.d.ts +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 +2 -0
- package/dist/hooks/magic-context/auto-search-worker-client.d.ts.map +1 -1
- package/dist/hooks/magic-context/command-handler.d.ts +2 -0
- package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/emergency-fail-closed.d.ts +28 -0
- package/dist/hooks/magic-context/emergency-fail-closed.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/final-wire-token-estimate.d.ts +1 -0
- package/dist/hooks/magic-context/final-wire-token-estimate.d.ts.map +1 -1
- package/dist/hooks/magic-context/historian-host-runner.d.ts +8 -0
- package/dist/hooks/magic-context/historian-host-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts +3 -1
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/latest-thinking-recovery.d.ts +7 -0
- package/dist/hooks/magic-context/latest-thinking-recovery.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-measured-request.d.ts +3 -1
- package/dist/hooks/magic-context/lkg-measured-request.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-persist.d.ts +8 -14
- package/dist/hooks/magic-context/lkg-persist.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-recovery-fence.d.ts +62 -0
- package/dist/hooks/magic-context/lkg-recovery-fence.d.ts.map +1 -0
- package/dist/hooks/magic-context/lkg-recovery-prefix.d.ts +38 -0
- package/dist/hooks/magic-context/lkg-recovery-prefix.d.ts.map +1 -0
- package/dist/hooks/magic-context/lkg-replay.d.ts +3 -1
- package/dist/hooks/magic-context/lkg-replay.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-slot.d.ts.map +1 -1
- package/dist/hooks/magic-context/opaque-thinking.d.ts +12 -0
- package/dist/hooks/magic-context/opaque-thinking.d.ts.map +1 -0
- package/dist/hooks/magic-context/pass-outcome.d.ts +3 -2
- package/dist/hooks/magic-context/pass-outcome.d.ts.map +1 -1
- package/dist/hooks/magic-context/pending-materialization.d.ts +8 -0
- package/dist/hooks/magic-context/pending-materialization.d.ts.map +1 -0
- package/dist/hooks/magic-context/read-session-chunk.d.ts +7 -1
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-db.d.ts +3 -0
- package/dist/hooks/magic-context/read-session-db.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-raw.d.ts +35 -0
- package/dist/hooks/magic-context/read-session-raw.d.ts.map +1 -1
- package/dist/hooks/magic-context/recomp-orchestrator.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-mode-transform.d.ts +37 -0
- package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/shared-compartment-boundaries.d.ts +8 -1
- package/dist/hooks/magic-context/shared-compartment-boundaries.d.ts.map +1 -1
- package/dist/hooks/magic-context/strict-thinking-prefix.d.ts +8 -0
- package/dist/hooks/magic-context/strict-thinking-prefix.d.ts.map +1 -0
- package/dist/hooks/magic-context/strip-content.d.ts +5 -2
- package/dist/hooks/magic-context/strip-content.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-date-refresh.d.ts +29 -0
- package/dist/hooks/magic-context/system-date-refresh.d.ts.map +1 -0
- package/dist/hooks/magic-context/system-prompt-dates.d.ts +6 -0
- package/dist/hooks/magic-context/system-prompt-dates.d.ts.map +1 -0
- package/dist/hooks/magic-context/system-prompt-delivery.d.ts +47 -0
- package/dist/hooks/magic-context/system-prompt-delivery.d.ts.map +1 -0
- package/dist/hooks/magic-context/system-prompt-hash.d.ts +4 -0
- package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-messages.d.ts +8 -0
- package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +15 -0
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +7 -0
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-ty64eqcn.js → index-0pjvpfkf.js} +24 -4
- package/dist/{index-db7zwa3v.js → index-1bt88epp.js} +93 -9
- package/dist/{index-2y0s2hep.js → index-4mjhqadz.js} +1 -1
- package/dist/index-6m7rdv7y.js +733 -0
- package/dist/{index-k1xb52kd.js → index-6tfxmc4n.js} +11 -11
- package/dist/{index-fbv1dn35.js → index-7w18gg78.js} +26 -2
- package/dist/{index-7mx8v0pw.js → index-att4bfan.js} +4 -4
- package/dist/{index-mmyh6d8f.js → index-eypn4ba6.js} +11 -6
- package/dist/{index-q2tqeqde.js → index-fdtkt5r1.js} +1229 -78
- package/dist/{index-c43kr12f.js → index-fg00p1cg.js} +42 -40
- package/dist/{v2/server-1bc61ans.js → index-fvnzcnww.js} +44 -1
- package/dist/index-gbmqa9x9.js +1170 -0
- package/dist/{index-knh4y330.js → index-gzky5rva.js} +31 -49
- package/dist/{index-0qhce371.js → index-h2wc01qk.js} +2 -2
- package/dist/{index-dhwzyd54.js → index-h5zfkjyk.js} +160 -25
- package/dist/{index-bhvjj0ys.js → index-k6xvbj2e.js} +255 -1075
- package/dist/{index-0w56v4fm.js → index-mw7c950g.js} +1 -1
- package/dist/{index-8j7gqj40.js → index-nsjyysj0.js} +6 -2
- package/dist/{index-k9nnwad5.js → index-nydv6g8r.js} +44 -7
- package/dist/{index-f0h6xwqm.js → index-p0n5ryq8.js} +304 -960
- package/dist/{index-pg50n748.js → index-p1hnwfd8.js} +4 -4
- package/dist/{index-1qb0z7wa.js → index-qx53vezw.js} +1 -1
- package/dist/{index-5zygecde.js → index-r2zcs71c.js} +8 -6
- package/dist/{index-cb7emxgj.js → index-rafsaxac.js} +336 -6
- package/dist/{index-z8e0psj8.js → index-s7fc0fkn.js} +3 -3
- package/dist/{index-14cjxt20.js → index-sfhndpcb.js} +505 -11
- package/dist/index-sv0bb7vg.js +6972 -0
- package/dist/{index-jcbd3znx.js → index-tqf7yg27.js} +1 -1
- package/dist/{index-72nhv486.js → index-vkbqdnkj.js} +2 -2
- package/dist/{index-pdecwzrd.js → index-w23dh319.js} +18 -259
- package/dist/{index-yq8n9qcb.js → index-xgrwmj82.js} +4 -4
- package/dist/{index-0an7742d.js → index-xnanvj3w.js} +1364 -2278
- package/dist/{index-eeezr5zz.js → index-z1tjp257.js} +1 -1
- package/dist/{index-692jzy0p.js → index-zfzdpeq2.js} +2279 -4061
- package/dist/{index-q7h7csab.js → index-zg8yq4ya.js} +34 -749
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +241 -76
- package/dist/{logger-d3wex3dz.js → logger-ewak5q1s.js} +1 -1
- package/dist/{message-index-bounded-7ezbgddp.js → message-index-bounded-hqktkhdy.js} +15 -14
- package/dist/{message-time-backfill-brbd63hv.js → message-time-backfill-8x06r9kx.js} +2 -2
- package/dist/migration-worker.js +11 -10
- package/dist/plugin/hooks/create-session-hooks.d.ts +5 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/plugin/messages-transform.d.ts.map +1 -1
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/plugin/tool-registry.d.ts.map +1 -1
- package/dist/{project-embedding-registry-7qzptcw7.js → project-embedding-registry-0gv3h6y8.js} +10 -10
- package/dist/raw-ordinal-warmup-worker.js +4 -4
- package/dist/{read-session-chunk-6k83m4fj.js → read-session-chunk-5mh0bh8y.js} +12 -9
- package/dist/{read-session-raw-3g9qy1xa.js → read-session-raw-8sjbc9h0.js} +5 -3
- package/dist/{recomp-orchestrator-d3fp1cy0.js → recomp-orchestrator-kpkhkjhq.js} +28 -27
- package/dist/{safe-notification-target-5ffqq32m.js → safe-notification-target-q0cyrx3x.js} +2 -2
- package/dist/{search-epax1ecv.js → search-p9w39qv4.js} +22 -21
- package/dist/{send-session-notification-erecz4y4.js → send-session-notification-xffh3bbe.js} +5 -5
- package/dist/shared/auto-search-lifecycle.d.ts +14 -0
- package/dist/shared/auto-search-lifecycle.d.ts.map +1 -1
- package/dist/shared/logger.d.ts.map +1 -1
- package/dist/shared/models-dev-cache.d.ts.map +1 -1
- package/dist/shared/models-dev-temperature.d.ts +18 -0
- package/dist/shared/models-dev-temperature.d.ts.map +1 -0
- package/dist/shared/project-directory-key.d.ts +16 -0
- package/dist/shared/project-directory-key.d.ts.map +1 -1
- package/dist/shared/storage-file-mutex.d.ts +9 -0
- package/dist/shared/storage-file-mutex.d.ts.map +1 -0
- package/dist/shared/storage-permissions.d.ts +6 -0
- package/dist/shared/storage-permissions.d.ts.map +1 -1
- package/dist/shared/subagent-temperature.d.ts +46 -0
- package/dist/shared/subagent-temperature.d.ts.map +1 -0
- package/dist/shared/window-geometry.d.ts +9 -66
- package/dist/shared/window-geometry.d.ts.map +1 -1
- package/dist/standalone-plugin-marker.d.ts +8 -0
- package/dist/standalone-plugin-marker.d.ts.map +1 -0
- package/dist/{storage-tags-d3b0v2ss.js → storage-tags-k0pda32s.js} +6 -4
- package/dist/tools/ctx-reduce/constants.d.ts +1 -2
- package/dist/tools/ctx-reduce/constants.d.ts.map +1 -1
- package/dist/tools/ctx-reduce/tools.d.ts +1 -1
- package/dist/tools/ctx-reduce/tools.d.ts.map +1 -1
- 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-spcy2qre.js → transform-postprocess-phase-481j5a7z.js} +28 -27
- package/dist/v2/auto-search-worker.js +3 -3
- package/dist/v2/{context-sf98kstd.js → context-gsdtha5v.js} +1619 -3111
- package/dist/v2/{derive-budgets-3vc0y84t.js → derive-budgets-enckmg7y.js} +3 -3
- package/dist/v2/embedding-backfill-dbvjbcmm.js +20 -0
- package/dist/v2/embedding-worker-process.js +29 -0
- package/dist/v2/embedding-worker.js +6 -7
- package/dist/v2/hidden-child-native.d.ts.map +1 -1
- package/dist/v2/hidden-completion.d.ts +7 -0
- package/dist/v2/hidden-completion.d.ts.map +1 -1
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/copied-tag-notation.d.ts +19 -0
- package/dist/v2/hooks/copied-tag-notation.d.ts.map +1 -0
- package/dist/v2/hooks/dream-trigger.d.ts +4 -1
- package/dist/v2/hooks/dream-trigger.d.ts.map +1 -1
- package/dist/v2/hooks/generate.d.ts +9 -2
- package/dist/v2/hooks/generate.d.ts.map +1 -1
- package/dist/v2/hooks/payload.d.ts.map +1 -1
- package/dist/v2/hooks/system-prompt-response.d.ts +5 -0
- package/dist/v2/hooks/system-prompt-response.d.ts.map +1 -0
- package/dist/v2/{logger-mxd0ym09.js → logger-pj02s7sr.js} +1 -1
- package/dist/v2/{message-index-bounded-dy3s2k1e.js → message-index-bounded-p6v0n8qh.js} +15 -14
- package/dist/v2/{message-time-backfill-gtx1pwk1.js → message-time-backfill-cje68egj.js} +2 -2
- package/dist/v2/migration-worker.js +11 -10
- package/dist/v2/{project-embedding-registry-1tgba5dv.js → project-embedding-registry-nyq7z8y6.js} +11 -12
- package/dist/v2/raw-ordinal-warmup-worker.js +4 -4
- package/dist/v2/{read-session-chunk-rh4khdkv.js → read-session-chunk-fhyfe4qa.js} +12 -9
- package/dist/v2/{read-session-raw-bsbmf0vj.js → read-session-raw-j8dvp7f4.js} +5 -3
- package/dist/v2/recomp-orchestrator-5xy7w136.js +57 -0
- package/dist/v2/{safe-notification-target-73ax1p5v.js → safe-notification-target-y3p1hce9.js} +2 -2
- package/dist/v2/{search-nzkwrc6n.js → search-j7bakcwa.js} +23 -23
- package/dist/v2/{send-session-notification-6km439kn.js → send-session-notification-f6v698r5.js} +5 -5
- package/dist/v2/{server-7wwc2nga.js → server-1fszbabv.js} +32 -32
- package/dist/v2/{server-k228xhjg.js → server-2htmbqbv.js} +26 -2
- package/dist/v2/{server-aan4q8mx.js → server-3t0q2cqx.js} +1 -1
- package/dist/v2/{server-686jg6eb.js → server-4c7jt8gq.js} +68 -7
- package/dist/v2/{server-xxm59eww.js → server-4enr7s6x.js} +4 -4
- package/dist/v2/{server-zxhgvsf9.js → server-676xw7at.js} +1 -1
- package/dist/v2/{server-52awr2mw.js → server-6byqfbqf.js} +93 -9
- package/dist/v2/{server-e0vdaae2.js → server-6tcrjfw8.js} +4 -4
- package/dist/v2/{server-qye6ykf7.js → server-7ekna9zs.js} +2 -2
- package/dist/v2/{server-g5r0n3b6.js → server-7h861yms.js} +160 -25
- package/dist/v2/{server-k8x2rbxc.js → server-7spkq1y6.js} +3457 -5192
- package/dist/v2/{server-8pyt7hev.js → server-7vkj6zhb.js} +34 -749
- package/dist/v2/{server-yczc713m.js → server-8xmq9h3f.js} +31 -49
- package/dist/v2/{server-sggvvzhb.js → server-bgzy0phk.js} +505 -11
- package/dist/v2/server-c7n2ftng.js +6860 -0
- package/dist/v2/server-cvgn49tr.js +733 -0
- package/dist/v2/{server-zm570tr2.js → server-cw6521wn.js} +232 -7
- package/dist/v2/{server-xdfwt6kh.js → server-czb2rkpk.js} +23 -3
- package/dist/v2/{server-x2g40a71.js → server-d6g4whc2.js} +21 -15
- package/dist/{index-1bc61ans.js → v2/server-fvnzcnww.js} +44 -1
- package/dist/v2/{server-4k748ke6.js → server-hb6xhh9q.js} +2 -2
- package/dist/v2/{server-gjcr4w98.js → server-kh958yj8.js} +5 -5
- package/dist/v2/{server-1r6pmz4f.js → server-kzns2hbz.js} +1 -1
- package/dist/v2/{server-psqc7e9n.js → server-mqvtz7wz.js} +1227 -78
- package/dist/v2/{server-vqpf3167.js → server-ras2sxnc.js} +135 -15
- package/dist/v2/{server-ezhze64f.js → server-s2st631p.js} +4 -4
- package/dist/v2/{server-5m3dt5r1.js → server-t4k4qexw.js} +6 -2
- package/dist/v2/{server-z2037m6z.js → server-t528t8qm.js} +2 -2
- package/dist/v2/{server-v06jcv0w.js → server-vb7pbd9p.js} +18 -259
- package/dist/v2/{server-8tqanswc.js → server-zbxjj2mz.js} +331 -4
- package/dist/v2/server.d.ts.map +1 -1
- package/dist/v2/server.js +150 -6
- package/dist/v2/{storage-tags-w4tv77sn.js → storage-tags-5yxrvkaf.js} +6 -4
- package/dist/v2/store-reader.d.ts +8 -2
- package/dist/v2/store-reader.d.ts.map +1 -1
- package/dist/v2/{wrapup-orchestrator-mz7efs7w.js → wrapup-orchestrator-yem5422s.js} +36 -36
- package/dist/wrapup-orchestrator-xvrr27ws.js +45 -0
- package/package.json +4 -4
- package/src/config/{mural-model-deprecation.ts → deprecated-config.ts} +19 -0
- package/src/config/index.test.ts +15 -37
- package/src/config/index.ts +2 -3
- package/src/config/project-security.ts +3 -3
- package/src/config/schema/magic-context.ts +11 -7
- package/src/features/magic-context/dreamer/task-registry.ts +2 -3
- package/src/shared/auto-search-lifecycle.ts +43 -0
- package/src/shared/logger.test.ts +38 -0
- package/src/shared/logger.ts +10 -2
- package/src/shared/models-dev-cache.ts +1 -7
- package/src/shared/models-dev-temperature.ts +107 -0
- package/src/shared/project-directory-key.test.ts +59 -0
- package/src/shared/project-directory-key.ts +20 -0
- package/src/shared/sqlite-640-review.test.ts +5 -1
- package/src/shared/storage-file-mutex-review.test.ts +162 -0
- package/src/shared/storage-file-mutex.ts +130 -0
- package/src/shared/storage-permissions.ts +46 -0
- package/src/shared/subagent-temperature.test.ts +270 -0
- package/src/shared/subagent-temperature.ts +110 -0
- package/src/shared/window-geometry.test.ts +102 -236
- package/src/shared/window-geometry.ts +23 -413
- package/dist/config/mural-model-deprecation.d.ts.map +0 -1
- package/dist/embedding-backfill-9rcm1mfy.js +0 -21
- package/dist/index-bdckkfw6.js +0 -3261
- package/dist/index-mfkzp7qj.js +0 -229
- package/dist/v2/embedding-backfill-vn8g1nh1.js +0 -21
- package/dist/v2/recomp-orchestrator-az61rfcg.js +0 -57
- package/dist/v2/server-2fbhp79z.js +0 -3205
- package/dist/v2/server-mfkzp7qj.js +0 -229
- package/dist/wrapup-orchestrator-amzta1t4.js +0 -44
- package/src/shared/__fixtures__/window-overlay.v1.json +0 -337
- /package/dist/{index-2pp04pmg.js → index-69vas84q.js} +0 -0
- /package/dist/v2/{index-2pp04pmg.js → index-69vas84q.js} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import"./server-pavzsdc6.js";
|
|
2
2
|
import {
|
|
3
3
|
sessionLog2
|
|
4
|
-
} from "./server-
|
|
5
|
-
import"./server-
|
|
4
|
+
} from "./server-t4k4qexw.js";
|
|
5
|
+
import"./server-cvgn49tr.js";
|
|
6
6
|
import {
|
|
7
7
|
COMPARTMENT_LEASE_RENEWAL_MS,
|
|
8
8
|
acquireCompartmentLease,
|
|
@@ -10,12 +10,6 @@ import {
|
|
|
10
10
|
releaseCompartmentLeaseBestEffort,
|
|
11
11
|
getCompartments,
|
|
12
12
|
getLastCompartmentEndMessage,
|
|
13
|
-
getWrapupInProgressState,
|
|
14
|
-
acquireWrapupInProgress,
|
|
15
|
-
updateWrapupInProgress,
|
|
16
|
-
releaseWrapupInProgress,
|
|
17
|
-
getHistorianFailureState,
|
|
18
|
-
clearEmergencyRecovery,
|
|
19
13
|
describeBoundaryDiagnostics,
|
|
20
14
|
resolveWrapupProtectedTailBoundary,
|
|
21
15
|
hasRunnableCompartmentWindow,
|
|
@@ -25,47 +19,53 @@ import {
|
|
|
25
19
|
registerActiveCompartmentRun,
|
|
26
20
|
setRecompStarting2,
|
|
27
21
|
setRecompTerminal2
|
|
28
|
-
} from "./server-
|
|
29
|
-
import"./server-
|
|
30
|
-
import"./server-
|
|
22
|
+
} from "./server-7spkq1y6.js";
|
|
23
|
+
import"./server-kzns2hbz.js";
|
|
24
|
+
import"./server-hb6xhh9q.js";
|
|
31
25
|
import"./server-kb9nn0a0.js";
|
|
32
|
-
import"./server-
|
|
33
|
-
import"./server-
|
|
34
|
-
import"./server-
|
|
35
|
-
import"./server-52awr2mw.js";
|
|
36
|
-
import"./server-1zx87sdm.js";
|
|
37
|
-
import"./server-686jg6eb.js";
|
|
38
|
-
import"./server-mfkzp7qj.js";
|
|
39
|
-
import"./server-g5r0n3b6.js";
|
|
40
|
-
import"./server-2ra6pwf3.js";
|
|
41
|
-
import"./server-xdfwt6kh.js";
|
|
26
|
+
import"./server-2htmbqbv.js";
|
|
27
|
+
import"./server-s2st631p.js";
|
|
28
|
+
import"./server-bgzy0phk.js";
|
|
42
29
|
import {
|
|
30
|
+
getWrapupInProgressState,
|
|
31
|
+
acquireWrapupInProgress,
|
|
32
|
+
updateWrapupInProgress,
|
|
33
|
+
releaseWrapupInProgress,
|
|
34
|
+
getHistorianFailureState,
|
|
35
|
+
clearEmergencyRecovery,
|
|
43
36
|
prepareRawSessionOrdinals2
|
|
44
|
-
} from "./server-
|
|
45
|
-
import"./server-
|
|
37
|
+
} from "./server-c7n2ftng.js";
|
|
38
|
+
import"./server-6byqfbqf.js";
|
|
39
|
+
import"./server-7vkj6zhb.js";
|
|
40
|
+
import"./server-1zx87sdm.js";
|
|
41
|
+
import"./server-4c7jt8gq.js";
|
|
42
|
+
import"./server-cw6521wn.js";
|
|
43
|
+
import"./server-7h861yms.js";
|
|
44
|
+
import"./server-2ra6pwf3.js";
|
|
45
|
+
import"./server-czb2rkpk.js";
|
|
46
|
+
import"./server-7ekna9zs.js";
|
|
46
47
|
import"./server-fr0wbhdn.js";
|
|
47
|
-
import"./server-
|
|
48
|
-
import"./server-
|
|
49
|
-
import"./server-
|
|
48
|
+
import"./server-6tcrjfw8.js";
|
|
49
|
+
import"./server-8xmq9h3f.js";
|
|
50
|
+
import"./server-1fszbabv.js";
|
|
50
51
|
import"./server-fb3zxn06.js";
|
|
51
|
-
import"./server-
|
|
52
|
-
import"./server-8tqanswc.js";
|
|
52
|
+
import"./server-zbxjj2mz.js";
|
|
53
53
|
import {
|
|
54
54
|
pushNotification2
|
|
55
55
|
} from "./server-x8a7jmkh.js";
|
|
56
56
|
import"./server-qt1qqasc.js";
|
|
57
57
|
import"./server-4dhv7mqz.js";
|
|
58
|
-
import"./server-
|
|
59
|
-
import"./server-
|
|
58
|
+
import"./server-ras2sxnc.js";
|
|
59
|
+
import"./server-kh958yj8.js";
|
|
60
60
|
import"./server-7jzrrxap.js";
|
|
61
|
-
import"./server-
|
|
62
|
-
import"./server-
|
|
63
|
-
import"./server-
|
|
64
|
-
import"./server-
|
|
61
|
+
import"./server-d6g4whc2.js";
|
|
62
|
+
import"./server-vb7pbd9p.js";
|
|
63
|
+
import"./server-t528t8qm.js";
|
|
64
|
+
import"./server-676xw7at.js";
|
|
65
65
|
import {
|
|
66
66
|
sendStatusNotification2
|
|
67
|
-
} from "./server-
|
|
68
|
-
import"./server-
|
|
67
|
+
} from "./server-4enr7s6x.js";
|
|
68
|
+
import"./server-3t0q2cqx.js";
|
|
69
69
|
|
|
70
70
|
// src/hooks/magic-context/wrapup-orchestrator.ts
|
|
71
71
|
import * as crypto from "node:crypto";
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runManagedWrapup2
|
|
3
|
+
} from "./index-6tfxmc4n.js";
|
|
4
|
+
import"./index-eypn4ba6.js";
|
|
5
|
+
import"./index-zfzdpeq2.js";
|
|
6
|
+
import"./index-rafsaxac.js";
|
|
7
|
+
import"./index-sfhndpcb.js";
|
|
8
|
+
import"./index-r2zcs71c.js";
|
|
9
|
+
import"./index-7jzrrxap.js";
|
|
10
|
+
import"./index-fg00p1cg.js";
|
|
11
|
+
import"./index-p1hnwfd8.js";
|
|
12
|
+
import"./index-4dhv7mqz.js";
|
|
13
|
+
import"./index-w23dh319.js";
|
|
14
|
+
import"./index-sd3egckz.js";
|
|
15
|
+
import"./index-xgrwmj82.js";
|
|
16
|
+
import"./index-qt1qqasc.js";
|
|
17
|
+
import"./index-x8a7jmkh.js";
|
|
18
|
+
import"./index-tqf7yg27.js";
|
|
19
|
+
import"./index-gbmqa9x9.js";
|
|
20
|
+
import"./index-vkbqdnkj.js";
|
|
21
|
+
import"./index-zg8yq4ya.js";
|
|
22
|
+
import"./index-fb3zxn06.js";
|
|
23
|
+
import"./index-att4bfan.js";
|
|
24
|
+
import"./index-6m7rdv7y.js";
|
|
25
|
+
import"./index-fr0wbhdn.js";
|
|
26
|
+
import"./index-gzky5rva.js";
|
|
27
|
+
import"./index-7w18gg78.js";
|
|
28
|
+
import"./index-sv0bb7vg.js";
|
|
29
|
+
import"./index-nydv6g8r.js";
|
|
30
|
+
import"./index-1zx87sdm.js";
|
|
31
|
+
import"./index-0pjvpfkf.js";
|
|
32
|
+
import"./index-h5zfkjyk.js";
|
|
33
|
+
import"./index-k6xvbj2e.js";
|
|
34
|
+
import"./index-h2wc01qk.js";
|
|
35
|
+
import"./index-1bt88epp.js";
|
|
36
|
+
import"./index-58e3y90n.js";
|
|
37
|
+
import"./index-qx53vezw.js";
|
|
38
|
+
import"./index-4mjhqadz.js";
|
|
39
|
+
import"./index-kb9nn0a0.js";
|
|
40
|
+
import"./index-nsjyysj0.js";
|
|
41
|
+
import"./index-0sahzkwr.js";
|
|
42
|
+
import"./index-pavzsdc6.js";
|
|
43
|
+
export {
|
|
44
|
+
runManagedWrapup2 as runManagedWrapup
|
|
45
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/opencode-magic-context",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.49.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "OpenCode plugin for Magic Context — cross-session memory and context management",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"README.md"
|
|
38
38
|
],
|
|
39
39
|
"scripts": {
|
|
40
|
-
"build": "bun ../../scripts/check-bun.mjs && tsc -p ../retina-local-fs/tsconfig.build.json && bun run build:tui && bun ../../scripts/clean-dist-chunks.mjs dist index.js transformers-web.js transformers-node-wasm.js && bun build src/features/magic-context/memory/transformers-web-entry.ts --outfile dist/transformers-web.js --target browser --format esm --external onnxruntime-web && bun scripts/build-transformers-node-wasm.ts dist && bun build src/index.ts src/features/magic-context/memory/embedding-worker.ts src/features/magic-context/migration-worker.ts src/hooks/magic-context/auto-search-worker.ts src/hooks/magic-context/raw-ordinal-warmup-worker.ts --outdir dist --entry-naming '[name].[ext]' --target node --format esm --splitting --external @opencode-ai/plugin --external onnxruntime-node --external onnxruntime-web --external sharp --external bun:sqlite --external node:sqlite && bun run build:v2 && tsc --emitDeclarationOnly",
|
|
41
|
-
"build:v2": "bun ../../scripts/clean-dist-chunks.mjs dist/v2 server.js embedding-worker.js migration-worker.js && bun build src/features/magic-context/memory/transformers-web-entry.ts --outfile dist/v2/transformers-web.js --target browser --format esm --external onnxruntime-web && bun scripts/build-transformers-node-wasm.ts dist/v2 && bun build src/v2/server.ts src/features/magic-context/memory/embedding-worker.ts src/features/magic-context/migration-worker.ts src/hooks/magic-context/auto-search-worker.ts src/hooks/magic-context/raw-ordinal-warmup-worker.ts --outdir dist/v2 --entry-naming '[name].[ext]' --target node --format esm --splitting --external @opencode/plugin --external onnxruntime-node --external onnxruntime-web --external sharp --external bun:sqlite --external node:sqlite",
|
|
40
|
+
"build": "bun ../../scripts/check-bun.mjs && tsc -p ../retina-local-fs/tsconfig.build.json && bun run build:tui && bun ../../scripts/clean-dist-chunks.mjs dist index.js transformers-web.js transformers-node-wasm.js && bun build src/features/magic-context/memory/transformers-web-entry.ts --outfile dist/transformers-web.js --target browser --format esm --external onnxruntime-web && bun scripts/build-transformers-node-wasm.ts dist && bun build src/index.ts src/features/magic-context/memory/embedding-worker.ts src/features/magic-context/memory/embedding-worker-process.ts src/features/magic-context/migration-worker.ts src/hooks/magic-context/auto-search-worker.ts src/hooks/magic-context/raw-ordinal-warmup-worker.ts --outdir dist --entry-naming '[name].[ext]' --target node --format esm --splitting --external @opencode-ai/plugin --external onnxruntime-node --external onnxruntime-web --external sharp --external bun:ffi --external bun:sqlite --external node:sqlite && bun run build:v2 && tsc --emitDeclarationOnly",
|
|
41
|
+
"build:v2": "bun ../../scripts/clean-dist-chunks.mjs dist/v2 server.js embedding-worker.js embedding-worker-process.js migration-worker.js && bun build src/features/magic-context/memory/transformers-web-entry.ts --outfile dist/v2/transformers-web.js --target browser --format esm --external onnxruntime-web && bun scripts/build-transformers-node-wasm.ts dist/v2 && bun build src/v2/server.ts src/features/magic-context/memory/embedding-worker.ts src/features/magic-context/memory/embedding-worker-process.ts src/features/magic-context/migration-worker.ts src/hooks/magic-context/auto-search-worker.ts src/hooks/magic-context/raw-ordinal-warmup-worker.ts --outdir dist/v2 --entry-naming '[name].[ext]' --target node --format esm --splitting --external @opencode/plugin --external onnxruntime-node --external onnxruntime-web --external sharp --external bun:ffi --external bun:sqlite --external node:sqlite",
|
|
42
42
|
"build:tui": "bun scripts/build-tui.ts",
|
|
43
43
|
"check:tui-compiled": "git diff --exit-code -- src/tui-compiled && test -z \"$(git status --porcelain -- src/tui-compiled)\"",
|
|
44
44
|
"check:transformers-node-wasm": "bun scripts/verify-transformers-node-wasm.ts",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"lint:fix": "biome check --write .",
|
|
51
51
|
"format": "biome format --write .",
|
|
52
52
|
"format:check": "biome format .",
|
|
53
|
-
"clean": "bun ../../scripts/clean-dist-chunks.mjs dist index.js embedding-worker.js migration-worker.js transformers-web.js transformers-node-wasm.js && bun ../../scripts/clean-dist-chunks.mjs dist/v2 server.js embedding-worker.js migration-worker.js transformers-web.js transformers-node-wasm.js",
|
|
53
|
+
"clean": "bun ../../scripts/clean-dist-chunks.mjs dist index.js embedding-worker.js embedding-worker-process.js migration-worker.js transformers-web.js transformers-node-wasm.js && bun ../../scripts/clean-dist-chunks.mjs dist/v2 server.js embedding-worker.js embedding-worker-process.js migration-worker.js transformers-web.js transformers-node-wasm.js",
|
|
54
54
|
"prepublishOnly": "bun run build && bun run check:tui-compiled"
|
|
55
55
|
},
|
|
56
56
|
"//check:tui-compiled": "Check drift on output already generated by build or build:tui; this check never regenerates files. CI and prepublishOnly build first.",
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
export const MURAL_MODEL_DEPRECATION_WARNING =
|
|
9
9
|
"mural.model is deprecated and ignored; compress-cues now uses the dreamer model for each harness, like every other dreamer task. To override it, set dreamer.opencode.tasks.compress-cues.model (or the pi/omp equivalent). This key no longer does anything; remove it.";
|
|
10
10
|
|
|
11
|
+
export const WINDOW_OVERLAY_PATH_DEPRECATION_WARNING =
|
|
12
|
+
"models.window_overlay_path is deprecated and ignored; Fusiform no longer publishes window-overlay data, so this setting no longer changes model window geometry. Remove this key.";
|
|
13
|
+
|
|
11
14
|
/**
|
|
12
15
|
* Pushes the deprecation warning when the config still sets `mural.model`.
|
|
13
16
|
* Call it after the legacy experimental migration so the pre-graduation
|
|
@@ -22,3 +25,19 @@ export function warnDeprecatedMuralModel(
|
|
|
22
25
|
warnings.push(MURAL_MODEL_DEPRECATION_WARNING);
|
|
23
26
|
}
|
|
24
27
|
}
|
|
28
|
+
|
|
29
|
+
/** Pushes one warning when a config still sets the retired Fusiform path. */
|
|
30
|
+
export function warnDeprecatedWindowOverlayPath(
|
|
31
|
+
config: Record<string, unknown>,
|
|
32
|
+
warnings: string[],
|
|
33
|
+
): void {
|
|
34
|
+
const models = config.models;
|
|
35
|
+
if (
|
|
36
|
+
typeof models === "object" &&
|
|
37
|
+
models !== null &&
|
|
38
|
+
Object.hasOwn(models, "window_overlay_path") &&
|
|
39
|
+
!warnings.includes(WINDOW_OVERLAY_PATH_DEPRECATION_WARNING)
|
|
40
|
+
) {
|
|
41
|
+
warnings.push(WINDOW_OVERLAY_PATH_DEPRECATION_WARNING);
|
|
42
|
+
}
|
|
43
|
+
}
|
package/src/config/index.test.ts
CHANGED
|
@@ -8,12 +8,10 @@ import { resolveDreamerTaskModel, resolveHistorianModel } from "../shared/model-
|
|
|
8
8
|
import { Database } from "../shared/sqlite";
|
|
9
9
|
import { createTestTempDir, createTestTempDirFromPath } from "../shared/test-temp-dir";
|
|
10
10
|
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} from "../shared/window-geometry";
|
|
11
|
+
MURAL_MODEL_DEPRECATION_WARNING,
|
|
12
|
+
WINDOW_OVERLAY_PATH_DEPRECATION_WARNING,
|
|
13
|
+
} from "./deprecated-config";
|
|
15
14
|
import { loadPluginConfig, loadPluginConfigDetailed } from "./index";
|
|
16
|
-
import { MURAL_MODEL_DEPRECATION_WARNING } from "./mural-model-deprecation";
|
|
17
15
|
import { resolveConfigProfile } from "./profiles";
|
|
18
16
|
import { getProtectedTokensTierOverrides } from "./project-security";
|
|
19
17
|
import { REMOVED_AGENT_CONFIG_WARNING } from "./removed-agent-config";
|
|
@@ -123,39 +121,19 @@ function loadWithUserAndProjectConfig(
|
|
|
123
121
|
}
|
|
124
122
|
}
|
|
125
123
|
|
|
126
|
-
describe("loadPluginConfig — Fusiform
|
|
127
|
-
it("
|
|
128
|
-
const
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
writeFileSync(
|
|
133
|
-
overlayPath,
|
|
134
|
-
JSON.stringify({
|
|
135
|
-
schema: "fusiform-window-overlay/v1",
|
|
136
|
-
generated_at: "2026-09-01T00:00:00Z",
|
|
137
|
-
minted_provider_ids: [],
|
|
138
|
-
cells: [{ provider_id: "hunt-provider", model_id: modelId, facts: {} }],
|
|
139
|
-
}),
|
|
140
|
-
);
|
|
141
|
-
|
|
142
|
-
try {
|
|
143
|
-
writeOverlay("before-rewrite");
|
|
144
|
-
loadWithUserConfig(configText);
|
|
145
|
-
expect(getWindowOverlay()?.cells[0]?.model_id).toBe("before-rewrite");
|
|
146
|
-
|
|
147
|
-
writeOverlay("after-rewrite");
|
|
148
|
-
expect(getWindowOverlay()?.cells[0]?.model_id).toBe("before-rewrite");
|
|
149
|
-
|
|
150
|
-
loadWithUserConfig(configText);
|
|
151
|
-
expect(getWindowOverlay()?.cells[0]?.model_id).toBe("before-rewrite");
|
|
124
|
+
describe("loadPluginConfig — retired Fusiform window path", () => {
|
|
125
|
+
it("parses the old key but warns once that it is ignored", () => {
|
|
126
|
+
const path = "/tmp/retired-fusiform-window.json";
|
|
127
|
+
const config = loadWithUserConfig(
|
|
128
|
+
JSON.stringify({ models: { window_overlay_path: path } }),
|
|
129
|
+
);
|
|
152
130
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
131
|
+
expect(config.models?.window_overlay_path).toBe(path);
|
|
132
|
+
const warnings = config.configWarnings?.filter((message) =>
|
|
133
|
+
message.includes("models.window_overlay_path"),
|
|
134
|
+
);
|
|
135
|
+
expect(warnings).toHaveLength(1);
|
|
136
|
+
expect(warnings?.[0]).toContain(WINDOW_OVERLAY_PATH_DEPRECATION_WARNING);
|
|
159
137
|
});
|
|
160
138
|
});
|
|
161
139
|
|
package/src/config/index.ts
CHANGED
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
import { log } from "../shared/logger";
|
|
15
15
|
import { setOutputReserveConfig } from "../shared/models-dev-cache";
|
|
16
16
|
import type { PromptSurfaceConfig } from "../shared/prompt-surface";
|
|
17
|
-
import { setWindowOverlayPath } from "../shared/window-geometry";
|
|
18
17
|
import { isCompactionEnabled, migrateLegacyAgentEnabledInMemory } from "./agent-disable";
|
|
18
|
+
import { warnDeprecatedMuralModel, warnDeprecatedWindowOverlayPath } from "./deprecated-config";
|
|
19
19
|
import {
|
|
20
20
|
cortexKitProjectConfigBasePath,
|
|
21
21
|
cortexKitUserConfigBasePath,
|
|
@@ -25,7 +25,6 @@ import {
|
|
|
25
25
|
} from "./migrate-config-location";
|
|
26
26
|
import { migrateDreamerV2 } from "./migrate-dreamer-v2";
|
|
27
27
|
import { migrateLegacyExperimental } from "./migrate-experimental";
|
|
28
|
-
import { warnDeprecatedMuralModel } from "./mural-model-deprecation";
|
|
29
28
|
import { resolveConfigProfile } from "./profiles";
|
|
30
29
|
import {
|
|
31
30
|
attachProtectedTokensTierOverrides,
|
|
@@ -439,6 +438,7 @@ export function parsePluginConfig(
|
|
|
439
438
|
preMigrationWarnings,
|
|
440
439
|
);
|
|
441
440
|
warnDeprecatedMuralModel(migratedExperimental, preMigrationWarnings);
|
|
441
|
+
warnDeprecatedWindowOverlayPath(migratedExperimental, preMigrationWarnings);
|
|
442
442
|
// Dreamer v2: convert the legacy v1 dreamer shape (window schedule, tasks
|
|
443
443
|
// array, user_memories/pin_key_files blocks) into the per-task `tasks` record.
|
|
444
444
|
// Runs AFTER migrate-experimental so experimental.user_memories (already
|
|
@@ -872,7 +872,6 @@ export function loadPluginConfigDetailed(
|
|
|
872
872
|
if (profileResolution.activeProfile) config.profile = profileResolution.activeProfile;
|
|
873
873
|
if (applyRuntimeGlobals) {
|
|
874
874
|
setOutputReserveConfig(config.output_reserve);
|
|
875
|
-
setWindowOverlayPath(config.models?.window_overlay_path);
|
|
876
875
|
}
|
|
877
876
|
const leafValidationWarnings = [...(config.configWarnings ?? [])];
|
|
878
877
|
if (config.configWarnings?.length) {
|
|
@@ -327,8 +327,8 @@ function makeProjectThresholdWarning(field: string, reason: string): string {
|
|
|
327
327
|
* - `debug_rpc` — a repo must not enable process heap capture or memory diagnostics.
|
|
328
328
|
* - `allow_home_project` — only the user may opt a home-directory session
|
|
329
329
|
* into a durable project identity.
|
|
330
|
-
* - `output_reserve`
|
|
331
|
-
*
|
|
330
|
+
* - `output_reserve` — only the user may change process-wide window geometry.
|
|
331
|
+
* The deprecated `models.window_overlay_path` field is ignored at every tier.
|
|
332
332
|
* - `language`: a repo must not inject prompt text through a user preference.
|
|
333
333
|
* - `sqlite` — `sqlite.cache_size_mb` / `mmap_size_mb` become PRAGMAs on the
|
|
334
334
|
* process-global shared DB handle (one connection across every project in the
|
|
@@ -425,7 +425,7 @@ export function stripUnsafeProjectConfigFields(projectRaw: Record<string, unknow
|
|
|
425
425
|
if (isPlainObject(models) && "window_overlay_path" in models) {
|
|
426
426
|
delete models.window_overlay_path;
|
|
427
427
|
warnings.push(
|
|
428
|
-
"Ignoring models.window_overlay_path from project config (
|
|
428
|
+
"Ignoring models.window_overlay_path from project config (deprecated; this setting no longer changes model window geometry).",
|
|
429
429
|
);
|
|
430
430
|
}
|
|
431
431
|
|
|
@@ -792,7 +792,7 @@ const BaseEmbeddingConfigSchema = z
|
|
|
792
792
|
.enum(["auto", "native", "wasm"])
|
|
793
793
|
.default("auto")
|
|
794
794
|
.describe(
|
|
795
|
-
"Local provider only: ONNX runtime selection. 'auto' uses native under Node and uses WASM under Bun versions before 1.4.0, where Bun's NAPI teardown race can panic on quit; native is restored automatically on Bun 1.4.0+. Inference runs in a dedicated worker. On Bun before 1.4.0, even explicit 'native' uses WASM because native worker teardown can crash the process. Set 'wasm' to avoid loading the native addon on newer hosts too.",
|
|
795
|
+
"Local provider only: ONNX runtime selection. 'auto' uses native under Node and uses WASM under Bun versions before 1.4.0, where Bun's NAPI teardown race can panic on quit; native is restored automatically on Bun 1.4.0+. Inference runs in a dedicated worker after disabling POSIX telemetry in the native process environment. Compiled Bun hosts and hosts without a verified in-process opt-out use a subprocess instead. Windows native ONNX emits OS-controlled ETW diagnostics, not direct uploads. On Bun before 1.4.0, even explicit 'native' uses WASM because native worker teardown can crash the process. Set 'wasm' to avoid loading the native addon on newer hosts too.",
|
|
796
796
|
),
|
|
797
797
|
local_dtype: z
|
|
798
798
|
.enum([
|
|
@@ -953,8 +953,8 @@ export interface MagicContextConfig {
|
|
|
953
953
|
prompt_surface: PromptSurfaceConfig;
|
|
954
954
|
/** User-only output-token reservation override. Zero disables reservation. */
|
|
955
955
|
output_reserve?: number | { default: number; [modelKey: string]: number };
|
|
956
|
-
/**
|
|
957
|
-
models?: { window_overlay_path?:
|
|
956
|
+
/** Deprecated user-only window metadata path; parsed only so loaders can warn and ignore it. */
|
|
957
|
+
models?: { window_overlay_path?: unknown };
|
|
958
958
|
/** TUI toast lifetime in milliseconds for Magic Context notifications. Default: 5000. */
|
|
959
959
|
toast_duration_ms?: number;
|
|
960
960
|
execute_threshold_percentage: number | { default: number; [modelKey: string]: number };
|
|
@@ -1220,12 +1220,16 @@ export const MagicContextConfigSchema = z
|
|
|
1220
1220
|
),
|
|
1221
1221
|
models: z
|
|
1222
1222
|
.object({
|
|
1223
|
-
window_overlay_path: z
|
|
1223
|
+
window_overlay_path: z
|
|
1224
|
+
.unknown()
|
|
1225
|
+
.optional()
|
|
1226
|
+
.describe(
|
|
1227
|
+
"Deprecated: ignored. Fusiform no longer publishes window-overlay data, so this setting no longer changes model window geometry. Remove this key.",
|
|
1228
|
+
)
|
|
1229
|
+
.meta({ deprecated: true }),
|
|
1224
1230
|
})
|
|
1225
1231
|
.optional()
|
|
1226
|
-
.describe(
|
|
1227
|
-
"User-only Fusiform window-overlay settings. The path defaults to <dataDir>/fusiform/window-overlay.json.",
|
|
1228
|
-
),
|
|
1232
|
+
.describe("Deprecated user-only Fusiform window-overlay settings; ignored."),
|
|
1229
1233
|
toast_duration_ms: z
|
|
1230
1234
|
.number()
|
|
1231
1235
|
.min(0)
|
|
@@ -35,10 +35,9 @@ export function availableDreamTasks(smartNotesEnabled = true): DreamTaskName[] {
|
|
|
35
35
|
);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
/** Prompt-token ceilings
|
|
38
|
+
/** Prompt-token ceilings leave headroom for repeated tool-loop prompt sends.
|
|
39
39
|
* Completed Gemini run usage predicts 20-memory mapping/verification batches
|
|
40
|
-
* at about 70% of their
|
|
41
|
-
* (docs/reports/verify-token-budget-2026-09-30.md); curate and other tasks retain
|
|
40
|
+
* at about 70% of their ceiling; curate and other tasks retain
|
|
42
41
|
* their separate allowances. */
|
|
43
42
|
export const DREAM_TOOL_LOOP_TOKEN_BUDGETS = {
|
|
44
43
|
"map-memories": 2_500_000,
|
|
@@ -1,4 +1,47 @@
|
|
|
1
|
+
import type { AutoSearchHintNoHintReason } from "../features/magic-context/storage-meta-persisted";
|
|
2
|
+
|
|
1
3
|
const pending = new Map<string, Set<AbortController>>();
|
|
4
|
+
const unpublishedNoHints = new Map<string, Map<string, AutoSearchHintNoHintReason>>();
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A failed save can still send the user message without a search hint. Remember
|
|
8
|
+
* that no-hint decision until a later pass saves it to SQLite, including across
|
|
9
|
+
* closing and reopening the database handle. Switching or shutting down a session
|
|
10
|
+
* does not prove deletion and must not discard it. If all compare-and-swap (CAS)
|
|
11
|
+
* save retries fail and the process restarts before repair, this unsaved record
|
|
12
|
+
* is lost: that compound failure is the remaining durability gap.
|
|
13
|
+
*/
|
|
14
|
+
export function rememberUnpublishedAutoSearchNoHint(
|
|
15
|
+
sessionId: string,
|
|
16
|
+
messageId: string,
|
|
17
|
+
reason: AutoSearchHintNoHintReason,
|
|
18
|
+
): void {
|
|
19
|
+
let messages = unpublishedNoHints.get(sessionId);
|
|
20
|
+
if (!messages) {
|
|
21
|
+
messages = new Map();
|
|
22
|
+
unpublishedNoHints.set(sessionId, messages);
|
|
23
|
+
}
|
|
24
|
+
if (!messages.has(messageId)) messages.set(messageId, reason);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function getUnpublishedAutoSearchNoHint(
|
|
28
|
+
sessionId: string,
|
|
29
|
+
messageId: string,
|
|
30
|
+
): AutoSearchHintNoHintReason | undefined {
|
|
31
|
+
return unpublishedNoHints.get(sessionId)?.get(messageId);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function forgetUnpublishedAutoSearchNoHint(sessionId: string, messageId: string): void {
|
|
35
|
+
const messages = unpublishedNoHints.get(sessionId);
|
|
36
|
+
messages?.delete(messageId);
|
|
37
|
+
if (messages?.size === 0) unpublishedNoHints.delete(sessionId);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Deleting a session releases its unsaved no-hint records; switching away does not. */
|
|
41
|
+
export function clearUnpublishedAutoSearchNoHints(sessionId?: string): void {
|
|
42
|
+
if (sessionId === undefined) unpublishedNoHints.clear();
|
|
43
|
+
else unpublishedNoHints.delete(sessionId);
|
|
44
|
+
}
|
|
2
45
|
|
|
3
46
|
/** Cleanup cancels optional searches and backfill, not durable served decisions. */
|
|
4
47
|
export function registerAutoSearchWork(sessionId: string): {
|
|
@@ -129,6 +129,28 @@ if (scenario === "retry") {
|
|
|
129
129
|
predecessorMode: fs.statSync(predecessorPath).mode & 0o777,
|
|
130
130
|
files: fs.readdirSync(path.dirname(logPath)).filter((name) => name.startsWith("magic-context.log")).sort(),
|
|
131
131
|
}));
|
|
132
|
+
} else if (scenario === "stale-rotation") {
|
|
133
|
+
const maxLogBytes = 32 * 1024 * 1024;
|
|
134
|
+
fs.mkdirSync(path.dirname(logPath), { recursive: true });
|
|
135
|
+
fs.writeFileSync(logPath, Buffer.alloc(maxLogBytes - 200, "o"));
|
|
136
|
+
fs.chmodSync(logPath, 0o600);
|
|
137
|
+
// This process now caches a size just under the bound.
|
|
138
|
+
logger.log("cached size");
|
|
139
|
+
logger.flushLogger();
|
|
140
|
+
|
|
141
|
+
// Another process sharing the file rotates it: the full log becomes the
|
|
142
|
+
// predecessor and the current file starts over.
|
|
143
|
+
fs.copyFileSync(logPath, logPath + ".1");
|
|
144
|
+
fs.writeFileSync(logPath, "written by the other process\\n");
|
|
145
|
+
|
|
146
|
+
// A line that crosses the bound only by this process's stale cached size.
|
|
147
|
+
logger.log("x".repeat(400));
|
|
148
|
+
logger.flushLogger();
|
|
149
|
+
console.log(JSON.stringify({
|
|
150
|
+
current: fs.readFileSync(logPath, "utf8"),
|
|
151
|
+
predecessorFirstByte: fs.readFileSync(logPath + ".1")[0],
|
|
152
|
+
predecessorSize: fs.statSync(logPath + ".1").size,
|
|
153
|
+
}));
|
|
132
154
|
} else if (scenario === "hot-path") {
|
|
133
155
|
for (let index = 0; index < 20; index++) {
|
|
134
156
|
logger.log("hot-path-" + index);
|
|
@@ -182,6 +204,7 @@ async function runLoggerScenario<T>(
|
|
|
182
204
|
| "recovery"
|
|
183
205
|
| "diagnostics"
|
|
184
206
|
| "rotation"
|
|
207
|
+
| "stale-rotation"
|
|
185
208
|
| "hot-path"
|
|
186
209
|
| "retry"
|
|
187
210
|
| "bounded"
|
|
@@ -269,6 +292,21 @@ describe("logger", () => {
|
|
|
269
292
|
}
|
|
270
293
|
});
|
|
271
294
|
|
|
295
|
+
test("a stale cached size does not rotate a file another process already rotated", async () => {
|
|
296
|
+
const result = await runLoggerScenario<{
|
|
297
|
+
current: string;
|
|
298
|
+
predecessorFirstByte: number;
|
|
299
|
+
predecessorSize: number;
|
|
300
|
+
}>("stale-rotation");
|
|
301
|
+
|
|
302
|
+
// The other process's full predecessor survives, and the new line joins
|
|
303
|
+
// the restarted current file instead of replacing that predecessor.
|
|
304
|
+
expect(result.predecessorFirstByte).toBe("o".charCodeAt(0));
|
|
305
|
+
expect(result.predecessorSize).toBeGreaterThan(32 * 1024 * 1024 - 1024);
|
|
306
|
+
expect(result.current).toContain("written by the other process");
|
|
307
|
+
expect(result.current).toContain("x".repeat(400));
|
|
308
|
+
});
|
|
309
|
+
|
|
272
310
|
test("uses cached size between periodic rotation checks", async () => {
|
|
273
311
|
const result = await runLoggerScenario<HotPathScenarioResult>("hot-path");
|
|
274
312
|
|
package/src/shared/logger.ts
CHANGED
|
@@ -163,8 +163,16 @@ function flush(): void {
|
|
|
163
163
|
let currentSize = getCurrentLogSize(logFile);
|
|
164
164
|
const dataSize = Buffer.byteLength(data);
|
|
165
165
|
if (currentSize > 0 && currentSize + dataSize > MAX_LOG_FILE_BYTES) {
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
// Several processes share this file and each caches its size. A stale
|
|
167
|
+
// cache must not rotate a file another process already rotated: that
|
|
168
|
+
// second rotation would overwrite the full predecessor with the few
|
|
169
|
+
// lines written since. Decide on the file's real size instead.
|
|
170
|
+
flushesSinceSizeCheck = SIZE_CHECK_INTERVAL_FLUSHES;
|
|
171
|
+
currentSize = getCurrentLogSize(logFile);
|
|
172
|
+
if (currentSize > 0 && currentSize + dataSize > MAX_LOG_FILE_BYTES) {
|
|
173
|
+
rotateLogFile(logFile, currentSize);
|
|
174
|
+
currentSize = 0;
|
|
175
|
+
}
|
|
168
176
|
}
|
|
169
177
|
fs.appendFileSync(logFile, data, { encoding: "utf8", mode: 0o600 });
|
|
170
178
|
buffer = [];
|
|
@@ -33,12 +33,7 @@ import { getHarness } from "./harness";
|
|
|
33
33
|
import { modelRefLookupOrder } from "./harness-provider-map";
|
|
34
34
|
import { sessionLog } from "./logger";
|
|
35
35
|
import { writeStorageFileAtomicSync } from "./storage-permissions";
|
|
36
|
-
import {
|
|
37
|
-
deriveWindowGeometry,
|
|
38
|
-
getWindowOverlay,
|
|
39
|
-
resolveWindowOverlayFacts,
|
|
40
|
-
type WindowGeometryResult,
|
|
41
|
-
} from "./window-geometry";
|
|
36
|
+
import { deriveWindowGeometry, type WindowGeometryResult } from "./window-geometry";
|
|
42
37
|
|
|
43
38
|
interface OpencodeClientLike {
|
|
44
39
|
config: {
|
|
@@ -515,7 +510,6 @@ export function getSdkWindowGeometry(
|
|
|
515
510
|
output: metadata.outputLimit,
|
|
516
511
|
},
|
|
517
512
|
{
|
|
518
|
-
overlay: resolveWindowOverlayFacts(providerID, modelID, getWindowOverlay()),
|
|
519
513
|
outputReserveOverride: resolveOutputReserve(providerID, modelID),
|
|
520
514
|
harness: options?.harness ?? "opencode",
|
|
521
515
|
contextCap:
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Temperature capability from the models.dev catalog that OpenCode caches on disk.
|
|
3
|
+
*
|
|
4
|
+
* OpenCode 1 copies models.dev's `temperature` flag onto each model, but OpenCode 2's
|
|
5
|
+
* model rows, Pi's model registry and Oh My Pi's Gemini models carry no equivalent
|
|
6
|
+
* field. For those hosts the cached catalog is the only positive evidence on the
|
|
7
|
+
* machine, so a missing file, an unparsable file or a missing entry all mean "unknown"
|
|
8
|
+
* and the caller omits temperature.
|
|
9
|
+
*
|
|
10
|
+
* This module is bundled into the Pi/OMP historian child extension, so it must only
|
|
11
|
+
* depend on Node built-ins.
|
|
12
|
+
*/
|
|
13
|
+
import { readFileSync, statSync } from "node:fs";
|
|
14
|
+
import { homedir } from "node:os";
|
|
15
|
+
import { join } from "node:path";
|
|
16
|
+
|
|
17
|
+
export interface CatalogTemperature {
|
|
18
|
+
temperature: boolean;
|
|
19
|
+
/** The catalog entry that decided, as `provider/model`. */
|
|
20
|
+
entry: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Harness provider ids that name the same models.dev provider. Codex (`openai-codex`)
|
|
25
|
+
* is deliberately absent: the ChatGPT backend is a different transport from the
|
|
26
|
+
* OpenAI API that models.dev describes, so it gets no catalog answer and no temperature.
|
|
27
|
+
*/
|
|
28
|
+
const CATALOG_PROVIDER_ALIASES: Readonly<Record<string, string>> = {
|
|
29
|
+
"google-antigravity": "google",
|
|
30
|
+
"opencode-zen": "opencode",
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** The Antigravity auth plugins register Gemini models as `google/antigravity-<model>`. */
|
|
34
|
+
const ANTIGRAVITY_MODEL_PREFIX = "antigravity-";
|
|
35
|
+
|
|
36
|
+
type CatalogIndex = Map<string, boolean>;
|
|
37
|
+
|
|
38
|
+
let cached: { path: string; mtimeMs: number; size: number; index: CatalogIndex } | undefined;
|
|
39
|
+
|
|
40
|
+
/** OpenCode reads `OPENCODE_MODELS_PATH` instead of its cache when it is set. */
|
|
41
|
+
export function modelsDevCatalogPath(env: NodeJS.ProcessEnv = process.env): string {
|
|
42
|
+
if (env.OPENCODE_MODELS_PATH) return env.OPENCODE_MODELS_PATH;
|
|
43
|
+
return join(env.XDG_CACHE_HOME || join(homedir(), ".cache"), "opencode", "models.json");
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function buildIndex(raw: unknown): CatalogIndex {
|
|
47
|
+
const index: CatalogIndex = new Map();
|
|
48
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return index;
|
|
49
|
+
for (const [providerID, provider] of Object.entries(raw as Record<string, unknown>)) {
|
|
50
|
+
const models = (provider as { models?: unknown } | null)?.models;
|
|
51
|
+
if (!models || typeof models !== "object") continue;
|
|
52
|
+
for (const [modelID, model] of Object.entries(models as Record<string, unknown>)) {
|
|
53
|
+
const temperature = (model as { temperature?: unknown } | null)?.temperature;
|
|
54
|
+
if (typeof temperature === "boolean")
|
|
55
|
+
index.set(`${providerID}/${modelID}`, temperature);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return index;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function loadIndex(): CatalogIndex | undefined {
|
|
62
|
+
const path = modelsDevCatalogPath();
|
|
63
|
+
try {
|
|
64
|
+
const stat = statSync(path);
|
|
65
|
+
if (cached?.path === path && cached.mtimeMs === stat.mtimeMs && cached.size === stat.size)
|
|
66
|
+
return cached.index;
|
|
67
|
+
const index = buildIndex(JSON.parse(readFileSync(path, "utf8")));
|
|
68
|
+
cached = { path, mtimeMs: stat.mtimeMs, size: stat.size, index };
|
|
69
|
+
return index;
|
|
70
|
+
} catch {
|
|
71
|
+
// Absent or partially written catalog: no evidence either way.
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** Spellings to try for a harness `provider/model` reference, most specific first. */
|
|
77
|
+
export function catalogCandidates(providerID: string, modelID: string): string[] {
|
|
78
|
+
const provider = Object.hasOwn(CATALOG_PROVIDER_ALIASES, providerID)
|
|
79
|
+
? CATALOG_PROVIDER_ALIASES[providerID]
|
|
80
|
+
: providerID;
|
|
81
|
+
const candidates = [`${provider}/${modelID}`];
|
|
82
|
+
if (provider === "google" && modelID.startsWith(ANTIGRAVITY_MODEL_PREFIX))
|
|
83
|
+
candidates.push(`google/${modelID.slice(ANTIGRAVITY_MODEL_PREFIX.length)}`);
|
|
84
|
+
return candidates;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Look `provider/model` up in the cached catalogue, trying only the exact spellings from
|
|
89
|
+
* `catalogCandidates`. A malformed reference, a missing catalogue or no entry returns undefined.
|
|
90
|
+
*/
|
|
91
|
+
export function catalogTemperature(model: string): CatalogTemperature | undefined {
|
|
92
|
+
const slash = model.indexOf("/");
|
|
93
|
+
if (slash <= 0 || slash === model.length - 1) return undefined;
|
|
94
|
+
const index = loadIndex();
|
|
95
|
+
if (!index) return undefined;
|
|
96
|
+
for (const entry of catalogCandidates(model.slice(0, slash), model.slice(slash + 1))) {
|
|
97
|
+
const temperature = index.get(entry);
|
|
98
|
+
if (temperature !== undefined) return { temperature, entry };
|
|
99
|
+
}
|
|
100
|
+
return undefined;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export const __catalogTest = {
|
|
104
|
+
reset(): void {
|
|
105
|
+
cached = undefined;
|
|
106
|
+
},
|
|
107
|
+
};
|