@cortexkit/opencode-magic-context 0.41.4 → 0.42.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/README.md +21 -3
- package/dist/agents/hidden-agent-registrations.d.ts +1 -3
- package/dist/agents/hidden-agent-registrations.d.ts.map +1 -1
- package/dist/agents/magic-context-prompt.d.ts +1 -1
- package/dist/agents/magic-context-prompt.d.ts.map +1 -1
- package/dist/agents/permissions.d.ts +1 -22
- package/dist/agents/permissions.d.ts.map +1 -1
- package/dist/config/agent-disable.d.ts +0 -5
- package/dist/config/agent-disable.d.ts.map +1 -1
- package/dist/config/index.d.ts +5 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/migrate-config-location.d.ts.map +1 -1
- package/dist/config/project-security.d.ts +20 -2
- package/dist/config/project-security.d.ts.map +1 -1
- package/dist/config/removed-agent-config.d.ts +8 -0
- package/dist/config/removed-agent-config.d.ts.map +1 -0
- package/dist/config/schema/magic-context.d.ts +43 -201
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/{conflict-warning-hook-ejkc9sjn.js → conflict-warning-hook-6p3xqeac.js} +3 -3
- package/dist/{derive-budgets-bc366cz8.js → derive-budgets-s2pgnnm4.js} +1 -1
- package/dist/features/builtin-commands/commands.d.ts +0 -4
- package/dist/features/builtin-commands/commands.d.ts.map +1 -1
- package/dist/features/magic-context/compaction-marker.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts +15 -4
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-storage.d.ts.map +1 -1
- package/dist/features/magic-context/context-authority.d.ts +31 -4
- package/dist/features/magic-context/context-authority.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/classify.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/evaluate-smart-notes.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/map-memories.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/open-opencode-db.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/refresh-primers.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/retrospective-orphan-sweep.d.ts +19 -9
- package/dist/features/magic-context/dreamer/retrospective-orphan-sweep.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/storage-dream-runs.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts +4 -0
- package/dist/features/magic-context/dreamer/task-scheduler.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -1
- package/dist/features/magic-context/fail-closed-block.d.ts.map +1 -1
- package/dist/features/magic-context/git-commits/sweep-coordinator.d.ts.map +1 -1
- package/dist/features/magic-context/index.d.ts +0 -1
- package/dist/features/magic-context/index.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-identity.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-local.d.ts +13 -0
- package/dist/features/magic-context/memory/embedding-local.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-model-match.d.ts +41 -0
- package/dist/features/magic-context/memory/embedding-model-match.d.ts.map +1 -0
- package/dist/features/magic-context/memory/embedding-openai.d.ts +7 -20
- package/dist/features/magic-context/memory/embedding-openai.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-provider.d.ts +2 -2
- package/dist/features/magic-context/memory/embedding-provider.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-synapse.d.ts +48 -14
- package/dist/features/magic-context/memory/embedding-synapse.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding.d.ts +1 -1
- package/dist/features/magic-context/memory/embedding.d.ts.map +1 -1
- package/dist/features/magic-context/memory/memory-migration.d.ts.map +1 -1
- package/dist/features/magic-context/memory/project-identity.d.ts +1 -0
- package/dist/features/magic-context/memory/project-identity.d.ts.map +1 -1
- package/dist/features/magic-context/memory/promotion.d.ts +7 -1
- package/dist/features/magic-context/memory/promotion.d.ts.map +1 -1
- package/dist/features/magic-context/merged-reasoning-decisions.d.ts +6 -0
- package/dist/features/magic-context/merged-reasoning-decisions.d.ts.map +1 -0
- package/dist/features/magic-context/message-fts-rowid-map.d.ts.map +1 -1
- package/dist/features/magic-context/message-index-async.d.ts +12 -0
- package/dist/features/magic-context/message-index-async.d.ts.map +1 -1
- package/dist/features/magic-context/message-index.d.ts.map +1 -1
- package/dist/features/magic-context/migrations.d.ts.map +1 -1
- package/dist/features/magic-context/mural/compress-cues.d.ts.map +1 -1
- package/dist/features/magic-context/mural/render-trigger.d.ts +6 -0
- package/dist/features/magic-context/mural/render-trigger.d.ts.map +1 -1
- package/dist/features/magic-context/no-content-compartment.d.ts +12 -0
- package/dist/features/magic-context/no-content-compartment.d.ts.map +1 -0
- package/dist/features/magic-context/pi-content-decisions.d.ts +9 -0
- package/dist/features/magic-context/pi-content-decisions.d.ts.map +1 -0
- package/dist/features/magic-context/project-docs-hash.d.ts +4 -0
- package/dist/features/magic-context/project-docs-hash.d.ts.map +1 -1
- package/dist/features/magic-context/project-embedding-registry.d.ts +13 -4
- package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
- package/dist/features/magic-context/protection-window.d.ts +79 -0
- package/dist/features/magic-context/protection-window.d.ts.map +1 -0
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/features/magic-context/session-project-backfill.d.ts.map +1 -1
- package/dist/features/magic-context/shadow-backfill-state.d.ts +26 -0
- package/dist/features/magic-context/shadow-backfill-state.d.ts.map +1 -0
- package/dist/features/magic-context/smart-notes/compiler.d.ts.map +1 -1
- package/dist/features/magic-context/smart-notes/sandbox-runner.d.ts +4 -0
- package/dist/features/magic-context/smart-notes/sandbox-runner.d.ts.map +1 -1
- package/dist/features/magic-context/smart-notes/storage.d.ts.map +1 -1
- package/dist/features/magic-context/storage-clone.d.ts.map +1 -1
- package/dist/features/magic-context/storage-db.d.ts +1 -1
- package/dist/features/magic-context/storage-db.d.ts.map +1 -1
- package/dist/features/magic-context/storage-embedding-measurements.d.ts +2 -2
- package/dist/features/magic-context/storage-embedding-measurements.d.ts.map +1 -1
- package/dist/features/magic-context/storage-historian-runs.d.ts +4 -0
- package/dist/features/magic-context/storage-historian-runs.d.ts.map +1 -1
- package/dist/features/magic-context/storage-memory-mutation-log.d.ts +1 -0
- package/dist/features/magic-context/storage-memory-mutation-log.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +79 -13
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta.d.ts +1 -1
- package/dist/features/magic-context/storage-meta.d.ts.map +1 -1
- package/dist/features/magic-context/storage-native-replay.d.ts +29 -0
- package/dist/features/magic-context/storage-native-replay.d.ts.map +1 -0
- package/dist/features/magic-context/storage-notes.d.ts +6 -0
- package/dist/features/magic-context/storage-notes.d.ts.map +1 -1
- package/dist/features/magic-context/storage-replay-document.d.ts +33 -0
- package/dist/features/magic-context/storage-replay-document.d.ts.map +1 -0
- package/dist/features/magic-context/storage-subagent-invocations.d.ts +1 -1
- package/dist/features/magic-context/storage-subagent-invocations.d.ts.map +1 -1
- package/dist/features/magic-context/storage-tags.d.ts +19 -11
- package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
- package/dist/features/magic-context/storage.d.ts +3 -3
- package/dist/features/magic-context/storage.d.ts.map +1 -1
- package/dist/features/magic-context/subagent-token-capture.d.ts.map +1 -1
- package/dist/features/magic-context/tagger.d.ts +13 -0
- package/dist/features/magic-context/tagger.d.ts.map +1 -1
- package/dist/features/magic-context/tool-owner-backfill.d.ts.map +1 -1
- package/dist/features/magic-context/user-memory/review-user-memories.d.ts.map +1 -1
- package/dist/features/magic-context/user-memory/storage-user-memory.d.ts.map +1 -1
- package/dist/features/magic-context/workspaces.d.ts.map +1 -1
- package/dist/hooks/magic-context/apply-operations.d.ts +11 -5
- package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/cache-busting-signals.d.ts +9 -1
- package/dist/hooks/magic-context/cache-busting-signals.d.ts.map +1 -1
- package/dist/hooks/magic-context/caveman-cleanup.d.ts +1 -1
- package/dist/hooks/magic-context/caveman-cleanup.d.ts.map +1 -1
- package/dist/hooks/magic-context/channel2-delivery.d.ts.map +1 -1
- package/dist/hooks/magic-context/child-session-spawn.d.ts +3 -3
- package/dist/hooks/magic-context/child-session-spawn.d.ts.map +1 -1
- package/dist/hooks/magic-context/command-handler.d.ts +1 -10
- package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/compaction-marker-manager.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-drop-queue.d.ts +10 -21
- package/dist/hooks/magic-context/compartment-runner-drop-queue.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-partial-recomp.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-recomp.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts +1 -1
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts.map +1 -1
- package/dist/hooks/magic-context/ctx-reduce-nudge.d.ts +26 -2
- package/dist/hooks/magic-context/ctx-reduce-nudge.d.ts.map +1 -1
- package/dist/hooks/magic-context/decay-render.d.ts.map +1 -1
- package/dist/hooks/magic-context/dropped-input-guard.d.ts +9 -0
- package/dist/hooks/magic-context/dropped-input-guard.d.ts.map +1 -0
- package/dist/hooks/magic-context/embed-session-state.d.ts +1 -1
- package/dist/hooks/magic-context/embed-session-state.d.ts.map +1 -1
- package/dist/hooks/magic-context/emergency-drop.d.ts +6 -1
- package/dist/hooks/magic-context/emergency-drop.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-handler.d.ts +0 -1
- package/dist/hooks/magic-context/event-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-payloads.d.ts +7 -6
- package/dist/hooks/magic-context/event-payloads.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-resolvers.d.ts +1 -1
- package/dist/hooks/magic-context/event-resolvers.d.ts.map +1 -1
- package/dist/hooks/magic-context/execute-status.d.ts +3 -1
- package/dist/hooks/magic-context/execute-status.d.ts.map +1 -1
- package/dist/hooks/magic-context/format-embed-failure.d.ts +2 -1
- package/dist/hooks/magic-context/format-embed-failure.d.ts.map +1 -1
- package/dist/hooks/magic-context/format-embed-status.d.ts.map +1 -1
- package/dist/hooks/magic-context/heuristic-cleanup.d.ts +7 -1
- package/dist/hooks/magic-context/heuristic-cleanup.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook-handlers.d.ts +3 -1
- package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts +13 -4
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts +14 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/live-session-state.d.ts +1 -1
- package/dist/hooks/magic-context/lkg-slot.d.ts +34 -0
- package/dist/hooks/magic-context/lkg-slot.d.ts.map +1 -1
- package/dist/hooks/magic-context/maintenance-authority.d.ts +2 -2
- package/dist/hooks/magic-context/maintenance-authority.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-state-sync-timing.d.ts +21 -0
- package/dist/hooks/magic-context/module-state-sync-timing.d.ts.map +1 -0
- package/dist/hooks/magic-context/module-state-sync.d.ts +21 -7
- package/dist/hooks/magic-context/module-state-sync.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-transport.d.ts +12 -0
- package/dist/hooks/magic-context/module-transport.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-wire.d.ts +8 -0
- package/dist/hooks/magic-context/module-wire.d.ts.map +1 -1
- package/dist/hooks/magic-context/note-nudger.d.ts.map +1 -1
- package/dist/hooks/magic-context/persist-filtered-noise.d.ts +5 -0
- package/dist/hooks/magic-context/persist-filtered-noise.d.ts.map +1 -0
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts +6 -0
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-chunk.d.ts +18 -18
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-db.d.ts +22 -12
- package/dist/hooks/magic-context/read-session-db.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-formatting.d.ts +8 -0
- package/dist/hooks/magic-context/read-session-formatting.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-raw.d.ts +10 -1
- package/dist/hooks/magic-context/read-session-raw.d.ts.map +1 -1
- package/dist/hooks/magic-context/recomp-orchestrator.d.ts.map +1 -1
- package/dist/hooks/magic-context/reference-retrieval.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-mode-transform.d.ts +74 -9
- package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/send-session-notification.d.ts +11 -10
- package/dist/hooks/magic-context/send-session-notification.d.ts.map +1 -1
- package/dist/hooks/magic-context/strip-content.d.ts +7 -0
- package/dist/hooks/magic-context/strip-content.d.ts.map +1 -1
- package/dist/hooks/magic-context/supersession-reclaim.d.ts +13 -0
- package/dist/hooks/magic-context/supersession-reclaim.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-prompt-hash.d.ts +2 -3
- package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
- package/dist/hooks/magic-context/tail-hygiene-walk.d.ts +8 -3
- package/dist/hooks/magic-context/tail-hygiene-walk.d.ts.map +1 -1
- package/dist/hooks/magic-context/tool-drop-target.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-context-state.d.ts +7 -1
- package/dist/hooks/magic-context/transform-context-state.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +11 -4
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +7 -2
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/upgrade-reminder.d.ts +7 -9
- package/dist/hooks/magic-context/upgrade-reminder.d.ts.map +1 -1
- package/dist/hooks/magic-context/wrapup-orchestrator.d.ts.map +1 -1
- package/dist/index-1974jvn3.js +783 -0
- package/dist/{index-0y2mcg5y.js → index-1q9kay7n.js} +18717 -16197
- package/dist/{index-4avmwfp5.js → index-36wd1d6k.js} +6 -29
- package/dist/{index-fz104x1j.js → index-jmtjh2d3.js} +3 -3
- package/dist/{index-q264erdp.js → index-nqgjwfzn.js} +70 -38
- package/dist/{index-mjv9je4e.js → index-xdtge3y2.js} +45 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6457 -5190
- package/dist/plugin/conflict-warning-hook.d.ts +5 -6
- package/dist/plugin/conflict-warning-hook.d.ts.map +1 -1
- package/dist/plugin/dream-timer.d.ts +1 -0
- package/dist/plugin/dream-timer.d.ts.map +1 -1
- package/dist/plugin/embedding-bootstrap-helpers.d.ts.map +1 -1
- package/dist/plugin/embedding-routing.d.ts +4 -1
- package/dist/plugin/embedding-routing.d.ts.map +1 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts +16 -2
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/plugin/rpc-handlers.d.ts +31 -1
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/plugin/rust-tool-backends.d.ts +1 -0
- package/dist/plugin/rust-tool-backends.d.ts.map +1 -1
- package/dist/plugin/tool-registry.d.ts.map +1 -1
- package/dist/{recomp-orchestrator-q98r6rga.js → recomp-orchestrator-m33b3rk9.js} +5 -5
- package/dist/{send-session-notification-hdh02wy9.js → send-session-notification-1qeqkswb.js} +6 -4
- package/dist/shared/child-session-teardown.d.ts +34 -0
- package/dist/shared/child-session-teardown.d.ts.map +1 -0
- package/dist/shared/keep-subagents.d.ts +1 -1
- package/dist/shared/keep-subagents.d.ts.map +1 -1
- package/dist/shared/model-suggestion-retry.d.ts +1 -1
- package/dist/shared/opencode-db-path.d.ts +24 -0
- package/dist/shared/opencode-db-path.d.ts.map +1 -0
- package/dist/shared/prompt-surface-runtime.d.ts +10 -5
- package/dist/shared/prompt-surface-runtime.d.ts.map +1 -1
- package/dist/shared/resolve-fallbacks.d.ts +1 -1
- package/dist/shared/rpc-types.d.ts +121 -0
- package/dist/shared/rpc-types.d.ts.map +1 -1
- package/dist/shared/sqlite.d.ts +42 -0
- package/dist/shared/sqlite.d.ts.map +1 -1
- package/dist/shared/status-detail-text.d.ts +3 -1
- package/dist/shared/status-detail-text.d.ts.map +1 -1
- package/dist/shared/status-summary.d.ts +30 -0
- package/dist/shared/status-summary.d.ts.map +1 -0
- package/dist/shared/subagent-runner.d.ts +17 -10
- package/dist/shared/subagent-runner.d.ts.map +1 -1
- package/dist/shared/tag-transcript.d.ts.map +1 -1
- package/dist/shared/tail-hygiene-status.d.ts +1 -0
- package/dist/shared/tail-hygiene-status.d.ts.map +1 -1
- package/dist/shared/transcript.d.ts +6 -0
- package/dist/shared/transcript.d.ts.map +1 -1
- package/dist/shared/user-facing-codes.d.ts +191 -0
- package/dist/shared/user-facing-codes.d.ts.map +1 -0
- package/dist/shared/window-geometry.d.ts +23 -0
- package/dist/shared/window-geometry.d.ts.map +1 -1
- package/dist/shared/write-transaction-timing.d.ts +1 -1
- package/dist/shared/write-transaction-timing.d.ts.map +1 -1
- package/dist/{storage-meta-session-dvwfw778.js → storage-meta-session-e6g0mmec.js} +2 -2
- package/dist/tools/ctx-memory/tools.d.ts.map +1 -1
- package/dist/tools/ctx-memory/verification-recording.d.ts.map +1 -1
- package/dist/tools/ctx-note/constants.d.ts +1 -1
- package/dist/tools/ctx-note/constants.d.ts.map +1 -1
- package/dist/tools/ctx-note/tools.d.ts.map +1 -1
- package/dist/tools/ctx-note/types.d.ts +1 -0
- package/dist/tools/ctx-note/types.d.ts.map +1 -1
- package/dist/tools/ctx-reduce/tools.d.ts +10 -1
- package/dist/tools/ctx-reduce/tools.d.ts.map +1 -1
- package/dist/tools/ctx-search/constants.d.ts +1 -1
- package/dist/tools/ctx-search/constants.d.ts.map +1 -1
- package/dist/tools/light-descriptions.d.ts +2 -2
- package/dist/tools/light-descriptions.d.ts.map +1 -1
- package/package.json +2 -3
- package/src/agents/hidden-agent-registrations.ts +3 -15
- package/src/agents/magic-context-prompt.test.ts +7 -5
- package/src/agents/magic-context-prompt.ts +22 -30
- package/src/agents/permissions.test.ts +1 -42
- package/src/agents/permissions.ts +1 -24
- package/src/config/agent-disable.ts +5 -22
- package/src/config/index.test.ts +126 -15
- package/src/config/index.ts +41 -6
- package/src/config/latch-permanence-guard.test.ts +4 -0
- package/src/config/migrate-config-location.test.ts +39 -6
- package/src/config/migrate-config-location.ts +18 -31
- package/src/config/profiles.ts +1 -1
- package/src/config/project-security.hostile-matrix.test.ts +0 -8
- package/src/config/project-security.test.ts +21 -24
- package/src/config/project-security.ts +115 -14
- package/src/config/protected-tokens.test.ts +235 -0
- package/src/config/removed-agent-config.ts +45 -0
- package/src/config/removed-agent-source-fence.test.ts +56 -0
- package/src/config/schema/magic-context.test.ts +50 -42
- package/src/config/schema/magic-context.ts +70 -37
- package/src/shared/child-session-teardown.test.ts +218 -0
- package/src/shared/child-session-teardown.ts +66 -0
- package/src/shared/keep-subagents.ts +9 -14
- package/src/shared/model-suggestion-retry.ts +1 -1
- package/src/shared/opencode-db-path.test.ts +196 -0
- package/src/shared/opencode-db-path.ts +215 -0
- package/src/shared/prompt-surface-a1-golden.md +50 -35
- package/src/shared/prompt-surface-runtime.test.ts +28 -0
- package/src/shared/prompt-surface-runtime.ts +22 -5
- package/src/shared/resolve-fallbacks.ts +1 -1
- package/src/shared/rpc-types.ts +128 -0
- package/src/shared/session-messages-bounded.test.ts +1 -1
- package/src/shared/sqlite-import-fence.test.ts +19 -0
- package/src/shared/sqlite.test.ts +27 -1
- package/src/shared/sqlite.ts +204 -1
- package/src/shared/status-detail-text.test.ts +92 -20
- package/src/shared/status-detail-text.ts +24 -2
- package/src/shared/status-summary.ts +167 -0
- package/src/shared/subagent-runner.ts +17 -10
- package/src/shared/tag-transcript.ts +33 -21
- package/src/shared/tail-hygiene-status.ts +8 -0
- package/src/shared/transcript.ts +7 -0
- package/src/shared/user-facing-codes.test.ts +140 -0
- package/src/shared/user-facing-codes.ts +276 -0
- package/src/shared/window-geometry.test.ts +44 -0
- package/src/shared/window-geometry.ts +89 -11
- package/src/shared/write-transaction-attribution.test.ts +241 -0
- package/src/shared/write-transaction-timing.ts +2 -1
- package/src/tui/index.tsx +44 -11
- package/src/tui/slots/sidebar-content.tsx +12 -7
- package/src/tui-compiled/index.tsx +662 -649
- package/src/tui-compiled/slots/sidebar-content.tsx +301 -305
- package/dist/agents/sidekick.d.ts +0 -2
- package/dist/agents/sidekick.d.ts.map +0 -1
- package/dist/features/magic-context/defaults.d.ts +0 -2
- package/dist/features/magic-context/defaults.d.ts.map +0 -1
- package/dist/features/magic-context/sidekick/agent.d.ts +0 -14
- package/dist/features/magic-context/sidekick/agent.d.ts.map +0 -1
- package/dist/features/magic-context/sidekick/core.d.ts +0 -38
- package/dist/features/magic-context/sidekick/core.d.ts.map +0 -1
- package/dist/features/magic-context/sidekick/index.d.ts +0 -3
- package/dist/features/magic-context/sidekick/index.d.ts.map +0 -1
- package/dist/hooks/magic-context/boundary-execution.d.ts +0 -27
- package/dist/hooks/magic-context/boundary-execution.d.ts.map +0 -1
- package/dist/index-raatkvw5.js +0 -360
- package/src/agents/sidekick.ts +0 -1
- package/src/features/magic-context/defaults.ts +0 -1
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import type { EmbeddingFailureClass } from "../features/magic-context/memory/embedding-failure";
|
|
2
|
+
import type { PromptFailureClass } from "./model-suggestion-retry";
|
|
3
|
+
export declare const USER_FACING_FAILURES: {
|
|
4
|
+
readonly historian_unavailable: {
|
|
5
|
+
readonly code: "MC-H01";
|
|
6
|
+
readonly sentence: "History compression could not finish this turn.";
|
|
7
|
+
readonly action: "It will retry automatically.";
|
|
8
|
+
};
|
|
9
|
+
readonly recomp_unavailable: {
|
|
10
|
+
readonly code: "MC-R01";
|
|
11
|
+
readonly sentence: "History compression could not be rebuilt.";
|
|
12
|
+
readonly action: "Run /ctx-recomp again.";
|
|
13
|
+
};
|
|
14
|
+
readonly dream_provider_timeout: {
|
|
15
|
+
readonly code: "MC-D01";
|
|
16
|
+
readonly sentence: "Memory maintenance took too long to respond.";
|
|
17
|
+
readonly action: "Run /ctx-dream again.";
|
|
18
|
+
};
|
|
19
|
+
readonly dream_provider_error: {
|
|
20
|
+
readonly code: "MC-D02";
|
|
21
|
+
readonly sentence: "Memory maintenance could not reach its model.";
|
|
22
|
+
readonly action: "Check the model connection, then run /ctx-dream again.";
|
|
23
|
+
};
|
|
24
|
+
readonly dream_empty_completion: {
|
|
25
|
+
readonly code: "MC-D03";
|
|
26
|
+
readonly sentence: "Memory maintenance received no usable response.";
|
|
27
|
+
readonly action: "Run /ctx-dream again.";
|
|
28
|
+
};
|
|
29
|
+
readonly dream_no_models: {
|
|
30
|
+
readonly code: "MC-D04";
|
|
31
|
+
readonly sentence: "Memory maintenance has no model available.";
|
|
32
|
+
readonly action: "Check the model settings, then run /ctx-dream again.";
|
|
33
|
+
};
|
|
34
|
+
readonly dream_child_aborted: {
|
|
35
|
+
readonly code: "MC-D05";
|
|
36
|
+
readonly sentence: "Memory maintenance was interrupted.";
|
|
37
|
+
readonly action: "Run /ctx-dream again.";
|
|
38
|
+
};
|
|
39
|
+
readonly dream_parse_failed: {
|
|
40
|
+
readonly code: "MC-D06";
|
|
41
|
+
readonly sentence: "Memory maintenance could not use the model response.";
|
|
42
|
+
readonly action: "Run /ctx-dream again.";
|
|
43
|
+
};
|
|
44
|
+
readonly dream_unknown: {
|
|
45
|
+
readonly code: "MC-D07";
|
|
46
|
+
readonly sentence: "Memory maintenance could not finish.";
|
|
47
|
+
readonly action: "Run /ctx-dream again.";
|
|
48
|
+
};
|
|
49
|
+
readonly embedding_substitution_rejected: {
|
|
50
|
+
readonly code: "MC-E01";
|
|
51
|
+
readonly sentence: "Search indexing could not use the selected model.";
|
|
52
|
+
readonly action: "Check the embedding model setting, then run /ctx-embed start again.";
|
|
53
|
+
};
|
|
54
|
+
readonly embedding_http_error: {
|
|
55
|
+
readonly code: "MC-E02";
|
|
56
|
+
readonly sentence: "The search indexing provider refused the request.";
|
|
57
|
+
readonly action: "Check the provider connection and credentials, then run /ctx-embed start again.";
|
|
58
|
+
};
|
|
59
|
+
readonly embedding_transport_error: {
|
|
60
|
+
readonly code: "MC-E03";
|
|
61
|
+
readonly sentence: "Search indexing could not reach its provider.";
|
|
62
|
+
readonly action: "Check the connection, then run /ctx-embed start again.";
|
|
63
|
+
};
|
|
64
|
+
readonly embedding_invalid_envelope: {
|
|
65
|
+
readonly code: "MC-E04";
|
|
66
|
+
readonly sentence: "Search indexing received an unsupported response.";
|
|
67
|
+
readonly action: "Check the embedding endpoint, then run /ctx-embed start again.";
|
|
68
|
+
};
|
|
69
|
+
readonly embedding_empty_result: {
|
|
70
|
+
readonly code: "MC-E05";
|
|
71
|
+
readonly sentence: "Search indexing received no usable result.";
|
|
72
|
+
readonly action: "Run /ctx-embed start again.";
|
|
73
|
+
};
|
|
74
|
+
readonly embedding_certification_refusal: {
|
|
75
|
+
readonly code: "MC-E06";
|
|
76
|
+
readonly sentence: "Search indexing is not ready for this provider.";
|
|
77
|
+
readonly action: "Finish the provider setup, or set a fallback provider in the embedding settings, then run /ctx-embed start again.";
|
|
78
|
+
};
|
|
79
|
+
readonly embedding_credential_required: {
|
|
80
|
+
readonly code: "MC-E07";
|
|
81
|
+
readonly sentence: "Search indexing needs provider credentials.";
|
|
82
|
+
readonly action: "Sign in to the provider, then run /ctx-embed start again.";
|
|
83
|
+
};
|
|
84
|
+
readonly embedding_local_binding_missing: {
|
|
85
|
+
readonly code: "MC-E08";
|
|
86
|
+
readonly sentence: "Local search indexing is unavailable on this system.";
|
|
87
|
+
readonly action: "Run `npx @cortexkit/magic-context doctor`, then retry.";
|
|
88
|
+
};
|
|
89
|
+
readonly embedding_local_fs_unavailable: {
|
|
90
|
+
readonly code: "MC-E09";
|
|
91
|
+
readonly sentence: "Local search indexing cannot save its model files.";
|
|
92
|
+
readonly action: "Update or reinstall Magic Context, then retry.";
|
|
93
|
+
};
|
|
94
|
+
readonly embedding_local_download_failure: {
|
|
95
|
+
readonly code: "MC-E10";
|
|
96
|
+
readonly sentence: "Local search indexing could not download its model.";
|
|
97
|
+
readonly action: "Check the network connection, then retry.";
|
|
98
|
+
};
|
|
99
|
+
readonly embedding_local_runtime_error: {
|
|
100
|
+
readonly code: "MC-E11";
|
|
101
|
+
readonly sentence: "Local search indexing could not start.";
|
|
102
|
+
readonly action: "Run `npx @cortexkit/magic-context doctor`, then retry.";
|
|
103
|
+
};
|
|
104
|
+
readonly embedding_unavailable: {
|
|
105
|
+
readonly code: "MC-E12";
|
|
106
|
+
readonly sentence: "Search indexing could not finish.";
|
|
107
|
+
readonly action: "Run /ctx-embed start again.";
|
|
108
|
+
};
|
|
109
|
+
readonly status_unavailable: {
|
|
110
|
+
readonly code: "MC-S01";
|
|
111
|
+
readonly sentence: "Magic Context status is temporarily unavailable.";
|
|
112
|
+
readonly action: "Retry /ctx-status in a moment.";
|
|
113
|
+
};
|
|
114
|
+
readonly transform_update_failed: {
|
|
115
|
+
readonly code: "MC-S02";
|
|
116
|
+
readonly sentence: "The last context update did not finish.";
|
|
117
|
+
readonly action: "Send another message to retry.";
|
|
118
|
+
};
|
|
119
|
+
readonly configuration_warning: {
|
|
120
|
+
readonly code: "MC-S03";
|
|
121
|
+
readonly sentence: "Some configuration settings could not be applied.";
|
|
122
|
+
readonly action: "Fix the configuration warning shown in /ctx-status diagnostics, then restart.";
|
|
123
|
+
};
|
|
124
|
+
readonly status_log_unavailable: {
|
|
125
|
+
readonly code: "MC-S04";
|
|
126
|
+
readonly sentence: "Some diagnostic details could not be saved.";
|
|
127
|
+
readonly action: "Retry /ctx-status in a moment.";
|
|
128
|
+
};
|
|
129
|
+
readonly memory_writes_paused: {
|
|
130
|
+
readonly code: "MC-C01";
|
|
131
|
+
readonly sentence: "Memory writes are paused while the engine syncs.";
|
|
132
|
+
readonly action: "Retry in a moment.";
|
|
133
|
+
};
|
|
134
|
+
readonly memory_access_unavailable: {
|
|
135
|
+
readonly code: "MC-C02";
|
|
136
|
+
readonly sentence: "Memory access is temporarily unavailable.";
|
|
137
|
+
readonly action: "Retry in a moment.";
|
|
138
|
+
};
|
|
139
|
+
readonly note_changes_paused: {
|
|
140
|
+
readonly code: "MC-C03";
|
|
141
|
+
readonly sentence: "Note changes are paused while the engine syncs.";
|
|
142
|
+
readonly action: "Retry in a moment.";
|
|
143
|
+
};
|
|
144
|
+
readonly note_access_unavailable: {
|
|
145
|
+
readonly code: "MC-C04";
|
|
146
|
+
readonly sentence: "Notes are temporarily unavailable.";
|
|
147
|
+
readonly action: "Retry in a moment.";
|
|
148
|
+
};
|
|
149
|
+
readonly context_cleanup_paused: {
|
|
150
|
+
readonly code: "MC-C05";
|
|
151
|
+
readonly sentence: "Context cleanup is paused while the engine syncs.";
|
|
152
|
+
readonly action: "Retry in a moment.";
|
|
153
|
+
};
|
|
154
|
+
readonly partial_history_unavailable: {
|
|
155
|
+
readonly code: "MC-C06";
|
|
156
|
+
readonly sentence: "Partial history compression is not available in the current mode.";
|
|
157
|
+
readonly action: "Run /ctx-recomp without a range.";
|
|
158
|
+
};
|
|
159
|
+
readonly session_upgrade_unavailable: {
|
|
160
|
+
readonly code: "MC-C07";
|
|
161
|
+
readonly sentence: "Session upgrade is not available in the current mode.";
|
|
162
|
+
readonly action: "Run /ctx-recomp instead.";
|
|
163
|
+
};
|
|
164
|
+
readonly smart_note_conditions_unavailable: {
|
|
165
|
+
readonly code: "MC-C08";
|
|
166
|
+
readonly sentence: "Conditional notes are not available in the current mode.";
|
|
167
|
+
readonly action: "Save a regular note without a condition.";
|
|
168
|
+
};
|
|
169
|
+
readonly history_compression_paused: {
|
|
170
|
+
readonly code: "MC-C09";
|
|
171
|
+
readonly sentence: "History compression is paused while the engine syncs.";
|
|
172
|
+
readonly action: "Retry in a moment.";
|
|
173
|
+
};
|
|
174
|
+
readonly context_service_unavailable: {
|
|
175
|
+
readonly code: "MC-C10";
|
|
176
|
+
readonly sentence: "Magic Context is temporarily unavailable.";
|
|
177
|
+
readonly action: "Retry in a moment.";
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
export type UserFacingFailureKey = keyof typeof USER_FACING_FAILURES;
|
|
181
|
+
export type UserFacingTextStyle = "markdown" | "plain";
|
|
182
|
+
export declare function renderUserFacingFailure(key: UserFacingFailureKey, style?: UserFacingTextStyle): string;
|
|
183
|
+
export declare function userFacingFailureCode(key: UserFacingFailureKey): string;
|
|
184
|
+
export type CapabilityRefusal = "memory_write" | "memory_access" | "note_change" | "note_access" | "context_cleanup" | "partial_history" | "session_upgrade" | "smart_note_condition" | "history_compression" | "context_service";
|
|
185
|
+
export declare function renderCapabilityRefusal(capability: CapabilityRefusal): string;
|
|
186
|
+
export declare function capabilityRefusalCode(capability: CapabilityRefusal): string;
|
|
187
|
+
export declare function renderDreamFailure(failureClass: PromptFailureClass, style?: UserFacingTextStyle): string;
|
|
188
|
+
export declare function dreamFailureCode(failureClass: PromptFailureClass): string;
|
|
189
|
+
export declare function renderEmbeddingFailure(failureClass: EmbeddingFailureClass, style?: UserFacingTextStyle): string;
|
|
190
|
+
export declare function embeddingFailureCode(failureClass: EmbeddingFailureClass): string;
|
|
191
|
+
//# sourceMappingURL=user-facing-codes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-facing-codes.d.ts","sourceRoot":"","sources":["../../src/shared/user-facing-codes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oD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3,6 +3,12 @@ export declare const WINDOW_OVERLAY_SCHEMA = "fusiform-window-overlay/v1";
|
|
|
3
3
|
export declare const PROMPT_WALL_MARGIN = 4096;
|
|
4
4
|
export declare const PI_OUTPUT_FLOOR = 4096;
|
|
5
5
|
export declare const OPENCODE_OUTPUT_CAP = 32000;
|
|
6
|
+
/**
|
|
7
|
+
* Smallest context window any served model can plausibly have. Reported or
|
|
8
|
+
* inferred limits below this are placeholders (0, 1) or corrupt state, never a
|
|
9
|
+
* real window, so every denominator check shares this one floor.
|
|
10
|
+
*/
|
|
11
|
+
export declare const MIN_PLAUSIBLE_CONTEXT_LIMIT = 1024;
|
|
6
12
|
export type WindowGeometry = "shared_upfront" | "shared_truncating" | "separate";
|
|
7
13
|
export type WindowReserveSource = "output_catalog" | "output_config" | "wall_margin" | "none";
|
|
8
14
|
export type WindowOverlayGrade = "provider_asserted_runtime" | "measured" | "provider_asserted_doc" | "catalog" | "unknown";
|
|
@@ -45,11 +51,14 @@ export interface ResolvedWindowOverlayFacts {
|
|
|
45
51
|
/** Includes facts whose tagged value is explicitly unknown. */
|
|
46
52
|
facts: Record<string, WindowOverlayFact>;
|
|
47
53
|
}
|
|
54
|
+
export type WindowLimitSource = "catalog" | "overlay" | "provider" | "detected";
|
|
48
55
|
export interface WindowDerivation {
|
|
49
56
|
window: number;
|
|
50
57
|
reserve: number;
|
|
51
58
|
reserveSource: WindowReserveSource;
|
|
52
59
|
geometry: WindowGeometry;
|
|
60
|
+
windowSource: WindowLimitSource;
|
|
61
|
+
absoluteWall: number;
|
|
53
62
|
}
|
|
54
63
|
export interface WindowGeometryResult {
|
|
55
64
|
usableSoft: number;
|
|
@@ -87,6 +96,20 @@ export declare function resolveWindowOverlayFacts(providerID: string, modelID: s
|
|
|
87
96
|
/** Placeholder filtering is deliberately per output field, never a row-level rejection. */
|
|
88
97
|
export declare function placeholderFilteredOutput(output: number | undefined, context: number | undefined): number | undefined;
|
|
89
98
|
export declare function deriveWindowGeometry(providerID: string, modelID: string, catalogLimit: ModelLimit | undefined, options?: DeriveWindowGeometryOptions): WindowGeometryResult | undefined;
|
|
99
|
+
export interface ProvenInputFloorResult {
|
|
100
|
+
geometry: WindowGeometryResult;
|
|
101
|
+
refused?: {
|
|
102
|
+
reading: number;
|
|
103
|
+
absoluteWall: number;
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
export declare function hasTrustedAbsoluteWall(geometry: WindowGeometryResult): boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Successful requests can disprove static catalog metadata, but cannot
|
|
109
|
+
* disprove a provider, overlay, or observed-overflow wall. A reading beyond
|
|
110
|
+
* that wall is malformed usage accounting and must not enlarge the geometry.
|
|
111
|
+
*/
|
|
112
|
+
export declare function applyProvenInputFloor(geometry: WindowGeometryResult, provenInputTokens: number | undefined): ProvenInputFloorResult;
|
|
90
113
|
export declare function formatWindowDerivationLine(inputTokens: number, result: WindowGeometryResult): string;
|
|
91
114
|
export declare function formatCompactTokens(value: number): string;
|
|
92
115
|
//# sourceMappingURL=window-geometry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"window-geometry.d.ts","sourceRoot":"","sources":["../../src/shared/window-geometry.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,eAAO,MAAM,qBAAqB,+BAA+B,CAAC;AAClE,eAAO,MAAM,kBAAkB,OAAQ,CAAC;AACxC,eAAO,MAAM,eAAe,OAAQ,CAAC;AACrC,eAAO,MAAM,mBAAmB,QAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"window-geometry.d.ts","sourceRoot":"","sources":["../../src/shared/window-geometry.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,eAAO,MAAM,qBAAqB,+BAA+B,CAAC;AAClE,eAAO,MAAM,kBAAkB,OAAQ,CAAC;AACxC,eAAO,MAAM,eAAe,OAAQ,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AAO,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;CACvD;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,OAAO,CAE9E;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACjC,QAAQ,EAAE,oBAAoB,EAC9B,iBAAiB,EAAE,MAAM,GAAG,SAAS,GACtC,sBAAsB,CAuCxB;AAED,wBAAgB,0BAA0B,CACtC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,oBAAoB,GAC7B,MAAM,CASR;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQzD"}
|
|
@@ -7,5 +7,5 @@ export declare const SLOW_WRITE_TRANSACTION_THRESHOLD_MS = 1000;
|
|
|
7
7
|
* Log a slow write only after its COMMIT has completed. The timing diagnostic is
|
|
8
8
|
* deliberately best-effort so it can never change the transaction's behavior.
|
|
9
9
|
*/
|
|
10
|
-
export declare function logSlowWriteTransaction(site: string, startedAt: number, thresholdMs?: number): void;
|
|
10
|
+
export declare function logSlowWriteTransaction(site: string, startedAt: number, thresholdMs?: number, completedAtMs?: number): void;
|
|
11
11
|
//# sourceMappingURL=write-transaction-timing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-transaction-timing.d.ts","sourceRoot":"","sources":["../../src/shared/write-transaction-timing.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,mCAAmC,OAAQ,CAAC;AAEzD;;;GAGG;AACH,wBAAgB,uBAAuB,CACnC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,WAAW,SAAsC,
|
|
1
|
+
{"version":3,"file":"write-transaction-timing.d.ts","sourceRoot":"","sources":["../../src/shared/write-transaction-timing.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,mCAAmC,OAAQ,CAAC;AAEzD;;;GAGG;AACH,wBAAgB,uBAAuB,CACnC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,WAAW,SAAsC,EACjD,aAAa,SAAoB,GAClC,IAAI,CAQN"}
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
retryPendingSessionCleanups2,
|
|
7
7
|
retryPendingRustSessionCleanupsForProject2,
|
|
8
8
|
clearSession2
|
|
9
|
-
} from "./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
} from "./index-jmtjh2d3.js";
|
|
10
|
+
import"./index-1974jvn3.js";
|
|
11
11
|
import"./index-dkv2dn46.js";
|
|
12
12
|
export {
|
|
13
13
|
advanceToolReclaimWatermark2 as advanceToolReclaimWatermark,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-memory/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAuDhE,OAAO,EAKH,KAAK,iBAAiB,EACzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-memory/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAuDhE,OAAO,EAKH,KAAK,iBAAiB,EACzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAwhCrE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAI5F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verification-recording.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-memory/verification-recording.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"verification-recording.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-memory/verification-recording.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGpD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAYvE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const CTX_NOTE_DESCRIPTION = "Working notes for this session
|
|
1
|
+
export declare const CTX_NOTE_DESCRIPTION = "Working notes for this session \u2014 reminders, follow-ups, and things to revisit later.\n\nUse a note when something matters LATER but not in the next few steps: \"revisit the retry logic after the release\", \"user wants the dashboard polish batched\", \"flaky test to investigate when touching CI\". Don't use notes for active work (use todos) or durable project knowledge (use ctx_memory). Notes resurface at work boundaries and when read.\n\nActions:\n- write: save a note (content). Add surface_condition to make it a smart note (below).\n- read: list notes, newest first. Default: latest active session notes + ready smart notes; page older ones with limit/offset, or inspect other states with filter.\n- update: change a note by note_id. dismiss: retire one by note_id or 1\u201350 by note_ids; provide exactly one.\n\nSmart notes: pass surface_condition and the note stays hidden until a background checker confirms the condition \u2014 using ONLY externally verifiable signals (GitHub state via gh, files on disk, git history, web pages). It cannot see this conversation, so the condition must be checkable from outside:\n\u2713 \"When PR #42 in cortexkit/magic-context is merged\"\n\u2713 \"When the latest release tag is >= v0.22.0\"\n\u2713 \"When packages/plugin/src/foo.ts contains a function named bar\"\n\u2717 \"When the user mentions X\" / \"when we revisit Y\" / \"after we finish this refactor\" \u2014 no external signal; write a regular note instead.\n\nExample: ctx_note(action=\"write\", content=\"Re-run the perf benchmark once the boundary rework ships\", surface_condition=\"When the latest release tag is >= v0.23.0\")";
|
|
2
2
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-note/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-note/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,qnDAeoI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-note/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-note/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAsBhE,OAAO,KAAK,EAAuB,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAM7F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAMpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,QAAQ,CAAC;IACb,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAC/D,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACvC;AAwgBD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAIxF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-note/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,CAAC;AAErF,MAAM,WAAW,WAAY,SAAQ,mBAAmB;IACpD,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-note/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,CAAC;AAErF,MAAM,WAAW,WAAY,SAAQ,mBAAmB;IACpD,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB"}
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { type ToolDefinition } from "@opencode-ai/plugin";
|
|
2
|
+
import { type ProtectionWindowResult } from "../../features/magic-context/protection-window";
|
|
2
3
|
import type { RustToolBackends } from "../../plugin/rust-tool-backends";
|
|
3
4
|
import type { Database } from "../../shared/sqlite";
|
|
4
5
|
export { CTX_REDUCE_LIGHT_DESCRIPTION } from "../light-descriptions";
|
|
5
6
|
export interface CtxReduceToolDeps {
|
|
6
7
|
db: Database;
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Union projection form: protectedSet (tag-number set form).
|
|
10
|
+
* Coordinate space: tag-number space.
|
|
11
|
+
* Empty-window behavior: empty set means zero tool tags are protected by the window;
|
|
12
|
+
* requested drops apply immediately, and non-tool tags are never reclaim targets.
|
|
13
|
+
*/
|
|
14
|
+
protectedSet?: ReadonlySet<number> | ((sessionId: string) => ReadonlySet<number>);
|
|
15
|
+
getProtectionWindow?: (sessionId: string) => ProtectionWindowResult;
|
|
16
|
+
floor?: number;
|
|
8
17
|
getSessionTokens?: (sessionId: string) => number;
|
|
9
18
|
rustToolBackends?: RustToolBackends;
|
|
10
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-reduce/tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-reduce/tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAEH,KAAK,sBAAsB,EAC9B,MAAM,gDAAgD,CAAC;AAUxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAGxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAMpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,QAAQ,CAAC;IACb;;;;;OAKG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IAClF,mBAAmB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,sBAAsB,CAAC;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IACjD,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACvC;AAiPD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAI5F"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const CTX_SEARCH_TOOL_NAME = "ctx_search";
|
|
2
|
-
export declare const CTX_SEARCH_DESCRIPTION = "Your long-term recall for this project \u2014 search everything that ever happened here, not just what's currently visible.\n\nReach for it when something feels familiar but isn't in view: \"did we solve this before?\", \"what did we decide about X?\", \"when did this break?\", \"where does Y live?\". Results only contain things you CANNOT currently see \u2014 memories already shown in <project-memory> and the live conversation tail are filtered out. A query that is just one or more memory ids (e.g. `#7234` or `12, 34`) bypasses text search and resolves those ids directly.\n\nSources (omit for a broad search across all):\n- memory: curated cross-session project knowledge \u2014 rules, constraints, conventions.\n- message: the raw conversation behind your compacted history. Hits include message ordinals \u2014 expand the surrounding exchange with ctx_expand(start=N-10, end=N+5).\n- git_commit: this repository's commit history.\n- note: parked decisions
|
|
2
|
+
export declare const CTX_SEARCH_DESCRIPTION = "Your long-term recall for this project \u2014 search everything that ever happened here, not just what's currently visible.\n\nRetrieval matches meaning as well as exact words and fuses them, so phrasing matters: phrase `query` as a natural-language question that still contains the exact terms you expect in the answer (paths, symbols, config keys, error strings); a bare keyword stack finds less than a question carrying the same words.\n- Good: \"where is the retry backoff for the upload client configured?\"\n- Bad: \"upload client retry backoff config\"\n\nReach for it when something feels familiar but isn't in view: \"did we solve this before?\", \"what did we decide about X?\", \"when did this break?\", \"where does Y live?\". Results only contain things you CANNOT currently see \u2014 memories already shown in <project-memory> and the live conversation tail are filtered out. A query that is just one or more memory ids (e.g. `#7234` or `12, 34`) bypasses text search and resolves those ids directly.\n\nSources (omit for a broad search across all):\n- memory: curated cross-session project knowledge \u2014 rules, constraints, conventions.\n- message: the raw conversation behind your compacted history. Hits include message ordinals \u2014 expand the surrounding exchange with ctx_expand(start=N-10, end=N+5).\n- git_commit: this repository's commit history.\n- note: parked decisions and follow-ups with their recorded text.\n\nPicking sources:\n- \"when did this change / was this working before\" \u2192 [\"git_commit\", \"message\"]\n- \"did we discuss this earlier\" \u2192 [\"message\"]\n- \"did we decide something about this / leave a follow-up\" \u2192 [\"note\"]\n- \"what's our convention / rule for X\" \u2192 [\"memory\"]";
|
|
3
3
|
export declare const DEFAULT_CTX_SEARCH_LIMIT = 10;
|
|
4
4
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-search/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,eAAe,CAAC;AACjD,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-search/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,eAAe,CAAC;AACjD,eAAO,MAAM,sBAAsB,4tDAkBiB,CAAC;AACrD,eAAO,MAAM,wBAAwB,KAAK,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const CTX_REDUCE_LIGHT_DESCRIPTION = "For ctx_reduce users, mark spent \u00A7N\u00A7 outputs discardable; release is QUEUED, not immediate, so content stays visible until space is needed. Newest tags stay protected until they age out. Released content becomes a placeholder; recover it only by rerunning the source or recovery tool, so mark only genuinely finished material. Mark analyzed, redundant, persisted, or merely confirmatory outputs; keep user messages, unresolved errors, unextracted evidence, and exact wording. NEVER blanket-mark a large range: review every tag first.";
|
|
2
2
|
export declare const CTX_EXPAND_LIGHT_DESCRIPTION = "For ctx_expand users, recover compacted conversation by passing a session-history heading's inclusive start/end ordinals. Results are raw [N] U:/A: transcript capped near 15K tokens; oversized ranges return the head and a continuation. Use verbose=true to list each message ordinal, part previews, and tool-output sizes; use message=N for one complete stored message and its tool exchanges. NEVER expand ranges after the last compartment because that live tail is already visible.";
|
|
3
|
-
export declare const CTX_NOTE_LIGHT_DESCRIPTION = "For ctx_note
|
|
3
|
+
export declare const CTX_NOTE_LIGHT_DESCRIPTION = "For ctx_note: write saves, read lists, update changes, dismiss retires one note_id or 1\u201350 note_ids (choose one); surface_condition makes a smart note. Smart-note conditions must be externally verifiable via GitHub, disk, git, or web\u2014not this conversation or future actions.";
|
|
4
4
|
export declare const CTX_MEMORY_LIGHT_DESCRIPTION = "For ctx_memory users, write one standalone durable fact with category and content; update one ID, archive one or more IDs, merge two or more IDs, or get one to twenty numeric IDs. get reads memories in every status; list remains dreamer-only, so primary agents must NEVER assume bulk-list access.";
|
|
5
|
-
export declare const CTX_SEARCH_LIGHT_DESCRIPTION = "For ctx_search users, retrieve only hidden recall: memories not
|
|
5
|
+
export declare const CTX_SEARCH_LIGHT_DESCRIPTION = "For ctx_search users, retrieve only hidden recall: memories not in <project-memory>, compacted messages outside the live tail, commits, and notes; phrase query as a question carrying exact terms. Omit sources for broad search; select memory, message, git_commit, or note, or pass memory IDs directly. Hits expand through ctx_expand.";
|
|
6
6
|
//# sourceMappingURL=light-descriptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"light-descriptions.d.ts","sourceRoot":"","sources":["../../src/tools/light-descriptions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,oiBAA0hB,CAAC;AAEpkB,eAAO,MAAM,4BAA4B,qeAAqe,CAAC;AAE/gB,eAAO,MAAM,0BAA0B,
|
|
1
|
+
{"version":3,"file":"light-descriptions.d.ts","sourceRoot":"","sources":["../../src/tools/light-descriptions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,oiBAA0hB,CAAC;AAEpkB,eAAO,MAAM,4BAA4B,qeAAqe,CAAC;AAE/gB,eAAO,MAAM,0BAA0B,iSAAuR,CAAC;AAE/T,eAAO,MAAM,4BAA4B,6SAA6S,CAAC;AAEvV,eAAO,MAAM,4BAA4B,iVAAiV,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/opencode-magic-context",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "OpenCode plugin for Magic Context — cross-session memory and context management",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"src/shared",
|
|
30
30
|
"src/config",
|
|
31
31
|
"src/agents",
|
|
32
|
-
"src/features/magic-context/defaults.ts",
|
|
33
32
|
"src/features/magic-context/dreamer/cron.ts",
|
|
34
33
|
"src/features/magic-context/dreamer/task-registry.ts",
|
|
35
34
|
"README.md"
|
|
@@ -51,7 +50,7 @@
|
|
|
51
50
|
"prepublishOnly": "bun run build && bun run build:tui"
|
|
52
51
|
},
|
|
53
52
|
"dependencies": {
|
|
54
|
-
"@cortexkit/subc-client": "0.
|
|
53
|
+
"@cortexkit/subc-client": "0.11.1",
|
|
55
54
|
"@jitl/quickjs-singlefile-cjs-release-asyncify": "0.32.0",
|
|
56
55
|
"@opencode-ai/plugin": "^1.17.11",
|
|
57
56
|
"@opencode-ai/sdk": "^1.17.11",
|
|
@@ -24,8 +24,8 @@ import { applyDisallowedTools, buildAllowOnlyPermission } from "./permissions";
|
|
|
24
24
|
|
|
25
25
|
// Clamp a user-provided step override to the hidden-agent's built-in cap (loop
|
|
26
26
|
// insurance — see buildHiddenAgentConfig). Caps live as inline literals in
|
|
27
|
-
// buildHiddenAgentRegistrations (historian
|
|
28
|
-
// of tool calls for the historian
|
|
27
|
+
// buildHiddenAgentRegistrations (historian=40, dreamer=150): a handful
|
|
28
|
+
// of tool calls for the historian, a real multi-step maintenance loop
|
|
29
29
|
// for the dreamer.
|
|
30
30
|
function clampHiddenAgentStepLimit(value: unknown, cap: number): number {
|
|
31
31
|
return typeof value === "number" && Number.isFinite(value) ? Math.min(value, cap) : cap;
|
|
@@ -75,7 +75,7 @@ export interface HiddenAgentRegistration {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
|
-
* Hoisted function declaration: returns the
|
|
78
|
+
* Hoisted function declaration: returns the hidden-agent registrations with
|
|
79
79
|
* INLINE id / allow-list / step-cap literals (see {@link HiddenAgentRegistration}
|
|
80
80
|
* for why these must not come from module-level `var` consts). Prompts and
|
|
81
81
|
* computed overrides are passed in by the caller; the historian disallow filter
|
|
@@ -87,10 +87,8 @@ export function buildHiddenAgentRegistrations(args: {
|
|
|
87
87
|
historianPrompt: string | undefined;
|
|
88
88
|
historianRecompPrompt?: string | undefined;
|
|
89
89
|
historianEditorPrompt: string | undefined;
|
|
90
|
-
sidekickPrompt: string | undefined;
|
|
91
90
|
dreamerOverrides?: Record<string, unknown>;
|
|
92
91
|
historianOverrides?: Record<string, unknown>;
|
|
93
|
-
sidekickOverrides?: Record<string, unknown>;
|
|
94
92
|
historianDisallowed: readonly string[];
|
|
95
93
|
}): HiddenAgentRegistration[] {
|
|
96
94
|
const historianAllowedTools = applyDisallowedTools(
|
|
@@ -287,16 +285,6 @@ export function buildHiddenAgentRegistrations(args: {
|
|
|
287
285
|
maxSteps: 40,
|
|
288
286
|
overrides: args.historianOverrides,
|
|
289
287
|
},
|
|
290
|
-
{
|
|
291
|
-
id: "sidekick",
|
|
292
|
-
mode: "primary",
|
|
293
|
-
hidden: true,
|
|
294
|
-
description: HIDDEN_AGENT_DESCRIPTION,
|
|
295
|
-
prompt: args.sidekickPrompt,
|
|
296
|
-
allowedTools: ["ctx_search", "aft_outline", "aft_zoom"],
|
|
297
|
-
maxSteps: 40,
|
|
298
|
-
overrides: args.sidekickOverrides,
|
|
299
|
-
},
|
|
300
288
|
];
|
|
301
289
|
}
|
|
302
290
|
|
|
@@ -81,7 +81,7 @@ describe("buildMagicContextSection — subagent mode", () => {
|
|
|
81
81
|
expect(out).toContain("## Magic Context");
|
|
82
82
|
expect(out).toContain("§N§ identifiers");
|
|
83
83
|
expect(out).toContain("ctx_reduce");
|
|
84
|
-
expect(out).toContain("
|
|
84
|
+
expect(out).toContain("newest token-mass window");
|
|
85
85
|
});
|
|
86
86
|
|
|
87
87
|
it("OMITS the long-term-partner frame and primary-only guidance", () => {
|
|
@@ -95,9 +95,11 @@ describe("buildMagicContextSection — subagent mode", () => {
|
|
|
95
95
|
expect(out).not.toContain("ctx_expand");
|
|
96
96
|
});
|
|
97
97
|
|
|
98
|
-
it("
|
|
99
|
-
const
|
|
100
|
-
|
|
98
|
+
it("describes token-mass protection independently of a legacy count", () => {
|
|
99
|
+
const withSeven = buildMagicContextSection(null, 7, true, false, false, false, true);
|
|
100
|
+
const withTwenty = buildMagicContextSection(null, 20, true, false, false, false, true);
|
|
101
|
+
expect(withSeven).toBe(withTwenty);
|
|
102
|
+
expect(withSeven).toContain("newest token-mass window");
|
|
101
103
|
});
|
|
102
104
|
|
|
103
105
|
it("is much shorter than the full primary block", () => {
|
|
@@ -174,7 +176,7 @@ describe("buildMagicContextSection — caveman compression warning", () => {
|
|
|
174
176
|
it("emits the warning when caveman is enabled and ctx_reduce is unavailable", () => {
|
|
175
177
|
const out = buildMagicContextSection(
|
|
176
178
|
null, // agent
|
|
177
|
-
20, //
|
|
179
|
+
20, // legacy positional value (ignored in no-reduce path)
|
|
178
180
|
false, // ctx_reduce is unavailable in this session.
|
|
179
181
|
false, // dreamerEnabled
|
|
180
182
|
false, // temporalAwarenessEnabled
|