@cortexkit/opencode-magic-context 0.44.3 → 0.45.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/dist/agents/hidden-agent-registrations.d.ts +3 -2
- package/dist/agents/hidden-agent-registrations.d.ts.map +1 -1
- package/dist/agents/magic-context-prompt.d.ts +1 -0
- package/dist/agents/magic-context-prompt.d.ts.map +1 -1
- package/dist/agents/permissions.d.ts +8 -28
- package/dist/agents/permissions.d.ts.map +1 -1
- package/dist/{announcement-n8hs7kjw.js → announcement-f75t58v9.js} +4 -2
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/project-security.d.ts +48 -0
- package/dist/config/project-security.d.ts.map +1 -1
- package/dist/config/raw-loader.d.ts.map +1 -1
- package/dist/config/schema/magic-context.d.ts +10 -7
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/{conflict-warning-hook-hmpzxep6.js → conflict-warning-hook-5yrz2r24.js} +10 -6
- package/dist/{derive-budgets-vjmvh6pz.js → derive-budgets-a63zsm5c.js} +4 -4
- package/dist/embedding-worker.js +49 -0
- package/dist/emscripten-module-0g8f45e6.js +602 -0
- package/dist/emscripten-module-0pekdjxz.js +1532 -0
- package/dist/emscripten-module-e67xwsp3.js +503 -0
- package/dist/emscripten-module-pj1vyb44.js +4559 -0
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts +23 -3
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-embedding.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-storage.d.ts +14 -3
- package/dist/features/magic-context/compartment-storage.d.ts.map +1 -1
- package/dist/features/magic-context/context-store-uuid.d.ts +7 -0
- package/dist/features/magic-context/context-store-uuid.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/classify.d.ts +1 -3
- package/dist/features/magic-context/dreamer/classify.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/cron.d.ts +5 -4
- package/dist/features/magic-context/dreamer/cron.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/docs-proposals.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/evaluate-smart-notes.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/expire-memories.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/idle-schedule-prune.d.ts +24 -0
- package/dist/features/magic-context/dreamer/idle-schedule-prune.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/manual-summary.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/map-memories.d.ts +5 -5
- package/dist/features/magic-context/dreamer/map-memories.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/module-apply.d.ts +4 -25
- package/dist/features/magic-context/dreamer/module-apply.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/retrospective-learnings.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/storage-dream-runs.d.ts +5 -1
- package/dist/features/magic-context/dreamer/storage-dream-runs.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/storage-task-schedule.d.ts +12 -5
- package/dist/features/magic-context/dreamer/storage-task-schedule.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-executor.d.ts +6 -0
- package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-gates.d.ts +34 -0
- package/dist/features/magic-context/dreamer/task-gates.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-prompts.d.ts +1 -1
- package/dist/features/magic-context/dreamer/task-prompts.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-registry.d.ts +7 -5
- package/dist/features/magic-context/dreamer/task-registry.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts +10 -3
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/token-budget.d.ts +3 -0
- package/dist/features/magic-context/dreamer/token-budget.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/verify.d.ts +2 -2
- package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -1
- package/dist/features/magic-context/git-commits/git-log-reader.d.ts +11 -2
- package/dist/features/magic-context/git-commits/git-log-reader.d.ts.map +1 -1
- package/dist/features/magic-context/git-commits/indexer.d.ts.map +1 -1
- package/dist/features/magic-context/git-commits/search-git-commits.d.ts.map +1 -1
- package/dist/features/magic-context/git-commits/storage-git-commits.d.ts +2 -0
- package/dist/features/magic-context/git-commits/storage-git-commits.d.ts.map +1 -1
- package/dist/features/magic-context/legacy-authority-fixture.test-support.d.ts +6 -0
- package/dist/features/magic-context/legacy-authority-fixture.test-support.d.ts.map +1 -0
- package/dist/features/magic-context/lkg-prefix-chunks.d.ts +53 -0
- package/dist/features/magic-context/lkg-prefix-chunks.d.ts.map +1 -0
- package/dist/features/magic-context/memory/embedding-backfill.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-local.d.ts +8 -0
- package/dist/features/magic-context/memory/embedding-local.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-openai.d.ts +1 -0
- package/dist/features/magic-context/memory/embedding-openai.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-worker-client.d.ts +27 -0
- package/dist/features/magic-context/memory/embedding-worker-client.d.ts.map +1 -0
- package/dist/features/magic-context/memory/embedding-worker.d.ts +2 -0
- package/dist/features/magic-context/memory/embedding-worker.d.ts.map +1 -0
- package/dist/features/magic-context/memory/embedding-worker.fixture.d.ts +2 -0
- package/dist/features/magic-context/memory/embedding-worker.fixture.d.ts.map +1 -0
- package/dist/features/magic-context/memory/memory-selection.d.ts.map +1 -1
- package/dist/features/magic-context/memory/project-identity-cache.d.ts +4 -3
- package/dist/features/magic-context/memory/project-identity-cache.d.ts.map +1 -1
- package/dist/features/magic-context/memory/project-identity.d.ts +5 -4
- package/dist/features/magic-context/memory/project-identity.d.ts.map +1 -1
- package/dist/features/magic-context/memory/storage-memory-fts.d.ts.map +1 -1
- package/dist/features/magic-context/memory/visibility.d.ts +1 -1
- package/dist/features/magic-context/memory/visibility.d.ts.map +1 -1
- package/dist/features/magic-context/message-fts-rowid-map.d.ts +14 -1
- package/dist/features/magic-context/message-fts-rowid-map.d.ts.map +1 -1
- package/dist/features/magic-context/message-fts-session-filter.d.ts +14 -0
- package/dist/features/magic-context/message-fts-session-filter.d.ts.map +1 -0
- package/dist/features/magic-context/message-index.d.ts +1 -7
- package/dist/features/magic-context/message-index.d.ts.map +1 -1
- package/dist/features/magic-context/message-time-backfill.d.ts.map +1 -1
- package/dist/features/magic-context/migration-v94-write-split.d.ts +62 -0
- package/dist/features/magic-context/migration-v94-write-split.d.ts.map +1 -0
- package/dist/features/magic-context/migration-worker-client.d.ts +23 -0
- package/dist/features/magic-context/migration-worker-client.d.ts.map +1 -0
- package/dist/features/magic-context/migration-worker-protocol.d.ts +30 -0
- package/dist/features/magic-context/migration-worker-protocol.d.ts.map +1 -0
- package/dist/features/magic-context/migration-worker.d.ts +2 -0
- package/dist/features/magic-context/migration-worker.d.ts.map +1 -0
- package/dist/features/magic-context/migrations.d.ts +7 -0
- package/dist/features/magic-context/migrations.d.ts.map +1 -1
- package/dist/features/magic-context/mural/render-mural.d.ts +24 -2
- package/dist/features/magic-context/mural/render-mural.d.ts.map +1 -1
- package/dist/features/magic-context/mural/render-trigger.d.ts +1 -1
- package/dist/features/magic-context/mural/render-trigger.d.ts.map +1 -1
- package/dist/features/magic-context/overflow-detection.d.ts +18 -7
- package/dist/features/magic-context/overflow-detection.d.ts.map +1 -1
- package/dist/features/magic-context/project-embedding-registry.d.ts +2 -0
- package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
- package/dist/features/magic-context/range-parser.d.ts +2 -3
- package/dist/features/magic-context/range-parser.d.ts.map +1 -1
- package/dist/features/magic-context/resolve-subagent-fallback.d.ts +2 -0
- package/dist/features/magic-context/resolve-subagent-fallback.d.ts.map +1 -1
- package/dist/features/magic-context/scheduler.d.ts +2 -0
- package/dist/features/magic-context/scheduler.d.ts.map +1 -1
- package/dist/features/magic-context/search.d.ts +7 -0
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/features/magic-context/session-project-backfill.d.ts.map +1 -1
- package/dist/features/magic-context/session-project-storage.d.ts +10 -1
- package/dist/features/magic-context/session-project-storage.d.ts.map +1 -1
- package/dist/features/magic-context/smart-notes/compiler-prompt.d.ts +1 -1
- package/dist/features/magic-context/smart-notes/compiler-prompt.d.ts.map +1 -1
- package/dist/features/magic-context/smart-notes/compiler.d.ts +4 -0
- package/dist/features/magic-context/smart-notes/compiler.d.ts.map +1 -1
- package/dist/features/magic-context/smart-notes/runner.d.ts.map +1 -1
- package/dist/features/magic-context/smart-notes/sandbox-runner.d.ts +2 -0
- package/dist/features/magic-context/smart-notes/sandbox-runner.d.ts.map +1 -1
- package/dist/features/magic-context/smart-notes/ssrf-guard.d.ts +10 -8
- package/dist/features/magic-context/smart-notes/ssrf-guard.d.ts.map +1 -1
- package/dist/features/magic-context/smart-notes/storage.d.ts +2 -2
- package/dist/features/magic-context/smart-notes/storage.d.ts.map +1 -1
- package/dist/features/magic-context/smart-notes/types.d.ts +7 -2
- package/dist/features/magic-context/smart-notes/types.d.ts.map +1 -1
- package/dist/features/magic-context/storage-caveman-rules.d.ts +21 -0
- package/dist/features/magic-context/storage-caveman-rules.d.ts.map +1 -0
- package/dist/features/magic-context/storage-clone.d.ts.map +1 -1
- package/dist/features/magic-context/storage-compartment-history-version.d.ts +4 -0
- package/dist/features/magic-context/storage-compartment-history-version.d.ts.map +1 -0
- package/dist/features/magic-context/storage-db.d.ts +68 -3
- package/dist/features/magic-context/storage-db.d.ts.map +1 -1
- package/dist/features/magic-context/storage-identity-merge.d.ts +6 -0
- package/dist/features/magic-context/storage-identity-merge.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +15 -0
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-session.d.ts +1 -1
- package/dist/features/magic-context/storage-meta-session.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-shared.d.ts +1 -1
- package/dist/features/magic-context/storage-meta-shared.d.ts.map +1 -1
- package/dist/features/magic-context/storage-notes.d.ts +2 -2
- package/dist/features/magic-context/storage-notes.d.ts.map +1 -1
- package/dist/features/magic-context/storage-reasoning-removal.d.ts +30 -0
- package/dist/features/magic-context/storage-reasoning-removal.d.ts.map +1 -0
- package/dist/features/magic-context/storage-replay-document.d.ts +42 -5
- package/dist/features/magic-context/storage-replay-document.d.ts.map +1 -1
- package/dist/features/magic-context/storage-session-tables.d.ts.map +1 -1
- package/dist/features/magic-context/storage-tags.d.ts +7 -1
- package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
- package/dist/features/magic-context/storage.d.ts +1 -1
- package/dist/features/magic-context/storage.d.ts.map +1 -1
- package/dist/features/magic-context/store-generation-rebase.d.ts.map +1 -1
- package/dist/features/magic-context/tag-input.d.ts +4 -0
- package/dist/features/magic-context/tag-input.d.ts.map +1 -0
- package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -1
- package/dist/features/magic-context/user-memory/review-user-memories.d.ts.map +1 -1
- package/dist/features/magic-context/user-memory/storage-user-memory.d.ts.map +1 -1
- package/dist/features/magic-context/v22-deferred-backfill.d.ts.map +1 -1
- package/dist/ffi-3cx1cxpk.js +78 -0
- package/dist/ffi-7bqqe4cd.js +91 -0
- package/dist/ffi-7e6gryj5.js +91 -0
- package/dist/ffi-bpvkebwr.js +78 -0
- package/dist/hooks/magic-context/apply-operations.d.ts +9 -1
- package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-deadline.d.ts +10 -0
- package/dist/hooks/magic-context/auto-search-deadline.d.ts.map +1 -0
- package/dist/hooks/magic-context/auto-search-hint.d.ts +3 -0
- package/dist/hooks/magic-context/auto-search-hint.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-runner.d.ts +3 -0
- package/dist/hooks/magic-context/auto-search-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/caveman-cleanup.d.ts +8 -1
- package/dist/hooks/magic-context/caveman-cleanup.d.ts.map +1 -1
- package/dist/hooks/magic-context/caveman.d.ts +56 -1
- package/dist/hooks/magic-context/caveman.d.ts.map +1 -1
- package/dist/hooks/magic-context/child-session-spawn.d.ts +2 -0
- package/dist/hooks/magic-context/child-session-spawn.d.ts.map +1 -1
- package/dist/hooks/magic-context/command-handler.d.ts +1 -1
- package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/compaction-marker-manager.d.ts +1 -1
- package/dist/hooks/magic-context/compaction-marker-manager.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-parser.d.ts +3 -3
- package/dist/hooks/magic-context/compartment-parser.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-render-epoch.d.ts +12 -1
- package/dist/hooks/magic-context/compartment-render-epoch.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts +0 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-partial-recomp.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 +3 -0
- package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts +6 -0
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-trigger.d.ts.map +1 -1
- package/dist/hooks/magic-context/degraded-pass-refusal.d.ts +35 -0
- package/dist/hooks/magic-context/degraded-pass-refusal.d.ts.map +1 -0
- package/dist/hooks/magic-context/derive-budgets.d.ts.map +1 -1
- package/dist/hooks/magic-context/drop-stale-reduce-calls.d.ts.map +1 -1
- package/dist/hooks/magic-context/dropped-input-guard.d.ts.map +1 -1
- package/dist/hooks/magic-context/embed-history-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/emergency-drop.d.ts +15 -0
- 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-resolvers.d.ts +7 -0
- package/dist/hooks/magic-context/event-resolvers.d.ts.map +1 -1
- package/dist/hooks/magic-context/execute-status.d.ts +1 -0
- package/dist/hooks/magic-context/execute-status.d.ts.map +1 -1
- package/dist/hooks/magic-context/final-wire-token-estimate.d.ts +17 -0
- package/dist/hooks/magic-context/final-wire-token-estimate.d.ts.map +1 -1
- package/dist/hooks/magic-context/heuristic-cleanup.d.ts +2 -0
- package/dist/hooks/magic-context/heuristic-cleanup.d.ts.map +1 -1
- package/dist/hooks/magic-context/historian-host-runner.d.ts +5 -0
- package/dist/hooks/magic-context/historian-host-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/historian-prompt-fit.d.ts +116 -0
- package/dist/hooks/magic-context/historian-prompt-fit.d.ts.map +1 -0
- package/dist/hooks/magic-context/historian-prompt.generated.d.ts +1 -1
- package/dist/hooks/magic-context/historian-prompt.generated.d.ts.map +1 -1
- package/dist/hooks/magic-context/history-boundary-repair.d.ts +44 -0
- package/dist/hooks/magic-context/history-boundary-repair.d.ts.map +1 -0
- package/dist/hooks/magic-context/hook.d.ts +4 -0
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts +13 -0
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-persist.d.ts +12 -0
- package/dist/hooks/magic-context/lkg-persist.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-replay-fit.d.ts +104 -0
- package/dist/hooks/magic-context/lkg-replay-fit.d.ts.map +1 -0
- package/dist/hooks/magic-context/lkg-replay.d.ts +64 -0
- package/dist/hooks/magic-context/lkg-replay.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-client.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-state-sync-timing.d.ts +1 -1
- package/dist/hooks/magic-context/module-state-sync-timing.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-state-sync.d.ts +6 -68
- package/dist/hooks/magic-context/module-state-sync.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-tool-backends.d.ts +1 -34
- package/dist/hooks/magic-context/module-tool-backends.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-transport.d.ts +1 -55
- package/dist/hooks/magic-context/module-transport.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-wire.d.ts.map +1 -1
- package/dist/hooks/magic-context/note-nudger.d.ts +2 -0
- package/dist/hooks/magic-context/note-nudger.d.ts.map +1 -1
- package/dist/hooks/magic-context/pass-outcome.d.ts +59 -2
- package/dist/hooks/magic-context/pass-outcome.d.ts.map +1 -1
- package/dist/hooks/magic-context/producer-window-guard.d.ts +6 -0
- package/dist/hooks/magic-context/producer-window-guard.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-chunk.d.ts +17 -4
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-formatting.d.ts +11 -0
- package/dist/hooks/magic-context/read-session-formatting.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-raw.d.ts +2 -2
- package/dist/hooks/magic-context/read-session-raw.d.ts.map +1 -1
- package/dist/hooks/magic-context/reasoning-removal.d.ts +60 -0
- package/dist/hooks/magic-context/reasoning-removal.d.ts.map +1 -0
- package/dist/hooks/magic-context/recomp-orchestrator.d.ts +1 -0
- package/dist/hooks/magic-context/recomp-orchestrator.d.ts.map +1 -1
- package/dist/hooks/magic-context/reference-retrieval.d.ts +1 -1
- package/dist/hooks/magic-context/reference-retrieval.d.ts.map +1 -1
- package/dist/hooks/magic-context/reply-pages.d.ts +3 -0
- package/dist/hooks/magic-context/reply-pages.d.ts.map +1 -0
- package/dist/hooks/magic-context/rust-lkg-freeze-registry.d.ts +62 -0
- package/dist/hooks/magic-context/rust-lkg-freeze-registry.d.ts.map +1 -0
- package/dist/hooks/magic-context/rust-mode-transform.d.ts +17 -85
- package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/send-session-notification.d.ts.map +1 -1
- package/dist/hooks/magic-context/sentinel.d.ts +35 -0
- package/dist/hooks/magic-context/sentinel.d.ts.map +1 -1
- package/dist/hooks/magic-context/shared-compartment-boundaries.d.ts +28 -0
- package/dist/hooks/magic-context/shared-compartment-boundaries.d.ts.map +1 -0
- package/dist/hooks/magic-context/single-store-refusal.d.ts +14 -0
- package/dist/hooks/magic-context/single-store-refusal.d.ts.map +1 -0
- package/dist/hooks/magic-context/storage-busy-refusal.d.ts +7 -0
- package/dist/hooks/magic-context/storage-busy-refusal.d.ts.map +1 -1
- package/dist/hooks/magic-context/strip-content.d.ts.map +1 -1
- package/dist/hooks/magic-context/stripped-command.d.ts +1 -1
- package/dist/hooks/magic-context/stripped-command.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-injection-stripper.d.ts +7 -0
- package/dist/hooks/magic-context/system-injection-stripper.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-content-primitives.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-id-fallback.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-messages.d.ts +18 -1
- package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
- package/dist/hooks/magic-context/tail-hygiene-walk.d.ts.map +1 -1
- package/dist/hooks/magic-context/tokenizer-calibration.d.ts +1 -1
- package/dist/hooks/magic-context/tool-drop-target.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts +1 -0
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +38 -4
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +12 -39
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/unmanaged-over-window.d.ts +36 -0
- package/dist/hooks/magic-context/unmanaged-over-window.d.ts.map +1 -0
- package/dist/hooks/magic-context/unresolved-history-boundary.d.ts +15 -0
- package/dist/hooks/magic-context/unresolved-history-boundary.d.ts.map +1 -0
- package/dist/hooks/magic-context/user-profile-render.d.ts +3 -0
- package/dist/hooks/magic-context/user-profile-render.d.ts.map +1 -0
- package/dist/hooks/magic-context/wrapup-orchestrator.d.ts.map +1 -1
- package/dist/{index-yhm60r53.js → index-16ny736w.js} +13622 -28584
- package/dist/{index-q5p1aqvv.js → index-2aq21j41.js} +1208 -429
- package/dist/{index-32b096cc.js → index-2ntg5sd4.js} +6 -2
- package/dist/index-4krbw8z9.js +6034 -0
- package/dist/{index-33q7s9y2.js → index-75zjgwga.js} +61 -85
- package/dist/{index-nf9sk8sh.js → index-8fgkmxmy.js} +28 -10
- package/dist/index-a4m2b1yv.js +530 -0
- package/dist/index-anq4nn6f.js +131 -0
- package/dist/index-avwt563y.js +62 -0
- package/dist/index-bmzf7zxv.js +445 -0
- package/dist/index-e44zzy84.js +10 -0
- package/dist/index-en1k8h8m.js +244 -0
- package/dist/{index-638hf49n.js → index-f85teqck.js} +15 -6
- package/dist/index-fr2z4qy8.js +7810 -0
- package/dist/{index-kwe03yde.js → index-fzbvakh0.js} +1 -1
- package/dist/{module-asyncify-2EFITU5U-rkqjhjxd.js → index-g20jdh0p.js} +114 -105
- package/dist/index-gd5qx1j9.js +398 -0
- package/dist/{index-3bygzk2d.js → index-hybnrwq0.js} +169 -4
- package/dist/{index-jqcbs2k1.js → index-mc22ayvf.js} +24 -5
- package/dist/{index-y5145x8k.js → index-n96ag4rk.js} +15 -1
- package/dist/index-q7yesyk9.js +9118 -0
- package/dist/index-remp7e2g.js +214 -0
- package/dist/{index-7k55qm8a.js → index-sfpzqvdz.js} +8 -8
- package/dist/{index-9y5p0d50.js → index-vvtfyw1z.js} +13 -76
- package/dist/index-w9jwmntv.js +202 -0
- package/dist/{index-kr5qehbd.js → index-x23gah8c.js} +1 -1
- package/dist/{index-jdxxq8cz.js → index-x8a7jmkh.js} +6 -1
- package/dist/{index-rdsaxnf2.js → index-xgt9k6c6.js} +23 -12
- package/dist/index-y8v6yerm.js +77 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7560 -8084
- package/dist/message-time-backfill-an311pmk.js +124 -0
- package/dist/migration-worker.js +53 -0
- package/dist/{model-resolution-dxatzjde.js → model-resolution-xhfmyyvy.js} +5 -1
- package/dist/module-ES6BEMUI-3cet1pyp.js +12 -0
- package/dist/module-asyncify-2EFITU5U-c2razzd9.js +6 -0
- package/dist/plugin/boot-deadline.d.ts.map +1 -1
- package/dist/plugin/conflict-warning-hook.d.ts.map +1 -1
- package/dist/plugin/dream-timer-module-client.d.ts +1 -11
- package/dist/plugin/dream-timer-module-client.d.ts.map +1 -1
- package/dist/plugin/dream-timer.d.ts.map +1 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts +8 -0
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/plugin/messages-transform.d.ts +20 -13
- package/dist/plugin/messages-transform.d.ts.map +1 -1
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/plugin/stale-build-notice.d.ts +16 -0
- package/dist/plugin/stale-build-notice.d.ts.map +1 -0
- package/dist/read-session-chunk-8rxs0tc9.js +84 -0
- package/dist/recomp-orchestrator-nzamtw29.js +39 -0
- package/dist/{rpc-notifications-4amf6mf4.js → rpc-notifications-3hed126v.js} +3 -1
- package/dist/{safe-notification-target-50gm9c58.js → safe-notification-target-43r8jsxw.js} +3 -3
- package/dist/send-session-notification-nqpv7cne.js +28 -0
- package/dist/shared/assistant-message-extractor.d.ts +4 -0
- package/dist/shared/assistant-message-extractor.d.ts.map +1 -1
- package/dist/shared/background-batch-drain.d.ts +8 -0
- package/dist/shared/background-batch-drain.d.ts.map +1 -0
- package/dist/{features/builtin-commands/commands.d.ts → shared/builtin-commands.d.ts} +1 -1
- package/dist/shared/builtin-commands.d.ts.map +1 -0
- package/dist/shared/embedding-activity.d.ts +13 -0
- package/dist/shared/embedding-activity.d.ts.map +1 -0
- package/dist/shared/historian-tool-expansions.d.ts +5 -0
- package/dist/shared/historian-tool-expansions.d.ts.map +1 -0
- package/dist/shared/historian-tool-template.d.ts +5 -0
- package/dist/shared/historian-tool-template.d.ts.map +1 -0
- package/dist/shared/historian-transient-error.d.ts +2 -0
- package/dist/shared/historian-transient-error.d.ts.map +1 -0
- package/dist/shared/jsonc-edit.d.ts.map +1 -1
- package/dist/shared/logger.d.ts +7 -0
- package/dist/shared/logger.d.ts.map +1 -1
- package/dist/shared/model-suggestion-retry.d.ts +2 -1
- package/dist/shared/model-suggestion-retry.d.ts.map +1 -1
- package/dist/shared/models-dev-cache.d.ts.map +1 -1
- package/dist/shared/off-thread-migration-clock.d.ts +38 -0
- package/dist/shared/off-thread-migration-clock.d.ts.map +1 -0
- package/dist/shared/plugin-package-version.d.ts +14 -0
- package/dist/shared/plugin-package-version.d.ts.map +1 -0
- package/dist/shared/project-directory-key.d.ts +26 -0
- package/dist/shared/project-directory-key.d.ts.map +1 -0
- package/dist/shared/prompt-async-transport.d.ts +4 -0
- package/dist/shared/prompt-async-transport.d.ts.map +1 -1
- package/dist/shared/prompt-surface-runtime.d.ts +3 -3
- package/dist/shared/provider-response-completion.d.ts +12 -0
- package/dist/shared/provider-response-completion.d.ts.map +1 -0
- package/dist/shared/redaction.d.ts.map +1 -1
- package/dist/shared/rpc-client.d.ts +23 -2
- package/dist/shared/rpc-client.d.ts.map +1 -1
- package/dist/shared/rpc-types.d.ts +19 -0
- package/dist/shared/rpc-types.d.ts.map +1 -1
- package/dist/shared/rpc-utils.d.ts +41 -0
- package/dist/shared/rpc-utils.d.ts.map +1 -1
- package/dist/shared/sqlite.d.ts +13 -2
- package/dist/shared/sqlite.d.ts.map +1 -1
- package/dist/shared/stale-plugin-build.d.ts +21 -0
- package/dist/shared/stale-plugin-build.d.ts.map +1 -0
- package/dist/shared/status-summary.d.ts +29 -0
- package/dist/shared/status-summary.d.ts.map +1 -1
- package/dist/shared/status-view-check.d.ts +124 -0
- package/dist/shared/status-view-check.d.ts.map +1 -0
- package/dist/shared/status-view.d.ts +38 -2
- package/dist/shared/status-view.d.ts.map +1 -1
- package/dist/shared/tag-owner-id.d.ts +19 -0
- package/dist/shared/tag-owner-id.d.ts.map +1 -0
- package/dist/shared/tag-transcript.d.ts +2 -1
- package/dist/shared/tag-transcript.d.ts.map +1 -1
- package/dist/shared/test-temp-dir.d.ts +8 -2
- package/dist/shared/test-temp-dir.d.ts.map +1 -1
- package/dist/shared/transcript.d.ts +2 -0
- package/dist/shared/transcript.d.ts.map +1 -1
- package/dist/shared/user-answer.d.ts +4 -0
- package/dist/shared/user-answer.d.ts.map +1 -0
- package/dist/shared/user-facing-codes.d.ts +41 -6
- package/dist/shared/user-facing-codes.d.ts.map +1 -1
- package/dist/shared/xml-unescape.d.ts +9 -0
- package/dist/shared/xml-unescape.d.ts.map +1 -0
- package/dist/task-config-v81k8jvk.js +17 -0
- 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/mode.d.ts +4 -0
- package/dist/tools/ctx-expand/mode.d.ts.map +1 -1
- package/dist/tools/ctx-expand/render.d.ts +5 -1
- package/dist/tools/ctx-expand/render.d.ts.map +1 -1
- package/dist/tools/ctx-expand/tools.d.ts +2 -0
- package/dist/tools/ctx-expand/tools.d.ts.map +1 -1
- package/dist/tools/ctx-expand/types.d.ts +1 -0
- package/dist/tools/ctx-expand/types.d.ts.map +1 -1
- package/dist/tools/ctx-memory/tools.d.ts.map +1 -1
- package/dist/tools/ctx-note/render.d.ts +2 -0
- package/dist/tools/ctx-note/render.d.ts.map +1 -1
- 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/light-descriptions.d.ts +3 -3
- package/dist/tools/light-descriptions.d.ts.map +1 -1
- package/dist/tools/parameter-descriptions.d.ts +14 -14
- package/dist/transform-postprocess-phase-414phndq.js +61 -0
- package/dist/tui/data/context-db.d.ts +34 -10
- package/dist/tui/data/context-db.d.ts.map +1 -1
- package/dist/tui/data/notification-socket.d.ts +6 -0
- package/dist/tui/data/notification-socket.d.ts.map +1 -1
- package/dist/tui/data/session-directory.d.ts +16 -0
- package/dist/tui/data/session-directory.d.ts.map +1 -0
- package/dist/tui-compiled/data/context-db.d.ts +34 -10
- package/dist/tui-compiled/data/context-db.d.ts.map +1 -1
- package/dist/tui-compiled/data/notification-socket.d.ts +6 -0
- package/dist/tui-compiled/data/notification-socket.d.ts.map +1 -1
- package/dist/tui-compiled/data/session-directory.d.ts +16 -0
- package/dist/tui-compiled/data/session-directory.d.ts.map +1 -0
- package/dist/v2/derive-budgets-v0krf3t7.js +18 -0
- package/dist/v2/embedding-worker.js +47 -0
- package/dist/v2/emscripten-module-0g8f45e6.js +602 -0
- package/dist/v2/emscripten-module-0pekdjxz.js +1532 -0
- package/dist/v2/emscripten-module-e67xwsp3.js +503 -0
- package/dist/v2/emscripten-module-pj1vyb44.js +4559 -0
- package/dist/v2/ffi-3cx1cxpk.js +78 -0
- package/dist/v2/ffi-7bqqe4cd.js +91 -0
- package/dist/v2/ffi-7e6gryj5.js +91 -0
- package/dist/v2/ffi-bpvkebwr.js +78 -0
- package/dist/v2/fold/boundary.d.ts.map +1 -1
- package/dist/v2/fork-inheritance.d.ts +101 -0
- package/dist/v2/fork-inheritance.d.ts.map +1 -0
- package/dist/v2/hidden-child-cleanup.d.ts +11 -0
- package/dist/v2/hidden-child-cleanup.d.ts.map +1 -0
- package/dist/v2/hidden-child-native.d.ts +29 -0
- package/dist/v2/hidden-child-native.d.ts.map +1 -0
- package/dist/v2/hidden-child-record.d.ts +135 -0
- package/dist/v2/hidden-child-record.d.ts.map +1 -0
- package/dist/v2/hidden-completion.d.ts +12 -97
- package/dist/v2/hidden-completion.d.ts.map +1 -1
- package/dist/v2/hooks/context.d.ts +20 -8
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/dream-manual.d.ts.map +1 -1
- package/dist/v2/hooks/dream-trigger.d.ts +5 -0
- package/dist/v2/hooks/dream-trigger.d.ts.map +1 -1
- package/dist/v2/hooks/generate.d.ts +10 -0
- package/dist/v2/hooks/generate.d.ts.map +1 -0
- package/dist/v2/hooks/hidden-child.d.ts +33 -2
- package/dist/v2/hooks/hidden-child.d.ts.map +1 -1
- package/dist/v2/hooks/payload.d.ts +3 -0
- package/dist/v2/hooks/payload.d.ts.map +1 -1
- package/dist/v2/hooks/session-api-gate.d.ts +4 -0
- package/dist/v2/hooks/session-api-gate.d.ts.map +1 -0
- package/dist/v2/hooks/storage-gate.d.ts +3 -1
- package/dist/v2/hooks/storage-gate.d.ts.map +1 -1
- package/dist/v2/hooks/store.d.ts +1 -1
- package/dist/v2/hooks/store.d.ts.map +1 -1
- package/dist/v2/hooks/tools.d.ts.map +1 -1
- package/dist/v2/hooks/types.d.ts +10 -0
- package/dist/v2/hooks/types.d.ts.map +1 -1
- package/dist/v2/hooks/update-check.d.ts.map +1 -1
- package/dist/v2/hooks/usage-persist.d.ts.map +1 -1
- package/dist/v2/hooks/usage-reading.d.ts +4 -0
- package/dist/v2/hooks/usage-reading.d.ts.map +1 -1
- package/dist/v2/index-6e4mwffh.js +5662 -0
- package/dist/v2/index-en1k8h8m.js +244 -0
- package/dist/{message-time-backfill-q374fxc5.js → v2/message-time-backfill-0n93vrd7.js} +19 -5
- package/dist/v2/migration-worker.js +52 -0
- package/dist/v2/model-resolution-xhfmyyvy.js +16 -0
- package/dist/v2/module-ES6BEMUI-3cet1pyp.js +12 -0
- package/dist/v2/module-asyncify-2EFITU5U-c2razzd9.js +6 -0
- package/dist/v2/prompt-context-5y5ms8f9.js +6 -0
- package/dist/{read-session-chunk-n072mcq4.js → v2/read-session-chunk-hjza38hr.js} +24 -7
- package/dist/v2/recomp-orchestrator-1aq7h44c.js +36 -0
- package/dist/v2/retrospective-raw-provider.d.ts +21 -0
- package/dist/v2/retrospective-raw-provider.d.ts.map +1 -0
- package/dist/v2/rpc-notifications-3hed126v.js +16 -0
- package/dist/v2/safe-notification-target-wtj0bbc2.js +9 -0
- package/dist/{send-session-notification-04hvd54c.js → v2/send-session-notification-mq9frrtm.js} +10 -5
- package/dist/v2/server-0jqw05sa.js +803 -0
- package/dist/v2/server-5317ykaf.js +40 -0
- package/dist/v2/server-a4m2b1yv.js +530 -0
- package/dist/v2/server-avwt563y.js +62 -0
- package/dist/v2/server-c4g2y1z8.js +28824 -0
- package/dist/v2/server-ckpc8pxy.js +662 -0
- package/dist/v2/server-e36nf2p1.js +7702 -0
- package/dist/v2/server-e44zzy84.js +10 -0
- package/dist/v2/server-fgmxwrgy.js +16 -0
- package/dist/v2/server-fmsr7v69.js +75 -0
- package/dist/v2/server-g20jdh0p.js +1273 -0
- package/dist/{index-dgg5y7er.js → v2/server-hfjfbg59.js} +849 -747
- package/dist/v2/server-n96ag4rk.js +633 -0
- package/dist/v2/server-qdjnb2z1.js +181 -0
- package/dist/v2/server-qpg6wf72.js +187 -0
- package/dist/v2/server-r7cmye3k.js +131 -0
- package/dist/v2/server-remp7e2g.js +214 -0
- package/dist/v2/server-rhdgxp1t.js +398 -0
- package/dist/v2/server-sfpzqvdz.js +137 -0
- package/dist/v2/server-syahy8j8.js +50 -0
- package/dist/v2/server-v5xgft5v.js +9116 -0
- package/dist/v2/server-w99cyt6a.js +361 -0
- package/dist/v2/server-x8a7jmkh.js +104 -0
- package/dist/v2/server-y8v6yerm.js +77 -0
- package/dist/v2/server-z19x7eqz.js +423 -0
- package/dist/v2/server.d.ts.map +1 -1
- package/dist/v2/server.js +8868 -107184
- package/dist/v2/store-reader.d.ts +52 -1
- package/dist/v2/store-reader.d.ts.map +1 -1
- package/dist/v2/task-config-tbndqyny.js +17 -0
- package/dist/v2/transformers-node-wasm.js +26768 -0
- package/dist/v2/transformers-web.js +25670 -0
- package/dist/v2/transformers.node-hj754h7s.js +29997 -0
- package/dist/v2/tui/index.d.ts +10 -1
- package/dist/v2/tui/index.d.ts.map +1 -1
- package/dist/v2/tui/sidebar-mount.d.ts +6 -0
- package/dist/v2/tui/sidebar-mount.d.ts.map +1 -1
- package/dist/v2/tui/status-dialog-mount.d.ts +7 -4
- package/dist/v2/tui/status-dialog-mount.d.ts.map +1 -1
- package/dist/v2/tui/types.d.ts +12 -0
- package/dist/v2/tui/types.d.ts.map +1 -1
- package/dist/v2/wrapup-orchestrator-tbyx78dz.js +425 -0
- package/dist/wrapup-orchestrator-h28bqsy6.js +26 -0
- package/package.json +8 -8
- package/src/agents/hidden-agent-registrations.ts +24 -16
- package/src/agents/magic-context-prompt.test.ts +41 -0
- package/src/agents/magic-context-prompt.ts +8 -5
- package/src/agents/permissions.test.ts +31 -49
- package/src/agents/permissions.ts +8 -28
- package/src/config/index.test.ts +60 -20
- package/src/config/index.ts +53 -1
- package/src/config/live-run-config.test.ts +5 -5
- package/src/config/live-snapshot.test.ts +4 -4
- package/src/config/migrate-config-location.test.ts +3 -10
- package/src/config/project-config-trust-boundary.test.ts +207 -0
- package/src/config/project-security.hostile-matrix.test.ts +4 -4
- package/src/config/project-security.ts +218 -1
- package/src/config/protected-tokens.test.ts +14 -9
- package/src/config/raw-loader.test.ts +31 -3
- package/src/config/raw-loader.ts +8 -3
- package/src/config/schema/magic-context.ts +20 -3
- package/src/config/variable.test.ts +3 -2
- package/src/features/magic-context/dreamer/cron.ts +30 -9
- package/src/features/magic-context/dreamer/task-registry.ts +7 -5
- package/src/shared/announcement.test.ts +2 -1
- package/src/shared/assistant-message-extractor.test.ts +27 -1
- package/src/shared/assistant-message-extractor.ts +27 -0
- package/src/shared/background-batch-drain.test.ts +38 -0
- package/src/shared/background-batch-drain.ts +29 -0
- package/src/shared/builtin-commands.ts +50 -0
- package/src/shared/console-diagnostics-fence.test.ts +145 -0
- package/src/shared/data-path.test.ts +6 -5
- package/src/shared/embedding-activity.test.ts +21 -0
- package/src/shared/embedding-activity.ts +36 -0
- package/src/shared/historian-tool-defaults.json +13 -0
- package/src/shared/historian-tool-expansions.ts +18 -0
- package/src/shared/historian-tool-template.ts +248 -0
- package/src/shared/historian-transient-error.test.ts +36 -0
- package/src/shared/historian-transient-error.ts +22 -0
- package/src/shared/jsonc-edit.ts +20 -1
- package/src/shared/logger.test.ts +3 -2
- package/src/shared/logger.ts +40 -1
- package/src/shared/model-suggestion-retry.test.ts +46 -0
- package/src/shared/model-suggestion-retry.ts +16 -1
- package/src/shared/models-dev-cache.test.ts +74 -2
- package/src/shared/models-dev-cache.ts +5 -1
- package/src/shared/off-thread-migration-clock.test.ts +55 -0
- package/src/shared/off-thread-migration-clock.ts +124 -0
- package/src/shared/opencode-db-path.test.ts +3 -2
- package/src/shared/plugin-package-version.ts +52 -0
- package/src/shared/project-directory-key.test.ts +111 -0
- package/src/shared/project-directory-key.ts +54 -0
- package/src/shared/prompt-async-transport.test.ts +249 -72
- package/src/shared/prompt-async-transport.ts +131 -24
- package/src/shared/prompt-surface-a1-golden.md +41 -25
- package/src/shared/prompt-surface-runtime.test.ts +3 -3
- package/src/shared/provider-response-completion.ts +23 -0
- package/src/shared/redaction.test.ts +51 -1
- package/src/shared/redaction.ts +33 -0
- package/src/shared/rpc-async-probes.test.ts +32 -2
- package/src/shared/rpc-client.test.ts +3 -2
- package/src/shared/rpc-client.ts +76 -18
- package/src/shared/rpc-types.ts +15 -0
- package/src/shared/rpc-utils.test.ts +191 -12
- package/src/shared/rpc-utils.ts +184 -26
- package/src/shared/sqlite-acquisition-routing.test.ts +46 -3
- package/src/shared/sqlite-pass-scope.test.ts +3 -2
- package/src/shared/sqlite-transaction-mode-guard.test.ts +4 -0
- package/src/shared/sqlite-writer-diagnostics.test.ts +134 -0
- package/src/shared/sqlite.ts +225 -41
- package/src/shared/stale-plugin-build.test.ts +129 -0
- package/src/shared/stale-plugin-build.ts +151 -0
- package/src/shared/status-summary.ts +40 -13
- package/src/shared/status-view-check.test.ts +253 -0
- package/src/shared/status-view-check.ts +536 -0
- package/src/shared/status-view.test.ts +6 -1
- package/src/shared/status-view.ts +176 -4
- package/src/shared/storage-busy.test.ts +3 -2
- package/src/shared/tag-owner-id.test.ts +33 -0
- package/src/shared/tag-owner-id.ts +29 -0
- package/src/shared/tag-transcript.ts +17 -3
- package/src/shared/test-temp-dir-policy.test.ts +33 -0
- package/src/shared/test-temp-dir.test.ts +27 -0
- package/src/shared/test-temp-dir.ts +36 -12
- package/src/shared/transcript.ts +3 -0
- package/src/shared/tui-config.test.ts +6 -5
- package/src/shared/tui-preferences.test.ts +3 -2
- package/src/shared/user-answer.test.ts +40 -0
- package/src/shared/user-answer.ts +17 -0
- package/src/shared/user-facing-codes.ts +52 -6
- package/src/shared/window-geometry.test.ts +3 -2
- package/src/shared/write-transaction-attribution.test.ts +11 -7
- package/src/shared/write-transaction-hold-clock.test.ts +160 -0
- package/src/shared/xml-unescape.ts +19 -0
- package/src/tui/data/context-db.test.ts +92 -4
- package/src/tui/data/context-db.ts +184 -18
- package/src/tui/data/notification-socket.test.ts +49 -2
- package/src/tui/data/notification-socket.ts +47 -9
- package/src/tui/data/session-directory.ts +19 -0
- package/src/tui/dialogs/status-dialog-render.test.ts +284 -0
- package/src/tui/dialogs/status-dialog.tsx +41 -38
- package/src/tui/index.tsx +30 -18
- package/src/tui/slots/sidebar-content.tsx +9 -2
- package/src/tui-compiled/data/context-db.ts +184 -18
- package/src/tui-compiled/data/notification-socket.ts +47 -9
- package/src/tui-compiled/data/session-directory.ts +19 -0
- package/src/tui-compiled/dialogs/status-dialog.tsx +38 -29
- package/src/tui-compiled/index.tsx +29 -16
- package/src/tui-compiled/slots/sidebar-content.tsx +3 -2
- package/src/v2/tui/host-contract.test.ts +9 -10
- package/src/v2/tui/index.ts +78 -23
- package/src/v2/tui/load-compiled-sidebar.d.mts +5 -1
- package/src/v2/tui/load-compiled-status-dialog.d.mts +3 -2
- package/src/v2/tui/session-directory.test.ts +53 -0
- package/src/v2/tui/sidebar-mount.ts +19 -1
- package/src/v2/tui/status-dialog-mount.ts +10 -7
- package/src/v2/tui/types.ts +10 -0
- package/dist/features/builtin-commands/commands.d.ts.map +0 -1
- package/dist/features/builtin-commands/types.d.ts +0 -3
- package/dist/features/builtin-commands/types.d.ts.map +0 -1
- package/dist/features/magic-context/context-authority.d.ts +0 -272
- package/dist/features/magic-context/context-authority.d.ts.map +0 -1
- package/dist/features/magic-context/memory/mirror-reembed.d.ts +0 -22
- package/dist/features/magic-context/memory/mirror-reembed.d.ts.map +0 -1
- package/dist/hooks/magic-context/historian-state-file.d.ts +0 -43
- package/dist/hooks/magic-context/historian-state-file.d.ts.map +0 -1
- package/dist/index-4an2p8qa.js +0 -1056
- package/dist/index-rn7gafjr.js +0 -8
- package/dist/index-v6t0tg85.js +0 -13
- package/dist/plugin/memory-id-translation.d.ts +0 -109
- package/dist/plugin/memory-id-translation.d.ts.map +0 -1
- package/dist/plugin/rust-note-backend.d.ts +0 -84
- package/dist/plugin/rust-note-backend.d.ts.map +0 -1
- package/dist/recomp-orchestrator-19tr6zya.js +0 -22
- package/dist/task-config-2bm68628.js +0 -9
- package/dist/transform-postprocess-phase-z2mfc5w1.js +0 -36
- package/dist/v2/host-service.d.ts +0 -66
- package/dist/v2/host-service.d.ts.map +0 -1
- package/dist/wrapup-orchestrator-sy4m56a7.js +0 -19
- /package/dist/{index-s70wtd8k.js → index-q6hef7fh.js} +0 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { posix } from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { getHarness, type HarnessId } from "./harness";
|
|
4
|
+
import { log } from "./logger";
|
|
5
|
+
|
|
6
|
+
interface BuildHost {
|
|
7
|
+
dist: string;
|
|
8
|
+
harness: HarnessId;
|
|
9
|
+
notify?: (message: string) => unknown;
|
|
10
|
+
}
|
|
11
|
+
interface StaleBuildState {
|
|
12
|
+
hosts: Map<string, BuildHost>;
|
|
13
|
+
loggedChunks: Set<string>;
|
|
14
|
+
pendingNotice?: string;
|
|
15
|
+
notified: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Pi reloads modules and OpenCode can create several plugin instances. Neither
|
|
19
|
+
// should reset the process-wide warning or replay an old import rejection.
|
|
20
|
+
const STATE = Symbol.for("magic-context.stale-plugin-build");
|
|
21
|
+
function state(): StaleBuildState {
|
|
22
|
+
const globals = globalThis as Record<symbol, unknown>;
|
|
23
|
+
return (globals[STATE] ??= {
|
|
24
|
+
hosts: new Map(),
|
|
25
|
+
loggedChunks: new Set(),
|
|
26
|
+
notified: false,
|
|
27
|
+
}) as StaleBuildState;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function absolutePath(value: string): string | undefined {
|
|
31
|
+
let path = value;
|
|
32
|
+
if (path.startsWith("file:")) {
|
|
33
|
+
try {
|
|
34
|
+
path = fileURLToPath(path);
|
|
35
|
+
} catch {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
path = path.replaceAll("\\", "/").replace(/^\/(?=[A-Za-z]:\/)/, "");
|
|
40
|
+
if (!path.startsWith("/") && !/^[A-Za-z]:\//.test(path)) return undefined;
|
|
41
|
+
path = posix.normalize(path);
|
|
42
|
+
// Windows paths are case insensitive; POSIX paths are not.
|
|
43
|
+
return /^[A-Za-z]:\//.test(path) ? path.toLowerCase() : path;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function distForModule(moduleUrl: string): string | undefined {
|
|
47
|
+
const path = absolutePath(moduleUrl);
|
|
48
|
+
if (!path) return undefined;
|
|
49
|
+
// Use the actual loaded module's location, not a checkout name or cwd: npm
|
|
50
|
+
// installs, linked packages and the dist/v2 entry all use different roots.
|
|
51
|
+
const dist = path.lastIndexOf("/dist/");
|
|
52
|
+
return dist < 0 ? undefined : path.slice(0, dist + "/dist".length);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function stalePluginBuildGuidance(harness: HarnessId): string {
|
|
56
|
+
return harness === "pi" || harness === "omp"
|
|
57
|
+
? "Magic Context was rebuilt while this Pi was running; type /reload to load the new build"
|
|
58
|
+
: "Magic Context was rebuilt while this OpenCode host was running; restart the host to load the new build";
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function deliverNotice(host: BuildHost): void {
|
|
62
|
+
const current = state();
|
|
63
|
+
if (current.notified || !current.pendingNotice || !host.notify) return;
|
|
64
|
+
current.notified = true; // Claim before calling a reentrant or async UI.
|
|
65
|
+
try {
|
|
66
|
+
void Promise.resolve(host.notify(current.pendingNotice)).catch(() => {});
|
|
67
|
+
} catch {
|
|
68
|
+
// The single diagnostic remains available when the UI is shutting down.
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function registerStalePluginBuildHost(options: {
|
|
73
|
+
moduleUrl: string;
|
|
74
|
+
harness: HarnessId;
|
|
75
|
+
notify?: (message: string) => unknown;
|
|
76
|
+
}): void {
|
|
77
|
+
const dist = distForModule(options.moduleUrl);
|
|
78
|
+
if (!dist) return; // Source-mode imports are not a stale split distribution.
|
|
79
|
+
const host = { ...options, dist };
|
|
80
|
+
state().hosts.set(dist, host);
|
|
81
|
+
deliverNotice(host);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface StalePluginBuild {
|
|
85
|
+
chunk: string;
|
|
86
|
+
guidance: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function classifyStalePluginBuild(error: unknown): StalePluginBuild | null {
|
|
90
|
+
if (error instanceof StalePluginBuildError) return error.build;
|
|
91
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
92
|
+
const missing = message.match(/(?:Cannot find module|ENOENT reading)\s+(['"])(.*?)\1/);
|
|
93
|
+
if (!missing) return null;
|
|
94
|
+
let chunk = absolutePath(missing[2]);
|
|
95
|
+
if (!chunk && /^\.\.?[/\\]/.test(missing[2])) {
|
|
96
|
+
const importer = message
|
|
97
|
+
.slice((missing.index ?? 0) + missing[0].length)
|
|
98
|
+
.match(/(?:imported from|from)\s+(?:['"]([^'"]+)['"]|([^\n]+))/);
|
|
99
|
+
const from = importer && absolutePath((importer[1] ?? importer[2]).trim());
|
|
100
|
+
if (from)
|
|
101
|
+
chunk = absolutePath(posix.join(posix.dirname(from), missing[2].replaceAll("\\", "/")));
|
|
102
|
+
}
|
|
103
|
+
if (!chunk) return null;
|
|
104
|
+
for (const host of state().hosts.values()) {
|
|
105
|
+
if (chunk.startsWith(`${host.dist}/`)) {
|
|
106
|
+
return { chunk, guidance: stalePluginBuildGuidance(host.harness) };
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
// Workers and early boot failures can precede host registration. In a split
|
|
110
|
+
// bundle this module also lives in dist; do not guess from the error's path.
|
|
111
|
+
const ownDist = distForModule(import.meta.url);
|
|
112
|
+
return ownDist && chunk.startsWith(`${ownDist}/`)
|
|
113
|
+
? { chunk, guidance: stalePluginBuildGuidance(getHarness()) }
|
|
114
|
+
: null;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export class StalePluginBuildError extends Error {
|
|
118
|
+
constructor(readonly build: StalePluginBuild) {
|
|
119
|
+
super(build.guidance);
|
|
120
|
+
this.name = "StalePluginBuildError";
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** undefined means ordinary logging; null means an already reported occurrence. */
|
|
125
|
+
export function stalePluginBuildDiagnostic(error: unknown): string | null | undefined {
|
|
126
|
+
// Catch paths sometimes interpolate or rewrap a guarded import's error;
|
|
127
|
+
// reloaded modules also have a different StalePluginBuildError constructor.
|
|
128
|
+
const pending = state().pendingNotice;
|
|
129
|
+
const message = error instanceof Error ? error.message : typeof error === "string" ? error : "";
|
|
130
|
+
if (pending && message.includes(pending)) return null;
|
|
131
|
+
const build = classifyStalePluginBuild(error);
|
|
132
|
+
if (!build) return undefined;
|
|
133
|
+
const current = state();
|
|
134
|
+
current.pendingNotice ??= build.guidance;
|
|
135
|
+
for (const host of current.hosts.values()) deliverNotice(host);
|
|
136
|
+
if (current.loggedChunks.has(build.chunk)) return null;
|
|
137
|
+
current.loggedChunks.add(build.chunk);
|
|
138
|
+
return `[magic-context] stale plugin build: missing ${build.chunk.replace(/[\r\n]/g, " ")}; ${build.guidance}`;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** Keep the import lazy, but classify failures before an outer catch loses their identity. */
|
|
142
|
+
export async function importPluginModule<T>(load: () => Promise<T>): Promise<T> {
|
|
143
|
+
try {
|
|
144
|
+
return await load();
|
|
145
|
+
} catch (error) {
|
|
146
|
+
const build = classifyStalePluginBuild(error);
|
|
147
|
+
if (!build) throw error;
|
|
148
|
+
log("[magic-context] lazy import failed", error);
|
|
149
|
+
throw new StalePluginBuildError(build);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
@@ -36,20 +36,30 @@ export interface UserStatusSummary {
|
|
|
36
36
|
dreamerRunner?: RunnerStatus;
|
|
37
37
|
warnings: UserFacingFailureKey[];
|
|
38
38
|
hiddenVariantWarnings?: string[];
|
|
39
|
+
dreamerSkipped?: readonly string[];
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
/**
|
|
43
|
+
* The status fields the warning list is derived from. A full `StatusDetail`
|
|
44
|
+
* satisfies it; the status payload check builds one from an unchecked RPC reply
|
|
45
|
+
* so both paths derive the same warnings.
|
|
46
|
+
*/
|
|
47
|
+
export interface StatusWarningInput {
|
|
48
|
+
readonly lastTransformError?: string | null;
|
|
49
|
+
readonly historianFailureCount?: number;
|
|
50
|
+
readonly configParseFailures?: readonly unknown[];
|
|
51
|
+
readonly embedding?: { readonly state: string };
|
|
52
|
+
readonly loggerDiagnostics?: { readonly swallowedWriteCount?: number };
|
|
53
|
+
readonly memoryMirror?: { readonly stalled?: boolean };
|
|
54
|
+
readonly compactionMarker?: { readonly code: string | null };
|
|
55
|
+
readonly memoryAuthorityMismatch?: boolean;
|
|
56
|
+
readonly dreamerFailures?: readonly unknown[];
|
|
57
|
+
readonly dreamerTickFailure?: unknown;
|
|
58
|
+
readonly hostLimitations?: readonly UserFacingFailureKey[];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Failure codes the status surfaces print as warnings, deduplicated, in display order. */
|
|
62
|
+
export function statusWarningsFromDetail(detail: StatusWarningInput): UserFacingFailureKey[] {
|
|
53
63
|
const warnings: UserFacingFailureKey[] = [];
|
|
54
64
|
if (detail.lastTransformError) warnings.push("transform_update_failed");
|
|
55
65
|
if ((detail.historianFailureCount ?? 0) > 0) warnings.push("historian_unavailable");
|
|
@@ -70,6 +80,21 @@ export function statusSummaryFromDetail(detail: StatusDetail): UserStatusSummary
|
|
|
70
80
|
// same list: the user needs to see that something they configured or asked
|
|
71
81
|
// for is not running here.
|
|
72
82
|
warnings.push(...(detail.hostLimitations ?? []));
|
|
83
|
+
return [...new Set(warnings)];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function statusSummaryFromDetail(detail: StatusDetail): UserStatusSummary {
|
|
87
|
+
const compressionState: StatusCompressionState =
|
|
88
|
+
detail.compaction_enabled === false
|
|
89
|
+
? "off"
|
|
90
|
+
: detail.historianRunning ||
|
|
91
|
+
detail.compartmentInProgress ||
|
|
92
|
+
(detail.recompProgress?.phase === "recomp" &&
|
|
93
|
+
detail.recompProgress.kind !== "embed")
|
|
94
|
+
? "compressing"
|
|
95
|
+
: detail.compartmentCount > 0
|
|
96
|
+
? "ready"
|
|
97
|
+
: "waiting";
|
|
73
98
|
|
|
74
99
|
return {
|
|
75
100
|
inputTokens: detail.inputTokens,
|
|
@@ -101,8 +126,9 @@ export function statusSummaryFromDetail(detail: StatusDetail): UserStatusSummary
|
|
|
101
126
|
historianRunner: detail.historianRunner,
|
|
102
127
|
dreamerRunner: detail.dreamerRunner,
|
|
103
128
|
compactionMarker: detail.compactionMarker,
|
|
104
|
-
warnings:
|
|
129
|
+
warnings: statusWarningsFromDetail(detail),
|
|
105
130
|
hiddenVariantWarnings: detail.hiddenVariantWarnings ?? [],
|
|
131
|
+
dreamerSkipped: detail.dreamerSkipped,
|
|
106
132
|
};
|
|
107
133
|
}
|
|
108
134
|
|
|
@@ -194,6 +220,7 @@ export function renderUserStatusSummary(
|
|
|
194
220
|
if (summary.dreamerRunner) {
|
|
195
221
|
values.push(["Dreamer runner", runnerText(summary.dreamerRunner)]);
|
|
196
222
|
}
|
|
223
|
+
for (const skipped of summary.dreamerSkipped ?? []) values.push(["Dreamer skipped", skipped]);
|
|
197
224
|
if (summary.historianRefusal) {
|
|
198
225
|
values.push([
|
|
199
226
|
"Historian refusal",
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every payload the `/ctx-status` dialog can receive, from the cases that were
|
|
3
|
+
* reproduced on a real OpenCode 1.18.30 TUI for issue 584: each one must turn
|
|
4
|
+
* into a drawable view, and none may throw. The home-directory and
|
|
5
|
+
* paused-identity replies are the ones that crashed the TUI with
|
|
6
|
+
* "undefined is not an object (evaluating 'view().headline')".
|
|
7
|
+
*/
|
|
8
|
+
import { describe, expect, test } from "bun:test";
|
|
9
|
+
import { buildStatusViewFor, type StatusView } from "./status-view";
|
|
10
|
+
import {
|
|
11
|
+
checkStatusDetailPayload,
|
|
12
|
+
statusRpcFailure,
|
|
13
|
+
statusVersionNotice,
|
|
14
|
+
} from "./status-view-check";
|
|
15
|
+
|
|
16
|
+
const UI = "0.44.5";
|
|
17
|
+
const NOW = 1_790_765_900_000;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A `status-detail` reply captured from a real 0.42.6 server (sessionId and
|
|
21
|
+
* the dreamer backlog trimmed). It predates `pluginVersion`,
|
|
22
|
+
* `compactionMarker` and the other 0.44 fields.
|
|
23
|
+
*/
|
|
24
|
+
const V0426_DETAIL = {
|
|
25
|
+
sessionId: "ses_f0e0a60ebffeHorSVS4EaCi21f",
|
|
26
|
+
usagePercentage: 1.2512512512512513,
|
|
27
|
+
inputTokens: 2400,
|
|
28
|
+
contextLimit: 191808,
|
|
29
|
+
native_context_usage_percentage: 1.2,
|
|
30
|
+
compaction_enabled: true,
|
|
31
|
+
systemPromptTokens: 501,
|
|
32
|
+
compartmentCount: 0,
|
|
33
|
+
archivedCompartmentCount: 0,
|
|
34
|
+
memoryCount: 0,
|
|
35
|
+
memoryBlockCount: 0,
|
|
36
|
+
pendingOpsCount: 0,
|
|
37
|
+
historianRunning: false,
|
|
38
|
+
compartmentInProgress: false,
|
|
39
|
+
sessionNoteCount: 0,
|
|
40
|
+
readySmartNoteCount: 0,
|
|
41
|
+
cacheTtl: "5m",
|
|
42
|
+
lastTransformError: null,
|
|
43
|
+
lastDreamerRunAt: null,
|
|
44
|
+
projectIdentity: "git:e336ae3adbf8494e99a54cbfda6abff75804f693",
|
|
45
|
+
dreamerProgress: null,
|
|
46
|
+
compartmentTokens: 1,
|
|
47
|
+
factTokens: 0,
|
|
48
|
+
memoryTokens: 0,
|
|
49
|
+
docsTokens: 0,
|
|
50
|
+
profileTokens: 0,
|
|
51
|
+
conversationTokens: 0,
|
|
52
|
+
toolCallTokens: 0,
|
|
53
|
+
toolDefinitionTokens: 1898,
|
|
54
|
+
tailHygiene: {
|
|
55
|
+
u: 6,
|
|
56
|
+
t: 6,
|
|
57
|
+
severity: 1,
|
|
58
|
+
evaluable: true,
|
|
59
|
+
generationInvalidated: false,
|
|
60
|
+
baselineGeneration: 1,
|
|
61
|
+
computedAt: 1790765801961,
|
|
62
|
+
reclaimableToolOutputCount: 0,
|
|
63
|
+
},
|
|
64
|
+
executeThreshold: 40,
|
|
65
|
+
newWorkTokens: 2420,
|
|
66
|
+
totalInputTokens: 2400,
|
|
67
|
+
recompProgress: null,
|
|
68
|
+
hostBackendsModuleSide: false,
|
|
69
|
+
memoryAuthorityMismatch: false,
|
|
70
|
+
activeProfile: null,
|
|
71
|
+
tagCounter: 1,
|
|
72
|
+
activeTags: 1,
|
|
73
|
+
droppedTags: 0,
|
|
74
|
+
totalTags: 1,
|
|
75
|
+
tagCountsAuthoritative: true,
|
|
76
|
+
activeBytes: 16,
|
|
77
|
+
lastResponseTime: 1790765802064,
|
|
78
|
+
lastNudgeTokens: 0,
|
|
79
|
+
historianFailureCount: 0,
|
|
80
|
+
isSubagent: false,
|
|
81
|
+
pendingOps: [],
|
|
82
|
+
cacheTtlMs: 300000,
|
|
83
|
+
cacheRemainingMs: 279327,
|
|
84
|
+
cacheExpired: false,
|
|
85
|
+
cacheTtlSource: "session",
|
|
86
|
+
configParseFailures: [],
|
|
87
|
+
cacheNeverExpires: false,
|
|
88
|
+
executeThresholdMode: "percentage",
|
|
89
|
+
protectedTagCount: 0,
|
|
90
|
+
historyBudgetPercentage: 0.15,
|
|
91
|
+
historyBlockTokens: 1,
|
|
92
|
+
compressionBudget: 11508,
|
|
93
|
+
compressionUsage: "0%",
|
|
94
|
+
toastDurationMs: 5000,
|
|
95
|
+
loggerDiagnostics: { swallowedWriteCount: 0, lastErrorMessage: null, lastErrorTime: null },
|
|
96
|
+
storage_versions: { context_db_schema_version: 85, plugin_supported_version: 85 },
|
|
97
|
+
cacheTtlModelKey: "mock-anthropic/mock-sonnet",
|
|
98
|
+
embedding: { state: "waiting", indexed: 0, total: 0 },
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/** The same snapshot as a current server sends it: same fields plus its version. */
|
|
102
|
+
const CURRENT_DETAIL = { ...V0426_DETAIL, pluginVersion: UI };
|
|
103
|
+
|
|
104
|
+
function render(raw: unknown): StatusView {
|
|
105
|
+
return buildStatusViewFor(checkStatusDetailPayload(raw, UI), { version: UI, now: NOW });
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function warningText(view: StatusView): string {
|
|
109
|
+
return view.warnings.map((warning) => warning.text).join("\n");
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function reasonRow(view: StatusView): string | undefined {
|
|
113
|
+
return view.sections.flatMap((section) => section.rows).find((row) => row.label === "Reason")
|
|
114
|
+
?.value;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
describe("status payloads the dialog receives", () => {
|
|
118
|
+
test("a current, complete snapshot draws the full view with no notices", () => {
|
|
119
|
+
const view = render(CURRENT_DETAIL);
|
|
120
|
+
expect(view.headline.left.text).toBe("1.3% / 40%");
|
|
121
|
+
expect(view.headline.right.text).toBe("2K / 192K tokens");
|
|
122
|
+
expect(view.sections.map((section) => section.title)).toContain("Cache TTL");
|
|
123
|
+
expect(view.warnings).toEqual([]);
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
test("a transport failure names the RPC error", () => {
|
|
127
|
+
const view = buildStatusViewFor(statusRpcFailure("connect ECONNREFUSED 127.0.0.1:52206"), {
|
|
128
|
+
version: UI,
|
|
129
|
+
});
|
|
130
|
+
expect(view.headline.left).toEqual({ text: "Status unavailable", tone: "error" });
|
|
131
|
+
expect(reasonRow(view)).toBe("server did not answer");
|
|
132
|
+
expect(warningText(view)).toContain("connect ECONNREFUSED 127.0.0.1:52206");
|
|
133
|
+
expect(warningText(view)).toContain("(MC-S01)");
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
test("an error envelope names the server's error", () => {
|
|
137
|
+
// What a 0.42.6 server answered on a real host once a newer build had
|
|
138
|
+
// migrated the shared store to a schema version it does not support.
|
|
139
|
+
const view = render({ error: "unavailable" });
|
|
140
|
+
expect(reasonRow(view)).toBe("server did not answer");
|
|
141
|
+
expect(warningText(view)).toContain("did not return status: unavailable");
|
|
142
|
+
// A bare envelope says nothing about the server's age.
|
|
143
|
+
expect(warningText(view)).not.toContain("older Magic Context");
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
test("the home-directory reply draws the unavailable view instead of crashing", () => {
|
|
147
|
+
// Exactly what a 0.44.4 server sends for the user's home directory.
|
|
148
|
+
const view = render({ sessionId: "ses_home", disabled: true });
|
|
149
|
+
expect(view.headline.left.text).toBe("Status unavailable");
|
|
150
|
+
expect(reasonRow(view)).toBe("home directory");
|
|
151
|
+
expect(warningText(view)).toContain("allow_home_project");
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
test("the paused-identity reply draws the unavailable view instead of crashing", () => {
|
|
155
|
+
const view = render({
|
|
156
|
+
sessionId: "ses_paused",
|
|
157
|
+
disabled: true,
|
|
158
|
+
paused: true,
|
|
159
|
+
pluginVersion: UI,
|
|
160
|
+
});
|
|
161
|
+
expect(reasonRow(view)).toBe("memory paused");
|
|
162
|
+
expect(warningText(view)).toContain("memory features paused");
|
|
163
|
+
expect(warningText(view)).not.toContain("older Magic Context");
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
test("an empty reply names the missing fields", () => {
|
|
167
|
+
const view = render({});
|
|
168
|
+
expect(reasonRow(view)).toBe("incomplete status data");
|
|
169
|
+
expect(warningText(view)).toContain("usagePercentage");
|
|
170
|
+
expect(warningText(view)).toContain("cacheTtl");
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
test("a partial reply names exactly the fields that are missing or mistyped", () => {
|
|
174
|
+
const { usagePercentage: _dropped, ...partial } = CURRENT_DETAIL;
|
|
175
|
+
const view = render({ ...partial, cacheExpired: "no" });
|
|
176
|
+
const check = checkStatusDetailPayload({ ...partial, cacheExpired: "no" }, UI);
|
|
177
|
+
expect(check.state === "unavailable" && check.reason).toEqual({
|
|
178
|
+
kind: "malformed",
|
|
179
|
+
fields: ["usagePercentage", "cacheExpired"],
|
|
180
|
+
});
|
|
181
|
+
expect(warningText(view)).toContain("usagePercentage, cacheExpired");
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
test("a non-object reply is unavailable, not a crash", () => {
|
|
185
|
+
expect(reasonRow(render(null))).toBe("incomplete status data");
|
|
186
|
+
expect(reasonRow(render("ok"))).toBe("incomplete status data");
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
test("a 0.42.6 server's snapshot draws the full view and says an older server is running", () => {
|
|
190
|
+
const view = render(V0426_DETAIL);
|
|
191
|
+
expect(view.headline.left.text).toBe("1.3% / 40%");
|
|
192
|
+
expect(warningText(view)).toContain("An older Magic Context server");
|
|
193
|
+
expect(warningText(view)).toContain("quit all OpenCode processes");
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
test("a server reporting an older version is named with its version", () => {
|
|
197
|
+
const view = render({ ...CURRENT_DETAIL, pluginVersion: "0.42.6" });
|
|
198
|
+
expect(view.headline.left.text).toBe("1.3% / 40%");
|
|
199
|
+
expect(view.warnings[0]).toEqual({
|
|
200
|
+
text: `An older Magic Context (0.42.6) server is still running, while this UI is ${UI}: quit all OpenCode processes, then start OpenCode again`,
|
|
201
|
+
tone: "warning",
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
test("a malformed reply from an older server names the version difference first", () => {
|
|
206
|
+
const view = render({ sessionId: "s", pluginVersion: "0.42.6" });
|
|
207
|
+
expect(view.warnings[0]?.text).toContain("An older Magic Context (0.42.6) server");
|
|
208
|
+
expect(warningText(view)).toContain("The version difference above is the likely cause.");
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
test("optional fields with an unexpected shape are dropped and listed, not drawn", () => {
|
|
212
|
+
const view = render({
|
|
213
|
+
...CURRENT_DETAIL,
|
|
214
|
+
// Each of these used to throw inside the view model.
|
|
215
|
+
windowGeometry: { usableSoft: 1 },
|
|
216
|
+
dreamerUnsupportedTasks: { curate: true },
|
|
217
|
+
hiddenVariantWarnings: "one",
|
|
218
|
+
hostLimitations: ["a_code_from_a_newer_server"],
|
|
219
|
+
});
|
|
220
|
+
expect(view.headline.left.text).toBe("1.3% / 40%");
|
|
221
|
+
expect(view.windowLine).toBeNull();
|
|
222
|
+
expect(warningText(view)).toContain(
|
|
223
|
+
"Ignored status fields with an unexpected shape: windowGeometry, dreamerUnsupportedTasks, hiddenVariantWarnings, hostLimitations",
|
|
224
|
+
);
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
test("a migration run past an unchecked holder is reported", () => {
|
|
228
|
+
const view = render({
|
|
229
|
+
...CURRENT_DETAIL,
|
|
230
|
+
unconfirmedMigrationHolders: { pids: [10376], fromVersion: 85, toVersion: 91 },
|
|
231
|
+
});
|
|
232
|
+
expect(warningText(view)).toContain(
|
|
233
|
+
"upgraded its database from v85 to v91 while OpenCode PID 10376 could not be checked",
|
|
234
|
+
);
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
describe("version notice", () => {
|
|
239
|
+
test("equal versions and in-process status carry no notice", () => {
|
|
240
|
+
expect(statusVersionNotice({ server: UI, ui: UI })).toBeNull();
|
|
241
|
+
expect(statusVersionNotice(null)).toBeNull();
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
test("a newer server asks for a restart", () => {
|
|
245
|
+
expect(statusVersionNotice({ server: "0.45.0", ui: "0.44.10" })).toBe(
|
|
246
|
+
"Magic Context server is 0.45.0, this UI is 0.44.10: restart OpenCode",
|
|
247
|
+
);
|
|
248
|
+
// Numeric, not lexical: 0.44.10 is newer than 0.44.9.
|
|
249
|
+
expect(statusVersionNotice({ server: "0.44.9", ui: "0.44.10" })).toContain(
|
|
250
|
+
"An older Magic Context (0.44.9) server",
|
|
251
|
+
);
|
|
252
|
+
});
|
|
253
|
+
});
|