@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
|
@@ -1,15 +1,22 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The real GA CLI 2.0.3 placement probe confirms OPENCODE_DB is honoured.
|
|
3
|
-
* Isolation must still use private XDG roots, not rely solely on the filename.
|
|
4
|
-
*/
|
|
1
|
+
/** Compatibility export; shared/opencode-db-path.ts is the single filename authority. */
|
|
5
2
|
export declare function sourceDatabaseFilename(channel: string, env?: NodeJS.ProcessEnv): string;
|
|
6
|
-
/** GA data root
|
|
3
|
+
/** GA data root resolved by the shared host-generation-aware resolver. */
|
|
7
4
|
export declare function gaDatabasePath(dataHome: string, channel?: string, env?: NodeJS.ProcessEnv): string;
|
|
8
5
|
export type MessageType = "agent-switched" | "model-switched" | "location-switched" | "user" | "synthetic" | "system" | "skill" | "shell" | "assistant" | "compaction" | "idle";
|
|
6
|
+
export declare const RAW_MESSAGE_TYPES: readonly ["user", "synthetic", "assistant", "skill", "shell", "system"];
|
|
7
|
+
export declare const V2_MESSAGE_PAGE_SQL: string;
|
|
9
8
|
export interface MessageData {
|
|
10
9
|
[key: string]: unknown;
|
|
11
10
|
content?: Array<Record<string, unknown>>;
|
|
12
11
|
text?: string;
|
|
12
|
+
finish?: string;
|
|
13
|
+
outcome?: "succeeded" | "failed" | "interrupted";
|
|
14
|
+
error?: unknown;
|
|
15
|
+
model?: {
|
|
16
|
+
id: string;
|
|
17
|
+
providerID: string;
|
|
18
|
+
variant?: string;
|
|
19
|
+
};
|
|
13
20
|
tokens?: {
|
|
14
21
|
input: number;
|
|
15
22
|
output: number;
|
|
@@ -38,27 +45,92 @@ export interface StoreRow<T extends MessageType = MessageType> {
|
|
|
38
45
|
session_id: string;
|
|
39
46
|
type: T;
|
|
40
47
|
seq: number;
|
|
48
|
+
time_created?: number;
|
|
41
49
|
data: T extends "idle" ? IdleData : T extends "compaction" ? CompactionData : MessageData;
|
|
42
50
|
}
|
|
51
|
+
export declare const V2_STORE_READER_DEBUG_COUNTER_KEY = "magic-context.v2.store-reader-debug";
|
|
52
|
+
export interface V2StoreReaderDebugOperation {
|
|
53
|
+
calls: number;
|
|
54
|
+
decodedRows: number;
|
|
55
|
+
maxDecodedRows: number;
|
|
56
|
+
}
|
|
57
|
+
export interface V2StoreReaderDebugQuery {
|
|
58
|
+
operation: string;
|
|
59
|
+
statement: string;
|
|
60
|
+
rows: number;
|
|
61
|
+
elapsedMs: number;
|
|
62
|
+
}
|
|
63
|
+
export interface V2StoreReaderDebugCounters {
|
|
64
|
+
decodedRows: number;
|
|
65
|
+
operations: Record<string, V2StoreReaderDebugOperation>;
|
|
66
|
+
openReaders: number;
|
|
67
|
+
maxOpenReaders: number;
|
|
68
|
+
readersOpened: number;
|
|
69
|
+
readersClosed: number;
|
|
70
|
+
queries?: V2StoreReaderDebugQuery[];
|
|
71
|
+
captureQueries?: boolean;
|
|
72
|
+
}
|
|
73
|
+
export interface V2MessageOrdinalAnchor {
|
|
74
|
+
timeCreated: number;
|
|
75
|
+
id: string;
|
|
76
|
+
}
|
|
77
|
+
export interface V2MessageOrdinalEntry extends V2MessageOrdinalAnchor {
|
|
78
|
+
contributesOrdinal: boolean;
|
|
79
|
+
hasValidInfo: boolean;
|
|
80
|
+
}
|
|
81
|
+
export declare function getV2StoreReaderDebugCounters(): V2StoreReaderDebugCounters;
|
|
82
|
+
export declare function resetV2StoreReaderDebugCounters(options?: {
|
|
83
|
+
captureQueries?: boolean;
|
|
84
|
+
}): void;
|
|
43
85
|
/** Opens an existing store read-only; missing/corrupt stores propagate errors, never an empty history. */
|
|
44
86
|
export declare class V2StoreReader {
|
|
45
87
|
private readonly db;
|
|
88
|
+
private closed;
|
|
46
89
|
constructor(path: string);
|
|
47
90
|
close(): void;
|
|
48
91
|
/** Exclusive cursor, ascending seq. IDs are not chronological in the v2 store. */
|
|
49
92
|
page(sessionID: string, options?: {
|
|
50
93
|
after?: number;
|
|
94
|
+
through?: number;
|
|
51
95
|
limit?: number;
|
|
52
96
|
type?: MessageType;
|
|
53
97
|
}): {
|
|
54
98
|
rows: StoreRow[];
|
|
55
99
|
cursor: number | undefined;
|
|
56
100
|
};
|
|
101
|
+
/**
|
|
102
|
+
* Read one page from the contiguous raw-message ordinal space. OpenCode seq
|
|
103
|
+
* includes non-conversation rows, so the CTE maps the two ordinal boundaries
|
|
104
|
+
* to seq values without hydrating any row outside the requested page.
|
|
105
|
+
*/
|
|
106
|
+
messagePage(sessionID: string, afterOrdinal: number, limit: number, finalWatermark: number): StoreRow[];
|
|
107
|
+
messageCount(sessionID: string): number;
|
|
108
|
+
storedMessageCount(sessionID: string): number;
|
|
109
|
+
messageById(sessionID: string, id: string): StoreRow | null;
|
|
110
|
+
messageExistsById(sessionID: string, id: string): boolean;
|
|
111
|
+
messageOrdinalById(sessionID: string, id: string): number | null;
|
|
112
|
+
messageIdOrdinals(sessionID: string, fromOrdinal: number, toOrdinal: number): Map<string, number>;
|
|
113
|
+
messageOrdinalPage(sessionID: string, after: V2MessageOrdinalAnchor | null, limit: number): V2MessageOrdinalEntry[];
|
|
114
|
+
range(sessionID: string, after: number, through: number): StoreRow[];
|
|
115
|
+
/** Conversational rows at or before `throughSeq`, newest first. */
|
|
116
|
+
rawRowsThrough(sessionID: string, throughSeq: number, limit: number): StoreRow[];
|
|
117
|
+
sequenceForId(sessionID: string, id: string | null | undefined): number | undefined;
|
|
118
|
+
latestSequenceForIds(sessionID: string, ids: readonly string[]): number;
|
|
119
|
+
private compactionByStatus;
|
|
57
120
|
latestCompaction(sessionID: string): StoreRow<"compaction"> | undefined;
|
|
121
|
+
latestRunningCompaction(sessionID: string): StoreRow<"compaction"> | undefined;
|
|
58
122
|
idleRows(sessionID: string, after?: number): StoreRow<"idle">[];
|
|
123
|
+
earliestSequence(sessionID: string): number | undefined;
|
|
124
|
+
latestSequence(sessionID: string): number;
|
|
125
|
+
latestAssistant(sessionID: string): StoreRow<"assistant"> | undefined;
|
|
126
|
+
latestIdle(sessionID: string): StoreRow<"idle"> | undefined;
|
|
59
127
|
/** Include the completed checkpoint itself, matching the host history cut. */
|
|
60
128
|
window(sessionID: string): StoreRow[];
|
|
61
|
-
/**
|
|
129
|
+
/**
|
|
130
|
+
* Read every retained row only for conversions between store generations and
|
|
131
|
+
* explicit diagnostics, because those operations need every part payload.
|
|
132
|
+
* Context passes use messagePage, messageCount, and range instead.
|
|
133
|
+
*/
|
|
62
134
|
history(sessionID: string): StoreRow[];
|
|
63
135
|
private all;
|
|
64
136
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-reader.d.ts","sourceRoot":"","sources":["../../src/v2/store-reader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"store-reader.d.ts","sourceRoot":"","sources":["../../src/v2/store-reader.ts"],"names":[],"mappings":"AAOA,yFAAyF;AACzF,wBAAgB,sBAAsB,CAClC,OAAO,EAAE,MAAM,EACf,GAAG,GAAE,MAAM,CAAC,UAAwB,GACrC,MAAM,CAER;AAED,0EAA0E;AAC1E,wBAAgB,cAAc,CAC1B,QAAQ,EAAE,MAAM,EAChB,OAAO,SAAW,EAClB,GAAG,GAAE,MAAM,CAAC,UAAwB,GACrC,MAAM,CAER;AAGD,MAAM,MAAM,WAAW,GACjB,gBAAgB,GAChB,gBAAgB,GAChB,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
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenCode 2 events carry their session id in several different shapes
|
|
3
|
+
* depending on the event family (`sessionID`/`sessionId`/`id`, sometimes nested
|
|
4
|
+
* under `data` or `info`), so one extractor serves every v2 TUI listener.
|
|
5
|
+
*/
|
|
6
|
+
export declare function eventSessionID(event: unknown): string | undefined;
|
|
7
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/v2/tui/events.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAiBjE"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { SidebarSnapshot, StatusDetail } from "../../shared/rpc-types";
|
|
2
|
+
import type { V2TuiContext } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Plain-text projection of the sidebar snapshot, used only when the real v1
|
|
5
|
+
* component cannot be loaded because the host registers no OpenTUI runtime
|
|
6
|
+
* modules (`opentui:runtime-module:*`). That arm is reachable on a host that
|
|
7
|
+
* boots the TUI without OpenTUI's runtime-plugin support installed — for
|
|
8
|
+
* example a future or cut-down OpenCode 2 TUI, or any embedding of this setup
|
|
9
|
+
* outside the packaged host. GA 2.0.5 and 2.0.11 both register the modules, so
|
|
10
|
+
* on those hosts the v1 component is what paints.
|
|
11
|
+
*
|
|
12
|
+
* Exported for test access; mirrors the v1 sidebar's compaction-off rows.
|
|
13
|
+
*/
|
|
14
|
+
export declare function sidebarText(snapshot: SidebarSnapshot | undefined): string;
|
|
15
|
+
/**
|
|
16
|
+
* Plain-text projection of the status snapshot, used only when the real v1
|
|
17
|
+
* dialog component cannot be mounted — a host that publishes no component
|
|
18
|
+
* dialog surface, or one that registers no OpenTUI runtime modules
|
|
19
|
+
* (`opentui:runtime-module:*`). GA 2.0.5 and 2.0.11 do both, so on those hosts
|
|
20
|
+
* the v1 dialog is what paints.
|
|
21
|
+
*
|
|
22
|
+
* Exported for test access.
|
|
23
|
+
*/
|
|
24
|
+
export declare function statusText(detail: StatusDetail): string;
|
|
25
|
+
type JsxFactory = (type: string, props: Record<string, unknown>) => unknown;
|
|
26
|
+
export declare function setupWithJsx(context: V2TuiContext, jsx: JsxFactory): Promise<() => void>;
|
|
27
|
+
export declare function setup(context: V2TuiContext): Promise<() => void>;
|
|
28
|
+
declare const _default: {
|
|
29
|
+
id: string;
|
|
30
|
+
setup: typeof setup;
|
|
31
|
+
};
|
|
32
|
+
export default _default;
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/v2/tui/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAuB5E,OAAO,KAAK,EAAiC,YAAY,EAAE,MAAM,SAAS,CAAC;AAY3E;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,eAAe,GAAG,SAAS,GAAG,MAAM,CAyBzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CA6BvD;AAOD,KAAK,UAAU,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC;AAE5E,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC,CA4Y9F;AAED,wBAAsB,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC,CAEtE;;;;;AAED,wBAAuD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type V1Theme } from "./load-compiled-sidebar.mjs";
|
|
2
|
+
import type { V2ResolvedTheme, V2TuiContext } from "./types";
|
|
3
|
+
export interface V1SidebarMount {
|
|
4
|
+
/** Renders the v1 component for one paint of the v2 `sidebar.content` slot. */
|
|
5
|
+
render(input: {
|
|
6
|
+
readonly sessionID: string;
|
|
7
|
+
}): unknown;
|
|
8
|
+
/** Asks the mounted component to fetch a snapshot now, out of band. */
|
|
9
|
+
refresh(): void;
|
|
10
|
+
dispose(): void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Colour tokens moved between host generations: OpenCode 1 handed the sidebar a
|
|
14
|
+
* flat table (`theme.accent`, `theme.textMuted`, …) while OpenCode 2 resolves a
|
|
15
|
+
* token tree (`@opencode/theme/tui` `ResolvedThemeTokens`: `text.base`,
|
|
16
|
+
* `text.muted`, `text.feedback.error.base`, `hue.accent[500]`, …). This maps
|
|
17
|
+
* the eight tokens the sidebar reads. A token the host does not resolve falls
|
|
18
|
+
* back to a colour chosen for the host's theme mode: an earlier fallback of
|
|
19
|
+
* white text painted the section headers white-on-white on light themes when
|
|
20
|
+
* the mapping read key names the theme package never had.
|
|
21
|
+
*
|
|
22
|
+
* The accent is read at hue step 200, the step the host draws its own accent
|
|
23
|
+
* UI in. The ramp is ordered by distance from the page, not by lightness, so
|
|
24
|
+
* step 200 stays a readable accent in both modes (captured GA host: #9d7cd8 on
|
|
25
|
+
* #0a0a0a dark, #d68c27 on #ffffff light) where step 500 resolved to a dark
|
|
26
|
+
* purple on the dark page and a pale orange on the light one.
|
|
27
|
+
*/
|
|
28
|
+
export declare function flattenTheme(theme: V2ResolvedTheme | undefined, mode?: "dark" | "light"): V1Theme;
|
|
29
|
+
/**
|
|
30
|
+
* True when the import failed because the host does not register the OpenTUI
|
|
31
|
+
* runtime modules. That is the only failure this module is allowed to answer
|
|
32
|
+
* with the plain-text fallback; anything else is a real defect and rethrows.
|
|
33
|
+
*/
|
|
34
|
+
export declare function isMissingOpenTuiRuntime(error: unknown): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Loads and mounts the v1 sidebar, or returns `null` when the host provides no
|
|
37
|
+
* OpenTUI runtime registry to load it through.
|
|
38
|
+
*/
|
|
39
|
+
export declare function mountV1Sidebar(context: V2TuiContext, directory: string): Promise<V1SidebarMount | null>;
|
|
40
|
+
//# sourceMappingURL=sidebar-mount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-mount.d.ts","sourceRoot":"","sources":["../../../src/v2/tui/sidebar-mount.ts"],"names":[],"mappings":"AAoBA,OAAO,EAKH,KAAK,OAAO,EACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE7D,MAAM,WAAW,cAAc;IAC3B,+EAA+E;IAC/E,MAAM,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;IACvD,uEAAuE;IACvE,OAAO,IAAI,IAAI,CAAC;IAChB,OAAO,IAAI,IAAI,CAAC;CACnB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CACxB,KAAK,EAAE,eAAe,GAAG,SAAS,EAClC,IAAI,GAAE,MAAM,GAAG,OAAgB,GAChC,OAAO,CAaT;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAM/D;AA2BD;;;GAGG;AACH,wBAAsB,cAAc,CAChC,OAAO,EAAE,YAAY,EACrB,SAAS,EAAE,MAAM,GAClB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CA+ChC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mounts the OpenCode 1 `/ctx-status` dialog component on the OpenCode 2 dialog
|
|
3
|
+
* surface, so both host generations show the same status view instead of one
|
|
4
|
+
* host getting a plain-text summary of it.
|
|
5
|
+
*
|
|
6
|
+
* It is the same arrangement as `sidebar-mount.ts`, for the same reasons: the
|
|
7
|
+
* component is loaded from `src/tui-compiled/` (Solid transform already applied,
|
|
8
|
+
* runtime imports pointing at the host's `opentui:runtime-module:*` registry) so
|
|
9
|
+
* it binds the host's single Solid/OpenTUI runtime rather than a second copy out
|
|
10
|
+
* of this package.
|
|
11
|
+
*
|
|
12
|
+
* Unlike the sidebar, this component fetches nothing: the caller passes the
|
|
13
|
+
* status snapshot it already loaded over RPC, so no second data layer is
|
|
14
|
+
* initialised here.
|
|
15
|
+
*/
|
|
16
|
+
import type { StatusDetail } from "../../shared/rpc-types";
|
|
17
|
+
import type { V2TuiContext } from "./types";
|
|
18
|
+
export interface V1StatusDialogMount {
|
|
19
|
+
/** Replaces the host's dialog surface with the status view for one snapshot. */
|
|
20
|
+
show(detail: StatusDetail): void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Loads and mounts the v1 status dialog, or returns `null` when this host
|
|
24
|
+
* cannot render it: either it publishes no component dialog surface, or it
|
|
25
|
+
* registers no OpenTUI runtime modules to load the component through. Both
|
|
26
|
+
* cases are answered by the caller's plain-text dialog.
|
|
27
|
+
*/
|
|
28
|
+
export declare function mountV1StatusDialog(context: V2TuiContext): Promise<V1StatusDialogMount | null>;
|
|
29
|
+
//# sourceMappingURL=status-dialog-mount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-dialog-mount.d.ts","sourceRoot":"","sources":["../../../src/v2/tui/status-dialog-mount.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAM3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,WAAW,mBAAmB;IAChC,gFAAgF;IAChF,IAAI,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;CACpC;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACrC,OAAO,EAAE,YAAY,GACtB,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAuCrC"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import type { SidebarSnapshot } from "../../shared/rpc-types";
|
|
2
|
+
export interface V2TuiLocation {
|
|
3
|
+
readonly directory: string;
|
|
4
|
+
}
|
|
5
|
+
export interface V2TuiRoute {
|
|
6
|
+
readonly type: string;
|
|
7
|
+
readonly sessionID?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* One resolved colour from the OpenCode 2 theme. `@opentui/core`'s RGBA keeps
|
|
11
|
+
* its channels as 0..1 floats; only those four fields are read here, so the
|
|
12
|
+
* shape is declared structurally instead of depending on the optional
|
|
13
|
+
* `@opencode/theme` peer package (it is not installed in this workspace).
|
|
14
|
+
*/
|
|
15
|
+
export interface V2ThemeColor {
|
|
16
|
+
readonly r: number;
|
|
17
|
+
readonly g: number;
|
|
18
|
+
readonly b: number;
|
|
19
|
+
readonly a: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The part of `@opencode/theme/tui`'s `ResolvedTheme` the sidebar reads. Every
|
|
23
|
+
* level is optional because the plugin must still paint on a host whose theme
|
|
24
|
+
* resolves a different token set than the pinned 2.0.5 one.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* The part of `@opencode/theme/tui`'s `ResolvedThemeTokens` the sidebar and the
|
|
28
|
+
* status dialog read, with the key names from the published 2.0.11 declaration
|
|
29
|
+
* (`dist/tui/types.d.ts`): `text.base` / `text.muted`, `text.feedback.<kind>.base`
|
|
30
|
+
* for `error` / `warning` / `success` / `info`, `hue.<name>[step]` with steps
|
|
31
|
+
* 100..900 and the `accent` alias, `background.base`, `border.base`. Every level
|
|
32
|
+
* is optional because the plugin must still paint on a host whose theme resolves
|
|
33
|
+
* a different token set.
|
|
34
|
+
*/
|
|
35
|
+
export interface V2ResolvedTheme {
|
|
36
|
+
readonly hue?: Readonly<Record<string, Readonly<Record<string, V2ThemeColor>>>>;
|
|
37
|
+
readonly text?: {
|
|
38
|
+
readonly base?: V2ThemeColor;
|
|
39
|
+
readonly muted?: V2ThemeColor;
|
|
40
|
+
readonly feedback?: Readonly<Record<string, {
|
|
41
|
+
readonly base?: V2ThemeColor;
|
|
42
|
+
}>>;
|
|
43
|
+
};
|
|
44
|
+
readonly background?: {
|
|
45
|
+
readonly base?: V2ThemeColor;
|
|
46
|
+
};
|
|
47
|
+
readonly border?: {
|
|
48
|
+
readonly base?: V2ThemeColor;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export interface V2TuiContext {
|
|
52
|
+
readonly location?: V2TuiLocation;
|
|
53
|
+
readonly renderer: {
|
|
54
|
+
requestRender(): void;
|
|
55
|
+
};
|
|
56
|
+
/** `Context.theme` on GA 2.0.5/2.0.11; absent on hosts that publish no theme. */
|
|
57
|
+
readonly theme?: V2ResolvedTheme;
|
|
58
|
+
/** `Context.themeMode` on GA 2.0.5/2.0.11; picks readable fallbacks when a token is missing. */
|
|
59
|
+
readonly themeMode?: "dark" | "light";
|
|
60
|
+
readonly data: {
|
|
61
|
+
readonly listen: (handler: (event: {
|
|
62
|
+
details: unknown;
|
|
63
|
+
}) => void) => () => void;
|
|
64
|
+
readonly location: {
|
|
65
|
+
default(): V2TuiLocation;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
readonly keymap: {
|
|
69
|
+
readonly layer: (input: () => {
|
|
70
|
+
readonly mode?: string;
|
|
71
|
+
readonly commands: ReadonlyArray<{
|
|
72
|
+
readonly id: string;
|
|
73
|
+
readonly title: string;
|
|
74
|
+
readonly group: string;
|
|
75
|
+
readonly palette: true;
|
|
76
|
+
readonly slash: {
|
|
77
|
+
readonly name: string;
|
|
78
|
+
readonly arguments?: true;
|
|
79
|
+
};
|
|
80
|
+
readonly run: (input?: string) => void | Promise<void>;
|
|
81
|
+
}>;
|
|
82
|
+
}) => void;
|
|
83
|
+
};
|
|
84
|
+
readonly storage: {
|
|
85
|
+
readonly memory: <Value extends object>(key: string, options: {
|
|
86
|
+
readonly initial: Value;
|
|
87
|
+
}) => readonly [Value, (mutation: (draft: Value) => void) => void];
|
|
88
|
+
};
|
|
89
|
+
readonly ui: {
|
|
90
|
+
readonly router: {
|
|
91
|
+
current(): V2TuiRoute;
|
|
92
|
+
};
|
|
93
|
+
readonly slot: (claim: V2SlotClaim) => () => void;
|
|
94
|
+
readonly toast: {
|
|
95
|
+
show(options: {
|
|
96
|
+
readonly title?: string;
|
|
97
|
+
readonly message: string;
|
|
98
|
+
readonly variant?: "info" | "success" | "warning" | "error";
|
|
99
|
+
readonly duration?: number;
|
|
100
|
+
}): void;
|
|
101
|
+
};
|
|
102
|
+
readonly dialog: {
|
|
103
|
+
/**
|
|
104
|
+
* Renders a plugin-owned component as the dialog surface. GA 2.0.5
|
|
105
|
+
* and 2.0.11 publish it next to alert/confirm/prompt; it is optional
|
|
106
|
+
* here so a host without it still gets the text dialog.
|
|
107
|
+
*/
|
|
108
|
+
show?(component: () => unknown, onClose?: () => void): void;
|
|
109
|
+
/** Sizes the dialog surface before `show`; "medium" is the host default. */
|
|
110
|
+
set?(options: {
|
|
111
|
+
readonly size?: string;
|
|
112
|
+
readonly centered?: boolean;
|
|
113
|
+
}): void;
|
|
114
|
+
alert(options: {
|
|
115
|
+
readonly title: string;
|
|
116
|
+
readonly message: string;
|
|
117
|
+
}): Promise<void>;
|
|
118
|
+
confirm(options: {
|
|
119
|
+
readonly title: string;
|
|
120
|
+
readonly message: string;
|
|
121
|
+
readonly label?: {
|
|
122
|
+
readonly confirm?: string;
|
|
123
|
+
readonly cancel?: string;
|
|
124
|
+
};
|
|
125
|
+
}): Promise<boolean | undefined>;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* A slot claim's `render` runs inside the host's component tree; `app` is the
|
|
131
|
+
* always-mounted root slot, which is where `keymap.layer()` can be called from
|
|
132
|
+
* when plugin `setup()` runs outside the keymap provider (see index.ts).
|
|
133
|
+
*/
|
|
134
|
+
export type V2SlotClaim = {
|
|
135
|
+
readonly append: "sidebar.content";
|
|
136
|
+
readonly render: (input: {
|
|
137
|
+
readonly sessionID: string;
|
|
138
|
+
}) => unknown;
|
|
139
|
+
} | {
|
|
140
|
+
readonly append: "app";
|
|
141
|
+
readonly render: (input: Readonly<Record<string, never>>) => unknown;
|
|
142
|
+
};
|
|
143
|
+
/** The layer object `context.keymap.layer()` accepts, derived from the context type. */
|
|
144
|
+
export type V2KeymapLayer = ReturnType<Parameters<V2TuiContext["keymap"]["layer"]>[0]>;
|
|
145
|
+
export interface V2SidebarState {
|
|
146
|
+
snapshots: Record<string, SidebarSnapshot | undefined>;
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/v2/tui/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,WAAW,aAAa;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,UAAU;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IACzB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAA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,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,KAAK,OAAO,CAAC;CACxE,CAAC;AAER,wFAAwF;AACxF,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEvF,MAAM,WAAW,cAAc;IAC3B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,GAAG,SAAS,CAAC,CAAC;CAC1D"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runManagedWrapup2
|
|
3
|
+
} from "./index-w2ety11c.js";
|
|
4
|
+
import"./index-d0dh7v0f.js";
|
|
5
|
+
import"./index-sd3egckz.js";
|
|
6
|
+
import"./index-8w1skpnm.js";
|
|
7
|
+
import"./index-rvwvdq59.js";
|
|
8
|
+
import"./index-ygwdyntq.js";
|
|
9
|
+
import"./index-y5145x8k.js";
|
|
10
|
+
import"./index-ykg9sdzz.js";
|
|
11
|
+
import"./index-9skq8m9y.js";
|
|
12
|
+
import"./index-jdxxq8cz.js";
|
|
13
|
+
import"./index-qp20p2py.js";
|
|
14
|
+
export {
|
|
15
|
+
runManagedWrapup2 as runManagedWrapup
|
|
16
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/opencode-magic-context",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.43.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "OpenCode plugin for Magic Context — cross-session memory and context management",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -25,8 +25,10 @@
|
|
|
25
25
|
"files": [
|
|
26
26
|
"dist",
|
|
27
27
|
"index.js",
|
|
28
|
+
"tui.js",
|
|
28
29
|
"src/tui",
|
|
29
30
|
"src/tui-compiled",
|
|
31
|
+
"src/v2/tui",
|
|
30
32
|
"src/shared",
|
|
31
33
|
"src/config",
|
|
32
34
|
"src/agents",
|
|
@@ -41,7 +43,7 @@
|
|
|
41
43
|
"check:tui-compiled": "bun run build:tui && git diff --exit-code -- src/tui-compiled && test -z \"$(git status --porcelain -- src/tui-compiled)\"",
|
|
42
44
|
"check:transformers-node-wasm": "bun scripts/verify-transformers-node-wasm.ts",
|
|
43
45
|
"typecheck": "tsc -p ../retina-local-fs/tsconfig.build.json && tsc --noEmit && tsc -p tsconfig.scripts.json",
|
|
44
|
-
"test": "bun ../../scripts/check-bun.mjs && bun install --frozen-lockfile && bun test --parallel --timeout 30000",
|
|
46
|
+
"test": "bun ../../scripts/check-bun.mjs && bun install --frozen-lockfile && bun test --parallel=4 --timeout 30000",
|
|
45
47
|
"test:serial": "bun install --frozen-lockfile && bun test --timeout 30000",
|
|
46
48
|
"test:parallel:probe": "bun scripts/verify-parallel-db-isolation.ts",
|
|
47
49
|
"lint": "bun ../../scripts/check-bun.mjs && biome check .",
|
|
@@ -67,16 +69,16 @@
|
|
|
67
69
|
"zod": "^4.1.8"
|
|
68
70
|
},
|
|
69
71
|
"optionalDependencies": {
|
|
70
|
-
"onnxruntime-node": "1.
|
|
72
|
+
"onnxruntime-node": "1.30.0",
|
|
71
73
|
"sharp": "^0.35.0"
|
|
72
74
|
},
|
|
73
75
|
"devDependencies": {
|
|
74
|
-
"@opencode/plugin": "2.0.
|
|
75
|
-
"@opencode/cli": "2.0.
|
|
76
|
-
"@opencode/client": "2.0.
|
|
76
|
+
"@opencode/plugin": "2.0.15",
|
|
77
|
+
"@opencode/cli": "2.0.15",
|
|
78
|
+
"@opencode/client": "2.0.15",
|
|
77
79
|
"effect": "4.0.0-rc.112",
|
|
78
80
|
"@ai-sdk/anthropic": "3.0.82",
|
|
79
|
-
"@huggingface/transformers": "^4.
|
|
81
|
+
"@huggingface/transformers": "^4.3.0",
|
|
80
82
|
"@ai-sdk/openai-compatible": "2.0.41",
|
|
81
83
|
"@biomejs/biome": "^2.5.1",
|
|
82
84
|
"@types/better-sqlite3": "^7.6.13",
|
package/src/agents/dreamer.ts
CHANGED
|
@@ -33,22 +33,14 @@ export const DREAMER_MEMORY_MAPPER_ALLOWED_TOOLS = [
|
|
|
33
33
|
// needs no tools at all. Locked so a user override can't grant any.
|
|
34
34
|
export const DREAMER_CLASSIFIER_AGENT = "dreamer-classifier";
|
|
35
35
|
|
|
36
|
-
// Docs
|
|
37
|
-
// ARCHITECTURE.md / STRUCTURE.md. Needs file read + write/edit + bash (git log,
|
|
38
|
-
// find) + aft navigation, but deliberately NO ctx_memory/ctx_search/ctx_note —
|
|
39
|
-
// it touches docs, never the memory store. Locked so a user override can't add
|
|
40
|
-
// the memory surface back.
|
|
36
|
+
// Docs proposal investigator: read-only source tools; the host validates its final text.
|
|
41
37
|
export const DREAMER_DOCS_AGENT = "dreamer-docs";
|
|
42
38
|
|
|
43
|
-
/**
|
|
44
|
-
* tools (it edits docs, not the memory store). */
|
|
39
|
+
/** Read-only source investigation for docs proposals. */
|
|
45
40
|
export const DREAMER_DOCS_ALLOWED_TOOLS = [
|
|
46
41
|
"read",
|
|
47
42
|
"grep",
|
|
48
43
|
"glob",
|
|
49
|
-
"bash",
|
|
50
|
-
"write",
|
|
51
|
-
"edit",
|
|
52
44
|
"aft_outline",
|
|
53
45
|
"aft_zoom",
|
|
54
46
|
"aft_search",
|
|
@@ -60,9 +52,8 @@ export const DREAMER_DOCS_ALLOWED_TOOLS = [
|
|
|
60
52
|
export const DREAMER_REVIEWER_AGENT = "dreamer-reviewer";
|
|
61
53
|
|
|
62
54
|
/** Tool profile for the base `dreamer` agent, now CURATE-ONLY (memory-pool
|
|
63
|
-
* hygiene). Curate edits
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
|
|
68
|
-
export const DREAMER_CURATE_ALLOWED_TOOLS = ["ctx_memory"] as const;
|
|
55
|
+
* hygiene). Curate edits memories through ctx_memory and enumerates them through
|
|
56
|
+
* the dreamer-only ctx_memory_list; it never reads code because a separate verify
|
|
57
|
+
* task owns memory-vs-code correctness. Kept on the `dreamer` id so memory-tool
|
|
58
|
+
* agent gates recognize it. */
|
|
59
|
+
export const DREAMER_CURATE_ALLOWED_TOOLS = ["ctx_memory", "ctx_memory_list"] as const;
|
|
@@ -102,15 +102,15 @@ export function buildHiddenAgentRegistrations(args: {
|
|
|
102
102
|
hidden: true,
|
|
103
103
|
description: HIDDEN_AGENT_DESCRIPTION,
|
|
104
104
|
prompt: args.dreamerPrompt,
|
|
105
|
-
// CURATE-ONLY now. Curate edits
|
|
106
|
-
// never reads code
|
|
107
|
-
//
|
|
108
|
-
//
|
|
105
|
+
// CURATE-ONLY now. Curate edits through ctx_memory and enumerates through
|
|
106
|
+
// ctx_memory_list; it never reads code because a separate verify task
|
|
107
|
+
// owns memory-vs-code correctness. No former bash/write/edit/read/aft/
|
|
108
|
+
// ctx_search/ctx_note surface remains. maintain-docs
|
|
109
109
|
// and review-user-memories moved to their own scoped agents below.
|
|
110
110
|
// (Inline literal — kept byte-identical to DREAMER_CURATE_ALLOWED_TOOLS
|
|
111
111
|
// by agent-registration-drift.test.ts; see the module header for why
|
|
112
112
|
// these are not const imports.)
|
|
113
|
-
allowedTools: ["ctx_memory"],
|
|
113
|
+
allowedTools: ["ctx_memory", "ctx_memory_list"],
|
|
114
114
|
// Curate is a genuine multi-step whole-pool hygiene loop, so it keeps a
|
|
115
115
|
// high cap.
|
|
116
116
|
maxSteps: 150,
|
|
@@ -126,23 +126,11 @@ export function buildHiddenAgentRegistrations(args: {
|
|
|
126
126
|
hidden: true,
|
|
127
127
|
description: HIDDEN_AGENT_DESCRIPTION,
|
|
128
128
|
prompt: args.dreamerPrompt,
|
|
129
|
-
//
|
|
130
|
-
//
|
|
131
|
-
|
|
132
|
-
//
|
|
133
|
-
|
|
134
|
-
"read",
|
|
135
|
-
"grep",
|
|
136
|
-
"glob",
|
|
137
|
-
"bash",
|
|
138
|
-
"write",
|
|
139
|
-
"edit",
|
|
140
|
-
"aft_outline",
|
|
141
|
-
"aft_zoom",
|
|
142
|
-
"aft_search",
|
|
143
|
-
],
|
|
144
|
-
// Docs maintenance reads the tree and writes two files — a bounded loop,
|
|
145
|
-
// not the whole-pool 150.
|
|
129
|
+
// Documentation proposals may inspect source files but cannot mutate them.
|
|
130
|
+
// Keep this list synchronized with DREAMER_DOCS_ALLOWED_TOOLS and locked against overrides.
|
|
131
|
+
allowedTools: ["read", "grep", "glob", "aft_outline", "aft_zoom", "aft_search"],
|
|
132
|
+
// Documentation investigation reads the repository tree in a bounded loop,
|
|
133
|
+
// unlike whole-memory-pool tasks with a 150-step limit.
|
|
146
134
|
maxSteps: 60,
|
|
147
135
|
overrides: args.dreamerOverrides,
|
|
148
136
|
// Lock so a user override can't add the memory surface back.
|