@cortexkit/opencode-magic-context 0.42.5 → 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 +6 -7
- 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 +10 -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 +13 -2
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/{conflict-warning-hook-jyj54gbe.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 +37 -3
- 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/open-opencode-db.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 +1 -0
- package/dist/features/magic-context/memory/embedding-local.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding.d.ts +1 -1
- package/dist/features/magic-context/memory/embedding.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 +16 -0
- 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 +1 -0
- 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/session-project-backfill.d.ts.map +1 -1
- 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/auto-update-checker/index.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 -4
- package/dist/hooks/magic-context/cache-busting-signals.d.ts.map +1 -1
- package/dist/hooks/magic-context/channel2-delivery.d.ts +8 -0
- package/dist/hooks/magic-context/channel2-delivery.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 +19 -0
- 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 +4 -1
- package/dist/hooks/magic-context/module-state-sync.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-transport.d.ts +24 -2
- package/dist/hooks/magic-context/module-transport.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-wire.d.ts +43 -1
- 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 +47 -1
- 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 +51 -10
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-db.d.ts +8 -0
- package/dist/hooks/magic-context/read-session-db.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-formatting.d.ts +6 -0
- package/dist/hooks/magic-context/read-session-formatting.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 +51 -0
- package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-refusal-recovery.d.ts +28 -0
- package/dist/hooks/magic-context/rust-refusal-recovery.d.ts.map +1 -0
- 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 +44 -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-3wbd8sdq.js → index-d0dh7v0f.js} +28107 -29850
- package/dist/{index-d8mgqezq.js → index-rpz2me0v.js} +133 -78
- package/dist/{index-p474rw9p.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-jkrqhc7y.js → index-ykg9sdzz.js} +147 -28
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7065 -3197
- 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/embedding-bootstrap.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 +109 -0
- package/dist/plugin/memory-id-translation.d.ts.map +1 -0
- 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/rust-tool-backends.d.ts +1 -1
- package/dist/plugin/rust-tool-backends.d.ts.map +1 -1
- 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-k20sfpm2.js → recomp-orchestrator-6akjp11f.js} +8 -8
- package/dist/{send-session-notification-xnypkxpx.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/auto-update-provenance.d.ts +9 -0
- package/dist/shared/auto-update-provenance.d.ts.map +1 -0
- package/dist/shared/conflict-detector.d.ts +14 -5
- 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 +46 -2
- package/dist/shared/opencode-db-path.d.ts.map +1 -1
- package/dist/shared/prompt-surface-runtime.d.ts +6 -6
- package/dist/shared/prompt-surface-runtime.d.ts.map +1 -1
- 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/mode.d.ts +31 -0
- package/dist/tools/ctx-expand/mode.d.ts.map +1 -0
- 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-note/types.d.ts +1 -1
- package/dist/tools/ctx-note/types.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 +3 -1
- 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 +114 -14
- 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 +58 -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 +32 -0
- package/dist/v2/hooks/hidden-child.d.ts.map +1 -0
- 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 +157 -19
- 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.d.ts +19 -0
- package/dist/v2/server.d.ts.map +1 -1
- package/dist/v2/server.js +141849 -110533
- package/dist/v2/store-reader.d.ts +78 -6
- 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 +33 -0
- package/dist/v2/tui/index.d.ts.map +1 -0
- 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 +148 -0
- package/dist/v2/tui/types.d.ts.map +1 -0
- package/dist/wrapup-orchestrator-5akc87gr.js +16 -0
- package/package.json +9 -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 +39 -4
- 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/protected-tokens.test.ts +40 -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 +109 -13
- 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/auto-update-provenance.ts +42 -0
- 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 +277 -7
- package/src/shared/conflict-detector.ts +221 -80
- 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.test.ts +25 -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 +174 -0
- package/src/shared/opencode-db-path.ts +193 -15
- package/src/shared/opencode-host-generation.test.ts +29 -0
- package/src/shared/prompt-surface-a1-golden.md +142 -215
- package/src/shared/prompt-surface-runtime.test.ts +20 -0
- package/src/shared/prompt-surface-runtime.ts +7 -5
- 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/entry.mjs +11 -1
- 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 +251 -0
- package/src/v2/tui/index.ts +526 -0
- 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 +132 -0
- 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-1ar7b3e9.js +0 -637
- package/dist/index-4wwr6cz0.js +0 -112
- package/dist/index-avwt563y.js +0 -62
- package/dist/storage-meta-session-x3j0q9qy.js +0 -20
|
@@ -0,0 +1,526 @@
|
|
|
1
|
+
import { jsx } from "@opentui/solid/jsx-runtime";
|
|
2
|
+
import { COMPACTION_ENABLED_PATH } from "../../config/agent-disable";
|
|
3
|
+
import { flushLogger, log } from "../../shared/logger";
|
|
4
|
+
import type { SidebarSnapshot, StatusDetail } from "../../shared/rpc-types";
|
|
5
|
+
import { compactionOffSidebarRows, nativeCompactionContextLabel } from "../../tui/compaction-off";
|
|
6
|
+
import {
|
|
7
|
+
type CommandRpcResult,
|
|
8
|
+
closeRpc,
|
|
9
|
+
getCompartmentCount,
|
|
10
|
+
initRpcClient,
|
|
11
|
+
loadSidebarSnapshot,
|
|
12
|
+
loadStatusDetail,
|
|
13
|
+
requestDream,
|
|
14
|
+
requestEmbed,
|
|
15
|
+
requestFlush,
|
|
16
|
+
requestRecomp,
|
|
17
|
+
requestWrapup,
|
|
18
|
+
} from "../../tui/data/context-db";
|
|
19
|
+
import {
|
|
20
|
+
type SocketNotification,
|
|
21
|
+
startNotificationSocket,
|
|
22
|
+
stopNotificationSocket,
|
|
23
|
+
} from "../../tui/data/notification-socket";
|
|
24
|
+
import { eventSessionID } from "./events";
|
|
25
|
+
import { mountV1Sidebar, type V1SidebarMount } from "./sidebar-mount";
|
|
26
|
+
import { mountV1StatusDialog, type V1StatusDialogMount } from "./status-dialog-mount";
|
|
27
|
+
import type { V2KeymapLayer, V2SidebarState, V2TuiContext } from "./types";
|
|
28
|
+
|
|
29
|
+
const SIDEBAR_REFRESH_MS = 1_000;
|
|
30
|
+
const inflight = new Set<string>();
|
|
31
|
+
const refreshedAt = new Map<string, number>();
|
|
32
|
+
|
|
33
|
+
function compactTokens(value: number): string {
|
|
34
|
+
if (value >= 1_000_000) return `${(value / 1_000_000).toFixed(1)}M`;
|
|
35
|
+
if (value >= 1_000) return `${Math.round(value / 1_000)}K`;
|
|
36
|
+
return String(value);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Plain-text projection of the sidebar snapshot, used only when the real v1
|
|
41
|
+
* component cannot be loaded because the host registers no OpenTUI runtime
|
|
42
|
+
* modules (`opentui:runtime-module:*`). That arm is reachable on a host that
|
|
43
|
+
* boots the TUI without OpenTUI's runtime-plugin support installed — for
|
|
44
|
+
* example a future or cut-down OpenCode 2 TUI, or any embedding of this setup
|
|
45
|
+
* outside the packaged host. GA 2.0.5 and 2.0.11 both register the modules, so
|
|
46
|
+
* on those hosts the v1 component is what paints.
|
|
47
|
+
*
|
|
48
|
+
* Exported for test access; mirrors the v1 sidebar's compaction-off rows.
|
|
49
|
+
*/
|
|
50
|
+
export function sidebarText(snapshot: SidebarSnapshot | undefined): string {
|
|
51
|
+
if (!snapshot) return "Magic Context · loading…";
|
|
52
|
+
if (snapshot.compaction_enabled === false) {
|
|
53
|
+
return [
|
|
54
|
+
"Magic Context",
|
|
55
|
+
nativeCompactionContextLabel(snapshot),
|
|
56
|
+
...compactionOffSidebarRows(snapshot).map((row) => `${row.label} ${row.value}`),
|
|
57
|
+
...(snapshot.readySmartNoteCount > 0
|
|
58
|
+
? [`Smart Notes ${snapshot.readySmartNoteCount} ready`]
|
|
59
|
+
: []),
|
|
60
|
+
...(snapshot.lastTransformError ? [`Warning: ${snapshot.lastTransformError}`] : []),
|
|
61
|
+
].join("\n");
|
|
62
|
+
}
|
|
63
|
+
const pressure =
|
|
64
|
+
snapshot.contextLimit > 0
|
|
65
|
+
? `${snapshot.usagePercentage.toFixed(1)}% · ${compactTokens(snapshot.inputTokens)}/${compactTokens(snapshot.contextLimit)}`
|
|
66
|
+
: `${compactTokens(snapshot.inputTokens)} tokens`;
|
|
67
|
+
const historian = snapshot.historianRunning ? "running" : "idle";
|
|
68
|
+
return [
|
|
69
|
+
"Magic Context",
|
|
70
|
+
`Context ${pressure}`,
|
|
71
|
+
`Historian ${historian} · C:${snapshot.compartmentCount}`,
|
|
72
|
+
`Memories ${snapshot.memoryBlockCount}/${snapshot.memoryCount} · Q:${snapshot.pendingOpsCount}`,
|
|
73
|
+
...(snapshot.lastTransformError ? [`Warning: ${snapshot.lastTransformError}`] : []),
|
|
74
|
+
].join("\n");
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Plain-text projection of the status snapshot, used only when the real v1
|
|
79
|
+
* dialog component cannot be mounted — a host that publishes no component
|
|
80
|
+
* dialog surface, or one that registers no OpenTUI runtime modules
|
|
81
|
+
* (`opentui:runtime-module:*`). GA 2.0.5 and 2.0.11 do both, so on those hosts
|
|
82
|
+
* the v1 dialog is what paints.
|
|
83
|
+
*
|
|
84
|
+
* Exported for test access.
|
|
85
|
+
*/
|
|
86
|
+
export function statusText(detail: StatusDetail): string {
|
|
87
|
+
const context =
|
|
88
|
+
detail.contextLimit > 0
|
|
89
|
+
? `${detail.usagePercentage.toFixed(1)}% (${compactTokens(detail.inputTokens)}/${compactTokens(detail.contextLimit)} tokens)`
|
|
90
|
+
: `${compactTokens(detail.inputTokens)} tokens`;
|
|
91
|
+
return [
|
|
92
|
+
...(detail.compaction_enabled === false
|
|
93
|
+
? [
|
|
94
|
+
`Compaction: disabled (${COMPACTION_ENABLED_PATH}: false) — native compaction owns the context window.`,
|
|
95
|
+
]
|
|
96
|
+
: []),
|
|
97
|
+
`Context: ${context}`,
|
|
98
|
+
`Historian: ${detail.historianRunning ? "running" : "idle"}`,
|
|
99
|
+
`Compartments: ${detail.compartmentCount}`,
|
|
100
|
+
`Memories: ${detail.memoryBlockCount} injected / ${detail.memoryCount} stored`,
|
|
101
|
+
`Pending reductions: ${detail.pendingOpsCount}`,
|
|
102
|
+
`Harness: opencode2`,
|
|
103
|
+
...(detail.configGeneration === undefined
|
|
104
|
+
? []
|
|
105
|
+
: [
|
|
106
|
+
`Config generation: ${detail.configGeneration} (adopted ${detail.configAdoptedAt ? new Date(detail.configAdoptedAt).toLocaleString() : "unknown"})`,
|
|
107
|
+
]),
|
|
108
|
+
...(detail.configReloadFailure
|
|
109
|
+
? [
|
|
110
|
+
`Config reload failed ${detail.configReloadFailure.path}: ${detail.configReloadFailure.message}`,
|
|
111
|
+
]
|
|
112
|
+
: []),
|
|
113
|
+
...(detail.lastTransformError ? [`Warning: ${detail.lastTransformError}`] : []),
|
|
114
|
+
].join("\n");
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function currentSessionID(context: V2TuiContext): string | null {
|
|
118
|
+
const route = context.ui.router.current();
|
|
119
|
+
return route.type === "session" && route.sessionID ? route.sessionID : null;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
type JsxFactory = (type: string, props: Record<string, unknown>) => unknown;
|
|
123
|
+
|
|
124
|
+
export async function setupWithJsx(context: V2TuiContext, jsx: JsxFactory): Promise<() => void> {
|
|
125
|
+
const directory = context.location?.directory ?? context.data.location.default().directory;
|
|
126
|
+
initRpcClient(directory);
|
|
127
|
+
const [sidebar, updateSidebar] = context.storage.memory<V2SidebarState>(
|
|
128
|
+
"magic-context.sidebar.v2",
|
|
129
|
+
{ initial: { snapshots: {} } },
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
const refresh = async (sessionID: string, force = false): Promise<void> => {
|
|
133
|
+
if (!sessionID || inflight.has(sessionID)) return;
|
|
134
|
+
const now = Date.now();
|
|
135
|
+
if (!force && now - (refreshedAt.get(sessionID) ?? 0) < SIDEBAR_REFRESH_MS) return;
|
|
136
|
+
refreshedAt.set(sessionID, now);
|
|
137
|
+
inflight.add(sessionID);
|
|
138
|
+
try {
|
|
139
|
+
const snapshot = await loadSidebarSnapshot(sessionID, directory);
|
|
140
|
+
updateSidebar((draft) => {
|
|
141
|
+
draft.snapshots[sessionID] = snapshot;
|
|
142
|
+
});
|
|
143
|
+
context.renderer.requestRender();
|
|
144
|
+
} finally {
|
|
145
|
+
inflight.delete(sessionID);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
const showStatus = async (target = currentSessionID(context)) => {
|
|
150
|
+
if (!target) {
|
|
151
|
+
context.ui.toast.show({ message: "No active session", variant: "warning" });
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
const result = await loadStatusDetail(target, directory);
|
|
155
|
+
if (currentSessionID(context) !== target) return false;
|
|
156
|
+
if (!result.ok) {
|
|
157
|
+
context.ui.toast.show({
|
|
158
|
+
message: "Magic Context status is unavailable",
|
|
159
|
+
variant: "warning",
|
|
160
|
+
});
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
const mounted = statusDialog;
|
|
164
|
+
if (mounted) {
|
|
165
|
+
try {
|
|
166
|
+
mounted.show(result.detail);
|
|
167
|
+
return true;
|
|
168
|
+
} catch (error) {
|
|
169
|
+
// A component that throws while opening would leave the host
|
|
170
|
+
// with a dead dialog surface. Degrade to the text dialog for the
|
|
171
|
+
// rest of this TUI session and say so once.
|
|
172
|
+
statusDialog = null;
|
|
173
|
+
console.warn("[magic-context] v2 status dialog failed; using text", error);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
await context.ui.dialog.alert({
|
|
177
|
+
title: "Magic Context status",
|
|
178
|
+
message: statusText(result.detail),
|
|
179
|
+
});
|
|
180
|
+
return true;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
const showRecomp = async (target = currentSessionID(context)) => {
|
|
184
|
+
if (!target) {
|
|
185
|
+
context.ui.toast.show({ message: "No active session", variant: "warning" });
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
const count = await getCompartmentCount(target, directory);
|
|
189
|
+
if (currentSessionID(context) !== target) return false;
|
|
190
|
+
if (!count.ok) {
|
|
191
|
+
context.ui.toast.show({ message: "Unable to load recomp details", variant: "error" });
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
const confirmed = await context.ui.dialog.confirm({
|
|
195
|
+
title: "Recomp confirmation",
|
|
196
|
+
message: [
|
|
197
|
+
count.count === 0
|
|
198
|
+
? "This session has no compartments yet; recomp will build them from raw history."
|
|
199
|
+
: `This session has ${count.count} compartments.`,
|
|
200
|
+
"Recomp rebuilds compressed history and can consume significant tokens.",
|
|
201
|
+
].join("\n\n"),
|
|
202
|
+
label: { confirm: "Run recomp", cancel: "Cancel" },
|
|
203
|
+
});
|
|
204
|
+
if (!confirmed) return true;
|
|
205
|
+
const requested = await requestRecomp(target);
|
|
206
|
+
context.ui.toast.show({
|
|
207
|
+
message: requested
|
|
208
|
+
? "Recomp requested; historian will start shortly"
|
|
209
|
+
: "Recomp request failed",
|
|
210
|
+
variant: requested ? "info" : "error",
|
|
211
|
+
});
|
|
212
|
+
if (requested) void refresh(target, true);
|
|
213
|
+
return requested;
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
const showDream = async (task?: string) => {
|
|
217
|
+
const target = currentSessionID(context);
|
|
218
|
+
if (!target) {
|
|
219
|
+
context.ui.toast.show({ message: "No active session", variant: "warning" });
|
|
220
|
+
return false;
|
|
221
|
+
}
|
|
222
|
+
const started = await requestDream(target, task);
|
|
223
|
+
context.ui.toast.show({
|
|
224
|
+
message: started
|
|
225
|
+
? "Dream run started; the summary appears when it finishes"
|
|
226
|
+
: "Dream request failed",
|
|
227
|
+
variant: started ? "info" : "error",
|
|
228
|
+
});
|
|
229
|
+
return started;
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
// One sidebar: the OpenCode 1 component, mounted on the v2 slot through the
|
|
233
|
+
// host's own OpenTUI runtime. `mountV1Sidebar` returns null only when the
|
|
234
|
+
// host registers no runtime modules to load it through, which is the single
|
|
235
|
+
// case the plain-text projection covers.
|
|
236
|
+
let mountedSidebar: V1SidebarMount | null = await mountV1Sidebar(context, directory);
|
|
237
|
+
// One status view: the OpenCode 1 dialog component, mounted on the v2 dialog
|
|
238
|
+
// surface through the host's own OpenTUI runtime. `mountV1StatusDialog`
|
|
239
|
+
// returns null only for a host that cannot render a component dialog, which
|
|
240
|
+
// is the single case the plain-text projection covers.
|
|
241
|
+
let statusDialog: V1StatusDialogMount | null = await mountV1StatusDialog(context);
|
|
242
|
+
const unregisterSlot = context.ui.slot({
|
|
243
|
+
append: "sidebar.content",
|
|
244
|
+
render: (input) => {
|
|
245
|
+
const mounted = mountedSidebar;
|
|
246
|
+
if (mounted) {
|
|
247
|
+
try {
|
|
248
|
+
return mounted.render(input);
|
|
249
|
+
} catch (error) {
|
|
250
|
+
// A component that throws mid-paint would take the host's
|
|
251
|
+
// sidebar down with it. Degrade to the text projection for
|
|
252
|
+
// the rest of this TUI session and say so once.
|
|
253
|
+
mountedSidebar = null;
|
|
254
|
+
mounted.dispose();
|
|
255
|
+
console.warn("[magic-context] v2 sidebar component failed; using text", error);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
void refresh(input.sessionID);
|
|
259
|
+
return jsx("text", { children: sidebarText(sidebar.snapshots[input.sessionID]) });
|
|
260
|
+
},
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
// Every /ctx-* command this host can reach goes through the keymap layer:
|
|
264
|
+
// OpenCode 2 has no `command.execute.before` hook, so the server-side command
|
|
265
|
+
// handler the OpenCode 1 plugin uses never runs here. Each `run` calls the
|
|
266
|
+
// RPC handler that does the same server-side work and reports back through a
|
|
267
|
+
// dialog or toast, because this host has no ignored-message chat carrier.
|
|
268
|
+
const runCommandRpc = async (
|
|
269
|
+
title: string,
|
|
270
|
+
call: (sessionID: string) => Promise<CommandRpcResult>,
|
|
271
|
+
pending?: string,
|
|
272
|
+
): Promise<boolean> => {
|
|
273
|
+
const target = currentSessionID(context);
|
|
274
|
+
if (!target) {
|
|
275
|
+
context.ui.toast.show({ message: "No active session", variant: "warning" });
|
|
276
|
+
return false;
|
|
277
|
+
}
|
|
278
|
+
const result = await call(target);
|
|
279
|
+
if (!result.ok) {
|
|
280
|
+
context.ui.toast.show({
|
|
281
|
+
message: result.error ?? `${title} request failed`,
|
|
282
|
+
variant: "error",
|
|
283
|
+
});
|
|
284
|
+
return false;
|
|
285
|
+
}
|
|
286
|
+
// A started background run has no text yet; its outcome arrives later as a
|
|
287
|
+
// show-result-dialog notification.
|
|
288
|
+
if (result.started) {
|
|
289
|
+
context.ui.toast.show({ message: pending ?? `${title} started`, variant: "info" });
|
|
290
|
+
return true;
|
|
291
|
+
}
|
|
292
|
+
if (currentSessionID(context) !== target) return false;
|
|
293
|
+
await context.ui.dialog.alert({ title, message: result.message ?? "" });
|
|
294
|
+
return true;
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
// OpenCode 2 runs plugin setup() outside the TUI component tree, where
|
|
298
|
+
// context.keymap.layer() throws "Keymap.Provider is missing" (the provider is
|
|
299
|
+
// a Solid context). Try the direct call first (hosts that do run setup
|
|
300
|
+
// in-tree), then fall back to the app slot: its render executes inside the
|
|
301
|
+
// component tree, the same place the host's own built-in plugins register
|
|
302
|
+
// their layers.
|
|
303
|
+
const buildKeymapLayer = (): V2KeymapLayer => ({
|
|
304
|
+
mode: "global",
|
|
305
|
+
commands: [
|
|
306
|
+
{
|
|
307
|
+
id: "magic-context.status",
|
|
308
|
+
title: "Magic Context: Status",
|
|
309
|
+
group: "Magic Context",
|
|
310
|
+
palette: true,
|
|
311
|
+
slash: { name: "ctx-status" },
|
|
312
|
+
run: async () => {
|
|
313
|
+
await showStatus();
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
id: "magic-context.recomp",
|
|
318
|
+
title: "Magic Context: Recomp",
|
|
319
|
+
group: "Magic Context",
|
|
320
|
+
palette: true,
|
|
321
|
+
slash: { name: "ctx-recomp" },
|
|
322
|
+
run: async () => {
|
|
323
|
+
await showRecomp();
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
id: "magic-context.dream",
|
|
328
|
+
title: "Magic Context: Dream",
|
|
329
|
+
group: "Magic Context",
|
|
330
|
+
palette: true,
|
|
331
|
+
slash: { name: "ctx-dream", arguments: true },
|
|
332
|
+
run: async (input) => {
|
|
333
|
+
await showDream(input?.trim() || undefined);
|
|
334
|
+
},
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
id: "magic-context.flush",
|
|
338
|
+
title: "Magic Context: Flush",
|
|
339
|
+
group: "Magic Context",
|
|
340
|
+
palette: true,
|
|
341
|
+
slash: { name: "ctx-flush" },
|
|
342
|
+
run: async () => {
|
|
343
|
+
const flushed = await runCommandRpc("Flush", requestFlush);
|
|
344
|
+
if (flushed) void refresh(currentSessionID(context) ?? "", true);
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
id: "magic-context.embed",
|
|
349
|
+
title: "Magic Context: Embed",
|
|
350
|
+
group: "Magic Context",
|
|
351
|
+
palette: true,
|
|
352
|
+
slash: { name: "ctx-embed", arguments: true },
|
|
353
|
+
run: async (input) => {
|
|
354
|
+
const argument = input?.trim().toLowerCase() ?? "";
|
|
355
|
+
if (argument !== "" && argument !== "start" && argument !== "pause") {
|
|
356
|
+
context.ui.toast.show({
|
|
357
|
+
message:
|
|
358
|
+
"Usage: /ctx-embed (status), /ctx-embed start, or /ctx-embed pause",
|
|
359
|
+
variant: "warning",
|
|
360
|
+
});
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
const action = argument === "" ? "status" : argument;
|
|
364
|
+
await runCommandRpc(
|
|
365
|
+
"Embed",
|
|
366
|
+
(sessionID) => requestEmbed(sessionID, action, directory),
|
|
367
|
+
"Embedding started; the summary appears when it finishes",
|
|
368
|
+
);
|
|
369
|
+
},
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
id: "magic-context.wrapup",
|
|
373
|
+
title: "Magic Context: Wrapup",
|
|
374
|
+
group: "Magic Context",
|
|
375
|
+
palette: true,
|
|
376
|
+
slash: { name: "ctx-wrapup", arguments: true },
|
|
377
|
+
run: async (input) => {
|
|
378
|
+
const argument = input?.trim() ?? "";
|
|
379
|
+
if (argument !== "" && !/^\d+$/.test(argument)) {
|
|
380
|
+
context.ui.toast.show({
|
|
381
|
+
message:
|
|
382
|
+
"Usage: /ctx-wrapup [messages_to_keep] where messages_to_keep is a positive integer",
|
|
383
|
+
variant: "warning",
|
|
384
|
+
});
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
const messagesToKeep = argument === "" ? 20 : Number.parseInt(argument, 10);
|
|
388
|
+
if (messagesToKeep <= 0) {
|
|
389
|
+
context.ui.toast.show({
|
|
390
|
+
message: "messages_to_keep must be a positive integer",
|
|
391
|
+
variant: "warning",
|
|
392
|
+
});
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
await runCommandRpc(
|
|
396
|
+
"Wrapup",
|
|
397
|
+
(sessionID) => requestWrapup(sessionID, messagesToKeep),
|
|
398
|
+
"Wrapup started; the summary appears when it finishes",
|
|
399
|
+
);
|
|
400
|
+
},
|
|
401
|
+
},
|
|
402
|
+
],
|
|
403
|
+
});
|
|
404
|
+
let keymapLayerRegistered = false;
|
|
405
|
+
let keymapGapLogged = false;
|
|
406
|
+
const registerKeymapLayer = (): boolean => {
|
|
407
|
+
if (keymapLayerRegistered) return true;
|
|
408
|
+
try {
|
|
409
|
+
context.keymap.layer(buildKeymapLayer);
|
|
410
|
+
keymapLayerRegistered = true;
|
|
411
|
+
// The accepted layer is the only place that knows which slash commands
|
|
412
|
+
// this host actually got, so report them from it. Anything missing here
|
|
413
|
+
// is missing from the host's command palette too. It goes to the
|
|
414
|
+
// diagnostic log as well as the console because a TUI host owns the
|
|
415
|
+
// screen and drops plugin console output.
|
|
416
|
+
const registered = `registered slash commands: ${buildKeymapLayer()
|
|
417
|
+
.commands.map((command) => command.slash.name)
|
|
418
|
+
.join(" ")}`;
|
|
419
|
+
log(`[magic-context] ${registered}`);
|
|
420
|
+
// Startup lines are worth an immediate write: a TUI that exits or is
|
|
421
|
+
// killed before the next buffer flush would otherwise leave no record
|
|
422
|
+
// of which commands this host received.
|
|
423
|
+
flushLogger();
|
|
424
|
+
console.info(`[magic-context] ${registered}`);
|
|
425
|
+
return true;
|
|
426
|
+
} catch (error) {
|
|
427
|
+
if (!(error instanceof Error) || error.message !== "Keymap.Provider is missing")
|
|
428
|
+
throw error;
|
|
429
|
+
return false;
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
let unregisterKeymapSlot: (() => void) | undefined;
|
|
433
|
+
if (!registerKeymapLayer()) {
|
|
434
|
+
unregisterKeymapSlot = context.ui.slot({
|
|
435
|
+
append: "app",
|
|
436
|
+
render: () => {
|
|
437
|
+
let registered = false;
|
|
438
|
+
try {
|
|
439
|
+
registered = registerKeymapLayer();
|
|
440
|
+
} catch (error) {
|
|
441
|
+
console.warn("[magic-context] keymap.layer registration failed", error);
|
|
442
|
+
}
|
|
443
|
+
if (!registered && !keymapGapLogged) {
|
|
444
|
+
keymapGapLogged = true;
|
|
445
|
+
console.warn(
|
|
446
|
+
"[magic-context] OpenCode 2 keymap.layer is unavailable; /ctx-status, /ctx-recomp, /ctx-dream, /ctx-flush, /ctx-embed and /ctx-wrapup were not registered",
|
|
447
|
+
);
|
|
448
|
+
}
|
|
449
|
+
return null;
|
|
450
|
+
},
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
// Only the text projection needs the sidebar snapshot store; the mounted
|
|
455
|
+
// component keeps its own snapshot and subscribes to the same event stream
|
|
456
|
+
// itself.
|
|
457
|
+
const stopListening = context.data.listen(({ details }) => {
|
|
458
|
+
if (mountedSidebar) return;
|
|
459
|
+
const sessionID = eventSessionID(details);
|
|
460
|
+
if (sessionID) void refresh(sessionID, true);
|
|
461
|
+
});
|
|
462
|
+
|
|
463
|
+
const handleNotification = async (notification: SocketNotification): Promise<boolean> => {
|
|
464
|
+
const target = notification.sessionId ?? currentSessionID(context);
|
|
465
|
+
if (notification.sessionId && notification.sessionId !== currentSessionID(context))
|
|
466
|
+
return false;
|
|
467
|
+
if (notification.type === "toast") {
|
|
468
|
+
const payload = notification.payload;
|
|
469
|
+
context.ui.toast.show({
|
|
470
|
+
title: typeof payload.title === "string" ? payload.title : undefined,
|
|
471
|
+
message: String(payload.message ?? ""),
|
|
472
|
+
variant:
|
|
473
|
+
payload.variant === "success" ||
|
|
474
|
+
payload.variant === "warning" ||
|
|
475
|
+
payload.variant === "error"
|
|
476
|
+
? payload.variant
|
|
477
|
+
: "info",
|
|
478
|
+
duration: typeof payload.duration === "number" ? payload.duration : undefined,
|
|
479
|
+
});
|
|
480
|
+
return true;
|
|
481
|
+
}
|
|
482
|
+
if (notification.type !== "action") return false;
|
|
483
|
+
if (notification.payload.action === "show-status-dialog") {
|
|
484
|
+
return showStatus(target);
|
|
485
|
+
}
|
|
486
|
+
if (notification.payload.action === "show-recomp-dialog") return showRecomp(target);
|
|
487
|
+
if (notification.payload.action === "refresh-sidebar" && target) {
|
|
488
|
+
if (mountedSidebar) mountedSidebar.refresh();
|
|
489
|
+
else await refresh(target, true);
|
|
490
|
+
return true;
|
|
491
|
+
}
|
|
492
|
+
if (notification.payload.action === "show-result-dialog") {
|
|
493
|
+
await context.ui.dialog.alert({
|
|
494
|
+
title: String(notification.payload.title ?? "Magic Context"),
|
|
495
|
+
message: String(notification.payload.message ?? ""),
|
|
496
|
+
});
|
|
497
|
+
return true;
|
|
498
|
+
}
|
|
499
|
+
return false;
|
|
500
|
+
};
|
|
501
|
+
|
|
502
|
+
startNotificationSocket({
|
|
503
|
+
getSessionId: () => currentSessionID(context),
|
|
504
|
+
onNotification: handleNotification,
|
|
505
|
+
});
|
|
506
|
+
console.info("[magic-context] @cortexkit/opencode-magic-context v2 TUI setup");
|
|
507
|
+
|
|
508
|
+
return () => {
|
|
509
|
+
unregisterSlot();
|
|
510
|
+
mountedSidebar?.dispose();
|
|
511
|
+
mountedSidebar = null;
|
|
512
|
+
statusDialog = null;
|
|
513
|
+
unregisterKeymapSlot?.();
|
|
514
|
+
stopListening();
|
|
515
|
+
stopNotificationSocket();
|
|
516
|
+
closeRpc();
|
|
517
|
+
inflight.clear();
|
|
518
|
+
refreshedAt.clear();
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
export async function setup(context: V2TuiContext): Promise<() => void> {
|
|
523
|
+
return setupWithJsx(context, jsx);
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
export default { id: "opencode-magic-context", setup };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** Typed view of load-compiled-sidebar.mjs; see that file for why it is untyped JS. */
|
|
2
|
+
|
|
3
|
+
/** The colour table the OpenCode 1 sidebar reads (OpenTUI RGBA or a hex string). */
|
|
4
|
+
export type V1ThemeColor = { r: number; g: number; b: number; a?: number } | string;
|
|
5
|
+
|
|
6
|
+
export type V1Theme = Record<
|
|
7
|
+
| "text"
|
|
8
|
+
| "textMuted"
|
|
9
|
+
| "accent"
|
|
10
|
+
| "background"
|
|
11
|
+
| "borderActive"
|
|
12
|
+
| "error"
|
|
13
|
+
| "warning"
|
|
14
|
+
| "success",
|
|
15
|
+
V1ThemeColor
|
|
16
|
+
>;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The v1 event object as the sidebar component reads it. It only ever pulls a
|
|
20
|
+
* session id out of these three fields.
|
|
21
|
+
*/
|
|
22
|
+
export interface V1Event {
|
|
23
|
+
readonly properties: {
|
|
24
|
+
readonly sessionID: string;
|
|
25
|
+
readonly info: { readonly id: string; readonly sessionID: string };
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** The slice of OpenCode 1's `TuiPluginApi` the sidebar component actually uses. */
|
|
30
|
+
export interface V1SidebarApi {
|
|
31
|
+
readonly state: { readonly path: { readonly directory: string } };
|
|
32
|
+
readonly renderer: { requestRender(): void };
|
|
33
|
+
readonly event: { on(type: string, handler: (event: V1Event) => void): () => void };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface V1SidebarSlot {
|
|
37
|
+
dispose(): void;
|
|
38
|
+
slots: {
|
|
39
|
+
sidebar_content(
|
|
40
|
+
context: { readonly theme: { readonly current: V1Theme } },
|
|
41
|
+
value: { readonly session_id: string },
|
|
42
|
+
): unknown;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface CompiledSidebarComponent {
|
|
47
|
+
createSidebarContentSlot(api: V1SidebarApi): V1SidebarSlot;
|
|
48
|
+
refreshSidebarSnapshot(): void;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface CompiledSidebarData {
|
|
52
|
+
initRpcClient(directory: string): void;
|
|
53
|
+
closeRpc(): void;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export declare function loadCompiledSidebar(): Promise<{
|
|
57
|
+
component: CompiledSidebarComponent;
|
|
58
|
+
data: CompiledSidebarData;
|
|
59
|
+
}>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Loads the precompiled OpenCode 1 sidebar for the OpenCode 2 slot mount.
|
|
2
|
+
//
|
|
3
|
+
// This lives in a .mjs file on purpose. `src/tui-compiled/slots/sidebar-content.tsx`
|
|
4
|
+
// is Solid-transform output that the package never typechecks or compiles — it
|
|
5
|
+
// is shipped verbatim and executed by the host — and a TypeScript file importing
|
|
6
|
+
// a .tsx path forces `--jsx` on the whole program, which would pull that
|
|
7
|
+
// generated file into the type graph. Keeping the import here is the same
|
|
8
|
+
// arrangement `src/tui/entry.mjs` already uses for the v1 entry; the typed view
|
|
9
|
+
// of this module is the sibling load-compiled-sidebar.d.mts.
|
|
10
|
+
//
|
|
11
|
+
// Explicit extensions match entry.mjs: the host resolves these paths directly,
|
|
12
|
+
// with no bundler step to fill an extension in.
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Imports the compiled sidebar component and the RPC data-layer copy that
|
|
16
|
+
* compiled tree carries. Rejects when the host registers no
|
|
17
|
+
* `opentui:runtime-module:*` virtual modules to resolve the component's runtime
|
|
18
|
+
* imports through; the caller answers that case with the text projection.
|
|
19
|
+
*/
|
|
20
|
+
export async function loadCompiledSidebar() {
|
|
21
|
+
const component = await import("../../tui-compiled/slots/sidebar-content.tsx");
|
|
22
|
+
const data = await import("../../tui-compiled/data/context-db.ts");
|
|
23
|
+
return { component, data };
|
|
24
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Typed view of load-compiled-status-dialog.mjs; see that file for why it is untyped JS. */
|
|
2
|
+
import type { StatusDetail } from "../../shared/rpc-types";
|
|
3
|
+
import type { V1Theme } from "./load-compiled-sidebar.d.mts";
|
|
4
|
+
|
|
5
|
+
/** The slice of OpenCode 1's `TuiPluginApi` the status dialog component reads. */
|
|
6
|
+
export interface V1StatusDialogApi {
|
|
7
|
+
readonly theme: { readonly current: V1Theme };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface CompiledStatusDialog {
|
|
11
|
+
StatusDialog(props: {
|
|
12
|
+
readonly api: V1StatusDialogApi;
|
|
13
|
+
readonly s: StatusDetail;
|
|
14
|
+
}): unknown;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export declare function loadCompiledStatusDialog(): Promise<CompiledStatusDialog>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Loads the precompiled OpenCode 1 status dialog for the OpenCode 2 dialog surface.
|
|
2
|
+
//
|
|
3
|
+
// Same arrangement, and same reasons, as load-compiled-sidebar.mjs next to it:
|
|
4
|
+
// `src/tui-compiled/dialogs/status-dialog.tsx` is Solid-transform output that this
|
|
5
|
+
// package never typechecks or compiles, and a TypeScript file importing a .tsx
|
|
6
|
+
// path would force `--jsx` on the whole program and pull that generated file into
|
|
7
|
+
// the type graph. The typed view of this module is load-compiled-status-dialog.d.mts.
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Imports the compiled status dialog component. Rejects when the host registers
|
|
11
|
+
* no `opentui:runtime-module:*` virtual modules to resolve the component's
|
|
12
|
+
* runtime imports through; the caller answers that case with the text dialog.
|
|
13
|
+
*/
|
|
14
|
+
export async function loadCompiledStatusDialog() {
|
|
15
|
+
return await import("../../tui-compiled/dialogs/status-dialog.tsx");
|
|
16
|
+
}
|