@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,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conflict warning for Desktop mode when magic-context is disabled.
|
|
3
|
+
*
|
|
4
|
+
* - When conflicts detected: reads Desktop app state → finds active session → sends ignored warning
|
|
5
|
+
* - When no conflicts: cleans up any leftover warning messages from previous runs
|
|
6
|
+
*
|
|
7
|
+
* TUI handles this via a startup dialog — this covers Desktop only.
|
|
8
|
+
*/
|
|
9
|
+
import type { ConflictResult } from "../shared/conflict-detector";
|
|
10
|
+
/**
|
|
11
|
+
* Send an ignored notification to the active Desktop session at plugin startup.
|
|
12
|
+
*/
|
|
13
|
+
export declare function sendConflictWarning(client: unknown, directory: string, conflictResult: ConflictResult): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Clean up leftover conflict warning messages from previous disabled runs.
|
|
16
|
+
* Called at startup when no conflicts exist (plugin is enabled normally).
|
|
17
|
+
*/
|
|
18
|
+
export declare function cleanupConflictWarnings(client: unknown, directory: string, serverUrl?: string): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Notify the user that tui.json was configured with the sidebar plugin.
|
|
21
|
+
* Sends an ignored message that auto-deletes after 1 second.
|
|
22
|
+
*/
|
|
23
|
+
export declare function sendTuiSetupNotification(client: unknown, directory: string, serverUrl?: string): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Desktop startup announcement: post a one-shot ignored message describing
|
|
26
|
+
* what's new in this release. Mirrors the TUI's RPC-driven dialog path so both
|
|
27
|
+
* surfaces deliver the same announcement once per ANNOUNCEMENT_VERSION.
|
|
28
|
+
*
|
|
29
|
+
* Persistence lives in `getMagicContextStorageDir()/last_announced_version`,
|
|
30
|
+
* shared with the TUI handlers and the Pi plugin so a dismissal in any harness
|
|
31
|
+
* suppresses the others for the same announcement.
|
|
32
|
+
*/
|
|
33
|
+
export declare function sendStartupAnnouncement(client: unknown, directory: string, version: string, features: ReadonlyArray<string>, footer: string, markSeen: (version: string) => void): Promise<void>;
|
|
34
|
+
//# sourceMappingURL=conflict-warning-hook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conflict-warning-hook.d.ts","sourceRoot":"","sources":["../../src/plugin/conflict-warning-hook.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAoLlE;;GAEG;AACH,wBAAsB,mBAAmB,CACrC,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,cAAc,GAC/B,OAAO,CAAC,IAAI,CAAC,CA+Cf;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,CACzC,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,EACjB,SAAS,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAqHf;AAkCD;;;GAGG;AACH,wBAAsB,wBAAwB,CAC1C,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,EACjB,SAAS,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAkEf;AAED;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,CACzC,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,EAC/B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GACpC,OAAO,CAAC,IAAI,CAAC,CA8Df"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { DreamerConfig } from "../config/schema/magic-context";
|
|
2
|
+
import type { Database } from "../shared/sqlite";
|
|
3
|
+
import type { PluginContext } from "./types";
|
|
4
|
+
/**
|
|
5
|
+
* Per-project work registered with the timer. The timer is a process-wide
|
|
6
|
+
* singleton, but Desktop OpenCode can load the same plugin once per project
|
|
7
|
+
* within one process — every load needs its directory's git commits indexed,
|
|
8
|
+
* its dream schedule checked, and its experimental config respected.
|
|
9
|
+
*/
|
|
10
|
+
interface ProjectRegistration {
|
|
11
|
+
directory: string;
|
|
12
|
+
projectIdentity: string;
|
|
13
|
+
client: PluginContext["client"];
|
|
14
|
+
dreamerConfig?: DreamerConfig;
|
|
15
|
+
experimentalUserMemories?: {
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
promotionThreshold: number;
|
|
18
|
+
};
|
|
19
|
+
experimentalPinKeyFiles?: {
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
token_budget: number;
|
|
22
|
+
min_reads: number;
|
|
23
|
+
};
|
|
24
|
+
gitCommitIndexing?: {
|
|
25
|
+
enabled: boolean;
|
|
26
|
+
since_days: number;
|
|
27
|
+
max_commits: number;
|
|
28
|
+
};
|
|
29
|
+
ensureRegistered: (directory: string, db: Database) => Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Register the calling project with the process-wide dream + maintenance
|
|
33
|
+
* timer. The timer itself is a singleton (we only need one setInterval per
|
|
34
|
+
* process), but every registered project gets its per-directory work — git
|
|
35
|
+
* commit indexing, dream schedule check, dream queue processing — on each
|
|
36
|
+
* tick. The first registration also kicks off an immediate startup tick so
|
|
37
|
+
* fresh installs and restarts don't wait 15 minutes for first-time indexing.
|
|
38
|
+
*
|
|
39
|
+
* Returns a cleanup that removes this project's registration. The timer
|
|
40
|
+
* itself stops only when the last project unregisters.
|
|
41
|
+
*/
|
|
42
|
+
export declare function startDreamScheduleTimer(args: ProjectRegistration): Promise<(() => void) | undefined>;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=dream-timer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dream-timer.d.ts","sourceRoot":"","sources":["../../src/plugin/dream-timer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAapE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAK7C;;;;;GAKG;AACH,UAAU,mBAAmB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChC,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,wBAAwB,CAAC,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,kBAAkB,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5E,uBAAuB,CAAC,EAAE;QACtB,OAAO,EAAE,OAAO,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;QACrB,SAAS,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,iBAAiB,CAAC,EAAE;QAChB,OAAO,EAAE,OAAO,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,gBAAgB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACxE;AAQD;;;;;;;;;;GAUG;AACH,wBAAsB,uBAAuB,CACzC,IAAI,EAAE,mBAAmB,GAC1B,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC,CA4DnC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { EmbeddingConfig } from "../config/schema/magic-context";
|
|
2
|
+
import type { Database } from "../shared/sqlite";
|
|
3
|
+
export type LoadOutcome = "ok" | "project-file-parse-error" | "project-file-io-error" | "schema-recovery" | "substitution-failure";
|
|
4
|
+
export interface EmbeddingLoadResultDetailed<TConfig extends {
|
|
5
|
+
embedding: EmbeddingConfig;
|
|
6
|
+
}> {
|
|
7
|
+
config: TConfig;
|
|
8
|
+
loadOutcome: LoadOutcome;
|
|
9
|
+
sources: {
|
|
10
|
+
userConfig: LoadOutcome;
|
|
11
|
+
projectConfig: LoadOutcome;
|
|
12
|
+
};
|
|
13
|
+
substitutionFailures: Array<{
|
|
14
|
+
keyPath: string;
|
|
15
|
+
source: "user" | "project";
|
|
16
|
+
message: string;
|
|
17
|
+
}>;
|
|
18
|
+
recoveredTopLevelKeys: string[];
|
|
19
|
+
}
|
|
20
|
+
export declare const EMBEDDING_AFFECTING_KEYS: Set<string>;
|
|
21
|
+
export declare const EMBEDDING_AFFECTING_TOP_LEVEL_KEYS: Set<string>;
|
|
22
|
+
export declare function isConfigLoadUntrusted(detailed: EmbeddingLoadResultDetailed<{
|
|
23
|
+
embedding: EmbeddingConfig;
|
|
24
|
+
}>): boolean;
|
|
25
|
+
export declare function describeFailure(detailed: EmbeddingLoadResultDetailed<{
|
|
26
|
+
embedding: EmbeddingConfig;
|
|
27
|
+
}>): string;
|
|
28
|
+
export declare function logConfigFailureOnce(projectIdentity: string, detailed: EmbeddingLoadResultDetailed<{
|
|
29
|
+
embedding: EmbeddingConfig;
|
|
30
|
+
}>): void;
|
|
31
|
+
export declare function handleUntrustedLoad(db: Database, projectIdentity: string, directory: string, detailed: EmbeddingLoadResultDetailed<{
|
|
32
|
+
embedding: EmbeddingConfig;
|
|
33
|
+
}>): boolean;
|
|
34
|
+
export declare function _resetEmbeddingConfigFailureLogsForTests(): void;
|
|
35
|
+
//# sourceMappingURL=embedding-bootstrap-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embedding-bootstrap-helpers.d.ts","sourceRoot":"","sources":["../../src/plugin/embedding-bootstrap-helpers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAMtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,MAAM,WAAW,GACjB,IAAI,GACJ,0BAA0B,GAC1B,uBAAuB,GACvB,iBAAiB,GACjB,sBAAsB,CAAC;AAE7B,MAAM,WAAW,2BAA2B,CAAC,OAAO,SAAS;IAAE,SAAS,EAAE,eAAe,CAAA;CAAE;IACvF,MAAM,EAAE,OAAO,CAAC;IAChB,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;AAED,eAAO,MAAM,wBAAwB,aAKnC,CAAC;AAEH,eAAO,MAAM,kCAAkC,aAAmD,CAAC;AAcnG,wBAAgB,qBAAqB,CACjC,QAAQ,EAAE,2BAA2B,CAAC;IAAE,SAAS,EAAE,eAAe,CAAA;CAAE,CAAC,GACtE,OAAO,CA0BT;AAED,wBAAgB,eAAe,CAC3B,QAAQ,EAAE,2BAA2B,CAAC;IAAE,SAAS,EAAE,eAAe,CAAA;CAAE,CAAC,GACtE,MAAM,CAkBR;AAED,wBAAgB,oBAAoB,CAChC,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,2BAA2B,CAAC;IAAE,SAAS,EAAE,eAAe,CAAA;CAAE,CAAC,GACtE,IAAI,CAiBN;AAED,wBAAgB,mBAAmB,CAC/B,EAAE,EAAE,QAAQ,EACZ,eAAe,EAAE,MAAM,EACvB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,2BAA2B,CAAC;IAAE,SAAS,EAAE,eAAe,CAAA;CAAE,CAAC,GACtE,OAAO,CAeT;AAED,wBAAgB,wCAAwC,IAAI,IAAI,CAE/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embedding-bootstrap.d.ts","sourceRoot":"","sources":["../../src/plugin/embedding-bootstrap.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGjD,wBAAsB,4CAA4C,CAC9D,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,QAAQ,GACb,OAAO,CAAC,IAAI,CAAC,CAqBf"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function createEventHandler(args: {
|
|
2
|
+
magicContext: {
|
|
3
|
+
event?: (input: {
|
|
4
|
+
event: import("@opencode-ai/sdk").Event;
|
|
5
|
+
}) => Promise<void>;
|
|
6
|
+
} | null;
|
|
7
|
+
autoUpdateChecker?: ((input: {
|
|
8
|
+
event: import("@opencode-ai/sdk").Event;
|
|
9
|
+
}) => Promise<void>) | null;
|
|
10
|
+
}): (input: {
|
|
11
|
+
event: import("@opencode-ai/sdk").Event;
|
|
12
|
+
}) => Promise<void>;
|
|
13
|
+
//# sourceMappingURL=event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../src/plugin/event.ts"],"names":[],"mappings":"AAAA,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACrC,YAAY,EAAE;QACV,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE;YAAE,KAAK,EAAE,OAAO,kBAAkB,EAAE,KAAK,CAAA;SAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;KACjF,GAAG,IAAI,CAAC;IACT,iBAAiB,CAAC,EACZ,CAAC,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,OAAO,kBAAkB,EAAE,KAAK,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,GACvE,IAAI,CAAC;CACd,GAAG,CAAC,KAAK,EAAE;IAAE,KAAK,EAAE,OAAO,kBAAkB,EAAE,KAAK,CAAA;CAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAKxE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { MagicContextPluginConfig } from "../../config";
|
|
2
|
+
import type { LiveSessionState } from "../../hooks/magic-context/live-session-state";
|
|
3
|
+
import type { PluginContext } from "../types";
|
|
4
|
+
export declare function createSessionHooks(args: {
|
|
5
|
+
ctx: PluginContext;
|
|
6
|
+
pluginConfig: MagicContextPluginConfig;
|
|
7
|
+
liveSessionState: LiveSessionState;
|
|
8
|
+
}): {
|
|
9
|
+
magicContext: {
|
|
10
|
+
"experimental.chat.messages.transform": (_input: Record<string, never>, output: {
|
|
11
|
+
messages: unknown[];
|
|
12
|
+
}) => Promise<void>;
|
|
13
|
+
"experimental.chat.system.transform": (input: {
|
|
14
|
+
sessionID?: string;
|
|
15
|
+
}, output: {
|
|
16
|
+
system: string[];
|
|
17
|
+
}) => Promise<void>;
|
|
18
|
+
"experimental.text.complete": (_input: {
|
|
19
|
+
sessionID: string;
|
|
20
|
+
messageID: string;
|
|
21
|
+
partID: string;
|
|
22
|
+
}, output: {
|
|
23
|
+
text: string;
|
|
24
|
+
}) => Promise<void>;
|
|
25
|
+
"chat.message": (input: {
|
|
26
|
+
sessionID?: string;
|
|
27
|
+
variant?: string;
|
|
28
|
+
agent?: string;
|
|
29
|
+
model?: {
|
|
30
|
+
providerID?: string;
|
|
31
|
+
modelID?: string;
|
|
32
|
+
};
|
|
33
|
+
}) => Promise<void>;
|
|
34
|
+
event: (input: {
|
|
35
|
+
event: {
|
|
36
|
+
type: string;
|
|
37
|
+
properties?: unknown;
|
|
38
|
+
};
|
|
39
|
+
}) => Promise<void>;
|
|
40
|
+
"command.execute.before": (input: unknown, output: unknown) => Promise<unknown>;
|
|
41
|
+
"tool.execute.after": (input: unknown) => Promise<void>;
|
|
42
|
+
} | null;
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=create-session-hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-session-hooks.d.ts","sourceRoot":"","sources":["../../../src/plugin/hooks/create-session-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAU7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACrC,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;IACvC,gBAAgB,EAAE,gBAAgB,CAAC;CACtC;;;;;;qBAoDkuJ,CAAC;;;;;;;;;;;;qBAA9sC,CAAC;mBAAyB,CAAC;iBAAuB,CAAC;iBAAuB,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;0BAA+luB,CAAC;;;;;;EADju1B"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
type MessageWithParts = {
|
|
2
|
+
info: import("@opencode-ai/sdk").Message;
|
|
3
|
+
parts: import("@opencode-ai/sdk").Part[];
|
|
4
|
+
};
|
|
5
|
+
type MessagesTransformOutput = {
|
|
6
|
+
messages: MessageWithParts[];
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Top-level transform wrapper. Catches errors so OpenCode's prompt loop
|
|
10
|
+
* always proceeds — without this guard, a transient DB contention event can
|
|
11
|
+
* crash the user's turn through OpenCode's Effect pipeline. See issue #23:
|
|
12
|
+
* https://github.com/cortexkit/magic-context/issues/23
|
|
13
|
+
*
|
|
14
|
+
* Error handling is tiered:
|
|
15
|
+
*
|
|
16
|
+
* - **SQLITE_BUSY**: Transient, expected from concurrent plugin processes
|
|
17
|
+
* (second OpenCode instance, long dreamer/historian child session, slow
|
|
18
|
+
* WAL checkpoint). Logged tersely; next pass will retry naturally. No
|
|
19
|
+
* persistent telemetry needed.
|
|
20
|
+
*
|
|
21
|
+
* - **Non-BUSY errors**: Schema corruption, programming bugs, type errors.
|
|
22
|
+
* These can silently disable magic-context for the entire session if the
|
|
23
|
+
* error repeats on every pass. We:
|
|
24
|
+
* 1. Log with full detail (code, name, message, stack).
|
|
25
|
+
* 2. Persist a short error summary into `session_meta.last_transform_error`
|
|
26
|
+
* so the sidebar/dashboard surfaces the failure state. The sidebar
|
|
27
|
+
* already reads this field; runPostTransformPhase's catch only fires
|
|
28
|
+
* for errors that reach it, and an error thrown early enough bypasses
|
|
29
|
+
* it entirely. Writing it here at the outer boundary guarantees
|
|
30
|
+
* observability.
|
|
31
|
+
* 3. Return with messages unmodified for this pass.
|
|
32
|
+
*
|
|
33
|
+
* In both cases we NEVER rethrow — OpenCode's Effect pipeline turns thrown
|
|
34
|
+
* errors into user-visible prompt failures. We accept degraded behavior
|
|
35
|
+
* (no injection / no drops this turn) rather than blocking the user.
|
|
36
|
+
*
|
|
37
|
+
* Correctness is preserved because all persistent state mutations inside
|
|
38
|
+
* the inner transform are idempotent across passes.
|
|
39
|
+
*/
|
|
40
|
+
export declare function createMessagesTransformHandler(args: {
|
|
41
|
+
magicContext: {
|
|
42
|
+
"experimental.chat.messages.transform"?: (input: Record<string, never>, output: MessagesTransformOutput) => Promise<void>;
|
|
43
|
+
} | null;
|
|
44
|
+
}): (input: Record<string, never>, output: MessagesTransformOutput) => Promise<void>;
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=messages-transform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages-transform.d.ts","sourceRoot":"","sources":["../../src/plugin/messages-transform.ts"],"names":[],"mappings":"AAWA,KAAK,gBAAgB,GAAG;IACpB,IAAI,EAAE,OAAO,kBAAkB,EAAE,OAAO,CAAC;IACzC,KAAK,EAAE,OAAO,kBAAkB,EAAE,IAAI,EAAE,CAAC;CAC5C,CAAC;AAEF,KAAK,uBAAuB,GAAG;IAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAA;CAAE,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE;IACjD,YAAY,EAAE;QACV,sCAAsC,CAAC,EAAE,CACrC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAC5B,MAAM,EAAE,uBAAuB,KAC9B,OAAO,CAAC,IAAI,CAAC,CAAC;KACtB,GAAG,IAAI,CAAC;CACZ,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,uBAAuB,KAAK,OAAO,CAAC,IAAI,CAAC,CAiDnF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ToolDefinition } from "@opencode-ai/plugin";
|
|
2
|
+
/**
|
|
3
|
+
* Patches each arg schema with a toJSONSchema override so that
|
|
4
|
+
* property-level descriptions from .describe() survive JSON Schema serialization.
|
|
5
|
+
*/
|
|
6
|
+
export declare function normalizeToolArgSchemas<TDefinition extends Pick<ToolDefinition, "args">>(toolDefinition: TDefinition): TDefinition;
|
|
7
|
+
//# sourceMappingURL=normalize-tool-arg-schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-tool-arg-schemas.d.ts","sourceRoot":"","sources":["../../src/plugin/normalize-tool-arg-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAgChE;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,WAAW,SAAS,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,EACpF,cAAc,EAAE,WAAW,GAC5B,WAAW,CAMb"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-side RPC handlers. Queries the server's own SQLite DB
|
|
3
|
+
* and returns typed responses for TUI consumption.
|
|
4
|
+
*/
|
|
5
|
+
import type { MagicContextConfig } from "../config/schema/magic-context";
|
|
6
|
+
import { type ContextDatabase as Database } from "../features/magic-context/storage";
|
|
7
|
+
import type { LiveSessionState } from "../hooks/magic-context/live-session-state";
|
|
8
|
+
import type { MagicContextRpcServer } from "../shared/rpc-server";
|
|
9
|
+
import type { SidebarSnapshot, StatusDetail } from "../shared/rpc-types";
|
|
10
|
+
export declare function buildSidebarSnapshot(db: Database, sessionId: string, directory: string, liveSessionState?: LiveSessionState, injectionBudgetTokens?: number, config?: Record<string, unknown>): SidebarSnapshot;
|
|
11
|
+
export declare function buildStatusDetail(db: Database, sessionId: string, directory: string, modelKey?: string, config?: Record<string, unknown>, liveSessionState?: LiveSessionState, injectionBudgetTokens?: number): StatusDetail;
|
|
12
|
+
/**
|
|
13
|
+
* Register all RPC handlers on the server.
|
|
14
|
+
*/
|
|
15
|
+
export declare function registerRpcHandlers(rpcServer: MagicContextRpcServer, args: {
|
|
16
|
+
directory: string;
|
|
17
|
+
config: MagicContextConfig;
|
|
18
|
+
client: unknown;
|
|
19
|
+
liveSessionState: LiveSessionState;
|
|
20
|
+
}): void;
|
|
21
|
+
//# sourceMappingURL=rpc-handlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc-handlers.d.ts","sourceRoot":"","sources":["../../src/plugin/rpc-handlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGzE,OAAO,EAAE,KAAK,eAAe,IAAI,QAAQ,EAAgB,MAAM,mCAAmC,CAAC;AAWnG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAgBlF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAmDzE,wBAAgB,oBAAoB,CAChC,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,qBAAqB,CAAC,EAAE,MAAM,EAK9B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACjC,eAAe,CAmVjB;AAED,wBAAgB,iBAAiB,CAC7B,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,qBAAqB,CAAC,EAAE,MAAM,GAC/B,YAAY,CAuKd;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAC/B,SAAS,EAAE,qBAAqB,EAChC,IAAI,EAAE;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,gBAAgB,EAAE,gBAAgB,CAAC;CACtC,GACF,IAAI,CAkKN"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SidebarSnapshot } from "../shared/rpc-types";
|
|
2
|
+
/**
|
|
3
|
+
* Apply the sticky-cache policy to a freshly built snapshot.
|
|
4
|
+
*
|
|
5
|
+
* Returns either the live snapshot (preferred) or a hybrid snapshot that
|
|
6
|
+
* preserves token-breakdown values from the previous good reading while keeping
|
|
7
|
+
* fresh DB-backed counts (compartmentCount, memoryCount, historian state, etc.)
|
|
8
|
+
* from the current build.
|
|
9
|
+
*/
|
|
10
|
+
export declare function applyStickySnapshotCache(sessionId: string, fresh: SidebarSnapshot): SidebarSnapshot;
|
|
11
|
+
/**
|
|
12
|
+
* Drop the cached snapshot for a session. Wired to `session.deleted`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function clearSidebarSnapshotCache(sessionId: string): void;
|
|
15
|
+
/**
|
|
16
|
+
* Test helper — drop the entire cache.
|
|
17
|
+
*/
|
|
18
|
+
export declare function resetSidebarSnapshotCache(): void;
|
|
19
|
+
//# sourceMappingURL=sidebar-snapshot-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-snapshot-cache.d.ts","sourceRoot":"","sources":["../../src/plugin/sidebar-snapshot-cache.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAY3D;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACpC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,eAAe,GACvB,eAAe,CA+DjB;AAQD;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAEjE;AAED;;GAEG;AACH,wBAAgB,yBAAyB,IAAI,IAAI,CAEhD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ToolDefinition } from "@opencode-ai/plugin";
|
|
2
|
+
import type { MagicContextPluginConfig } from "../config";
|
|
3
|
+
import type { PluginContext } from "./types";
|
|
4
|
+
export declare function createToolRegistry(args: {
|
|
5
|
+
ctx: PluginContext;
|
|
6
|
+
pluginConfig: MagicContextPluginConfig;
|
|
7
|
+
}): Record<string, ToolDefinition>;
|
|
8
|
+
//# sourceMappingURL=tool-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-registry.d.ts","sourceRoot":"","sources":["../../src/plugin/tool-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAgB1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACrC,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;CAC1C,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAyEjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugin/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Release-notes startup announcement shared by OpenCode plugin and Pi plugin.
|
|
3
|
+
*
|
|
4
|
+
* Bump `ANNOUNCEMENT_VERSION` and populate `ANNOUNCEMENT_FEATURES` *only* when a
|
|
5
|
+
* release ships user-facing news worth surfacing once at startup. Patch releases
|
|
6
|
+
* with no user-visible changes should leave both untouched — that way a user who
|
|
7
|
+
* already dismissed the dialog for the current `ANNOUNCEMENT_VERSION` won't see
|
|
8
|
+
* it again on the next bugfix bump.
|
|
9
|
+
*
|
|
10
|
+
* The persisted state is a single line of text (`last_announced_version`) under
|
|
11
|
+
* `getMagicContextStorageDir()`. OpenCode and Pi share the same file because
|
|
12
|
+
* they share the same storage root — so dismissing in one harness suppresses
|
|
13
|
+
* the dialog in the other for the same announcement.
|
|
14
|
+
*
|
|
15
|
+
* Leave both empty (`""` and `[]`) to skip the dialog entirely.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Bump only when there are user-visible changes worth a startup dialog.
|
|
19
|
+
* Does NOT need to match the published package version.
|
|
20
|
+
*/
|
|
21
|
+
export declare const ANNOUNCEMENT_VERSION = "0.21.7";
|
|
22
|
+
/**
|
|
23
|
+
* Short, user-facing bullet strings. Keep each line ~80 chars or shorter so the
|
|
24
|
+
* TUI dialog renders cleanly without horizontal scroll on a typical terminal.
|
|
25
|
+
*/
|
|
26
|
+
export declare const ANNOUNCEMENT_FEATURES: ReadonlyArray<string>;
|
|
27
|
+
/**
|
|
28
|
+
* Persistent footer rendered below the version-specific bullets in every
|
|
29
|
+
* announcement. Stays in place across releases so users always see the Discord
|
|
30
|
+
* invite without us needing to repeat it in `ANNOUNCEMENT_FEATURES` each time.
|
|
31
|
+
*
|
|
32
|
+
* Leave empty (`""`) to suppress the footer.
|
|
33
|
+
*/
|
|
34
|
+
export declare const ANNOUNCEMENT_FOOTER = "Join us on Discord: https://discord.gg/F2uWxjGnU";
|
|
35
|
+
/**
|
|
36
|
+
* Read the most recently dismissed announcement version, or `""` if none.
|
|
37
|
+
*
|
|
38
|
+
* Best-effort: any read failure returns `""` (which forces the announcement to
|
|
39
|
+
* re-show). The cost of a spurious second dialog is much smaller than the cost
|
|
40
|
+
* of suppressing a real announcement due to a transient FS error.
|
|
41
|
+
*/
|
|
42
|
+
export declare function readLastAnnouncedVersion(): string;
|
|
43
|
+
/**
|
|
44
|
+
* Persist `version` as the most recently dismissed announcement. Best-effort:
|
|
45
|
+
* write failures are swallowed so dialog-confirm flows never throw on storage
|
|
46
|
+
* errors. Worst case the user sees the same dialog once more on next startup.
|
|
47
|
+
*/
|
|
48
|
+
export declare function markAnnouncementSeen(version: string): void;
|
|
49
|
+
/**
|
|
50
|
+
* True when the configured `ANNOUNCEMENT_VERSION` has not yet been dismissed
|
|
51
|
+
* AND there is at least one feature to show. Used by both the TUI dialog path
|
|
52
|
+
* and the Desktop ignored-message fallback.
|
|
53
|
+
*/
|
|
54
|
+
export declare function shouldShowAnnouncement(): boolean;
|
|
55
|
+
//# sourceMappingURL=announcement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"announcement.d.ts","sourceRoot":"","sources":["../../src/shared/announcement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH;;;GAGG;AACH,eAAO,MAAM,oBAAoB,WAAW,CAAC;AAE7C;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,MAAM,CAOvD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,qDAAqD,CAAC;AAQtF;;;;;;GAMG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAQjD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAS1D;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAGhD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistant-message-extractor.d.ts","sourceRoot":"","sources":["../../src/shared/assistant-message-extractor.ts"],"names":[],"mappings":"AAwDA,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAiB3E"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bounded LRU map keyed by session id.
|
|
3
|
+
*
|
|
4
|
+
* Rationale: magic-context maintains several module-scope Maps that track
|
|
5
|
+
* per-session state (prepared injection cache, per-message token cache, etc.).
|
|
6
|
+
* These are cleared on the `session.deleted` event, but sessions that are
|
|
7
|
+
* never explicitly deleted — because OpenCode crashed, the user force-quit,
|
|
8
|
+
* the session was archived rather than deleted, or the session simply outlived
|
|
9
|
+
* the plugin process's interest in it — leak entries for the lifetime of the
|
|
10
|
+
* plugin process.
|
|
11
|
+
*
|
|
12
|
+
* In long-running OpenCode instances with thousands of sessions over time,
|
|
13
|
+
* an unbounded `Map<sessionId, LargeObject>` can retain tens of megabytes
|
|
14
|
+
* indefinitely. A session-scoped LRU with a generous cap (e.g. 100) covers
|
|
15
|
+
* any realistic working-set of active sessions a user actually cares about,
|
|
16
|
+
* while evicting cold session ids that will either never return or be
|
|
17
|
+
* rebuilt from durable SQLite state on their next transform pass.
|
|
18
|
+
*
|
|
19
|
+
* Implementation notes:
|
|
20
|
+
* - Built on `Map` which preserves insertion order. On every `set`/`get`
|
|
21
|
+
* touch we delete+reinsert to move the key to the tail (most-recent).
|
|
22
|
+
* - Eviction drops the oldest entry (first in iteration order).
|
|
23
|
+
* - The cached value type is generic — callers decide what per-session state
|
|
24
|
+
* to store. For injection/token state, all three properties of the cached
|
|
25
|
+
* object are safe to throw away: they are either recomputable from the
|
|
26
|
+
* messages array on the next pass, or reloadable from SQLite.
|
|
27
|
+
*/
|
|
28
|
+
export declare class BoundedSessionMap<V> {
|
|
29
|
+
private readonly maxEntries;
|
|
30
|
+
private readonly store;
|
|
31
|
+
constructor(maxEntries: number);
|
|
32
|
+
get(sessionId: string): V | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Peek without touching recency — useful for `has`-style checks that
|
|
35
|
+
* should not rearrange LRU order. Use sparingly; `get` is the normal
|
|
36
|
+
* access path.
|
|
37
|
+
*/
|
|
38
|
+
peek(sessionId: string): V | undefined;
|
|
39
|
+
has(sessionId: string): boolean;
|
|
40
|
+
set(sessionId: string, value: V): void;
|
|
41
|
+
delete(sessionId: string): boolean;
|
|
42
|
+
clear(): void;
|
|
43
|
+
get size(): number;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=bounded-session-map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bounded-session-map.d.ts","sourceRoot":"","sources":["../../src/shared/bounded-session-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,iBAAiB,CAAC,CAAC;IAC5B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAwB;gBAElC,UAAU,EAAE,MAAM;IAO9B,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IASrC;;;;OAIG;IACH,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAItC,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAI/B,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAYtC,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAIlC,KAAK,IAAI,IAAI;IAIb,IAAI,IAAI,IAAI,MAAM,CAEjB;CACJ"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export interface ConflictResult {
|
|
2
|
+
/** Whether any blocking conflict was found */
|
|
3
|
+
hasConflict: boolean;
|
|
4
|
+
/** Human-readable reasons for each conflict */
|
|
5
|
+
reasons: string[];
|
|
6
|
+
/** Which conflicts were found — used for targeted fixes */
|
|
7
|
+
conflicts: {
|
|
8
|
+
compactionAuto: boolean;
|
|
9
|
+
compactionPrune: boolean;
|
|
10
|
+
dcpPlugin: boolean;
|
|
11
|
+
omoPreemptiveCompaction: boolean;
|
|
12
|
+
omoContextWindowMonitor: boolean;
|
|
13
|
+
omoAnthropicRecovery: boolean;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Detect all conflicts that would prevent magic-context from working correctly.
|
|
18
|
+
* Checks: OpenCode compaction, DCP plugin, OMO conflicting hooks.
|
|
19
|
+
*/
|
|
20
|
+
export declare function detectConflicts(directory: string): ConflictResult;
|
|
21
|
+
/**
|
|
22
|
+
* Canonical npm package names that represent the conflicting plugin.
|
|
23
|
+
* Matched against the npm-style segment of each plugin entry, so:
|
|
24
|
+
* - "@tarquinen/opencode-dcp" ✓ direct match
|
|
25
|
+
* - "@tarquinen/opencode-dcp@latest" ✓ version suffix stripped
|
|
26
|
+
* - "@tarquinen/opencode-dcp@^3.1.0" ✓ semver suffix stripped
|
|
27
|
+
* - "file:///path/to/opencode-dcp-fork" ✗ unrelated path
|
|
28
|
+
*
|
|
29
|
+
* forks/renames that don't ship the conflicting transform/system hooks are
|
|
30
|
+
* intentionally NOT matched.
|
|
31
|
+
*/
|
|
32
|
+
export declare const DCP_PACKAGE_NAMES: Set<string>;
|
|
33
|
+
/**
|
|
34
|
+
* Match a plugin entry against a set of canonical npm package names.
|
|
35
|
+
*
|
|
36
|
+
* A plugin entry can be:
|
|
37
|
+
* - "pkg-name"
|
|
38
|
+
* - "pkg-name@version"
|
|
39
|
+
* - "@scope/pkg-name"
|
|
40
|
+
* - "@scope/pkg-name@version"
|
|
41
|
+
* - "file://..." or other URL/path forms (never matched here)
|
|
42
|
+
*
|
|
43
|
+
* For the canonical-name path we only match the exact package name (with
|
|
44
|
+
* optional version suffix). file:// paths and forks with different
|
|
45
|
+
* package names are intentionally NOT matched — even if a path string
|
|
46
|
+
* happens to contain a substring like "oh-my-opencode" (e.g. forks like
|
|
47
|
+
* "oh-my-opencode-slim" published under a different package name).
|
|
48
|
+
*/
|
|
49
|
+
export declare function matchesPackageName(entry: string, canonicalNames: Set<string>): boolean;
|
|
50
|
+
/** Extract the package-name string from a plugin entry.
|
|
51
|
+
* OpenCode supports two forms:
|
|
52
|
+
* - plain string: "@scope/pkg@latest"
|
|
53
|
+
* - tuple [name, opts]: ["@scope/pkg@latest", { ... }]
|
|
54
|
+
* Returns null for any other shape (numbers, objects, etc.). */
|
|
55
|
+
export declare function extractPluginName(entry: unknown): string | null;
|
|
56
|
+
/**
|
|
57
|
+
* Canonical OMO npm package names. The plugin publishes under both names as
|
|
58
|
+
* a versioned alias (latest 3.17.5 on npm at time of writing).
|
|
59
|
+
*
|
|
60
|
+
* Forks under a different package name (e.g. `oh-my-opencode-slim`,
|
|
61
|
+
* `oh-my-opencode-cli`, etc.) are intentionally NOT matched here — they
|
|
62
|
+
* don't ship the `preemptive-compaction`, `context-window-monitor`, or
|
|
63
|
+
* `anthropic-context-window-limit-recovery` hooks that conflict with
|
|
64
|
+
* Magic Context. See https://github.com/cortexkit/magic-context/issues/43.
|
|
65
|
+
*
|
|
66
|
+
* The legacy `@code-yeongyu/` scope is no longer used — both names are
|
|
67
|
+
* unscoped on npm.
|
|
68
|
+
*/
|
|
69
|
+
export declare const OMO_PACKAGE_NAMES: Set<string>;
|
|
70
|
+
/**
|
|
71
|
+
* Generate a short conflict summary for ignored message display.
|
|
72
|
+
*/
|
|
73
|
+
export declare function formatConflictShort(result: ConflictResult): string;
|
|
74
|
+
//# sourceMappingURL=conflict-detector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conflict-detector.d.ts","sourceRoot":"","sources":["../../src/shared/conflict-detector.ts"],"names":[],"mappings":"AAiBA,MAAM,WAAW,cAAc;IAC3B,8CAA8C;IAC9C,WAAW,EAAE,OAAO,CAAC;IACrB,+CAA+C;IAC/C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,2DAA2D;IAC3D,SAAS,EAAE;QACP,cAAc,EAAE,OAAO,CAAC;QACxB,eAAe,EAAE,OAAO,CAAC;QACzB,SAAS,EAAE,OAAO,CAAC;QACnB,uBAAuB,EAAE,OAAO,CAAC;QACjC,uBAAuB,EAAE,OAAO,CAAC;QACjC,oBAAoB,EAAE,OAAO,CAAC;KACjC,CAAC;CACL;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,CAyDjE;AA4ED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,aAAuC,CAAC;AAOtE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,OAAO,CAoBtF;AAED;;;;iEAIiE;AACjE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAI/D;AAwCD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iBAAiB,aAAiD,CAAC;AAoEhF;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAWlE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conflict-fixer.d.ts","sourceRoot":"","sources":["../../src/shared/conflict-fixer.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,cAAc,EAItB,MAAM,qBAAqB,CAAC;AAqG7B,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,CAAC,WAAW,CAAC,GAAG,MAAM,EAAE,CA+GhG"}
|