@cortexkit/opencode-magic-context 0.25.0 → 0.27.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 +14 -12
- package/dist/agents/dreamer.d.ts +19 -0
- package/dist/agents/dreamer.d.ts.map +1 -1
- package/dist/agents/hidden-agent-registrations.d.ts +67 -0
- package/dist/agents/hidden-agent-registrations.d.ts.map +1 -0
- package/dist/agents/historian.d.ts +1 -0
- package/dist/agents/historian.d.ts.map +1 -1
- package/dist/agents/permissions.d.ts +19 -42
- package/dist/agents/permissions.d.ts.map +1 -1
- package/dist/agents/smart-note-compiler.d.ts +2 -0
- package/dist/agents/smart-note-compiler.d.ts.map +1 -0
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/migrate-config-location.d.ts +89 -0
- package/dist/config/migrate-config-location.d.ts.map +1 -0
- package/dist/config/migrate-dreamer-v2.d.ts +37 -0
- package/dist/config/migrate-dreamer-v2.d.ts.map +1 -0
- package/dist/config/migrate-experimental.d.ts.map +1 -1
- package/dist/config/project-security.d.ts +3 -0
- package/dist/config/project-security.d.ts.map +1 -1
- package/dist/config/prune-config-leaf.d.ts.map +1 -1
- package/dist/config/schema/magic-context.d.ts +606 -60
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/features/magic-context/compaction-marker.d.ts +9 -3
- package/dist/features/magic-context/compaction-marker.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts +18 -1
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-embedding.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/classify-prompt.d.ts +50 -0
- package/dist/features/magic-context/dreamer/classify-prompt.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/classify.d.ts +22 -0
- package/dist/features/magic-context/dreamer/classify.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/cron.d.ts +72 -0
- package/dist/features/magic-context/dreamer/cron.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/evaluate-smart-notes.d.ts +30 -0
- package/dist/features/magic-context/dreamer/evaluate-smart-notes.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/index.d.ts +1 -3
- package/dist/features/magic-context/dreamer/index.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/lease.d.ts +44 -6
- package/dist/features/magic-context/dreamer/lease.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/maintain-docs-protected-enforcement.d.ts +13 -0
- package/dist/features/magic-context/dreamer/maintain-docs-protected-enforcement.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/map-memories-prompt.d.ts +36 -0
- package/dist/features/magic-context/dreamer/map-memories-prompt.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/map-memories.d.ts +22 -0
- package/dist/features/magic-context/dreamer/map-memories.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/open-opencode-db.d.ts +7 -0
- package/dist/features/magic-context/dreamer/open-opencode-db.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/primer-seed.d.ts +25 -0
- package/dist/features/magic-context/dreamer/primer-seed.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/promote-primers.d.ts +21 -0
- package/dist/features/magic-context/dreamer/promote-primers.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/protected-regions.d.ts +19 -0
- package/dist/features/magic-context/dreamer/protected-regions.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/refresh-primers.d.ts +30 -0
- package/dist/features/magic-context/dreamer/refresh-primers.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/retrospective-learnings.d.ts +47 -0
- package/dist/features/magic-context/dreamer/retrospective-learnings.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/retrospective-orphan-sweep.d.ts +48 -0
- package/dist/features/magic-context/dreamer/retrospective-orphan-sweep.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/retrospective-raw-provider.d.ts +81 -0
- package/dist/features/magic-context/dreamer/retrospective-raw-provider.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/storage-dream-runs.d.ts +8 -0
- package/dist/features/magic-context/dreamer/storage-dream-runs.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/storage-task-schedule.d.ts +82 -0
- package/dist/features/magic-context/dreamer/storage-task-schedule.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/task-config.d.ts +28 -0
- package/dist/features/magic-context/dreamer/task-config.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/task-executor.d.ts +49 -0
- package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/task-gates.d.ts +29 -0
- package/dist/features/magic-context/dreamer/task-gates.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/task-prompts.d.ts +37 -6
- package/dist/features/magic-context/dreamer/task-prompts.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-registry.d.ts +48 -0
- package/dist/features/magic-context/dreamer/task-registry.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts +88 -0
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/verify-gate.d.ts +43 -0
- package/dist/features/magic-context/dreamer/verify-gate.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/verify-prompt.d.ts +41 -0
- package/dist/features/magic-context/dreamer/verify-prompt.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/verify.d.ts +43 -0
- package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -0
- 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/git-commits/storage-git-commit-embeddings.d.ts +4 -4
- package/dist/features/magic-context/git-commits/storage-git-commit-embeddings.d.ts.map +1 -1
- package/dist/features/magic-context/index.d.ts +1 -0
- package/dist/features/magic-context/index.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-cache.d.ts +2 -2
- package/dist/features/magic-context/memory/embedding-cache.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-identity.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-local.d.ts +3 -3
- package/dist/features/magic-context/memory/embedding-local.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-openai.d.ts +20 -9
- package/dist/features/magic-context/memory/embedding-openai.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-provider.d.ts +8 -4
- package/dist/features/magic-context/memory/embedding-provider.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding.d.ts +2 -2
- package/dist/features/magic-context/memory/embedding.d.ts.map +1 -1
- package/dist/features/magic-context/memory/index.d.ts +4 -1
- package/dist/features/magic-context/memory/index.d.ts.map +1 -1
- package/dist/features/magic-context/memory/memory-migration.d.ts +1 -0
- package/dist/features/magic-context/memory/memory-migration.d.ts.map +1 -1
- package/dist/features/magic-context/memory/promotion.d.ts +16 -4
- package/dist/features/magic-context/memory/promotion.d.ts.map +1 -1
- package/dist/features/magic-context/memory/relocate-memory.d.ts +58 -0
- package/dist/features/magic-context/memory/relocate-memory.d.ts.map +1 -0
- package/dist/features/magic-context/memory/storage-memory-embeddings.d.ts +2 -2
- package/dist/features/magic-context/memory/storage-memory-embeddings.d.ts.map +1 -1
- package/dist/features/magic-context/memory/storage-memory-verifications.d.ts +31 -0
- package/dist/features/magic-context/memory/storage-memory-verifications.d.ts.map +1 -0
- package/dist/features/magic-context/memory/storage-memory.d.ts +12 -1
- package/dist/features/magic-context/memory/storage-memory.d.ts.map +1 -1
- package/dist/features/magic-context/memory/types.d.ts +4 -0
- package/dist/features/magic-context/memory/types.d.ts.map +1 -1
- package/dist/features/magic-context/memory/verification-paths.d.ts +32 -0
- package/dist/features/magic-context/memory/verification-paths.d.ts.map +1 -0
- package/dist/features/magic-context/message-index.d.ts.map +1 -1
- package/dist/features/magic-context/migrations.d.ts.map +1 -1
- package/dist/features/magic-context/overflow-detection.d.ts.map +1 -1
- package/dist/features/magic-context/primer-clustering.d.ts +29 -0
- package/dist/features/magic-context/primer-clustering.d.ts.map +1 -0
- package/dist/features/magic-context/project-embedding-registry.d.ts +28 -4
- package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
- package/dist/features/magic-context/search.d.ts +12 -2
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/features/magic-context/sidekick/agent.d.ts.map +1 -1
- package/dist/features/magic-context/smart-notes/capabilities.d.ts +31 -0
- package/dist/features/magic-context/smart-notes/capabilities.d.ts.map +1 -0
- package/dist/features/magic-context/smart-notes/compiler-prompt.d.ts +2 -0
- package/dist/features/magic-context/smart-notes/compiler-prompt.d.ts.map +1 -0
- package/dist/features/magic-context/smart-notes/compiler.d.ts +52 -0
- package/dist/features/magic-context/smart-notes/compiler.d.ts.map +1 -0
- package/dist/features/magic-context/smart-notes/index.d.ts +10 -0
- package/dist/features/magic-context/smart-notes/index.d.ts.map +1 -0
- package/dist/features/magic-context/smart-notes/runner.d.ts +18 -0
- package/dist/features/magic-context/smart-notes/runner.d.ts.map +1 -0
- package/dist/features/magic-context/smart-notes/sandbox-runner.d.ts +22 -0
- package/dist/features/magic-context/smart-notes/sandbox-runner.d.ts.map +1 -0
- package/dist/features/magic-context/smart-notes/schedule.d.ts +9 -0
- package/dist/features/magic-context/smart-notes/schedule.d.ts.map +1 -0
- package/dist/features/magic-context/smart-notes/ssrf-guard.d.ts +49 -0
- package/dist/features/magic-context/smart-notes/ssrf-guard.d.ts.map +1 -0
- package/dist/features/magic-context/smart-notes/storage.d.ts +27 -0
- package/dist/features/magic-context/smart-notes/storage.d.ts.map +1 -0
- package/dist/features/magic-context/smart-notes/types.d.ts +63 -0
- package/dist/features/magic-context/smart-notes/types.d.ts.map +1 -0
- package/dist/features/magic-context/storage-db.d.ts +6 -1
- package/dist/features/magic-context/storage-db.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +45 -4
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-session.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-shared.d.ts +5 -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 +15 -0
- package/dist/features/magic-context/storage-notes.d.ts.map +1 -1
- package/dist/features/magic-context/storage-primers.d.ts +85 -0
- package/dist/features/magic-context/storage-primers.d.ts.map +1 -0
- package/dist/features/magic-context/storage-tags.d.ts +68 -2
- package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
- package/dist/features/magic-context/storage.d.ts +4 -3
- package/dist/features/magic-context/storage.d.ts.map +1 -1
- package/dist/features/magic-context/tagger.d.ts +7 -1
- package/dist/features/magic-context/tagger.d.ts.map +1 -1
- package/dist/features/magic-context/tool-owner-backfill.d.ts.map +1 -1
- package/dist/features/magic-context/transform-decision-log.d.ts +59 -0
- package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -0
- package/dist/features/magic-context/types.d.ts +2 -0
- package/dist/features/magic-context/types.d.ts.map +1 -1
- package/dist/features/magic-context/user-memory/review-user-memories.d.ts +5 -0
- package/dist/features/magic-context/user-memory/review-user-memories.d.ts.map +1 -1
- package/dist/features/magic-context/user-memory/storage-user-memory.d.ts +18 -0
- package/dist/features/magic-context/user-memory/storage-user-memory.d.ts.map +1 -1
- package/dist/features/magic-context/v22-deferred-backfill.d.ts.map +1 -1
- package/dist/hooks/auto-update-checker/semver.d.ts +9 -0
- package/dist/hooks/auto-update-checker/semver.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-hint.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/command-handler.d.ts +8 -15
- 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/compartment-parser.d.ts +9 -0
- package/dist/hooks/magic-context/compartment-parser.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-prompt.d.ts +4 -1
- package/dist/hooks/magic-context/compartment-prompt.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.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-partial-recomp.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-recomp.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-types.d.ts +8 -0
- package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-trigger.d.ts +1 -1
- package/dist/hooks/magic-context/compartment-trigger.d.ts.map +1 -1
- package/dist/hooks/magic-context/ctx-reduce-nudge.d.ts.map +1 -1
- package/dist/hooks/magic-context/derive-budgets.d.ts +5 -9
- package/dist/hooks/magic-context/derive-budgets.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 +1 -0
- package/dist/hooks/magic-context/event-payloads.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-resolvers.d.ts.map +1 -1
- package/dist/hooks/magic-context/heuristic-cleanup.d.ts +1 -0
- package/dist/hooks/magic-context/heuristic-cleanup.d.ts.map +1 -1
- package/dist/hooks/magic-context/historian-prompt.generated.d.ts +1 -1
- package/dist/hooks/magic-context/historian-prompt.generated.d.ts.map +1 -1
- package/dist/hooks/magic-context/historian-state-file.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook-handlers.d.ts +2 -1
- package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts +1 -0
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts +0 -3
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts +10 -0
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
- package/dist/hooks/magic-context/send-session-notification.d.ts +2 -0
- package/dist/hooks/magic-context/send-session-notification.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-prompt-hash.d.ts +17 -0
- package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-id-fallback.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-messages.d.ts +10 -0
- package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts +32 -1
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +14 -5
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +0 -2
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17664 -4236
- package/dist/plugin/dream-timer.d.ts +17 -9
- package/dist/plugin/dream-timer.d.ts.map +1 -1
- package/dist/plugin/embedding-bootstrap-helpers.d.ts +1 -1
- package/dist/plugin/embedding-bootstrap-helpers.d.ts.map +1 -1
- package/dist/plugin/embedding-bootstrap.d.ts.map +1 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts +211 -0
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/plugin/instance-disposal.d.ts +2 -0
- package/dist/plugin/instance-disposal.d.ts.map +1 -0
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/shared/announcement.d.ts +1 -1
- package/dist/shared/announcement.d.ts.map +1 -1
- package/dist/shared/data-path.d.ts +26 -7
- package/dist/shared/data-path.d.ts.map +1 -1
- package/dist/shared/index.d.ts +0 -1
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/model-suggestion-retry.d.ts +48 -2
- package/dist/shared/model-suggestion-retry.d.ts.map +1 -1
- package/dist/shared/redaction.d.ts +7 -0
- package/dist/shared/redaction.d.ts.map +1 -0
- package/dist/shared/resolve-fallbacks.d.ts +28 -16
- package/dist/shared/resolve-fallbacks.d.ts.map +1 -1
- package/dist/shared/rpc-server.d.ts.map +1 -1
- package/dist/shared/rpc-types.d.ts +2 -0
- package/dist/shared/rpc-types.d.ts.map +1 -1
- package/dist/shared/subagent-runner.d.ts +12 -3
- package/dist/shared/subagent-runner.d.ts.map +1 -1
- package/dist/shared/tui-config.d.ts.map +1 -1
- package/dist/tools/ctx-memory/tools.d.ts.map +1 -1
- package/dist/tools/ctx-memory/types.d.ts.map +1 -1
- package/dist/tools/ctx-memory/verification-recording.d.ts +8 -0
- package/dist/tools/ctx-memory/verification-recording.d.ts.map +1 -0
- package/dist/tools/ctx-search/tools.d.ts.map +1 -1
- package/dist/tools/ctx-search/types.d.ts +1 -1
- package/dist/tools/ctx-search/types.d.ts.map +1 -1
- package/dist/tui/data/context-db.d.ts +2 -0
- package/dist/tui/data/context-db.d.ts.map +1 -1
- package/package.json +3 -1
- package/src/shared/announcement.test.ts +20 -0
- package/src/shared/announcement.ts +19 -7
- package/src/shared/data-path.test.ts +70 -6
- package/src/shared/data-path.ts +50 -8
- package/src/shared/index.ts +0 -1
- package/src/shared/model-suggestion-retry.test.ts +79 -2
- package/src/shared/model-suggestion-retry.ts +181 -3
- package/src/shared/redaction.test.ts +48 -0
- package/src/shared/redaction.ts +240 -0
- package/src/shared/resolve-fallbacks.test.ts +37 -71
- package/src/shared/resolve-fallbacks.ts +30 -26
- package/src/shared/rpc-server.ts +24 -0
- package/src/shared/rpc-types.ts +2 -0
- package/src/shared/subagent-runner.ts +12 -3
- package/src/shared/tui-config.test.ts +63 -0
- package/src/shared/tui-config.ts +67 -39
- package/src/tui/data/context-db.ts +12 -0
- package/src/tui/index.tsx +87 -17
- package/src/tui/slots/sidebar-content.tsx +15 -7
- package/dist/features/magic-context/dreamer/queue.d.ts +0 -55
- package/dist/features/magic-context/dreamer/queue.d.ts.map +0 -1
- package/dist/features/magic-context/dreamer/runner.d.ts +0 -92
- package/dist/features/magic-context/dreamer/runner.d.ts.map +0 -1
- package/dist/features/magic-context/dreamer/scheduler.d.ts +0 -29
- package/dist/features/magic-context/dreamer/scheduler.d.ts.map +0 -1
- package/dist/features/magic-context/key-files/aft-availability.d.ts +0 -11
- package/dist/features/magic-context/key-files/aft-availability.d.ts.map +0 -1
- package/dist/features/magic-context/key-files/identify-key-files.d.ts +0 -84
- package/dist/features/magic-context/key-files/identify-key-files.d.ts.map +0 -1
- package/dist/features/magic-context/key-files/project-key-files.d.ts +0 -42
- package/dist/features/magic-context/key-files/project-key-files.d.ts.map +0 -1
- package/dist/features/magic-context/key-files/read-history.d.ts +0 -26
- package/dist/features/magic-context/key-files/read-history.d.ts.map +0 -1
- package/dist/features/magic-context/key-files/read-stats.d.ts +0 -18
- package/dist/features/magic-context/key-files/read-stats.d.ts.map +0 -1
- package/dist/features/magic-context/key-files/storage-key-files.d.ts +0 -20
- package/dist/features/magic-context/key-files/storage-key-files.d.ts.map +0 -1
- package/dist/hooks/magic-context/key-files-block.d.ts +0 -27
- package/dist/hooks/magic-context/key-files-block.d.ts.map +0 -1
- package/dist/shared/model-requirements.d.ts +0 -26
- package/dist/shared/model-requirements.d.ts.map +0 -1
- package/src/shared/model-requirements.ts +0 -86
package/README.md
CHANGED
|
@@ -26,6 +26,8 @@
|
|
|
26
26
|
<a href="#-capture">Capture</a> ·
|
|
27
27
|
<a href="#-consolidate">Consolidate</a> ·
|
|
28
28
|
<a href="#-recall">Recall</a> ·
|
|
29
|
+
<a href="https://docs.cortexkit.io/magic-context">Docs</a> ·
|
|
30
|
+
<a href="./CONFIGURATION.md">Configuration</a> ·
|
|
29
31
|
<a href="https://discord.gg/DSa65w8wuf">💬 Discord</a>
|
|
30
32
|
</p>
|
|
31
33
|
|
|
@@ -40,7 +42,7 @@ Coding agents work the opposite way. Every task is a fresh hire with no memory o
|
|
|
40
42
|
Magic Context gives them one. It is the **hippocampus** for coding agents, the part of the brain that forms memories, consolidates them, and recalls them, entirely in the background. One session stops being a disposable contractor and becomes a long-term teammate who was there for the whole project:
|
|
41
43
|
|
|
42
44
|
- **Capture.** As the historian compresses your history, it lifts the durable knowledge (decisions, constraints, conventions) into project memory. You get a memory system for free, from work you are already doing.
|
|
43
|
-
- **Consolidate.** Overnight,
|
|
45
|
+
- **Consolidate.** Overnight, dreamer agents do what sleep does for you: verify memories against the codebase, curate duplicates and stale entries, and promote what recurs.
|
|
44
46
|
- **Recall.** The right memories surface automatically every turn, and the agent can search across memories, past conversations, and git history on demand. Across sessions, and across OpenCode and Pi.
|
|
45
47
|
|
|
46
48
|
Two promises: your agent **never stops to manage its context** (no compaction pauses, no broken flow) and it **never forgets**.
|
|
@@ -72,7 +74,7 @@ The wizard auto-detects which harnesses you have (OpenCode, Pi, or both), adds t
|
|
|
72
74
|
|
|
73
75
|
> **Why disable built-in compaction?** Magic Context manages context itself. The host's compaction would interfere with its cache-aware deferred operations and double-compress.
|
|
74
76
|
|
|
75
|
-
**Manual setup** (OpenCode): add the plugin and turn compaction off in `opencode.json`, then drop a `magic-context.jsonc` in
|
|
77
|
+
**Manual setup** (OpenCode): add the plugin and turn compaction off in `opencode.json`, then drop a `magic-context.jsonc` in `<project>/.cortexkit/` (or `~/.config/cortexkit/` for user-wide defaults). See the [configuration reference](./CONFIGURATION.md).
|
|
76
78
|
|
|
77
79
|
```jsonc
|
|
78
80
|
{
|
|
@@ -164,10 +166,9 @@ ctx_memory(action="write", category="ARCHITECTURE", content="Event sourcing for
|
|
|
164
166
|
|
|
165
167
|
*What sleep does for memory.* An optional **dreamer** agent runs overnight to keep memory quality high, spinning up ephemeral child sessions for each task:
|
|
166
168
|
|
|
167
|
-
- **
|
|
168
|
-
- **
|
|
169
|
-
- **
|
|
170
|
-
- **Improve**: rewrite verbose memories into terse, operational form.
|
|
169
|
+
- **Verify**: incrementally check memories against the current codebase (paths, configs, patterns) and fix/remove stale facts.
|
|
170
|
+
- **Curate**: scan the whole memory pool to merge duplicates, tighten wording, and archive low-value or redundant entries.
|
|
171
|
+
- **Classify**: score each memory's importance, scope, and safe shareability without disturbing the live prompt cache.
|
|
171
172
|
- **Maintain docs**: keep `ARCHITECTURE.md` and `STRUCTURE.md` current from codebase changes.
|
|
172
173
|
- **User memories**: promote recurring observations about how you work (communication style, review focus, working patterns) into a `<user-profile>` that travels with every session.
|
|
173
174
|
- **Smart notes**: evaluate deferred notes whose `surface_condition` has come true and surface the ready ones.
|
|
@@ -214,7 +215,7 @@ Recall works **across sessions** (a new session inherits everything) and **acros
|
|
|
214
215
|
| `/ctx-recomp` | Rebuild compartments from raw history (accepts a `start-end` range). Use when stored state seems wrong |
|
|
215
216
|
| `/ctx-session-upgrade` | Upgrade this session to the latest history format: rebuild compartments and migrate project memories |
|
|
216
217
|
| `/ctx-aug` | Run sidekick augmentation on a prompt: retrieve relevant memories via a separate model |
|
|
217
|
-
| `/ctx-dream` | Run dreamer maintenance on demand:
|
|
218
|
+
| `/ctx-dream` | Run dreamer maintenance on demand: maintain memory, docs, smart notes, and user-profile review |
|
|
218
219
|
|
|
219
220
|
---
|
|
220
221
|
|
|
@@ -239,12 +240,13 @@ It reads directly from Magic Context's SQLite database. No extra server, no API.
|
|
|
239
240
|
|
|
240
241
|
## Configuration
|
|
241
242
|
|
|
242
|
-
Settings live in `magic-context.jsonc`. Everything has sensible defaults; project config merges on top of user-wide settings.
|
|
243
|
+
Settings live in `magic-context.jsonc`. Everything has sensible defaults; project config merges on top of user-wide settings. For the full reference — cache TTL tuning, per-model execute thresholds, historian and dreamer model selection, embedding providers, and memory settings — see **[CONFIGURATION.md](./CONFIGURATION.md)** or the **[configuration reference on docs.cortexkit.io](https://docs.cortexkit.io/magic-context/reference/configuration/)**.
|
|
243
244
|
|
|
244
|
-
**Config locations** (
|
|
245
|
-
1. `<project-root
|
|
246
|
-
2.
|
|
247
|
-
|
|
245
|
+
**Config locations** (one shared CortexKit location, project overrides user):
|
|
246
|
+
1. `<project-root>/.cortexkit/magic-context.jsonc`
|
|
247
|
+
2. `~/.config/cortexkit/magic-context.jsonc`
|
|
248
|
+
|
|
249
|
+
Upgrading from an earlier version? Your existing config is moved here automatically on first run (a `.MOVED_READPLEASE` breadcrumb is left at the old path).
|
|
248
250
|
|
|
249
251
|
---
|
|
250
252
|
|
package/dist/agents/dreamer.d.ts
CHANGED
|
@@ -1,2 +1,21 @@
|
|
|
1
1
|
export declare const DREAMER_AGENT = "dreamer";
|
|
2
|
+
export declare const DREAMER_RETROSPECTIVE_AGENT = "dreamer-retrospective";
|
|
3
|
+
export declare const DREAMER_PRIMER_INVESTIGATOR_AGENT = "dreamer-primer-investigator";
|
|
4
|
+
export declare const DREAMER_MEMORY_MAPPER_AGENT = "dreamer-memory-mapper";
|
|
5
|
+
/** Read-only tool profile shared by the memory-maintenance reader agent.
|
|
6
|
+
* No ctx_search (local-source checks only), no write/bash/ctx_memory. */
|
|
7
|
+
export declare const DREAMER_MEMORY_MAPPER_ALLOWED_TOOLS: readonly ["read", "grep", "glob", "aft_outline", "aft_zoom", "aft_search"];
|
|
8
|
+
export declare const DREAMER_CLASSIFIER_AGENT = "dreamer-classifier";
|
|
9
|
+
export declare const DREAMER_DOCS_AGENT = "dreamer-docs";
|
|
10
|
+
/** Codebase-read + doc-write tool profile for the docs maintainer. No memory
|
|
11
|
+
* tools (it edits docs, not the memory store). */
|
|
12
|
+
export declare const DREAMER_DOCS_ALLOWED_TOOLS: readonly ["read", "grep", "glob", "bash", "write", "edit", "aft_outline", "aft_zoom", "aft_search"];
|
|
13
|
+
export declare const DREAMER_REVIEWER_AGENT = "dreamer-reviewer";
|
|
14
|
+
/** Tool profile for the base `dreamer` agent, now CURATE-ONLY (memory-pool
|
|
15
|
+
* hygiene). Curate edits the memory store through ctx_memory and never reads
|
|
16
|
+
* code (a separate verify task owns memory-vs-code correctness), so it needs
|
|
17
|
+
* only ctx_memory — not the former bash/write/edit/read/aft/ctx_search/ctx_note
|
|
18
|
+
* kitchen sink. Kept on the `dreamer` id so the ctx_memory dreamer-action gate
|
|
19
|
+
* (toolContext.agent === DREAMER_AGENT) still recognizes it. */
|
|
20
|
+
export declare const DREAMER_CURATE_ALLOWED_TOOLS: readonly ["ctx_memory"];
|
|
2
21
|
//# sourceMappingURL=dreamer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dreamer.d.ts","sourceRoot":"","sources":["../../src/agents/dreamer.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"dreamer.d.ts","sourceRoot":"","sources":["../../src/agents/dreamer.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,YAAY,CAAC;AACvC,eAAO,MAAM,2BAA2B,0BAA0B,CAAC;AAOnE,eAAO,MAAM,iCAAiC,gCAAgC,CAAC;AAQ/E,eAAO,MAAM,2BAA2B,0BAA0B,CAAC;AAEnE;0EAC0E;AAC1E,eAAO,MAAM,mCAAmC,4EAOtC,CAAC;AAMX,eAAO,MAAM,wBAAwB,uBAAuB,CAAC;AAO7D,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AAEjD;mDACmD;AACnD,eAAO,MAAM,0BAA0B,qGAU7B,CAAC;AAKX,eAAO,MAAM,sBAAsB,qBAAqB,CAAC;AAEzD;;;;;iEAKiE;AACjE,eAAO,MAAM,4BAA4B,yBAA0B,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static registration data for one hidden agent. The id / allow-list / step cap
|
|
3
|
+
* are INLINE LITERALS in {@link buildHiddenAgentRegistrations} rather than
|
|
4
|
+
* cross-module `const` imports.
|
|
5
|
+
*
|
|
6
|
+
* # Why inline
|
|
7
|
+
*
|
|
8
|
+
* Belt-and-suspenders, not the load-bearing fix. The load failure was caused by
|
|
9
|
+
* exporting helpers from the entry module (see the module header) — that is what
|
|
10
|
+
* the entry-only-`default` rule fixes. Inlining the small id/tool/step values
|
|
11
|
+
* additionally removes any dependency on cross-module top-level `const` init
|
|
12
|
+
* timing, so this builder returns a complete, valid registration set the instant
|
|
13
|
+
* it is called regardless of module-evaluation order. Cheap insurance for a path
|
|
14
|
+
* that runs once per plugin-instance boot.
|
|
15
|
+
*
|
|
16
|
+
* The only value that cannot be inlined is the multi-KB generated system prompt;
|
|
17
|
+
* it stays a module `var` and is guarded at the call site (skip the agent + log
|
|
18
|
+
* if undefined, never register a broken/deny-all agent).
|
|
19
|
+
*
|
|
20
|
+
* `agent-registration-drift.test.ts` asserts the inline literals here stay
|
|
21
|
+
* byte-identical to the canonical exported constants so they can't silently
|
|
22
|
+
* diverge.
|
|
23
|
+
*/
|
|
24
|
+
export interface HiddenAgentRegistration {
|
|
25
|
+
id: string;
|
|
26
|
+
prompt: string | undefined;
|
|
27
|
+
allowedTools: readonly string[];
|
|
28
|
+
maxSteps: number;
|
|
29
|
+
overrides?: Record<string, unknown>;
|
|
30
|
+
/** Drop any user `permission` override (privacy-critical agents only). */
|
|
31
|
+
lockPermissions?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Hoisted function declaration: returns the four hidden-agent registrations with
|
|
35
|
+
* INLINE id / allow-list / step-cap literals (see {@link HiddenAgentRegistration}
|
|
36
|
+
* for why these must not come from module-level `var` consts). Prompts and
|
|
37
|
+
* computed overrides are passed in by the caller; the historian disallow filter
|
|
38
|
+
* is applied here against an inline default allow-list.
|
|
39
|
+
*/
|
|
40
|
+
export declare function buildHiddenAgentRegistrations(args: {
|
|
41
|
+
dreamerPrompt: string | undefined;
|
|
42
|
+
smartNoteCompilerPrompt?: string | undefined;
|
|
43
|
+
historianPrompt: string | undefined;
|
|
44
|
+
historianRecompPrompt?: string | undefined;
|
|
45
|
+
historianEditorPrompt: string | undefined;
|
|
46
|
+
sidekickPrompt: string | undefined;
|
|
47
|
+
dreamerOverrides?: Record<string, unknown>;
|
|
48
|
+
historianOverrides?: Record<string, unknown>;
|
|
49
|
+
sidekickOverrides?: Record<string, unknown>;
|
|
50
|
+
historianDisallowed: readonly string[];
|
|
51
|
+
}): HiddenAgentRegistration[];
|
|
52
|
+
/**
|
|
53
|
+
* Build a hidden-agent config with a deny-everything-by-default permission
|
|
54
|
+
* baseline and a hard tool-iteration ceiling. User overrides may lower
|
|
55
|
+
* `steps`/`maxSteps`, but cannot raise either above the built-in cap.
|
|
56
|
+
*/
|
|
57
|
+
export declare function buildHiddenAgentConfig(prompt: string, allowedTools: readonly string[], maxSteps: number, overrides?: Record<string, unknown>, agentLabel?: string, lockPermissions?: boolean): {
|
|
58
|
+
steps: number;
|
|
59
|
+
maxSteps: number;
|
|
60
|
+
permission: {
|
|
61
|
+
[x: string]: unknown;
|
|
62
|
+
};
|
|
63
|
+
mode: "subagent";
|
|
64
|
+
hidden: boolean;
|
|
65
|
+
prompt: string;
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=hidden-agent-registrations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hidden-agent-registrations.d.ts","sourceRoot":"","sources":["../../src/agents/hidden-agent-registrations.ts"],"names":[],"mappings":"AAiCA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,uBAAuB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,0EAA0E;IAC1E,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE;IAChD,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,uBAAuB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7C,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,qBAAqB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7C,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,mBAAmB,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C,GAAG,uBAAuB,EAAE,CA0K5B;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAClC,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,SAAS,MAAM,EAAE,EAC/B,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,UAAU,CAAC,EAAE,MAAM,EACnB,eAAe,UAAQ;;;;;;;;;EA+D1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"historian.d.ts","sourceRoot":"","sources":["../../src/agents/historian.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,cAAc,CAAC;AAC3C,eAAO,MAAM,sBAAsB,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"historian.d.ts","sourceRoot":"","sources":["../../src/agents/historian.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,cAAc,CAAC;AAC3C,eAAO,MAAM,sBAAsB,qBAAqB,CAAC;AACzD,eAAO,MAAM,sBAAsB,qBAAqB,CAAC"}
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
* `explore`/`scout`/`general` agents and by Alfonso for its static
|
|
81
81
|
* agent profiles.
|
|
82
82
|
*/
|
|
83
|
-
export declare function buildAllowOnlyPermission(allowedTools: readonly string[]): Record<string, "deny" | "allow">;
|
|
83
|
+
export declare function buildAllowOnlyPermission(allowedTools: readonly string[] | undefined, agentLabel?: string): Record<string, "deny" | "allow">;
|
|
84
84
|
/**
|
|
85
85
|
* Tools the historian + historian-editor + compressor agents need.
|
|
86
86
|
*
|
|
@@ -98,48 +98,11 @@ export declare function buildAllowOnlyPermission(allowedTools: readonly string[]
|
|
|
98
98
|
*/
|
|
99
99
|
export declare const HISTORIAN_ALLOWED_TOOLS: readonly ["read", "aft_outline", "aft_zoom", "aft_search"];
|
|
100
100
|
/**
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
* - `ctx_memory` / `ctx_search` / `ctx_note` — the canonical memory
|
|
106
|
-
* CRUD and retrieval path for consolidate / verify / archive /
|
|
107
|
-
* improve and smart-note dismissal.
|
|
108
|
-
* - `read` / `grep` / `glob` — the verify task prompt
|
|
109
|
-
* (`task-prompts.ts`) explicitly tells the model to grep schema
|
|
110
|
-
* files for default values, read source to confirm claimed
|
|
111
|
-
* behavior, and use glob for project structure inventory.
|
|
112
|
-
* - `bash` — required for smart-note condition evaluation (the
|
|
113
|
-
* prompt explicitly mentions `gh` / `git` / `curl` / file reads),
|
|
114
|
-
* for the verify task's `git log --oneline --since=...` step, and
|
|
115
|
-
* for the improve task's `find` / `grep` directory inventory. The
|
|
116
|
-
* live OpenCode DB shows over 100 `bash` invocations across
|
|
117
|
-
* consolidate / verify / improve / archive-stale / smart-notes
|
|
118
|
-
* dreamer child sessions, so removing it would regress real,
|
|
119
|
-
* documented dreamer behavior.
|
|
120
|
-
* - `write` / `edit` — the maintain-docs task (`task-prompts.ts`)
|
|
121
|
-
* explicitly instructs the model to "Write or update using the
|
|
122
|
-
* Write tool" to keep `ARCHITECTURE.md` / `STRUCTURE.md` at the
|
|
123
|
-
* project root synchronized. Without these tools the dreamer was
|
|
124
|
-
* forced to emit docs through `bash` heredocs/`sed` — fragile and
|
|
125
|
-
* hard to review. Granting `write` + `edit` lets it use the proper
|
|
126
|
-
* file tools (which back up + validate) instead.
|
|
127
|
-
* - `aft_search` — primary read-only code search for the verify /
|
|
128
|
-
* improve / maintain-docs tasks; finds the symbols and call sites a
|
|
129
|
-
* doc/memory rewrite must describe, more precisely than raw `grep`.
|
|
130
|
-
*
|
|
131
|
-
* Deliberately NOT allowed:
|
|
132
|
-
* - `task` — no subagent fanout from dreamer
|
|
133
|
-
* - `webfetch` / `websearch` — out of scope; smart-note URL fetches
|
|
134
|
-
* go through `bash` + `curl` instead
|
|
135
|
-
*
|
|
136
|
-
* Note: `write` / `edit` grant general file-write capability (the
|
|
137
|
-
* permission gate is tool-level, not path-level). Dreamer is a trusted
|
|
138
|
-
* hidden agent whose prompts scope writes to docs + memory; the
|
|
139
|
-
* task-prompts still say "Do not commit changes," so it edits the
|
|
140
|
-
* working tree but never commits.
|
|
101
|
+
* Subtract `disallowed` from the default historian allow-list. `"*"` removes
|
|
102
|
+
* all tools. Unknown tool names are silently ignored (the Zod enum in the
|
|
103
|
+
* config schema rejects them at parse time, so this is defense-in-depth).
|
|
141
104
|
*/
|
|
142
|
-
export declare
|
|
105
|
+
export declare function applyDisallowedTools(defaults: readonly string[], disallowed: readonly string[]): readonly string[];
|
|
143
106
|
/**
|
|
144
107
|
* Tools the sidekick agent needs. Sidekick is a read-only memory
|
|
145
108
|
* retriever for `/ctx-aug` — it queries the project's memory store
|
|
@@ -153,5 +116,19 @@ export declare const DREAMER_ALLOWED_TOOLS: readonly ["read", "grep", "glob", "b
|
|
|
153
116
|
*
|
|
154
117
|
* Still denied: spawning subagents, edits, bash, web fetches.
|
|
155
118
|
*/
|
|
119
|
+
export declare const DREAMER_RETROSPECTIVE_ALLOWED_TOOLS: readonly ["ctx_search"];
|
|
120
|
+
/**
|
|
121
|
+
* The refresh-primers code investigator: read + navigate + search the CURRENT
|
|
122
|
+
* source to answer a primer question. NO write/edit/bash (could corrupt user
|
|
123
|
+
* source) and NO ctx_memory/ctx_note (a ctx_memory mutation bumps the project
|
|
124
|
+
* memory epoch → busts m[0], breaking the primers cache-neutral contract).
|
|
125
|
+
*/
|
|
126
|
+
export declare const DREAMER_PRIMER_INVESTIGATOR_ALLOWED_TOOLS: readonly ["read", "grep", "glob", "aft_outline", "aft_zoom", "aft_search", "ctx_search"];
|
|
127
|
+
/**
|
|
128
|
+
* The smart-note compiler consumes untrusted note text and emits code that will
|
|
129
|
+
* later run in the QuickJS sandbox. It must not have ambient tools: all I/O is
|
|
130
|
+
* performed only when the compiled check runs through the host capability API.
|
|
131
|
+
*/
|
|
132
|
+
export declare const SMART_NOTE_COMPILER_ALLOWED_TOOLS: readonly [];
|
|
156
133
|
export declare const SIDEKICK_ALLOWED_TOOLS: readonly ["ctx_search", "aft_outline", "aft_zoom"];
|
|
157
134
|
//# sourceMappingURL=permissions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/agents/permissions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/agents/permissions.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AAEH;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CACpC,YAAY,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EAC3C,UAAU,CAAC,EAAE,MAAM,GACpB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAoBlC;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,uBAAuB,4DAA6D,CAAC;AAElG;;;;GAIG;AACH,wBAAgB,oBAAoB,CAChC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,UAAU,EAAE,SAAS,MAAM,EAAE,GAC9B,SAAS,MAAM,EAAE,CAGnB;AAQD;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,mCAAmC,yBAA0B,CAAC;AAE3E;;;;;GAKG;AACH,eAAO,MAAM,yCAAyC,0FAQ5C,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,aAAc,CAAC;AAE7D,eAAO,MAAM,sBAAsB,oDAAqD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smart-note-compiler.d.ts","sourceRoot":"","sources":["../../src/agents/smart-note-compiler.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,wBAAwB,CAAC"}
|
package/dist/config/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface MagicContextPluginConfig extends MagicContextConfig {
|
|
|
9
9
|
subtask?: boolean;
|
|
10
10
|
}>;
|
|
11
11
|
}
|
|
12
|
-
export type LoadOutcome = "ok" | "project-file-parse-error" | "project-file-io-error" | "schema-recovery" | "substitution-failure";
|
|
12
|
+
export type LoadOutcome = "ok" | "project-file-parse-error" | "project-file-io-error" | "legacy-config-unmigrated" | "schema-recovery" | "substitution-failure";
|
|
13
13
|
export interface LoadResultDetailed {
|
|
14
14
|
config: MagicContextPluginConfig & {
|
|
15
15
|
configWarnings?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,KAAK,kBAAkB,EAA4B,MAAM,wBAAwB,CAAC;AAG3F,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;IAChE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CACZ,MAAM,EACN;QACI,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,OAAO,CAAC;KACrB,CACJ,CAAC;CACL;AAsCD,MAAM,MAAM,WAAW,GACjB,IAAI,GACJ,0BAA0B,GAC1B,uBAAuB,GACvB,0BAA0B,GAC1B,iBAAiB,GACjB,sBAAsB,CAAC;AAE7B,MAAM,WAAW,kBAAkB;IAC/B,MAAM,EAAE,wBAAwB,GAAG;QAAE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACjE,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE;QACL,UAAU,EAAE,WAAW,CAAC;QACxB,aAAa,EAAE,WAAW,CAAC;KAC9B,CAAC;IACF,oBAAoB,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9F,qBAAqB,EAAE,MAAM,EAAE,CAAC;CACnC;AAiSD,wBAAgB,gBAAgB,CAC5B,SAAS,EAAE,MAAM,GAClB,wBAAwB,GAAG;IAAE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAY1D;AAiDD,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB,CAiI9E"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Config-LOCATION migration: move Magic Context config from the per-harness
|
|
3
|
+
* legacy locations to one shared CortexKit location, mirroring AFT's proven
|
|
4
|
+
* move-and-marker design (NOT copy-in-place, which is a silent stale-edit trap).
|
|
5
|
+
*
|
|
6
|
+
* Legacy (read by old builds):
|
|
7
|
+
* user: ~/.config/opencode/magic-context.{jsonc,json}
|
|
8
|
+
* ~/.pi/agent/magic-context.{jsonc,json}
|
|
9
|
+
* project: <root>/magic-context.{jsonc,json} (bare root)
|
|
10
|
+
* <root>/.opencode/magic-context.{jsonc,json}
|
|
11
|
+
* <root>/.pi/magic-context.{jsonc,json}
|
|
12
|
+
*
|
|
13
|
+
* Target (the only thing new builds read — HARD CUTOVER, harness-agnostic):
|
|
14
|
+
* user: ~/.config/cortexkit/magic-context.jsonc
|
|
15
|
+
* project: <root>/.cortexkit/magic-context.jsonc
|
|
16
|
+
*
|
|
17
|
+
* The migrator runs at plugin init before the loader. Idempotency comes from
|
|
18
|
+
* the legacy file being renamed away (not from a sentinel): once a source is
|
|
19
|
+
* moved aside to `<name>.MOVED_READPLEASE`, later runs find no legacy source
|
|
20
|
+
* and no-op. The marker is a pure human breadcrumb — the loader never reads it.
|
|
21
|
+
*
|
|
22
|
+
* NB: this is config-LOCATION migration. It is unrelated to the schema/key
|
|
23
|
+
* migrations (migrate-dreamer-v2, migrate-experimental) that rewrite keys
|
|
24
|
+
* INSIDE an already-located config file.
|
|
25
|
+
*/
|
|
26
|
+
export interface LegacyConfigSource {
|
|
27
|
+
path: string;
|
|
28
|
+
label: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ConfigMigrationLogger {
|
|
31
|
+
warn?: (msg: string) => void;
|
|
32
|
+
info?: (msg: string) => void;
|
|
33
|
+
log?: (msg: string) => void;
|
|
34
|
+
}
|
|
35
|
+
export interface ConfigFileMigrationOptions {
|
|
36
|
+
scope: "user" | "project";
|
|
37
|
+
targetPath: string;
|
|
38
|
+
legacySources: readonly LegacyConfigSource[];
|
|
39
|
+
logger?: ConfigMigrationLogger;
|
|
40
|
+
}
|
|
41
|
+
export interface ConfigFileMigrationResult {
|
|
42
|
+
migrated: boolean;
|
|
43
|
+
conflict: boolean;
|
|
44
|
+
sourcePath?: string;
|
|
45
|
+
targetPath: string;
|
|
46
|
+
warnings: string[];
|
|
47
|
+
}
|
|
48
|
+
/** `~/.config/cortexkit/magic-context` (no extension — for detectConfigFile). */
|
|
49
|
+
export declare function cortexKitUserConfigBasePath(): string;
|
|
50
|
+
/** `<root>/.cortexkit/magic-context` (no extension — for detectConfigFile). */
|
|
51
|
+
export declare function cortexKitProjectConfigBasePath(directory: string): string;
|
|
52
|
+
/** The migration target: always normalized to `.jsonc`. */
|
|
53
|
+
export declare function resolveCortexKitUserConfigPath(): string;
|
|
54
|
+
/** The migration target: always normalized to `.jsonc`. */
|
|
55
|
+
export declare function resolveCortexKitProjectConfigPath(directory: string): string;
|
|
56
|
+
/**
|
|
57
|
+
* The legacy config locations to migrate FROM, by scope. Each base produces a
|
|
58
|
+
* `.jsonc` and a `.json` candidate; whichever exists migrates, target is always
|
|
59
|
+
* `.jsonc`. The bare-root project source (`<root>/magic-context.*`) is unique to
|
|
60
|
+
* Magic Context (AFT never had it) — omitting it would orphan repo-root configs.
|
|
61
|
+
*/
|
|
62
|
+
export declare function resolveLegacyConfigSources(directory: string): {
|
|
63
|
+
user: LegacyConfigSource[];
|
|
64
|
+
project: LegacyConfigSource[];
|
|
65
|
+
};
|
|
66
|
+
export type ConfigHarness = "opencode" | "pi";
|
|
67
|
+
/**
|
|
68
|
+
* Legacy sources owned by ONE harness, most-specific first. Used by the loaders
|
|
69
|
+
* as a NON-DESTRUCTIVE read fallback: when the shared CortexKit base is absent
|
|
70
|
+
* (migration not yet run, or refused because OpenCode and Pi legacy configs
|
|
71
|
+
* differ), the running harness reads its OWN legacy config rather than silently
|
|
72
|
+
* falling back to schema defaults — which would re-enable features the legacy
|
|
73
|
+
* config disabled. Each harness reads only its own files, so a differing pair
|
|
74
|
+
* stays correct per-harness until the user consolidates. The bare project-root
|
|
75
|
+
* `<root>/magic-context.*` was OpenCode-only historically.
|
|
76
|
+
*/
|
|
77
|
+
export declare function resolveLegacyConfigSourcesForHarness(directory: string, harness: ConfigHarness): {
|
|
78
|
+
user: LegacyConfigSource[];
|
|
79
|
+
project: LegacyConfigSource[];
|
|
80
|
+
};
|
|
81
|
+
export declare function migrateConfigFile(opts: ConfigFileMigrationOptions): ConfigFileMigrationResult;
|
|
82
|
+
/**
|
|
83
|
+
* Run both the user-scope and project-scope config-location migrations for a
|
|
84
|
+
* project directory. Idempotent and cheap when nothing to migrate (a few
|
|
85
|
+
* existsSync calls). Call once at plugin init, before loading config. Returns
|
|
86
|
+
* any warnings (conflicts / partial failures) for the host to surface + log.
|
|
87
|
+
*/
|
|
88
|
+
export declare function migrateMagicContextConfigLocations(directory: string, logger?: ConfigMigrationLogger): string[];
|
|
89
|
+
//# sourceMappingURL=migrate-config-location.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-config-location.d.ts","sourceRoot":"","sources":["../../src/config/migrate-config-location.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IAClC,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,0BAA0B;IACvC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAC7C,MAAM,CAAC,EAAE,qBAAqB,CAAC;CAClC;AAED,MAAM,WAAW,yBAAyB;IACtC,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACtB;AAoBD,iFAAiF;AACjF,wBAAgB,2BAA2B,IAAI,MAAM,CAEpD;AAED,+EAA+E;AAC/E,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAExE;AAED,2DAA2D;AAC3D,wBAAgB,8BAA8B,IAAI,MAAM,CAEvD;AAED,2DAA2D;AAC3D,wBAAgB,iCAAiC,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE3E;AASD;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG;IAC3D,IAAI,EAAE,kBAAkB,EAAE,CAAC;IAC3B,OAAO,EAAE,kBAAkB,EAAE,CAAC;CACjC,CAqBA;AAED,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,IAAI,CAAC;AAE9C;;;;;;;;;GASG;AACH,wBAAgB,oCAAoC,CAChD,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,aAAa,GACvB;IAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;IAAC,OAAO,EAAE,kBAAkB,EAAE,CAAA;CAAE,CA0B/D;AAmSD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,0BAA0B,GAAG,yBAAyB,CA0F7F;AAED;;;;;GAKG;AACH,wBAAgB,kCAAkC,CAC9C,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,qBAAqB,GAC/B,MAAM,EAAE,CA6BV"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-memory migration of the legacy v1 dreamer config shape to the Dreamer v2
|
|
3
|
+
* per-task shape (shared OpenCode + Pi; runs on every config load, like
|
|
4
|
+
* migrate-experimental). Doctor performs the on-disk equivalent.
|
|
5
|
+
*
|
|
6
|
+
* v1 shape (any subset):
|
|
7
|
+
* dreamer: {
|
|
8
|
+
* schedule: "02:00-06:00", // a TIME WINDOW
|
|
9
|
+
* tasks: ["consolidate","verify"], // an ARRAY of agentic task names
|
|
10
|
+
* task_timeout_minutes: 20,
|
|
11
|
+
* max_runtime_minutes: 120,
|
|
12
|
+
* user_memories: { enabled, promotion_threshold },
|
|
13
|
+
* pin_key_files: { enabled, token_budget, min_reads },
|
|
14
|
+
* }
|
|
15
|
+
*
|
|
16
|
+
* v2 shape:
|
|
17
|
+
* dreamer: {
|
|
18
|
+
* tasks: { <task>: { schedule: "<cron>"|"", model?, timeout_minutes?, ... } }
|
|
19
|
+
* }
|
|
20
|
+
*
|
|
21
|
+
* Rules (see dreamer-v2-AB-spec.md):
|
|
22
|
+
* - Base cron derived from the WINDOW START: "02:00-06:00" → "0 2 * * *".
|
|
23
|
+
* - Legacy `tasks` array PRESENT → it is the user's deliberate selection: each
|
|
24
|
+
* LISTED agentic task gets the base cron; each OMITTED canonical task gets ""
|
|
25
|
+
* (disabled). Built-in defaults are used ONLY when `tasks` is absent.
|
|
26
|
+
* - user_memories.enabled false → review-user-memories "" ; true → base cron
|
|
27
|
+
* (promotion_threshold carried). A legacy pin_key_files block is dropped
|
|
28
|
+
* (key-files pinning moved out of Magic Context).
|
|
29
|
+
* - classify-memories is NEW in v2 and defaults ON daily at 06:00, unless the
|
|
30
|
+
* whole dreamer block is disabled.
|
|
31
|
+
* - evaluate-smart-notes → base cron (it always ran on pending notes).
|
|
32
|
+
* - task_timeout_minutes → each task's timeout_minutes default; max_runtime_minutes dropped.
|
|
33
|
+
* - Object-shaped A+B configs carrying retired memory task keys are folded into
|
|
34
|
+
* verify + curate before schema parsing strips unknown keys.
|
|
35
|
+
*/
|
|
36
|
+
export declare function migrateDreamerV2(rawConfig: Record<string, unknown>, warnings: string[]): Record<string, unknown>;
|
|
37
|
+
//# sourceMappingURL=migrate-dreamer-v2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-dreamer-v2.d.ts","sourceRoot":"","sources":["../../src/config/migrate-dreamer-v2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAsGH,wBAAgB,gBAAgB,CAC5B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,QAAQ,EAAE,MAAM,EAAE,GACnB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAoMzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-experimental.d.ts","sourceRoot":"","sources":["../../src/config/migrate-experimental.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,yBAAyB,CACrC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,QAAQ,EAAE,MAAM,EAAE,GACnB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"migrate-experimental.d.ts","sourceRoot":"","sources":["../../src/config/migrate-experimental.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,yBAAyB,CACrC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,QAAQ,EAAE,MAAM,EAAE,GACnB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAgIzB"}
|
|
@@ -22,6 +22,9 @@
|
|
|
22
22
|
* process). A cloned repo could set a huge value to exhaust host memory /
|
|
23
23
|
* address space — a resource-exhaustion vector with no legitimate per-repo
|
|
24
24
|
* use. Honor user-level config only.
|
|
25
|
+
* - `embedding.endpoint` / `embedding.provider` — a repo must not choose
|
|
26
|
+
* where private memory/search/commit text is embedded. User-level config is
|
|
27
|
+
* the trust boundary for embedding destinations.
|
|
25
28
|
* - hidden-agent `prompt`/`permission`/`tools` — a repo must not reprogram or
|
|
26
29
|
* re-permission the historian/dreamer/sidekick.
|
|
27
30
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-security.d.ts","sourceRoot":"","sources":["../../src/config/project-security.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"project-security.d.ts","sourceRoot":"","sources":["../../src/config/project-security.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAkCH;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,8BAA8B,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,EAAE,CAsD5F;AA2BD,wBAAgB,mCAAmC,CAC/C,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,MAAM,EAAE,CAsCV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prune-config-leaf.d.ts","sourceRoot":"","sources":["../../src/config/prune-config-leaf.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACjC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,YAAY,EAAE,SAAS,WAAW,EAAE,GACrC;IAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"prune-config-leaf.d.ts","sourceRoot":"","sources":["../../src/config/prune-config-leaf.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACjC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,YAAY,EAAE,SAAS,WAAW,EAAE,GACrC;IAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAqC5D"}
|