@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
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { afterAll, beforeEach, describe, expect, test } from "bun:test";
|
|
2
|
+
import { mkdirSync, rmSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
import { modelsDevCatalogPath } from "./models-dev-temperature";
|
|
6
|
+
import {
|
|
7
|
+
__temperatureTest,
|
|
8
|
+
applyHiddenSubagentTemperature,
|
|
9
|
+
resolveTemperatureCapability,
|
|
10
|
+
subagentTemperature,
|
|
11
|
+
} from "./subagent-temperature";
|
|
12
|
+
import { cleanupTestTempDir, createTestTempDirFromPath } from "./test-temp-dir";
|
|
13
|
+
|
|
14
|
+
// Every test reads a catalog it wrote itself, never the machine's OpenCode cache.
|
|
15
|
+
const cacheRoot = createTestTempDirFromPath(join(tmpdir(), "mc-temperature-catalog-"));
|
|
16
|
+
const savedEnv = {
|
|
17
|
+
XDG_CACHE_HOME: process.env.XDG_CACHE_HOME,
|
|
18
|
+
OPENCODE_MODELS_PATH: process.env.OPENCODE_MODELS_PATH,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** Shape of OpenCode's cached models.dev api.json, trimmed to the fields that matter. */
|
|
22
|
+
const CATALOG = {
|
|
23
|
+
google: {
|
|
24
|
+
id: "google",
|
|
25
|
+
models: {
|
|
26
|
+
"gemini-3.8-flash": { id: "gemini-3.8-flash", temperature: true, reasoning: true },
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
openrouter: {
|
|
30
|
+
id: "openrouter",
|
|
31
|
+
models: {
|
|
32
|
+
"google/gemini-3.8-flash": { temperature: true, reasoning: true },
|
|
33
|
+
"openai/gpt-6.1-sol": { temperature: false, reasoning: true },
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
openai: { id: "openai", models: { "gpt-6.1-sol": { temperature: false, reasoning: true } } },
|
|
37
|
+
opencode: { id: "opencode", models: { "gemini-3.8-flash": { temperature: true } } },
|
|
38
|
+
broken: { id: "broken", models: { "no-flag": { reasoning: true } } },
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
function writeCatalog(contents: string = JSON.stringify(CATALOG)): void {
|
|
42
|
+
const path = join(cacheRoot, "opencode", "models.json");
|
|
43
|
+
mkdirSync(join(cacheRoot, "opencode"), { recursive: true });
|
|
44
|
+
writeFileSync(path, contents);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function removeCatalog(): void {
|
|
48
|
+
rmSync(join(cacheRoot, "opencode"), { recursive: true, force: true });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
beforeEach(() => {
|
|
52
|
+
process.env.XDG_CACHE_HOME = cacheRoot;
|
|
53
|
+
delete process.env.OPENCODE_MODELS_PATH;
|
|
54
|
+
removeCatalog();
|
|
55
|
+
__temperatureTest.reset();
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
afterAll(() => {
|
|
59
|
+
for (const [key, value] of Object.entries(savedEnv)) {
|
|
60
|
+
if (value === undefined) delete process.env[key];
|
|
61
|
+
else process.env[key] = value;
|
|
62
|
+
}
|
|
63
|
+
cleanupTestTempDir(cacheRoot);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
describe("subagent sampling metadata", () => {
|
|
67
|
+
for (const [host, yes, no] of [
|
|
68
|
+
[
|
|
69
|
+
"OpenCode 1",
|
|
70
|
+
{ capabilities: { temperature: true } },
|
|
71
|
+
{ capabilities: { temperature: false } },
|
|
72
|
+
],
|
|
73
|
+
["OpenCode 2", { temperature: true }, { temperature: false }],
|
|
74
|
+
[
|
|
75
|
+
"Pi",
|
|
76
|
+
{ compat: { supportsTemperature: true } },
|
|
77
|
+
{ compat: { supportsTemperature: false } },
|
|
78
|
+
],
|
|
79
|
+
[
|
|
80
|
+
"OMP",
|
|
81
|
+
{ compat: { supportsSamplingParams: true } },
|
|
82
|
+
{ compat: { supportsSamplingParams: false } },
|
|
83
|
+
],
|
|
84
|
+
] as const) {
|
|
85
|
+
test(`${host} requires affirmative metadata and preserves explicit zero`, () => {
|
|
86
|
+
const logs: string[] = [];
|
|
87
|
+
const note = (line: string) => logs.push(line);
|
|
88
|
+
expect(subagentTemperature("provider/yes", yes, 0.1, note)).toBe(0.1);
|
|
89
|
+
expect(subagentTemperature("provider/yes", yes, 0, note)).toBe(0);
|
|
90
|
+
expect(subagentTemperature("provider/no", no, 0.1, note)).toBeUndefined();
|
|
91
|
+
expect(
|
|
92
|
+
subagentTemperature("provider/missing", { reasoning: false }, 0.1, note),
|
|
93
|
+
).toBeUndefined();
|
|
94
|
+
expect(
|
|
95
|
+
subagentTemperature("provider/unknown", { temperature: "yes" }, 0.1, note),
|
|
96
|
+
).toBeUndefined();
|
|
97
|
+
expect(subagentTemperature("provider/unset", yes, undefined, note)).toBeUndefined();
|
|
98
|
+
expect(logs).toEqual([
|
|
99
|
+
"Subagent temperature sent for provider/yes: host model metadata says yes",
|
|
100
|
+
"Subagent temperature omitted for provider/no: host model metadata says no",
|
|
101
|
+
"Subagent temperature omitted for provider/missing: no host or models.dev metadata",
|
|
102
|
+
"Subagent temperature omitted for provider/unknown: no host or models.dev metadata",
|
|
103
|
+
]);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
test("decision logging is once per model and decision, and does not remember a denial as a capability", () => {
|
|
108
|
+
const logs: string[] = [];
|
|
109
|
+
const note = (line: string) => logs.push(line);
|
|
110
|
+
expect(subagentTemperature("p/m", undefined, 0.1, note)).toBeUndefined();
|
|
111
|
+
expect(subagentTemperature("p/m", undefined, 0.1, note)).toBeUndefined();
|
|
112
|
+
expect(subagentTemperature("p/m", { temperature: true }, 0.1, note)).toBe(0.1);
|
|
113
|
+
expect(subagentTemperature("p/m", { temperature: true }, 0.1, note)).toBe(0.1);
|
|
114
|
+
expect(logs).toEqual([
|
|
115
|
+
"Subagent temperature omitted for p/m: no host or models.dev metadata",
|
|
116
|
+
"Subagent temperature sent for p/m: host model metadata says yes",
|
|
117
|
+
]);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
test("OpenCode 1 guards historian, dreamer and compiler per resolved model, not unrelated agents", () => {
|
|
121
|
+
const yes = { providerID: "p", id: "flash", capabilities: { temperature: true } };
|
|
122
|
+
const no = { providerID: "p", id: "fallback", capabilities: { temperature: false } };
|
|
123
|
+
for (const agent of [
|
|
124
|
+
"historian",
|
|
125
|
+
"historian-editor",
|
|
126
|
+
"historian-recomp",
|
|
127
|
+
"dreamer",
|
|
128
|
+
"dreamer-classifier",
|
|
129
|
+
"smart-note-compiler",
|
|
130
|
+
]) {
|
|
131
|
+
const output: { temperature?: number } = { temperature: 0 };
|
|
132
|
+
applyHiddenSubagentTemperature({ agent, model: yes }, output, () => {});
|
|
133
|
+
expect(output).toEqual({ temperature: 0 });
|
|
134
|
+
applyHiddenSubagentTemperature({ agent, model: no }, output, () => {});
|
|
135
|
+
expect(output).toEqual({});
|
|
136
|
+
output.temperature = 0.1;
|
|
137
|
+
applyHiddenSubagentTemperature({ agent }, output, () => {});
|
|
138
|
+
expect(output).toEqual({});
|
|
139
|
+
}
|
|
140
|
+
const output = { temperature: 0.4 };
|
|
141
|
+
applyHiddenSubagentTemperature({ agent: "build", model: no }, output, () => {});
|
|
142
|
+
expect(output.temperature).toBe(0.4);
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
describe("models.dev catalog fallback when the host is silent", () => {
|
|
147
|
+
test("resolves the cached catalog by provider and exact model id", () => {
|
|
148
|
+
writeCatalog();
|
|
149
|
+
const logs: string[] = [];
|
|
150
|
+
const note = (line: string) => logs.push(line);
|
|
151
|
+
// Pi and OpenCode 2 rows carry no temperature field.
|
|
152
|
+
const silent = { reasoning: true, compat: { thinkingFormat: "openrouter" } };
|
|
153
|
+
expect(subagentTemperature("openrouter/google/gemini-3.8-flash", silent, 0.1, note)).toBe(
|
|
154
|
+
0.1,
|
|
155
|
+
);
|
|
156
|
+
expect(subagentTemperature("google/gemini-3.8-flash", silent, 0, note)).toBe(0);
|
|
157
|
+
expect(subagentTemperature("opencode-zen/gemini-3.8-flash", silent, 0.1, note)).toBe(0.1);
|
|
158
|
+
expect(subagentTemperature("openai/gpt-6.1-sol", silent, 0.1, note)).toBeUndefined();
|
|
159
|
+
expect(
|
|
160
|
+
subagentTemperature("openrouter/openai/gpt-6.1-sol", silent, 0.1, note),
|
|
161
|
+
).toBeUndefined();
|
|
162
|
+
expect(logs).toEqual([
|
|
163
|
+
"Subagent temperature sent for openrouter/google/gemini-3.8-flash: models.dev cache entry openrouter/google/gemini-3.8-flash says yes",
|
|
164
|
+
"Subagent temperature sent for google/gemini-3.8-flash: models.dev cache entry google/gemini-3.8-flash says yes",
|
|
165
|
+
"Subagent temperature sent for opencode-zen/gemini-3.8-flash: models.dev cache entry opencode/gemini-3.8-flash says yes",
|
|
166
|
+
"Subagent temperature omitted for openai/gpt-6.1-sol: models.dev cache entry openai/gpt-6.1-sol says no",
|
|
167
|
+
"Subagent temperature omitted for openrouter/openai/gpt-6.1-sol: models.dev cache entry openrouter/openai/gpt-6.1-sol says no",
|
|
168
|
+
]);
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
test("both Antigravity spellings map to the underlying Gemini entry", () => {
|
|
172
|
+
writeCatalog();
|
|
173
|
+
for (const model of [
|
|
174
|
+
"google/antigravity-gemini-3.8-flash",
|
|
175
|
+
"google-antigravity/gemini-3.8-flash",
|
|
176
|
+
"google-antigravity/antigravity-gemini-3.8-flash",
|
|
177
|
+
]) {
|
|
178
|
+
expect(resolveTemperatureCapability(model, {})).toEqual({
|
|
179
|
+
supported: true,
|
|
180
|
+
source: "catalog",
|
|
181
|
+
entry: "google/gemini-3.8-flash",
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
// The prefix is only an Antigravity spelling on Google, not a general rewrite.
|
|
185
|
+
expect(resolveTemperatureCapability("openrouter/antigravity-gemini-3.8-flash", {})).toEqual(
|
|
186
|
+
{
|
|
187
|
+
supported: undefined,
|
|
188
|
+
source: "none",
|
|
189
|
+
},
|
|
190
|
+
);
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
test("Codex and unmatched models stay unknown, so temperature is omitted", () => {
|
|
194
|
+
writeCatalog();
|
|
195
|
+
for (const model of [
|
|
196
|
+
"openai-codex/gpt-6.1-sol",
|
|
197
|
+
"google/gemini-3.8-flash-preview",
|
|
198
|
+
"google/claude-opus-4-6-thinking",
|
|
199
|
+
"broken/no-flag",
|
|
200
|
+
"unknown/unknown",
|
|
201
|
+
"no-slash",
|
|
202
|
+
]) {
|
|
203
|
+
expect(resolveTemperatureCapability(model, undefined)).toEqual({
|
|
204
|
+
supported: undefined,
|
|
205
|
+
source: "none",
|
|
206
|
+
});
|
|
207
|
+
expect(subagentTemperature(model, undefined, 0.1, () => {})).toBeUndefined();
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
test("host metadata outranks the catalog in both directions", () => {
|
|
212
|
+
writeCatalog();
|
|
213
|
+
expect(
|
|
214
|
+
subagentTemperature(
|
|
215
|
+
"google/gemini-3.8-flash",
|
|
216
|
+
{ capabilities: { temperature: false } },
|
|
217
|
+
0.1,
|
|
218
|
+
() => {},
|
|
219
|
+
),
|
|
220
|
+
).toBeUndefined();
|
|
221
|
+
expect(
|
|
222
|
+
subagentTemperature(
|
|
223
|
+
"openai/gpt-6.1-sol",
|
|
224
|
+
{ compat: { supportsSamplingParams: true } },
|
|
225
|
+
0.1,
|
|
226
|
+
() => {},
|
|
227
|
+
),
|
|
228
|
+
).toBe(0.1);
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
test("a missing, empty or partially written catalog is not evidence", () => {
|
|
232
|
+
const silent = {};
|
|
233
|
+
expect(
|
|
234
|
+
subagentTemperature("google/gemini-3.8-flash", silent, 0.1, () => {}),
|
|
235
|
+
).toBeUndefined();
|
|
236
|
+
writeCatalog(JSON.stringify(CATALOG).slice(0, 200));
|
|
237
|
+
expect(
|
|
238
|
+
subagentTemperature("google/gemini-3.8-flash", silent, 0.1, () => {}),
|
|
239
|
+
).toBeUndefined();
|
|
240
|
+
writeCatalog("[]");
|
|
241
|
+
expect(
|
|
242
|
+
subagentTemperature("google/gemini-3.8-flash", silent, 0.1, () => {}),
|
|
243
|
+
).toBeUndefined();
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
test("a rewritten catalog is re-read rather than served from memory", () => {
|
|
247
|
+
writeCatalog();
|
|
248
|
+
expect(resolveTemperatureCapability("google/gemini-3.8-flash", {}).supported).toBe(true);
|
|
249
|
+
writeCatalog(
|
|
250
|
+
JSON.stringify({
|
|
251
|
+
google: { models: { "gemini-3.8-flash": { temperature: false, note: "changed" } } },
|
|
252
|
+
}),
|
|
253
|
+
);
|
|
254
|
+
expect(resolveTemperatureCapability("google/gemini-3.8-flash", {}).supported).toBe(false);
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
test("OPENCODE_MODELS_PATH takes precedence over the cache, as it does for OpenCode", () => {
|
|
258
|
+
writeCatalog();
|
|
259
|
+
const override = join(cacheRoot, "override.json");
|
|
260
|
+
writeFileSync(
|
|
261
|
+
override,
|
|
262
|
+
JSON.stringify({ google: { models: { "gemini-3.8-flash": { temperature: false } } } }),
|
|
263
|
+
);
|
|
264
|
+
process.env.OPENCODE_MODELS_PATH = override;
|
|
265
|
+
expect(modelsDevCatalogPath()).toBe(override);
|
|
266
|
+
expect(resolveTemperatureCapability("google/gemini-3.8-flash", {}).supported).toBe(false);
|
|
267
|
+
delete process.env.OPENCODE_MODELS_PATH;
|
|
268
|
+
expect(modelsDevCatalogPath()).toBe(join(cacheRoot, "opencode", "models.json"));
|
|
269
|
+
});
|
|
270
|
+
});
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { __catalogTest, catalogTemperature } from "./models-dev-temperature";
|
|
2
|
+
|
|
3
|
+
export type TemperatureMetadata = {
|
|
4
|
+
temperature?: boolean;
|
|
5
|
+
capabilities?: { temperature?: boolean };
|
|
6
|
+
compat?: { supportsTemperature?: boolean; supportsSamplingParams?: boolean };
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const loggedDecisions = new Set<string>();
|
|
10
|
+
|
|
11
|
+
export function temperatureCapability(metadata: unknown): boolean | undefined {
|
|
12
|
+
if (!metadata || typeof metadata !== "object") return undefined;
|
|
13
|
+
const model = metadata as TemperatureMetadata;
|
|
14
|
+
const supported =
|
|
15
|
+
model.capabilities?.temperature ??
|
|
16
|
+
model.temperature ??
|
|
17
|
+
model.compat?.supportsTemperature ??
|
|
18
|
+
model.compat?.supportsSamplingParams;
|
|
19
|
+
return typeof supported === "boolean" ? supported : undefined;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Where a temperature decision came from: the host's own model metadata, the models.dev
|
|
24
|
+
* catalog OpenCode caches on disk, or nothing (which omits temperature).
|
|
25
|
+
*/
|
|
26
|
+
export type TemperatureSource = "host" | "catalog" | "none";
|
|
27
|
+
|
|
28
|
+
export interface TemperatureDecision {
|
|
29
|
+
supported: boolean | undefined;
|
|
30
|
+
source: TemperatureSource;
|
|
31
|
+
/** The models.dev entry (`provider/model`) when the catalog decided. */
|
|
32
|
+
entry?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Host metadata wins whenever it states a boolean. Only when the host is silent do we
|
|
37
|
+
* consult the cached models.dev catalog, matched by provider and model id.
|
|
38
|
+
*/
|
|
39
|
+
export function resolveTemperatureCapability(
|
|
40
|
+
model: string,
|
|
41
|
+
metadata: unknown,
|
|
42
|
+
): TemperatureDecision {
|
|
43
|
+
const host = temperatureCapability(metadata);
|
|
44
|
+
if (host !== undefined) return { supported: host, source: "host" };
|
|
45
|
+
const catalog = catalogTemperature(model);
|
|
46
|
+
if (catalog) return { supported: catalog.temperature, source: "catalog", entry: catalog.entry };
|
|
47
|
+
return { supported: undefined, source: "none" };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function describeTemperatureDecision(model: string, decision: TemperatureDecision): string {
|
|
51
|
+
const verdict = decision.supported === true ? "sent" : "omitted";
|
|
52
|
+
const answer = decision.supported === true ? "yes" : "no";
|
|
53
|
+
const reason =
|
|
54
|
+
decision.source === "host"
|
|
55
|
+
? `host model metadata says ${answer}`
|
|
56
|
+
: decision.source === "catalog"
|
|
57
|
+
? `models.dev cache entry ${decision.entry ?? "unknown"} says ${answer}`
|
|
58
|
+
: "no host or models.dev metadata";
|
|
59
|
+
return `Subagent temperature ${verdict} for ${model}: ${reason}`;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Log each model's decision once per process, and again only if the decision changes. */
|
|
63
|
+
export function logTemperatureDecision(
|
|
64
|
+
model: string,
|
|
65
|
+
decision: TemperatureDecision,
|
|
66
|
+
log: (message: string, decision: TemperatureDecision) => void,
|
|
67
|
+
): void {
|
|
68
|
+
const key = `${model}\u0000${decision.source}\u0000${decision.supported}\u0000${decision.entry ?? ""}`;
|
|
69
|
+
if (loggedDecisions.has(key)) return;
|
|
70
|
+
loggedDecisions.add(key);
|
|
71
|
+
log(describeTemperatureDecision(model, decision), decision);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Only a positive capability permits sampling; reasoning alone is not evidence. */
|
|
75
|
+
export function subagentTemperature(
|
|
76
|
+
model: string,
|
|
77
|
+
metadata: unknown,
|
|
78
|
+
temperature: number | undefined,
|
|
79
|
+
log: (message: string, decision: TemperatureDecision) => void,
|
|
80
|
+
): number | undefined {
|
|
81
|
+
if (temperature === undefined) return undefined;
|
|
82
|
+
const decision = resolveTemperatureCapability(model, metadata);
|
|
83
|
+
logTemperatureDecision(model, decision, log);
|
|
84
|
+
return decision.supported === true ? temperature : undefined;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** OpenCode 1 computes agent sampling before chat.params resolves the final model. */
|
|
88
|
+
export function applyHiddenSubagentTemperature(
|
|
89
|
+
input: { agent: string; model?: TemperatureMetadata & { providerID?: string; id?: string } },
|
|
90
|
+
output: { temperature?: number },
|
|
91
|
+
log: (message: string) => void,
|
|
92
|
+
): void {
|
|
93
|
+
if (!/^(?:historian(?:-|$)|dreamer(?:-|$)|smart-note-compiler$)/.test(input.agent)) return;
|
|
94
|
+
const temperature = subagentTemperature(
|
|
95
|
+
`${input.model?.providerID ?? "unknown"}/${input.model?.id ?? "unknown"}`,
|
|
96
|
+
input.model,
|
|
97
|
+
output.temperature,
|
|
98
|
+
// Host loggers treat a second argument as structured data; the message says it all.
|
|
99
|
+
(message) => log(message),
|
|
100
|
+
);
|
|
101
|
+
if (temperature === undefined) delete output.temperature;
|
|
102
|
+
else output.temperature = temperature;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export const __temperatureTest = {
|
|
106
|
+
reset(): void {
|
|
107
|
+
loggedDecisions.clear();
|
|
108
|
+
__catalogTest.reset();
|
|
109
|
+
},
|
|
110
|
+
};
|