@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,295 @@
|
|
|
1
|
+
import type { TokenTotals } from "../../features/magic-context/subagent-token-capture";
|
|
2
|
+
import type { PluginContext } from "../../plugin/types";
|
|
3
|
+
import type { HarnessId } from "../../shared/harness";
|
|
4
|
+
import type { ModelInput } from "../../shared/model-resolution";
|
|
5
|
+
import type { PromptArgs } from "../../shared/model-suggestion-retry";
|
|
6
|
+
import type { RunTokenLog } from "../../shared/run-token-log";
|
|
7
|
+
import type { Database } from "../../shared/sqlite";
|
|
8
|
+
import type { ParsedEvent } from "./compartment-parser";
|
|
9
|
+
import type { BoundarySnapshotValidationResult, ProtectedTailBoundarySnapshot } from "./protected-tail-boundary";
|
|
10
|
+
import type { NotificationParams } from "./send-session-notification";
|
|
11
|
+
/**
|
|
12
|
+
* Live progress for a running recomp, surfaced in the TUI sidebar + /mmc-status
|
|
13
|
+
* so users can watch a long rebuild instead of staring at a single "started"
|
|
14
|
+
* toast. Lives in `LiveSessionState.recompProgressBySession`
|
|
15
|
+
* (process-local, in-memory — if the process restarts mid-recomp the recomp
|
|
16
|
+
* itself is interrupted, so losing the progress entry is correct).
|
|
17
|
+
*
|
|
18
|
+
* - phase "recomp" → rebuilding compartments; `processedMessages/totalMessages` drives the bar.
|
|
19
|
+
* - phase "migration" → recomp done, re-organizing project memories (indeterminate).
|
|
20
|
+
* - phase "done" → finished successfully; `message` holds the summary. Auto-cleared after a grace period.
|
|
21
|
+
* - phase "failed" → stopped without publishing; `message` holds the reason. Retained until next run.
|
|
22
|
+
*/
|
|
23
|
+
export interface RecompProgress {
|
|
24
|
+
sessionId: string;
|
|
25
|
+
/** Which user-facing flow this progress belongs to, so the sidebar/status
|
|
26
|
+
* wording follows the flow that started the run instead of hardcoding one
|
|
27
|
+
* verb for all of them (dogfood 2026-06-04: a plain recomp showed
|
|
28
|
+
* "Recomp / ✗ Upgrade failed", a self-contradiction). Optional + defaults
|
|
29
|
+
* to "recomp" so runner-emitted per-pass entries (which don't know the
|
|
30
|
+
* flow) inherit the kind set by setRecompStarting. "upgrade" is no longer
|
|
31
|
+
* produced — the session-upgrade flow is gone — and the renderers keep its
|
|
32
|
+
* arm only so an in-flight entry from an older process still labels. */
|
|
33
|
+
kind?: "recomp" | "upgrade" | "wrapup";
|
|
34
|
+
/** "skipped" is a TRANSIENT non-failure outcome: the incremental historian
|
|
35
|
+
* briefly held the compartment-state lease (or another process is mutating
|
|
36
|
+
* it), so the run no-op'd. It renders neutrally with retry guidance and
|
|
37
|
+
* auto-clears, unlike red "failed" which persists. */
|
|
38
|
+
phase: "recomp" | "migration" | "done" | "failed" | "skipped";
|
|
39
|
+
/** Raw messages processed so far (the recomp loop's `offset`). */
|
|
40
|
+
processedMessages: number;
|
|
41
|
+
/** Total raw messages to reprocess (protected-tail start − 1). */
|
|
42
|
+
totalMessages: number;
|
|
43
|
+
/** Successful historian passes completed. */
|
|
44
|
+
passCount: number;
|
|
45
|
+
/** Compartments rebuilt so far this run. */
|
|
46
|
+
compartmentsCreated: number;
|
|
47
|
+
startedAt: number;
|
|
48
|
+
updatedAt: number;
|
|
49
|
+
/** Terminal summary/reason (done | failed). */
|
|
50
|
+
message?: string;
|
|
51
|
+
/** Transient status line for the active phase — e.g. "Starting…", "Running
|
|
52
|
+
* historian…", "Primary returned nothing — trying fallback sonnet-4.6…",
|
|
53
|
+
* "Repair retry…". Surfaced under the progress bar so a long/retrying pass
|
|
54
|
+
* shows live activity instead of a frozen bar. */
|
|
55
|
+
note?: string;
|
|
56
|
+
}
|
|
57
|
+
export declare class HiddenCompletionRefusal extends Error {
|
|
58
|
+
readonly code: "hidden_model_unsupported" | "hidden_tools_unsupported" | "hidden_prompt_unrecognized" | "unsupported_transport";
|
|
59
|
+
readonly terminal: boolean;
|
|
60
|
+
constructor(code: "hidden_model_unsupported" | "hidden_tools_unsupported" | "hidden_prompt_unrecognized" | "unsupported_transport", message: string, terminal?: boolean);
|
|
61
|
+
}
|
|
62
|
+
export interface HiddenRunIdentity {
|
|
63
|
+
parentSessionId?: string;
|
|
64
|
+
parentInvocationId?: number | null;
|
|
65
|
+
agent: string;
|
|
66
|
+
kind: "historian" | "historian-editor" | "memory-maintenance";
|
|
67
|
+
system: string;
|
|
68
|
+
model?: ModelInput;
|
|
69
|
+
configuredModels?: readonly ModelInput[];
|
|
70
|
+
timeoutMs: number;
|
|
71
|
+
/**
|
|
72
|
+
* Output cap the user configured for this run (`historian.maxTokens`), or
|
|
73
|
+
* absent when they configured none. The OpenCode 2 carrier turns a present
|
|
74
|
+
* value into a wire parameter, so the OpenCode 2 lane must pass the
|
|
75
|
+
* configured value through unchanged instead of substituting a fallback:
|
|
76
|
+
* some backends reject the parameter outright, and the chunk-sizing
|
|
77
|
+
* arithmetic that reserves output room supplies its own default separately.
|
|
78
|
+
*/
|
|
79
|
+
maxOutputTokens?: number;
|
|
80
|
+
title: string;
|
|
81
|
+
directory: string;
|
|
82
|
+
metadata?: Record<string, unknown>;
|
|
83
|
+
}
|
|
84
|
+
export interface HiddenRunHandle {
|
|
85
|
+
id: string;
|
|
86
|
+
childSessionId?: string;
|
|
87
|
+
}
|
|
88
|
+
export interface HiddenCompletion {
|
|
89
|
+
text: string | null;
|
|
90
|
+
reasoning?: string | null;
|
|
91
|
+
usage: TokenTotals;
|
|
92
|
+
lengthCapped: boolean;
|
|
93
|
+
/** Original host messages are retained only by transports that expose them. */
|
|
94
|
+
messages?: unknown[];
|
|
95
|
+
providerId?: string;
|
|
96
|
+
modelId?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Host steps (context-hook apply invocations) the transport observed for
|
|
99
|
+
* this completion, when it counts them; absent on transports that don't.
|
|
100
|
+
* The memory-maintainer adapter streams this count through its budget
|
|
101
|
+
* meter (plan 10 D9 tool-step dimension).
|
|
102
|
+
*/
|
|
103
|
+
steps?: number;
|
|
104
|
+
/** Verbatim child usage surface when the transport exposes raw token fields. */
|
|
105
|
+
tokenLog?: RunTokenLog;
|
|
106
|
+
}
|
|
107
|
+
export interface HiddenCompletionExecutor {
|
|
108
|
+
readonly capabilities: {
|
|
109
|
+
tools: boolean;
|
|
110
|
+
harness: HarnessId;
|
|
111
|
+
};
|
|
112
|
+
open(run: HiddenRunIdentity): Promise<HiddenRunHandle>;
|
|
113
|
+
attempt(handle: HiddenRunHandle, request: PromptArgs): Promise<void>;
|
|
114
|
+
/** Kept separate from prompt settlement so read failures never resend a historian prompt. */
|
|
115
|
+
collect(handle: HiddenRunHandle, limit: number): Promise<HiddenCompletion>;
|
|
116
|
+
close(handle: HiddenRunHandle | null, settlement: {
|
|
117
|
+
promptSettled: boolean;
|
|
118
|
+
privacySensitive: boolean;
|
|
119
|
+
context: string;
|
|
120
|
+
log: (message: string) => void;
|
|
121
|
+
}): Promise<void>;
|
|
122
|
+
}
|
|
123
|
+
export interface CompartmentRunnerDeps<Client extends PluginContext["client"] | undefined = PluginContext["client"]> {
|
|
124
|
+
hiddenCompletionExecutor?: HiddenCompletionExecutor;
|
|
125
|
+
compactionMarkerStrategy?: {
|
|
126
|
+
setPending?: typeof import("../../features/magic-context/storage").setPendingCompactionMarkerState;
|
|
127
|
+
publish?: typeof import("./compaction-marker-manager").updateCompactionMarkerAfterPublication;
|
|
128
|
+
};
|
|
129
|
+
client: Client;
|
|
130
|
+
db: Database;
|
|
131
|
+
sessionId: string;
|
|
132
|
+
/**
|
|
133
|
+
* Historian chunk budget — how much raw history historian processes per
|
|
134
|
+
* call. Bounded by the HISTORIAN model's context window, not main's.
|
|
135
|
+
* Derived via `deriveHistorianChunkTokens(historianContextLimit)`.
|
|
136
|
+
*/
|
|
137
|
+
historianChunkTokens: number;
|
|
138
|
+
historianTimeoutMs?: number;
|
|
139
|
+
/** Immutable protected-tail boundary resolved by the trigger/force path. Tests may omit it and use the default-snapshot factory. */
|
|
140
|
+
boundarySnapshot?: ProtectedTailBoundarySnapshot;
|
|
141
|
+
/** Optional stale-snapshot refresh hook. Manual wrapup uses this so stale
|
|
142
|
+
* snapshots re-resolve with the keep-watermark override instead of falling
|
|
143
|
+
* back to normal pressure math. */
|
|
144
|
+
refreshBoundarySnapshot?: (snapshot: ProtectedTailBoundarySnapshot, validation: BoundarySnapshotValidationResult) => ProtectedTailBoundarySnapshot | null;
|
|
145
|
+
/** Current resolved main-model context limit used to reject stale boundary snapshots after model switches. */
|
|
146
|
+
currentContextLimit?: number;
|
|
147
|
+
/** Active OpenCode historian entry, including its request variant. */
|
|
148
|
+
model?: ModelInput;
|
|
149
|
+
/** Known context limit for the same resolved historian model. Unknown means no producer guard. */
|
|
150
|
+
historianContextLimit?: number;
|
|
151
|
+
/** Output reservation configured on the historian agent request. */
|
|
152
|
+
historianMaxOutputTokens?: number;
|
|
153
|
+
/** Resolved fallback chain for historian-family calls (historian + compressor). */
|
|
154
|
+
fallbackModels?: readonly ModelInput[];
|
|
155
|
+
language?: string;
|
|
156
|
+
directory: string;
|
|
157
|
+
historyBudgetTokens?: number;
|
|
158
|
+
fallbackModelId?: string;
|
|
159
|
+
ensureProjectRegistered?: (directory: string, db: Database) => Promise<void>;
|
|
160
|
+
getNotificationParams?: () => NotificationParams;
|
|
161
|
+
/** When true, inject wall-clock dates on compartments in <session-history>. */
|
|
162
|
+
experimentalTemporalAwareness?: boolean;
|
|
163
|
+
/** When true, run an editor pass after successful historian output to clean
|
|
164
|
+
* low-signal U: lines and cross-compartment duplicates. */
|
|
165
|
+
historianTwoPass?: boolean;
|
|
166
|
+
historianExpandTools?: Record<string, string | false>;
|
|
167
|
+
/**
|
|
168
|
+
* Cross-session memory feature gate (`memory.enabled` config). When false,
|
|
169
|
+
* historian/recomp must NOT promote session facts into project memories
|
|
170
|
+
* and must NOT generate or store embeddings. Issue #44.
|
|
171
|
+
*/
|
|
172
|
+
memoryEnabled?: boolean;
|
|
173
|
+
/**
|
|
174
|
+
* Automatic-promotion gate (`memory.auto_promote` config). When false (and
|
|
175
|
+
* memory is otherwise enabled), tools and search still work, but historian
|
|
176
|
+
* does not auto-promote session facts to memories. Users can still write
|
|
177
|
+
* memories explicitly via `mmc_memory write`. Issue #44.
|
|
178
|
+
*/
|
|
179
|
+
autoPromote?: boolean;
|
|
180
|
+
/**
|
|
181
|
+
* Called after compartment state is published. The runner marks the active
|
|
182
|
+
* run as published before invoking this callback.
|
|
183
|
+
*/
|
|
184
|
+
onCompartmentStatePublished?: (sessionId: string) => void;
|
|
185
|
+
/** Live recomp-phase progress callback (sidebar / status). The runner emits
|
|
186
|
+
* "recomp"-phase updates (start + each pass); the caller owns the migration
|
|
187
|
+
* and terminal (done/failed) phases. Best-effort, never throws into the loop. */
|
|
188
|
+
onRecompProgress?: (progress: RecompProgress) => void;
|
|
189
|
+
/**
|
|
190
|
+
* When true, publication preserves the in-memory injection cache until a
|
|
191
|
+
* later materializing pass consumes the deferred refresh.
|
|
192
|
+
*/
|
|
193
|
+
preserveInjectionCacheUntilConsumed?: boolean;
|
|
194
|
+
/**
|
|
195
|
+
* Plan v6 §4: Called when historian/recomp publication wrote a pending
|
|
196
|
+
* compaction-marker row in-transaction (deferring marker application to a
|
|
197
|
+
* later materializing pass). Consumer (hook.ts) seeds
|
|
198
|
+
* `liveSessionState.deferredHistoryRefreshSessions` so the next consuming
|
|
199
|
+
* postprocess pass drains the pending blob and applies the marker.
|
|
200
|
+
*/
|
|
201
|
+
onDeferredMarkerPending?: (sessionId: string) => void;
|
|
202
|
+
/** Holder id for the DB-backed compartment-state lease guarding publish paths. */
|
|
203
|
+
compartmentLeaseHolderId?: string;
|
|
204
|
+
/**
|
|
205
|
+
* Called synchronously the moment the runner commits to a REAL historian
|
|
206
|
+
* pass — after every no-op early-return (stale/empty snapshot, nothing to
|
|
207
|
+
* compact, drain-quota) and immediately before the first `await`. Lets
|
|
208
|
+
* `startCompartmentAgent` distinguish a fire-and-forget run that actually
|
|
209
|
+
* started from one that no-op'd synchronously, so a no-op does not leave
|
|
210
|
+
* the rest of the transform pass believing a historian is in progress
|
|
211
|
+
* (which would defer queued drop ops — the production livelock).
|
|
212
|
+
*/
|
|
213
|
+
onHistorianRunStarted?: () => void;
|
|
214
|
+
/** Manual wrapup bypasses the pressure-window quota but keeps the no-progress breaker. */
|
|
215
|
+
forceDrainQuota?: boolean;
|
|
216
|
+
/** Persist a weak-lookahead final compartment for coverage, but skip durable promotion. */
|
|
217
|
+
forceKeepLastCompartment?: boolean;
|
|
218
|
+
}
|
|
219
|
+
export type HiddenCompartmentRunnerDeps = CompartmentRunnerDeps<PluginContext["client"] | undefined>;
|
|
220
|
+
export interface CandidateCompartment {
|
|
221
|
+
sequence: number;
|
|
222
|
+
startMessage: number;
|
|
223
|
+
endMessage: number;
|
|
224
|
+
startMessageId: string;
|
|
225
|
+
endMessageId: string;
|
|
226
|
+
title: string;
|
|
227
|
+
/** v2: P1 tier text (mirror). v1/compressor: flat content. */
|
|
228
|
+
content: string;
|
|
229
|
+
/** v2 paraphrase tiers (model B). Null/undefined for v1/flat compartments.
|
|
230
|
+
* Nullability matches CompartmentInput so candidates and staging rows
|
|
231
|
+
* round-trip through each other without type friction. */
|
|
232
|
+
p1?: string | null;
|
|
233
|
+
p2?: string | null;
|
|
234
|
+
p3?: string | null;
|
|
235
|
+
p4?: string | null;
|
|
236
|
+
/** v2 decay-rate signal (1-100). Null/undefined for v1/flat. */
|
|
237
|
+
importance?: number | null;
|
|
238
|
+
/** v2 comma-separated activity types. Null/undefined for v1/flat. */
|
|
239
|
+
episodeType?: string | null;
|
|
240
|
+
}
|
|
241
|
+
export interface HistorianRunResult {
|
|
242
|
+
refusal?: HiddenCompletionRefusal;
|
|
243
|
+
ok: boolean;
|
|
244
|
+
result?: string;
|
|
245
|
+
error?: string;
|
|
246
|
+
dumpPath?: string;
|
|
247
|
+
invocationId?: number;
|
|
248
|
+
}
|
|
249
|
+
export type ValidatedHistorianPassResult = {
|
|
250
|
+
ok: true;
|
|
251
|
+
compartments: CandidateCompartment[];
|
|
252
|
+
facts: Array<{
|
|
253
|
+
category: string;
|
|
254
|
+
content: string;
|
|
255
|
+
}>;
|
|
256
|
+
droppedFactBlocks?: number;
|
|
257
|
+
droppedFacts?: number;
|
|
258
|
+
userObservations?: string[];
|
|
259
|
+
/** Durable standing-question candidates for Primers v1 (stored side-table only).
|
|
260
|
+
* `originCompartmentIndex` is the 1-based index into THIS publish's
|
|
261
|
+
* emitted compartments (same convention as `<events>` at_compartment);
|
|
262
|
+
* undefined → emission falls back to the chunk span. */
|
|
263
|
+
primerCandidates?: Array<{
|
|
264
|
+
question: string;
|
|
265
|
+
originCompartmentIndex?: number;
|
|
266
|
+
}>;
|
|
267
|
+
/** v2: historian-extracted events (stored, not rendered). */
|
|
268
|
+
events?: ParsedEvent[];
|
|
269
|
+
/**
|
|
270
|
+
* Subagent-invocation id of the model attempt that actually produced
|
|
271
|
+
* this validated output (primary, repair, editor, or fallback). The
|
|
272
|
+
* caller uses it as the exact `historian_runs.subagent_invocation_id`
|
|
273
|
+
* FK so the telemetry row joins to the right tokens/model — a kind-
|
|
274
|
+
* filtered "latest invocation" lookup mislinks recomp passes (recorded
|
|
275
|
+
* under subagent='recomp') to a stale subagent='historian' row.
|
|
276
|
+
*/
|
|
277
|
+
invocationId?: number | null;
|
|
278
|
+
} | {
|
|
279
|
+
ok: false;
|
|
280
|
+
error: string;
|
|
281
|
+
invocationId?: number | null;
|
|
282
|
+
};
|
|
283
|
+
export interface StoredCompartmentRange {
|
|
284
|
+
startMessage: number;
|
|
285
|
+
endMessage: number;
|
|
286
|
+
}
|
|
287
|
+
export interface HistorianProgressCallbacks {
|
|
288
|
+
onRepairRetry?: (error: string) => Promise<void>;
|
|
289
|
+
/** Fired before each fallback model attempt in `runFallbackHistorianPass`
|
|
290
|
+
* (after the primary + repair failed). `modelId` is the model about to be
|
|
291
|
+
* tried; `index`/`total` describe its position in the fallback chain. Lets
|
|
292
|
+
* the caller surface "trying fallback X…" in live progress. */
|
|
293
|
+
onModelFallback?: (modelId: string, index: number, total: number) => void;
|
|
294
|
+
}
|
|
295
|
+
//# sourceMappingURL=compartment-runner-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compartment-runner-types.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/compartment-runner-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAC;AACvF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EACR,gCAAgC,EAChC,6BAA6B,EAChC,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,cAAc;IAC3B,SAAS,EAAE,MAAM,CAAC;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ChC,GACD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAEjE,MAAM,WAAW,sBAAsB;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,0BAA0B;IACvC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD;;;oEAGgE;IAChE,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7E"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { StoredCompartmentRange, ValidatedHistorianPassResult } from "./compartment-runner-types";
|
|
2
|
+
export declare const HISTORIAN_BOUNDARY_HEALING_SLACK = 2;
|
|
3
|
+
export interface HistorianValidationChunk {
|
|
4
|
+
startIndex: number;
|
|
5
|
+
endIndex: number;
|
|
6
|
+
lines: Array<{
|
|
7
|
+
ordinal: number;
|
|
8
|
+
messageId: string;
|
|
9
|
+
}>;
|
|
10
|
+
/** Optional — when provided, gaps inside these ranges heal at any size. */
|
|
11
|
+
toolOnlyRanges?: ReadonlyArray<{
|
|
12
|
+
start: number;
|
|
13
|
+
end: number;
|
|
14
|
+
}>;
|
|
15
|
+
/** Completed invocation/result arcs visible in the raw snapshot. */
|
|
16
|
+
completedToolArcs?: ReadonlyArray<{
|
|
17
|
+
start: number;
|
|
18
|
+
end: number;
|
|
19
|
+
}>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Do not discard the last historian compartment when that would leave the persisted
|
|
23
|
+
* end boundary inside a completed tool invocation/result pair.
|
|
24
|
+
*/
|
|
25
|
+
export declare function shouldDiscardLastHistorianCompartment(compartments: ReadonlyArray<{
|
|
26
|
+
endMessage: number;
|
|
27
|
+
}>, chunk: Pick<HistorianValidationChunk, "endIndex" | "completedToolArcs">): boolean;
|
|
28
|
+
export declare function validateHistorianOutput(text: string, sessionId: string, chunk: HistorianValidationChunk, _priorCompartments: StoredCompartmentRange[], sequenceOffset: number): ValidatedHistorianPassResult;
|
|
29
|
+
/**
|
|
30
|
+
* Number of CONSECUTIVE historian failures before a failure notice escalates
|
|
31
|
+
* from "transient, will retry" reassurance to an actionable "your historian
|
|
32
|
+
* model needs attention" alert. The historian retries on every turn and silently
|
|
33
|
+
* iterates its whole fallback chain, so a single failure is almost always a
|
|
34
|
+
* transient blip (a model hiccup, a provider timeout) that the next turn fixes on
|
|
35
|
+
* its own. Only a sustained run of failures indicates a real misconfiguration
|
|
36
|
+
* worth alarming the user about. 3 mirrors the dreamer circuit-breaker threshold.
|
|
37
|
+
*/
|
|
38
|
+
export declare const HISTORIAN_PERSISTENT_FAILURE_THRESHOLD = 3;
|
|
39
|
+
/**
|
|
40
|
+
* User-facing notice for a historian (history-comparting) failure. The framing is
|
|
41
|
+
* chosen by `failureCount` so users aren't alarmed by harmless transient blips:
|
|
42
|
+
*
|
|
43
|
+
* - Below the threshold → calm reassurance: Magic Context retries automatically
|
|
44
|
+
* on the next turn, nothing is lost, and the conversation continues normally.
|
|
45
|
+
* We explicitly promise we'll only speak up again if it keeps failing.
|
|
46
|
+
* - At/above the threshold → escalation: the failures are persistent, so it's
|
|
47
|
+
* likely the configured historian model is misconfigured or unreachable, with
|
|
48
|
+
* the last error and the actionable next step (check mmc.jsonc).
|
|
49
|
+
*
|
|
50
|
+
* Shared by both harnesses so the wording (and the transient/persistent contract)
|
|
51
|
+
* never drifts between OpenCode and Pi.
|
|
52
|
+
*/
|
|
53
|
+
export declare function buildHistorianFailureNotice(failureCount: number, _lastError: string): string;
|
|
54
|
+
/**
|
|
55
|
+
* User-facing notice for stored compartments that fail validation before the
|
|
56
|
+
* historian can run. Unlike a model failure this cannot clear on its own: the
|
|
57
|
+
* saved rows stay invalid until they are rebuilt, so the notice names the
|
|
58
|
+
* rebuild instead of promising an automatic retry.
|
|
59
|
+
*/
|
|
60
|
+
export declare function buildStoredCompartmentsInvalidNotice(): string;
|
|
61
|
+
/**
|
|
62
|
+
* User-facing notice for a historian model whose window cannot hold even the
|
|
63
|
+
* fixed instructions plus a minimal chunk. Retrying cannot help, so the notice
|
|
64
|
+
* names the model setting instead of promising an automatic retry.
|
|
65
|
+
*/
|
|
66
|
+
export declare function buildHistorianWindowTooSmallNotice(): string;
|
|
67
|
+
export declare function buildHistorianRepairPrompt(originalPrompt: string, previousOutput: string, validationError: string, language?: string): string;
|
|
68
|
+
export declare function validateStoredCompartments(compartments: Array<{
|
|
69
|
+
startMessage: number;
|
|
70
|
+
endMessage: number;
|
|
71
|
+
}>, nonNarrativeGapRanges?: ReadonlyArray<{
|
|
72
|
+
start: number;
|
|
73
|
+
end: number;
|
|
74
|
+
}>): string | null;
|
|
75
|
+
export declare function validateChunkCoverage(chunk: {
|
|
76
|
+
startIndex: number;
|
|
77
|
+
endIndex: number;
|
|
78
|
+
lines: Array<{
|
|
79
|
+
ordinal: number;
|
|
80
|
+
}>;
|
|
81
|
+
}): string | null;
|
|
82
|
+
export declare function getReducedRecompTokenBudget(currentBudget: number): number | null;
|
|
83
|
+
//# sourceMappingURL=compartment-runner-validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compartment-runner-validation.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/compartment-runner-validation.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACR,sBAAsB,EACtB,4BAA4B,EAC/B,MAAM,4BAA4B,CAAC;AAQpC,eAAO,MAAM,gCAAgC,IAAI,CAAC;AAElD,MAAM,WAAW,wBAAwB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,E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,EACjE,qBAAqB,GAAE,aAAa,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAM,GAC1E,MAAM,GAAG,IAAI,CA0Bf;AAgED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACrC,GAAG,MAAM,GAAG,IAAI,CAkBhB;AAED,wBAAgB,2BAA2B,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGhF"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { runCompartmentAgent } from "./compartment-runner-incremental";
|
|
2
|
+
import { type PartialRecompRange } from "./compartment-runner-partial-recomp";
|
|
3
|
+
import type { CompartmentRunnerDeps, HiddenCompartmentRunnerDeps } from "./compartment-runner-types";
|
|
4
|
+
export interface ActiveCompartmentRun {
|
|
5
|
+
promise: Promise<void>;
|
|
6
|
+
published: boolean;
|
|
7
|
+
kind?: "incremental" | "recomp" | "wrapup" | "other";
|
|
8
|
+
/**
|
|
9
|
+
* Set to true once the 95%-emergency user-facing notification has been
|
|
10
|
+
* dispatched for this run. Prevents the notification from re-firing on
|
|
11
|
+
* every subsequent transform pass while the same compartment run is
|
|
12
|
+
* still active — which would otherwise persist a fresh ignored user
|
|
13
|
+
* message every pass and drive OpenCode's runLoop break condition false.
|
|
14
|
+
*/
|
|
15
|
+
notificationSent?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function getActiveCompartmentRun(sessionId: string): ActiveCompartmentRun | undefined;
|
|
18
|
+
export declare function markActiveCompartmentRunPublished(sessionId: string): void;
|
|
19
|
+
/**
|
|
20
|
+
* Register a compartment-state-mutating promise with the active-runs map.
|
|
21
|
+
*
|
|
22
|
+
* Use this to serialize background compressor runs against historian/recomp
|
|
23
|
+
* runs: both read-modify-write compartment rows, and while SQLite serializes
|
|
24
|
+
* individual statements it does NOT serialize multi-step update cycles. If a
|
|
25
|
+
* historian starts while a background compressor is still running, either
|
|
26
|
+
* side's final write can overwrite the other's work.
|
|
27
|
+
*
|
|
28
|
+
* The registered promise is cleared from activeRuns on settle so later passes
|
|
29
|
+
* can start a new run. If a run is already registered for the session, the
|
|
30
|
+
* caller is expected to have checked getActiveCompartmentRun() first and
|
|
31
|
+
* bailed — this function will overwrite silently if called anyway, which is
|
|
32
|
+
* the desired behavior for the retry path.
|
|
33
|
+
*/
|
|
34
|
+
export declare function registerActiveCompartmentRun(sessionId: string, promise: Promise<void>, kind?: ActiveCompartmentRun["kind"]): ActiveCompartmentRun;
|
|
35
|
+
/** Historian work and its lease timers remain background work even when a pass starts them. */
|
|
36
|
+
export declare function startCompartmentAgent(deps: HiddenCompartmentRunnerDeps, runAgent?: typeof runCompartmentAgent): void;
|
|
37
|
+
export interface ExecuteContextRecompOptions {
|
|
38
|
+
/**
|
|
39
|
+
* Optional partial range (inclusive raw message ordinals). When provided,
|
|
40
|
+
* runs partial recomp — snaps to enclosing compartment boundaries and
|
|
41
|
+
* rebuilds only the matching compartments, preserving prior/tail
|
|
42
|
+
* compartments and all session facts.
|
|
43
|
+
*
|
|
44
|
+
* When omitted, runs full recomp from message 1 to the protected tail,
|
|
45
|
+
* replacing all compartments and facts.
|
|
46
|
+
*/
|
|
47
|
+
range?: PartialRecompRange;
|
|
48
|
+
/** @internal Exercises the lease/marker race without delaying production callers. */
|
|
49
|
+
onLeaseAcquired?: () => void;
|
|
50
|
+
}
|
|
51
|
+
export interface ExecuteContextRecompResult {
|
|
52
|
+
message: string;
|
|
53
|
+
published: boolean;
|
|
54
|
+
}
|
|
55
|
+
export declare function executeContextRecompWithResult(deps: CompartmentRunnerDeps, options?: ExecuteContextRecompOptions): Promise<ExecuteContextRecompResult>;
|
|
56
|
+
export declare function executeContextRecomp(deps: CompartmentRunnerDeps, options?: ExecuteContextRecompOptions): Promise<string>;
|
|
57
|
+
export { runCompartmentAgent } from "./compartment-runner-incremental";
|
|
58
|
+
export type { PartialRecompRange } from "./compartment-runner-partial-recomp";
|
|
59
|
+
//# sourceMappingURL=compartment-runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compartment-runner.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/compartment-runner.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAEH,KAAK,kBAAkB,EAC1B,MAAM,qCAAqC,CAAC;AAE7C,OAAO,KAAK,EACR,qBAAqB,EACrB,2BAA2B,EAC9B,MAAM,4BAA4B,CAAC;AAEpC,MAAM,WAAW,oBAAoB;IACjC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,aAAa,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrD;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAID,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS,CAE3F;AAED,wBAAgB,iCAAiC,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAGzE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,4BAA4B,CACxC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,EACtB,IAAI,GAAE,oBAAoB,CAAC,MAAM,CAAW,GAC7C,oBAAoB,CAgBtB;AAkCD,+FAA+F;AAC/F,wBAAgB,qBAAqB,CACjC,IAAI,EAAE,2BAA2B,EACjC,QAAQ,GAAE,OAAO,mBAAyC,GAC3D,IAAI,CAEN;AAsGD,MAAM,WAAW,2BAA2B;IACxC;;;;;;;;OAQG;IACH,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,qFAAqF;IACrF,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,0BAA0B;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;CACtB;AAED,wBAAsB,8BAA8B,CAChD,IAAI,EAAE,qBAAqB,EAC3B,OAAO,GAAE,2BAAgC,GAC1C,OAAO,CAAC,0BAA0B,CAAC,CA2ErC;AAED,wBAAsB,oBAAoB,CACtC,IAAI,EAAE,qBAAqB,EAC3B,OAAO,GAAE,2BAAgC,GAC1C,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,YAAY,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { ContextUsage, SessionMeta, TagEntry } from "../../features/magic-context/types";
|
|
2
|
+
import type { Database } from "../../shared/sqlite";
|
|
3
|
+
import { type ReclaimRideSignals } from "./cache-busting-signals";
|
|
4
|
+
import { type ProtectedTailBoundarySnapshot } from "./protected-tail-boundary";
|
|
5
|
+
import { type InMemoryMessageView, type RawMessage } from "./read-session-raw";
|
|
6
|
+
declare const POST_DROP_TARGET_RATIO = 0.75;
|
|
7
|
+
declare const BLOCK_UNTIL_DONE_PERCENTAGE = 95;
|
|
8
|
+
export { BLOCK_UNTIL_DONE_PERCENTAGE, POST_DROP_TARGET_RATIO };
|
|
9
|
+
export interface CompartmentTriggerResult {
|
|
10
|
+
shouldFire: boolean;
|
|
11
|
+
reason?: "projected_headroom" | "force_band" | "commit_clusters" | "tail_size";
|
|
12
|
+
/**
|
|
13
|
+
* The protected-tail boundary snapshot the decision was computed from.
|
|
14
|
+
* Present whenever the tail inspection ran. Callers that start the
|
|
15
|
+
* historian in the SAME pass (transform path) should hand this to
|
|
16
|
+
* runCompartmentPhase so it doesn't re-resolve the boundary — one
|
|
17
|
+
* resolution per pass, and the historian sees exactly the snapshot the
|
|
18
|
+
* decision saw.
|
|
19
|
+
*/
|
|
20
|
+
boundarySnapshot?: ProtectedTailBoundarySnapshot;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* In-memory tail source for the trigger — the transform's `args.messages`
|
|
24
|
+
* converted to absolute-ordinal RawMessages (via `buildInMemoryTailRawMessages`
|
|
25
|
+
* with `anchorFound=true`). When supplied, the tail inspection primes the
|
|
26
|
+
* raw-message cache from memory and performs ZERO opencode.db reads on the hot
|
|
27
|
+
* path. Callers must only pass an ANCHORED conversion — an unanchored one has
|
|
28
|
+
* assumed ordinals; leave it undefined to fall through to the DB-primed path.
|
|
29
|
+
*/
|
|
30
|
+
export interface InMemoryTailSource {
|
|
31
|
+
messages: RawMessage[];
|
|
32
|
+
absoluteMessageCount: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Wire capability for projecting reclaimable reasoning bytes. OpenCode derives
|
|
36
|
+
* this from the provider's empty-sentinel support; Pi overrides it because its
|
|
37
|
+
* serializers safely omit cleared thinking for every provider.
|
|
38
|
+
*/
|
|
39
|
+
export interface ReasoningProjectionCapability {
|
|
40
|
+
providerID?: string;
|
|
41
|
+
canClearReasoning?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Deferred tail conversion for callers that have already tagged the live wire.
|
|
45
|
+
* The trigger's cheap gate can use the caller-provided tag floor without building
|
|
46
|
+
* RawMessages; the factory runs only when authoritative tail inspection is needed.
|
|
47
|
+
*/
|
|
48
|
+
export type LazyInMemoryTailSource = () => InMemoryTailSource | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Convert the transform's in-memory `args.messages` into a trigger tail source,
|
|
51
|
+
* applying the anchored-only gate:
|
|
52
|
+
*
|
|
53
|
+
* - Compartments exist + boundary has a message id → require the anchor to be
|
|
54
|
+
* FOUND in the array (`anchorFound`). OpenCode's `filterCompacted` stops at
|
|
55
|
+
* our compaction marker (the boundary message), so the anchor is normally the
|
|
56
|
+
* array head; when the marker drain lags, the anchor sits a few messages in
|
|
57
|
+
* and the converter drops the already-compartmentalized prefix. If it isn't
|
|
58
|
+
* present at all (deleted, or the marker advanced past it), ordinal
|
|
59
|
+
* assignment would be an unverified guess → return undefined so the caller
|
|
60
|
+
* falls through to the DB-primed read.
|
|
61
|
+
* - Compartments exist but the boundary row has NO message id (legacy rows) →
|
|
62
|
+
* undefined (DB path, as before).
|
|
63
|
+
* - No compartments (#132 early-session) → the whole array is the session;
|
|
64
|
+
* ordinals from 1, no anchor needed.
|
|
65
|
+
*
|
|
66
|
+
* Live-verified byte-identical to the DB path on every boundary decision field
|
|
67
|
+
* (offset, protectedTailStart, eligibleEndOrdinal, N, trueRawEligibleTokens,
|
|
68
|
+
* arc fencing) across real sessions before the cutover.
|
|
69
|
+
*/
|
|
70
|
+
export declare function buildTriggerInMemoryTail(db: Database, sessionId: string, messages: readonly InMemoryMessageView[]): InMemoryTailSource | undefined;
|
|
71
|
+
export declare function getProactiveCompartmentTriggerPercentage(executeThresholdPercentage: number): number;
|
|
72
|
+
export declare function formatProjectedPostDropPercentage(value: number | null): string;
|
|
73
|
+
export declare function checkCompartmentTrigger(db: Database, sessionId: string, sessionMeta: SessionMeta, usage: ContextUsage, _previousPercentage: number, executeThresholdPercentage: number, triggerBudget: number, clearReasoningAge?: number, commitClusterTrigger?: {
|
|
74
|
+
enabled: boolean;
|
|
75
|
+
min_clusters: number;
|
|
76
|
+
}, preloadedActiveTags?: readonly TagEntry[], contextLimit?: number, inMemoryTail?: InMemoryTailSource | LazyInMemoryTailSource, taggerFloorOverride?: number, reasoningProjection?: ReasoningProjectionCapability, reclaimRide?: ReclaimRideSignals, storedTotalsExcludeToolTags?: boolean): CompartmentTriggerResult;
|
|
77
|
+
//# sourceMappingURL=compartment-trigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compartment-trigger.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/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