@cortexkit/opencode-magic-context 0.42.6 → 0.43.0
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/README.md +4 -5
- package/dist/agents/dreamer.d.ts +7 -9
- package/dist/agents/dreamer.d.ts.map +1 -1
- package/dist/agents/hidden-agent-registrations.d.ts.map +1 -1
- package/dist/agents/magic-context-prompt.d.ts.map +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/live-run-config.d.ts +12 -0
- package/dist/config/live-run-config.d.ts.map +1 -0
- package/dist/config/live-snapshot.d.ts +32 -0
- package/dist/config/live-snapshot.d.ts.map +1 -0
- package/dist/config/schema/magic-context.d.ts +12 -2
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/{conflict-warning-hook-aktepwpz.js → conflict-warning-hook-t2vb0wnx.js} +3 -3
- package/dist/{derive-budgets-v1fkhjjr.js → derive-budgets-0sg5vp61.js} +5 -2
- package/dist/features/builtin-commands/commands.d.ts +0 -4
- package/dist/features/builtin-commands/commands.d.ts.map +1 -1
- package/dist/features/magic-context/compaction-marker.d.ts +6 -0
- package/dist/features/magic-context/compaction-marker.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts +4 -1
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-lease.d.ts +8 -0
- package/dist/features/magic-context/compartment-lease.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-storage.d.ts +21 -0
- package/dist/features/magic-context/compartment-storage.d.ts.map +1 -1
- package/dist/features/magic-context/context-authority.d.ts +9 -2
- package/dist/features/magic-context/context-authority.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/classify.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/docs-proposals.d.ts +23 -0
- package/dist/features/magic-context/dreamer/docs-proposals.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/evaluate-smart-notes.d.ts +5 -1
- package/dist/features/magic-context/dreamer/evaluate-smart-notes.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/hidden-single-shot.d.ts +48 -0
- package/dist/features/magic-context/dreamer/hidden-single-shot.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/manual-summary.d.ts +7 -0
- package/dist/features/magic-context/dreamer/manual-summary.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/map-memories.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/promote-primers.d.ts +8 -1
- package/dist/features/magic-context/dreamer/promote-primers.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/refresh-primers.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/retrospective-orphan-sweep.d.ts +5 -2
- package/dist/features/magic-context/dreamer/retrospective-orphan-sweep.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/retrospective-raw-provider.d.ts +22 -13
- package/dist/features/magic-context/dreamer/retrospective-raw-provider.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/storage-task-schedule.d.ts +9 -0
- package/dist/features/magic-context/dreamer/storage-task-schedule.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-config.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-executor.d.ts +3 -0
- package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-prompts.d.ts +7 -4
- package/dist/features/magic-context/dreamer/task-prompts.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-registry.d.ts +53 -2
- package/dist/features/magic-context/dreamer/task-registry.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts +3 -0
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/tick-failure.d.ts +38 -0
- package/dist/features/magic-context/dreamer/tick-failure.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/verify.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-identity.d.ts +1 -0
- package/dist/features/magic-context/memory/embedding-identity.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-local.d.ts.map +1 -1
- package/dist/features/magic-context/memory/memory-diagnostics.d.ts +6 -0
- package/dist/features/magic-context/memory/memory-diagnostics.d.ts.map +1 -0
- package/dist/features/magic-context/memory/memory-selection.d.ts +12 -0
- package/dist/features/magic-context/memory/memory-selection.d.ts.map +1 -0
- package/dist/features/magic-context/memory/memory-visibility.d.ts +46 -0
- package/dist/features/magic-context/memory/memory-visibility.d.ts.map +1 -0
- package/dist/features/magic-context/memory/mirror-reembed.d.ts +22 -0
- package/dist/features/magic-context/memory/mirror-reembed.d.ts.map +1 -0
- package/dist/features/magic-context/memory/project-identity.d.ts +9 -0
- package/dist/features/magic-context/memory/project-identity.d.ts.map +1 -1
- package/dist/features/magic-context/memory/storage-memory-fts.d.ts +6 -2
- package/dist/features/magic-context/memory/storage-memory-fts.d.ts.map +1 -1
- package/dist/features/magic-context/memory/storage-memory.d.ts.map +1 -1
- package/dist/features/magic-context/memory/transformers-remote-host.d.ts +6 -0
- package/dist/features/magic-context/memory/transformers-remote-host.d.ts.map +1 -0
- package/dist/features/magic-context/memory/transformers-web-entry.d.ts.map +1 -1
- package/dist/features/magic-context/message-fts-rowid-map.d.ts +3 -1
- package/dist/features/magic-context/message-fts-rowid-map.d.ts.map +1 -1
- package/dist/features/magic-context/message-index-async.d.ts +8 -3
- package/dist/features/magic-context/message-index-async.d.ts.map +1 -1
- package/dist/features/magic-context/message-index.d.ts +7 -1
- package/dist/features/magic-context/message-index.d.ts.map +1 -1
- package/dist/features/magic-context/message-time-backfill.d.ts +19 -0
- package/dist/features/magic-context/message-time-backfill.d.ts.map +1 -0
- package/dist/features/magic-context/migrations.d.ts +10 -6
- package/dist/features/magic-context/migrations.d.ts.map +1 -1
- package/dist/features/magic-context/mural/compress-cues.d.ts.map +1 -1
- package/dist/features/magic-context/mural/storage-mural.d.ts +5 -0
- package/dist/features/magic-context/mural/storage-mural.d.ts.map +1 -1
- package/dist/features/magic-context/opencode2-relabel.d.ts +132 -0
- package/dist/features/magic-context/opencode2-relabel.d.ts.map +1 -0
- package/dist/features/magic-context/overflow-detection.d.ts +3 -0
- package/dist/features/magic-context/overflow-detection.d.ts.map +1 -1
- package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
- package/dist/features/magic-context/protection-window.d.ts +1 -1
- package/dist/features/magic-context/protection-window.d.ts.map +1 -1
- package/dist/features/magic-context/search.d.ts +6 -0
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/features/magic-context/session-decision-calibration.d.ts +31 -0
- package/dist/features/magic-context/session-decision-calibration.d.ts.map +1 -0
- package/dist/features/magic-context/shadow-backfill-state.d.ts +1 -1
- package/dist/features/magic-context/shadow-backfill-state.d.ts.map +1 -1
- package/dist/features/magic-context/smart-notes/compiler.d.ts +5 -1
- package/dist/features/magic-context/smart-notes/compiler.d.ts.map +1 -1
- package/dist/features/magic-context/storage-clone.d.ts.map +1 -1
- package/dist/features/magic-context/storage-db.d.ts +1 -1
- package/dist/features/magic-context/storage-db.d.ts.map +1 -1
- package/dist/features/magic-context/storage-historian-runs.d.ts +4 -2
- package/dist/features/magic-context/storage-historian-runs.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +16 -2
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-shared.d.ts +1 -1
- package/dist/features/magic-context/storage-meta-shared.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-notes.d.ts +1 -0
- package/dist/features/magic-context/storage-notes.d.ts.map +1 -1
- package/dist/features/magic-context/storage-replay-document.d.ts +2 -0
- package/dist/features/magic-context/storage-replay-document.d.ts.map +1 -1
- package/dist/features/magic-context/storage-subagent-invocations.d.ts +1 -1
- package/dist/features/magic-context/storage-subagent-invocations.d.ts.map +1 -1
- package/dist/features/magic-context/storage-tags.d.ts +42 -4
- package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
- package/dist/features/magic-context/storage.d.ts +2 -2
- package/dist/features/magic-context/storage.d.ts.map +1 -1
- package/dist/features/magic-context/store-generation-rebase.d.ts +95 -0
- package/dist/features/magic-context/store-generation-rebase.d.ts.map +1 -0
- package/dist/features/magic-context/subagent-token-capture.d.ts +1 -0
- package/dist/features/magic-context/subagent-token-capture.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/tool-definition-tokens.d.ts +1 -0
- package/dist/features/magic-context/tool-definition-tokens.d.ts.map +1 -1
- package/dist/features/magic-context/tool-owner-backfill.d.ts.map +1 -1
- package/dist/features/magic-context/user-memory/review-user-memories.d.ts +5 -1
- package/dist/features/magic-context/user-memory/review-user-memories.d.ts.map +1 -1
- package/dist/hooks/magic-context/apply-operations.d.ts +10 -1
- package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
- package/dist/hooks/magic-context/cache-busting-signals.d.ts +19 -3
- package/dist/hooks/magic-context/cache-busting-signals.d.ts.map +1 -1
- package/dist/hooks/magic-context/command-handler.d.ts +5 -4
- package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/compaction-marker-manager.d.ts.map +1 -1
- package/dist/hooks/magic-context/compaction-off-transition.d.ts +1 -0
- package/dist/hooks/magic-context/compaction-off-transition.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-prompt.d.ts +1 -1
- package/dist/hooks/magic-context/compartment-prompt.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-render-epoch.d.ts +3 -1
- package/dist/hooks/magic-context/compartment-render-epoch.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-drop-queue.d.ts +1 -1
- package/dist/hooks/magic-context/compartment-runner-drop-queue.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts +1 -0
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts +8 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-recomp.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-types.d.ts +19 -11
- package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts +4 -1
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-trigger.d.ts.map +1 -1
- package/dist/hooks/magic-context/decay-render.d.ts +1 -0
- package/dist/hooks/magic-context/decay-render.d.ts.map +1 -1
- package/dist/hooks/magic-context/decision-calibration.d.ts +24 -0
- package/dist/hooks/magic-context/decision-calibration.d.ts.map +1 -0
- package/dist/hooks/magic-context/derive-budgets.d.ts +2 -0
- package/dist/hooks/magic-context/derive-budgets.d.ts.map +1 -1
- package/dist/hooks/magic-context/dropped-input-guard.d.ts +50 -4
- package/dist/hooks/magic-context/dropped-input-guard.d.ts.map +1 -1
- package/dist/hooks/magic-context/embed-history-runner.d.ts +30 -0
- package/dist/hooks/magic-context/embed-history-runner.d.ts.map +1 -0
- package/dist/hooks/magic-context/emergency-drop.d.ts +13 -8
- package/dist/hooks/magic-context/emergency-drop.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-payloads.d.ts +2 -1
- package/dist/hooks/magic-context/event-payloads.d.ts.map +1 -1
- package/dist/hooks/magic-context/execute-status.d.ts +2 -1
- package/dist/hooks/magic-context/execute-status.d.ts.map +1 -1
- package/dist/hooks/magic-context/final-wire-token-estimate.d.ts +12 -4
- package/dist/hooks/magic-context/final-wire-token-estimate.d.ts.map +1 -1
- package/dist/hooks/magic-context/heuristic-cleanup.d.ts.map +1 -1
- package/dist/hooks/magic-context/historian-no-fire-cause.d.ts +5 -0
- package/dist/hooks/magic-context/historian-no-fire-cause.d.ts.map +1 -0
- package/dist/hooks/magic-context/historian-publish-stage-logger.d.ts +3 -0
- package/dist/hooks/magic-context/historian-publish-stage-logger.d.ts.map +1 -0
- package/dist/hooks/magic-context/hook-handlers.d.ts +0 -3
- package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts +4 -4
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/host-served-rows.d.ts +58 -0
- package/dist/hooks/magic-context/host-served-rows.d.ts.map +1 -0
- package/dist/hooks/magic-context/inject-compartments.d.ts +38 -0
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/legacy-compartments.d.ts +20 -0
- package/dist/hooks/magic-context/legacy-compartments.d.ts.map +1 -0
- package/dist/hooks/magic-context/live-session-state.d.ts +7 -7
- package/dist/hooks/magic-context/m0-token-breakdown.d.ts +6 -0
- package/dist/hooks/magic-context/m0-token-breakdown.d.ts.map +1 -1
- package/dist/hooks/magic-context/maintenance-authority.d.ts +0 -1
- package/dist/hooks/magic-context/maintenance-authority.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-state-sync.d.ts +1 -1
- package/dist/hooks/magic-context/module-state-sync.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-transport.d.ts +1 -1
- package/dist/hooks/magic-context/module-transport.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-wire.d.ts +42 -0
- package/dist/hooks/magic-context/module-wire.d.ts.map +1 -1
- package/dist/hooks/magic-context/note-nudger.d.ts.map +1 -1
- package/dist/hooks/magic-context/postprocess-read-cache.d.ts +8 -0
- package/dist/hooks/magic-context/postprocess-read-cache.d.ts.map +1 -0
- package/dist/hooks/magic-context/producer-window-guard.d.ts +16 -0
- package/dist/hooks/magic-context/producer-window-guard.d.ts.map +1 -1
- package/dist/hooks/magic-context/producer-window-test-support.d.ts +14 -0
- package/dist/hooks/magic-context/producer-window-test-support.d.ts.map +1 -0
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts +2 -0
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-chunk.d.ts +45 -10
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-db.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-raw.d.ts +4 -0
- package/dist/hooks/magic-context/read-session-raw.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts +6 -0
- package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts.map +1 -1
- package/dist/hooks/magic-context/recomp-orchestrator.d.ts +17 -39
- package/dist/hooks/magic-context/recomp-orchestrator.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-mode-transform.d.ts +24 -3
- package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/sentinel.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-prompt-hash.d.ts +6 -7
- package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-messages.d.ts +21 -1
- package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
- package/dist/hooks/magic-context/tail-hygiene-walk.d.ts +63 -0
- package/dist/hooks/magic-context/tail-hygiene-walk.d.ts.map +1 -1
- package/dist/hooks/magic-context/tokenizer-calibration.d.ts +19 -12
- package/dist/hooks/magic-context/tokenizer-calibration.d.ts.map +1 -1
- package/dist/hooks/magic-context/tool-drop-target.d.ts +52 -1
- package/dist/hooks/magic-context/tool-drop-target.d.ts.map +1 -1
- package/dist/hooks/magic-context/tool-sweep-policy.d.ts +50 -0
- package/dist/hooks/magic-context/tool-sweep-policy.d.ts.map +1 -0
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts +20 -1
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-context-state.d.ts +9 -0
- package/dist/hooks/magic-context/transform-context-state.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +5 -3
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +37 -4
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/wrapup-orchestrator.d.ts.map +1 -1
- package/dist/{index-f9gem5cr.js → index-8w1skpnm.js} +85 -5
- package/dist/index-99sfbrrf.js +170 -0
- package/dist/index-9skq8m9y.js +16 -0
- package/dist/{index-djp6rwz6.js → index-d0dh7v0f.js} +28130 -30282
- package/dist/{index-s61hh7gv.js → index-rpz2me0v.js} +94 -72
- package/dist/{index-ngjmj6xx.js → index-rvwvdq59.js} +1 -1
- package/dist/index-w2ety11c.js +393 -0
- package/dist/index-y5145x8k.js +619 -0
- package/dist/index-ygwdyntq.js +5407 -0
- package/dist/{index-a9ssj59b.js → index-ykg9sdzz.js} +55 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5749 -3006
- package/dist/message-time-backfill-gzjer78y.js +108 -0
- package/dist/plugin/dream-timer.d.ts +13 -0
- package/dist/plugin/dream-timer.d.ts.map +1 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts +5 -2
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/plugin/memory-id-translation.d.ts +86 -0
- package/dist/plugin/memory-id-translation.d.ts.map +1 -1
- package/dist/plugin/messages-transform.d.ts.map +1 -1
- package/dist/plugin/rpc-handlers.d.ts +10 -0
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/plugin/rust-note-backend.d.ts +84 -0
- package/dist/plugin/rust-note-backend.d.ts.map +1 -0
- package/dist/plugin/tool-registry.d.ts +1 -0
- package/dist/plugin/tool-registry.d.ts.map +1 -1
- package/dist/read-session-chunk-ec3jkvhg.js +61 -0
- package/dist/{recomp-orchestrator-0xx1364v.js → recomp-orchestrator-6akjp11f.js} +8 -8
- package/dist/{send-session-notification-jbxknvar.js → send-session-notification-f6gwkesy.js} +2 -2
- package/dist/shared/assistant-message-extractor.d.ts +6 -0
- package/dist/shared/assistant-message-extractor.d.ts.map +1 -1
- package/dist/shared/conflict-detector.d.ts +9 -4
- package/dist/shared/conflict-detector.d.ts.map +1 -1
- package/dist/shared/hidden-variant-warnings.d.ts +5 -0
- package/dist/shared/hidden-variant-warnings.d.ts.map +1 -0
- package/dist/shared/host-limitations.d.ts +14 -0
- package/dist/shared/host-limitations.d.ts.map +1 -0
- package/dist/shared/keep-subagents.d.ts +1 -1
- package/dist/shared/keep-subagents.d.ts.map +1 -1
- package/dist/shared/model-suggestion-retry.d.ts.map +1 -1
- package/dist/shared/models-dev-cache.d.ts +1 -0
- package/dist/shared/models-dev-cache.d.ts.map +1 -1
- package/dist/shared/opencode-config-dir.d.ts +52 -0
- package/dist/shared/opencode-config-dir.d.ts.map +1 -1
- package/dist/shared/opencode-db-path.d.ts +15 -0
- package/dist/shared/opencode-db-path.d.ts.map +1 -1
- package/dist/shared/prompt-surface-runtime.d.ts +5 -5
- package/dist/shared/rpc-server.d.ts +10 -0
- package/dist/shared/rpc-server.d.ts.map +1 -1
- package/dist/shared/rpc-types.d.ts +64 -5
- package/dist/shared/rpc-types.d.ts.map +1 -1
- package/dist/shared/status-detail-text.d.ts +1 -3
- package/dist/shared/status-detail-text.d.ts.map +1 -1
- package/dist/shared/status-summary.d.ts +7 -0
- package/dist/shared/status-summary.d.ts.map +1 -1
- package/dist/shared/status-view.d.ts +229 -0
- package/dist/shared/status-view.d.ts.map +1 -0
- package/dist/shared/tag-transcript.d.ts.map +1 -1
- package/dist/shared/tail-hygiene-status.d.ts +8 -0
- package/dist/shared/tail-hygiene-status.d.ts.map +1 -1
- package/dist/shared/user-facing-codes.d.ts +32 -7
- package/dist/shared/user-facing-codes.d.ts.map +1 -1
- package/dist/shared/window-geometry.d.ts +3 -0
- package/dist/shared/window-geometry.d.ts.map +1 -1
- package/dist/{task-config-cv8k9y8r.js → task-config-ex4nt0q0.js} +1 -1
- package/dist/tools/ctx-expand/constants.d.ts +1 -1
- package/dist/tools/ctx-expand/constants.d.ts.map +1 -1
- package/dist/tools/ctx-expand/render.d.ts.map +1 -1
- package/dist/tools/ctx-expand/tools.d.ts.map +1 -1
- package/dist/tools/ctx-memory/constants.d.ts +3 -1
- package/dist/tools/ctx-memory/constants.d.ts.map +1 -1
- package/dist/tools/ctx-memory/tools.d.ts +1 -0
- package/dist/tools/ctx-memory/tools.d.ts.map +1 -1
- package/dist/tools/ctx-memory/types.d.ts +2 -2
- package/dist/tools/ctx-note/constants.d.ts +1 -1
- package/dist/tools/ctx-note/constants.d.ts.map +1 -1
- package/dist/tools/ctx-note/render.d.ts +88 -0
- package/dist/tools/ctx-note/render.d.ts.map +1 -0
- package/dist/tools/ctx-note/tools.d.ts.map +1 -1
- package/dist/tools/ctx-reduce/constants.d.ts +1 -1
- package/dist/tools/ctx-reduce/constants.d.ts.map +1 -1
- package/dist/tools/ctx-search/constants.d.ts +1 -1
- package/dist/tools/ctx-search/constants.d.ts.map +1 -1
- package/dist/tools/ctx-search/date-range.d.ts +9 -0
- package/dist/tools/ctx-search/date-range.d.ts.map +1 -0
- package/dist/tools/ctx-search/tools.d.ts.map +1 -1
- package/dist/tools/ctx-search/types.d.ts +2 -0
- package/dist/tools/ctx-search/types.d.ts.map +1 -1
- package/dist/tools/light-descriptions.d.ts +5 -5
- package/dist/tools/light-descriptions.d.ts.map +1 -1
- package/dist/tools/parameter-descriptions.d.ts +75 -0
- package/dist/tools/parameter-descriptions.d.ts.map +1 -0
- package/dist/transformers-node-wasm.js +1918 -826
- package/dist/transformers-web.js +1736 -636
- package/dist/{transformers.node-dpmf3wpx.js → transformers.node-3zqr6k1w.js} +4087 -2898
- package/dist/tui/data/context-db.d.ts +19 -7
- package/dist/tui/data/context-db.d.ts.map +1 -1
- package/dist/tui-compiled/data/context-db.d.ts +19 -7
- package/dist/tui-compiled/data/context-db.d.ts.map +1 -1
- package/dist/v2/fold/host-media.d.ts +36 -0
- package/dist/v2/fold/host-media.d.ts.map +1 -0
- package/dist/v2/fold/restore.d.ts +21 -1
- package/dist/v2/fold/restore.d.ts.map +1 -1
- package/dist/v2/hidden-completion.d.ts +45 -1
- package/dist/v2/hidden-completion.d.ts.map +1 -1
- package/dist/v2/hooks/commands.d.ts +29 -0
- package/dist/v2/hooks/commands.d.ts.map +1 -0
- package/dist/v2/hooks/context.d.ts +46 -2
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/deleted-session-tombstones.d.ts +10 -0
- package/dist/v2/hooks/deleted-session-tombstones.d.ts.map +1 -0
- package/dist/v2/hooks/dream-manual.d.ts +43 -0
- package/dist/v2/hooks/dream-manual.d.ts.map +1 -0
- package/dist/v2/hooks/dream-trigger.d.ts +7 -0
- package/dist/v2/hooks/dream-trigger.d.ts.map +1 -1
- package/dist/v2/hooks/hidden-child.d.ts +1 -0
- package/dist/v2/hooks/hidden-child.d.ts.map +1 -1
- package/dist/v2/hooks/model-limit-cache.d.ts +19 -0
- package/dist/v2/hooks/model-limit-cache.d.ts.map +1 -0
- package/dist/v2/hooks/payload.d.ts.map +1 -1
- package/dist/v2/hooks/provider-admission.d.ts +22 -0
- package/dist/v2/hooks/provider-admission.d.ts.map +1 -0
- package/dist/v2/hooks/rpc-live-state.d.ts +9 -0
- package/dist/v2/hooks/rpc-live-state.d.ts.map +1 -0
- package/dist/v2/hooks/store.d.ts +38 -2
- package/dist/v2/hooks/store.d.ts.map +1 -1
- package/dist/v2/hooks/tools.d.ts +8 -0
- package/dist/v2/hooks/tools.d.ts.map +1 -0
- package/dist/v2/hooks/types.d.ts +58 -0
- package/dist/v2/hooks/types.d.ts.map +1 -1
- package/dist/v2/hooks/usage-reading.d.ts +42 -0
- package/dist/v2/hooks/usage-reading.d.ts.map +1 -0
- package/dist/v2/host-service.d.ts +65 -0
- package/dist/v2/host-service.d.ts.map +1 -0
- package/dist/v2/server.js +141678 -111890
- package/dist/v2/store-reader.d.ts +67 -1
- package/dist/v2/store-reader.d.ts.map +1 -1
- package/dist/v2/tui/events.d.ts +7 -0
- package/dist/v2/tui/events.d.ts.map +1 -0
- package/dist/v2/tui/index.d.ts +23 -0
- package/dist/v2/tui/index.d.ts.map +1 -1
- package/dist/v2/tui/sidebar-mount.d.ts +40 -0
- package/dist/v2/tui/sidebar-mount.d.ts.map +1 -0
- package/dist/v2/tui/status-dialog-mount.d.ts +29 -0
- package/dist/v2/tui/status-dialog-mount.d.ts.map +1 -0
- package/dist/v2/tui/types.d.ts +74 -6
- package/dist/v2/tui/types.d.ts.map +1 -1
- package/dist/wrapup-orchestrator-5akc87gr.js +16 -0
- package/package.json +8 -7
- package/src/agents/dreamer.ts +7 -16
- package/src/agents/hidden-agent-registrations.ts +10 -22
- package/src/agents/magic-context-prompt.test.ts +29 -39
- package/src/agents/magic-context-prompt.ts +99 -122
- package/src/agents/permissions.test.ts +17 -21
- package/src/config/index.ts +8 -3
- package/src/config/live-run-config.test.ts +237 -0
- package/src/config/live-run-config.ts +80 -0
- package/src/config/live-schema-drift.test.ts +67 -0
- package/src/config/live-snapshot.test.ts +85 -0
- package/src/config/live-snapshot.ts +191 -0
- package/src/config/raw-loader.test.ts +1 -0
- package/src/config/schema/magic-context.test.ts +13 -5
- package/src/config/schema/magic-context.ts +101 -10
- package/src/features/magic-context/dreamer/task-registry.ts +137 -13
- package/src/shared/assistant-message-extractor.test.ts +21 -0
- package/src/shared/assistant-message-extractor.ts +43 -8
- package/src/shared/child-session-teardown.test.ts +38 -3
- package/src/shared/child-session-teardown.ts +3 -3
- package/src/shared/conflict-detector.test.ts +224 -7
- package/src/shared/conflict-detector.ts +161 -89
- package/src/shared/hidden-variant-warnings.ts +21 -0
- package/src/shared/host-limitations.ts +43 -0
- package/src/shared/keep-subagents.ts +6 -6
- package/src/shared/model-suggestion-retry.test.ts +43 -0
- package/src/shared/model-suggestion-retry.ts +12 -0
- package/src/shared/models-dev-cache.ts +5 -0
- package/src/shared/opencode-config-dir.ts +80 -7
- package/src/shared/opencode-db-path.test.ts +78 -0
- package/src/shared/opencode-db-path.ts +49 -2
- package/src/shared/opencode-host-generation.test.ts +29 -0
- package/src/shared/prompt-surface-a1-golden.md +142 -211
- package/src/shared/rpc-server.ts +18 -0
- package/src/shared/rpc-types.ts +63 -4
- package/src/shared/status-detail-text.test.ts +52 -18
- package/src/shared/status-detail-text.ts +1 -90
- package/src/shared/status-summary.ts +37 -2
- package/src/shared/status-view.test.ts +441 -0
- package/src/shared/status-view.ts +707 -0
- package/src/shared/tag-transcript.ts +115 -16
- package/src/shared/tail-hygiene-status.ts +9 -1
- package/src/shared/user-facing-codes.test.ts +3 -4
- package/src/shared/user-facing-codes.ts +33 -8
- package/src/shared/window-geometry.test.ts +23 -5
- package/src/shared/window-geometry.ts +13 -3
- package/src/tui/data/context-db.ts +50 -15
- package/src/tui/dialogs/status-dialog-colors.test.ts +58 -0
- package/src/tui/dialogs/status-dialog.tsx +288 -0
- package/src/tui/index.tsx +7 -464
- package/src/tui/slots/sidebar-content.tsx +21 -5
- package/src/tui-compiled/data/context-db.ts +50 -15
- package/src/tui-compiled/dialogs/status-dialog.tsx +552 -0
- package/src/tui-compiled/index.tsx +43 -1025
- package/src/tui-compiled/slots/sidebar-content.tsx +173 -152
- package/src/v2/tui/__fixtures__/ga-host-theme.json +160 -0
- package/src/v2/tui/events.ts +23 -0
- package/src/v2/tui/host-contract.test.ts +57 -8
- package/src/v2/tui/index.ts +315 -59
- package/src/v2/tui/load-compiled-sidebar.d.mts +59 -0
- package/src/v2/tui/load-compiled-sidebar.mjs +24 -0
- package/src/v2/tui/load-compiled-status-dialog.d.mts +17 -0
- package/src/v2/tui/load-compiled-status-dialog.mjs +16 -0
- package/src/v2/tui/sidebar-fallback.test.ts +100 -0
- package/src/v2/tui/sidebar-mount.ts +164 -0
- package/src/v2/tui/sidebar-text.test.ts +70 -0
- package/src/v2/tui/status-dialog-fallback.test.ts +97 -0
- package/src/v2/tui/status-dialog-mount.ts +76 -0
- package/src/v2/tui/theme-mapping.test.ts +57 -0
- package/src/v2/tui/types.ts +69 -4
- package/tui.js +1 -0
- package/dist/features/magic-context/memory/memory-migration.d.ts +0 -129
- package/dist/features/magic-context/memory/memory-migration.d.ts.map +0 -1
- package/dist/hooks/magic-context/upgrade-reminder.d.ts +0 -76
- package/dist/hooks/magic-context/upgrade-reminder.d.ts.map +0 -1
- package/dist/index-4wwr6cz0.js +0 -112
- package/dist/index-avwt563y.js +0 -62
- package/dist/index-znraa0kv.js +0 -637
- package/dist/storage-meta-session-z818pn1e.js +0 -20
|
@@ -0,0 +1,619 @@
|
|
|
1
|
+
// src/hooks/magic-context/tokenizer-calibration-seeds.json
|
|
2
|
+
var tokenizer_calibration_seeds_default = [
|
|
3
|
+
{
|
|
4
|
+
prefix: "google/gemini-3.8-flash",
|
|
5
|
+
systemRatio: 0.961167,
|
|
6
|
+
toolsRatio: 0.967504,
|
|
7
|
+
proseRatio: 1.006909
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
prefix: "google/gemini-3.7-flash",
|
|
11
|
+
systemRatio: 0.961167,
|
|
12
|
+
toolsRatio: 0.967504,
|
|
13
|
+
proseRatio: 1.006909
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
prefix: "google/gemini-3.1-pro-preview",
|
|
17
|
+
systemRatio: 0.961167,
|
|
18
|
+
toolsRatio: 0.967504,
|
|
19
|
+
proseRatio: 1.006909
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
prefix: "anthropic/claude-fable-5-1",
|
|
23
|
+
systemRatio: 1.511497,
|
|
24
|
+
toolsRatio: 1.551639,
|
|
25
|
+
proseRatio: 1.571778
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
prefix: "anthropic/claude-opus-5",
|
|
29
|
+
systemRatio: 1.511497,
|
|
30
|
+
toolsRatio: 1.551639,
|
|
31
|
+
proseRatio: 1.571778
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
prefix: "anthropic/claude-sonnet-5",
|
|
35
|
+
systemRatio: 1.511497,
|
|
36
|
+
toolsRatio: 1.554814,
|
|
37
|
+
proseRatio: 1.571815
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
prefix: "openrouter/anthropic/claude-fable-5-1",
|
|
41
|
+
systemRatio: 1.511497,
|
|
42
|
+
toolsRatio: 1.551639,
|
|
43
|
+
proseRatio: 1.571778
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
prefix: "openrouter/anthropic/claude-opus-5",
|
|
47
|
+
systemRatio: 1.511497,
|
|
48
|
+
toolsRatio: 1.551639,
|
|
49
|
+
proseRatio: 1.571778
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
prefix: "openrouter/anthropic/claude-sonnet-5",
|
|
53
|
+
systemRatio: 1.511497,
|
|
54
|
+
toolsRatio: 1.554814,
|
|
55
|
+
proseRatio: 1.571815
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
prefix: "github-copilot/claude-fable-5-1",
|
|
59
|
+
systemRatio: 1.511497,
|
|
60
|
+
toolsRatio: 1.551639,
|
|
61
|
+
proseRatio: 1.571778
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
prefix: "github-copilot/claude-opus-5",
|
|
65
|
+
systemRatio: 1.511497,
|
|
66
|
+
toolsRatio: 1.551639,
|
|
67
|
+
proseRatio: 1.571778
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
prefix: "github-copilot/claude-sonnet-5",
|
|
71
|
+
systemRatio: 1.511497,
|
|
72
|
+
toolsRatio: 1.554814,
|
|
73
|
+
proseRatio: 1.571815
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
prefix: "anthropic/claude-opus-4-8",
|
|
77
|
+
systemRatio: 1.51,
|
|
78
|
+
toolsRatio: 1.57
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
prefix: "anthropic/claude-opus-4.8",
|
|
82
|
+
systemRatio: 1.51,
|
|
83
|
+
toolsRatio: 1.57
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
prefix: "anthropic/claude-opus-4-7",
|
|
87
|
+
systemRatio: 1.51,
|
|
88
|
+
toolsRatio: 1.57,
|
|
89
|
+
proseRatio: 1.571778
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
prefix: "anthropic/claude-opus-4.7",
|
|
93
|
+
systemRatio: 1.51,
|
|
94
|
+
toolsRatio: 1.57
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
prefix: "anthropic/claude-opus-4-5",
|
|
98
|
+
systemRatio: 1.02,
|
|
99
|
+
toolsRatio: 1.16
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
prefix: "anthropic/claude-opus-4.5",
|
|
103
|
+
systemRatio: 1.02,
|
|
104
|
+
toolsRatio: 1.16
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
prefix: "anthropic/claude-opus-4-6",
|
|
108
|
+
systemRatio: 1.02,
|
|
109
|
+
toolsRatio: 1.16
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
prefix: "anthropic/claude-opus-4.6",
|
|
113
|
+
systemRatio: 1.02,
|
|
114
|
+
toolsRatio: 1.16
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
prefix: "anthropic/claude-sonnet-4-5",
|
|
118
|
+
systemRatio: 1.02,
|
|
119
|
+
toolsRatio: 1.16
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
prefix: "anthropic/claude-sonnet-4.5",
|
|
123
|
+
systemRatio: 1.02,
|
|
124
|
+
toolsRatio: 1.16
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
prefix: "anthropic/claude-sonnet-4-6",
|
|
128
|
+
systemRatio: 1.02,
|
|
129
|
+
toolsRatio: 1.14,
|
|
130
|
+
proseRatio: 1.057976
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
prefix: "anthropic/claude-sonnet-4.6",
|
|
134
|
+
systemRatio: 1.02,
|
|
135
|
+
toolsRatio: 1.14
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
prefix: "anthropic/claude-haiku-4-5",
|
|
139
|
+
systemRatio: 1.02,
|
|
140
|
+
toolsRatio: 1.16
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
prefix: "anthropic/claude-haiku-4.5",
|
|
144
|
+
systemRatio: 1.02,
|
|
145
|
+
toolsRatio: 1.16
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
prefix: "openrouter/anthropic/claude-opus-4-8",
|
|
149
|
+
systemRatio: 1.51,
|
|
150
|
+
toolsRatio: 1.57
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
prefix: "openrouter/anthropic/claude-opus-4.8",
|
|
154
|
+
systemRatio: 1.51,
|
|
155
|
+
toolsRatio: 1.57
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
prefix: "github-copilot/claude-opus-4-8",
|
|
159
|
+
systemRatio: 1.51,
|
|
160
|
+
toolsRatio: 1.57
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
prefix: "github-copilot/claude-opus-4.8",
|
|
164
|
+
systemRatio: 1.51,
|
|
165
|
+
toolsRatio: 1.57
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
prefix: "openrouter/anthropic/claude-opus-4-7",
|
|
169
|
+
systemRatio: 1.51,
|
|
170
|
+
toolsRatio: 1.57
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
prefix: "openrouter/anthropic/claude-opus-4.7",
|
|
174
|
+
systemRatio: 1.51,
|
|
175
|
+
toolsRatio: 1.57
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
prefix: "github-copilot/claude-opus-4-7",
|
|
179
|
+
systemRatio: 1.51,
|
|
180
|
+
toolsRatio: 1.57
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
prefix: "github-copilot/claude-opus-4.7",
|
|
184
|
+
systemRatio: 1.51,
|
|
185
|
+
toolsRatio: 1.57
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
prefix: "openrouter/anthropic/claude-sonnet-4.6",
|
|
189
|
+
systemRatio: 1.02,
|
|
190
|
+
toolsRatio: 1.14
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
prefix: "github-copilot/claude-sonnet-4.6",
|
|
194
|
+
systemRatio: 1.02,
|
|
195
|
+
toolsRatio: 1.14
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
prefix: "github-copilot/claude-sonnet-4.5",
|
|
199
|
+
systemRatio: 1.02,
|
|
200
|
+
toolsRatio: 1.16
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
prefix: "github-copilot/claude-opus-4.5",
|
|
204
|
+
systemRatio: 1.02,
|
|
205
|
+
toolsRatio: 1.16
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
prefix: "github-copilot/claude-haiku-4.5",
|
|
209
|
+
systemRatio: 1.02,
|
|
210
|
+
toolsRatio: 1.16
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
prefix: "openai/gpt-5.5",
|
|
214
|
+
systemRatio: 1.000278,
|
|
215
|
+
toolsRatio: 0.850953,
|
|
216
|
+
proseRatio: 1.000017
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
prefix: "openai/gpt-6-astra",
|
|
220
|
+
systemRatio: 1.000278,
|
|
221
|
+
toolsRatio: 0.850953,
|
|
222
|
+
proseRatio: 1.000017
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
prefix: "openai/gpt-5",
|
|
226
|
+
systemRatio: 1,
|
|
227
|
+
toolsRatio: 0.84
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
prefix: "xai/grok-4-latest",
|
|
231
|
+
systemRatio: 0.817751,
|
|
232
|
+
toolsRatio: 0.880494,
|
|
233
|
+
proseRatio: 0.880137
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
prefix: "xai/grok-code-fast-1",
|
|
237
|
+
systemRatio: 0.817751,
|
|
238
|
+
toolsRatio: 0.880494,
|
|
239
|
+
proseRatio: 0.880137
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
prefix: "xai/grok-4",
|
|
243
|
+
systemRatio: 0.82,
|
|
244
|
+
toolsRatio: 0.88
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
prefix: "xai/grok-code-fast",
|
|
248
|
+
systemRatio: 0.82,
|
|
249
|
+
toolsRatio: 0.89
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
prefix: "cerebras/qwen-3-235b",
|
|
253
|
+
systemRatio: 1,
|
|
254
|
+
toolsRatio: 1.1
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
prefix: "cerebras/zai-glm-4.7",
|
|
258
|
+
systemRatio: 1,
|
|
259
|
+
toolsRatio: 1.09
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
prefix: "cerebras/gpt-oss-120b",
|
|
263
|
+
systemRatio: 0.84,
|
|
264
|
+
toolsRatio: 0.79
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
prefix: "fireworks-ai/accounts/fireworks/models/glm-5p1",
|
|
268
|
+
systemRatio: 1,
|
|
269
|
+
toolsRatio: 1.06
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
prefix: "fireworks-ai/accounts/fireworks/models/deepseek-v3p2",
|
|
273
|
+
systemRatio: 1.05,
|
|
274
|
+
toolsRatio: 1.09
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
prefix: "opencode-go/glm-5.1",
|
|
278
|
+
systemRatio: 1,
|
|
279
|
+
toolsRatio: 1.06
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
prefix: "opencode-go/glm-5",
|
|
283
|
+
systemRatio: 1,
|
|
284
|
+
toolsRatio: 1.06
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
prefix: "opencode-go/kimi-k2.6",
|
|
288
|
+
systemRatio: 0.87,
|
|
289
|
+
toolsRatio: 0.86,
|
|
290
|
+
proseRatio: 0.925501
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
prefix: "moonshot/kimi-k2.6",
|
|
294
|
+
systemRatio: 0.872126,
|
|
295
|
+
toolsRatio: 0.863853,
|
|
296
|
+
proseRatio: 0.925501
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
prefix: "moonshot/kimi-for-coding",
|
|
300
|
+
systemRatio: 0.872126,
|
|
301
|
+
toolsRatio: 0.863853,
|
|
302
|
+
proseRatio: 0.925501
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
prefix: "zai/glm-4.7",
|
|
306
|
+
systemRatio: 0.999721,
|
|
307
|
+
toolsRatio: 1.056823,
|
|
308
|
+
proseRatio: 1.000875
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
prefix: "meta/muse-spark",
|
|
312
|
+
systemRatio: 0.865949,
|
|
313
|
+
toolsRatio: 1.024605,
|
|
314
|
+
proseRatio: 0.923366
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
prefix: "opencode/muse-spark",
|
|
318
|
+
systemRatio: 0.865949,
|
|
319
|
+
toolsRatio: 1.024605,
|
|
320
|
+
proseRatio: 0.923366
|
|
321
|
+
}
|
|
322
|
+
];
|
|
323
|
+
|
|
324
|
+
// src/hooks/magic-context/tokenizer-calibration.ts
|
|
325
|
+
var CALIBRATION_TABLE = tokenizer_calibration_seeds_default;
|
|
326
|
+
var NEUTRAL = { systemRatio: 1, toolsRatio: 1, proseRatio: 1 };
|
|
327
|
+
var CALIBRATION_TABLE_REVISION = "2026-09-23-model-id-generation-v2";
|
|
328
|
+
var UNKNOWN_FIT_RATIO = Math.max(2, ...CALIBRATION_TABLE.flatMap((entry) => [
|
|
329
|
+
entry.systemRatio,
|
|
330
|
+
entry.toolsRatio,
|
|
331
|
+
entry.proseRatio ?? 1
|
|
332
|
+
]));
|
|
333
|
+
function hasModelCalibration(providerId, modelId) {
|
|
334
|
+
return resolveModelCalibration(providerId, modelId) !== NEUTRAL;
|
|
335
|
+
}
|
|
336
|
+
function resolveModelCalibration(providerId, modelId) {
|
|
337
|
+
if (!providerId || !modelId)
|
|
338
|
+
return NEUTRAL;
|
|
339
|
+
const key = `${providerId}/${modelId}`.toLowerCase();
|
|
340
|
+
let best = null;
|
|
341
|
+
for (const entry of CALIBRATION_TABLE) {
|
|
342
|
+
const prefix = entry.prefix.toLowerCase();
|
|
343
|
+
if (!key.startsWith(prefix))
|
|
344
|
+
continue;
|
|
345
|
+
if (!best || prefix.length > best.prefix.length) {
|
|
346
|
+
best = entry;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
if (best)
|
|
350
|
+
return { ...best, proseRatio: best.proseRatio ?? 1 };
|
|
351
|
+
const provider = providerId.toLowerCase();
|
|
352
|
+
const model = modelId.toLowerCase();
|
|
353
|
+
if (CALIBRATION_TABLE.some((entry) => entry.prefix.toLowerCase().startsWith(`${provider}/`))) {
|
|
354
|
+
return resolveFamilyFallback(provider, model) ?? NEUTRAL;
|
|
355
|
+
}
|
|
356
|
+
const canonical = canonicalProvider(model);
|
|
357
|
+
let modelMatch = null;
|
|
358
|
+
for (const entry of CALIBRATION_TABLE) {
|
|
359
|
+
const seedModel = entry.prefix.toLowerCase().split("/").slice(1).join("/");
|
|
360
|
+
if (!model.startsWith(seedModel))
|
|
361
|
+
continue;
|
|
362
|
+
const oldModel = modelMatch?.prefix.toLowerCase().split("/").slice(1).join("/") ?? "";
|
|
363
|
+
if (seedModel.length > oldModel.length || seedModel.length === oldModel.length && entry.prefix.toLowerCase().startsWith(`${canonical}/`) && !modelMatch?.prefix.toLowerCase().startsWith(`${canonical}/`))
|
|
364
|
+
modelMatch = entry;
|
|
365
|
+
}
|
|
366
|
+
if (modelMatch)
|
|
367
|
+
return {
|
|
368
|
+
...modelMatch,
|
|
369
|
+
proseRatio: modelMatch.proseRatio ?? 1,
|
|
370
|
+
derivedFrom: modelMatch.prefix,
|
|
371
|
+
matchedByModelId: true
|
|
372
|
+
};
|
|
373
|
+
const inherited = canonical ? resolveFamilyFallback(canonical, model) : null;
|
|
374
|
+
return inherited ? { ...inherited, matchedByModelId: true } : NEUTRAL;
|
|
375
|
+
}
|
|
376
|
+
function parseModelLineage(modelId) {
|
|
377
|
+
const tokens = modelId.split("-");
|
|
378
|
+
const versionAt = tokens.findIndex((token) => /^\d+(\.\d+)*$/.test(token));
|
|
379
|
+
if (versionAt <= 0)
|
|
380
|
+
return null;
|
|
381
|
+
const version = [];
|
|
382
|
+
let end = versionAt;
|
|
383
|
+
while (end < tokens.length && /^\d+(\.\d+)*$/.test(tokens[end] ?? "")) {
|
|
384
|
+
for (const part of (tokens[end] ?? "").split("."))
|
|
385
|
+
version.push(Number(part));
|
|
386
|
+
end += 1;
|
|
387
|
+
}
|
|
388
|
+
return {
|
|
389
|
+
family: tokens.slice(0, versionAt).join("-"),
|
|
390
|
+
version,
|
|
391
|
+
variant: tokens.slice(end).join("-")
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
function canonicalProvider(model) {
|
|
395
|
+
if (model.startsWith("claude-"))
|
|
396
|
+
return "anthropic";
|
|
397
|
+
if (model.startsWith("gpt-"))
|
|
398
|
+
return "openai";
|
|
399
|
+
if (model.startsWith("gemini-"))
|
|
400
|
+
return "google";
|
|
401
|
+
return "";
|
|
402
|
+
}
|
|
403
|
+
function compareVersions(a, b) {
|
|
404
|
+
const length = Math.max(a.length, b.length);
|
|
405
|
+
for (let i = 0;i < length; i++) {
|
|
406
|
+
const delta = (a[i] ?? 0) - (b[i] ?? 0);
|
|
407
|
+
if (delta !== 0)
|
|
408
|
+
return delta;
|
|
409
|
+
}
|
|
410
|
+
return 0;
|
|
411
|
+
}
|
|
412
|
+
function resolveFamilyFallback(providerId, modelId) {
|
|
413
|
+
const wanted = parseModelLineage(modelId);
|
|
414
|
+
if (!wanted)
|
|
415
|
+
return null;
|
|
416
|
+
let below = null;
|
|
417
|
+
let above = null;
|
|
418
|
+
for (const entry of CALIBRATION_TABLE) {
|
|
419
|
+
const prefix = entry.prefix.toLowerCase();
|
|
420
|
+
if (!prefix.startsWith(`${providerId}/`))
|
|
421
|
+
continue;
|
|
422
|
+
const lineage = parseModelLineage(prefix.slice(providerId.length + 1));
|
|
423
|
+
if (!lineage || lineage.family !== wanted.family || lineage.variant !== wanted.variant)
|
|
424
|
+
continue;
|
|
425
|
+
const order = compareVersions(lineage.version, wanted.version);
|
|
426
|
+
if (order === 0)
|
|
427
|
+
continue;
|
|
428
|
+
if (order < 0) {
|
|
429
|
+
if (!below || compareVersions(lineage.version, below.version) > 0) {
|
|
430
|
+
below = { entry, version: lineage.version };
|
|
431
|
+
}
|
|
432
|
+
} else if (!above || compareVersions(lineage.version, above.version) < 0) {
|
|
433
|
+
above = { entry, version: lineage.version };
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
let source = below ?? above;
|
|
437
|
+
if (source?.version[0] !== wanted.version[0] && canonicalProvider(modelId) !== "") {
|
|
438
|
+
let sibling = null;
|
|
439
|
+
for (const entry of CALIBRATION_TABLE) {
|
|
440
|
+
const prefix = entry.prefix.toLowerCase();
|
|
441
|
+
if (!prefix.startsWith(`${providerId}/`))
|
|
442
|
+
continue;
|
|
443
|
+
const lineage = parseModelLineage(prefix.slice(providerId.length + 1));
|
|
444
|
+
if (!lineage || lineage.version[0] !== wanted.version[0] || lineage.variant !== wanted.variant || lineage.family.split("-")[0] !== wanted.family.split("-")[0])
|
|
445
|
+
continue;
|
|
446
|
+
const candidate = { entry, version: lineage.version };
|
|
447
|
+
if (!sibling || compareVersions(candidate.version, wanted.version) <= 0 && compareVersions(sibling.version, wanted.version) > 0 || compareVersions(candidate.version, wanted.version) <= 0 && compareVersions(candidate.version, sibling.version) > 0 || compareVersions(sibling.version, wanted.version) > 0 && compareVersions(candidate.version, sibling.version) < 0)
|
|
448
|
+
sibling = candidate;
|
|
449
|
+
}
|
|
450
|
+
source = sibling ?? source;
|
|
451
|
+
}
|
|
452
|
+
if (!source)
|
|
453
|
+
return null;
|
|
454
|
+
return {
|
|
455
|
+
systemRatio: source.entry.systemRatio,
|
|
456
|
+
toolsRatio: source.entry.toolsRatio,
|
|
457
|
+
proseRatio: source.entry.proseRatio ?? 1,
|
|
458
|
+
derivedFrom: source.entry.prefix
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
function calibrateBuckets(input) {
|
|
462
|
+
const empty = {
|
|
463
|
+
systemTokens: 0,
|
|
464
|
+
toolDefinitionTokens: 0,
|
|
465
|
+
compartmentTokens: 0,
|
|
466
|
+
factTokens: 0,
|
|
467
|
+
memoryTokens: 0,
|
|
468
|
+
docsTokens: 0,
|
|
469
|
+
profileTokens: 0,
|
|
470
|
+
conversationTokens: 0,
|
|
471
|
+
toolCallTokens: 0
|
|
472
|
+
};
|
|
473
|
+
if (input.inputTokens <= 0)
|
|
474
|
+
return empty;
|
|
475
|
+
let calibratedSystem = Math.round(input.systemLocal * input.calibration.systemRatio);
|
|
476
|
+
let calibratedToolDefs = Math.round(input.toolDefsLocal * input.calibration.toolsRatio);
|
|
477
|
+
const proseRatio = input.calibration.proseRatio;
|
|
478
|
+
let compartments = Math.round(Math.max(0, input.compartmentsLocal) * proseRatio);
|
|
479
|
+
let facts = Math.round(Math.max(0, input.factsLocal) * proseRatio);
|
|
480
|
+
let memories = Math.round(Math.max(0, input.memoriesLocal) * proseRatio);
|
|
481
|
+
let docs = Math.round(Math.max(0, input.docsLocal) * proseRatio);
|
|
482
|
+
let profile = Math.round(Math.max(0, input.profileLocal) * proseRatio);
|
|
483
|
+
const nonResidualTotal = calibratedSystem + calibratedToolDefs + compartments + facts + memories + docs + profile;
|
|
484
|
+
if (nonResidualTotal > input.inputTokens) {
|
|
485
|
+
const ratio = input.inputTokens / nonResidualTotal;
|
|
486
|
+
calibratedSystem = Math.round(calibratedSystem * ratio);
|
|
487
|
+
calibratedToolDefs = Math.round(calibratedToolDefs * ratio);
|
|
488
|
+
compartments = Math.round(compartments * ratio);
|
|
489
|
+
facts = Math.round(facts * ratio);
|
|
490
|
+
memories = Math.round(memories * ratio);
|
|
491
|
+
docs = Math.round(docs * ratio);
|
|
492
|
+
profile = Math.round(profile * ratio);
|
|
493
|
+
}
|
|
494
|
+
const residualTarget = Math.max(0, input.inputTokens - calibratedSystem - calibratedToolDefs - compartments - facts - memories - docs - profile);
|
|
495
|
+
const residualLocalSum = input.conversationLocal + input.toolCallsLocal;
|
|
496
|
+
let conversation;
|
|
497
|
+
let toolCalls;
|
|
498
|
+
if (residualLocalSum <= 0) {
|
|
499
|
+
conversation = residualTarget;
|
|
500
|
+
toolCalls = 0;
|
|
501
|
+
} else {
|
|
502
|
+
const scale = residualTarget / residualLocalSum;
|
|
503
|
+
conversation = Math.round(input.conversationLocal * scale);
|
|
504
|
+
toolCalls = Math.round(input.toolCallsLocal * scale);
|
|
505
|
+
}
|
|
506
|
+
const provisionalSum = calibratedSystem + calibratedToolDefs + compartments + facts + memories + docs + profile + conversation + toolCalls;
|
|
507
|
+
let delta = input.inputTokens - provisionalSum;
|
|
508
|
+
if (delta !== 0) {
|
|
509
|
+
if (conversation >= toolCalls) {
|
|
510
|
+
const adjusted = Math.max(0, conversation + delta);
|
|
511
|
+
delta -= adjusted - conversation;
|
|
512
|
+
conversation = adjusted;
|
|
513
|
+
} else {
|
|
514
|
+
const adjusted = Math.max(0, toolCalls + delta);
|
|
515
|
+
delta -= adjusted - toolCalls;
|
|
516
|
+
toolCalls = adjusted;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
if (delta < 0) {
|
|
520
|
+
const get = (name) => {
|
|
521
|
+
if (name === "system")
|
|
522
|
+
return calibratedSystem;
|
|
523
|
+
if (name === "toolDefs")
|
|
524
|
+
return calibratedToolDefs;
|
|
525
|
+
if (name === "compartments")
|
|
526
|
+
return compartments;
|
|
527
|
+
if (name === "facts")
|
|
528
|
+
return facts;
|
|
529
|
+
if (name === "docs")
|
|
530
|
+
return docs;
|
|
531
|
+
if (name === "profile")
|
|
532
|
+
return profile;
|
|
533
|
+
return memories;
|
|
534
|
+
};
|
|
535
|
+
const subtract = (name, amount) => {
|
|
536
|
+
if (name === "system")
|
|
537
|
+
calibratedSystem -= amount;
|
|
538
|
+
else if (name === "toolDefs")
|
|
539
|
+
calibratedToolDefs -= amount;
|
|
540
|
+
else if (name === "compartments")
|
|
541
|
+
compartments -= amount;
|
|
542
|
+
else if (name === "facts")
|
|
543
|
+
facts -= amount;
|
|
544
|
+
else if (name === "docs")
|
|
545
|
+
docs -= amount;
|
|
546
|
+
else if (name === "profile")
|
|
547
|
+
profile -= amount;
|
|
548
|
+
else
|
|
549
|
+
memories -= amount;
|
|
550
|
+
};
|
|
551
|
+
const buckets = [
|
|
552
|
+
"system",
|
|
553
|
+
"toolDefs",
|
|
554
|
+
"compartments",
|
|
555
|
+
"facts",
|
|
556
|
+
"memories",
|
|
557
|
+
"docs",
|
|
558
|
+
"profile"
|
|
559
|
+
];
|
|
560
|
+
buckets.sort((a, b) => get(b) - get(a));
|
|
561
|
+
for (const name of buckets) {
|
|
562
|
+
if (delta >= 0)
|
|
563
|
+
break;
|
|
564
|
+
const value = get(name);
|
|
565
|
+
if (value <= 0)
|
|
566
|
+
continue;
|
|
567
|
+
const adjustment = Math.min(value, -delta);
|
|
568
|
+
subtract(name, adjustment);
|
|
569
|
+
delta += adjustment;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
return {
|
|
573
|
+
systemTokens: calibratedSystem,
|
|
574
|
+
toolDefinitionTokens: calibratedToolDefs,
|
|
575
|
+
compartmentTokens: compartments,
|
|
576
|
+
factTokens: facts,
|
|
577
|
+
memoryTokens: memories,
|
|
578
|
+
docsTokens: docs,
|
|
579
|
+
profileTokens: profile,
|
|
580
|
+
conversationTokens: conversation,
|
|
581
|
+
toolCallTokens: toolCalls
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
// src/hooks/magic-context/decision-calibration.ts
|
|
586
|
+
function resolveDecisionCalibration(providerId, modelId) {
|
|
587
|
+
const ratios = resolveModelCalibration(providerId, modelId);
|
|
588
|
+
return Object.freeze({
|
|
589
|
+
...ratios,
|
|
590
|
+
modelKey: `${providerId ?? "unknown"}/${modelId ?? "unknown"}`.toLowerCase(),
|
|
591
|
+
revision: CALIBRATION_TABLE_REVISION,
|
|
592
|
+
matchedPrefix: ratios.derivedFrom ?? ratios.prefix,
|
|
593
|
+
seeded: hasModelCalibration(providerId, modelId),
|
|
594
|
+
source: ratios.matchedByModelId ? "model-id" : ratios.derivedFrom ? "family-fallback" : "seed"
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
function providerMass(raw, seed, fit = false) {
|
|
598
|
+
const { system = 0, tools = 0, prose = 0 } = raw;
|
|
599
|
+
if ([system, tools, prose].some((count) => !Number.isFinite(count) || count < 0) || [seed.systemRatio, seed.toolsRatio, seed.proseRatio].some((ratio) => !Number.isFinite(ratio) || ratio <= 0)) {
|
|
600
|
+
return Number.POSITIVE_INFINITY;
|
|
601
|
+
}
|
|
602
|
+
const total = fit && !seed.seeded ? (system + tools + prose) * UNKNOWN_FIT_RATIO : system * seed.systemRatio + tools * seed.toolsRatio + prose * seed.proseRatio;
|
|
603
|
+
return Number.isFinite(total) ? Math.ceil(total) : Number.POSITIVE_INFINITY;
|
|
604
|
+
}
|
|
605
|
+
function localBudget(providerTokens, ratio) {
|
|
606
|
+
if (!Number.isFinite(providerTokens) || providerTokens <= 0 || !Number.isFinite(ratio) || ratio <= 0)
|
|
607
|
+
return 0;
|
|
608
|
+
return Math.floor(providerTokens / ratio);
|
|
609
|
+
}
|
|
610
|
+
function calibrationForModelKey(modelKey) {
|
|
611
|
+
const slash = modelKey?.indexOf("/") ?? -1;
|
|
612
|
+
return modelKey != null && slash > 0 ? resolveDecisionCalibration(modelKey.slice(0, slash), modelKey.slice(slash + 1)) : resolveDecisionCalibration(undefined, undefined);
|
|
613
|
+
}
|
|
614
|
+
function historyLocalBudget(providerTokens, modelKey) {
|
|
615
|
+
const ratio = calibrationForModelKey(modelKey).proseRatio;
|
|
616
|
+
return ratio === 1 ? providerTokens : localBudget(providerTokens, ratio);
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
export { UNKNOWN_FIT_RATIO, resolveModelCalibration, calibrateBuckets, resolveDecisionCalibration, providerMass, localBudget, calibrationForModelKey, historyLocalBudget };
|