@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
package/src/shared/rpc-server.ts
CHANGED
|
@@ -106,6 +106,24 @@ export class MagicContextRpcServer {
|
|
|
106
106
|
this.handlers.set(method, handler);
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
/**
|
|
110
|
+
* Run a registered handler from inside this process, skipping the HTTP hop.
|
|
111
|
+
*
|
|
112
|
+
* A caller that already lives in the server process (a host command callback,
|
|
113
|
+
* for instance) must reach exactly the handler the TUI reaches over HTTP, so
|
|
114
|
+
* the two entry points cannot drift apart. The loopback socket, its bearer
|
|
115
|
+
* token and JSON encoding add nothing here, so they are skipped rather than
|
|
116
|
+
* paid for; an unknown method is still an error, as it is over HTTP.
|
|
117
|
+
*/
|
|
118
|
+
async dispatch(
|
|
119
|
+
method: string,
|
|
120
|
+
params: Record<string, unknown>,
|
|
121
|
+
): Promise<Record<string, unknown>> {
|
|
122
|
+
const handler = this.handlers.get(method);
|
|
123
|
+
if (!handler) return { error: `Unknown method: ${method}` };
|
|
124
|
+
return handler(params);
|
|
125
|
+
}
|
|
126
|
+
|
|
109
127
|
/** Start the server on a random port, write port to disk. */
|
|
110
128
|
async start(): Promise<number> {
|
|
111
129
|
if (typeof Bun === "undefined") {
|
package/src/shared/rpc-types.ts
CHANGED
|
@@ -5,11 +5,16 @@
|
|
|
5
5
|
|
|
6
6
|
import type {
|
|
7
7
|
DreamTaskBacklogMap,
|
|
8
|
+
DreamTaskFailureState,
|
|
9
|
+
DreamTaskName,
|
|
8
10
|
DreamTaskProgress,
|
|
9
11
|
} from "../features/magic-context/dreamer/task-registry";
|
|
12
|
+
import type { DreamerTickFailure } from "../features/magic-context/dreamer/tick-failure";
|
|
10
13
|
import type { SynapseLaneDescriptor } from "../features/magic-context/memory/embedding-synapse";
|
|
14
|
+
import type { RunnerRefusalCanonicalCause } from "../hooks/magic-context/historian-no-fire-cause";
|
|
11
15
|
import type { ConfigParseFailure } from "./config-diagnostics";
|
|
12
16
|
import type { LoggerDiagnostics } from "./logger";
|
|
17
|
+
import type { UserFacingFailureKey } from "./user-facing-codes";
|
|
13
18
|
|
|
14
19
|
export interface TailHygieneStatus {
|
|
15
20
|
/** Tokens in active, non-protected tail content that the agent can reclaim. */
|
|
@@ -98,6 +103,14 @@ export interface SidebarSnapshot {
|
|
|
98
103
|
* shows this as "Tool Definitions".
|
|
99
104
|
*/
|
|
100
105
|
toolDefinitionTokens: number;
|
|
106
|
+
/**
|
|
107
|
+
* Named capabilities the host this plugin runs in does not have, such as an
|
|
108
|
+
* experimental mode the host cannot carry. These persist for the life of
|
|
109
|
+
* the process rather than describing one failed operation, so the status
|
|
110
|
+
* surfaces keep showing them. Absent on hosts with nothing to report and on
|
|
111
|
+
* older RPC servers.
|
|
112
|
+
*/
|
|
113
|
+
hostLimitations?: UserFacingFailureKey[];
|
|
101
114
|
/** Persisted reclaimable (U) and eligible (T) token counts used by both nudge mechanisms. */
|
|
102
115
|
tailHygiene?: TailHygieneStatus;
|
|
103
116
|
/**
|
|
@@ -124,15 +137,18 @@ export interface SidebarSnapshot {
|
|
|
124
137
|
newWorkTokens?: number | null;
|
|
125
138
|
totalInputTokens?: number | null;
|
|
126
139
|
/**
|
|
127
|
-
* Live recomp
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
140
|
+
* Live recomp progress for this session, or null when no recomp is running
|
|
141
|
+
* (and no recent terminal state is being shown). Drives the sidebar progress
|
|
142
|
+
* bar and the /ctx-status dialog. Mirrors the runtime `RecompProgress` shape
|
|
143
|
+
* from compartment-runner-types.ts.
|
|
131
144
|
*/
|
|
132
145
|
/** Read-only per-task candidate counts; populated by the server RPC. */
|
|
133
146
|
dreamerBacklog?: DreamTaskBacklogMap;
|
|
134
147
|
/** Process-local task progress; absent when no Dreamer task is running. */
|
|
135
148
|
dreamerProgress?: DreamTaskProgress | null;
|
|
149
|
+
/** Dreamer tasks whose last scheduled run failed. Empty when all of them are
|
|
150
|
+
* healthy; absent on a database with no scheduler table yet. */
|
|
151
|
+
dreamerFailures?: DreamTaskFailureState[];
|
|
136
152
|
recompProgress?: {
|
|
137
153
|
/** "recomp" → "Recomp" labels; "upgrade" → "Upgrade" labels. */
|
|
138
154
|
kind?: "recomp" | "upgrade" | "embed" | "wrapup";
|
|
@@ -146,7 +162,40 @@ export interface SidebarSnapshot {
|
|
|
146
162
|
} | null;
|
|
147
163
|
}
|
|
148
164
|
|
|
165
|
+
export interface MemoryImportanceHistogram {
|
|
166
|
+
total: number;
|
|
167
|
+
unclassified: number;
|
|
168
|
+
bands: {
|
|
169
|
+
"0-19": number;
|
|
170
|
+
"20-39": number;
|
|
171
|
+
"40-59": number;
|
|
172
|
+
"60-79": number;
|
|
173
|
+
"80-100": number;
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
|
|
149
177
|
export interface StatusDetail extends SidebarSnapshot {
|
|
178
|
+
/** OpenCode 2 hidden-run model variants dropped because the host catalog did not declare them. */
|
|
179
|
+
hiddenVariantWarnings?: string[];
|
|
180
|
+
/** Runner refusal provenance reported by the Rust historian, including received text. */
|
|
181
|
+
historianRefusal?: {
|
|
182
|
+
stage: "credential" | "provider" | "model" | "resolution";
|
|
183
|
+
canonicalCause: RunnerRefusalCanonicalCause;
|
|
184
|
+
detail: string;
|
|
185
|
+
};
|
|
186
|
+
/** ACTIVE-memory importance distribution; unclassified is a subset of total. */
|
|
187
|
+
memoryImportanceHistogram: MemoryImportanceHistogram;
|
|
188
|
+
/**
|
|
189
|
+
* Dreamer tasks this host cannot run because it has no tool loop, named so a
|
|
190
|
+
* user can see which maintenance is unavailable instead of inferring it from
|
|
191
|
+
* a backlog that never falls. Absent on a host that runs every task.
|
|
192
|
+
*/
|
|
193
|
+
dreamerUnsupportedTasks?: DreamTaskName[];
|
|
194
|
+
/**
|
|
195
|
+
* The stage that stopped the last background maintenance pass, when one did.
|
|
196
|
+
* Absent while the maintenance timer is completing its passes.
|
|
197
|
+
*/
|
|
198
|
+
dreamerTickFailure?: DreamerTickFailure | null;
|
|
150
199
|
/** True when Rust authority has rerouted host tool and historian paths to the module. */
|
|
151
200
|
hostBackendsModuleSide?: boolean;
|
|
152
201
|
/** Host cursor compared with the module changefeed frontier. */
|
|
@@ -160,10 +209,20 @@ export interface StatusDetail extends SidebarSnapshot {
|
|
|
160
209
|
stalled: boolean;
|
|
161
210
|
code: "MC-M01" | null;
|
|
162
211
|
};
|
|
212
|
+
/** Health of the pending OpenCode history-boundary marker repair. */
|
|
213
|
+
compactionMarker?: {
|
|
214
|
+
code: "MC-C11" | null;
|
|
215
|
+
attempts: number;
|
|
216
|
+
lastError: string | null;
|
|
217
|
+
pendingSinceMs: number | null;
|
|
218
|
+
};
|
|
163
219
|
/** A durable host marker whose live module status no longer reports module ownership. */
|
|
164
220
|
memoryAuthorityMismatch?: boolean;
|
|
165
221
|
/** User-owned model profile selected for this project, or null for the base config. */
|
|
166
222
|
activeProfile: string | null;
|
|
223
|
+
configGeneration?: number;
|
|
224
|
+
configAdoptedAt?: number;
|
|
225
|
+
configReloadFailure?: { path: string; message: string };
|
|
167
226
|
tagCounter: number;
|
|
168
227
|
activeTags: number;
|
|
169
228
|
droppedTags: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, test } from "bun:test";
|
|
2
2
|
import type { StatusDetail } from "./rpc-types";
|
|
3
|
-
import { formatStatusDetailMarkdown
|
|
3
|
+
import { formatStatusDetailMarkdown } from "./status-detail-text";
|
|
4
4
|
|
|
5
5
|
const STATUS_FIXTURE: StatusDetail = {
|
|
6
6
|
sessionId: "ses_status",
|
|
@@ -12,6 +12,17 @@ const STATUS_FIXTURE: StatusDetail = {
|
|
|
12
12
|
compartmentCount: 12,
|
|
13
13
|
memoryCount: 8,
|
|
14
14
|
memoryBlockCount: 3,
|
|
15
|
+
memoryImportanceHistogram: {
|
|
16
|
+
total: 7_986,
|
|
17
|
+
unclassified: 1_181,
|
|
18
|
+
bands: {
|
|
19
|
+
"0-19": 101,
|
|
20
|
+
"20-39": 202,
|
|
21
|
+
"40-59": 6_303,
|
|
22
|
+
"60-79": 707,
|
|
23
|
+
"80-100": 673,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
15
26
|
pendingOpsCount: 2,
|
|
16
27
|
historianRunning: true,
|
|
17
28
|
compartmentInProgress: true,
|
|
@@ -112,20 +123,29 @@ describe("status detail text", () => {
|
|
|
112
123
|
expect(rendered).not.toContain("Reclaimable: 0");
|
|
113
124
|
});
|
|
114
125
|
|
|
115
|
-
test("
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
126
|
+
test("surfaces a failing scheduled dreamer task in the summary", () => {
|
|
127
|
+
// The whole point: a task failing on every slot must not be visible only as a
|
|
128
|
+
// backlog count that never falls.
|
|
129
|
+
const detail: StatusDetail = {
|
|
130
|
+
...STATUS_FIXTURE,
|
|
131
|
+
dreamerFailures: [
|
|
132
|
+
{
|
|
133
|
+
task: "classify-memories",
|
|
134
|
+
error: "Rust classify module failed: producer session busy",
|
|
135
|
+
lastSucceededAt: Date.now() - 6 * 24 * 3_600_000,
|
|
136
|
+
retryCount: 3,
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
};
|
|
140
|
+
const summary = formatStatusDetailMarkdown(detail);
|
|
141
|
+
expect(summary).toContain("A background maintenance task keeps failing");
|
|
142
|
+
expect(summary).toContain("MC-S05");
|
|
122
143
|
});
|
|
123
144
|
|
|
124
|
-
test("
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
expect(diagnostics).toContain("- **Execute threshold:** 65.0%");
|
|
145
|
+
test("says nothing about the dreamer while every scheduled task is healthy", () => {
|
|
146
|
+
expect(
|
|
147
|
+
formatStatusDetailMarkdown({ ...STATUS_FIXTURE, dreamerFailures: [] }),
|
|
148
|
+
).not.toContain("MC-S05");
|
|
129
149
|
});
|
|
130
150
|
|
|
131
151
|
test("keeps internal vocabulary and identifiers out of the summary", () => {
|
|
@@ -157,7 +177,7 @@ describe("status detail text", () => {
|
|
|
157
177
|
expect(summary).toContain("(MC-H01)");
|
|
158
178
|
});
|
|
159
179
|
|
|
160
|
-
test("shows stalled mirror and authority mismatch codes in summary
|
|
180
|
+
test("shows stalled mirror and authority mismatch codes in the summary", () => {
|
|
161
181
|
const detail = {
|
|
162
182
|
...STATUS_FIXTURE,
|
|
163
183
|
hostBackendsModuleSide: true,
|
|
@@ -174,13 +194,27 @@ describe("status detail text", () => {
|
|
|
174
194
|
memoryAuthorityMismatch: true,
|
|
175
195
|
};
|
|
176
196
|
const summary = formatStatusDetailMarkdown(detail);
|
|
177
|
-
const diagnostics = formatStatusDiagnosticsMarkdown(detail);
|
|
178
197
|
|
|
179
198
|
expect(summary).toContain("(MC-M01)");
|
|
180
199
|
expect(summary).toContain("(MC-M02)");
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
test("renders historian refusal stage and received runner text", () => {
|
|
203
|
+
const detail =
|
|
204
|
+
"historian refusal stage=credential provider=google model=google/model-a received=\"open_failed: no apikey credential for provider 'google'\"";
|
|
205
|
+
const status = formatStatusDetailMarkdown({
|
|
206
|
+
...STATUS_FIXTURE,
|
|
207
|
+
historianRefusal: {
|
|
208
|
+
stage: "credential",
|
|
209
|
+
canonicalCause: "credential_unavailable",
|
|
210
|
+
detail,
|
|
211
|
+
},
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
expect(status).toContain("Historian refusal:** credential (credential_unavailable)");
|
|
215
|
+
expect(status).toContain(
|
|
216
|
+
"received=\"open_failed: no apikey credential for provider 'google'\"",
|
|
217
|
+
);
|
|
184
218
|
});
|
|
185
219
|
|
|
186
220
|
test("does not expose module routing in the summary", () => {
|
|
@@ -1,96 +1,7 @@
|
|
|
1
|
-
import { formatCacheTtlDisplay } from "./cache-ttl-display";
|
|
2
|
-
import { formatConfigParseStatusLine } from "./config-diagnostics";
|
|
3
|
-
import {
|
|
4
|
-
formatOpenCodeDbMissingStatusLine,
|
|
5
|
-
formatOpenCodeDbReadFailureStatusLine,
|
|
6
|
-
getOpenCodeDbReadFailure,
|
|
7
|
-
openCodeDbPathExists,
|
|
8
|
-
resolveOpenCodeDbPath,
|
|
9
|
-
} from "./opencode-db-path";
|
|
10
1
|
import type { StatusDetail } from "./rpc-types";
|
|
11
|
-
import { RUST_MODE_HOST_PATHS_LINE } from "./rust-mode-status";
|
|
12
2
|
import { renderUserStatusSummary, statusSummaryFromDetail } from "./status-summary";
|
|
13
|
-
import { renderUserFacingFailure } from "./user-facing-codes";
|
|
14
3
|
|
|
15
|
-
|
|
16
|
-
return Math.round(value).toLocaleString();
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function formatCacheLane(detail: StatusDetail): string {
|
|
20
|
-
if (detail.cacheNeverExpires) return `never expires; TTL ${detail.cacheTtl}`;
|
|
21
|
-
if (detail.lastResponseTime <= 0) return `waiting for first response; TTL ${detail.cacheTtl}`;
|
|
22
|
-
if (detail.cacheExpired) return `expired; TTL ${detail.cacheTtl}`;
|
|
23
|
-
return `live (${Math.round(detail.cacheRemainingMs / 1000)}s remaining); TTL ${detail.cacheTtl}`;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/** Render the default user summary for chat-only OpenCode clients. */
|
|
4
|
+
/** Render the status summary for chat-only OpenCode clients (no TUI dialog). */
|
|
27
5
|
export function formatStatusDetailMarkdown(detail: StatusDetail): string {
|
|
28
6
|
return renderUserStatusSummary(statusSummaryFromDetail(detail), "markdown");
|
|
29
7
|
}
|
|
30
|
-
|
|
31
|
-
/** Render the opt-in operator detail that the status dialog exposes behind Diagnostics. */
|
|
32
|
-
export function formatStatusDiagnosticsMarkdown(detail: StatusDetail): string {
|
|
33
|
-
const usableLimit =
|
|
34
|
-
detail.contextLimit > 0
|
|
35
|
-
? `${formatCount(detail.contextLimit)} usable tokens`
|
|
36
|
-
: "? usable tokens";
|
|
37
|
-
const historianState = detail.historianRunning ? "running" : "idle";
|
|
38
|
-
const historianDetails = [
|
|
39
|
-
detail.boundaryPresent === undefined
|
|
40
|
-
? undefined
|
|
41
|
-
: `boundary ${detail.boundaryPresent ? "present" : "absent"}`,
|
|
42
|
-
detail.coverageOrdinal === undefined
|
|
43
|
-
? undefined
|
|
44
|
-
: `coverage ${detail.coverageOrdinal === null ? "none" : detail.coverageOrdinal}`,
|
|
45
|
-
].filter((value): value is string => value !== undefined);
|
|
46
|
-
const openCodeDbResolution = resolveOpenCodeDbPath();
|
|
47
|
-
const openCodeDbReadFailure = getOpenCodeDbReadFailure();
|
|
48
|
-
const openCodeDbStatusLine = !openCodeDbPathExists(openCodeDbResolution)
|
|
49
|
-
? formatOpenCodeDbMissingStatusLine(openCodeDbResolution)
|
|
50
|
-
: openCodeDbReadFailure?.path === openCodeDbResolution.path
|
|
51
|
-
? formatOpenCodeDbReadFailureStatusLine(openCodeDbReadFailure)
|
|
52
|
-
: null;
|
|
53
|
-
const mode =
|
|
54
|
-
detail.compaction_enabled === false
|
|
55
|
-
? "native compaction (Magic Context history compaction disabled)"
|
|
56
|
-
: "Magic Context compaction";
|
|
57
|
-
|
|
58
|
-
const lines = [
|
|
59
|
-
...(openCodeDbStatusLine ? [openCodeDbStatusLine, ""] : []),
|
|
60
|
-
...(detail.configParseFailures ?? []).map(formatConfigParseStatusLine),
|
|
61
|
-
...((detail.configParseFailures?.length ?? 0) > 0 ? [""] : []),
|
|
62
|
-
"## Magic Context Status",
|
|
63
|
-
"",
|
|
64
|
-
`- **Mode:** ${mode}`,
|
|
65
|
-
`- **Active profile:** ${detail.activeProfile ?? "none"}`,
|
|
66
|
-
`- **Usage:** ${detail.usagePercentage.toFixed(1)}% (${formatCount(detail.inputTokens)} / ${usableLimit})`,
|
|
67
|
-
`- **${formatCacheTtlDisplay({ value: detail.cacheTtl, source: detail.cacheTtlSource ?? "session", modelKey: detail.cacheTtlModelKey })}**; ${formatCacheLane(detail)}`,
|
|
68
|
-
`- **Historian:** ${[historianState, ...historianDetails].join("; ")}`,
|
|
69
|
-
...(detail.hostBackendsModuleSide ? [`- ${RUST_MODE_HOST_PATHS_LINE}`] : []),
|
|
70
|
-
...(detail.memoryMirror
|
|
71
|
-
? [
|
|
72
|
-
`- **Memory mirror:** cursor ${formatCount(detail.memoryMirror.cursor)} / ${detail.memoryMirror.feedHead === null ? "unknown" : formatCount(detail.memoryMirror.feedHead)}; ${formatCount(detail.memoryMirror.liveRows)} live rows; ${detail.memoryMirror.stalled ? `stalled (${detail.memoryMirror.code})` : "advancing or caught up"}`,
|
|
73
|
-
]
|
|
74
|
-
: []),
|
|
75
|
-
`- **Memory:** ${formatCount(detail.memoryCount)} active; ${formatCount(detail.memoryBlockCount)} injected`,
|
|
76
|
-
`- **Tags:** ${formatCount(detail.activeTags)} active, ${formatCount(detail.droppedTags)} dropped; ${formatCount(detail.pendingOpsCount)} pending drops`,
|
|
77
|
-
`- **Execute threshold:** ${detail.executeThreshold.toFixed(1)}%${detail.executeThresholdClamped ? " (clamped)" : ""}`,
|
|
78
|
-
];
|
|
79
|
-
|
|
80
|
-
if (detail.recompProgress?.phase === "recomp") {
|
|
81
|
-
lines.push(
|
|
82
|
-
`- **${detail.recompProgress.kind === "embed" ? "Embed" : "Historian"} progress:** ${formatCount(detail.recompProgress.processedMessages)} / ${formatCount(detail.recompProgress.totalMessages)}`,
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
if (detail.lastTransformError) {
|
|
86
|
-
lines.push(`- **Warning:** ${renderUserFacingFailure("transform_update_failed")}`);
|
|
87
|
-
}
|
|
88
|
-
if (detail.memoryMirror?.stalled) {
|
|
89
|
-
lines.push(`- **Warning:** ${renderUserFacingFailure("memory_mirror_stalled")}`);
|
|
90
|
-
}
|
|
91
|
-
if (detail.memoryAuthorityMismatch) {
|
|
92
|
-
lines.push(`- **Warning:** ${renderUserFacingFailure("memory_authority_mismatch")}`);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return lines.join("\n");
|
|
96
|
-
}
|
|
@@ -26,7 +26,14 @@ export interface UserStatusSummary {
|
|
|
26
26
|
indexed: number;
|
|
27
27
|
total: number;
|
|
28
28
|
};
|
|
29
|
+
historianRefusal?: {
|
|
30
|
+
stage: string;
|
|
31
|
+
canonicalCause: string;
|
|
32
|
+
detail: string;
|
|
33
|
+
};
|
|
34
|
+
compactionMarker?: StatusDetail["compactionMarker"];
|
|
29
35
|
warnings: UserFacingFailureKey[];
|
|
36
|
+
hiddenVariantWarnings?: string[];
|
|
30
37
|
}
|
|
31
38
|
|
|
32
39
|
export function statusSummaryFromDetail(detail: StatusDetail): UserStatusSummary {
|
|
@@ -50,7 +57,17 @@ export function statusSummaryFromDetail(detail: StatusDetail): UserStatusSummary
|
|
|
50
57
|
warnings.push("status_log_unavailable");
|
|
51
58
|
}
|
|
52
59
|
if (detail.memoryMirror?.stalled) warnings.push("memory_mirror_stalled");
|
|
60
|
+
if (detail.compactionMarker?.code) warnings.push("compaction_marker_missing");
|
|
53
61
|
if (detail.memoryAuthorityMismatch) warnings.push("memory_authority_mismatch");
|
|
62
|
+
if ((detail.dreamerFailures?.length ?? 0) > 0) warnings.push("dreamer_task_failing");
|
|
63
|
+
// A whole maintenance pass that never reached its work is a different
|
|
64
|
+
// problem from an individual task that keeps failing, so it gets its own
|
|
65
|
+
// warning rather than sharing that one.
|
|
66
|
+
if (detail.dreamerTickFailure) warnings.push("dreamer_tick_blocked");
|
|
67
|
+
// Host limitations are not failures of this turn, but they belong in the
|
|
68
|
+
// same list: the user needs to see that something they configured or asked
|
|
69
|
+
// for is not running here.
|
|
70
|
+
warnings.push(...(detail.hostLimitations ?? []));
|
|
54
71
|
|
|
55
72
|
return {
|
|
56
73
|
inputTokens: detail.inputTokens,
|
|
@@ -78,7 +95,10 @@ export function statusSummaryFromDetail(detail: StatusDetail): UserStatusSummary
|
|
|
78
95
|
indexed: 0,
|
|
79
96
|
total: 0,
|
|
80
97
|
},
|
|
98
|
+
historianRefusal: detail.historianRefusal,
|
|
99
|
+
compactionMarker: detail.compactionMarker,
|
|
81
100
|
warnings: [...new Set(warnings)],
|
|
101
|
+
hiddenVariantWarnings: detail.hiddenVariantWarnings ?? [],
|
|
82
102
|
};
|
|
83
103
|
}
|
|
84
104
|
|
|
@@ -133,7 +153,7 @@ export function renderUserStatusSummary(
|
|
|
133
153
|
const context = `${summary.usagePercentage.toFixed(1)}% of usable context (${formatCount(summary.inputTokens)} / ${
|
|
134
154
|
summary.usableContextTokens > 0 ? formatCount(summary.usableContextTokens) : "?"
|
|
135
155
|
} tokens)`;
|
|
136
|
-
const values = [
|
|
156
|
+
const values: Array<readonly [string, string]> = [
|
|
137
157
|
["Context", context],
|
|
138
158
|
["Cache lifetime", summary.cacheLifetime],
|
|
139
159
|
[
|
|
@@ -149,7 +169,19 @@ export function renderUserStatusSummary(
|
|
|
149
169
|
`${formatCount(summary.memoryCount)} memories · ${formatCount(summary.noteCount)} notes`,
|
|
150
170
|
],
|
|
151
171
|
["Search indexing", embeddingText(summary)],
|
|
152
|
-
]
|
|
172
|
+
];
|
|
173
|
+
if (summary.historianRefusal) {
|
|
174
|
+
values.push([
|
|
175
|
+
"Historian refusal",
|
|
176
|
+
`${summary.historianRefusal.stage} (${summary.historianRefusal.canonicalCause}) — ${summary.historianRefusal.detail}`,
|
|
177
|
+
]);
|
|
178
|
+
}
|
|
179
|
+
if (summary.compactionMarker?.code) {
|
|
180
|
+
values.push([
|
|
181
|
+
"History boundary marker",
|
|
182
|
+
`${summary.compactionMarker.code} · ${summary.compactionMarker.attempts} attempts · last error: ${summary.compactionMarker.lastError ?? "unknown"}`,
|
|
183
|
+
]);
|
|
184
|
+
}
|
|
153
185
|
const lines =
|
|
154
186
|
style === "markdown"
|
|
155
187
|
? [
|
|
@@ -158,6 +190,9 @@ export function renderUserStatusSummary(
|
|
|
158
190
|
...values.map(([label, value]) => `- **${label}:** ${value}`),
|
|
159
191
|
]
|
|
160
192
|
: ["Magic Context Status", ...values.map(([label, value]) => `${label}: ${value}`)];
|
|
193
|
+
for (const warning of summary.hiddenVariantWarnings ?? []) {
|
|
194
|
+
lines.push(style === "markdown" ? `- **Warning:** ${warning}` : `Warning: ${warning}`);
|
|
195
|
+
}
|
|
161
196
|
for (const warning of summary.warnings) {
|
|
162
197
|
lines.push(
|
|
163
198
|
style === "markdown"
|