@cortexkit/opencode-magic-context 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +274 -0
- package/dist/agents/builtin-agents.d.ts +8 -0
- package/dist/agents/builtin-agents.d.ts.map +1 -0
- package/dist/agents/dreamer.d.ts +2 -0
- package/dist/agents/dreamer.d.ts.map +1 -0
- package/dist/agents/historian.d.ts +2 -0
- package/dist/agents/historian.d.ts.map +1 -0
- package/dist/agents/magic-context-prompt.d.ts +14 -0
- package/dist/agents/magic-context-prompt.d.ts.map +1 -0
- package/dist/agents/sidekick.d.ts +2 -0
- package/dist/agents/sidekick.d.ts.map +1 -0
- package/dist/agents/types.d.ts +19 -0
- package/dist/agents/types.d.ts.map +1 -0
- package/dist/cli/model-fallback-requirements.d.ts +2 -0
- package/dist/cli/model-fallback-requirements.d.ts.map +1 -0
- package/dist/config/index.d.ts +13 -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 +529 -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/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.d.ts +7 -0
- package/dist/features/magic-context/compaction.d.ts.map +1 -0
- package/dist/features/magic-context/compartment-storage.d.ts +83 -0
- package/dist/features/magic-context/compartment-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 +7 -0
- package/dist/features/magic-context/dreamer/index.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/lease.d.ts +7 -0
- package/dist/features/magic-context/dreamer/lease.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/queue.d.ts +27 -0
- package/dist/features/magic-context/dreamer/queue.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/runner.d.ts +34 -0
- package/dist/features/magic-context/dreamer/runner.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/scheduler.d.ts +21 -0
- package/dist/features/magic-context/dreamer/scheduler.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-consolidate.d.ts +9 -0
- package/dist/features/magic-context/dreamer/task-consolidate.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/task-decay.d.ts +11 -0
- package/dist/features/magic-context/dreamer/task-decay.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/task-prompts.d.ts +19 -0
- package/dist/features/magic-context/dreamer/task-prompts.d.ts.map +1 -0
- package/dist/features/magic-context/index.d.ts +11 -0
- package/dist/features/magic-context/index.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 +8 -0
- package/dist/features/magic-context/memory/embedding-backfill.d.ts.map +1 -0
- package/dist/features/magic-context/memory/embedding-local.d.ts +14 -0
- package/dist/features/magic-context/memory/embedding-local.d.ts.map +1 -0
- package/dist/features/magic-context/memory/embedding-openai.d.ts +21 -0
- package/dist/features/magic-context/memory/embedding-openai.d.ts.map +1 -0
- package/dist/features/magic-context/memory/embedding-provider.d.ts +9 -0
- package/dist/features/magic-context/memory/embedding-provider.d.ts.map +1 -0
- package/dist/features/magic-context/memory/embedding.d.ts +11 -0
- package/dist/features/magic-context/memory/embedding.d.ts.map +1 -0
- package/dist/features/magic-context/memory/index.d.ts +11 -0
- package/dist/features/magic-context/memory/index.d.ts.map +1 -0
- package/dist/features/magic-context/memory/injection.d.ts +10 -0
- package/dist/features/magic-context/memory/injection.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 +7 -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 +4 -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 +19 -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/mock-database.d.ts +3 -0
- package/dist/features/magic-context/mock-database.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/scheduler.d.ts +14 -0
- package/dist/features/magic-context/scheduler.d.ts.map +1 -0
- package/dist/features/magic-context/sidekick/agent.d.ts +12 -0
- package/dist/features/magic-context/sidekick/agent.d.ts.map +1 -0
- package/dist/features/magic-context/sidekick/client.d.ts +12 -0
- package/dist/features/magic-context/sidekick/client.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/sidekick/types.d.ts +48 -0
- package/dist/features/magic-context/sidekick/types.d.ts.map +1 -0
- package/dist/features/magic-context/storage-db.d.ts +8 -0
- package/dist/features/magic-context/storage-db.d.ts.map +1 -0
- package/dist/features/magic-context/storage-meta-persisted.d.ts +20 -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 +24 -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 +12 -0
- package/dist/features/magic-context/storage-notes.d.ts.map +1 -0
- package/dist/features/magic-context/storage-ops.d.ts +8 -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-tags.d.ts +9 -0
- package/dist/features/magic-context/storage-tags.d.ts.map +1 -0
- package/dist/features/magic-context/storage.d.ts +8 -0
- package/dist/features/magic-context/storage.d.ts.map +1 -0
- package/dist/features/magic-context/tagger.d.ts +14 -0
- package/dist/features/magic-context/tagger.d.ts.map +1 -0
- package/dist/features/magic-context/types.d.ts +36 -0
- package/dist/features/magic-context/types.d.ts.map +1 -0
- package/dist/hooks/auto-slash-command/constants.d.ts +2 -0
- package/dist/hooks/auto-slash-command/constants.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/command-handler.d.ts +46 -0
- package/dist/hooks/magic-context/command-handler.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-parser.d.ts +17 -0
- package/dist/hooks/magic-context/compartment-parser.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-prompt.d.ts +10 -0
- package/dist/hooks/magic-context/compartment-prompt.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner-compressor.d.ts +16 -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 +3 -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 +22 -0
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts +3 -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-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 +47 -0
- package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts +23 -0
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner.d.ts +6 -0
- package/dist/hooks/magic-context/compartment-runner.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-trigger.d.ts +14 -0
- package/dist/hooks/magic-context/compartment-trigger.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 +34 -0
- package/dist/hooks/magic-context/event-handler.d.ts.map +1 -0
- package/dist/hooks/magic-context/event-payloads.d.ts +32 -0
- package/dist/hooks/magic-context/event-payloads.d.ts.map +1 -0
- package/dist/hooks/magic-context/event-resolvers.d.ts +17 -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 +6 -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/get-error-message.d.ts +2 -0
- package/dist/hooks/magic-context/get-error-message.d.ts.map +1 -0
- package/dist/hooks/magic-context/heuristic-cleanup.d.ts +13 -0
- package/dist/hooks/magic-context/heuristic-cleanup.d.ts.map +1 -0
- package/dist/hooks/magic-context/hook-handlers.d.ts +72 -0
- package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -0
- package/dist/hooks/magic-context/hook.d.ts +66 -0
- package/dist/hooks/magic-context/hook.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 +21 -0
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -0
- package/dist/hooks/magic-context/note-nudger.d.ts +32 -0
- package/dist/hooks/magic-context/note-nudger.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 +13 -0
- package/dist/hooks/magic-context/nudge-placement-store.d.ts.map +1 -0
- package/dist/hooks/magic-context/nudger.d.ts +24 -0
- package/dist/hooks/magic-context/nudger.d.ts.map +1 -0
- package/dist/hooks/magic-context/read-session-chunk.d.ts +20 -0
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -0
- package/dist/hooks/magic-context/read-session-db.d.ts +5 -0
- package/dist/hooks/magic-context/read-session-db.d.ts.map +1 -0
- package/dist/hooks/magic-context/read-session-formatting.d.ts +25 -0
- package/dist/hooks/magic-context/read-session-formatting.d.ts.map +1 -0
- package/dist/hooks/magic-context/read-session-raw.d.ts +9 -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/strip-content.d.ts +21 -0
- package/dist/hooks/magic-context/strip-content.d.ts.map +1 -0
- package/dist/hooks/magic-context/strip-structural-noise.d.ts +3 -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 +25 -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 +35 -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/text-complete.d.ts +8 -0
- package/dist/hooks/magic-context/text-complete.d.ts.map +1 -0
- package/dist/hooks/magic-context/tool-drop-target.d.ts +32 -0
- package/dist/hooks/magic-context/tool-drop-target.d.ts.map +1 -0
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts +36 -0
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -0
- package/dist/hooks/magic-context/transform-context-state.d.ts +9 -0
- package/dist/hooks/magic-context/transform-context-state.d.ts.map +1 -0
- package/dist/hooks/magic-context/transform-message-helpers.d.ts +7 -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 +53 -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 +39 -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 +22571 -0
- package/dist/plugin/event.d.ts +10 -0
- package/dist/plugin/event.d.ts.map +1 -0
- package/dist/plugin/hooks/create-core-hooks.d.ts +37 -0
- package/dist/plugin/hooks/create-core-hooks.d.ts.map +1 -0
- package/dist/plugin/hooks/create-session-hooks.d.ts +37 -0
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -0
- package/dist/plugin/hooks/create-tag-content-resolver.d.ts +7 -0
- package/dist/plugin/hooks/create-tag-content-resolver.d.ts.map +1 -0
- package/dist/plugin/messages-transform.d.ts +14 -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/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/agent-display-names.d.ts +2 -0
- package/dist/shared/agent-display-names.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/data-path.d.ts +3 -0
- package/dist/shared/data-path.d.ts.map +1 -0
- package/dist/shared/error-message.d.ts +2 -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/index.d.ts +5 -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 +16 -0
- package/dist/shared/jsonc-parser.d.ts.map +1 -0
- package/dist/shared/logger.d.ts +4 -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 +31 -0
- package/dist/shared/model-suggestion-retry.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/permission-compat.d.ts +6 -0
- package/dist/shared/permission-compat.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/system-directive.d.ts +3 -0
- package/dist/shared/system-directive.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 +30 -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 +7 -0
- package/dist/tools/ctx-note/tools.d.ts.map +1 -0
- package/dist/tools/ctx-note/types.d.ts +5 -0
- package/dist/tools/ctx-note/types.d.ts.map +1 -0
- package/dist/tools/ctx-recall/constants.d.ts +4 -0
- package/dist/tools/ctx-recall/constants.d.ts.map +1 -0
- package/dist/tools/ctx-recall/index.d.ts +4 -0
- package/dist/tools/ctx-recall/index.d.ts.map +1 -0
- package/dist/tools/ctx-recall/tools.d.ts +4 -0
- package/dist/tools/ctx-recall/tools.d.ts.map +1 -0
- package/dist/tools/ctx-recall/types.d.ts +20 -0
- package/dist/tools/ctx-recall/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/index.d.ts +5 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/look-at/assistant-message-extractor.d.ts +2 -0
- package/dist/tools/look-at/assistant-message-extractor.d.ts.map +1 -0
- package/package.json +51 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 ualtinok
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
<h1 align="center">Magic Context</h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<strong>Cache-aware infinite context, cross-session memory, and background history compression for AI coding agents.</strong><br>
|
|
5
|
+
An <a href="https://github.com/anomalyco/opencode">OpenCode</a> plugin that keeps your agent's memory intact — no matter how long the session runs.
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<a href="https://www.npmjs.com/package/@cortexkit/opencode-magic-context"><img src="https://img.shields.io/npm/v/@cortexkit/opencode-magic-context?color=blue&style=flat-square" alt="npm"></a>
|
|
10
|
+
<a href="https://github.com/cortexkit/opencode-magic-context/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" alt="MIT License"></a>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<img src="docs/animation/out/optimized2.gif" alt="Magic Context in action" width="720">
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
<p align="center">
|
|
18
|
+
<a href="#get-started">Get Started</a> ·
|
|
19
|
+
<a href="#what-is-magic-context">What is Magic Context?</a> ·
|
|
20
|
+
<a href="#what-your-agent-gets">What Your Agent Gets</a> ·
|
|
21
|
+
<a href="#how-it-works">How It Works</a> ·
|
|
22
|
+
<a href="#commands">Commands</a> ·
|
|
23
|
+
<a href="#configuration">Configuration</a>
|
|
24
|
+
</p>
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Get Started
|
|
29
|
+
|
|
30
|
+
Add to your OpenCode config (`opencode.json` or `opencode.jsonc`):
|
|
31
|
+
|
|
32
|
+
```jsonc
|
|
33
|
+
{
|
|
34
|
+
"plugins": ["@cortexkit/opencode-magic-context@latest"]
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Magic Context conflicts with OpenCode's built-in compaction — the two cannot run together. To disable it:
|
|
39
|
+
|
|
40
|
+
```jsonc
|
|
41
|
+
{
|
|
42
|
+
"compaction": {
|
|
43
|
+
"auto": false,
|
|
44
|
+
"prune": false
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Create `magic-context.jsonc` in your project root, `.opencode/`, or `~/.config/opencode/`:
|
|
50
|
+
|
|
51
|
+
```jsonc
|
|
52
|
+
{
|
|
53
|
+
"enabled": true,
|
|
54
|
+
|
|
55
|
+
// Which model the historian uses for background compression,
|
|
56
|
+
// Prefer providers that charge by request instead of tokens
|
|
57
|
+
"historian": {
|
|
58
|
+
"model": "github-copilot/gpt-5.4",
|
|
59
|
+
"fallback_models": ["opencode-go/glm-5"]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
That's it. Everything else has sensible defaults. Project config merges on top of user-wide settings.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## What is Magic Context?
|
|
69
|
+
|
|
70
|
+
AI coding agents forget everything the moment a conversation gets long enough. Context windows fill up, old messages get dropped, and the agent loses track of decisions it made twenty minutes ago.
|
|
71
|
+
|
|
72
|
+
Magic Context fixes this with a background historian — a separate, lightweight model that compresses older conversation into structured summaries and durable facts while the main agent keeps working. The agent never stops to summarize its own history. It never notices the rewriting happening beneath it.
|
|
73
|
+
|
|
74
|
+
Every mutation is **cache-aware**. Drops and rewrites are queued until the provider's cached prefix expires, so you're not paying to throw away work that's already cached.
|
|
75
|
+
|
|
76
|
+
Across sessions, architecture decisions, constraints, and preferences persist in a **cross-session memory** system. A new conversation starts with everything the previous one learned, without replaying old transcripts.
|
|
77
|
+
|
|
78
|
+
And overnight, a **dreamer** agent consolidates, verifies, and improves memories — checking them against the actual codebase and merging duplicates into clean canonical facts.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## What Your Agent Gets
|
|
83
|
+
|
|
84
|
+
Magic Context injects structured context automatically and gives the agent four tools.
|
|
85
|
+
|
|
86
|
+
### `ctx_reduce` — Shed weight
|
|
87
|
+
|
|
88
|
+
After tool-heavy turns (large grep results, file reads, bash output), the agent calls `ctx_reduce` to mark stale content for removal. Drops are queued — not applied immediately — until the cache expires or context pressure forces it.
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
ctx_reduce(drop="3-5,12") // Drop tags 3, 4, 5, and 12
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Recent tags (last 20 by default) are protected. Drops targeting them stay queued until they age out.
|
|
95
|
+
|
|
96
|
+
### `ctx_expand` — Decompress history
|
|
97
|
+
|
|
98
|
+
When the agent needs to recall details from a compressed history range, it can expand specific compartment ranges back to the original conversation transcript.
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
ctx_expand(start=100, end=200) // Expand raw messages 100-200
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Returns the same compact `U:`/`A:` transcript format the historian sees, capped at ~15K tokens per request. Use `start`/`end` from compartment attributes visible in `<session-history>`.
|
|
105
|
+
|
|
106
|
+
### `ctx_note` — Deferred intentions
|
|
107
|
+
|
|
108
|
+
Session notes are the agent's scratchpad for things to tackle later — not task tracking (that's what todos are for), but deferred work and reminders that should surface at the right time.
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
ctx_note(action="write", content="After this fix, check if the compressor budget formula is correct")
|
|
112
|
+
ctx_note(action="read")
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Notes surface automatically at natural work boundaries: after commits, after historian runs, and after all todos complete.
|
|
116
|
+
|
|
117
|
+
### `ctx_memory` — Persistent cross-session knowledge
|
|
118
|
+
|
|
119
|
+
Architecture decisions, naming conventions, user preferences — anything that should survive across conversations. Memories are project-scoped and automatically promoted from session facts by the historian.
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
ctx_memory(action="write", category="ARCHITECTURE_DECISIONS", content="Event sourcing for orders.")
|
|
123
|
+
ctx_memory(action="search", query="authentication approach")
|
|
124
|
+
ctx_memory(action="delete", id=42)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Automatic context injection
|
|
128
|
+
|
|
129
|
+
Every turn, Magic Context injects a `<session-history>` block containing:
|
|
130
|
+
|
|
131
|
+
- **Project memories** — cross-session decisions, constraints, and preferences
|
|
132
|
+
- **Compartments** — structured summaries replacing older raw history
|
|
133
|
+
- **Session facts** — durable categorized facts from the current session
|
|
134
|
+
|
|
135
|
+
This block is stable between historian runs. Memory writes persist immediately for search but don't change the injected block until the next historian run — so writes never bust the cache mid-conversation.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## How It Works
|
|
140
|
+
|
|
141
|
+
### Tagging
|
|
142
|
+
|
|
143
|
+
Every message, tool output, and file attachment gets a monotonically increasing `§N§` tag. The agent sees these inline and uses them to reference specific content when calling `ctx_reduce`. Tags persist in the database and resume across restarts.
|
|
144
|
+
|
|
145
|
+
### Queued reductions
|
|
146
|
+
|
|
147
|
+
When the agent calls `ctx_reduce`, drops go into a pending queue — not applied immediately. Two conditions trigger execution:
|
|
148
|
+
|
|
149
|
+
- **Cache expired** — enough time has passed that the cached prefix is likely stale (configurable per model, default 5 minutes)
|
|
150
|
+
- **Threshold reached** — context usage hits `execute_threshold_percentage` (default 65%)
|
|
151
|
+
|
|
152
|
+
Between triggers, the conversation continues unchanged. The agent doesn't need to think about timing.
|
|
153
|
+
|
|
154
|
+
### Background historian
|
|
155
|
+
|
|
156
|
+
When local drops aren't buying enough headroom, Magic Context starts a historian — a separate lightweight model that reads an eligible prefix of raw history and produces:
|
|
157
|
+
|
|
158
|
+
- **Compartments** — chronological blocks that replace older raw messages
|
|
159
|
+
- **Facts** — durable decisions, constraints, and preferences (categorized)
|
|
160
|
+
|
|
161
|
+
The historian runs asynchronously. The main agent never waits for it. When the historian finishes, its output is materialized on the next transform pass.
|
|
162
|
+
|
|
163
|
+
A **separate compressor** pass fires when the rendered history block exceeds the configured history budget, merging the oldest compartments to keep the injected context lean.
|
|
164
|
+
|
|
165
|
+
### Nudging
|
|
166
|
+
|
|
167
|
+
As context usage grows, Magic Context sends rolling reminders suggesting the agent reduce. Cadence tightens as usage approaches the threshold — from gentle reminders to urgent warnings. If the agent recently called `ctx_reduce`, reminders are suppressed. An emergency nudge at 80% always fires.
|
|
168
|
+
|
|
169
|
+
### Cross-session memory
|
|
170
|
+
|
|
171
|
+
After each historian run, qualifying facts are promoted to the persistent memory store. On every subsequent turn, active memories are injected in `<session-history>`. New sessions inherit all project memories from previous sessions.
|
|
172
|
+
|
|
173
|
+
Memories are searchable via `ctx_memory(action="search", ...)` using semantic embeddings (local by default) with full-text search as fallback.
|
|
174
|
+
|
|
175
|
+
### Dreamer
|
|
176
|
+
|
|
177
|
+
An optional background agent that maintains memory quality overnight:
|
|
178
|
+
|
|
179
|
+
- **Consolidate** — merge semantically similar memories into canonical facts
|
|
180
|
+
- **Verify** — check memories against current codebase (configs, paths, code patterns)
|
|
181
|
+
- **Archive stale** — retire memories referencing removed features or old paths
|
|
182
|
+
- **Improve** — rewrite verbose memories into terse operational form
|
|
183
|
+
- **Maintain docs** — update ARCHITECTURE.md and STRUCTURE.md from codebase changes
|
|
184
|
+
|
|
185
|
+
The dreamer runs during a configurable schedule window and creates ephemeral OpenCode child sessions for each task. Since it runs during idle time (typically overnight), it works well with local models — even slower ones like `ollama/mlx-qwen3.5-27b-claude-4.6-opus-reasoning-distilled` are fine since there's no user waiting.
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Commands
|
|
190
|
+
|
|
191
|
+
| Command | Description |
|
|
192
|
+
|---------|-------------|
|
|
193
|
+
| `/ctx-status` | Debug view: tags, pending drops, cache TTL, nudge state, historian progress, compartment coverage, history compression budget |
|
|
194
|
+
| `/ctx-flush` | Force all queued operations immediately, bypassing cache TTL |
|
|
195
|
+
| `/ctx-recomp` | Rebuild compartments and facts from raw history — use when stored state seems wrong |
|
|
196
|
+
| `/ctx-aug` | Run sidekick augmentation on a prompt — retrieves relevant memories via a separate model |
|
|
197
|
+
| `/ctx-dream` | Run dreamer maintenance on demand — consolidate, verify, archive, improve memories |
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Configuration
|
|
202
|
+
|
|
203
|
+
All settings live in `magic-context.jsonc` as flat top-level keys. See **[CONFIGURATION.md](./CONFIGURATION.md)** for the full reference — cache TTL tuning, per-model execute thresholds, historian model selection, embedding providers, memory settings, sidekick, and dreamer.
|
|
204
|
+
|
|
205
|
+
**Config locations** (merged in order, project overrides user):
|
|
206
|
+
1. `<project-root>/magic-context.jsonc`
|
|
207
|
+
2. `<project-root>/.opencode/magic-context.jsonc`
|
|
208
|
+
3. `~/.config/opencode/magic-context.jsonc`
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## Storage
|
|
213
|
+
|
|
214
|
+
All durable states live in a local SQLite database. If the database can't be opened, Magic Context disables itself and notifies the user.
|
|
215
|
+
|
|
216
|
+
```
|
|
217
|
+
~/.local/share/opencode/storage/plugin/magic-context/context.db
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
| Table | Purpose |
|
|
221
|
+
|-------|---------|
|
|
222
|
+
| `tags` | Tag assignments — message ID, tag number, session, status |
|
|
223
|
+
| `pending_ops` | Queued drop operations |
|
|
224
|
+
| `source_contents` | Raw content snapshots for persisted reductions |
|
|
225
|
+
| `compartments` | Historian-produced structured history blocks |
|
|
226
|
+
| `session_facts` | Categorized durable facts from historian runs |
|
|
227
|
+
| `session_notes` | Session-scoped `ctx_note` content |
|
|
228
|
+
| `session_meta` | Per-session state — usage, nudge flags, anchors |
|
|
229
|
+
| `memories` | Cross-session persistent memories |
|
|
230
|
+
| `memory_embeddings` | Embedding vectors for semantic search |
|
|
231
|
+
| `dream_state` | Dreamer lease locking and task progress |
|
|
232
|
+
| `dream_queue` | Queued projects awaiting dream processing |
|
|
233
|
+
| `recomp_compartments` | Staging for `/ctx-recomp` partial progress |
|
|
234
|
+
| `recomp_facts` | Staging for `/ctx-recomp` partial progress |
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## Development
|
|
239
|
+
|
|
240
|
+
**Requirements:** [Bun](https://bun.sh) ≥ 1.0
|
|
241
|
+
|
|
242
|
+
```sh
|
|
243
|
+
bun install # Install dependencies
|
|
244
|
+
bun run build # Build the plugin
|
|
245
|
+
bun run typecheck # Type-check without emitting
|
|
246
|
+
bun test # Run tests
|
|
247
|
+
bun run lint # Lint (Biome)
|
|
248
|
+
bun run lint:fix # Lint with auto-fix
|
|
249
|
+
bun run format # Format (Biome)
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
**Utility scripts:**
|
|
253
|
+
|
|
254
|
+
```sh
|
|
255
|
+
bun scripts/tail-view.ts # Show post-compartment message tail
|
|
256
|
+
bun scripts/context-dump.ts # Dump full context state for a session
|
|
257
|
+
bun scripts/backfill-embeddings.ts # Backfill missing memory embeddings
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Dream execution requires a live OpenCode server — the dreamer creates ephemeral child sessions. Use `/ctx-dream` inside OpenCode for on-demand maintenance.
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## Contributing
|
|
265
|
+
|
|
266
|
+
Bug reports and pull requests are welcome. For larger changes, open an issue first to discuss the approach.
|
|
267
|
+
|
|
268
|
+
Run `bun run format` before submitting — CI rejects unformatted code.
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## License
|
|
273
|
+
|
|
274
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builtin-agents.d.ts","sourceRoot":"","sources":["../../src/agents/builtin-agents.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,sBAAsB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,SAAS,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,cAAc,EAAE,sBAAsB,EAalD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dreamer.d.ts","sourceRoot":"","sources":["../../src/agents/dreamer.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"historian.d.ts","sourceRoot":"","sources":["../../src/agents/historian.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-agent magic context system prompt sections.
|
|
3
|
+
* Each agent gets tailored guidance based on its workflow patterns.
|
|
4
|
+
*/
|
|
5
|
+
type AgentType = "sisyphus" | "atlas" | "hephaestus" | "sisyphus-junior" | "oracle" | "athena" | "athena-junior";
|
|
6
|
+
/**
|
|
7
|
+
* Detect which agent is active by scanning the system prompt for known signatures.
|
|
8
|
+
* Returns the detected agent type or null for unknown agents.
|
|
9
|
+
* Order matters — more specific signatures (e.g., "Sisyphus-Junior") are checked first.
|
|
10
|
+
*/
|
|
11
|
+
export declare function detectAgentFromSystemPrompt(systemPrompt: string): AgentType | null;
|
|
12
|
+
export declare function buildMagicContextSection(agent: AgentType | null, protectedTags: number): string;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=magic-context-prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"magic-context-prompt.d.ts","sourceRoot":"","sources":["../../src/agents/magic-context-prompt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,KAAK,SAAS,GACR,UAAU,GACV,OAAO,GACP,YAAY,GACZ,iBAAiB,GACjB,QAAQ,GACR,QAAQ,GACR,eAAe,CAAC;AA8JtB;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAOlF;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAQ/F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidekick.d.ts","sourceRoot":"","sources":["../../src/agents/sidekick.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { AgentConfig } from "@opencode-ai/sdk";
|
|
2
|
+
export type AgentMode = "primary" | "subagent" | "all";
|
|
3
|
+
export interface AgentPromptMetadata {
|
|
4
|
+
category: "exploration" | "specialist" | "advisor" | "utility";
|
|
5
|
+
cost: "FREE" | "CHEAP" | "EXPENSIVE";
|
|
6
|
+
triggers: Array<{
|
|
7
|
+
domain: string;
|
|
8
|
+
trigger: string;
|
|
9
|
+
}>;
|
|
10
|
+
useWhen?: string[];
|
|
11
|
+
avoidWhen?: string[];
|
|
12
|
+
dedicatedSection?: string;
|
|
13
|
+
promptAlias?: string;
|
|
14
|
+
keyTrigger?: string;
|
|
15
|
+
}
|
|
16
|
+
export type AgentFactory = ((model?: string) => AgentConfig) & {
|
|
17
|
+
mode: AgentMode;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/agents/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,KAAK,CAAC;AAEvD,MAAM,WAAW,mBAAmB;IAChC,QAAQ,EAAE,aAAa,GAAG,YAAY,GAAG,SAAS,GAAG,SAAS,CAAC;IAC/D,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,WAAW,CAAC;IACrC,QAAQ,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,WAAW,CAAC,GAAG;IAC3D,IAAI,EAAE,SAAS,CAAC;CACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-fallback-requirements.d.ts","sourceRoot":"","sources":["../../src/cli/model-fallback-requirements.ts"],"names":[],"mappings":"AAEA,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAErF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type MagicContextConfig } from "./schema/magic-context";
|
|
2
|
+
export interface MagicContextPluginConfig extends MagicContextConfig {
|
|
3
|
+
disabled_hooks?: string[];
|
|
4
|
+
command?: Record<string, {
|
|
5
|
+
template: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
agent?: string;
|
|
8
|
+
model?: string;
|
|
9
|
+
subtask?: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
12
|
+
export declare function loadPluginConfig(directory: string): MagicContextPluginConfig;
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,kBAAkB,EAA4B,MAAM,wBAAwB,CAAC;AAE3F,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;IAChE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CACZ,MAAM,EACN;QACI,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,OAAO,CAAC;KACrB,CACJ,CAAC;CACL;AA4FD,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,wBAAwB,CAsB5E"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { AgentConfig } from "@opencode-ai/sdk";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export declare const MAGIC_CONTEXT_AGENT_OVERRIDE_KEYS: readonly ["historian", "dreamer", "sidekick"];
|
|
4
|
+
export declare const AgentOverrideConfigSchema: z.ZodObject<{
|
|
5
|
+
model: z.ZodOptional<z.ZodString>;
|
|
6
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
top_p: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
9
|
+
tools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
10
|
+
disable: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
+
description: z.ZodOptional<z.ZodString>;
|
|
12
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
13
|
+
subagent: "subagent";
|
|
14
|
+
primary: "primary";
|
|
15
|
+
all: "all";
|
|
16
|
+
}>>;
|
|
17
|
+
color: z.ZodOptional<z.ZodString>;
|
|
18
|
+
maxSteps: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
permission: z.ZodOptional<z.ZodObject<{
|
|
20
|
+
edit: z.ZodOptional<z.ZodEnum<{
|
|
21
|
+
ask: "ask";
|
|
22
|
+
allow: "allow";
|
|
23
|
+
deny: "deny";
|
|
24
|
+
}>>;
|
|
25
|
+
bash: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
26
|
+
ask: "ask";
|
|
27
|
+
allow: "allow";
|
|
28
|
+
deny: "deny";
|
|
29
|
+
}>, z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
30
|
+
ask: "ask";
|
|
31
|
+
allow: "allow";
|
|
32
|
+
deny: "deny";
|
|
33
|
+
}>>]>>;
|
|
34
|
+
webfetch: z.ZodOptional<z.ZodEnum<{
|
|
35
|
+
ask: "ask";
|
|
36
|
+
allow: "allow";
|
|
37
|
+
deny: "deny";
|
|
38
|
+
}>>;
|
|
39
|
+
doom_loop: z.ZodOptional<z.ZodEnum<{
|
|
40
|
+
ask: "ask";
|
|
41
|
+
allow: "allow";
|
|
42
|
+
deny: "deny";
|
|
43
|
+
}>>;
|
|
44
|
+
external_directory: z.ZodOptional<z.ZodEnum<{
|
|
45
|
+
ask: "ask";
|
|
46
|
+
allow: "allow";
|
|
47
|
+
deny: "deny";
|
|
48
|
+
}>>;
|
|
49
|
+
}, z.core.$strip>>;
|
|
50
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
52
|
+
fallback_models: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
export type AgentOverrideConfig = z.infer<typeof AgentOverrideConfigSchema> & Partial<AgentConfig>;
|
|
55
|
+
//# sourceMappingURL=agent-overrides.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-overrides.d.ts","sourceRoot":"","sources":["../../../src/config/schema/agent-overrides.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,iCAAiC,+CAAgD,CAAC;AAgB/F,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkBpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC"}
|