@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,132 @@
|
|
|
1
|
+
import type { SidebarSnapshot } from "../../shared/rpc-types";
|
|
2
|
+
|
|
3
|
+
export interface V2TuiLocation {
|
|
4
|
+
readonly directory: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface V2TuiRoute {
|
|
8
|
+
readonly type: string;
|
|
9
|
+
readonly sessionID?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* One resolved colour from the OpenCode 2 theme. `@opentui/core`'s RGBA keeps
|
|
14
|
+
* its channels as 0..1 floats; only those four fields are read here, so the
|
|
15
|
+
* shape is declared structurally instead of depending on the optional
|
|
16
|
+
* `@opencode/theme` peer package (it is not installed in this workspace).
|
|
17
|
+
*/
|
|
18
|
+
export interface V2ThemeColor {
|
|
19
|
+
readonly r: number;
|
|
20
|
+
readonly g: number;
|
|
21
|
+
readonly b: number;
|
|
22
|
+
readonly a: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The part of `@opencode/theme/tui`'s `ResolvedTheme` the sidebar reads. Every
|
|
27
|
+
* level is optional because the plugin must still paint on a host whose theme
|
|
28
|
+
* resolves a different token set than the pinned 2.0.5 one.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* The part of `@opencode/theme/tui`'s `ResolvedThemeTokens` the sidebar and the
|
|
32
|
+
* status dialog read, with the key names from the published 2.0.11 declaration
|
|
33
|
+
* (`dist/tui/types.d.ts`): `text.base` / `text.muted`, `text.feedback.<kind>.base`
|
|
34
|
+
* for `error` / `warning` / `success` / `info`, `hue.<name>[step]` with steps
|
|
35
|
+
* 100..900 and the `accent` alias, `background.base`, `border.base`. Every level
|
|
36
|
+
* is optional because the plugin must still paint on a host whose theme resolves
|
|
37
|
+
* a different token set.
|
|
38
|
+
*/
|
|
39
|
+
export interface V2ResolvedTheme {
|
|
40
|
+
readonly hue?: Readonly<Record<string, Readonly<Record<string, V2ThemeColor>>>>;
|
|
41
|
+
readonly text?: {
|
|
42
|
+
readonly base?: V2ThemeColor;
|
|
43
|
+
readonly muted?: V2ThemeColor;
|
|
44
|
+
readonly feedback?: Readonly<Record<string, { readonly base?: V2ThemeColor }>>;
|
|
45
|
+
};
|
|
46
|
+
readonly background?: { readonly base?: V2ThemeColor };
|
|
47
|
+
readonly border?: { readonly base?: V2ThemeColor };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface V2TuiContext {
|
|
51
|
+
readonly location?: V2TuiLocation;
|
|
52
|
+
readonly renderer: { requestRender(): void };
|
|
53
|
+
/** `Context.theme` on GA 2.0.5/2.0.11; absent on hosts that publish no theme. */
|
|
54
|
+
readonly theme?: V2ResolvedTheme;
|
|
55
|
+
/** `Context.themeMode` on GA 2.0.5/2.0.11; picks readable fallbacks when a token is missing. */
|
|
56
|
+
readonly themeMode?: "dark" | "light";
|
|
57
|
+
readonly data: {
|
|
58
|
+
readonly listen: (handler: (event: { details: unknown }) => void) => () => void;
|
|
59
|
+
readonly location: { default(): V2TuiLocation };
|
|
60
|
+
};
|
|
61
|
+
readonly keymap: {
|
|
62
|
+
readonly layer: (
|
|
63
|
+
input: () => {
|
|
64
|
+
readonly mode?: string;
|
|
65
|
+
readonly commands: ReadonlyArray<{
|
|
66
|
+
readonly id: string;
|
|
67
|
+
readonly title: string;
|
|
68
|
+
readonly group: string;
|
|
69
|
+
readonly palette: true;
|
|
70
|
+
readonly slash: { readonly name: string; readonly arguments?: true };
|
|
71
|
+
readonly run: (input?: string) => void | Promise<void>;
|
|
72
|
+
}>;
|
|
73
|
+
},
|
|
74
|
+
) => void;
|
|
75
|
+
};
|
|
76
|
+
readonly storage: {
|
|
77
|
+
readonly memory: <Value extends object>(
|
|
78
|
+
key: string,
|
|
79
|
+
options: { readonly initial: Value },
|
|
80
|
+
) => readonly [Value, (mutation: (draft: Value) => void) => void];
|
|
81
|
+
};
|
|
82
|
+
readonly ui: {
|
|
83
|
+
readonly router: { current(): V2TuiRoute };
|
|
84
|
+
readonly slot: (claim: V2SlotClaim) => () => void;
|
|
85
|
+
readonly toast: {
|
|
86
|
+
show(options: {
|
|
87
|
+
readonly title?: string;
|
|
88
|
+
readonly message: string;
|
|
89
|
+
readonly variant?: "info" | "success" | "warning" | "error";
|
|
90
|
+
readonly duration?: number;
|
|
91
|
+
}): void;
|
|
92
|
+
};
|
|
93
|
+
readonly dialog: {
|
|
94
|
+
/**
|
|
95
|
+
* Renders a plugin-owned component as the dialog surface. GA 2.0.5
|
|
96
|
+
* and 2.0.11 publish it next to alert/confirm/prompt; it is optional
|
|
97
|
+
* here so a host without it still gets the text dialog.
|
|
98
|
+
*/
|
|
99
|
+
show?(component: () => unknown, onClose?: () => void): void;
|
|
100
|
+
/** Sizes the dialog surface before `show`; "medium" is the host default. */
|
|
101
|
+
set?(options: { readonly size?: string; readonly centered?: boolean }): void;
|
|
102
|
+
alert(options: { readonly title: string; readonly message: string }): Promise<void>;
|
|
103
|
+
confirm(options: {
|
|
104
|
+
readonly title: string;
|
|
105
|
+
readonly message: string;
|
|
106
|
+
readonly label?: { readonly confirm?: string; readonly cancel?: string };
|
|
107
|
+
}): Promise<boolean | undefined>;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* A slot claim's `render` runs inside the host's component tree; `app` is the
|
|
114
|
+
* always-mounted root slot, which is where `keymap.layer()` can be called from
|
|
115
|
+
* when plugin `setup()` runs outside the keymap provider (see index.ts).
|
|
116
|
+
*/
|
|
117
|
+
export type V2SlotClaim =
|
|
118
|
+
| {
|
|
119
|
+
readonly append: "sidebar.content";
|
|
120
|
+
readonly render: (input: { readonly sessionID: string }) => unknown;
|
|
121
|
+
}
|
|
122
|
+
| {
|
|
123
|
+
readonly append: "app";
|
|
124
|
+
readonly render: (input: Readonly<Record<string, never>>) => unknown;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
/** The layer object `context.keymap.layer()` accepts, derived from the context type. */
|
|
128
|
+
export type V2KeymapLayer = ReturnType<Parameters<V2TuiContext["keymap"]["layer"]>[0]>;
|
|
129
|
+
|
|
130
|
+
export interface V2SidebarState {
|
|
131
|
+
snapshots: Record<string, SidebarSnapshot | undefined>;
|
|
132
|
+
}
|
package/tui.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./src/tui/entry.mjs";
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import { sessionLog } from "../../../shared/logger";
|
|
2
|
-
import type { Database } from "../../../shared/sqlite";
|
|
3
|
-
import type { Memory, MemoryCategory } from "./types";
|
|
4
|
-
type AnyFn = (...args: any[]) => Promise<unknown>;
|
|
5
|
-
interface MigrationClient {
|
|
6
|
-
session: {
|
|
7
|
-
create: AnyFn;
|
|
8
|
-
prompt: AnyFn;
|
|
9
|
-
messages: AnyFn;
|
|
10
|
-
delete: AnyFn;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Memory migration (v2 / E3.2): re-evaluate a project's existing memories into
|
|
15
|
-
* the 5-category v2 world taxonomy via a one-shot historian-model prompt.
|
|
16
|
-
*
|
|
17
|
-
* Why this exists: pre-v2 memories use the 9-category taxonomy (ARCHITECTURE_DECISIONS,
|
|
18
|
-
* USER_DIRECTIVES, WORKFLOW_RULES, KNOWN_ISSUES, ENVIRONMENT, USER_PREFERENCES, …)
|
|
19
|
-
* collected under LOOSER definitions. v2's 5 categories (PROJECT_RULES, ARCHITECTURE,
|
|
20
|
-
* CONSTRAINTS, CONFIG_VALUES, NAMING) have STRICTER definitions, so this is a quality
|
|
21
|
-
* re-evaluation (drop stale / demote-to-narrative / merge), not a relabel. USER_* traits
|
|
22
|
-
* leave project memory entirely (they belong in the global user-profile store).
|
|
23
|
-
*
|
|
24
|
-
* Runtime shape (locked):
|
|
25
|
-
* - Runs on-demand inside `/ctx-session-upgrade`, ONCE per project (idempotent guard).
|
|
26
|
-
* - Uses the HISTORIAN model/plumbing (not dreamer) so it works even when dreamer is
|
|
27
|
-
* disabled — the historian model is guaranteed present whenever an upgrade is relevant.
|
|
28
|
-
* - Project-scoped: operates on the project's memory pool, shared across sessions.
|
|
29
|
-
*
|
|
30
|
-
* This module owns the PURE pieces (prompt builder, parser, apply, guard). The LLM
|
|
31
|
-
* call + child-session orchestration lives in the caller (command-handler), mirroring
|
|
32
|
-
* how the dreamer/historian invoke `promptSyncWithModelSuggestionRetry`.
|
|
33
|
-
*/
|
|
34
|
-
/** Per-project guard key in `schema_migrations_meta` (precedent: v22 keys). */
|
|
35
|
-
export declare function memoryMigrationGuardKey(projectPath: string): string;
|
|
36
|
-
/** True if this project's memories were already migrated to the 5-cat taxonomy. */
|
|
37
|
-
export declare function isMemoryMigrationDone(db: Database, projectPath: string): boolean;
|
|
38
|
-
/** Mark this project's memory migration complete (idempotent). */
|
|
39
|
-
export declare function markMemoryMigrationDone(db: Database, projectPath: string): void;
|
|
40
|
-
/**
|
|
41
|
-
* Build the migration prompt. Pure + deterministic for a given memory list.
|
|
42
|
-
* The model receives every existing memory (with its legacy category) and the
|
|
43
|
-
* strict 5-category definitions, and must return a single `<migrated>` block.
|
|
44
|
-
*/
|
|
45
|
-
export declare function buildMemoryMigrationPrompt(memories: readonly Memory[]): string;
|
|
46
|
-
export interface MemoryMigrationResult {
|
|
47
|
-
/** Re-categorized project memories (5-cat). */
|
|
48
|
-
memories: Array<{
|
|
49
|
-
category: MemoryCategory;
|
|
50
|
-
content: string;
|
|
51
|
-
}>;
|
|
52
|
-
/** User traits to route to the global user-profile store. */
|
|
53
|
-
userObservations: string[];
|
|
54
|
-
/** True when a well-formed `<migrated>` block was present (even if empty).
|
|
55
|
-
* Distinguishes "model validly migrated to zero project memories" from
|
|
56
|
-
* "unparseable output" so the orchestrator never treats a real empty
|
|
57
|
-
* result as a failure (and never wipes the pool on a parse failure). */
|
|
58
|
-
parsed: boolean;
|
|
59
|
-
}
|
|
60
|
-
/** Parse the migration output. Pure. Unknown categories are ignored (defensive). */
|
|
61
|
-
export declare function parseMemoryMigrationOutput(text: string): MemoryMigrationResult;
|
|
62
|
-
/**
|
|
63
|
-
* Apply a parsed migration result to the project's memory pool, atomically:
|
|
64
|
-
* delete the project's current `active`/`permanent` memories and insert the
|
|
65
|
-
* re-categorized set. Returns counts for the result message.
|
|
66
|
-
*
|
|
67
|
-
* Caller is responsible for routing `userObservations` to the user-profile
|
|
68
|
-
* store (done in the orchestrator, gated by the user_memories feature).
|
|
69
|
-
*
|
|
70
|
-
* Row-state safety: only `active` memories are re-evaluated. `permanent`
|
|
71
|
-
* memories are USER-curated (the user explicitly promoted them), so the
|
|
72
|
-
* migration must NOT LLM-rewrite or delete them — that would silently demote
|
|
73
|
-
* curated knowledge to fresh `active`/`unverified` rows and lose seen/retrieval
|
|
74
|
-
* state. Permanent rows are left exactly as-is; the re-categorized set is
|
|
75
|
-
* inserted alongside them.
|
|
76
|
-
*
|
|
77
|
-
* Embeddings cascade-delete with their memory rows (FK ON DELETE CASCADE,
|
|
78
|
-
* migration v12); new rows get embeddings via the normal best-effort sweep.
|
|
79
|
-
*/
|
|
80
|
-
export declare function applyMemoryMigration(db: Database, projectPath: string, result: MemoryMigrationResult): {
|
|
81
|
-
removed: number;
|
|
82
|
-
inserted: number;
|
|
83
|
-
};
|
|
84
|
-
export declare const MIGRATION_SYSTEM_PROMPT: string;
|
|
85
|
-
export interface MemoryMigrationOutcome {
|
|
86
|
-
/** True when the migration actually ran (vs. skipped because already done / empty / disabled). */
|
|
87
|
-
ran: boolean;
|
|
88
|
-
/** Human-readable summary for the command result message. */
|
|
89
|
-
summary: string;
|
|
90
|
-
removed?: number;
|
|
91
|
-
inserted?: number;
|
|
92
|
-
userObservations?: number;
|
|
93
|
-
}
|
|
94
|
-
export interface RunMemoryMigrationDeps {
|
|
95
|
-
client: MigrationClient;
|
|
96
|
-
db: Database;
|
|
97
|
-
/** Session directory used to resolve project identity + route the child session. */
|
|
98
|
-
directory: string;
|
|
99
|
-
/** Parent session id (child session is created under it). */
|
|
100
|
-
parentSessionId: string;
|
|
101
|
-
/** Resolved historian fallback chain (forwarded to the prompt helper). */
|
|
102
|
-
fallbackModels?: readonly string[];
|
|
103
|
-
/** Primary model for the migration child session, as "provider/modelID".
|
|
104
|
-
* When set, this runs FIRST (ahead of the fallback chain) and the historian
|
|
105
|
-
* agent default is NOT used. The upgrade path passes the session's live main
|
|
106
|
-
* model here — it's the user's working interactive model (typically stronger
|
|
107
|
-
* and, unlike a possibly-misconfigured historian model, guaranteed present).
|
|
108
|
-
* When omitted, the chain starts at the historian agent default. */
|
|
109
|
-
primaryModelId?: string;
|
|
110
|
-
/** Prompt timeout. */
|
|
111
|
-
timeoutMs?: number;
|
|
112
|
-
/** When true, route user_observations into the user-memory candidate pool. */
|
|
113
|
-
userMemoriesEnabled?: boolean;
|
|
114
|
-
language?: string;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Run the one-shot memory migration for a project.
|
|
118
|
-
*
|
|
119
|
-
* Idempotent: returns `ran: false` immediately if the project's guard is already
|
|
120
|
-
* set, if there are no memories, or if a parse yields nothing. On success it
|
|
121
|
-
* replaces the project's memories with the 5-cat set, routes user observations
|
|
122
|
-
* to the user-memory candidate pool (when enabled), and flips the guard.
|
|
123
|
-
*
|
|
124
|
-
* Uses the HISTORIAN model (via HISTORIAN_AGENT) with a migration-specific system
|
|
125
|
-
* override — works even when the dreamer is disabled.
|
|
126
|
-
*/
|
|
127
|
-
export declare function runMemoryMigration(deps: RunMemoryMigrationDeps): Promise<MemoryMigrationOutcome>;
|
|
128
|
-
export { sessionLog };
|
|
129
|
-
//# sourceMappingURL=memory-migration.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory-migration.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/memory/memory-migration.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAKvD,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAMtD,KAAK,KAAK,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAClD,UAAU,eAAe;IACrB,OAAO,EAAE;QACL,MAAM,EAAE,KAAK,CAAC;QACd,MAAM,EAAE,KAAK,CAAC;QACd,QAAQ,EAAE,KAAK,CAAC;QAChB,MAAM,EAAE,KAAK,CAAC;KACjB,CAAC;CACL;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,+EAA+E;AAC/E,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED,mFAAmF;AACnF,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAShF;AAED,kEAAkE;AAClE,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAI/E;AAWD;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CA4C9E;AAED,MAAM,WAAW,qBAAqB;IAClC,+CAA+C;IAC/C,QAAQ,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,cAAc,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/D,6DAA6D;IAC7D,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B;;;6EAGyE;IACzE,MAAM,EAAE,OAAO,CAAC;CACnB;AAMD,oFAAoF;AACpF,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB,CAqB9E;AAWD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CAChC,EAAE,EAAE,QAAQ,EACZ,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,qBAAqB,GAC9B;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAwCvC;AAED,eAAO,MAAM,uBAAuB,QAE2D,CAAC;AAEhG,MAAM,WAAW,sBAAsB;IACnC,kGAAkG;IAClG,GAAG,EAAE,OAAO,CAAC;IACb,6DAA6D;IAC7D,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,sBAAsB;IACnC,MAAM,EAAE,eAAe,CAAC;IACxB,EAAE,EAAE,QAAQ,CAAC;IACb,oFAAoF;IACpF,SAAS,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,eAAe,EAAE,MAAM,CAAC;IACxB,0EAA0E;IAC1E,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC;;;;;yEAKqE;IACrE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sBAAsB;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,kBAAkB,CACpC,IAAI,EAAE,sBAAsB,GAC7B,OAAO,CAAC,sBAAsB,CAAC,CA2OjC;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import type { Database } from "../../shared/sqlite";
|
|
2
|
-
import type { NotificationDeliveryDisposition } from "./send-session-notification";
|
|
3
|
-
/**
|
|
4
|
-
* E5 — Session upgrade reminder (v2).
|
|
5
|
-
*
|
|
6
|
-
* When a session still holds pre-v2 (legacy) compartments, those render in a
|
|
7
|
-
* degraded title-only/P4 form until the user runs `/ctx-session-upgrade`. This
|
|
8
|
-
* surfaces a bounded, model-invisible reminder pointing at the command.
|
|
9
|
-
*
|
|
10
|
-
* Cache-safety (locked design): the reminder is delivered as an IGNORED message
|
|
11
|
-
* (user-visible, never sent to the model), NOT appended to a user message — so it
|
|
12
|
-
* has zero effect on the cacheable prompt prefix. No anchor/replay machinery needed.
|
|
13
|
-
*
|
|
14
|
-
* Push reminders are bounded per session. A durable timestamp enforces a 24-hour
|
|
15
|
-
* cooldown, and a durable count caps deliveries at three. Pull surfaces such as
|
|
16
|
-
* `/ctx-status` continue to show upgrade-needed compartments after the cap.
|
|
17
|
-
*
|
|
18
|
-
* The in-process set still prevents duplicate delivery before durable metadata is
|
|
19
|
-
* read back.
|
|
20
|
-
*/
|
|
21
|
-
export declare const UPGRADE_REMINDER_COOLDOWN_MS: number;
|
|
22
|
-
export declare const MAX_UPGRADE_REMINDERS_PER_SESSION = 3;
|
|
23
|
-
declare const UPGRADE_REMINDER_TEXT: string;
|
|
24
|
-
/** A compartment needs upgrading when it lacks usable v2 tiers — either a pre-v2
|
|
25
|
-
* `legacy=1` row, OR a malformed "pseudo-v2" row flagged `legacy=0` but with no
|
|
26
|
-
* `p1` tier (e.g. from an interrupted/crashed recomp, or an older partial-v2
|
|
27
|
-
* build). The `legacy=0 ⟹ has tiers` invariant can break from any partial state,
|
|
28
|
-
* which would otherwise TRAP the session — the old gate said "already upgraded"
|
|
29
|
-
* and refused to re-run (dogfood 2026-05-30, AFT session with 541 tierless rows).
|
|
30
|
-
* Single source of truth shared with the upgrade gate in recomp-orchestrator. */
|
|
31
|
-
export declare const NEEDS_UPGRADE_SQL = "((title <> '' OR content <> '' OR COALESCE(p1, '') <> '' OR COALESCE(p2, '') <> '' OR COALESCE(p3, '') <> '' OR COALESCE(p4, '') <> '') AND (legacy = 1 OR p1 IS NULL OR p1 = ''))";
|
|
32
|
-
/**
|
|
33
|
-
* Count compartments that still need a v2 upgrade (pre-v2 `legacy=1` rows OR
|
|
34
|
-
* tierless `p1 IS NULL/''` rows from an interrupted/old partial build). Shared
|
|
35
|
-
* with the Pi /ctx-status dialog (Pi has no sidebar, so it surfaces upgrade
|
|
36
|
-
* status here) and the OpenCode upgrade gate. Returns 0 on any error.
|
|
37
|
-
*/
|
|
38
|
-
export declare function countCompartmentsNeedingUpgrade(db: Database, sessionId: string): number;
|
|
39
|
-
/** Partial recomp staging from an INTERRUPTED upgrade — completed historian
|
|
40
|
-
* passes are committed to `recomp_compartments` per-pass and only promoted to
|
|
41
|
-
* the real tables at the very end, so a mid-upgrade close leaves staged progress
|
|
42
|
-
* there that the next run resumes from (it does NOT restart from scratch). */
|
|
43
|
-
export interface ResumeInfo {
|
|
44
|
-
/** Compartments already rebuilt and staged. */
|
|
45
|
-
stagedCount: number;
|
|
46
|
-
/** Raw message ordinal the staged work covers through. */
|
|
47
|
-
stagedThrough: number;
|
|
48
|
-
}
|
|
49
|
-
export interface UpgradeReminderDeps {
|
|
50
|
-
client: unknown;
|
|
51
|
-
db: Database;
|
|
52
|
-
/** Delivers passive status outside the chat transcript (RPC or a harness toast). */
|
|
53
|
-
sendStatusNotification: (client: unknown, sessionId: string, text: string, params: Record<string, unknown>) => Promise<NotificationDeliveryDisposition>;
|
|
54
|
-
/** Live notification params (model/variant/agent) for the active session. */
|
|
55
|
-
getNotificationParams: (sessionId: string) => Record<string, unknown>;
|
|
56
|
-
/** True when a TUI client is actively polling FOR THIS SESSION (decides
|
|
57
|
-
* dialog vs status toast). Must be session-scoped: a TUI on a different
|
|
58
|
-
* session in the same process must not make this session take the dialog
|
|
59
|
-
* path. Optional: harnesses without an OpenCode-style TUI dialog system
|
|
60
|
-
* (e.g. Pi, which delivers via `ctx.ui.notify`) omit this and always take
|
|
61
|
-
* the `sendStatusNotification` path. */
|
|
62
|
-
isTuiConnected?: (sessionId?: string) => boolean;
|
|
63
|
-
/** Enqueue a server→TUI action so the TUI shows an interactive upgrade dialog
|
|
64
|
-
* ("Run upgrade now"/"Later") instead of a transient toast. TUI path only;
|
|
65
|
-
* omitted on harnesses without a dialog system. When `resume` is set, the
|
|
66
|
-
* dialog shows resume-flavored copy. */
|
|
67
|
-
pushTuiDialogAction?: (sessionId: string, resume?: ResumeInfo) => void;
|
|
68
|
-
/** Whether to honor durable explicit dialog dismissals. Default true for OpenCode.
|
|
69
|
-
* Pi has no dismissal dialog and opts out; both harnesses retain the cooldown and cap. */
|
|
70
|
-
deliveryPersists?: boolean;
|
|
71
|
-
}
|
|
72
|
-
export declare function maybeSendUpgradeReminder(deps: UpgradeReminderDeps, sessionId: string): Promise<void>;
|
|
73
|
-
/** Test-only: reset the per-process guard. */
|
|
74
|
-
export declare function __resetUpgradeReminderProcessGuard(): void;
|
|
75
|
-
export { UPGRADE_REMINDER_TEXT };
|
|
76
|
-
//# sourceMappingURL=upgrade-reminder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade-reminder.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/upgrade-reminder.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAEnF;;;;;;;;;;;;;;;;;GAiBG;AAEH,eAAO,MAAM,4BAA4B,QAAsB,CAAC;AAChE,eAAO,MAAM,iCAAiC,IAAI,CAAC;AAMnD,QAAA,MAAM,qBAAqB,QAYf,CAAC;AAEb;;;;;;kFAMkF;AAClF,eAAO,MAAM,iBAAiB,uLAA+E,CAAC;AAE9G;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAWvF;AAMD;;;+EAG+E;AAC/E,MAAM,WAAW,UAAU;IACvB,+CAA+C;IAC/C,WAAW,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,aAAa,EAAE,MAAM,CAAC;CACzB;AA6BD,MAAM,WAAW,mBAAmB;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,EAAE,EAAE,QAAQ,CAAC;IACb,oFAAoF;IACpF,sBAAsB,EAAE,CACpB,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC9B,OAAO,CAAC,+BAA+B,CAAC,CAAC;IAC9C,6EAA6E;IAC7E,qBAAqB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtE;;;;;6CAKyC;IACzC,cAAc,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;IACjD;;;6CAGyC;IACzC,mBAAmB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACvE;+FAC2F;IAC3F,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,wBAAsB,wBAAwB,CAC1C,IAAI,EAAE,mBAAmB,EACzB,SAAS,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CA+Ff;AAED,8CAA8C;AAC9C,wBAAgB,kCAAkC,IAAI,IAAI,CAEzD;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
|