@wolfx/opencode-magic-context 0.21.8-patch.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/dreamer.d.ts +2 -0
- package/dist/agents/dreamer.d.ts.map +1 -0
- package/dist/agents/historian.d.ts +3 -0
- package/dist/agents/historian.d.ts.map +1 -0
- package/dist/agents/magic-context-prompt.d.ts +3 -0
- package/dist/agents/magic-context-prompt.d.ts.map +1 -0
- package/dist/agents/permissions.d.ts +142 -0
- package/dist/agents/permissions.d.ts.map +1 -0
- package/dist/agents/sidekick.d.ts +2 -0
- package/dist/agents/sidekick.d.ts.map +1 -0
- package/dist/config/agent-disable.d.ts +26 -0
- package/dist/config/agent-disable.d.ts.map +1 -0
- package/dist/config/index.d.ts +33 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/schema/agent-overrides.d.ts +55 -0
- package/dist/config/schema/agent-overrides.d.ts.map +1 -0
- package/dist/config/schema/magic-context.d.ts +841 -0
- package/dist/config/schema/magic-context.d.ts.map +1 -0
- package/dist/config/schema.d.ts +3 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/variable.d.ts +48 -0
- package/dist/config/variable.d.ts.map +1 -0
- package/dist/features/builtin-commands/commands.d.ts +3 -0
- package/dist/features/builtin-commands/commands.d.ts.map +1 -0
- package/dist/features/builtin-commands/types.d.ts +5 -0
- package/dist/features/builtin-commands/types.d.ts.map +1 -0
- package/dist/features/magic-context/compaction-marker.d.ts +91 -0
- package/dist/features/magic-context/compaction-marker.d.ts.map +1 -0
- package/dist/features/magic-context/compaction.d.ts +7 -0
- package/dist/features/magic-context/compaction.d.ts.map +1 -0
- package/dist/features/magic-context/compartment-lease.d.ts +14 -0
- package/dist/features/magic-context/compartment-lease.d.ts.map +1 -0
- package/dist/features/magic-context/compartment-storage.d.ts +130 -0
- package/dist/features/magic-context/compartment-storage.d.ts.map +1 -0
- package/dist/features/magic-context/compression-depth-storage.d.ts +14 -0
- package/dist/features/magic-context/compression-depth-storage.d.ts.map +1 -0
- package/dist/features/magic-context/defaults.d.ts +2 -0
- package/dist/features/magic-context/defaults.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/index.d.ts +8 -0
- package/dist/features/magic-context/dreamer/index.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/lease.d.ts +8 -0
- package/dist/features/magic-context/dreamer/lease.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/queue.d.ts +44 -0
- package/dist/features/magic-context/dreamer/queue.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/runner.d.ts +81 -0
- package/dist/features/magic-context/dreamer/runner.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/scheduler.d.ts +33 -0
- package/dist/features/magic-context/dreamer/scheduler.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/storage-dream-runs.d.ts +41 -0
- package/dist/features/magic-context/dreamer/storage-dream-runs.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/storage-dream-state.d.ts +5 -0
- package/dist/features/magic-context/dreamer/storage-dream-state.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/task-prompts.d.ts +26 -0
- package/dist/features/magic-context/dreamer/task-prompts.d.ts.map +1 -0
- package/dist/features/magic-context/git-commits/git-log-reader.d.ts +57 -0
- package/dist/features/magic-context/git-commits/git-log-reader.d.ts.map +1 -0
- package/dist/features/magic-context/git-commits/index.d.ts +7 -0
- package/dist/features/magic-context/git-commits/index.d.ts.map +1 -0
- package/dist/features/magic-context/git-commits/indexer.d.ts +43 -0
- package/dist/features/magic-context/git-commits/indexer.d.ts.map +1 -0
- package/dist/features/magic-context/git-commits/search-git-commits.d.ts +32 -0
- package/dist/features/magic-context/git-commits/search-git-commits.d.ts.map +1 -0
- package/dist/features/magic-context/git-commits/storage-git-commit-embeddings.d.ts +19 -0
- package/dist/features/magic-context/git-commits/storage-git-commit-embeddings.d.ts.map +1 -0
- package/dist/features/magic-context/git-commits/storage-git-commits.d.ts +47 -0
- package/dist/features/magic-context/git-commits/storage-git-commits.d.ts.map +1 -0
- package/dist/features/magic-context/index.d.ts +12 -0
- package/dist/features/magic-context/index.d.ts.map +1 -0
- package/dist/features/magic-context/key-files/aft-availability.d.ts +11 -0
- package/dist/features/magic-context/key-files/aft-availability.d.ts.map +1 -0
- package/dist/features/magic-context/key-files/identify-key-files.d.ts +84 -0
- package/dist/features/magic-context/key-files/identify-key-files.d.ts.map +1 -0
- package/dist/features/magic-context/key-files/project-key-files.d.ts +42 -0
- package/dist/features/magic-context/key-files/project-key-files.d.ts.map +1 -0
- package/dist/features/magic-context/key-files/read-history.d.ts +26 -0
- package/dist/features/magic-context/key-files/read-history.d.ts.map +1 -0
- package/dist/features/magic-context/key-files/read-stats.d.ts +20 -0
- package/dist/features/magic-context/key-files/read-stats.d.ts.map +1 -0
- package/dist/features/magic-context/key-files/storage-key-files.d.ts +25 -0
- package/dist/features/magic-context/key-files/storage-key-files.d.ts.map +1 -0
- package/dist/features/magic-context/memory/constants.d.ts +5 -0
- package/dist/features/magic-context/memory/constants.d.ts.map +1 -0
- package/dist/features/magic-context/memory/cosine-similarity.d.ts +2 -0
- package/dist/features/magic-context/memory/cosine-similarity.d.ts.map +1 -0
- package/dist/features/magic-context/memory/embedding-backfill.d.ts +9 -0
- package/dist/features/magic-context/memory/embedding-backfill.d.ts.map +1 -0
- package/dist/features/magic-context/memory/embedding-cache.d.ts +8 -0
- package/dist/features/magic-context/memory/embedding-cache.d.ts.map +1 -0
- package/dist/features/magic-context/memory/embedding-identity.d.ts +11 -0
- package/dist/features/magic-context/memory/embedding-identity.d.ts.map +1 -0
- package/dist/features/magic-context/memory/embedding-local.d.ts +20 -0
- package/dist/features/magic-context/memory/embedding-local.d.ts.map +1 -0
- package/dist/features/magic-context/memory/embedding-openai.d.ts +44 -0
- package/dist/features/magic-context/memory/embedding-openai.d.ts.map +1 -0
- package/dist/features/magic-context/memory/embedding-probe.d.ts +69 -0
- package/dist/features/magic-context/memory/embedding-probe.d.ts.map +1 -0
- package/dist/features/magic-context/memory/embedding-provider.d.ts +15 -0
- package/dist/features/magic-context/memory/embedding-provider.d.ts.map +1 -0
- package/dist/features/magic-context/memory/embedding.d.ts +39 -0
- package/dist/features/magic-context/memory/embedding.d.ts.map +1 -0
- package/dist/features/magic-context/memory/index.d.ts +12 -0
- package/dist/features/magic-context/memory/index.d.ts.map +1 -0
- package/dist/features/magic-context/memory/normalize-hash.d.ts +3 -0
- package/dist/features/magic-context/memory/normalize-hash.d.ts.map +1 -0
- package/dist/features/magic-context/memory/project-identity.d.ts +23 -0
- package/dist/features/magic-context/memory/project-identity.d.ts.map +1 -0
- package/dist/features/magic-context/memory/promotion.d.ts +13 -0
- package/dist/features/magic-context/memory/promotion.d.ts.map +1 -0
- package/dist/features/magic-context/memory/storage-memory-embeddings.d.ts +8 -0
- package/dist/features/magic-context/memory/storage-memory-embeddings.d.ts.map +1 -0
- package/dist/features/magic-context/memory/storage-memory-fts.d.ts +12 -0
- package/dist/features/magic-context/memory/storage-memory-fts.d.ts.map +1 -0
- package/dist/features/magic-context/memory/storage-memory.d.ts +31 -0
- package/dist/features/magic-context/memory/storage-memory.d.ts.map +1 -0
- package/dist/features/magic-context/memory/types.d.ts +37 -0
- package/dist/features/magic-context/memory/types.d.ts.map +1 -0
- package/dist/features/magic-context/message-index-async.d.ts +12 -0
- package/dist/features/magic-context/message-index-async.d.ts.map +1 -0
- package/dist/features/magic-context/message-index.d.ts +10 -0
- package/dist/features/magic-context/message-index.d.ts.map +1 -0
- package/dist/features/magic-context/migrations.d.ts +33 -0
- package/dist/features/magic-context/migrations.d.ts.map +1 -0
- package/dist/features/magic-context/mock-database.d.ts +3 -0
- package/dist/features/magic-context/mock-database.d.ts.map +1 -0
- package/dist/features/magic-context/overflow-detection.d.ts +51 -0
- package/dist/features/magic-context/overflow-detection.d.ts.map +1 -0
- package/dist/features/magic-context/plugin-messages.d.ts +75 -0
- package/dist/features/magic-context/plugin-messages.d.ts.map +1 -0
- package/dist/features/magic-context/project-embedding-registry.d.ts +44 -0
- package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -0
- package/dist/features/magic-context/range-parser.d.ts +13 -0
- package/dist/features/magic-context/range-parser.d.ts.map +1 -0
- package/dist/features/magic-context/resolve-subagent-fallback.d.ts +40 -0
- package/dist/features/magic-context/resolve-subagent-fallback.d.ts.map +1 -0
- package/dist/features/magic-context/scheduler.d.ts +18 -0
- package/dist/features/magic-context/scheduler.d.ts.map +1 -0
- package/dist/features/magic-context/search.d.ts +69 -0
- package/dist/features/magic-context/search.d.ts.map +1 -0
- package/dist/features/magic-context/sidekick/agent.d.ts +13 -0
- package/dist/features/magic-context/sidekick/agent.d.ts.map +1 -0
- package/dist/features/magic-context/sidekick/core.d.ts +38 -0
- package/dist/features/magic-context/sidekick/core.d.ts.map +1 -0
- package/dist/features/magic-context/sidekick/index.d.ts +3 -0
- package/dist/features/magic-context/sidekick/index.d.ts.map +1 -0
- package/dist/features/magic-context/storage-db.d.ts +48 -0
- package/dist/features/magic-context/storage-db.d.ts.map +1 -0
- package/dist/features/magic-context/storage-meta-persisted.d.ts +246 -0
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -0
- package/dist/features/magic-context/storage-meta-session.d.ts +6 -0
- package/dist/features/magic-context/storage-meta-session.d.ts.map +1 -0
- package/dist/features/magic-context/storage-meta-shared.d.ts +31 -0
- package/dist/features/magic-context/storage-meta-shared.d.ts.map +1 -0
- package/dist/features/magic-context/storage-meta.d.ts +3 -0
- package/dist/features/magic-context/storage-meta.d.ts.map +1 -0
- package/dist/features/magic-context/storage-notes.d.ts +62 -0
- package/dist/features/magic-context/storage-notes.d.ts.map +1 -0
- package/dist/features/magic-context/storage-ops.d.ts +7 -0
- package/dist/features/magic-context/storage-ops.d.ts.map +1 -0
- package/dist/features/magic-context/storage-source.d.ts +5 -0
- package/dist/features/magic-context/storage-source.d.ts.map +1 -0
- package/dist/features/magic-context/storage-subagent-invocations.d.ts +52 -0
- package/dist/features/magic-context/storage-subagent-invocations.d.ts.map +1 -0
- package/dist/features/magic-context/storage-tags.d.ts +206 -0
- package/dist/features/magic-context/storage-tags.d.ts.map +1 -0
- package/dist/features/magic-context/storage.d.ts +11 -0
- package/dist/features/magic-context/storage.d.ts.map +1 -0
- package/dist/features/magic-context/subagent-token-capture.d.ts +33 -0
- package/dist/features/magic-context/subagent-token-capture.d.ts.map +1 -0
- package/dist/features/magic-context/tagger.d.ts +64 -0
- package/dist/features/magic-context/tagger.d.ts.map +1 -0
- package/dist/features/magic-context/tool-definition-tokens.d.ts +79 -0
- package/dist/features/magic-context/tool-definition-tokens.d.ts.map +1 -0
- package/dist/features/magic-context/tool-owner-backfill.d.ts +90 -0
- package/dist/features/magic-context/tool-owner-backfill.d.ts.map +1 -0
- package/dist/features/magic-context/types.d.ts +72 -0
- package/dist/features/magic-context/types.d.ts.map +1 -0
- package/dist/features/magic-context/user-memory/review-user-memories.d.ts +22 -0
- package/dist/features/magic-context/user-memory/review-user-memories.d.ts.map +1 -0
- package/dist/features/magic-context/user-memory/storage-user-memory.d.ts +33 -0
- package/dist/features/magic-context/user-memory/storage-user-memory.d.ts.map +1 -0
- package/dist/features/magic-context/work-metrics.d.ts +13 -0
- package/dist/features/magic-context/work-metrics.d.ts.map +1 -0
- package/dist/hooks/auto-update-checker/cache.d.ts +23 -0
- package/dist/hooks/auto-update-checker/cache.d.ts.map +1 -0
- package/dist/hooks/auto-update-checker/checker.d.ts +13 -0
- package/dist/hooks/auto-update-checker/checker.d.ts.map +1 -0
- package/dist/hooks/auto-update-checker/constants.d.ts +10 -0
- package/dist/hooks/auto-update-checker/constants.d.ts.map +1 -0
- package/dist/hooks/auto-update-checker/index.d.ts +40 -0
- package/dist/hooks/auto-update-checker/index.d.ts.map +1 -0
- package/dist/hooks/auto-update-checker/types.d.ts +50 -0
- package/dist/hooks/auto-update-checker/types.d.ts.map +1 -0
- package/dist/hooks/is-anthropic-provider.d.ts +2 -0
- package/dist/hooks/is-anthropic-provider.d.ts.map +1 -0
- package/dist/hooks/magic-context/apply-context-nudge.d.ts +5 -0
- package/dist/hooks/magic-context/apply-context-nudge.d.ts.map +1 -0
- package/dist/hooks/magic-context/apply-operations.d.ts +7 -0
- package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -0
- package/dist/hooks/magic-context/auto-search-hint.d.ts +34 -0
- package/dist/hooks/magic-context/auto-search-hint.d.ts.map +1 -0
- package/dist/hooks/magic-context/auto-search-runner.d.ts +53 -0
- package/dist/hooks/magic-context/auto-search-runner.d.ts.map +1 -0
- package/dist/hooks/magic-context/boundary-execution.d.ts +24 -0
- package/dist/hooks/magic-context/boundary-execution.d.ts.map +1 -0
- package/dist/hooks/magic-context/cache-busting-signals.d.ts +10 -0
- package/dist/hooks/magic-context/cache-busting-signals.d.ts.map +1 -0
- package/dist/hooks/magic-context/caveman-cleanup.d.ts +86 -0
- package/dist/hooks/magic-context/caveman-cleanup.d.ts.map +1 -0
- package/dist/hooks/magic-context/caveman.d.ts +35 -0
- package/dist/hooks/magic-context/caveman.d.ts.map +1 -0
- package/dist/hooks/magic-context/command-handler.d.ts +89 -0
- package/dist/hooks/magic-context/command-handler.d.ts.map +1 -0
- package/dist/hooks/magic-context/compaction-marker-manager.d.ts +106 -0
- package/dist/hooks/magic-context/compaction-marker-manager.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-parser.d.ts +18 -0
- package/dist/hooks/magic-context/compartment-parser.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-prompt.d.ts +19 -0
- package/dist/hooks/magic-context/compartment-prompt.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner-compressor.d.ts +87 -0
- package/dist/hooks/magic-context/compartment-runner-compressor.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner-drop-queue.d.ts +26 -0
- package/dist/hooks/magic-context/compartment-runner-drop-queue.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts +42 -0
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts +6 -0
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner-mapping.d.ts +33 -0
- package/dist/hooks/magic-context/compartment-runner-mapping.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner-partial-recomp.d.ts +29 -0
- package/dist/hooks/magic-context/compartment-runner-partial-recomp.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner-recomp.d.ts +3 -0
- package/dist/hooks/magic-context/compartment-runner-recomp.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner-state-xml.d.ts +21 -0
- package/dist/hooks/magic-context/compartment-runner-state-xml.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner-types.d.ts +102 -0
- package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts +28 -0
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner.d.ts +54 -0
- package/dist/hooks/magic-context/compartment-runner.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-trigger.d.ts +17 -0
- package/dist/hooks/magic-context/compartment-trigger.d.ts.map +1 -0
- package/dist/hooks/magic-context/derive-budgets.d.ts +57 -0
- package/dist/hooks/magic-context/derive-budgets.d.ts.map +1 -0
- package/dist/hooks/magic-context/drop-stale-reduce-calls.d.ts +4 -0
- package/dist/hooks/magic-context/drop-stale-reduce-calls.d.ts.map +1 -0
- package/dist/hooks/magic-context/event-handler.d.ts +49 -0
- package/dist/hooks/magic-context/event-handler.d.ts.map +1 -0
- package/dist/hooks/magic-context/event-payloads.d.ts +62 -0
- package/dist/hooks/magic-context/event-payloads.d.ts.map +1 -0
- package/dist/hooks/magic-context/event-resolvers.d.ts +72 -0
- package/dist/hooks/magic-context/event-resolvers.d.ts.map +1 -0
- package/dist/hooks/magic-context/execute-flush.d.ts +3 -0
- package/dist/hooks/magic-context/execute-flush.d.ts.map +1 -0
- package/dist/hooks/magic-context/execute-status.d.ts +12 -0
- package/dist/hooks/magic-context/execute-status.d.ts.map +1 -0
- package/dist/hooks/magic-context/format-bytes.d.ts +2 -0
- package/dist/hooks/magic-context/format-bytes.d.ts.map +1 -0
- package/dist/hooks/magic-context/heuristic-cleanup.d.ts +22 -0
- package/dist/hooks/magic-context/heuristic-cleanup.d.ts.map +1 -0
- package/dist/hooks/magic-context/historian-state-file.d.ts +43 -0
- package/dist/hooks/magic-context/historian-state-file.d.ts.map +1 -0
- package/dist/hooks/magic-context/hook-handlers.d.ts +165 -0
- package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -0
- package/dist/hooks/magic-context/hook.d.ts +118 -0
- package/dist/hooks/magic-context/hook.d.ts.map +1 -0
- package/dist/hooks/magic-context/image-token-estimate.d.ts +6 -0
- package/dist/hooks/magic-context/image-token-estimate.d.ts.map +1 -0
- package/dist/hooks/magic-context/index.d.ts +3 -0
- package/dist/hooks/magic-context/index.d.ts.map +1 -0
- package/dist/hooks/magic-context/inject-compartments.d.ts +52 -0
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -0
- package/dist/hooks/magic-context/key-files-block.d.ts +27 -0
- package/dist/hooks/magic-context/key-files-block.d.ts.map +1 -0
- package/dist/hooks/magic-context/live-session-state.d.ts +42 -0
- package/dist/hooks/magic-context/live-session-state.d.ts.map +1 -0
- package/dist/hooks/magic-context/note-nudger.d.ts +71 -0
- package/dist/hooks/magic-context/note-nudger.d.ts.map +1 -0
- package/dist/hooks/magic-context/note-visibility.d.ts +43 -0
- package/dist/hooks/magic-context/note-visibility.d.ts.map +1 -0
- package/dist/hooks/magic-context/nudge-bands.d.ts +6 -0
- package/dist/hooks/magic-context/nudge-bands.d.ts.map +1 -0
- package/dist/hooks/magic-context/nudge-injection.d.ts +7 -0
- package/dist/hooks/magic-context/nudge-injection.d.ts.map +1 -0
- package/dist/hooks/magic-context/nudge-placement-store.d.ts +15 -0
- package/dist/hooks/magic-context/nudge-placement-store.d.ts.map +1 -0
- package/dist/hooks/magic-context/nudger.d.ts +21 -0
- package/dist/hooks/magic-context/nudger.d.ts.map +1 -0
- package/dist/hooks/magic-context/read-session-chunk.d.ts +99 -0
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -0
- package/dist/hooks/magic-context/read-session-db.d.ts +21 -0
- package/dist/hooks/magic-context/read-session-db.d.ts.map +1 -0
- package/dist/hooks/magic-context/read-session-formatting.d.ts +35 -0
- package/dist/hooks/magic-context/read-session-formatting.d.ts.map +1 -0
- package/dist/hooks/magic-context/read-session-raw.d.ts +10 -0
- package/dist/hooks/magic-context/read-session-raw.d.ts.map +1 -0
- package/dist/hooks/magic-context/send-session-notification.d.ts +13 -0
- package/dist/hooks/magic-context/send-session-notification.d.ts.map +1 -0
- package/dist/hooks/magic-context/sentinel.d.ts +102 -0
- package/dist/hooks/magic-context/sentinel.d.ts.map +1 -0
- package/dist/hooks/magic-context/strip-content.d.ts +140 -0
- package/dist/hooks/magic-context/strip-content.d.ts.map +1 -0
- package/dist/hooks/magic-context/strip-structural-noise.d.ts +17 -0
- package/dist/hooks/magic-context/strip-structural-noise.d.ts.map +1 -0
- package/dist/hooks/magic-context/system-injection-stripper.d.ts +2 -0
- package/dist/hooks/magic-context/system-injection-stripper.d.ts.map +1 -0
- package/dist/hooks/magic-context/system-prompt-hash.d.ts +85 -0
- package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -0
- package/dist/hooks/magic-context/tag-content-primitives.d.ts +6 -0
- package/dist/hooks/magic-context/tag-content-primitives.d.ts.map +1 -0
- package/dist/hooks/magic-context/tag-id-fallback.d.ts +9 -0
- package/dist/hooks/magic-context/tag-id-fallback.d.ts.map +1 -0
- package/dist/hooks/magic-context/tag-messages.d.ts +48 -0
- package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -0
- package/dist/hooks/magic-context/tag-part-guards.d.ts +23 -0
- package/dist/hooks/magic-context/tag-part-guards.d.ts.map +1 -0
- package/dist/hooks/magic-context/temporal-awareness.d.ts +73 -0
- package/dist/hooks/magic-context/temporal-awareness.d.ts.map +1 -0
- package/dist/hooks/magic-context/text-complete.d.ts +8 -0
- package/dist/hooks/magic-context/text-complete.d.ts.map +1 -0
- package/dist/hooks/magic-context/todo-view.d.ts +102 -0
- package/dist/hooks/magic-context/todo-view.d.ts.map +1 -0
- package/dist/hooks/magic-context/tokenizer-calibration.d.ts +85 -0
- package/dist/hooks/magic-context/tokenizer-calibration.d.ts.map +1 -0
- package/dist/hooks/magic-context/tool-drop-target.d.ts +48 -0
- package/dist/hooks/magic-context/tool-drop-target.d.ts.map +1 -0
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts +66 -0
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -0
- package/dist/hooks/magic-context/transform-context-state.d.ts +12 -0
- package/dist/hooks/magic-context/transform-context-state.d.ts.map +1 -0
- package/dist/hooks/magic-context/transform-message-helpers.d.ts +29 -0
- package/dist/hooks/magic-context/transform-message-helpers.d.ts.map +1 -0
- package/dist/hooks/magic-context/transform-operations.d.ts +5 -0
- package/dist/hooks/magic-context/transform-operations.d.ts.map +1 -0
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +100 -0
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -0
- package/dist/hooks/magic-context/transform-stage-logger.d.ts +2 -0
- package/dist/hooks/magic-context/transform-stage-logger.d.ts.map +1 -0
- package/dist/hooks/magic-context/transform.d.ts +145 -0
- package/dist/hooks/magic-context/transform.d.ts.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +179800 -0
- package/dist/plugin/conflict-warning-hook.d.ts +34 -0
- package/dist/plugin/conflict-warning-hook.d.ts.map +1 -0
- package/dist/plugin/dream-timer.d.ts +44 -0
- package/dist/plugin/dream-timer.d.ts.map +1 -0
- package/dist/plugin/embedding-bootstrap-helpers.d.ts +35 -0
- package/dist/plugin/embedding-bootstrap-helpers.d.ts.map +1 -0
- package/dist/plugin/embedding-bootstrap.d.ts +3 -0
- package/dist/plugin/embedding-bootstrap.d.ts.map +1 -0
- package/dist/plugin/event.d.ts +13 -0
- package/dist/plugin/event.d.ts.map +1 -0
- package/dist/plugin/hooks/create-session-hooks.d.ts +44 -0
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -0
- package/dist/plugin/messages-transform.d.ts +46 -0
- package/dist/plugin/messages-transform.d.ts.map +1 -0
- package/dist/plugin/normalize-tool-arg-schemas.d.ts +7 -0
- package/dist/plugin/normalize-tool-arg-schemas.d.ts.map +1 -0
- package/dist/plugin/rpc-handlers.d.ts +21 -0
- package/dist/plugin/rpc-handlers.d.ts.map +1 -0
- package/dist/plugin/sidebar-snapshot-cache.d.ts +19 -0
- package/dist/plugin/sidebar-snapshot-cache.d.ts.map +1 -0
- package/dist/plugin/tool-registry.d.ts +8 -0
- package/dist/plugin/tool-registry.d.ts.map +1 -0
- package/dist/plugin/types.d.ts +3 -0
- package/dist/plugin/types.d.ts.map +1 -0
- package/dist/shared/announcement.d.ts +55 -0
- package/dist/shared/announcement.d.ts.map +1 -0
- package/dist/shared/assistant-message-extractor.d.ts +2 -0
- package/dist/shared/assistant-message-extractor.d.ts.map +1 -0
- package/dist/shared/bounded-session-map.d.ts +45 -0
- package/dist/shared/bounded-session-map.d.ts.map +1 -0
- package/dist/shared/conflict-detector.d.ts +74 -0
- package/dist/shared/conflict-detector.d.ts.map +1 -0
- package/dist/shared/conflict-fixer.d.ts +3 -0
- package/dist/shared/conflict-fixer.d.ts.map +1 -0
- package/dist/shared/data-path.d.ts +121 -0
- package/dist/shared/data-path.d.ts.map +1 -0
- package/dist/shared/error-message.d.ts +32 -0
- package/dist/shared/error-message.d.ts.map +1 -0
- package/dist/shared/format-bytes.d.ts +2 -0
- package/dist/shared/format-bytes.d.ts.map +1 -0
- package/dist/shared/format-threshold.d.ts +24 -0
- package/dist/shared/format-threshold.d.ts.map +1 -0
- package/dist/shared/harness.d.ts +43 -0
- package/dist/shared/harness.d.ts.map +1 -0
- package/dist/shared/index.d.ts +6 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/internal-initiator-marker.d.ts +2 -0
- package/dist/shared/internal-initiator-marker.d.ts.map +1 -0
- package/dist/shared/jsonc-parser.d.ts +8 -0
- package/dist/shared/jsonc-parser.d.ts.map +1 -0
- package/dist/shared/logger.d.ts +10 -0
- package/dist/shared/logger.d.ts.map +1 -0
- package/dist/shared/model-requirements.d.ts +26 -0
- package/dist/shared/model-requirements.d.ts.map +1 -0
- package/dist/shared/model-suggestion-retry.d.ts +68 -0
- package/dist/shared/model-suggestion-retry.d.ts.map +1 -0
- package/dist/shared/models-dev-cache.d.ts +65 -0
- package/dist/shared/models-dev-cache.d.ts.map +1 -0
- package/dist/shared/native-binding.d.ts +87 -0
- package/dist/shared/native-binding.d.ts.map +1 -0
- package/dist/shared/normalize-sdk-response.d.ts +5 -0
- package/dist/shared/normalize-sdk-response.d.ts.map +1 -0
- package/dist/shared/opencode-compaction-detector.d.ts +2 -0
- package/dist/shared/opencode-compaction-detector.d.ts.map +1 -0
- package/dist/shared/opencode-config-dir-types.d.ts +14 -0
- package/dist/shared/opencode-config-dir-types.d.ts.map +1 -0
- package/dist/shared/opencode-config-dir.d.ts +5 -0
- package/dist/shared/opencode-config-dir.d.ts.map +1 -0
- package/dist/shared/record-type-guard.d.ts +2 -0
- package/dist/shared/record-type-guard.d.ts.map +1 -0
- package/dist/shared/resolve-fallbacks.d.ts +32 -0
- package/dist/shared/resolve-fallbacks.d.ts.map +1 -0
- package/dist/shared/rpc-client.d.ts +17 -0
- package/dist/shared/rpc-client.d.ts.map +1 -0
- package/dist/shared/rpc-notifications.d.ts +24 -0
- package/dist/shared/rpc-notifications.d.ts.map +1 -0
- package/dist/shared/rpc-server.d.ts +20 -0
- package/dist/shared/rpc-server.d.ts.map +1 -0
- package/dist/shared/rpc-types.d.ts +105 -0
- package/dist/shared/rpc-types.d.ts.map +1 -0
- package/dist/shared/rpc-utils.d.ts +19 -0
- package/dist/shared/rpc-utils.d.ts.map +1 -0
- package/dist/shared/sqlite-helpers.d.ts +16 -0
- package/dist/shared/sqlite-helpers.d.ts.map +1 -0
- package/dist/shared/sqlite.d.ts +43 -0
- package/dist/shared/sqlite.d.ts.map +1 -0
- package/dist/shared/stable-json.d.ts +21 -0
- package/dist/shared/stable-json.d.ts.map +1 -0
- package/dist/shared/subagent-runner.d.ts +208 -0
- package/dist/shared/subagent-runner.d.ts.map +1 -0
- package/dist/shared/system-directive.d.ts +3 -0
- package/dist/shared/system-directive.d.ts.map +1 -0
- package/dist/shared/tag-transcript.d.ts +66 -0
- package/dist/shared/tag-transcript.d.ts.map +1 -0
- package/dist/shared/transcript-opencode.d.ts +71 -0
- package/dist/shared/transcript-opencode.d.ts.map +1 -0
- package/dist/shared/transcript.d.ts +212 -0
- package/dist/shared/transcript.d.ts.map +1 -0
- package/dist/shared/tui-config.d.ts +10 -0
- package/dist/shared/tui-config.d.ts.map +1 -0
- package/dist/tools/ctx-expand/constants.d.ts +3 -0
- package/dist/tools/ctx-expand/constants.d.ts.map +1 -0
- package/dist/tools/ctx-expand/index.d.ts +2 -0
- package/dist/tools/ctx-expand/index.d.ts.map +1 -0
- package/dist/tools/ctx-expand/tools.d.ts +3 -0
- package/dist/tools/ctx-expand/tools.d.ts.map +1 -0
- package/dist/tools/ctx-expand/types.d.ts +5 -0
- package/dist/tools/ctx-expand/types.d.ts.map +1 -0
- package/dist/tools/ctx-memory/constants.d.ts +4 -0
- package/dist/tools/ctx-memory/constants.d.ts.map +1 -0
- package/dist/tools/ctx-memory/index.d.ts +4 -0
- package/dist/tools/ctx-memory/index.d.ts.map +1 -0
- package/dist/tools/ctx-memory/tools.d.ts +4 -0
- package/dist/tools/ctx-memory/tools.d.ts.map +1 -0
- package/dist/tools/ctx-memory/types.d.ts +35 -0
- package/dist/tools/ctx-memory/types.d.ts.map +1 -0
- package/dist/tools/ctx-note/constants.d.ts +2 -0
- package/dist/tools/ctx-note/constants.d.ts.map +1 -0
- package/dist/tools/ctx-note/index.d.ts +4 -0
- package/dist/tools/ctx-note/index.d.ts.map +1 -0
- package/dist/tools/ctx-note/tools.d.ts +15 -0
- package/dist/tools/ctx-note/tools.d.ts.map +1 -0
- package/dist/tools/ctx-note/types.d.ts +9 -0
- package/dist/tools/ctx-note/types.d.ts.map +1 -0
- package/dist/tools/ctx-reduce/constants.d.ts +2 -0
- package/dist/tools/ctx-reduce/constants.d.ts.map +1 -0
- package/dist/tools/ctx-reduce/index.d.ts +4 -0
- package/dist/tools/ctx-reduce/index.d.ts.map +1 -0
- package/dist/tools/ctx-reduce/tools.d.ts +9 -0
- package/dist/tools/ctx-reduce/tools.d.ts.map +1 -0
- package/dist/tools/ctx-reduce/types.d.ts +4 -0
- package/dist/tools/ctx-reduce/types.d.ts.map +1 -0
- package/dist/tools/ctx-search/constants.d.ts +4 -0
- package/dist/tools/ctx-search/constants.d.ts.map +1 -0
- package/dist/tools/ctx-search/index.d.ts +4 -0
- package/dist/tools/ctx-search/index.d.ts.map +1 -0
- package/dist/tools/ctx-search/tools.d.ts +4 -0
- package/dist/tools/ctx-search/tools.d.ts.map +1 -0
- package/dist/tools/ctx-search/types.d.ts +34 -0
- package/dist/tools/ctx-search/types.d.ts.map +1 -0
- package/dist/tools/index.d.ts +6 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tui/data/context-db.d.ts +36 -0
- package/dist/tui/data/context-db.d.ts.map +1 -0
- package/package.json +80 -0
- package/src/shared/announcement.test.ts +143 -0
- package/src/shared/announcement.ts +97 -0
- package/src/shared/assistant-message-extractor.ts +74 -0
- package/src/shared/bounded-session-map.test.ts +97 -0
- package/src/shared/bounded-session-map.ts +84 -0
- package/src/shared/conflict-detector.test.ts +232 -0
- package/src/shared/conflict-detector.ts +371 -0
- package/src/shared/conflict-fixer.test.ts +124 -0
- package/src/shared/conflict-fixer.ts +222 -0
- package/src/shared/data-path.test.ts +159 -0
- package/src/shared/data-path.ts +155 -0
- package/src/shared/error-message.test.ts +94 -0
- package/src/shared/error-message.ts +115 -0
- package/src/shared/format-bytes.ts +5 -0
- package/src/shared/format-threshold.ts +28 -0
- package/src/shared/harness.ts +61 -0
- package/src/shared/index.ts +5 -0
- package/src/shared/internal-initiator-marker.ts +1 -0
- package/src/shared/jsonc-parser.ts +138 -0
- package/src/shared/logger.ts +94 -0
- package/src/shared/model-requirements.ts +86 -0
- package/src/shared/model-suggestion-retry.test.ts +251 -0
- package/src/shared/model-suggestion-retry.ts +348 -0
- package/src/shared/models-dev-cache.test.ts +394 -0
- package/src/shared/models-dev-cache.ts +337 -0
- package/src/shared/native-binding.ts +311 -0
- package/src/shared/normalize-sdk-response.ts +40 -0
- package/src/shared/opencode-compaction-detector.test.ts +222 -0
- package/src/shared/opencode-compaction-detector.ts +81 -0
- package/src/shared/opencode-config-dir-types.ts +15 -0
- package/src/shared/opencode-config-dir.ts +38 -0
- package/src/shared/record-type-guard.ts +3 -0
- package/src/shared/resolve-fallbacks.test.ts +136 -0
- package/src/shared/resolve-fallbacks.ts +76 -0
- package/src/shared/rpc-client.test.ts +161 -0
- package/src/shared/rpc-client.ts +183 -0
- package/src/shared/rpc-notifications.test.ts +20 -0
- package/src/shared/rpc-notifications.ts +53 -0
- package/src/shared/rpc-server.ts +174 -0
- package/src/shared/rpc-types.ts +104 -0
- package/src/shared/rpc-utils.ts +72 -0
- package/src/shared/session-messages-bounded.test.ts +112 -0
- package/src/shared/sqlite-helpers.ts +27 -0
- package/src/shared/sqlite.ts +134 -0
- package/src/shared/stable-json.test.ts +87 -0
- package/src/shared/stable-json.ts +37 -0
- package/src/shared/subagent-runner.ts +222 -0
- package/src/shared/system-directive.ts +9 -0
- package/src/shared/tag-transcript.ts +553 -0
- package/src/shared/transcript-opencode.ts +259 -0
- package/src/shared/transcript.ts +226 -0
- package/src/shared/tui-config.ts +99 -0
- package/src/tui/data/context-db.ts +303 -0
- package/src/tui/index.tsx +692 -0
- package/src/tui/slots/sidebar-content.tsx +482 -0
- package/src/tui/types/opencode-plugin-tui.d.ts +232 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"magic-context.d.ts","sourceRoot":"","sources":["../../../src/config/schema/magic-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,6BAA6B,QAAS,CAAC;AACpD,eAAO,MAAM,oCAAoC,KAAK,CAAC;AACvD,eAAO,MAAM,4BAA4B,SAAU,CAAC;AACpD,eAAO,MAAM,iCAAiC,OAAO,CAAC;AACtD,eAAO,MAAM,6BAA6B,4BAA4B,CAAC;AACvE,0EAA0E;AAC1E,eAAO,MAAM,wCAAwC,OAAO,CAAC;AAC7D,eAAO,MAAM,kCAAkC,IAAI,CAAC;AACpD,eAAO,MAAM,8BAA8B,SAAU,CAAC;AACtD;8FAC8F;AAC9F,eAAO,MAAM,4CAA4C,KAAK,CAAC;AAC/D;;yFAEyF;AACzF,eAAO,MAAM,qCAAqC,KAAK,CAAC;AACxD;+EAC+E;AAC/E,eAAO,MAAM,+BAA+B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAMlE,CAAC;AAEF,eAAO,MAAM,aAAa,iFAMhB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;;;EAAwB,CAAC;AACxD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,qBAAqB,EAAE,YAAY,EAK/C,CAAC;AAEF;;iEAEiE;AACjE,eAAO,MAAM,qBAAqB;;;;;;;GAEnB,CAAC;AAChB,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,wDAAwD;AACxD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;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gBAAgB,EAAE,MAAM,CAAC;SAC5B,CAAC;QACF;;;;;;;;;;;;WAYG;QACH,wBAAwB,EAAE;YACtB,OAAO,EAAE,OAAO,CAAC;YACjB,oEAAoE;YACpE,SAAS,EAAE,MAAM,CAAC;SACrB,CAAC;KACL,CAAC;IACF,SAAS,EAAE,eAAe,CAAC;IAC3B,MAAM,EAAE;QACJ,OAAO,EAAE,OAAO,CAAC;QACjB,uBAAuB,EAAE,MAAM,CAAC;QAChC,YAAY,EAAE,OAAO,CAAC;QACtB,mCAAmC,EAAE,MAAM,CAAC;KAC/C,CAAC;IACF,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC7B;AAED,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmO/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export interface SubstituteInput {
|
|
2
|
+
/** Raw config text before JSONC parsing. */
|
|
3
|
+
text: string;
|
|
4
|
+
/**
|
|
5
|
+
* Path of the config file the text came from. Used to resolve relative
|
|
6
|
+
* `{file:...}` references and to emit useful warnings. Pass undefined for
|
|
7
|
+
* virtual/synthetic inputs (tests) — in that case `{file:}` tokens with
|
|
8
|
+
* relative paths resolve against `cwd`, which is rarely what callers want,
|
|
9
|
+
* so callers should prefer passing a real path when one exists.
|
|
10
|
+
*/
|
|
11
|
+
configPath?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Project-level config files are untrusted repository input. Do not expand
|
|
14
|
+
* secret-bearing tokens there; leave them literal and warn instead.
|
|
15
|
+
*/
|
|
16
|
+
isProjectConfig?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface SubstituteResult {
|
|
19
|
+
/** Config text with all `{env:X}` and `{file:path}` tokens replaced. */
|
|
20
|
+
text: string;
|
|
21
|
+
/**
|
|
22
|
+
* Human-readable warnings for missing env vars, unreadable files, and
|
|
23
|
+
* unresolved tokens that fell back to empty string. Safe to surface to the
|
|
24
|
+
* user via logger/toast/startup notification.
|
|
25
|
+
*/
|
|
26
|
+
warnings: string[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Expand `{env:VAR}` and `{file:path}` tokens in raw config text.
|
|
30
|
+
*
|
|
31
|
+
* Mirrors OpenCode's `ConfigVariable.substitute` semantics so users can share
|
|
32
|
+
* the same patterns across `opencode.json(c)` and `magic-context.jsonc`:
|
|
33
|
+
* - `{env:VAR}` → `process.env.VAR` (trimmed key), JSON-escaped for safe inlining, empty string when missing
|
|
34
|
+
* - `{file:~/path}` → contents of `~/path`, JSON-escaped for safe inlining
|
|
35
|
+
* - `{file:./rel}` or `{file:rel}` → resolved against the config file's dir
|
|
36
|
+
* - `{file:/abs}` → resolved as absolute
|
|
37
|
+
*
|
|
38
|
+
* Unlike OpenCode we treat missing values as warnings rather than hard errors:
|
|
39
|
+
* magic-context config is less critical than the main OpenCode config, and a
|
|
40
|
+
* typo in an optional embedding key should not prevent the plugin from loading
|
|
41
|
+
* with other (valid) settings.
|
|
42
|
+
*
|
|
43
|
+
* File and env value substitution is JSON-escaped (wrapped then unwrapped
|
|
44
|
+
* through `JSON.stringify`) so line breaks, quotes, and backslashes survive
|
|
45
|
+
* the subsequent JSONC parse.
|
|
46
|
+
*/
|
|
47
|
+
export declare function substituteConfigVariables(input: SubstituteInput): SubstituteResult;
|
|
48
|
+
//# sourceMappingURL=variable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variable.d.ts","sourceRoot":"","sources":["../../src/config/variable.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,eAAe;IAC5B,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC7B,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,QAAQ,EAAE,MAAM,EAAE,CAAC;CACtB;AAKD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,eAAe,GAAG,gBAAgB,CAqGlF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/features/builtin-commands/commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,wBAAgB,8BAA8B,IAAI,oBAAoB,CAwBrE"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Config } from "@opencode-ai/sdk";
|
|
2
|
+
export declare const MAGIC_CONTEXT_COMMAND_NAMES: readonly ["ctx-status", "ctx-recomp", "ctx-flush", "ctx-aug", "ctx-dream"];
|
|
3
|
+
export type MagicContextCommandName = (typeof MAGIC_CONTEXT_COMMAND_NAMES)[number];
|
|
4
|
+
export type BuiltinCommandConfig = NonNullable<Config["command"]>;
|
|
5
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/features/builtin-commands/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,eAAO,MAAM,2BAA2B,4EAM9B,CAAC;AAEX,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AACnF,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compaction Marker Injection
|
|
3
|
+
*
|
|
4
|
+
* Injects compaction boundaries into OpenCode's SQLite DB so that
|
|
5
|
+
* `filterCompacted` stops at the historian boundary. After injection,
|
|
6
|
+
* the transform hook receives only post-boundary messages instead
|
|
7
|
+
* of the full session history.
|
|
8
|
+
*
|
|
9
|
+
* Always-on as of v0.21.4. Previously gated behind `compaction_markers`
|
|
10
|
+
* config (default true since v0.9.0); the knob was removed because the
|
|
11
|
+
* feature is required for sane transform performance.
|
|
12
|
+
*
|
|
13
|
+
* ## What gets injected (3 rows):
|
|
14
|
+
* 1. A `compaction` part on the boundary user message
|
|
15
|
+
* 2. A summary assistant message with `parentID` → boundary user message
|
|
16
|
+
* 3. A text part on that summary message containing a static placeholder
|
|
17
|
+
*
|
|
18
|
+
* The real `<session-history>` is injected by the transform pipeline via
|
|
19
|
+
* inject-compartments.ts. The marker exists solely to make filterCompacted
|
|
20
|
+
* stop at the boundary.
|
|
21
|
+
*
|
|
22
|
+
* ## How OpenCode's filterCompacted works:
|
|
23
|
+
* - Iterates newest→oldest
|
|
24
|
+
* - Stops when it finds a user message that:
|
|
25
|
+
* (a) has a part with type: "compaction"
|
|
26
|
+
* (b) has a completed summary assistant response (summary: true, finish: "stop")
|
|
27
|
+
* whose parentID matches that user message's id
|
|
28
|
+
*/
|
|
29
|
+
export declare function generateMessageId(timestampMs: number, counter?: bigint): string;
|
|
30
|
+
export declare function generatePartId(timestampMs: number, counter?: bigint): string;
|
|
31
|
+
export declare function closeCompactionMarkerDb(): void;
|
|
32
|
+
interface BoundaryUserMessage {
|
|
33
|
+
id: string;
|
|
34
|
+
timeCreated: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Find the nearest user message at or before the given raw ordinal.
|
|
38
|
+
* The boundary must be a user message for filterCompacted to work.
|
|
39
|
+
*
|
|
40
|
+
* Filters out compaction summary messages (summary=true, finish="stop")
|
|
41
|
+
* so ordinals stay consistent with readRawSessionMessagesFromDb.
|
|
42
|
+
*/
|
|
43
|
+
export declare function findBoundaryUserMessage(sessionId: string, endOrdinal: number): BoundaryUserMessage | null;
|
|
44
|
+
/**
|
|
45
|
+
* Check whether an OpenCode message ID still exists for a given session.
|
|
46
|
+
*
|
|
47
|
+
* Used by plan v6's deferred marker drain to validate that a deferred
|
|
48
|
+
* compaction-marker target hasn't been wiped by recomp / revert / partial
|
|
49
|
+
* recomp between publication and the consuming pass. Errors propagate
|
|
50
|
+
* (unlike the swallow-and-return-empty helpers in `read-session-db.ts`):
|
|
51
|
+
* the marker-manager wraps this call in its own try/catch so missing or
|
|
52
|
+
* locked OpenCode DBs become `retryable-failure` outcomes, not silent skips.
|
|
53
|
+
*
|
|
54
|
+
* Note: returns `{ id }` rather than a richer row shape because the only
|
|
55
|
+
* thing the caller needs is existence. If a future caller needs role or
|
|
56
|
+
* timestamps, widen the return type but keep the throw-on-failure contract.
|
|
57
|
+
*/
|
|
58
|
+
export declare function getOpenCodeMessageById(sessionId: string, messageId: string): {
|
|
59
|
+
id: string;
|
|
60
|
+
} | null;
|
|
61
|
+
interface CompactionMarkerState {
|
|
62
|
+
/** The user message ID that has the compaction part */
|
|
63
|
+
boundaryMessageId: string;
|
|
64
|
+
/** The summary assistant message ID we injected */
|
|
65
|
+
summaryMessageId: string;
|
|
66
|
+
/** The compaction part ID on the user message */
|
|
67
|
+
compactionPartId: string;
|
|
68
|
+
/** The text part ID on the summary message */
|
|
69
|
+
summaryPartId: string;
|
|
70
|
+
}
|
|
71
|
+
export interface InjectCompactionMarkerArgs {
|
|
72
|
+
sessionId: string;
|
|
73
|
+
/** Raw ordinal of the last compartmentalized message */
|
|
74
|
+
endOrdinal: number;
|
|
75
|
+
/** Summary text for the compaction summary message (static placeholder) */
|
|
76
|
+
summaryText: string;
|
|
77
|
+
/** Working directory for the session */
|
|
78
|
+
directory: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Inject a compaction marker into OpenCode's DB.
|
|
82
|
+
* Returns the marker state if successful, null if boundary couldn't be found.
|
|
83
|
+
*/
|
|
84
|
+
export declare function injectCompactionMarker(args: InjectCompactionMarkerArgs): CompactionMarkerState | null;
|
|
85
|
+
/**
|
|
86
|
+
* Remove an existing compaction marker (all 3 rows).
|
|
87
|
+
* Used when moving the boundary forward or on session cleanup.
|
|
88
|
+
*/
|
|
89
|
+
export declare function removeCompactionMarker(state: CompactionMarkerState): boolean;
|
|
90
|
+
export {};
|
|
91
|
+
//# sourceMappingURL=compaction-marker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compaction-marker.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/compaction-marker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAgCH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,SAAK,GAAG,MAAM,CAE3E;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,SAAK,GAAG,MAAM,CAExE;AAsGD,wBAAgB,uBAAuB,IAAI,IAAI,CAY9C;AAID,UAAU,mBAAmB;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACnC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACnB,mBAAmB,GAAG,IAAI,CAgC5B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CAClC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAClB;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAMvB;AAID,UAAU,qBAAqB;IAC3B,uDAAuD;IACvD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mDAAmD;IACnD,gBAAgB,EAAE,MAAM,CAAC;IACzB,iDAAiD;IACjD,gBAAgB,EAAE,MAAM,CAAC;IACzB,8CAA8C;IAC9C,aAAa,EAAE,MAAM,CAAC;CACzB;AAID,MAAM,WAAW,0BAA0B;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,UAAU,EAAE,MAAM,CAAC;IACnB,2EAA2E;IAC3E,WAAW,EAAE,MAAM,CAAC;IACpB,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAClC,IAAI,EAAE,0BAA0B,GACjC,qBAAqB,GAAG,IAAI,CAwF9B;AAID;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAgB5E"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Database } from "../../shared/sqlite";
|
|
2
|
+
interface CompactionHandler {
|
|
3
|
+
onCompacted(sessionId: string, db: Database): void;
|
|
4
|
+
}
|
|
5
|
+
export declare function createCompactionHandler(): CompactionHandler;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=compaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compaction.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/compaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGpD,UAAU,iBAAiB;IACvB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,GAAG,IAAI,CAAC;CACtD;AAED,wBAAgB,uBAAuB,IAAI,iBAAiB,CAY3D"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Database } from "../../shared/sqlite";
|
|
2
|
+
export declare const COMPARTMENT_LEASE_TTL_MS: number;
|
|
3
|
+
export declare const COMPARTMENT_LEASE_RENEWAL_MS: number;
|
|
4
|
+
export interface LeaseAcquired {
|
|
5
|
+
sessionId: string;
|
|
6
|
+
holderId: string;
|
|
7
|
+
acquiredAt: number;
|
|
8
|
+
expiresAt: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function acquireCompartmentLease(db: Database, sessionId: string, holderId: string): LeaseAcquired | null;
|
|
11
|
+
export declare function renewCompartmentLease(db: Database, sessionId: string, holderId: string): boolean;
|
|
12
|
+
export declare function releaseCompartmentLease(db: Database, sessionId: string, holderId: string): void;
|
|
13
|
+
export declare function isCompartmentLeaseHeld(db: Database, sessionId: string, holderId: string): boolean;
|
|
14
|
+
//# sourceMappingURL=compartment-lease.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compartment-lease.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/compartment-lease.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,eAAO,MAAM,wBAAwB,QAAgB,CAAC;AACtD,eAAO,MAAM,4BAA4B,QAAY,CAAC;AAEtD,MAAM,WAAW,aAAa;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,uBAAuB,CACnC,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACjB,aAAa,GAAG,IAAI,CAqBtB;AAED,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAWhG;AAED,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAK/F;AAED,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAOjG"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type { Database } from "../../shared/sqlite";
|
|
2
|
+
export interface Compartment {
|
|
3
|
+
id: number;
|
|
4
|
+
sessionId: string;
|
|
5
|
+
sequence: number;
|
|
6
|
+
startMessage: number;
|
|
7
|
+
endMessage: number;
|
|
8
|
+
startMessageId: string;
|
|
9
|
+
endMessageId: string;
|
|
10
|
+
title: string;
|
|
11
|
+
content: string;
|
|
12
|
+
createdAt: number;
|
|
13
|
+
}
|
|
14
|
+
export interface SessionFact {
|
|
15
|
+
id: number;
|
|
16
|
+
sessionId: string;
|
|
17
|
+
category: string;
|
|
18
|
+
content: string;
|
|
19
|
+
createdAt: number;
|
|
20
|
+
updatedAt: number;
|
|
21
|
+
}
|
|
22
|
+
export interface CompartmentInput {
|
|
23
|
+
sequence: number;
|
|
24
|
+
startMessage: number;
|
|
25
|
+
endMessage: number;
|
|
26
|
+
startMessageId: string;
|
|
27
|
+
endMessageId: string;
|
|
28
|
+
title: string;
|
|
29
|
+
content: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function getCompartments(db: Database, sessionId: string): Compartment[];
|
|
32
|
+
export declare function getLastCompartmentEndMessage(db: Database, sessionId: string): number;
|
|
33
|
+
/**
|
|
34
|
+
* Look up compartments whose stored `end_message_id` matches the given
|
|
35
|
+
* OpenCode message id. Returns an ARRAY — schema only enforces
|
|
36
|
+
* `UNIQUE(session_id, sequence)`, NOT `(session_id, end_message_id)`, so
|
|
37
|
+
* a future bug could in principle leave two rows sharing a boundary. The
|
|
38
|
+
* marker drain's `validatePendingTarget` treats `length > 1` as a schema
|
|
39
|
+
* invariant violation and bails to stale-skip (plan v6 section 5).
|
|
40
|
+
*
|
|
41
|
+
* Normal path: exactly one match → caller treats it as the target row.
|
|
42
|
+
*/
|
|
43
|
+
export declare function getCompartmentsByEndMessageId(db: Database, sessionId: string, endMessageId: string): Compartment[];
|
|
44
|
+
export declare function replaceAllCompartments(db: Database, sessionId: string, compartments: CompartmentInput[]): void;
|
|
45
|
+
/**
|
|
46
|
+
* Append new compartments without deleting existing ones.
|
|
47
|
+
* Used by the incremental runner where existing compartments are preserved
|
|
48
|
+
* and only new compartments for the latest chunk are added.
|
|
49
|
+
*/
|
|
50
|
+
export declare function appendCompartments(db: Database, sessionId: string, compartments: CompartmentInput[]): void;
|
|
51
|
+
/**
|
|
52
|
+
* Replace session facts without touching compartments.
|
|
53
|
+
* Facts are fully re-normalized by the historian on each pass,
|
|
54
|
+
* so they always need a full replacement.
|
|
55
|
+
*/
|
|
56
|
+
export declare function replaceSessionFacts(db: Database, sessionId: string, facts: Array<{
|
|
57
|
+
category: string;
|
|
58
|
+
content: string;
|
|
59
|
+
}>): void;
|
|
60
|
+
export declare function getSessionFacts(db: Database, sessionId: string): SessionFact[];
|
|
61
|
+
export declare function replaceAllCompartmentState(db: Database, sessionId: string, compartments: CompartmentInput[], facts: Array<{
|
|
62
|
+
category: string;
|
|
63
|
+
content: string;
|
|
64
|
+
}>): void;
|
|
65
|
+
export declare function replaceAllCompartmentStateAndBumpDepth(db: Database, holderId: string, sessionId: string, compartments: CompartmentInput[], facts: Array<{
|
|
66
|
+
category: string;
|
|
67
|
+
content: string;
|
|
68
|
+
}>, depthStartOrdinal: number, depthEndOrdinal: number): boolean;
|
|
69
|
+
export interface CompartmentDateRanges {
|
|
70
|
+
/** Map compartment id → `{ start: "YYYY-MM-DD", end: "YYYY-MM-DD" }` */
|
|
71
|
+
byId: Map<number, {
|
|
72
|
+
start: string;
|
|
73
|
+
end: string;
|
|
74
|
+
}>;
|
|
75
|
+
}
|
|
76
|
+
export declare function buildCompartmentBlock(compartments: Compartment[], facts: SessionFact[], memoryBlock?: string, dateRanges?: CompartmentDateRanges): string;
|
|
77
|
+
export interface RecompStaging {
|
|
78
|
+
compartments: CompartmentInput[];
|
|
79
|
+
facts: Array<{
|
|
80
|
+
category: string;
|
|
81
|
+
content: string;
|
|
82
|
+
}>;
|
|
83
|
+
passCount: number;
|
|
84
|
+
lastEndMessage: number;
|
|
85
|
+
}
|
|
86
|
+
/** Append one pass's results to the staging tables. */
|
|
87
|
+
export declare function saveRecompStagingPass(db: Database, sessionId: string, passNumber: number, compartments: CompartmentInput[], facts: Array<{
|
|
88
|
+
category: string;
|
|
89
|
+
content: string;
|
|
90
|
+
}>): void;
|
|
91
|
+
/** Read existing staging data for resume. Returns null if no staging exists. */
|
|
92
|
+
export declare function getRecompStaging(db: Database, sessionId: string): RecompStaging | null;
|
|
93
|
+
/** Atomically promote staging → real tables, then clear staging. */
|
|
94
|
+
export declare function promoteRecompStaging(db: Database, sessionId: string, holderId?: string): {
|
|
95
|
+
compartments: CompartmentInput[];
|
|
96
|
+
facts: Array<{
|
|
97
|
+
category: string;
|
|
98
|
+
content: string;
|
|
99
|
+
}>;
|
|
100
|
+
} | null;
|
|
101
|
+
/**
|
|
102
|
+
* Clear memory_block_cache for ALL sessions so every active session
|
|
103
|
+
* re-renders its memory block on the next cache-busting pass.
|
|
104
|
+
* Called after ctx_memory write/delete mutations.
|
|
105
|
+
*/
|
|
106
|
+
export declare function invalidateAllMemoryBlockCaches(db: Database): void;
|
|
107
|
+
/** Clear staging tables for a session (on cancel/abandon or after successful promote). */
|
|
108
|
+
export declare function clearRecompStaging(db: Database, sessionId: string): void;
|
|
109
|
+
/**
|
|
110
|
+
* Returns the stored partial recomp range for this session, or null when the
|
|
111
|
+
* active staging (if any) is for a full recomp.
|
|
112
|
+
*
|
|
113
|
+
* A zero-valued row means "no partial range recorded" — either no staging or
|
|
114
|
+
* full-recomp staging.
|
|
115
|
+
*/
|
|
116
|
+
export declare function getRecompPartialRange(db: Database, sessionId: string): {
|
|
117
|
+
start: number;
|
|
118
|
+
end: number;
|
|
119
|
+
} | null;
|
|
120
|
+
/**
|
|
121
|
+
* Record the active partial recomp range. Must be called inside or alongside
|
|
122
|
+
* saveRecompStagingPass so staging and range marker stay in sync.
|
|
123
|
+
*/
|
|
124
|
+
export declare function setRecompPartialRange(db: Database, sessionId: string, range: {
|
|
125
|
+
start: number;
|
|
126
|
+
end: number;
|
|
127
|
+
} | null): void;
|
|
128
|
+
export declare function escapeXmlAttr(s: string): string;
|
|
129
|
+
export declare function escapeXmlContent(s: string): string;
|
|
130
|
+
//# sourceMappingURL=compartment-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compartment-storage.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/compartment-storage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAkC,MAAM,qBAAqB,CAAC;AA6BpF,MAAM,WAAW,WAAW;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,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,MAAM,GAAG,MAAM,CAElD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Database, Statement as PreparedStatement } from "../../shared/sqlite";
|
|
2
|
+
export declare function getIncrementDepthStatement(db: Database): PreparedStatement;
|
|
3
|
+
export declare function incrementCompressionDepth(db: Database, sessionId: string, startOrdinal: number, endOrdinal: number): void;
|
|
4
|
+
export declare function getAverageCompressionDepth(db: Database, sessionId: string, startOrdinal: number, endOrdinal: number): number;
|
|
5
|
+
export declare function getMaxCompressionDepth(db: Database, sessionId: string): number;
|
|
6
|
+
export declare function clearCompressionDepth(db: Database, sessionId: string): void;
|
|
7
|
+
/**
|
|
8
|
+
* Clear compression depth counters for a specific message range.
|
|
9
|
+
* Used by partial recomp: rebuilt compartments start fresh at depth 0, so
|
|
10
|
+
* depth rows for the rebuilt ordinals must be removed. Existing depth for
|
|
11
|
+
* ordinals outside the range (prior and tail compartments) is preserved.
|
|
12
|
+
*/
|
|
13
|
+
export declare function clearCompressionDepthRange(db: Database, sessionId: string, startOrdinal: number, endOrdinal: number): void;
|
|
14
|
+
//# sourceMappingURL=compression-depth-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compression-depth-storage.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/compression-depth-storage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAepF,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,QAAQ,GAAG,iBAAiB,CAS1E;AAiCD,wBAAgB,yBAAyB,CACrC,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,GACnB,IAAI,CAWN;AAED,wBAAgB,0BAA0B,CACtC,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,GACnB,MAAM,CAaR;AAED,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAG9E;AAED,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAE3E;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACtC,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,GACnB,IAAI,CAON"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/defaults.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Database } from "../../../shared/sqlite";
|
|
2
|
+
export declare function isLeaseActive(db: Database): boolean;
|
|
3
|
+
export declare function getLeaseHolder(db: Database): string | null;
|
|
4
|
+
export declare function peekLeaseHolderAndExpiry(db: Database, expectedHolder: string): boolean;
|
|
5
|
+
export declare function acquireLease(db: Database, holderId: string): boolean;
|
|
6
|
+
export declare function renewLease(db: Database, holderId: string): boolean;
|
|
7
|
+
export declare function releaseLease(db: Database, holderId: string): void;
|
|
8
|
+
//# sourceMappingURL=lease.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lease.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/lease.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAkBvD,wBAAgB,aAAa,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAGnD;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI,CAE1D;AAED,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAOtF;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAepE;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAWlE;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAUjE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Database } from "../../../shared/sqlite";
|
|
2
|
+
export interface DreamQueueEntry {
|
|
3
|
+
id: number;
|
|
4
|
+
/** Project identity (e.g. "git:<sha>"), NOT a filesystem path */
|
|
5
|
+
projectIdentity: string;
|
|
6
|
+
reason: string;
|
|
7
|
+
enqueuedAt: number;
|
|
8
|
+
startedAt: number | null;
|
|
9
|
+
}
|
|
10
|
+
export declare function ensureDreamQueueTable(db: Database): void;
|
|
11
|
+
/** Enqueue a project for dreaming. Skips if the same project already has any queue entry (queued or running).
|
|
12
|
+
*
|
|
13
|
+
* @param force - When true (e.g. manual /ctx-dream), uses the lease TTL (2 min) as the stale threshold
|
|
14
|
+
* instead of the full 2-hour max-runtime window. This lets users re-trigger dreaming after a crash or
|
|
15
|
+
* restart even when the previous queue entry was started only seconds ago.
|
|
16
|
+
*/
|
|
17
|
+
export declare function enqueueDream(db: Database, projectIdentity: string, reason: string, force?: boolean): DreamQueueEntry | null;
|
|
18
|
+
/** Peek at the next unstarted entry without claiming it.
|
|
19
|
+
*
|
|
20
|
+
* @param projectIdentity - When provided, only matches entries for this project.
|
|
21
|
+
* This is critical for cross-process coexistence: each running OpenCode/Pi
|
|
22
|
+
* process registers exactly one project, so it must only drain entries that
|
|
23
|
+
* belong to it. Without this filter, Pi (running in project A) would dequeue
|
|
24
|
+
* queue entries for project B and try to dream B with Pi's runner — which
|
|
25
|
+
* either spawns `pi` in a directory that doesn't exist (the `git:<sha>`
|
|
26
|
+
* identity string) or, even if it succeeded, runs the wrong harness for that
|
|
27
|
+
* project.
|
|
28
|
+
*/
|
|
29
|
+
export declare function peekQueue(db: Database, projectIdentity?: string): DreamQueueEntry | null;
|
|
30
|
+
/** Claim the next unstarted entry atomically by marking started_at. Returns null if queue is empty.
|
|
31
|
+
*
|
|
32
|
+
* @param projectIdentity - When provided, only dequeues entries for this project.
|
|
33
|
+
* See `peekQueue` for the cross-process coexistence rationale.
|
|
34
|
+
*/
|
|
35
|
+
export declare function dequeueNext(db: Database, projectIdentity?: string): DreamQueueEntry | null;
|
|
36
|
+
/** Remove a completed or failed entry from the queue. */
|
|
37
|
+
export declare function removeDreamEntry(db: Database, id: number): void;
|
|
38
|
+
/** Reset a dequeued entry so it can be retried (e.g., after lease failure). Increments retry_count. */
|
|
39
|
+
export declare function resetDreamEntry(db: Database, id: number): void;
|
|
40
|
+
/** Get the retry count for a queue entry. */
|
|
41
|
+
export declare function getEntryRetryCount(db: Database, id: number): number;
|
|
42
|
+
/** Clear stale started entries (stuck for more than maxAgeMs). */
|
|
43
|
+
export declare function clearStaleEntries(db: Database, maxAgeMs: number): number;
|
|
44
|
+
//# sourceMappingURL=queue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGvD,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,iEAAiE;IACjE,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAexD;AAaD;;;;;GAKG;AACH,wBAAgB,YAAY,CACxB,EAAE,EAAE,QAAQ,EACZ,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,MAAM,EACd,KAAK,UAAQ,GACd,eAAe,GAAG,IAAI,CAsCxB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,QAAQ,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CA4BxF;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,QAAQ,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAa1F;AAED,yDAAyD;AACzD,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAE/D;AAED,uGAAuG;AACvG,wBAAgB,eAAe,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAI9D;AAED,6CAA6C;AAC7C,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAOnE;AAED,kEAAkE;AAClE,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAMxE"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { DreamingTask } from "../../../config/schema/magic-context";
|
|
2
|
+
import type { PluginContext } from "../../../plugin/types";
|
|
3
|
+
import { Database } from "../../../shared/sqlite";
|
|
4
|
+
interface ExperimentalPinKeyFilesConfig {
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
token_budget: number;
|
|
7
|
+
min_reads: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function registerDreamProjectDirectory(projectIdentity: string, directory: string): void;
|
|
10
|
+
export interface DreamRunResult {
|
|
11
|
+
startedAt: number;
|
|
12
|
+
finishedAt: number;
|
|
13
|
+
holderId: string;
|
|
14
|
+
smartNotesSurfaced: number;
|
|
15
|
+
smartNotesPending: number;
|
|
16
|
+
tasks: {
|
|
17
|
+
name: string;
|
|
18
|
+
durationMs: number;
|
|
19
|
+
result: unknown;
|
|
20
|
+
error?: string;
|
|
21
|
+
}[];
|
|
22
|
+
}
|
|
23
|
+
export declare function runDream(args: {
|
|
24
|
+
db: Database;
|
|
25
|
+
client: PluginContext["client"];
|
|
26
|
+
/** Project identity (e.g. "git:<sha>"), NOT a filesystem path. Used for dream state keys. */
|
|
27
|
+
projectIdentity: string;
|
|
28
|
+
tasks: DreamingTask[];
|
|
29
|
+
taskTimeoutMinutes: number;
|
|
30
|
+
maxRuntimeMinutes: number;
|
|
31
|
+
parentSessionId?: string;
|
|
32
|
+
sessionDirectory?: string;
|
|
33
|
+
experimentalUserMemories?: {
|
|
34
|
+
enabled: boolean;
|
|
35
|
+
promotionThreshold: number;
|
|
36
|
+
};
|
|
37
|
+
experimentalPinKeyFiles?: ExperimentalPinKeyFilesConfig;
|
|
38
|
+
/**
|
|
39
|
+
* Resolved fallback chain for dreamer subagent calls. When the primary
|
|
40
|
+
* `dreamer.model` fails (auth, model-not-found, rate limit, transient
|
|
41
|
+
* network), each entry is tried in order before giving up. Empty/undefined
|
|
42
|
+
* disables fallback iteration (legacy single-suggestion-retry only).
|
|
43
|
+
*
|
|
44
|
+
* Caller (`processDreamQueue` / direct caller) resolves this via
|
|
45
|
+
* `resolveFallbackChain(DREAMER_AGENT, config.dreamer.fallback_models)`.
|
|
46
|
+
*/
|
|
47
|
+
fallbackModels?: readonly string[];
|
|
48
|
+
}): Promise<DreamRunResult>;
|
|
49
|
+
export declare function processDreamQueue(args: {
|
|
50
|
+
db: Database;
|
|
51
|
+
client: PluginContext["client"];
|
|
52
|
+
tasks: DreamingTask[];
|
|
53
|
+
taskTimeoutMinutes: number;
|
|
54
|
+
maxRuntimeMinutes: number;
|
|
55
|
+
experimentalUserMemories?: {
|
|
56
|
+
enabled: boolean;
|
|
57
|
+
promotionThreshold: number;
|
|
58
|
+
};
|
|
59
|
+
experimentalPinKeyFiles?: ExperimentalPinKeyFilesConfig;
|
|
60
|
+
/**
|
|
61
|
+
* Optional project identity filter — when provided, only entries belonging
|
|
62
|
+
* to this project are dequeued. Each running OpenCode/Pi process registers
|
|
63
|
+
* exactly one project, and the host's dreamer client (and `pi` runner, in
|
|
64
|
+
* Pi's case) is project-specific. Without this filter, a Pi process running
|
|
65
|
+
* for project A would dequeue queue entries for project B and try to
|
|
66
|
+
* `posix_spawn 'pi'` in B's `git:<sha>` identity string as a directory,
|
|
67
|
+
* failing with ENOENT every cycle.
|
|
68
|
+
*
|
|
69
|
+
* Callers should pass this whenever they own a single project — both the
|
|
70
|
+
* scheduled timer tick (`sweepProject`) and the `/ctx-dream` command
|
|
71
|
+
* handler. Tests pass `undefined` to keep the legacy "dequeue any" semantics.
|
|
72
|
+
*/
|
|
73
|
+
projectIdentity?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Resolved Dreamer fallback chain. See `runDream` for semantics. Callers
|
|
76
|
+
* compute via `resolveFallbackChain(DREAMER_AGENT, pluginConfig.dreamer?.fallback_models)`.
|
|
77
|
+
*/
|
|
78
|
+
fallbackModels?: readonly string[];
|
|
79
|
+
}): Promise<DreamRunResult | null>;
|
|
80
|
+
export {};
|
|
81
|
+
//# sourceMappingURL=runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/runner.ts"],"names":[],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;;OAQG;IACH,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC,GAAG,OAAO,CAAC,cAAc,CAAC,CAkiB1B;AA2OD,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC1C,EAAE,EAAE,QAAQ,CAAC;IACb,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChC,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,wBAAwB,CAAC,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,kBAAkB,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5E,uBAAuB,CAAC,EAAE,6BAA6B,CAAC;IACxD;;;;;;;;;;;;OAYG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CA0DjC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Database } from "../../../shared/sqlite";
|
|
2
|
+
export interface DreamScheduleConfig {
|
|
3
|
+
/** Time range string like "02:00-06:00" */
|
|
4
|
+
schedule: string;
|
|
5
|
+
}
|
|
6
|
+
/** Parse "HH:MM-HH:MM" into start/end minutes since midnight. */
|
|
7
|
+
export declare function parseScheduleWindow(schedule: string): {
|
|
8
|
+
startMinutes: number;
|
|
9
|
+
endMinutes: number;
|
|
10
|
+
} | null;
|
|
11
|
+
/** Check if the current time is inside the schedule window. Handles overnight windows (e.g. 23:00-05:00). */
|
|
12
|
+
export declare function isInScheduleWindow(schedule: string, now?: Date): boolean;
|
|
13
|
+
/** Find projects that have memory updates or pending smart notes since their per-project last dream time. */
|
|
14
|
+
export declare function findProjectsNeedingDream(db: Database): string[];
|
|
15
|
+
/**
|
|
16
|
+
* Check schedule and enqueue eligible projects.
|
|
17
|
+
* Called periodically from the hook layer (debounced to once per hour).
|
|
18
|
+
* Returns the number of projects enqueued.
|
|
19
|
+
*
|
|
20
|
+
* @param ownProjectIdentity - When provided, restricts enqueue to this project.
|
|
21
|
+
* Each running OpenCode/Pi process registers exactly one project, so it
|
|
22
|
+
* must only enqueue work for THAT project — otherwise a process running for
|
|
23
|
+
* project A would enqueue dream entries for projects B, C, D... that this
|
|
24
|
+
* host can't actually drain (it has the wrong client + the wrong
|
|
25
|
+
* subagent-runner directory). Without the filter, a Pi process running for
|
|
26
|
+
* `opencode-anthropic-auth` ends up trying to spawn `pi --print` for
|
|
27
|
+
* `opencode-xtra` (a project Pi was never opened in), failing every cycle.
|
|
28
|
+
*
|
|
29
|
+
* When undefined, the legacy "enqueue everything that needs a dream"
|
|
30
|
+
* behavior is preserved for tests and any future single-host caller.
|
|
31
|
+
*/
|
|
32
|
+
export declare function checkScheduleAndEnqueue(db: Database, schedule: string, ownProjectIdentity?: string): number;
|
|
33
|
+
//# sourceMappingURL=scheduler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/scheduler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAIvD,MAAM,WAAW,mBAAmB;IAChC,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,iEAAiE;AACjE,wBAAgB,mBAAmB,CAC/B,QAAQ,EAAE,MAAM,GACjB;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAkBrD;AAaD,6GAA6G;AAC7G,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,GAAE,IAAiB,GAAG,OAAO,CAYpF;AAED,6GAA6G;AAC7G,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,QAAQ,GAAG,MAAM,EAAE,CAkD/D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,uBAAuB,CACnC,EAAE,EAAE,QAAQ,EACZ,QAAQ,EAAE,MAAM,EAChB,kBAAkB,CAAC,EAAE,MAAM,GAC5B,MAAM,CAgCR"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Database } from "../../../shared/sqlite";
|
|
2
|
+
export interface DreamRunTaskSummary {
|
|
3
|
+
name: string;
|
|
4
|
+
durationMs: number;
|
|
5
|
+
resultChars: number;
|
|
6
|
+
error?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface DreamRunMemoryChanges {
|
|
9
|
+
written: number;
|
|
10
|
+
deleted: number;
|
|
11
|
+
archived: number;
|
|
12
|
+
merged: number;
|
|
13
|
+
}
|
|
14
|
+
export interface DreamRunRow {
|
|
15
|
+
id: number;
|
|
16
|
+
project_path: string;
|
|
17
|
+
started_at: number;
|
|
18
|
+
finished_at: number;
|
|
19
|
+
holder_id: string;
|
|
20
|
+
tasks_json: string;
|
|
21
|
+
tasks_succeeded: number;
|
|
22
|
+
tasks_failed: number;
|
|
23
|
+
smart_notes_surfaced: number;
|
|
24
|
+
smart_notes_pending: number;
|
|
25
|
+
memory_changes_json: string | null;
|
|
26
|
+
}
|
|
27
|
+
export interface DreamRunInput {
|
|
28
|
+
projectPath: string;
|
|
29
|
+
startedAt: number;
|
|
30
|
+
finishedAt: number;
|
|
31
|
+
holderId: string;
|
|
32
|
+
tasks: DreamRunTaskSummary[];
|
|
33
|
+
tasksSucceeded: number;
|
|
34
|
+
tasksFailed: number;
|
|
35
|
+
smartNotesSurfaced: number;
|
|
36
|
+
smartNotesPending: number;
|
|
37
|
+
memoryChanges?: DreamRunMemoryChanges | null;
|
|
38
|
+
}
|
|
39
|
+
export declare function insertDreamRun(db: Database, run: DreamRunInput): void;
|
|
40
|
+
export declare function getDreamRuns(db: Database, projectPath: string, limit?: number): DreamRunRow[];
|
|
41
|
+
//# sourceMappingURL=storage-dream-runs.d.ts.map
|