@retaw106/mmc-oc 0.0.0-stage → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/historian.d.ts +4 -0
- package/dist/agents/historian.d.ts.map +1 -0
- package/dist/agents/language-directive.d.ts +26 -0
- package/dist/agents/language-directive.d.ts.map +1 -0
- package/dist/agents/magic-context-prompt.d.ts +5 -0
- package/dist/agents/magic-context-prompt.d.ts.map +1 -0
- package/dist/agents/memory-maintainer.d.ts +96 -0
- package/dist/agents/memory-maintainer.d.ts.map +1 -0
- package/dist/config/agent-disable.d.ts +29 -0
- package/dist/config/agent-disable.d.ts.map +1 -0
- package/dist/config/config-paths.d.ts +7 -0
- package/dist/config/config-paths.d.ts.map +1 -0
- package/dist/config/index.d.ts +69 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/live-run-config.d.ts +11 -0
- package/dist/config/live-run-config.d.ts.map +1 -0
- package/dist/config/live-snapshot.d.ts +32 -0
- package/dist/config/live-snapshot.d.ts.map +1 -0
- package/dist/config/migrate-experimental.d.ts +26 -0
- package/dist/config/migrate-experimental.d.ts.map +1 -0
- package/dist/config/profiles.d.ts +22 -0
- package/dist/config/profiles.d.ts.map +1 -0
- package/dist/config/project-security.d.ts +124 -0
- package/dist/config/project-security.d.ts.map +1 -0
- package/dist/config/prune-config-leaf.d.ts +26 -0
- package/dist/config/prune-config-leaf.d.ts.map +1 -0
- package/dist/config/raw-loader.d.ts +42 -0
- package/dist/config/raw-loader.d.ts.map +1 -0
- 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/agent-overrides.d.ts +52 -0
- package/dist/config/schema/agent-overrides.d.ts.map +1 -0
- package/dist/config/schema/magic-context.d.ts +805 -0
- package/dist/config/schema/magic-context.d.ts.map +1 -0
- package/dist/config/variable.d.ts +48 -0
- package/dist/config/variable.d.ts.map +1 -0
- package/dist/context-a6px04s0.js +23932 -0
- package/dist/derive-budgets-fhk00zv8.js +18 -0
- package/dist/features/magic-context/compaction-marker.d.ts +211 -0
- package/dist/features/magic-context/compaction-marker.d.ts.map +1 -0
- package/dist/features/magic-context/compaction.d.ts +7 -0
- package/dist/features/magic-context/compaction.d.ts.map +1 -0
- package/dist/features/magic-context/compartment-events.d.ts +50 -0
- package/dist/features/magic-context/compartment-events.d.ts.map +1 -0
- package/dist/features/magic-context/compartment-lease.d.ts +28 -0
- package/dist/features/magic-context/compartment-lease.d.ts.map +1 -0
- package/dist/features/magic-context/compartment-storage.d.ts +178 -0
- package/dist/features/magic-context/compartment-storage.d.ts.map +1 -0
- package/dist/features/magic-context/compression-depth-storage.d.ts +14 -0
- package/dist/features/magic-context/compression-depth-storage.d.ts.map +1 -0
- package/dist/features/magic-context/context-authority.d.ts +15 -0
- package/dist/features/magic-context/context-authority.d.ts.map +1 -0
- package/dist/features/magic-context/fail-closed-block.d.ts +117 -0
- package/dist/features/magic-context/fail-closed-block.d.ts.map +1 -0
- package/dist/features/magic-context/index.d.ts +10 -0
- package/dist/features/magic-context/index.d.ts.map +1 -0
- package/dist/features/magic-context/literal-probes.d.ts +24 -0
- package/dist/features/magic-context/literal-probes.d.ts.map +1 -0
- package/dist/features/magic-context/lkg-prefix-chunks.d.ts +53 -0
- package/dist/features/magic-context/lkg-prefix-chunks.d.ts.map +1 -0
- package/dist/features/magic-context/memory/constants.d.ts +16 -0
- package/dist/features/magic-context/memory/constants.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/memory-diagnostics.d.ts +6 -0
- package/dist/features/magic-context/memory/memory-diagnostics.d.ts.map +1 -0
- package/dist/features/magic-context/memory/memory-selection.d.ts +12 -0
- package/dist/features/magic-context/memory/memory-selection.d.ts.map +1 -0
- package/dist/features/magic-context/memory/memory-visibility.d.ts +46 -0
- package/dist/features/magic-context/memory/memory-visibility.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-cache.d.ts +7 -0
- package/dist/features/magic-context/memory/project-identity-cache.d.ts.map +1 -0
- package/dist/features/magic-context/memory/project-identity.d.ts +97 -0
- package/dist/features/magic-context/memory/project-identity.d.ts.map +1 -0
- package/dist/features/magic-context/memory/promotion.d.ts +26 -0
- package/dist/features/magic-context/memory/promotion.d.ts.map +1 -0
- package/dist/features/magic-context/memory/relocate-memory.d.ts +58 -0
- package/dist/features/magic-context/memory/relocate-memory.d.ts.map +1 -0
- package/dist/features/magic-context/memory/storage-memory-fts.d.ts +11 -0
- package/dist/features/magic-context/memory/storage-memory-fts.d.ts.map +1 -0
- package/dist/features/magic-context/memory/storage-memory-verifications.d.ts +35 -0
- package/dist/features/magic-context/memory/storage-memory-verifications.d.ts.map +1 -0
- package/dist/features/magic-context/memory/storage-memory.d.ts +89 -0
- package/dist/features/magic-context/memory/storage-memory.d.ts.map +1 -0
- package/dist/features/magic-context/memory/types.d.ts +59 -0
- package/dist/features/magic-context/memory/types.d.ts.map +1 -0
- package/dist/features/magic-context/memory/verification-paths.d.ts +48 -0
- package/dist/features/magic-context/memory/verification-paths.d.ts.map +1 -0
- package/dist/features/magic-context/memory/visibility.d.ts +6 -0
- package/dist/features/magic-context/memory/visibility.d.ts.map +1 -0
- package/dist/features/magic-context/memory-maintainer/apply.d.ts +65 -0
- package/dist/features/magic-context/memory-maintainer/apply.d.ts.map +1 -0
- package/dist/features/magic-context/memory-maintainer/budget.d.ts +75 -0
- package/dist/features/magic-context/memory-maintainer/budget.d.ts.map +1 -0
- package/dist/features/magic-context/memory-maintainer/coverage.d.ts +91 -0
- package/dist/features/magic-context/memory-maintainer/coverage.d.ts.map +1 -0
- package/dist/features/magic-context/memory-maintainer/dream-state.d.ts +18 -0
- package/dist/features/magic-context/memory-maintainer/dream-state.d.ts.map +1 -0
- package/dist/features/magic-context/memory-maintainer/launcher.d.ts +119 -0
- package/dist/features/magic-context/memory-maintainer/launcher.d.ts.map +1 -0
- package/dist/features/magic-context/memory-maintainer/lease.d.ts +56 -0
- package/dist/features/magic-context/memory-maintainer/lease.d.ts.map +1 -0
- package/dist/features/magic-context/memory-maintainer/manifest.d.ts +127 -0
- package/dist/features/magic-context/memory-maintainer/manifest.d.ts.map +1 -0
- package/dist/features/magic-context/memory-maintainer/manual-commands.d.ts +46 -0
- package/dist/features/magic-context/memory-maintainer/manual-commands.d.ts.map +1 -0
- package/dist/features/magic-context/memory-maintainer/oc2-adapter.d.ts +79 -0
- package/dist/features/magic-context/memory-maintainer/oc2-adapter.d.ts.map +1 -0
- package/dist/features/magic-context/memory-maintainer/pause-report.d.ts +37 -0
- package/dist/features/magic-context/memory-maintainer/pause-report.d.ts.map +1 -0
- package/dist/features/magic-context/memory-maintainer/pipeline.d.ts +199 -0
- package/dist/features/magic-context/memory-maintainer/pipeline.d.ts.map +1 -0
- package/dist/features/magic-context/memory-maintainer/provider-output-failure.d.ts +15 -0
- package/dist/features/magic-context/memory-maintainer/provider-output-failure.d.ts.map +1 -0
- package/dist/features/magic-context/memory-maintainer/schedule-storage.d.ts +76 -0
- package/dist/features/magic-context/memory-maintainer/schedule-storage.d.ts.map +1 -0
- package/dist/features/magic-context/memory-maintainer/schedule.d.ts +90 -0
- package/dist/features/magic-context/memory-maintainer/schedule.d.ts.map +1 -0
- 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 +50 -0
- package/dist/features/magic-context/message-fts-rowid-map.d.ts.map +1 -0
- package/dist/features/magic-context/message-fts-session-filter.d.ts +14 -0
- package/dist/features/magic-context/message-fts-session-filter.d.ts.map +1 -0
- package/dist/features/magic-context/message-index-async.d.ts +33 -0
- package/dist/features/magic-context/message-index-async.d.ts.map +1 -0
- package/dist/features/magic-context/message-index-sweep.d.ts +11 -0
- package/dist/features/magic-context/message-index-sweep.d.ts.map +1 -0
- package/dist/features/magic-context/message-index.d.ts +88 -0
- package/dist/features/magic-context/message-index.d.ts.map +1 -0
- package/dist/features/magic-context/message-time-backfill.d.ts +19 -0
- package/dist/features/magic-context/message-time-backfill.d.ts.map +1 -0
- package/dist/features/magic-context/migration-v2-write-split.d.ts +62 -0
- package/dist/features/magic-context/migration-v2-write-split.d.ts.map +1 -0
- package/dist/features/magic-context/migrations.d.ts +73 -0
- package/dist/features/magic-context/migrations.d.ts.map +1 -0
- package/dist/features/magic-context/mock-database.d.ts +3 -0
- package/dist/features/magic-context/mock-database.d.ts.map +1 -0
- package/dist/features/magic-context/mural/storage-mural-cues.d.ts +65 -0
- package/dist/features/magic-context/mural/storage-mural-cues.d.ts.map +1 -0
- 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/opencode2-relabel.d.ts +132 -0
- package/dist/features/magic-context/opencode2-relabel.d.ts.map +1 -0
- package/dist/features/magic-context/overflow-detection.d.ts +108 -0
- package/dist/features/magic-context/overflow-detection.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-identity.d.ts +2 -0
- package/dist/features/magic-context/project-identity.d.ts.map +1 -0
- 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/range-parser.d.ts +18 -0
- package/dist/features/magic-context/range-parser.d.ts.map +1 -0
- package/dist/features/magic-context/reclaim-protection.d.ts +13 -0
- package/dist/features/magic-context/reclaim-protection.d.ts.map +1 -0
- package/dist/features/magic-context/resolve-subagent-fallback.d.ts +42 -0
- package/dist/features/magic-context/resolve-subagent-fallback.d.ts.map +1 -0
- package/dist/features/magic-context/scheduler.d.ts +20 -0
- package/dist/features/magic-context/scheduler.d.ts.map +1 -0
- package/dist/features/magic-context/schema-fence-probe.d.ts +29 -0
- package/dist/features/magic-context/schema-fence-probe.d.ts.map +1 -0
- package/dist/features/magic-context/search.d.ts +118 -0
- package/dist/features/magic-context/search.d.ts.map +1 -0
- package/dist/features/magic-context/session-cache-ttl.d.ts +10 -0
- package/dist/features/magic-context/session-cache-ttl.d.ts.map +1 -0
- package/dist/features/magic-context/session-decision-calibration.d.ts +31 -0
- package/dist/features/magic-context/session-decision-calibration.d.ts.map +1 -0
- package/dist/features/magic-context/session-project-backfill.d.ts +37 -0
- package/dist/features/magic-context/session-project-backfill.d.ts.map +1 -0
- package/dist/features/magic-context/session-project-storage.d.ts +23 -0
- package/dist/features/magic-context/session-project-storage.d.ts.map +1 -0
- package/dist/features/magic-context/storage-caveman-rules.d.ts +21 -0
- package/dist/features/magic-context/storage-caveman-rules.d.ts.map +1 -0
- package/dist/features/magic-context/storage-clone.d.ts +44 -0
- package/dist/features/magic-context/storage-clone.d.ts.map +1 -0
- package/dist/features/magic-context/storage-db.d.ts +183 -0
- package/dist/features/magic-context/storage-db.d.ts.map +1 -0
- package/dist/features/magic-context/storage-historian-runs.d.ts +79 -0
- package/dist/features/magic-context/storage-historian-runs.d.ts.map +1 -0
- package/dist/features/magic-context/storage-identity-merge.d.ts +26 -0
- package/dist/features/magic-context/storage-identity-merge.d.ts.map +1 -0
- package/dist/features/magic-context/storage-identity-rekey-map.d.ts +11 -0
- package/dist/features/magic-context/storage-identity-rekey-map.d.ts.map +1 -0
- package/dist/features/magic-context/storage-m0-mutation-log.d.ts +22 -0
- package/dist/features/magic-context/storage-m0-mutation-log.d.ts.map +1 -0
- package/dist/features/magic-context/storage-memory-mutation-log.d.ts +29 -0
- package/dist/features/magic-context/storage-memory-mutation-log.d.ts.map +1 -0
- package/dist/features/magic-context/storage-meta-persisted.d.ts +623 -0
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -0
- package/dist/features/magic-context/storage-meta-session.d.ts +14 -0
- package/dist/features/magic-context/storage-meta-session.d.ts.map +1 -0
- package/dist/features/magic-context/storage-meta-shared.d.ts +102 -0
- package/dist/features/magic-context/storage-meta-shared.d.ts.map +1 -0
- package/dist/features/magic-context/storage-meta.d.ts +4 -0
- package/dist/features/magic-context/storage-meta.d.ts.map +1 -0
- 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 +80 -0
- package/dist/features/magic-context/storage-notes.d.ts.map +1 -0
- package/dist/features/magic-context/storage-ops.d.ts +14 -0
- package/dist/features/magic-context/storage-ops.d.ts.map +1 -0
- package/dist/features/magic-context/storage-primers.d.ts +96 -0
- package/dist/features/magic-context/storage-primers.d.ts.map +1 -0
- package/dist/features/magic-context/storage-project-state.d.ts +19 -0
- package/dist/features/magic-context/storage-project-state.d.ts.map +1 -0
- package/dist/features/magic-context/storage-reasoning-removal.d.ts +30 -0
- package/dist/features/magic-context/storage-reasoning-removal.d.ts.map +1 -0
- package/dist/features/magic-context/storage-replay-document.d.ts +72 -0
- package/dist/features/magic-context/storage-replay-document.d.ts.map +1 -0
- package/dist/features/magic-context/storage-schema-helpers.d.ts +31 -0
- package/dist/features/magic-context/storage-schema-helpers.d.ts.map +1 -0
- package/dist/features/magic-context/storage-session-tables.d.ts +18 -0
- package/dist/features/magic-context/storage-session-tables.d.ts.map +1 -0
- package/dist/features/magic-context/storage-source.d.ts +5 -0
- package/dist/features/magic-context/storage-source.d.ts.map +1 -0
- package/dist/features/magic-context/storage-subagent-invocations.d.ts +62 -0
- package/dist/features/magic-context/storage-subagent-invocations.d.ts.map +1 -0
- package/dist/features/magic-context/storage-tags.d.ts +542 -0
- package/dist/features/magic-context/storage-tags.d.ts.map +1 -0
- package/dist/features/magic-context/storage-unavailable-reason.d.ts +17 -0
- package/dist/features/magic-context/storage-unavailable-reason.d.ts.map +1 -0
- package/dist/features/magic-context/storage-v22-backfill-failures.d.ts +26 -0
- package/dist/features/magic-context/storage-v22-backfill-failures.d.ts.map +1 -0
- package/dist/features/magic-context/storage.d.ts +23 -0
- package/dist/features/magic-context/storage.d.ts.map +1 -0
- package/dist/features/magic-context/store-generation-rebase.d.ts +188 -0
- package/dist/features/magic-context/store-generation-rebase.d.ts.map +1 -0
- package/dist/features/magic-context/subagent-token-capture.d.ts +35 -0
- package/dist/features/magic-context/subagent-token-capture.d.ts.map +1 -0
- package/dist/features/magic-context/tag-input.d.ts +4 -0
- package/dist/features/magic-context/tag-input.d.ts.map +1 -0
- package/dist/features/magic-context/tagger.d.ts +119 -0
- package/dist/features/magic-context/tagger.d.ts.map +1 -0
- package/dist/features/magic-context/tool-definition-tokens.d.ts +90 -0
- package/dist/features/magic-context/tool-definition-tokens.d.ts.map +1 -0
- package/dist/features/magic-context/tool-owner-backfill.d.ts +93 -0
- package/dist/features/magic-context/tool-owner-backfill.d.ts.map +1 -0
- package/dist/features/magic-context/transform-decision-log.d.ts +110 -0
- package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -0
- package/dist/features/magic-context/types.d.ts +133 -0
- package/dist/features/magic-context/types.d.ts.map +1 -0
- package/dist/features/magic-context/window-report-ledger.d.ts +70 -0
- package/dist/features/magic-context/window-report-ledger.d.ts.map +1 -0
- package/dist/features/magic-context/work-metrics.d.ts +79 -0
- package/dist/features/magic-context/work-metrics.d.ts.map +1 -0
- package/dist/features/magic-context/workspaces.d.ts +28 -0
- package/dist/features/magic-context/workspaces.d.ts.map +1 -0
- package/dist/hooks/auto-update-checker/semver.d.ts +26 -0
- package/dist/hooks/auto-update-checker/semver.d.ts.map +1 -0
- package/dist/hooks/magic-context/apply-operations.d.ts +158 -0
- package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -0
- package/dist/hooks/magic-context/auto-search-deadline.d.ts +10 -0
- package/dist/hooks/magic-context/auto-search-deadline.d.ts.map +1 -0
- package/dist/hooks/magic-context/auto-search-hint.d.ts +36 -0
- package/dist/hooks/magic-context/auto-search-hint.d.ts.map +1 -0
- package/dist/hooks/magic-context/auto-search-runner.d.ts +60 -0
- package/dist/hooks/magic-context/auto-search-runner.d.ts.map +1 -0
- package/dist/hooks/magic-context/cache-busting-signals.d.ts +42 -0
- package/dist/hooks/magic-context/cache-busting-signals.d.ts.map +1 -0
- package/dist/hooks/magic-context/caveman-cleanup.d.ts +98 -0
- package/dist/hooks/magic-context/caveman-cleanup.d.ts.map +1 -0
- package/dist/hooks/magic-context/caveman.d.ts +90 -0
- package/dist/hooks/magic-context/caveman.d.ts.map +1 -0
- package/dist/hooks/magic-context/channel2-cycle.d.ts +16 -0
- package/dist/hooks/magic-context/channel2-cycle.d.ts.map +1 -0
- package/dist/hooks/magic-context/channel2-delivery.d.ts +32 -0
- package/dist/hooks/magic-context/channel2-delivery.d.ts.map +1 -0
- package/dist/hooks/magic-context/child-session-spawn.d.ts +27 -0
- package/dist/hooks/magic-context/child-session-spawn.d.ts.map +1 -0
- package/dist/hooks/magic-context/compaction-marker-manager.d.ts +154 -0
- package/dist/hooks/magic-context/compaction-marker-manager.d.ts.map +1 -0
- package/dist/hooks/magic-context/compaction-off-transition.d.ts +97 -0
- package/dist/hooks/magic-context/compaction-off-transition.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-parser.d.ts +66 -0
- package/dist/hooks/magic-context/compartment-parser.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-prompt.d.ts +33 -0
- package/dist/hooks/magic-context/compartment-prompt.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-render-epoch.d.ts +27 -0
- package/dist/hooks/magic-context/compartment-render-epoch.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner-drop-queue.d.ts +29 -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 +43 -0
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts +31 -0
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner-mapping.d.ts +25 -0
- package/dist/hooks/magic-context/compartment-runner-mapping.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner-partial-recomp.d.ts +29 -0
- package/dist/hooks/magic-context/compartment-runner-partial-recomp.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner-recomp.d.ts +11 -0
- package/dist/hooks/magic-context/compartment-runner-recomp.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner-types.d.ts +295 -0
- package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts +83 -0
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner.d.ts +59 -0
- package/dist/hooks/magic-context/compartment-runner.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-trigger.d.ts +77 -0
- package/dist/hooks/magic-context/compartment-trigger.d.ts.map +1 -0
- package/dist/hooks/magic-context/ctx-reduce-availability.d.ts +170 -0
- package/dist/hooks/magic-context/ctx-reduce-availability.d.ts.map +1 -0
- package/dist/hooks/magic-context/ctx-reduce-nudge.d.ts +104 -0
- package/dist/hooks/magic-context/ctx-reduce-nudge.d.ts.map +1 -0
- package/dist/hooks/magic-context/decay-curve.d.ts +84 -0
- package/dist/hooks/magic-context/decay-curve.d.ts.map +1 -0
- package/dist/hooks/magic-context/decay-render.d.ts +80 -0
- package/dist/hooks/magic-context/decay-render.d.ts.map +1 -0
- package/dist/hooks/magic-context/decision-calibration.d.ts +24 -0
- package/dist/hooks/magic-context/decision-calibration.d.ts.map +1 -0
- package/dist/hooks/magic-context/degraded-pass-refusal.d.ts +35 -0
- package/dist/hooks/magic-context/degraded-pass-refusal.d.ts.map +1 -0
- package/dist/hooks/magic-context/derive-budgets.d.ts +60 -0
- package/dist/hooks/magic-context/derive-budgets.d.ts.map +1 -0
- package/dist/hooks/magic-context/drop-stale-reduce-calls.d.ts +39 -0
- package/dist/hooks/magic-context/drop-stale-reduce-calls.d.ts.map +1 -0
- package/dist/hooks/magic-context/dropped-input-guard.d.ts +55 -0
- package/dist/hooks/magic-context/dropped-input-guard.d.ts.map +1 -0
- package/dist/hooks/magic-context/dropped-token-estimate.d.ts +20 -0
- package/dist/hooks/magic-context/dropped-token-estimate.d.ts.map +1 -0
- package/dist/hooks/magic-context/edit-marker.d.ts +11 -0
- package/dist/hooks/magic-context/edit-marker.d.ts.map +1 -0
- package/dist/hooks/magic-context/emergency-drop.d.ts +112 -0
- package/dist/hooks/magic-context/emergency-drop.d.ts.map +1 -0
- package/dist/hooks/magic-context/emergency-fail-closed.d.ts +14 -0
- package/dist/hooks/magic-context/emergency-fail-closed.d.ts.map +1 -0
- package/dist/hooks/magic-context/empty-task-output.d.ts +16 -0
- package/dist/hooks/magic-context/empty-task-output.d.ts.map +1 -0
- package/dist/hooks/magic-context/event-payloads.d.ts +73 -0
- package/dist/hooks/magic-context/event-payloads.d.ts.map +1 -0
- package/dist/hooks/magic-context/event-resolvers.d.ts +114 -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/final-wire-token-estimate.d.ts +56 -0
- package/dist/hooks/magic-context/final-wire-token-estimate.d.ts.map +1 -0
- package/dist/hooks/magic-context/fold-execution-gate.d.ts +2 -0
- package/dist/hooks/magic-context/fold-execution-gate.d.ts.map +1 -0
- package/dist/hooks/magic-context/format-bytes.d.ts +2 -0
- package/dist/hooks/magic-context/format-bytes.d.ts.map +1 -0
- package/dist/hooks/magic-context/heuristic-cleanup.d.ts +48 -0
- package/dist/hooks/magic-context/heuristic-cleanup.d.ts.map +1 -0
- package/dist/hooks/magic-context/historian-no-fire-cause.d.ts +5 -0
- package/dist/hooks/magic-context/historian-no-fire-cause.d.ts.map +1 -0
- package/dist/hooks/magic-context/historian-prompt-fit.d.ts +112 -0
- package/dist/hooks/magic-context/historian-prompt-fit.d.ts.map +1 -0
- package/dist/hooks/magic-context/historian-prompt.generated.d.ts +2 -0
- package/dist/hooks/magic-context/historian-prompt.generated.d.ts.map +1 -0
- package/dist/hooks/magic-context/historian-publish-stage-logger.d.ts +3 -0
- package/dist/hooks/magic-context/historian-publish-stage-logger.d.ts.map +1 -0
- package/dist/hooks/magic-context/historian-state-file.d.ts +43 -0
- package/dist/hooks/magic-context/historian-state-file.d.ts.map +1 -0
- package/dist/hooks/magic-context/history-boundary-repair.d.ts +44 -0
- package/dist/hooks/magic-context/history-boundary-repair.d.ts.map +1 -0
- package/dist/hooks/magic-context/hook-handlers.d.ts +177 -0
- package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -0
- package/dist/hooks/magic-context/host-served-rows.d.ts +58 -0
- package/dist/hooks/magic-context/host-served-rows.d.ts.map +1 -0
- package/dist/hooks/magic-context/image-token-estimate.d.ts +15 -0
- package/dist/hooks/magic-context/image-token-estimate.d.ts.map +1 -0
- package/dist/hooks/magic-context/inject-compartments.d.ts +389 -0
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -0
- package/dist/hooks/magic-context/issue-135-wire-fixtures.d.ts +8 -0
- package/dist/hooks/magic-context/issue-135-wire-fixtures.d.ts.map +1 -0
- package/dist/hooks/magic-context/issue-423-fixture.d.ts +37 -0
- package/dist/hooks/magic-context/issue-423-fixture.d.ts.map +1 -0
- package/dist/hooks/magic-context/issue-424-fixture.d.ts +11 -0
- package/dist/hooks/magic-context/issue-424-fixture.d.ts.map +1 -0
- package/dist/hooks/magic-context/legacy-compartments.d.ts +20 -0
- package/dist/hooks/magic-context/legacy-compartments.d.ts.map +1 -0
- package/dist/hooks/magic-context/live-session-state.d.ts +68 -0
- package/dist/hooks/magic-context/live-session-state.d.ts.map +1 -0
- package/dist/hooks/magic-context/lkg-persist.d.ts +22 -0
- package/dist/hooks/magic-context/lkg-persist.d.ts.map +1 -0
- package/dist/hooks/magic-context/lkg-replay.d.ts +71 -0
- package/dist/hooks/magic-context/lkg-replay.d.ts.map +1 -0
- package/dist/hooks/magic-context/lkg-slot.d.ts +119 -0
- package/dist/hooks/magic-context/lkg-slot.d.ts.map +1 -0
- package/dist/hooks/magic-context/m0-token-breakdown.d.ts +44 -0
- package/dist/hooks/magic-context/m0-token-breakdown.d.ts.map +1 -0
- package/dist/hooks/magic-context/maintenance-authority.d.ts +2 -0
- package/dist/hooks/magic-context/maintenance-authority.d.ts.map +1 -0
- package/dist/hooks/magic-context/openai-compat-adjacency.d.ts +38 -0
- package/dist/hooks/magic-context/openai-compat-adjacency.d.ts.map +1 -0
- package/dist/hooks/magic-context/opencode-v1-store-fixture.d.ts +12 -0
- package/dist/hooks/magic-context/opencode-v1-store-fixture.d.ts.map +1 -0
- package/dist/hooks/magic-context/pass-outcome.d.ts +70 -0
- package/dist/hooks/magic-context/pass-outcome.d.ts.map +1 -0
- 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/postprocess-read-cache.d.ts +8 -0
- package/dist/hooks/magic-context/postprocess-read-cache.d.ts.map +1 -0
- package/dist/hooks/magic-context/producer-window-guard.d.ts +63 -0
- package/dist/hooks/magic-context/producer-window-guard.d.ts.map +1 -0
- package/dist/hooks/magic-context/producer-window-test-support.d.ts +14 -0
- package/dist/hooks/magic-context/producer-window-test-support.d.ts.map +1 -0
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts +234 -0
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts.map +1 -0
- package/dist/hooks/magic-context/raw-fallback-context-limit.d.ts +10 -0
- package/dist/hooks/magic-context/raw-fallback-context-limit.d.ts.map +1 -0
- package/dist/hooks/magic-context/read-session-chunk.d.ts +271 -0
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -0
- package/dist/hooks/magic-context/read-session-db.d.ts +66 -0
- package/dist/hooks/magic-context/read-session-db.d.ts.map +1 -0
- package/dist/hooks/magic-context/read-session-formatting.d.ts +65 -0
- package/dist/hooks/magic-context/read-session-formatting.d.ts.map +1 -0
- package/dist/hooks/magic-context/read-session-raw.d.ts +164 -0
- package/dist/hooks/magic-context/read-session-raw.d.ts.map +1 -0
- package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts +82 -0
- package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts.map +1 -0
- package/dist/hooks/magic-context/reasoning-removal.d.ts +60 -0
- package/dist/hooks/magic-context/reasoning-removal.d.ts.map +1 -0
- package/dist/hooks/magic-context/recomp-orchestrator.d.ts +93 -0
- package/dist/hooks/magic-context/recomp-orchestrator.d.ts.map +1 -0
- package/dist/hooks/magic-context/reference-retrieval.d.ts +72 -0
- package/dist/hooks/magic-context/reference-retrieval.d.ts.map +1 -0
- package/dist/hooks/magic-context/reference-seeds.generated.d.ts +8 -0
- package/dist/hooks/magic-context/reference-seeds.generated.d.ts.map +1 -0
- package/dist/hooks/magic-context/send-session-notification.d.ts +43 -0
- package/dist/hooks/magic-context/send-session-notification.d.ts.map +1 -0
- package/dist/hooks/magic-context/sentinel.d.ts +146 -0
- package/dist/hooks/magic-context/sentinel.d.ts.map +1 -0
- package/dist/hooks/magic-context/storage-busy-refusal.d.ts +20 -0
- package/dist/hooks/magic-context/storage-busy-refusal.d.ts.map +1 -0
- package/dist/hooks/magic-context/strip-content.d.ts +216 -0
- package/dist/hooks/magic-context/strip-content.d.ts.map +1 -0
- package/dist/hooks/magic-context/strip-structural-noise.d.ts +15 -0
- package/dist/hooks/magic-context/strip-structural-noise.d.ts.map +1 -0
- package/dist/hooks/magic-context/stripped-command.d.ts +56 -0
- package/dist/hooks/magic-context/stripped-command.d.ts.map +1 -0
- package/dist/hooks/magic-context/supersession-reclaim.d.ts +58 -0
- package/dist/hooks/magic-context/supersession-reclaim.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 +129 -0
- package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -0
- package/dist/hooks/magic-context/tag-content-primitives.d.ts +31 -0
- package/dist/hooks/magic-context/tag-content-primitives.d.ts.map +1 -0
- package/dist/hooks/magic-context/tag-id-fallback.d.ts +11 -0
- package/dist/hooks/magic-context/tag-id-fallback.d.ts.map +1 -0
- package/dist/hooks/magic-context/tag-messages.d.ts +145 -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/tail-hygiene-walk.d.ts +178 -0
- package/dist/hooks/magic-context/tail-hygiene-walk.d.ts.map +1 -0
- package/dist/hooks/magic-context/temporal-awareness.d.ts +73 -0
- package/dist/hooks/magic-context/temporal-awareness.d.ts.map +1 -0
- package/dist/hooks/magic-context/text-complete.d.ts +31 -0
- package/dist/hooks/magic-context/text-complete.d.ts.map +1 -0
- package/dist/hooks/magic-context/todo-view.d.ts +127 -0
- package/dist/hooks/magic-context/todo-view.d.ts.map +1 -0
- package/dist/hooks/magic-context/tokenizer-calibration.d.ts +92 -0
- package/dist/hooks/magic-context/tokenizer-calibration.d.ts.map +1 -0
- package/dist/hooks/magic-context/tool-drop-target.d.ts +144 -0
- package/dist/hooks/magic-context/tool-drop-target.d.ts.map +1 -0
- package/dist/hooks/magic-context/tool-input-size.d.ts +21 -0
- package/dist/hooks/magic-context/tool-input-size.d.ts.map +1 -0
- package/dist/hooks/magic-context/tool-reclaim.d.ts +12 -0
- package/dist/hooks/magic-context/tool-reclaim.d.ts.map +1 -0
- package/dist/hooks/magic-context/tool-sweep-policy.d.ts +50 -0
- package/dist/hooks/magic-context/tool-sweep-policy.d.ts.map +1 -0
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts +133 -0
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -0
- package/dist/hooks/magic-context/transform-context-state.d.ts +28 -0
- package/dist/hooks/magic-context/transform-context-state.d.ts.map +1 -0
- package/dist/hooks/magic-context/transform-message-helpers.d.ts +32 -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 +350 -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 +334 -0
- package/dist/hooks/magic-context/transform.d.ts.map +1 -0
- package/dist/hooks/magic-context/unmanaged-over-window.d.ts +36 -0
- package/dist/hooks/magic-context/unmanaged-over-window.d.ts.map +1 -0
- package/dist/hooks/magic-context/unresolved-history-boundary.d.ts +15 -0
- package/dist/hooks/magic-context/unresolved-history-boundary.d.ts.map +1 -0
- package/dist/hooks/magic-context/wrapup-orchestrator.d.ts +14 -0
- package/dist/hooks/magic-context/wrapup-orchestrator.d.ts.map +1 -0
- package/dist/index-1vs6anwz.js +126 -0
- package/dist/index-3wagyrnj.js +670 -0
- package/dist/index-53g38ggt.js +40 -0
- package/dist/index-5pg0acf7.js +410 -0
- package/dist/index-977gxfz0.js +514 -0
- package/dist/index-by6h2pav.js +27883 -0
- package/dist/index-e1q8002h.js +16 -0
- package/dist/index-fg34g6a5.js +584 -0
- package/dist/index-jdxxq8cz.js +99 -0
- package/dist/index-me3zcj5t.js +69 -0
- package/dist/index-qbkzdkk0.js +496 -0
- package/dist/index-wgt4gamw.js +6388 -0
- package/dist/index-zx63j2e2.js +907 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/message-time-backfill-5ewk0axe.js +116 -0
- package/dist/model-resolution-5haaxnpt.js +6 -0
- package/dist/plugin/boot-deadline.d.ts +47 -0
- package/dist/plugin/boot-deadline.d.ts.map +1 -0
- package/dist/plugin/boot-quiet.d.ts +12 -0
- package/dist/plugin/boot-quiet.d.ts.map +1 -0
- package/dist/plugin/normalize-tool-arg-schemas.d.ts +7 -0
- package/dist/plugin/normalize-tool-arg-schemas.d.ts.map +1 -0
- package/dist/plugin/rpc-handlers.d.ts +52 -0
- package/dist/plugin/rpc-handlers.d.ts.map +1 -0
- package/dist/plugin/sidebar-snapshot-cache.d.ts +19 -0
- package/dist/plugin/sidebar-snapshot-cache.d.ts.map +1 -0
- package/dist/plugin/subagent-tool-policy.d.ts +9 -0
- package/dist/plugin/subagent-tool-policy.d.ts.map +1 -0
- package/dist/plugin/types.d.ts +3 -0
- package/dist/plugin/types.d.ts.map +1 -0
- package/dist/prompt-context-ffa5xcfx.js +76 -0
- package/dist/read-session-chunk-apjwrttc.js +56 -0
- package/dist/recomp-orchestrator-gyeevxaw.js +21 -0
- package/dist/rpc-notifications-4amf6mf4.js +14 -0
- package/dist/safe-notification-target-ph3xd1ve.js +9 -0
- package/dist/send-session-notification-y29y9fsr.js +18 -0
- package/dist/shared/announcement.d.ts +69 -0
- package/dist/shared/announcement.d.ts.map +1 -0
- package/dist/shared/assistant-message-extractor.d.ts +13 -0
- package/dist/shared/assistant-message-extractor.d.ts.map +1 -0
- package/dist/shared/auto-update-provenance.d.ts +9 -0
- package/dist/shared/auto-update-provenance.d.ts.map +1 -0
- package/dist/shared/bounded-session-map.d.ts +45 -0
- package/dist/shared/bounded-session-map.d.ts.map +1 -0
- package/dist/shared/builtin-commands.d.ts +24 -0
- package/dist/shared/builtin-commands.d.ts.map +1 -0
- package/dist/shared/cache-ttl-display.d.ts +25 -0
- package/dist/shared/cache-ttl-display.d.ts.map +1 -0
- package/dist/shared/cache-ttl-seed.d.ts +10 -0
- package/dist/shared/cache-ttl-seed.d.ts.map +1 -0
- package/dist/shared/child-session-teardown.d.ts +34 -0
- package/dist/shared/child-session-teardown.d.ts.map +1 -0
- package/dist/shared/commit-detection.d.ts +29 -0
- package/dist/shared/commit-detection.d.ts.map +1 -0
- package/dist/shared/config-diagnostics.d.ts +30 -0
- package/dist/shared/config-diagnostics.d.ts.map +1 -0
- package/dist/shared/conflict-detector.d.ts +139 -0
- package/dist/shared/conflict-detector.d.ts.map +1 -0
- package/dist/shared/conflict-fixer.d.ts +20 -0
- package/dist/shared/conflict-fixer.d.ts.map +1 -0
- package/dist/shared/context-limit-provenance.d.ts +3 -0
- package/dist/shared/context-limit-provenance.d.ts.map +1 -0
- package/dist/shared/data-path.d.ts +176 -0
- package/dist/shared/data-path.d.ts.map +1 -0
- package/dist/shared/error-message.d.ts +32 -0
- package/dist/shared/error-message.d.ts.map +1 -0
- package/dist/shared/escalation-bands.d.ts +9 -0
- package/dist/shared/escalation-bands.d.ts.map +1 -0
- package/dist/shared/format-bytes.d.ts +2 -0
- package/dist/shared/format-bytes.d.ts.map +1 -0
- package/dist/shared/format-threshold.d.ts +43 -0
- package/dist/shared/format-threshold.d.ts.map +1 -0
- package/dist/shared/harness-provider-map.d.ts +64 -0
- package/dist/shared/harness-provider-map.d.ts.map +1 -0
- package/dist/shared/harness.d.ts +55 -0
- package/dist/shared/harness.d.ts.map +1 -0
- package/dist/shared/hidden-variant-warnings.d.ts +5 -0
- package/dist/shared/hidden-variant-warnings.d.ts.map +1 -0
- package/dist/shared/historian-tool-expansions.d.ts +5 -0
- package/dist/shared/historian-tool-expansions.d.ts.map +1 -0
- package/dist/shared/historian-tool-template.d.ts +5 -0
- package/dist/shared/historian-tool-template.d.ts.map +1 -0
- package/dist/shared/historian-transient-error.d.ts +2 -0
- package/dist/shared/historian-transient-error.d.ts.map +1 -0
- package/dist/shared/host-limitations.d.ts +14 -0
- package/dist/shared/host-limitations.d.ts.map +1 -0
- package/dist/shared/index.d.ts +8 -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-edit.d.ts +23 -0
- package/dist/shared/jsonc-edit.d.ts.map +1 -0
- package/dist/shared/jsonc-parser.d.ts +30 -0
- package/dist/shared/jsonc-parser.d.ts.map +1 -0
- package/dist/shared/keep-subagents.d.ts +7 -0
- package/dist/shared/keep-subagents.d.ts.map +1 -0
- package/dist/shared/logger.d.ts +18 -0
- package/dist/shared/logger.d.ts.map +1 -0
- package/dist/shared/model-cache-ttl.d.ts +9 -0
- package/dist/shared/model-cache-ttl.d.ts.map +1 -0
- package/dist/shared/model-resolution.d.ts +35 -0
- package/dist/shared/model-resolution.d.ts.map +1 -0
- package/dist/shared/model-suggestion-retry.d.ts +138 -0
- package/dist/shared/model-suggestion-retry.d.ts.map +1 -0
- package/dist/shared/models-dev-cache.d.ts +156 -0
- package/dist/shared/models-dev-cache.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-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 +57 -0
- package/dist/shared/opencode-config-dir.d.ts.map +1 -0
- package/dist/shared/opencode-db-path.d.ts +68 -0
- package/dist/shared/opencode-db-path.d.ts.map +1 -0
- package/dist/shared/pi-executable.d.ts +6 -0
- package/dist/shared/pi-executable.d.ts.map +1 -0
- package/dist/shared/plugin-package-version.d.ts +14 -0
- package/dist/shared/plugin-package-version.d.ts.map +1 -0
- package/dist/shared/project-directory-key.d.ts +26 -0
- package/dist/shared/project-directory-key.d.ts.map +1 -0
- package/dist/shared/prompt-context.d.ts +31 -0
- package/dist/shared/prompt-context.d.ts.map +1 -0
- package/dist/shared/prompt-surface-a1-golden.d.ts +28 -0
- package/dist/shared/prompt-surface-a1-golden.d.ts.map +1 -0
- package/dist/shared/prompt-surface-runtime.d.ts +62 -0
- package/dist/shared/prompt-surface-runtime.d.ts.map +1 -0
- package/dist/shared/prompt-surface.d.ts +53 -0
- package/dist/shared/prompt-surface.d.ts.map +1 -0
- package/dist/shared/provider-response-completion.d.ts +12 -0
- package/dist/shared/provider-response-completion.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/redaction.d.ts +7 -0
- package/dist/shared/redaction.d.ts.map +1 -0
- package/dist/shared/resolve-fallbacks.d.ts +48 -0
- package/dist/shared/resolve-fallbacks.d.ts.map +1 -0
- package/dist/shared/rpc-client.d.ts +28 -0
- package/dist/shared/rpc-client.d.ts.map +1 -0
- package/dist/shared/rpc-notifications.d.ts +74 -0
- package/dist/shared/rpc-notifications.d.ts.map +1 -0
- package/dist/shared/rpc-server.d.ts +52 -0
- package/dist/shared/rpc-server.d.ts.map +1 -0
- package/dist/shared/rpc-types.d.ts +385 -0
- package/dist/shared/rpc-types.d.ts.map +1 -0
- package/dist/shared/rpc-utils.d.ts +162 -0
- package/dist/shared/rpc-utils.d.ts.map +1 -0
- package/dist/shared/run-token-log.d.ts +13 -0
- package/dist/shared/run-token-log.d.ts.map +1 -0
- package/dist/shared/safe-notification-target.d.ts +23 -0
- package/dist/shared/safe-notification-target.d.ts.map +1 -0
- package/dist/shared/sqlite-context-pragmas.d.ts +12 -0
- package/dist/shared/sqlite-context-pragmas.d.ts.map +1 -0
- package/dist/shared/sqlite-helpers.d.ts +25 -0
- package/dist/shared/sqlite-helpers.d.ts.map +1 -0
- package/dist/shared/sqlite-write-locker-test-support.d.ts +7 -0
- package/dist/shared/sqlite-write-locker-test-support.d.ts.map +1 -0
- package/dist/shared/sqlite.d.ts +163 -0
- package/dist/shared/sqlite.d.ts.map +1 -0
- package/dist/shared/stable-json.d.ts +21 -0
- package/dist/shared/stable-json.d.ts.map +1 -0
- package/dist/shared/status-detail-text.d.ts +4 -0
- package/dist/shared/status-detail-text.d.ts.map +1 -0
- package/dist/shared/status-summary.d.ts +54 -0
- package/dist/shared/status-summary.d.ts.map +1 -0
- package/dist/shared/status-view-check.d.ts +130 -0
- package/dist/shared/status-view-check.d.ts.map +1 -0
- package/dist/shared/status-view.d.ts +230 -0
- package/dist/shared/status-view.d.ts.map +1 -0
- package/dist/shared/storage-permissions.d.ts +29 -0
- package/dist/shared/storage-permissions.d.ts.map +1 -0
- package/dist/shared/subagent-runner.d.ts +231 -0
- package/dist/shared/subagent-runner.d.ts.map +1 -0
- package/dist/shared/summarize-child-stderr.d.ts +2 -0
- package/dist/shared/summarize-child-stderr.d.ts.map +1 -0
- package/dist/shared/system-directive.d.ts +3 -0
- package/dist/shared/system-directive.d.ts.map +1 -0
- package/dist/shared/tag-owner-id.d.ts +19 -0
- package/dist/shared/tag-owner-id.d.ts.map +1 -0
- package/dist/shared/tag-transcript.d.ts +103 -0
- package/dist/shared/tag-transcript.d.ts.map +1 -0
- package/dist/shared/tail-hygiene-status.d.ts +24 -0
- package/dist/shared/tail-hygiene-status.d.ts.map +1 -0
- package/dist/shared/test-temp-dir.d.ts +46 -0
- package/dist/shared/test-temp-dir.d.ts.map +1 -0
- package/dist/shared/transcript.d.ts +251 -0
- package/dist/shared/transcript.d.ts.map +1 -0
- package/dist/shared/user-answer.d.ts +4 -0
- package/dist/shared/user-answer.d.ts.map +1 -0
- package/dist/shared/user-facing-codes.d.ts +135 -0
- package/dist/shared/user-facing-codes.d.ts.map +1 -0
- package/dist/shared/window-geometry.d.ts +121 -0
- package/dist/shared/window-geometry.d.ts.map +1 -0
- package/dist/shared/write-transaction-timing.d.ts +11 -0
- package/dist/shared/write-transaction-timing.d.ts.map +1 -0
- package/dist/shared/xml-unescape.d.ts +9 -0
- package/dist/shared/xml-unescape.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/mode.d.ts +35 -0
- package/dist/tools/ctx-expand/mode.d.ts.map +1 -0
- package/dist/tools/ctx-expand/render.d.ts +47 -0
- package/dist/tools/ctx-expand/render.d.ts.map +1 -0
- package/dist/tools/ctx-expand/tools.d.ts +10 -0
- package/dist/tools/ctx-expand/tools.d.ts.map +1 -0
- package/dist/tools/ctx-expand/types.d.ts +11 -0
- package/dist/tools/ctx-expand/types.d.ts.map +1 -0
- package/dist/tools/ctx-memory/constants.d.ts +3 -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 +5 -0
- package/dist/tools/ctx-memory/tools.d.ts.map +1 -0
- package/dist/tools/ctx-memory/types.d.ts +38 -0
- package/dist/tools/ctx-memory/types.d.ts.map +1 -0
- package/dist/tools/ctx-memory/verification-recording.d.ts +8 -0
- package/dist/tools/ctx-memory/verification-recording.d.ts.map +1 -0
- package/dist/tools/ctx-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/render.d.ts +67 -0
- package/dist/tools/ctx-note/render.d.ts.map +1 -0
- package/dist/tools/ctx-note/tools.d.ts +13 -0
- package/dist/tools/ctx-note/tools.d.ts.map +1 -0
- package/dist/tools/ctx-note/types.d.ts +14 -0
- package/dist/tools/ctx-note/types.d.ts.map +1 -0
- package/dist/tools/ctx-reduce/constants.d.ts +4 -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 +19 -0
- package/dist/tools/ctx-reduce/tools.d.ts.map +1 -0
- package/dist/tools/ctx-reduce/types.d.ts +5 -0
- package/dist/tools/ctx-reduce/types.d.ts.map +1 -0
- package/dist/tools/ctx-search/constants.d.ts +4 -0
- package/dist/tools/ctx-search/constants.d.ts.map +1 -0
- package/dist/tools/ctx-search/date-range.d.ts +9 -0
- package/dist/tools/ctx-search/date-range.d.ts.map +1 -0
- package/dist/tools/ctx-search/index.d.ts +4 -0
- package/dist/tools/ctx-search/index.d.ts.map +1 -0
- package/dist/tools/ctx-search/tools.d.ts +5 -0
- package/dist/tools/ctx-search/tools.d.ts.map +1 -0
- package/dist/tools/ctx-search/types.d.ts +34 -0
- package/dist/tools/ctx-search/types.d.ts.map +1 -0
- package/dist/tools/light-descriptions.d.ts +6 -0
- package/dist/tools/light-descriptions.d.ts.map +1 -0
- package/dist/tools/parameter-descriptions.d.ts +75 -0
- package/dist/tools/parameter-descriptions.d.ts.map +1 -0
- package/dist/tools/unwrap-imitated-reduced-args.d.ts +21 -0
- package/dist/tools/unwrap-imitated-reduced-args.d.ts.map +1 -0
- package/dist/v2/fold/boundary.d.ts +61 -0
- package/dist/v2/fold/boundary.d.ts.map +1 -0
- package/dist/v2/fold/host-media.d.ts +36 -0
- package/dist/v2/fold/host-media.d.ts.map +1 -0
- package/dist/v2/fold/markers.d.ts +7 -0
- package/dist/v2/fold/markers.d.ts.map +1 -0
- package/dist/v2/fold/owner.d.ts +40 -0
- package/dist/v2/fold/owner.d.ts.map +1 -0
- package/dist/v2/fold/restore.d.ts +31 -0
- package/dist/v2/fold/restore.d.ts.map +1 -0
- package/dist/v2/fork-inheritance.d.ts +101 -0
- package/dist/v2/fork-inheritance.d.ts.map +1 -0
- package/dist/v2/hidden-child-cleanup.d.ts +11 -0
- package/dist/v2/hidden-child-cleanup.d.ts.map +1 -0
- package/dist/v2/hidden-child-native.d.ts +29 -0
- package/dist/v2/hidden-child-native.d.ts.map +1 -0
- package/dist/v2/hidden-child-record.d.ts +137 -0
- package/dist/v2/hidden-child-record.d.ts.map +1 -0
- package/dist/v2/hidden-completion.d.ts +57 -0
- package/dist/v2/hidden-completion.d.ts.map +1 -0
- package/dist/v2/hooks/channel2.d.ts +10 -0
- package/dist/v2/hooks/channel2.d.ts.map +1 -0
- package/dist/v2/hooks/commands.d.ts +29 -0
- package/dist/v2/hooks/commands.d.ts.map +1 -0
- package/dist/v2/hooks/context.d.ts +112 -0
- package/dist/v2/hooks/context.d.ts.map +1 -0
- package/dist/v2/hooks/deleted-session-tombstones.d.ts +10 -0
- package/dist/v2/hooks/deleted-session-tombstones.d.ts.map +1 -0
- package/dist/v2/hooks/generate.d.ts +10 -0
- package/dist/v2/hooks/generate.d.ts.map +1 -0
- package/dist/v2/hooks/hidden-child.d.ts +76 -0
- package/dist/v2/hooks/hidden-child.d.ts.map +1 -0
- package/dist/v2/hooks/hidden-terminal-error.d.ts +8 -0
- package/dist/v2/hooks/hidden-terminal-error.d.ts.map +1 -0
- package/dist/v2/hooks/lkg-system.d.ts +11 -0
- package/dist/v2/hooks/lkg-system.d.ts.map +1 -0
- package/dist/v2/hooks/model-limit-cache.d.ts +19 -0
- package/dist/v2/hooks/model-limit-cache.d.ts.map +1 -0
- package/dist/v2/hooks/payload.d.ts +15 -0
- package/dist/v2/hooks/payload.d.ts.map +1 -0
- package/dist/v2/hooks/refusal.d.ts +15 -0
- package/dist/v2/hooks/refusal.d.ts.map +1 -0
- package/dist/v2/hooks/restore-rows.d.ts +29 -0
- package/dist/v2/hooks/restore-rows.d.ts.map +1 -0
- package/dist/v2/hooks/rpc-live-state.d.ts +9 -0
- package/dist/v2/hooks/rpc-live-state.d.ts.map +1 -0
- package/dist/v2/hooks/session-api-gate.d.ts +4 -0
- package/dist/v2/hooks/session-api-gate.d.ts.map +1 -0
- package/dist/v2/hooks/session-project-backfill.d.ts +15 -0
- package/dist/v2/hooks/session-project-backfill.d.ts.map +1 -0
- package/dist/v2/hooks/storage-gate.d.ts +48 -0
- package/dist/v2/hooks/storage-gate.d.ts.map +1 -0
- package/dist/v2/hooks/storage-notice.d.ts +29 -0
- package/dist/v2/hooks/storage-notice.d.ts.map +1 -0
- package/dist/v2/hooks/store.d.ts +58 -0
- package/dist/v2/hooks/store.d.ts.map +1 -0
- package/dist/v2/hooks/tools.d.ts +8 -0
- package/dist/v2/hooks/tools.d.ts.map +1 -0
- package/dist/v2/hooks/types.d.ts +250 -0
- package/dist/v2/hooks/types.d.ts.map +1 -0
- package/dist/v2/hooks/usage-persist.d.ts +31 -0
- package/dist/v2/hooks/usage-persist.d.ts.map +1 -0
- package/dist/v2/hooks/usage-reading.d.ts +46 -0
- package/dist/v2/hooks/usage-reading.d.ts.map +1 -0
- package/dist/v2/server.d.ts +27 -0
- package/dist/v2/server.d.ts.map +1 -0
- package/dist/v2/server.js +76235 -0
- package/dist/v2/store-reader.d.ts +218 -0
- package/dist/v2/store-reader.d.ts.map +1 -0
- package/dist/web/api.d.ts +40 -0
- package/dist/web/api.d.ts.map +1 -0
- package/dist/web/context-store.d.ts +74 -0
- package/dist/web/context-store.d.ts.map +1 -0
- package/dist/web/fixtures.d.ts +53 -0
- package/dist/web/fixtures.d.ts.map +1 -0
- package/dist/web/host-opencode.d.ts +56 -0
- package/dist/web/host-opencode.d.ts.map +1 -0
- package/dist/web/host-pi.d.ts +116 -0
- package/dist/web/host-pi.d.ts.map +1 -0
- package/dist/web/main.d.ts +24 -0
- package/dist/web/main.d.ts.map +1 -0
- package/dist/web/main.js +6071 -0
- package/dist/web/memories.d.ts +67 -0
- package/dist/web/memories.d.ts.map +1 -0
- package/dist/web/server.d.ts +42 -0
- package/dist/web/server.d.ts.map +1 -0
- package/dist/web/types.d.ts +52 -0
- package/dist/web/types.d.ts.map +1 -0
- package/dist/web/ui/favicon.svg +4 -0
- package/dist/web/ui/index.html +36 -0
- package/dist/web/ui/panel.css +8 -0
- package/dist/web/ui/panel.js +373 -0
- package/dist/web/views.d.ts +155 -0
- package/dist/web/views.d.ts.map +1 -0
- package/dist/web/writes.d.ts +86 -0
- package/dist/web/writes.d.ts.map +1 -0
- package/dist/wrapup-orchestrator-z9sqpqjf.js +420 -0
- package/index.js +1 -0
- package/package.json +84 -4
- package/src/agents/historian.ts +3 -0
- package/src/agents/language-directive.test.ts +129 -0
- package/src/agents/language-directive.ts +113 -0
- package/src/agents/magic-context-prompt.language.test.ts +37 -0
- package/src/agents/magic-context-prompt.test.ts +520 -0
- package/src/agents/magic-context-prompt.ts +196 -0
- package/src/agents/memory-maintainer.test.ts +249 -0
- package/src/agents/memory-maintainer.ts +374 -0
- package/src/config/agent-disable.ts +58 -0
- package/src/config/compaction-accessor-guard.test.ts +81 -0
- package/src/config/compaction-backcompat.test.ts +52 -0
- package/src/config/config-paths.ts +42 -0
- package/src/config/index.test.ts +1252 -0
- package/src/config/index.ts +762 -0
- package/src/config/latch-permanence-guard.test.ts +218 -0
- package/src/config/live-run-config.test.ts +139 -0
- package/src/config/live-run-config.ts +79 -0
- package/src/config/live-schema-drift.test.ts +67 -0
- package/src/config/live-snapshot.test.ts +86 -0
- package/src/config/live-snapshot.ts +187 -0
- package/src/config/migrate-experimental.ts +92 -0
- package/src/config/misplaced-agent-model.test.ts +55 -0
- package/src/config/profiles.ts +106 -0
- package/src/config/project-config-trust-boundary.test.ts +185 -0
- package/src/config/project-security.hostile-matrix.test.ts +281 -0
- package/src/config/project-security.test.ts +329 -0
- package/src/config/project-security.ts +940 -0
- package/src/config/protected-tokens.test.ts +229 -0
- package/src/config/prune-config-leaf.test.ts +78 -0
- package/src/config/prune-config-leaf.ts +67 -0
- package/src/config/raw-loader.test.ts +389 -0
- package/src/config/raw-loader.ts +435 -0
- package/src/config/removed-agent-config.ts +45 -0
- package/src/config/removed-agent-source-fence.test.ts +53 -0
- package/src/config/removed-config-keys.test.ts +106 -0
- package/src/config/schema/agent-overrides.ts +45 -0
- package/src/config/schema/magic-context.test.ts +434 -0
- package/src/config/schema/magic-context.ts +1019 -0
- package/src/config/variable.test.ts +324 -0
- package/src/config/variable.ts +192 -0
- package/src/shared/__fixtures__/window-overlay.v1.json +337 -0
- package/src/shared/announcement.test.ts +198 -0
- package/src/shared/announcement.ts +145 -0
- package/src/shared/assistant-message-extractor.test.ts +47 -0
- package/src/shared/assistant-message-extractor.ts +156 -0
- package/src/shared/auto-update-provenance.ts +42 -0
- package/src/shared/bounded-session-map.test.ts +97 -0
- package/src/shared/bounded-session-map.ts +84 -0
- package/src/shared/builtin-commands.ts +46 -0
- package/src/shared/cache-ttl-display.test.ts +84 -0
- package/src/shared/cache-ttl-display.ts +58 -0
- package/src/shared/cache-ttl-seed.ts +23 -0
- package/src/shared/child-session-teardown.test.ts +241 -0
- package/src/shared/child-session-teardown.ts +66 -0
- package/src/shared/commit-detection.test.ts +63 -0
- package/src/shared/commit-detection.ts +53 -0
- package/src/shared/config-diagnostics.test.ts +29 -0
- package/src/shared/config-diagnostics.ts +64 -0
- package/src/shared/conflict-detector.test.ts +780 -0
- package/src/shared/conflict-detector.ts +596 -0
- package/src/shared/conflict-fixer.test.ts +608 -0
- package/src/shared/conflict-fixer.ts +295 -0
- package/src/shared/context-limit-provenance.ts +6 -0
- package/src/shared/data-path.test.ts +352 -0
- package/src/shared/data-path.ts +310 -0
- package/src/shared/error-message.test.ts +94 -0
- package/src/shared/error-message.ts +115 -0
- package/src/shared/escalation-bands.test.ts +23 -0
- package/src/shared/escalation-bands.ts +18 -0
- package/src/shared/format-bytes.ts +5 -0
- package/src/shared/format-threshold.ts +54 -0
- package/src/shared/harness-provider-map.test.ts +176 -0
- package/src/shared/harness-provider-map.ts +130 -0
- package/src/shared/harness.ts +76 -0
- package/src/shared/hidden-variant-warnings.ts +21 -0
- package/src/shared/historian-tool-defaults.json +13 -0
- package/src/shared/historian-tool-expansions.ts +18 -0
- package/src/shared/historian-tool-template.ts +248 -0
- package/src/shared/historian-transient-error.test.ts +36 -0
- package/src/shared/historian-transient-error.ts +22 -0
- package/src/shared/host-limitations.ts +43 -0
- package/src/shared/index.ts +7 -0
- package/src/shared/internal-initiator-marker.ts +1 -0
- package/src/shared/jsonc-edit.ts +387 -0
- package/src/shared/jsonc-parser.test.ts +46 -0
- package/src/shared/jsonc-parser.ts +283 -0
- package/src/shared/keep-subagents.test.ts +39 -0
- package/src/shared/keep-subagents.ts +28 -0
- package/src/shared/logger.test.ts +292 -0
- package/src/shared/logger.ts +248 -0
- package/src/shared/model-cache-ttl.test.ts +40 -0
- package/src/shared/model-cache-ttl.ts +58 -0
- package/src/shared/model-resolution.test.ts +132 -0
- package/src/shared/model-resolution.ts +158 -0
- package/src/shared/model-suggestion-retry.test.ts +698 -0
- package/src/shared/model-suggestion-retry.ts +838 -0
- package/src/shared/models-dev-cache.test.ts +720 -0
- package/src/shared/models-dev-cache.ts +661 -0
- package/src/shared/normalize-sdk-response.ts +40 -0
- package/src/shared/opencode-config-dir-types.ts +15 -0
- package/src/shared/opencode-config-dir.ts +111 -0
- package/src/shared/opencode-db-path.test.ts +389 -0
- package/src/shared/opencode-db-path.ts +396 -0
- package/src/shared/opencode-host-generation.test.ts +29 -0
- package/src/shared/pi-executable.ts +20 -0
- package/src/shared/plugin-package-version.ts +52 -0
- package/src/shared/project-directory-key.test.ts +111 -0
- package/src/shared/project-directory-key.ts +54 -0
- package/src/shared/prompt-context.ts +135 -0
- package/src/shared/prompt-surface-a1-golden.md +407 -0
- package/src/shared/prompt-surface-a1-golden.ts +41 -0
- package/src/shared/prompt-surface-runtime.test.ts +190 -0
- package/src/shared/prompt-surface-runtime.ts +263 -0
- package/src/shared/prompt-surface.test.ts +195 -0
- package/src/shared/prompt-surface.ts +162 -0
- package/src/shared/provider-response-completion.ts +23 -0
- package/src/shared/record-type-guard.ts +3 -0
- package/src/shared/redaction.test.ts +134 -0
- package/src/shared/redaction.ts +298 -0
- package/src/shared/resolve-fallbacks.test.ts +114 -0
- package/src/shared/resolve-fallbacks.ts +95 -0
- package/src/shared/rpc-async-probes.test.ts +320 -0
- package/src/shared/rpc-client.test.ts +576 -0
- package/src/shared/rpc-client.ts +218 -0
- package/src/shared/rpc-notifications.test.ts +151 -0
- package/src/shared/rpc-notifications.ts +222 -0
- package/src/shared/rpc-server.ts +431 -0
- package/src/shared/rpc-types.ts +386 -0
- package/src/shared/rpc-utils.test.ts +822 -0
- package/src/shared/rpc-utils.ts +1146 -0
- package/src/shared/run-token-log.test.ts +65 -0
- package/src/shared/run-token-log.ts +39 -0
- package/src/shared/safe-notification-target.test.ts +97 -0
- package/src/shared/safe-notification-target.ts +102 -0
- package/src/shared/session-messages-bounded.test.ts +112 -0
- package/src/shared/sqlite-acquisition-fence.test.ts +133 -0
- package/src/shared/sqlite-acquisition-routing.test.ts +145 -0
- package/src/shared/sqlite-bind-style.test.ts +80 -0
- package/src/shared/sqlite-context-pragmas.ts +24 -0
- package/src/shared/sqlite-helpers.ts +44 -0
- package/src/shared/sqlite-import-fence.test.ts +19 -0
- package/src/shared/sqlite-pass-scope.test.ts +154 -0
- package/src/shared/sqlite-transaction-mode-guard.test.ts +234 -0
- package/src/shared/sqlite-write-locker-test-support.ts +63 -0
- package/src/shared/sqlite.test.ts +58 -0
- package/src/shared/sqlite.ts +988 -0
- package/src/shared/stable-json.test.ts +87 -0
- package/src/shared/stable-json.ts +37 -0
- package/src/shared/status-detail-text.test.ts +194 -0
- package/src/shared/status-detail-text.ts +7 -0
- package/src/shared/status-summary.ts +189 -0
- package/src/shared/status-view-check.test.ts +252 -0
- package/src/shared/status-view-check.ts +519 -0
- package/src/shared/status-view.test.ts +395 -0
- package/src/shared/status-view.ts +794 -0
- package/src/shared/storage-busy.test.ts +73 -0
- package/src/shared/storage-permissions.test.ts +190 -0
- package/src/shared/storage-permissions.ts +212 -0
- package/src/shared/subagent-runner.ts +240 -0
- package/src/shared/summarize-child-stderr.test.ts +55 -0
- package/src/shared/summarize-child-stderr.ts +33 -0
- package/src/shared/system-directive.ts +9 -0
- package/src/shared/tag-owner-id.test.ts +33 -0
- package/src/shared/tag-owner-id.ts +29 -0
- package/src/shared/tag-transcript.test.ts +554 -0
- package/src/shared/tag-transcript.ts +1400 -0
- package/src/shared/tail-hygiene-status.ts +73 -0
- package/src/shared/test-temp-dir.test.ts +84 -0
- package/src/shared/test-temp-dir.ts +192 -0
- package/src/shared/transcript.ts +274 -0
- package/src/shared/user-answer.test.ts +12 -0
- package/src/shared/user-answer.ts +17 -0
- package/src/shared/user-facing-codes.test.ts +82 -0
- package/src/shared/user-facing-codes.ts +180 -0
- package/src/shared/window-geometry.test.ts +405 -0
- package/src/shared/window-geometry.ts +726 -0
- package/src/shared/windows-hidden-spawns.test.ts +133 -0
- package/src/shared/write-transaction-attribution.test.ts +214 -0
- package/src/shared/write-transaction-timing.ts +26 -0
- package/src/shared/xml-unescape.ts +19 -0
- package/README.md +0 -3
|
@@ -0,0 +1,1019 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { isValidLanguageCode } from "../../agents/language-directive";
|
|
3
|
+
import { toolTemplateError } from "../../shared/historian-tool-template";
|
|
4
|
+
import { isValidPromptSurfaceModelKey } from "../../shared/prompt-surface";
|
|
5
|
+
import { AgentOverrideConfigSchema } from "./agent-overrides";
|
|
6
|
+
|
|
7
|
+
export const DEFAULT_EXECUTE_THRESHOLD_PERCENTAGE = 65;
|
|
8
|
+
// Output reservation now removes generation capacity from the usable window.
|
|
9
|
+
// The 90% cap leaves roughly 10% of that safe input budget for mid-turn growth;
|
|
10
|
+
// escalation derives above the effective threshold and the 95% wall stays fixed.
|
|
11
|
+
export const EXECUTE_THRESHOLD_CAP_MESSAGE =
|
|
12
|
+
"execute_threshold is capped at 90% for cache safety: output capacity is reserved from the usable context window, and the remaining 10% absorbs mid-turn growth before the absolute 95% emergency wall. Use a value between 20 and 90.";
|
|
13
|
+
export const DEFAULT_HISTORIAN_TIMEOUT_MS = 600_000;
|
|
14
|
+
export const DEFAULT_HISTORY_BUDGET_PERCENTAGE = 0.15;
|
|
15
|
+
|
|
16
|
+
// Minimum absolute token floor for protected_tokens. Kept as a named constant so
|
|
17
|
+
// the schema's `.min()` and the loader's below-minimum warning share ONE source
|
|
18
|
+
// of truth — the loader must not duplicate the literal 4000.
|
|
19
|
+
export const PROTECTED_TOKENS_MIN = 4000;
|
|
20
|
+
|
|
21
|
+
/** Valid thinking levels for Pi subagents. Maps to Pi's --thinking CLI flag.
|
|
22
|
+
* Off: disable reasoning. Minimal/low/medium/high/xhigh/max: increasing reasoning depth.
|
|
23
|
+
* `max` was added in Pi 0.83.0.
|
|
24
|
+
* Pi-only — OpenCode uses `variant` in agent config instead. */
|
|
25
|
+
export const PiThinkingLevelSchema = z
|
|
26
|
+
.enum(["off", "minimal", "low", "medium", "high", "xhigh", "max"])
|
|
27
|
+
.optional();
|
|
28
|
+
export type PiThinkingLevel = z.infer<typeof PiThinkingLevelSchema>;
|
|
29
|
+
|
|
30
|
+
/** Pi-only child-process controls. This block is intentionally optional so an
|
|
31
|
+
* absent allowlist preserves Pi's normal extension discovery behavior. */
|
|
32
|
+
export const PiConfigSchema = z
|
|
33
|
+
.object({
|
|
34
|
+
subagent_extensions: z
|
|
35
|
+
.array(z.string().trim().min(1))
|
|
36
|
+
.optional()
|
|
37
|
+
.describe(
|
|
38
|
+
"User-only allowlist of Pi extensions for Magic Context subagent children. When set, children use --no-extensions and load only these entries (plus Magic Context's scoped child extension where applicable). Relative paths resolve from ~/.pi/agent, matching Pi's settings.json package location. Unset preserves normal Pi extension discovery.",
|
|
39
|
+
),
|
|
40
|
+
})
|
|
41
|
+
.optional();
|
|
42
|
+
export type PiConfig = NonNullable<z.infer<typeof PiConfigSchema>>;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Route the built-in prompt surface without changing guidance or tool registration.
|
|
46
|
+
* Project config can choose preset routing; only user config can provide override text.
|
|
47
|
+
*/
|
|
48
|
+
export const PromptSurfacePresetSchema = z.enum(["full", "light"]);
|
|
49
|
+
export type { PromptSurfacePreset } from "../../shared/prompt-surface";
|
|
50
|
+
|
|
51
|
+
const PromptSurfaceModelKeySchema = z.string().refine(isValidPromptSurfaceModelKey, {
|
|
52
|
+
message:
|
|
53
|
+
"Use a non-empty bare model key, provider/model key, or the literal provider/* wildcard; model IDs may contain additional slashes and matching is case-sensitive.",
|
|
54
|
+
});
|
|
55
|
+
// Tool-description keys must be non-empty IDs; harness-specific known-tool
|
|
56
|
+
// validation can run when a user override is applied.
|
|
57
|
+
const PromptSurfaceToolKeySchema = z.string().refine((value) => value.trim().length > 0, {
|
|
58
|
+
message: "tool description keys must not be empty or whitespace-only",
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export const PromptSurfaceConfigSchema = z
|
|
62
|
+
.object({
|
|
63
|
+
default: PromptSurfacePresetSchema.default("full").describe(
|
|
64
|
+
'Fallback prompt-surface preset ("full" or "light").',
|
|
65
|
+
),
|
|
66
|
+
models: z
|
|
67
|
+
.record(PromptSurfaceModelKeySchema, PromptSurfacePresetSchema)
|
|
68
|
+
.optional()
|
|
69
|
+
.describe(
|
|
70
|
+
"Literal per-model routing. Keys are bare model IDs, provider/model, or provider/*; matching is case-sensitive and preserves additional slashes in model IDs.",
|
|
71
|
+
),
|
|
72
|
+
guidance_override_path: z
|
|
73
|
+
.string()
|
|
74
|
+
.refine((value) => value.trim().length > 0, {
|
|
75
|
+
message: "guidance_override_path must not be empty or whitespace-only",
|
|
76
|
+
})
|
|
77
|
+
.optional()
|
|
78
|
+
.describe(
|
|
79
|
+
"USER-LEVEL ONLY path to a complete primary guidance section. Relative paths resolve from the user config file.",
|
|
80
|
+
),
|
|
81
|
+
tool_descriptions: z
|
|
82
|
+
.record(
|
|
83
|
+
PromptSurfaceToolKeySchema,
|
|
84
|
+
z.string().refine((value) => value.trim().length > 0, {
|
|
85
|
+
message: "tool description values must not be empty or whitespace-only",
|
|
86
|
+
}),
|
|
87
|
+
)
|
|
88
|
+
.optional()
|
|
89
|
+
.describe(
|
|
90
|
+
"USER-LEVEL ONLY top-level description overrides keyed by mmc_* tool ID; parameter schemas and descriptions are unchanged.",
|
|
91
|
+
),
|
|
92
|
+
})
|
|
93
|
+
.describe(
|
|
94
|
+
"Prompt-surface preset routing. Project config may select default/models, while guidance_override_path and tool_descriptions are user-level only.",
|
|
95
|
+
);
|
|
96
|
+
export type PromptSurfaceConfig = z.infer<typeof PromptSurfaceConfigSchema>;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The flat model-resolution fields are the only fields that move into harness
|
|
100
|
+
* blocks. Keeping this inventory next to the schema gives the loader migration
|
|
101
|
+
* an exhaustive contract instead of a catch-all rule.
|
|
102
|
+
*/
|
|
103
|
+
export const PER_HARNESS_MIGRATION_INVENTORY = {
|
|
104
|
+
historian: {
|
|
105
|
+
retained: [
|
|
106
|
+
"temperature",
|
|
107
|
+
"top_p",
|
|
108
|
+
"prompt",
|
|
109
|
+
"tools",
|
|
110
|
+
"disable",
|
|
111
|
+
"description",
|
|
112
|
+
"mode",
|
|
113
|
+
"color",
|
|
114
|
+
"maxSteps",
|
|
115
|
+
"permission",
|
|
116
|
+
"maxTokens",
|
|
117
|
+
"two_pass",
|
|
118
|
+
"disallowed_tools",
|
|
119
|
+
],
|
|
120
|
+
migrated_execution: ["model", "fallback_models", "variant", "thinking_level"],
|
|
121
|
+
},
|
|
122
|
+
} as const;
|
|
123
|
+
|
|
124
|
+
/** Harness keys that own independent hidden-agent model-selection blocks. */
|
|
125
|
+
export const PER_HARNESS_MODEL_KEYS = ["opencode", "pi"] as const;
|
|
126
|
+
|
|
127
|
+
/** OpenCode entry objects permit `variant` and reject Pi-only `thinking_level`. */
|
|
128
|
+
const OcEntryObjectSchema = z
|
|
129
|
+
.object({
|
|
130
|
+
model: z.string().describe("OpenCode model ID (for example, provider/model)."),
|
|
131
|
+
variant: z.string().optional().describe("OpenCode reasoning variant for this entry."),
|
|
132
|
+
})
|
|
133
|
+
.strict();
|
|
134
|
+
export const OcEntrySchema = z.union([z.string(), OcEntryObjectSchema]);
|
|
135
|
+
export type OcEntry = z.infer<typeof OcEntrySchema>;
|
|
136
|
+
|
|
137
|
+
/** Pi entry objects permit `thinking_level` and reject OpenCode-only `variant`. */
|
|
138
|
+
const PiEntryObjectSchema = z
|
|
139
|
+
.object({
|
|
140
|
+
model: z.string().describe("Pi model ID (for example, provider/model)."),
|
|
141
|
+
thinking_level: PiThinkingLevelSchema.describe("Pi thinking level for this entry."),
|
|
142
|
+
})
|
|
143
|
+
.strict();
|
|
144
|
+
export const PiEntrySchema = z.union([z.string(), PiEntryObjectSchema]);
|
|
145
|
+
export type PiEntry = z.infer<typeof PiEntrySchema>;
|
|
146
|
+
|
|
147
|
+
/** Strict model-resolution block used by historian.opencode. */
|
|
148
|
+
export const OpenCodeHarnessBlockSchema = z
|
|
149
|
+
.object({
|
|
150
|
+
model: OcEntrySchema.optional().describe("Primary OpenCode model entry."),
|
|
151
|
+
fallback_models: z
|
|
152
|
+
.array(OcEntrySchema)
|
|
153
|
+
.optional()
|
|
154
|
+
.describe(
|
|
155
|
+
"Ordered fallback OpenCode entries. New-shape configuration requires an array; legacy singleton values migrate to a one-element array.",
|
|
156
|
+
),
|
|
157
|
+
variant: z
|
|
158
|
+
.string()
|
|
159
|
+
.optional()
|
|
160
|
+
.describe(
|
|
161
|
+
"OpenCode reasoning variant for the primary entry when it declares none. Fallback entries declare variants per-entry.",
|
|
162
|
+
),
|
|
163
|
+
})
|
|
164
|
+
.strict()
|
|
165
|
+
.describe("Strict OpenCode model-resolution block. It accepts no Pi vocabulary.");
|
|
166
|
+
export type OpenCodeHarnessBlock = z.infer<typeof OpenCodeHarnessBlockSchema>;
|
|
167
|
+
|
|
168
|
+
/** Strict model-resolution block used by historian.pi. */
|
|
169
|
+
export const PiHarnessBlockSchema = z
|
|
170
|
+
.object({
|
|
171
|
+
model: PiEntrySchema.optional().describe("Primary Pi model entry."),
|
|
172
|
+
fallback_models: z
|
|
173
|
+
.array(PiEntrySchema)
|
|
174
|
+
.optional()
|
|
175
|
+
.describe(
|
|
176
|
+
"Ordered fallback Pi entries. New-shape configuration requires an array; legacy singleton values migrate to a one-element array.",
|
|
177
|
+
),
|
|
178
|
+
thinking_level: PiThinkingLevelSchema.describe(
|
|
179
|
+
"Pi thinking level for the primary entry when it declares none. Fallback entries declare thinking levels per-entry.",
|
|
180
|
+
),
|
|
181
|
+
})
|
|
182
|
+
.strict()
|
|
183
|
+
.describe("Strict Pi model-resolution block. It accepts no OpenCode vocabulary.");
|
|
184
|
+
export type PiHarnessBlock = z.infer<typeof PiHarnessBlockSchema>;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* A profile may select models but must not alter execution policy. Keep this
|
|
188
|
+
* separate from the full harness schemas, which also admit execution-policy
|
|
189
|
+
* fields beyond model selection.
|
|
190
|
+
*/
|
|
191
|
+
const ProfileOpenCodeModelBlockSchema = z
|
|
192
|
+
.object({
|
|
193
|
+
model: OcEntrySchema.optional().describe("Primary OpenCode model entry."),
|
|
194
|
+
fallback_models: z
|
|
195
|
+
.array(OcEntrySchema)
|
|
196
|
+
.optional()
|
|
197
|
+
.describe("Ordered fallback OpenCode model entries."),
|
|
198
|
+
variant: z
|
|
199
|
+
.string()
|
|
200
|
+
.optional()
|
|
201
|
+
.describe("OpenCode reasoning variant for the primary model entry."),
|
|
202
|
+
})
|
|
203
|
+
.strict()
|
|
204
|
+
.describe("Strict profile-only OpenCode model-selection block.");
|
|
205
|
+
const ProfilePiModelBlockSchema = z
|
|
206
|
+
.object({
|
|
207
|
+
model: PiEntrySchema.optional().describe("Primary Pi model entry."),
|
|
208
|
+
fallback_models: z
|
|
209
|
+
.array(PiEntrySchema)
|
|
210
|
+
.optional()
|
|
211
|
+
.describe("Ordered fallback Pi model entries."),
|
|
212
|
+
thinking_level: PiThinkingLevelSchema.describe(
|
|
213
|
+
"Pi thinking level for the primary model entry.",
|
|
214
|
+
),
|
|
215
|
+
})
|
|
216
|
+
.strict()
|
|
217
|
+
.describe("Strict profile-only Pi model-selection block.");
|
|
218
|
+
const ProfileHistorianSchema = z
|
|
219
|
+
.object({
|
|
220
|
+
opencode: ProfileOpenCodeModelBlockSchema.optional(),
|
|
221
|
+
pi: ProfilePiModelBlockSchema.optional(),
|
|
222
|
+
})
|
|
223
|
+
.strict();
|
|
224
|
+
|
|
225
|
+
export const ConfigProfileSchema = z
|
|
226
|
+
.object({
|
|
227
|
+
historian: ProfileHistorianSchema.optional(),
|
|
228
|
+
})
|
|
229
|
+
.strict()
|
|
230
|
+
.describe(
|
|
231
|
+
"User-owned model-selection overlay. Only historian harness model blocks are allowed.",
|
|
232
|
+
);
|
|
233
|
+
export type ConfigProfile = z.infer<typeof ConfigProfileSchema>;
|
|
234
|
+
|
|
235
|
+
export const ConfigProfilesSchema = z.record(
|
|
236
|
+
z.string().trim().min(1, "Profile names must not be empty or whitespace-only."),
|
|
237
|
+
ConfigProfileSchema,
|
|
238
|
+
);
|
|
239
|
+
export type ConfigProfiles = z.infer<typeof ConfigProfilesSchema>;
|
|
240
|
+
|
|
241
|
+
const AgentMetadataSchema = AgentOverrideConfigSchema.pick({
|
|
242
|
+
temperature: true,
|
|
243
|
+
top_p: true,
|
|
244
|
+
prompt: true,
|
|
245
|
+
tools: true,
|
|
246
|
+
disable: true,
|
|
247
|
+
description: true,
|
|
248
|
+
mode: true,
|
|
249
|
+
color: true,
|
|
250
|
+
maxSteps: true,
|
|
251
|
+
permission: true,
|
|
252
|
+
maxTokens: true,
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Historian metadata remains harness-independent. Only model resolution moves to
|
|
257
|
+
* the strict opencode and pi blocks; two_pass and disallowed_tools stay here.
|
|
258
|
+
*/
|
|
259
|
+
export const HistorianConfigSchema = AgentMetadataSchema.extend({
|
|
260
|
+
expand_tools: z
|
|
261
|
+
.record(
|
|
262
|
+
z.string(),
|
|
263
|
+
z.union([
|
|
264
|
+
z.string().superRefine((value, ctx) => {
|
|
265
|
+
const error = toolTemplateError(value);
|
|
266
|
+
if (error) ctx.addIssue({ code: "custom", message: error });
|
|
267
|
+
}),
|
|
268
|
+
z.literal(false),
|
|
269
|
+
]),
|
|
270
|
+
)
|
|
271
|
+
.optional()
|
|
272
|
+
.describe(
|
|
273
|
+
'Readable historian tool expansions, keyed by exact host tool name. Templates override built-in defaults; false disables an expansion. Supports ${input.path}, ${output.path}, bare ${output}, array [N], [*].field, .each("${field}"), .join("separator"), .count and final .truncate(N). Missing fields are empty; placeholders default to 300 characters, lists to 10 elements, expansions to 1000 characters. Valid in user and project config; affects historian/recomp and verbose ctx_expand only, never the wire or default ctx_expand transcript.',
|
|
274
|
+
),
|
|
275
|
+
opencode: OpenCodeHarnessBlockSchema.optional(),
|
|
276
|
+
pi: PiHarnessBlockSchema.optional(),
|
|
277
|
+
two_pass: z
|
|
278
|
+
.boolean()
|
|
279
|
+
.default(false)
|
|
280
|
+
.describe(
|
|
281
|
+
"Run a second editor pass over historian output to clean low-signal U: lines and cross-compartment duplicates. Adds ~1 extra API call and ~1.3x cost per historian run. Useful for models without extended thinking support. (default: false)",
|
|
282
|
+
),
|
|
283
|
+
disallowed_tools: z
|
|
284
|
+
.array(z.enum(["*", "read", "aft_outline", "aft_zoom", "aft_search"]))
|
|
285
|
+
.default([])
|
|
286
|
+
.describe(
|
|
287
|
+
'OpenCode only. Tools to REMOVE from the historian\'s default allow-list [read, aft_outline, aft_zoom, aft_search]. Applies to both historian and historian-editor agents. Use ["*"] to strip all tool definitions from the model request — this prevents weak instruction-following models (e.g. mistral-small-latest) from entering tool-calling loops. Individual tool names remove just that tool. Note: a user-supplied historian.permission override can re-allow a tool that disallowed_tools removed — disallowed_tools sets the baseline, permission overrides take precedence. (default: [])',
|
|
288
|
+
),
|
|
289
|
+
}).optional();
|
|
290
|
+
export type HistorianConfig = NonNullable<z.infer<typeof HistorianConfigSchema>>;
|
|
291
|
+
|
|
292
|
+
export interface MagicContextConfig {
|
|
293
|
+
enabled: boolean;
|
|
294
|
+
/** User-level setting that lets a session in the canonical home directory use project memory. */
|
|
295
|
+
allow_home_project: boolean;
|
|
296
|
+
/** DEPRECATED no-op: the auto-update check was removed (2026-10-05) — the package is
|
|
297
|
+
* private-registry-only, so public npm checks always failed. The key is still accepted
|
|
298
|
+
* (USER config only; project configs stripped) so existing configs keep parsing. */
|
|
299
|
+
auto_update?: boolean;
|
|
300
|
+
/** Output language for generated Magic Context prose. USER config only. */
|
|
301
|
+
language?: string;
|
|
302
|
+
/** Active user-owned model profile after user/project resolution. */
|
|
303
|
+
profile?: string;
|
|
304
|
+
/** Named user-owned model profiles. Declarations are consumed during resolution. */
|
|
305
|
+
profiles?: ConfigProfiles;
|
|
306
|
+
historian?: HistorianConfig;
|
|
307
|
+
cache_ttl: string | { default: string; [modelKey: string]: string };
|
|
308
|
+
/** Preset routing for guidance and provider-visible prompt surfaces. */
|
|
309
|
+
prompt_surface: PromptSurfaceConfig;
|
|
310
|
+
/** User-only output-token reservation override. Zero disables reservation. */
|
|
311
|
+
output_reserve?: number | { default: number; [modelKey: string]: number };
|
|
312
|
+
/** User-only model metadata inputs. */
|
|
313
|
+
models?: { window_overlay_path?: string };
|
|
314
|
+
/** TUI toast lifetime in milliseconds for Magic Context notifications. Default: 5000. */
|
|
315
|
+
toast_duration_ms?: number;
|
|
316
|
+
execute_threshold_percentage: number | { default: number; [modelKey: string]: number };
|
|
317
|
+
/** Absolute token thresholds per model. When set for a given model (or via `default`),
|
|
318
|
+
* this overrides `execute_threshold_percentage` for that model. Useful for hard caps
|
|
319
|
+
* matching provider input limits. Values above 90% × context_limit are clamped with a warning. */
|
|
320
|
+
execute_threshold_tokens?: { default?: number; [modelKey: string]: number | undefined };
|
|
321
|
+
protected_tokens?: number;
|
|
322
|
+
clear_reasoning_age: number;
|
|
323
|
+
history_budget_percentage: number;
|
|
324
|
+
historian_timeout_ms: number;
|
|
325
|
+
commit_cluster_trigger: {
|
|
326
|
+
enabled: boolean;
|
|
327
|
+
min_clusters: number;
|
|
328
|
+
};
|
|
329
|
+
/** Per-connection SQLite tuning for Magic Context's own context.db. */
|
|
330
|
+
sqlite: {
|
|
331
|
+
cache_size_mb: number;
|
|
332
|
+
mmap_size_mb: number;
|
|
333
|
+
};
|
|
334
|
+
/**
|
|
335
|
+
* Keep shared-storage permissions under an external operator's control.
|
|
336
|
+
* USER config only; project configs cannot weaken local data privacy.
|
|
337
|
+
*/
|
|
338
|
+
storage: {
|
|
339
|
+
enforce_private_permissions: boolean;
|
|
340
|
+
};
|
|
341
|
+
/**
|
|
342
|
+
* Controls whether and where Magic Context augments the system prompt
|
|
343
|
+
* (`## Magic Context` guidance, sticky date)
|
|
344
|
+
* inside `experimental.chat.system.transform`.
|
|
345
|
+
*
|
|
346
|
+
* Internal OpenCode hidden agents (title, summary, compaction) are
|
|
347
|
+
* always skipped automatically — that's a separate code path.
|
|
348
|
+
*/
|
|
349
|
+
system_prompt_injection: {
|
|
350
|
+
/** When false, NO injection happens for ANY agent — global escape hatch. */
|
|
351
|
+
enabled: boolean;
|
|
352
|
+
/**
|
|
353
|
+
* If the agent's system prompt contains any of these substrings,
|
|
354
|
+
* skip ALL Magic Context injection for that call. Lets users opt
|
|
355
|
+
* specific agents out (e.g. read-only QA agents that deny our
|
|
356
|
+
* `mmc_*` tools and don't need the guidance). The default marker
|
|
357
|
+
* `<!-- magic-context: skip -->` is meant to be added inside the
|
|
358
|
+
* user's custom agent prompt.
|
|
359
|
+
*/
|
|
360
|
+
skip_signatures: string[];
|
|
361
|
+
};
|
|
362
|
+
/** Inject elapsed-time markers between user messages and date ranges on
|
|
363
|
+
* compartments so the agent has a wall-clock sense of the session.
|
|
364
|
+
* Graduated from `experimental.temporal_awareness`; default: true. */
|
|
365
|
+
temporal_awareness: boolean;
|
|
366
|
+
/** Debug: when true, keep the child sessions Magic Context spawns for its
|
|
367
|
+
* own subagents (historian) instead
|
|
368
|
+
* of deleting them on success. For short-term inspection/data collection;
|
|
369
|
+
* kept sessions accumulate until manually cleared. Default false. */
|
|
370
|
+
keep_subagents: boolean;
|
|
371
|
+
/** Enable loopback-only diagnostic RPCs that expose memory usage and heap snapshots. */
|
|
372
|
+
debug_rpc?: boolean;
|
|
373
|
+
/**
|
|
374
|
+
* When true (default), deterministic inoperability (schema fence, storage
|
|
375
|
+
* open/migration failure) blocks the primary-session transform with a loud
|
|
376
|
+
* recovery error instead of silently falling through to native compaction.
|
|
377
|
+
* USER config only — project tier cannot set this. Not recommended to disable.
|
|
378
|
+
*/
|
|
379
|
+
fail_closed_blocking: boolean;
|
|
380
|
+
/**
|
|
381
|
+
* Compaction-off mode gate. When `enabled` is false Magic Context stops
|
|
382
|
+
* managing the context window and keeps only its knowledge layer, letting
|
|
383
|
+
* the harness's native compaction (or nothing) own the window. USER config
|
|
384
|
+
* only — project tier `compaction.enabled` is stripped for security.
|
|
385
|
+
* Boot-resolved: changing it requires a process restart.
|
|
386
|
+
*/
|
|
387
|
+
compaction: {
|
|
388
|
+
enabled: boolean;
|
|
389
|
+
};
|
|
390
|
+
/** Pi-only controls for Magic Context's OpenCode-parity todowrite surface. */
|
|
391
|
+
todowrite: {
|
|
392
|
+
enabled: boolean;
|
|
393
|
+
overlay: boolean;
|
|
394
|
+
};
|
|
395
|
+
/** Pi-only child-process extension controls. */
|
|
396
|
+
pi?: PiConfig;
|
|
397
|
+
/** Content-aware reclaim of tool output that a later call supersedes, added
|
|
398
|
+
* to the normal age-based auto-drop: superseded todowrite/mmc_reduce/meta
|
|
399
|
+
* outputs are dropped, and older edits to a file are compressed to a marker
|
|
400
|
+
* that keeps only the filePath. Only runs on a transform pass that is
|
|
401
|
+
* already rewriting the messages, so it never triggers a prompt-cache miss
|
|
402
|
+
* on its own; when off, the messages sent to the model are byte-identical to
|
|
403
|
+
* the age-based-only behavior. Experimental, opt-in, default off until cache
|
|
404
|
+
* stability is proven. */
|
|
405
|
+
smart_drops: boolean;
|
|
406
|
+
/**
|
|
407
|
+
* Age-tier caveman compression for long user/assistant text parts.
|
|
408
|
+
* Graduated from `experimental.caveman_text_compression`; opt-in, default off.
|
|
409
|
+
*
|
|
410
|
+
* Active only for primary sessions when enabled; never for subagents.
|
|
411
|
+
* Buckets eligible (outside-protected-tail) messages into four age
|
|
412
|
+
* tiers by tag position — oldest 20% → ultra, next 20% → full,
|
|
413
|
+
* next 20% → lite, newest 40% → untouched — and rewrites the text
|
|
414
|
+
* part in place.
|
|
415
|
+
* Always compresses from the original source (source_contents), so
|
|
416
|
+
* tier shifts produce the same result as if the target depth were
|
|
417
|
+
* applied directly to the original text.
|
|
418
|
+
*
|
|
419
|
+
* Disabled by default because it rewrites agent-visible history.
|
|
420
|
+
*/
|
|
421
|
+
caveman_text_compression: {
|
|
422
|
+
enabled: boolean;
|
|
423
|
+
/** Text parts shorter than this (characters) are left untouched. */
|
|
424
|
+
min_chars: number;
|
|
425
|
+
};
|
|
426
|
+
memory: {
|
|
427
|
+
enabled: boolean;
|
|
428
|
+
injection_budget_tokens: number;
|
|
429
|
+
auto_promote: boolean;
|
|
430
|
+
/** Appends a compact hint to new user messages when mmc_search finds
|
|
431
|
+
* highly-related memories or conversation. Does NOT
|
|
432
|
+
* inject full content — just vague fragments that nudge the agent to
|
|
433
|
+
* run mmc_search for full context if relevant. Graduated from
|
|
434
|
+
* `experimental.auto_search`; enabled by default. Independent of
|
|
435
|
+
* `memory.enabled` — it can still surface conversation hints when
|
|
436
|
+
* the memory store is off. */
|
|
437
|
+
auto_search: {
|
|
438
|
+
enabled: boolean;
|
|
439
|
+
/** Top hit score must exceed this threshold for the hint to fire. */
|
|
440
|
+
score_threshold: number;
|
|
441
|
+
/** Minimum user message length in characters (skip short prompts). */
|
|
442
|
+
min_prompt_chars: number;
|
|
443
|
+
};
|
|
444
|
+
};
|
|
445
|
+
/**
|
|
446
|
+
* Automatic memory-maintenance run controls (plan 10, dreamer replacement).
|
|
447
|
+
* USER config only — the whole group is stripped from project-tier config:
|
|
448
|
+
* a cloned repository must not raise run budgets, relax cooldowns/backoff,
|
|
449
|
+
* or loosen the anomaly guard to weaponize the maintenance task.
|
|
450
|
+
*/
|
|
451
|
+
maintenance: {
|
|
452
|
+
enabled: boolean;
|
|
453
|
+
/** Per-run four-dimensional budget (decision 9; provisional, calibrated in P3/P4). */
|
|
454
|
+
budgets: {
|
|
455
|
+
inputTokens: number;
|
|
456
|
+
outputTokens: number;
|
|
457
|
+
toolSteps: number;
|
|
458
|
+
wallMs: number;
|
|
459
|
+
};
|
|
460
|
+
/** Inter-run cooldown and failure-backoff schedule (decision 10; provisional). */
|
|
461
|
+
cooldowns: {
|
|
462
|
+
interRunMs: number;
|
|
463
|
+
backoffScheduleMs: number[];
|
|
464
|
+
backoffCapMs: number;
|
|
465
|
+
maxRetries: number;
|
|
466
|
+
};
|
|
467
|
+
/** Anomaly guard: single-run change-volume dual gate (decision 11).
|
|
468
|
+
* Defaults are P1/P2 TEST defaults — production values are calibrated
|
|
469
|
+
* against real-model samples in P3. */
|
|
470
|
+
anomalyThreshold: {
|
|
471
|
+
absoluteRows: number;
|
|
472
|
+
poolFraction: number;
|
|
473
|
+
};
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
export const MagicContextConfigSchema = z.object({
|
|
478
|
+
enabled: z.boolean().default(true).describe("Enable magic context (default: true)"),
|
|
479
|
+
allow_home_project: z
|
|
480
|
+
.boolean()
|
|
481
|
+
.default(false)
|
|
482
|
+
.describe(
|
|
483
|
+
"Allow Magic Context sessions launched from the exact canonical home directory. A non-git home uses its deterministic dir: identity; a home repository uses its git: identity. USER-LEVEL ONLY: project config is ignored. The home identity is excluded from registry seed exports, never resolves descendants by containment, and cannot join a workspace.",
|
|
484
|
+
),
|
|
485
|
+
auto_update: z
|
|
486
|
+
.boolean()
|
|
487
|
+
.optional()
|
|
488
|
+
.describe(
|
|
489
|
+
"DEPRECATED no-op: the automatic update check was removed (the package is private-registry-only, so public npm checks always 404). The key is still accepted so existing configs keep parsing; upgrade via the host's own plugin update channel.",
|
|
490
|
+
),
|
|
491
|
+
language: z
|
|
492
|
+
.string()
|
|
493
|
+
.trim()
|
|
494
|
+
.toLowerCase()
|
|
495
|
+
.refine(
|
|
496
|
+
(s) => isValidLanguageCode(s),
|
|
497
|
+
'language must be a 2-letter ISO 639-1 code (e.g. "tr", "es", "de")',
|
|
498
|
+
)
|
|
499
|
+
.optional()
|
|
500
|
+
.describe(
|
|
501
|
+
"Output language for Magic Context's generated content and guidance, as a " +
|
|
502
|
+
'2-letter ISO 639-1 code (e.g. "tr", "es", "de", "ja", "pt"). When set, the ' +
|
|
503
|
+
"historian and the agent-guidance block instruct the model to " +
|
|
504
|
+
"write its PROSE in this language while keeping all structural tokens (XML tags, " +
|
|
505
|
+
"the five memory category names, code identifiers, file paths) in English. " +
|
|
506
|
+
"USER-LEVEL ONLY (ignored in project config for security). Unset = today's " +
|
|
507
|
+
"behavior (model mirrors the conversation; English scaffolding). Changing it " +
|
|
508
|
+
"triggers one cache re-materialization; existing compartments/memories keep their " +
|
|
509
|
+
"original language until naturally rewritten.",
|
|
510
|
+
),
|
|
511
|
+
profile: z
|
|
512
|
+
.string()
|
|
513
|
+
.trim()
|
|
514
|
+
.min(1)
|
|
515
|
+
.optional()
|
|
516
|
+
.describe(
|
|
517
|
+
"Select a named user-owned model profile. A valid project name overrides this user default; an empty string, null, or other non-string project value is ignored with a warning so the user selection still applies. Unknown names warn and use the base configuration.",
|
|
518
|
+
),
|
|
519
|
+
profiles: ConfigProfilesSchema.optional().describe(
|
|
520
|
+
"User-level named model profiles. A profile may contain only historian model, fallback_models, OpenCode variant, and Pi thinking_level fields. Project configs may select a name but cannot define profiles.",
|
|
521
|
+
),
|
|
522
|
+
historian: HistorianConfigSchema.describe(
|
|
523
|
+
"Historian metadata plus independent strict OpenCode and Pi execution blocks. Retained metadata stays at historian; model, fallback_models, variant, and thinking_level belong only in historian.opencode or historian.pi.",
|
|
524
|
+
),
|
|
525
|
+
cache_ttl: z
|
|
526
|
+
.union([z.string(), z.object({ default: z.string() }).catchall(z.string())])
|
|
527
|
+
.default("5m")
|
|
528
|
+
.describe(
|
|
529
|
+
'How long Magic Context assumes the provider\'s cached prefix stays valid. This is MC\'s own deferral gate — it does not change the provider\'s actual cache lifetime. String (e.g. "5m", "1h", "30s") or per-model object ({ default: "5m", "provider/model": "1h", "provider/*": "never" }); keys resolve most-specific first (exact provider/model, bare model ID, shorter dash-prefixes, then the provider/* wildcard). Explicit per-model entries win; otherwise GPT-5.6 and later (including gpt-6*, through any provider prefix) use a built-in 30m lifetime before the object default or 5m fallback. An unset or global "5m" opts into built-in defaults; any other global string is an explicit policy and wins. Policy is frozen per session, including across restarts; a model switch resolves against that frozen policy. /mmc-status shows the effective value and source. OpenAI documents at least 30 minutes since the latest write or reuse: https://developers.openai.com/api/docs/guides/prompt-caching (Cache lifetime and Summary of model differences). Set to "never" to mean MC never assumes expiry (for lanes kept warm externally by a cache-keep tool) — disables the idle-TTL heuristic so MC never initiates a rebuild based on elapsed time. Provider-side extended TTL is a separate request-level concern (cache_control: { ttl } in the request body).',
|
|
530
|
+
),
|
|
531
|
+
prompt_surface: PromptSurfaceConfigSchema.default({ default: "full" }).describe(
|
|
532
|
+
"Prompt-surface presets: default is full; models use bare model IDs, provider/model, or provider/* routing keys. Guidance and tool-description overrides are user-level only. OpenCode 1.x and Pi register tool descriptions once per process (they follow the default preset). OpenCode 2 rewrites the five mmc_* descriptions per request from the draft model.",
|
|
533
|
+
),
|
|
534
|
+
output_reserve: z
|
|
535
|
+
.union([
|
|
536
|
+
z.number().min(0),
|
|
537
|
+
z.object({ default: z.number().min(0) }).catchall(z.number().min(0)),
|
|
538
|
+
])
|
|
539
|
+
.optional()
|
|
540
|
+
.describe(
|
|
541
|
+
'User-only output-token reservation override. Number or per-model object ({ default: 16384, "provider/model": 8192 }); 0 disables reservation. Takes precedence over every derived source: an explicit value here always wins against catalog output limits, provider window-geometry facts, and the 25%-of-context fallback (usable window = context window minus this reserve). When unset, Magic Context reserves the catalog output limit (capped at 25% of context) for shared-window providers and keeps proven separate-quota Google/Gemini windows unchanged.',
|
|
542
|
+
),
|
|
543
|
+
models: z
|
|
544
|
+
.object({
|
|
545
|
+
window_overlay_path: z.string().trim().min(1).optional(),
|
|
546
|
+
})
|
|
547
|
+
.optional()
|
|
548
|
+
.describe(
|
|
549
|
+
"User-only Fusiform window-overlay settings. The path defaults to <dataDir>/fusiform/window-overlay.json.",
|
|
550
|
+
),
|
|
551
|
+
toast_duration_ms: z
|
|
552
|
+
.number()
|
|
553
|
+
.min(0)
|
|
554
|
+
.max(60_000)
|
|
555
|
+
.default(5_000)
|
|
556
|
+
.describe(
|
|
557
|
+
"TUI toast lifetime in milliseconds for Magic Context notifications. Set to 0 to disable Magic Context toasts entirely (min: 0, max: 60000, default: 5000)",
|
|
558
|
+
),
|
|
559
|
+
execute_threshold_percentage: z
|
|
560
|
+
.union([
|
|
561
|
+
z.number().min(20).max(90, EXECUTE_THRESHOLD_CAP_MESSAGE),
|
|
562
|
+
z
|
|
563
|
+
.object({ default: z.number().min(20).max(90, EXECUTE_THRESHOLD_CAP_MESSAGE) })
|
|
564
|
+
.catchall(z.number().min(20).max(90, EXECUTE_THRESHOLD_CAP_MESSAGE)),
|
|
565
|
+
])
|
|
566
|
+
.default(DEFAULT_EXECUTE_THRESHOLD_PERCENTAGE)
|
|
567
|
+
.describe(
|
|
568
|
+
'Context percentage that forces queued operations to execute. Number or per-model object ({ default: 65, "provider/model": 45 }). Values above 90 are rejected because the runtime caps at 90% of the output-reserved safe window (MAX_EXECUTE_THRESHOLD). Default: DEFAULT_EXECUTE_THRESHOLD_PERCENTAGE',
|
|
569
|
+
),
|
|
570
|
+
execute_threshold_tokens: z
|
|
571
|
+
.object({
|
|
572
|
+
default: z.number().min(5_000).max(2_000_000).optional(),
|
|
573
|
+
})
|
|
574
|
+
.catchall(z.number().min(5_000).max(2_000_000))
|
|
575
|
+
.optional()
|
|
576
|
+
.describe(
|
|
577
|
+
"Absolute token thresholds per model. When matched, overrides execute_threshold_percentage for that model. Accepts `default` for all models or per-model keys. Values above 90% × context_limit are clamped with a warning log. Min 5_000, max 2_000_000.",
|
|
578
|
+
),
|
|
579
|
+
protected_tokens: z
|
|
580
|
+
.number()
|
|
581
|
+
.int()
|
|
582
|
+
.min(PROTECTED_TOKENS_MIN)
|
|
583
|
+
.max(1_000_000)
|
|
584
|
+
.optional()
|
|
585
|
+
.describe(
|
|
586
|
+
"Positive integer token floor to protect from automatic reclaim (min: 4_000, max: 1_000_000). When omitted, the derived default is clamp(round(0.05 × usableSoft), min(16_000, round(0.08 × usableSoft)), 64_000).",
|
|
587
|
+
),
|
|
588
|
+
clear_reasoning_age: z
|
|
589
|
+
.number()
|
|
590
|
+
.min(10)
|
|
591
|
+
.default(50)
|
|
592
|
+
.describe("Clear reasoning/thinking blocks older than N tags (default: 50)"),
|
|
593
|
+
history_budget_percentage: z
|
|
594
|
+
.number()
|
|
595
|
+
.min(0.05)
|
|
596
|
+
.max(0.5)
|
|
597
|
+
.default(DEFAULT_HISTORY_BUDGET_PERCENTAGE)
|
|
598
|
+
.describe(
|
|
599
|
+
"Fraction of usable context (context_limit × execute_threshold) reserved for the session history block (default: 0.15)",
|
|
600
|
+
),
|
|
601
|
+
historian_timeout_ms: z
|
|
602
|
+
.number()
|
|
603
|
+
.min(60_000)
|
|
604
|
+
.default(DEFAULT_HISTORIAN_TIMEOUT_MS)
|
|
605
|
+
.describe(
|
|
606
|
+
"Timeout for each historian prompt call in both TypeScript and Rust transform modes, in milliseconds (default: 600000)",
|
|
607
|
+
),
|
|
608
|
+
commit_cluster_trigger: z
|
|
609
|
+
.object({
|
|
610
|
+
enabled: z
|
|
611
|
+
.boolean()
|
|
612
|
+
.default(true)
|
|
613
|
+
.describe("Enable commit-cluster based historian triggering (default: true)"),
|
|
614
|
+
min_clusters: z
|
|
615
|
+
.number()
|
|
616
|
+
.min(1)
|
|
617
|
+
.default(3)
|
|
618
|
+
.describe(
|
|
619
|
+
"Minimum commit clusters required to trigger historian (min: 1, default: 3)",
|
|
620
|
+
),
|
|
621
|
+
})
|
|
622
|
+
.default({ enabled: true, min_clusters: 3 })
|
|
623
|
+
.describe(
|
|
624
|
+
"Commit-cluster trigger: fire historian when enough commit clusters accumulate in the unsummarized tail",
|
|
625
|
+
),
|
|
626
|
+
system_prompt_injection: z
|
|
627
|
+
.object({
|
|
628
|
+
enabled: z
|
|
629
|
+
.boolean()
|
|
630
|
+
.default(true)
|
|
631
|
+
.describe(
|
|
632
|
+
"When false, NO injection happens for ANY agent — global escape hatch. (default: true)",
|
|
633
|
+
),
|
|
634
|
+
skip_signatures: z
|
|
635
|
+
.array(z.string())
|
|
636
|
+
.default(["<!-- magic-context: skip -->"])
|
|
637
|
+
.describe(
|
|
638
|
+
"Substring opt-out list. If the agent's system prompt contains any of these strings, skip ALL Magic Context injection for that call. Default \"<!-- magic-context: skip -->\" is meant to be added inside a user's custom agent prompt to opt that agent out.",
|
|
639
|
+
),
|
|
640
|
+
})
|
|
641
|
+
.default({
|
|
642
|
+
enabled: true,
|
|
643
|
+
skip_signatures: ["<!-- magic-context: skip -->"],
|
|
644
|
+
})
|
|
645
|
+
.describe(
|
|
646
|
+
"Controls whether and where Magic Context augments the system prompt. Lets users opt specific agents out of the Magic Context guidance. OpenCode's internal hidden agents — title, summary, and compaction — are always skipped automatically.",
|
|
647
|
+
),
|
|
648
|
+
// v2: the LLM compressor was removed — deterministic decay-tier rendering
|
|
649
|
+
// (decay-render.ts) replaces it, so there are no compressor knobs. A
|
|
650
|
+
// leftover `compressor` block in an existing config is silently ignored
|
|
651
|
+
// (the schema strips unknown keys).
|
|
652
|
+
sqlite: z
|
|
653
|
+
.object({
|
|
654
|
+
cache_size_mb: z
|
|
655
|
+
.number()
|
|
656
|
+
.min(2)
|
|
657
|
+
.max(2048)
|
|
658
|
+
.default(64)
|
|
659
|
+
.describe(
|
|
660
|
+
"Page-cache size in MiB per connection (PRAGMA cache_size). Larger keeps more hot pages resident, cutting re-reads on repeated full-table scans. (min 2, max 2048, default 64)",
|
|
661
|
+
),
|
|
662
|
+
mmap_size_mb: z
|
|
663
|
+
.number()
|
|
664
|
+
.min(0)
|
|
665
|
+
.max(8192)
|
|
666
|
+
.default(0)
|
|
667
|
+
.describe(
|
|
668
|
+
"Memory-mapped I/O size in MiB (PRAGMA mmap_size). 0 disables mmap (SQLite default). Raising it can cut read overhead on large DBs at the cost of address space. (min 0, max 8192, default 0)",
|
|
669
|
+
),
|
|
670
|
+
})
|
|
671
|
+
.default({ cache_size_mb: 64, mmap_size_mb: 0 })
|
|
672
|
+
.describe(
|
|
673
|
+
"SQLite connection tuning for Magic Context's own context.db. These are per-connection PRAGMAs applied at open; they do not change the schema or what is stored.",
|
|
674
|
+
),
|
|
675
|
+
storage: z
|
|
676
|
+
.object({
|
|
677
|
+
enforce_private_permissions: z
|
|
678
|
+
.boolean()
|
|
679
|
+
.default(true)
|
|
680
|
+
.describe(
|
|
681
|
+
"When true (default), Magic Context creates and re-tightens its storage directories to owner-only 0700 and storage files to owner-only 0600. Set false only for a deliberate trusted-group deployment whose operator manages directory, database, WAL/SHM, cache, and RPC file permissions externally; Magic Context then never chmods or supplies restrictive creation modes. USER-LEVEL ONLY — ignored in project config for security. On Windows, POSIX chmod modes are already meaningless, so this setting is a no-op.",
|
|
682
|
+
),
|
|
683
|
+
})
|
|
684
|
+
.default({ enforce_private_permissions: true })
|
|
685
|
+
.describe(
|
|
686
|
+
"Storage permission policy. The default keeps session content and memories owner-private. Disabling enforcement is for trusted shared-group storage managed externally; every group member able to read the storage can read all stored session content and memories.",
|
|
687
|
+
),
|
|
688
|
+
temporal_awareness: z
|
|
689
|
+
.boolean()
|
|
690
|
+
.default(true)
|
|
691
|
+
.describe(
|
|
692
|
+
'Inject wall-clock gap markers (<!-- +Xm -->) between user messages where > 5 min elapsed since the previous message, and add compact date ranges to compartment headings. Gives the agent a sense of session pacing and "how long ago" across multi-day sessions. Graduated from experimental.temporal_awareness; default: true (set false to opt out).',
|
|
693
|
+
),
|
|
694
|
+
keep_subagents: z
|
|
695
|
+
.boolean()
|
|
696
|
+
.default(false)
|
|
697
|
+
.describe(
|
|
698
|
+
"Debug: keep every settled Magic Context child session instead of deleting it after success: historian runs. Kept hidden children can contain memory-pool text and user messages from other sessions of the same operator; their full transcript (prompt, tool calls, token usage, output) stays in the host session store. Kept sessions accumulate until manually cleared; leave false for normal use. Requires a restart to take effect. On OpenCode 2, one hidden session holds many runs; it is kept once any of its runs settled.",
|
|
699
|
+
),
|
|
700
|
+
debug_rpc: z
|
|
701
|
+
.boolean()
|
|
702
|
+
.default(false)
|
|
703
|
+
.describe(
|
|
704
|
+
"Developer-only: enable authenticated loopback RPCs for memory counters and heap snapshots. Disabled by default. USER-LEVEL ONLY and requires a restart.",
|
|
705
|
+
),
|
|
706
|
+
fail_closed_blocking: z
|
|
707
|
+
.boolean()
|
|
708
|
+
.default(true)
|
|
709
|
+
.describe(
|
|
710
|
+
"When Magic Context cannot operate (schema fence mismatch, storage open/migration failure), block the primary-session prompt with a loud recovery error instead of silently degrading to native compaction. Default true. Set false only to restore the old degrade-silently behavior (not recommended). USER-LEVEL ONLY — ignored in project config for security. Requires a restart.",
|
|
711
|
+
),
|
|
712
|
+
compaction: z
|
|
713
|
+
.object({
|
|
714
|
+
enabled: z
|
|
715
|
+
.boolean()
|
|
716
|
+
.default(true)
|
|
717
|
+
.describe(
|
|
718
|
+
"When false, Magic Context stops managing the context window and keeps its knowledge layer: memory injection through additive m[0]/m[1], raw-message FTS indexing, notes, mmc_search, mmc_expand, and mmc_memory remain available. MC's historian/compartment preparation, tagging, markers, pruning, folding, drops, strips, splicing, synthetic context-management todos, temporal markers, nudges, and fail-closed blocking stop; mmc_expand remains a knowledge-surface tool. fail_closed_blocking is inert: a transform failure passes the input messages through without blocking or cancelling. This setting does not enable native compaction: OpenCode's compaction.auto / compaction.prune or Pi's equivalent owns the window, or nothing does. MC's compaction.enabled in mmc.jsonc is distinct from OpenCode's compaction.auto / compaction.prune in opencode.jsonc; they are different files and different owners. On the first turn after disabling, a long session may trigger one native compaction cycle; MC removes only its own marker boundary, leaves native boundaries and stored compartments intact, and does no pre-trimming mitigation. Marker cleanup is lazy per session, so an unresumed session is cleaned when it is next resumed. If compaction is enabled again, run /mmc-wrapup when the historian is runnable to catch up. OpenCode peer verification against v1.18.4 confirms native compaction covers child sessions: subagents receive additive memory injection and no MC reclaim in this mode, so keep subagent tasks small or leave compaction.enabled on for long subagent runs. This is boot-resolved and requires a process restart; project-tier compaction.enabled is stripped so a cloned repository cannot disable the user's setting. The sidebar reports raw usage as Context: <pct>% · native compaction or Context: <pct>% · no active compaction and does not show an MC execute-threshold fill. /mmc-wrapup, /mmc-recomp, and /mmc-flush refuse without context-management side effects. Raw content hidden by a native boundary before Magic Context's first pass is not retroactively indexed.",
|
|
719
|
+
),
|
|
720
|
+
})
|
|
721
|
+
.default({ enabled: true })
|
|
722
|
+
.describe(
|
|
723
|
+
"Compaction-off mode gate. Default true (MC manages the context window as today). Set compaction.enabled=false to keep the knowledge layer while letting native compaction (or nothing) own the window. Boot-resolved; requires a restart to change.",
|
|
724
|
+
),
|
|
725
|
+
todowrite: z
|
|
726
|
+
.object({
|
|
727
|
+
enabled: z
|
|
728
|
+
.boolean()
|
|
729
|
+
.default(false)
|
|
730
|
+
.describe(
|
|
731
|
+
"Pi only: off by default. Set todowrite.enabled=true to register Magic Context's todowrite task-list tool and /todos command. OpenCode ships its own built-in todowrite; this setting has no effect there.",
|
|
732
|
+
),
|
|
733
|
+
overlay: z
|
|
734
|
+
.boolean()
|
|
735
|
+
.default(true)
|
|
736
|
+
.describe(
|
|
737
|
+
"Pi only: show the persistent todo overlay above the editor while tasks are active.",
|
|
738
|
+
),
|
|
739
|
+
})
|
|
740
|
+
.default({ enabled: false, overlay: true })
|
|
741
|
+
.describe(
|
|
742
|
+
"Pi-only todowrite tool and overlay controls. Pi registers tools and widgets at extension boot, so changing this after /cd requires /reload or restart.",
|
|
743
|
+
),
|
|
744
|
+
pi: PiConfigSchema.describe(
|
|
745
|
+
"Pi-only child-process extension controls. This setting is user-level only; project configuration cannot choose which extensions a user's subagent children load.",
|
|
746
|
+
),
|
|
747
|
+
smart_drops: z
|
|
748
|
+
.boolean()
|
|
749
|
+
.default(false)
|
|
750
|
+
.describe(
|
|
751
|
+
"Content-aware reclaim of provably-superseded tool output, layered on the existing execute-pass auto-drop. When on: superseded todowrite (keep newest 1), spent mmc_reduce (keep newest 3), and zero-value meta (bash_status, bash_kill, mmc_note read/dismiss) outputs are dropped; older edits to a file are compressed to a filePath-preserving marker while the newest edit per file stays full. Only acts on passes already busting the cache, so it never originates a cache bust. Honors the protected-tag reserve. Experimental: opt-in, default off until cache stability is proven; when off the wire is byte-identical to the positional-only reclaim. Requires a restart.",
|
|
752
|
+
),
|
|
753
|
+
caveman_text_compression: z
|
|
754
|
+
.object({
|
|
755
|
+
enabled: z
|
|
756
|
+
.boolean()
|
|
757
|
+
.default(false)
|
|
758
|
+
.describe(
|
|
759
|
+
"Apply deterministic caveman-style text compression to old conversation text. Active for primary sessions when enabled; never for subagents. Compresses user/assistant text in oldest-first tiers: ultra (oldest 20%), full, lite, untouched (newest 40%).",
|
|
760
|
+
),
|
|
761
|
+
min_chars: z
|
|
762
|
+
.number()
|
|
763
|
+
.min(100)
|
|
764
|
+
.max(10000)
|
|
765
|
+
.default(500)
|
|
766
|
+
.describe(
|
|
767
|
+
"Text parts shorter than this (characters) stay untouched. Min 100, max 10000. Default: 500.",
|
|
768
|
+
),
|
|
769
|
+
})
|
|
770
|
+
.default({ enabled: false, min_chars: 500 })
|
|
771
|
+
.describe(
|
|
772
|
+
"Age-tier caveman compression for long user/assistant text parts. Active for primary sessions when enabled; never for subagents. Oldest 20% of eligible tags (outside protected tail) go to ultra, next 20% to full, next 20% to lite, newest 40% untouched. Graduated from experimental.caveman_text_compression; opt-in, default off (lossy).",
|
|
773
|
+
),
|
|
774
|
+
memory: z
|
|
775
|
+
.object({
|
|
776
|
+
enabled: z
|
|
777
|
+
.boolean()
|
|
778
|
+
.default(true)
|
|
779
|
+
.describe("Enable cross-session memory (default: true)"),
|
|
780
|
+
injection_budget_tokens: z
|
|
781
|
+
.number()
|
|
782
|
+
.min(500)
|
|
783
|
+
.max(20000)
|
|
784
|
+
.default(4000)
|
|
785
|
+
.describe(
|
|
786
|
+
"Token budget for memory injection on session start (min: 500, max: 20000, default: 4000)",
|
|
787
|
+
),
|
|
788
|
+
auto_promote: z
|
|
789
|
+
.boolean()
|
|
790
|
+
.default(true)
|
|
791
|
+
.describe(
|
|
792
|
+
"Automatically promote eligible session facts into memory (default: true)",
|
|
793
|
+
),
|
|
794
|
+
auto_search: z
|
|
795
|
+
.object({
|
|
796
|
+
enabled: z
|
|
797
|
+
.boolean()
|
|
798
|
+
.default(true)
|
|
799
|
+
.describe(
|
|
800
|
+
"Automatically append a compact <ctx-search-hint> to eligible user messages when relevant memories, conversation, or commits are found. Graduated from experimental.auto_search; on by default (set false to opt out). Independent of memory.enabled.",
|
|
801
|
+
),
|
|
802
|
+
score_threshold: z
|
|
803
|
+
.number()
|
|
804
|
+
.min(0.3)
|
|
805
|
+
.max(0.95)
|
|
806
|
+
.default(0.6)
|
|
807
|
+
.describe(
|
|
808
|
+
"Top hit score must exceed this threshold for the hint to fire (min: 0.3, max: 0.95, default: 0.60)",
|
|
809
|
+
),
|
|
810
|
+
min_prompt_chars: z
|
|
811
|
+
.number()
|
|
812
|
+
.min(5)
|
|
813
|
+
.max(500)
|
|
814
|
+
.default(20)
|
|
815
|
+
.describe(
|
|
816
|
+
"Skip hint when user message is shorter than this (min: 5, max: 500, default: 20)",
|
|
817
|
+
),
|
|
818
|
+
})
|
|
819
|
+
.default({ enabled: true, score_threshold: 0.6, min_prompt_chars: 20 })
|
|
820
|
+
.describe(
|
|
821
|
+
"Auto-search hint: transform-time mmc_search on each new user message; when the top hit clears the threshold, append a compact <ctx-search-hint> block of vague fragments to that user message. Does NOT inject full content. Graduated from experimental.auto_search; enabled by default (set enabled: false to opt out). Independent of memory.enabled.",
|
|
822
|
+
),
|
|
823
|
+
})
|
|
824
|
+
.default({
|
|
825
|
+
enabled: true,
|
|
826
|
+
injection_budget_tokens: 4000,
|
|
827
|
+
auto_promote: true,
|
|
828
|
+
auto_search: { enabled: true, score_threshold: 0.6, min_prompt_chars: 20 },
|
|
829
|
+
})
|
|
830
|
+
.describe("Cross-session memory configuration"),
|
|
831
|
+
maintenance: z
|
|
832
|
+
.object({
|
|
833
|
+
enabled: z
|
|
834
|
+
.boolean()
|
|
835
|
+
.default(true)
|
|
836
|
+
.describe(
|
|
837
|
+
"Enable the automatic memory-maintenance task (default: true). USER-LEVEL ONLY — the whole maintenance group is stripped from project-tier config.",
|
|
838
|
+
),
|
|
839
|
+
budgets: z
|
|
840
|
+
.object({
|
|
841
|
+
inputTokens: z
|
|
842
|
+
.number()
|
|
843
|
+
.int()
|
|
844
|
+
.min(1)
|
|
845
|
+
.default(400_000)
|
|
846
|
+
.describe(
|
|
847
|
+
"Per-run input-token budget (input + cacheRead + cacheWrite pricing dimensions). Default 400000.",
|
|
848
|
+
),
|
|
849
|
+
outputTokens: z
|
|
850
|
+
.number()
|
|
851
|
+
.int()
|
|
852
|
+
.min(1)
|
|
853
|
+
.default(32_000)
|
|
854
|
+
.describe("Per-run output-token budget. Default 32000."),
|
|
855
|
+
toolSteps: z
|
|
856
|
+
.number()
|
|
857
|
+
.int()
|
|
858
|
+
.min(1)
|
|
859
|
+
.default(60)
|
|
860
|
+
.describe("Per-run tool-step budget. Default 60."),
|
|
861
|
+
wallMs: z
|
|
862
|
+
.number()
|
|
863
|
+
.int()
|
|
864
|
+
.min(1)
|
|
865
|
+
.default(900_000)
|
|
866
|
+
.describe(
|
|
867
|
+
"Per-run wall-clock budget in milliseconds. Default 900000 (15 minutes).",
|
|
868
|
+
),
|
|
869
|
+
})
|
|
870
|
+
.default({
|
|
871
|
+
inputTokens: 400_000,
|
|
872
|
+
outputTokens: 32_000,
|
|
873
|
+
toolSteps: 60,
|
|
874
|
+
wallMs: 900_000,
|
|
875
|
+
})
|
|
876
|
+
.describe(
|
|
877
|
+
"Run-level four-dimensional budget (decision 9). Provisional defaults — calibrated against real-model samples in P3/P4.",
|
|
878
|
+
),
|
|
879
|
+
cooldowns: z
|
|
880
|
+
.object({
|
|
881
|
+
interRunMs: z
|
|
882
|
+
.number()
|
|
883
|
+
.int()
|
|
884
|
+
.min(0)
|
|
885
|
+
.default(1_800_000)
|
|
886
|
+
.describe(
|
|
887
|
+
"Minimum cooldown between two runs of the same project. Default 1800000 (30 minutes).",
|
|
888
|
+
),
|
|
889
|
+
backoffScheduleMs: z
|
|
890
|
+
.array(z.number().int().min(0))
|
|
891
|
+
.min(1)
|
|
892
|
+
.default([900_000, 3_600_000, 14_400_000])
|
|
893
|
+
.describe(
|
|
894
|
+
"Failure-backoff schedule in milliseconds, applied in order (default 15m -> 1h -> 4h).",
|
|
895
|
+
),
|
|
896
|
+
backoffCapMs: z
|
|
897
|
+
.number()
|
|
898
|
+
.int()
|
|
899
|
+
.min(0)
|
|
900
|
+
.default(86_400_000)
|
|
901
|
+
.describe("Upper bound for backoff delays. Default 86400000 (24 hours)."),
|
|
902
|
+
maxRetries: z
|
|
903
|
+
.number()
|
|
904
|
+
.int()
|
|
905
|
+
.min(0)
|
|
906
|
+
.default(3)
|
|
907
|
+
.describe(
|
|
908
|
+
"Failed attempts before the task re-arms behind a cooldown instead of backing off further (never permanently abandoned). Default 3.",
|
|
909
|
+
),
|
|
910
|
+
})
|
|
911
|
+
.default({
|
|
912
|
+
interRunMs: 1_800_000,
|
|
913
|
+
backoffScheduleMs: [900_000, 3_600_000, 14_400_000],
|
|
914
|
+
backoffCapMs: 86_400_000,
|
|
915
|
+
maxRetries: 3,
|
|
916
|
+
})
|
|
917
|
+
.describe(
|
|
918
|
+
"Inter-run cooldown and failure-backoff schedule (decision 10). Provisional defaults.",
|
|
919
|
+
),
|
|
920
|
+
anomalyThreshold: z
|
|
921
|
+
.object({
|
|
922
|
+
absoluteRows: z
|
|
923
|
+
.number()
|
|
924
|
+
.int()
|
|
925
|
+
.min(1)
|
|
926
|
+
.default(10)
|
|
927
|
+
.describe(
|
|
928
|
+
"Anomaly guard: absolute number of changed rows in one run that trips the pause-and-report gate.",
|
|
929
|
+
),
|
|
930
|
+
poolFraction: z
|
|
931
|
+
.number()
|
|
932
|
+
.min(0)
|
|
933
|
+
.max(1)
|
|
934
|
+
.default(0.25)
|
|
935
|
+
.describe(
|
|
936
|
+
"Anomaly guard: changed-row fraction of the memory pool that trips the gate (either bound trips).",
|
|
937
|
+
),
|
|
938
|
+
})
|
|
939
|
+
.default({ absoluteRows: 10, poolFraction: 0.25 })
|
|
940
|
+
.describe(
|
|
941
|
+
"Single-run anomaly dual gate (decision 11). PROVISIONAL defaults: these are the P1/P2 test values, promoted unchanged to production. Real-model sensitivity calibration (gate-4 finding S2, plan 10 §11.3) was deferred to P4 — legal-but-aggressive pool sampling is in progress; tune only against that calibration evidence.",
|
|
942
|
+
),
|
|
943
|
+
})
|
|
944
|
+
.default({
|
|
945
|
+
enabled: true,
|
|
946
|
+
budgets: {
|
|
947
|
+
inputTokens: 400_000,
|
|
948
|
+
outputTokens: 32_000,
|
|
949
|
+
toolSteps: 60,
|
|
950
|
+
wallMs: 900_000,
|
|
951
|
+
},
|
|
952
|
+
cooldowns: {
|
|
953
|
+
interRunMs: 1_800_000,
|
|
954
|
+
backoffScheduleMs: [900_000, 3_600_000, 14_400_000],
|
|
955
|
+
backoffCapMs: 86_400_000,
|
|
956
|
+
maxRetries: 3,
|
|
957
|
+
},
|
|
958
|
+
anomalyThreshold: { absoluteRows: 10, poolFraction: 0.25 },
|
|
959
|
+
})
|
|
960
|
+
.describe(
|
|
961
|
+
"Automatic memory-maintenance run controls (dreamer replacement). USER-LEVEL ONLY: the whole group is stripped from project-tier config so a cloned repository cannot raise budgets, relax cooldowns, or loosen the anomaly guard.",
|
|
962
|
+
),
|
|
963
|
+
});
|
|
964
|
+
|
|
965
|
+
/** Settings whose fresh values can be used by later agent runs without changing rendered prompt bytes. */
|
|
966
|
+
export const LIVE_RELOAD_CONFIG_PATHS = [
|
|
967
|
+
"toast_duration_ms",
|
|
968
|
+
"historian.opencode.model",
|
|
969
|
+
"historian.opencode.fallback_models",
|
|
970
|
+
"historian.opencode.variant",
|
|
971
|
+
"historian.pi.model",
|
|
972
|
+
"historian.pi.fallback_models",
|
|
973
|
+
"historian.pi.thinking_level",
|
|
974
|
+
"historian.two_pass",
|
|
975
|
+
"historian.expand_tools",
|
|
976
|
+
"historian.maxTokens",
|
|
977
|
+
"historian_timeout_ms",
|
|
978
|
+
"commit_cluster_trigger.enabled",
|
|
979
|
+
"commit_cluster_trigger.min_clusters",
|
|
980
|
+
"memory.auto_promote",
|
|
981
|
+
] as const;
|
|
982
|
+
|
|
983
|
+
// Mark the input schema nodes, not their parsed defaults, so the JSON schema,
|
|
984
|
+
// runtime projection, docs and dashboard all share one policy source.
|
|
985
|
+
for (const path of LIVE_RELOAD_CONFIG_PATHS) {
|
|
986
|
+
let node: z.ZodType = MagicContextConfigSchema;
|
|
987
|
+
for (const part of path.split(".")) {
|
|
988
|
+
while (
|
|
989
|
+
node instanceof z.ZodOptional ||
|
|
990
|
+
node instanceof z.ZodDefault ||
|
|
991
|
+
node instanceof z.ZodNullable
|
|
992
|
+
) {
|
|
993
|
+
node = node.unwrap() as z.ZodType;
|
|
994
|
+
}
|
|
995
|
+
if (!(node instanceof z.ZodObject) || !(part in node.shape)) {
|
|
996
|
+
throw new Error(`Unknown live config path: ${path}`);
|
|
997
|
+
}
|
|
998
|
+
node = node.shape[part] as z.ZodType;
|
|
999
|
+
}
|
|
1000
|
+
z.globalRegistry.add(node, { ...node.meta(), "x-mc-live-reload": true });
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
/**
|
|
1004
|
+
* Derived default protected_tokens formula:
|
|
1005
|
+
* clamp(round(0.05 × usableSoft), min(16000, round(0.08 × usableSoft)), 64000)
|
|
1006
|
+
*
|
|
1007
|
+
* Sizing table:
|
|
1008
|
+
* 100k -> 8,000
|
|
1009
|
+
* 200k -> 16,000
|
|
1010
|
+
* 372k -> 18,600
|
|
1011
|
+
* 872k -> 43,600
|
|
1012
|
+
* 1M -> 50,000
|
|
1013
|
+
*/
|
|
1014
|
+
export function deriveDefaultProtectedTokens(usableSoft: number): number {
|
|
1015
|
+
const clampedUsable = Math.max(0, usableSoft);
|
|
1016
|
+
const lowerBound = Math.min(16_000, Math.round(0.08 * clampedUsable));
|
|
1017
|
+
const target = Math.round(0.05 * clampedUsable);
|
|
1018
|
+
return Math.min(64_000, Math.max(lowerBound, target));
|
|
1019
|
+
}
|