@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,180 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
3
|
-
import { tmpdir } from "node:os";
|
|
4
|
-
import { join } from "node:path";
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
5
2
|
import { resolveLimit, resolveOutputReserve } from "./models-dev-cache";
|
|
6
|
-
import { createTestTempDirFromPath } from "./test-temp-dir";
|
|
7
3
|
import {
|
|
8
4
|
applyProvenInputFloor,
|
|
9
5
|
deriveWindowGeometry,
|
|
10
6
|
formatCompactTokens,
|
|
11
7
|
formatWindowDerivationLine,
|
|
12
|
-
parseWindowOverlay,
|
|
13
8
|
placeholderFilteredOutput,
|
|
14
|
-
readWindowOverlayFile,
|
|
15
|
-
resolveWindowOverlayFacts,
|
|
16
|
-
scalarizeFact,
|
|
17
|
-
type WindowOverlay,
|
|
18
|
-
type WindowOverlayFact,
|
|
19
9
|
} from "./window-geometry";
|
|
20
10
|
|
|
21
|
-
const fixture = JSON.parse(
|
|
22
|
-
readFileSync(new URL("./__fixtures__/window-overlay.v1.json", import.meta.url), "utf8"),
|
|
23
|
-
) as unknown;
|
|
24
|
-
const parsedFixture = parseWindowOverlay(fixture).overlay as WindowOverlay;
|
|
25
|
-
const tempDirs: string[] = [];
|
|
26
|
-
|
|
27
|
-
function fact(
|
|
28
|
-
value: WindowOverlayFact["value"],
|
|
29
|
-
overrides: Partial<WindowOverlayFact> = {},
|
|
30
|
-
): WindowOverlayFact {
|
|
31
|
-
return {
|
|
32
|
-
value,
|
|
33
|
-
grade: "measured",
|
|
34
|
-
units: "provider",
|
|
35
|
-
boundary: "Observed",
|
|
36
|
-
source_ref: "test",
|
|
37
|
-
observed_at: "2026-08-13T00:00:00Z",
|
|
38
|
-
...overrides,
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function overlay(
|
|
43
|
-
provider: string,
|
|
44
|
-
model: string,
|
|
45
|
-
facts: Record<string, WindowOverlayFact>,
|
|
46
|
-
): WindowOverlay {
|
|
47
|
-
return {
|
|
48
|
-
schema: "fusiform-window-overlay/v1",
|
|
49
|
-
generated_at: "2026-08-13T00:00:00Z",
|
|
50
|
-
minted_provider_ids: [],
|
|
51
|
-
cells: [{ provider_id: provider, model_id: model, facts }],
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
afterEach(() => {
|
|
56
|
-
for (const path of tempDirs.splice(0)) rmSync(path, { recursive: true, force: true });
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
describe("Fusiform overlay v1", () => {
|
|
60
|
-
test("scalarizes every tagged union conservatively", () => {
|
|
61
|
-
expect(scalarizeFact({ kind: "stated", value: 272_000 })).toBe(272_000);
|
|
62
|
-
expect(scalarizeFact({ kind: "bracket", at_least: 340_000, below: 372_001 })).toBe(340_000);
|
|
63
|
-
expect(scalarizeFact({ kind: "bracket", below: 372_001 })).toBeUndefined();
|
|
64
|
-
expect(scalarizeFact({ kind: "unknown", why: "never_measured" })).toBeUndefined();
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
test("preserves a half-open bracket and derives exactly from at_least", () => {
|
|
68
|
-
const halfOpen = parseWindowOverlay({
|
|
69
|
-
schema: "fusiform-window-overlay/v1",
|
|
70
|
-
generated_at: "2026-08-13T00:00:00Z",
|
|
71
|
-
minted_provider_ids: [],
|
|
72
|
-
cells: [
|
|
73
|
-
{
|
|
74
|
-
provider_id: "openai-chatgpt-oauth",
|
|
75
|
-
model_id: "gpt-5.6-sol",
|
|
76
|
-
facts: {
|
|
77
|
-
"window.advertised": fact({ kind: "stated", value: 272_000 }),
|
|
78
|
-
"window.enforced": fact({ kind: "bracket", at_least: 340_000 }),
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
}).overlay;
|
|
83
|
-
const parsedValue = halfOpen?.cells[0]?.facts["window.enforced"]?.value;
|
|
84
|
-
expect(parsedValue).toEqual({ kind: "bracket", at_least: 340_000 });
|
|
85
|
-
expect(parsedValue && "below" in parsedValue).toBe(false);
|
|
86
|
-
const halfOpenResult = deriveWindowGeometry(
|
|
87
|
-
"openai-chatgpt-oauth",
|
|
88
|
-
"gpt-5.6-sol",
|
|
89
|
-
{ context: 272_000, output: 128_000 },
|
|
90
|
-
{
|
|
91
|
-
overlay: resolveWindowOverlayFacts("openai-chatgpt-oauth", "gpt-5.6-sol", halfOpen),
|
|
92
|
-
},
|
|
93
|
-
);
|
|
94
|
-
const statedResult = deriveWindowGeometry(
|
|
95
|
-
"openai-chatgpt-oauth",
|
|
96
|
-
"gpt-5.6-sol",
|
|
97
|
-
{ context: 272_000, output: 128_000 },
|
|
98
|
-
{
|
|
99
|
-
overlay: resolveWindowOverlayFacts(
|
|
100
|
-
"openai-chatgpt-oauth",
|
|
101
|
-
"gpt-5.6-sol",
|
|
102
|
-
overlay("openai-chatgpt-oauth", "gpt-5.6-sol", {
|
|
103
|
-
"window.enforced": fact({ kind: "stated", value: 340_000 }),
|
|
104
|
-
}),
|
|
105
|
-
),
|
|
106
|
-
},
|
|
107
|
-
);
|
|
108
|
-
expect(halfOpenResult).toEqual(statedResult);
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
test("specific cells override wildcard facts per fact", () => {
|
|
112
|
-
const data: WindowOverlay = {
|
|
113
|
-
schema: "fusiform-window-overlay/v1",
|
|
114
|
-
generated_at: "2026-08-13T00:00:00Z",
|
|
115
|
-
minted_provider_ids: [],
|
|
116
|
-
cells: [
|
|
117
|
-
{
|
|
118
|
-
provider_id: "ollama-cloud",
|
|
119
|
-
model_id: "*",
|
|
120
|
-
facts: {
|
|
121
|
-
"output.enforced": fact({ kind: "stated", value: 65_536 }),
|
|
122
|
-
geometry: fact({ kind: "stated", value: "shared_upfront" }),
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
provider_id: "ollama-cloud",
|
|
127
|
-
model_id: "deepseek-v4",
|
|
128
|
-
facts: {
|
|
129
|
-
"output.enforced": fact({ kind: "stated", value: 32_000 }),
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
],
|
|
133
|
-
};
|
|
134
|
-
const facts = resolveWindowOverlayFacts("ollama-cloud", "deepseek-v4", data)?.facts;
|
|
135
|
-
expect(scalarizeFact(facts?.["output.enforced"]?.value as never)).toBe(32_000);
|
|
136
|
-
expect(facts?.geometry?.value).toEqual({ kind: "stated", value: "shared_upfront" });
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
test("refuses an unrecognized schema before considering familiar cells", () => {
|
|
140
|
-
const v2 = {
|
|
141
|
-
...(fixture as Record<string, unknown>),
|
|
142
|
-
schema: "fusiform-window-overlay/v2",
|
|
143
|
-
};
|
|
144
|
-
const parsed = parseWindowOverlay(v2);
|
|
145
|
-
expect(parsed.overlay).toBeUndefined();
|
|
146
|
-
expect(parsed.refusal).toContain("unrecognized schema");
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
test("skips bad cells once and keeps valid cells", () => {
|
|
150
|
-
const badCell = {
|
|
151
|
-
provider_id: "bad",
|
|
152
|
-
model_id: "model",
|
|
153
|
-
facts: { "window.enforced": { value: { kind: "stated", value: 1_000_000 } } },
|
|
154
|
-
};
|
|
155
|
-
const parsed = parseWindowOverlay({
|
|
156
|
-
...(fixture as Record<string, unknown>),
|
|
157
|
-
cells: [badCell, ...(fixture as { cells: unknown[] }).cells],
|
|
158
|
-
});
|
|
159
|
-
expect(parsed.badCells).toBe(1);
|
|
160
|
-
expect(parsed.overlay?.cells.length).toBe(parsedFixture.cells.length);
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
test("a missing file is silent and a bad file logs one summary", () => {
|
|
164
|
-
const dir = createTestTempDirFromPath(join(tmpdir(), "window-overlay-test-"));
|
|
165
|
-
tempDirs.push(dir);
|
|
166
|
-
const logs: string[] = [];
|
|
167
|
-
expect(
|
|
168
|
-
readWindowOverlayFile(join(dir, "missing.json"), (message) => logs.push(message)),
|
|
169
|
-
).toBeUndefined();
|
|
170
|
-
expect(logs).toEqual([]);
|
|
171
|
-
const path = join(dir, "bad.json");
|
|
172
|
-
writeFileSync(path, JSON.stringify({ ...(fixture as object), schema: "v2" }));
|
|
173
|
-
expect(readWindowOverlayFile(path, (message) => logs.push(message))).toBeUndefined();
|
|
174
|
-
expect(logs).toHaveLength(1);
|
|
175
|
-
});
|
|
176
|
-
});
|
|
177
|
-
|
|
178
11
|
describe("window geometry", () => {
|
|
179
12
|
test("filters placeholders independently in both directions", () => {
|
|
180
13
|
expect(placeholderFilteredOutput(0, 1_000_000)).toBeUndefined();
|
|
@@ -190,63 +23,106 @@ describe("window geometry", () => {
|
|
|
190
23
|
).toBe(300_000);
|
|
191
24
|
});
|
|
192
25
|
|
|
193
|
-
test("
|
|
26
|
+
test("preserves catalog geometry for representative models", () => {
|
|
194
27
|
const cases = [
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
{ context, output },
|
|
212
|
-
{
|
|
213
|
-
overlay: resolveWindowOverlayFacts(provider, model, parsedFixture),
|
|
28
|
+
{
|
|
29
|
+
provider: "openai",
|
|
30
|
+
model: "gpt-4o",
|
|
31
|
+
limit: { context: 128_000, output: 16_384 },
|
|
32
|
+
expected: {
|
|
33
|
+
usableSoft: 111_616,
|
|
34
|
+
usableHard: 111_616,
|
|
35
|
+
geometry: "shared_upfront",
|
|
36
|
+
derivation: {
|
|
37
|
+
window: 128_000,
|
|
38
|
+
reserve: 16_384,
|
|
39
|
+
reserveSource: "output_catalog",
|
|
40
|
+
geometry: "shared_upfront",
|
|
41
|
+
windowSource: "catalog",
|
|
42
|
+
absoluteWall: 128_000,
|
|
43
|
+
},
|
|
214
44
|
},
|
|
215
|
-
|
|
216
|
-
expect(Math.floor((result?.usableSoft ?? 0) * 0.65)).toBe(expectedExecute);
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
test("grok derives from geometry, window, and default output without an enforced output", () => {
|
|
221
|
-
const facts = resolveWindowOverlayFacts("xai", "grok-4.6", parsedFixture);
|
|
222
|
-
expect(facts?.facts["output.enforced"]).toBeUndefined();
|
|
223
|
-
const result = deriveWindowGeometry(
|
|
224
|
-
"xai",
|
|
225
|
-
"grok-4.6",
|
|
226
|
-
{ context: 500_000, output: 500_000 },
|
|
227
|
-
{ overlay: facts },
|
|
228
|
-
);
|
|
229
|
-
expect(result?.geometry).toBe("shared_truncating");
|
|
230
|
-
expect(result?.usableSoft).toBe(468_000);
|
|
231
|
-
});
|
|
232
|
-
|
|
233
|
-
test("kimi reserves its default output instead of placeholder advertised output", () => {
|
|
234
|
-
const result = deriveWindowGeometry(
|
|
235
|
-
"moonshotai",
|
|
236
|
-
"kimi-k3",
|
|
237
|
-
{ context: 1_048_576, output: 1_048_576 },
|
|
45
|
+
},
|
|
238
46
|
{
|
|
239
|
-
|
|
47
|
+
provider: "anthropic",
|
|
48
|
+
model: "claude-3-7-sonnet",
|
|
49
|
+
limit: { context: 200_000, output: 64_000 },
|
|
50
|
+
expected: {
|
|
51
|
+
usableSoft: 150_000,
|
|
52
|
+
usableHard: 195_904,
|
|
53
|
+
geometry: "shared_truncating",
|
|
54
|
+
derivation: {
|
|
55
|
+
window: 200_000,
|
|
56
|
+
reserve: 50_000,
|
|
57
|
+
reserveSource: "output_catalog",
|
|
58
|
+
geometry: "shared_truncating",
|
|
59
|
+
windowSource: "catalog",
|
|
60
|
+
absoluteWall: 200_000,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
240
63
|
},
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
64
|
+
{
|
|
65
|
+
provider: "google",
|
|
66
|
+
model: "gemini-2.5-pro",
|
|
67
|
+
limit: { context: 1_000_000, output: 65_536 },
|
|
68
|
+
expected: {
|
|
69
|
+
usableSoft: 1_000_000,
|
|
70
|
+
usableHard: 1_000_000,
|
|
71
|
+
geometry: "separate",
|
|
72
|
+
derivation: {
|
|
73
|
+
window: 1_000_000,
|
|
74
|
+
reserve: 0,
|
|
75
|
+
reserveSource: "none",
|
|
76
|
+
geometry: "separate",
|
|
77
|
+
windowSource: "catalog",
|
|
78
|
+
absoluteWall: 1_000_000,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
provider: "xai",
|
|
84
|
+
model: "grok-3",
|
|
85
|
+
limit: { context: 131_072, output: 32_768 },
|
|
86
|
+
expected: {
|
|
87
|
+
usableSoft: 98_304,
|
|
88
|
+
usableHard: 126_976,
|
|
89
|
+
geometry: "shared_truncating",
|
|
90
|
+
derivation: {
|
|
91
|
+
window: 131_072,
|
|
92
|
+
reserve: 32_768,
|
|
93
|
+
reserveSource: "output_catalog",
|
|
94
|
+
geometry: "shared_truncating",
|
|
95
|
+
windowSource: "catalog",
|
|
96
|
+
absoluteWall: 131_072,
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
provider: "openai-codex",
|
|
102
|
+
model: "gpt-5.6-sol",
|
|
103
|
+
limit: { context: 272_000, output: 128_000 },
|
|
104
|
+
expected: {
|
|
105
|
+
usableSoft: 204_000,
|
|
106
|
+
usableHard: 240_000,
|
|
107
|
+
geometry: "shared_upfront",
|
|
108
|
+
derivation: {
|
|
109
|
+
window: 272_000,
|
|
110
|
+
reserve: 68_000,
|
|
111
|
+
reserveSource: "output_catalog",
|
|
112
|
+
geometry: "shared_upfront",
|
|
113
|
+
windowSource: "catalog",
|
|
114
|
+
absoluteWall: 272_000,
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
] as const;
|
|
119
|
+
|
|
120
|
+
for (const { provider, model, limit, expected } of cases) {
|
|
121
|
+
expect(deriveWindowGeometry(provider, model, limit)).toEqual(expected);
|
|
122
|
+
}
|
|
244
123
|
});
|
|
245
124
|
|
|
246
|
-
test("output_reserve forms override a pre-carved input and
|
|
247
|
-
const data = overlay("openai-codex", "gpt-5.6-sol", {
|
|
248
|
-
"output.enforced": fact({ kind: "stated", value: 68_000 }),
|
|
249
|
-
});
|
|
125
|
+
test("output_reserve forms override a pre-carved input and catalog output", () => {
|
|
250
126
|
const cases = [
|
|
251
127
|
16_384,
|
|
252
128
|
{ default: 16_384 },
|
|
@@ -259,7 +135,6 @@ describe("window geometry", () => {
|
|
|
259
135
|
"gpt-5.6-sol",
|
|
260
136
|
{ context: 400_000, input: 272_000, output: 128_000 },
|
|
261
137
|
{
|
|
262
|
-
overlay: resolveWindowOverlayFacts("openai-codex", "gpt-5.6-sol", data),
|
|
263
138
|
outputReserveOverride: resolveOutputReserve(
|
|
264
139
|
"openai-codex",
|
|
265
140
|
"gpt-5.6-sol",
|
|
@@ -276,27 +151,18 @@ describe("window geometry", () => {
|
|
|
276
151
|
}
|
|
277
152
|
});
|
|
278
153
|
|
|
279
|
-
test("provider hook
|
|
280
|
-
const
|
|
281
|
-
|
|
282
|
-
|
|
154
|
+
test("provider hook overrides catalog limits field by field", () => {
|
|
155
|
+
const catalog = deriveWindowGeometry("provider", "model", {
|
|
156
|
+
context: 200_000,
|
|
157
|
+
output: 10_000,
|
|
283
158
|
});
|
|
284
|
-
const overlayOnly = deriveWindowGeometry(
|
|
285
|
-
"provider",
|
|
286
|
-
"model",
|
|
287
|
-
{ context: 200_000, output: 10_000 },
|
|
288
|
-
{ overlay: resolveWindowOverlayFacts("provider", "model", data) },
|
|
289
|
-
);
|
|
290
159
|
const hooked = deriveWindowGeometry(
|
|
291
160
|
"provider",
|
|
292
161
|
"model",
|
|
293
162
|
{ context: 200_000, output: 10_000 },
|
|
294
|
-
{
|
|
295
|
-
overlay: resolveWindowOverlayFacts("provider", "model", data),
|
|
296
|
-
providerLimit: { context: 400_000, output: 30_000 },
|
|
297
|
-
},
|
|
163
|
+
{ providerLimit: { context: 400_000, output: 30_000 } },
|
|
298
164
|
);
|
|
299
|
-
expect(
|
|
165
|
+
expect(catalog?.derivation.window).toBe(200_000);
|
|
300
166
|
expect(hooked?.derivation.window).toBe(400_000);
|
|
301
167
|
expect(hooked?.derivation.reserve).toBe(30_000);
|
|
302
168
|
});
|
|
@@ -360,7 +226,7 @@ describe("window geometry", () => {
|
|
|
360
226
|
expect(logs[0]).toContain("clamped");
|
|
361
227
|
});
|
|
362
228
|
|
|
363
|
-
test("
|
|
229
|
+
test("catalog usableSoft matches the legacy resolver", () => {
|
|
364
230
|
const corpus = [
|
|
365
231
|
["openai", "real", { context: 200_000, output: 32_000 }],
|
|
366
232
|
["openai", "zero", { context: 200_000, output: 0 }],
|