@code-yeongyu/senpi 2026.8.1 → 2026.8.3-3
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/CHANGELOG.md +74 -0
- package/README.md +10 -0
- package/dist/cli/args.d.ts +2 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +28 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/credential-print.d.ts +23 -0
- package/dist/cli/credential-print.d.ts.map +1 -0
- package/dist/cli/credential-print.js +116 -0
- package/dist/cli/credential-print.js.map +1 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +3 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/remote-session.d.ts +53 -0
- package/dist/client/remote-session.d.ts.map +1 -0
- package/dist/client/remote-session.js +340 -0
- package/dist/client/remote-session.js.map +1 -0
- package/dist/client/transcript.d.ts +12 -0
- package/dist/client/transcript.d.ts.map +1 -0
- package/dist/client/transcript.js +98 -0
- package/dist/client/transcript.js.map +1 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +3 -0
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +40 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +434 -53
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +5 -0
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +72 -11
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/dynamic-prompt/verification.d.ts +2 -2
- package/dist/core/dynamic-prompt/verification.d.ts.map +1 -1
- package/dist/core/dynamic-prompt/verification.js +2 -2
- package/dist/core/dynamic-prompt/verification.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/bounded-queue.d.ts +17 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/bounded-queue.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/bounded-queue.js +56 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/bounded-queue.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/sdk-boundary.d.ts +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/sdk-boundary.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/sdk-boundary.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.d.ts +32 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.js +43 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.d.ts +18 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.js +46 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.d.ts +81 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.js +127 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-entry-annotations.d.ts +10 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-entry-annotations.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-entry-annotations.js +34 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-entry-annotations.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.d.ts +56 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.js +174 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reaper.d.ts +24 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reaper.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reaper.js +34 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reaper.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.d.ts +34 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.js +85 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.d.ts +2 -13
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.js +34 -55
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-wiring.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-wiring.js +35 -93
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-wiring.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.d.ts +13 -11
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.js +44 -55
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.d.ts +3 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.js +101 -126
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.d.ts +2 -31
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.js +26 -98
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-claim.d.ts +14 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-claim.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-claim.js +42 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-claim.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-types.d.ts +32 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-types.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-types.js +8 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-types.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream-events.d.ts +16 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream-events.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream-events.js +92 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream-events.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream.js +48 -88
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/tools.d.ts +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/tools.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/tools.js +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/tools.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/checkpoint-state.d.ts +18 -1
- package/dist/core/extensions/builtin/compaction/checkpoint-state.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/checkpoint-state.js +32 -0
- package/dist/core/extensions/builtin/compaction/checkpoint-state.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/deterministic-fallback.d.ts +1 -1
- package/dist/core/extensions/builtin/compaction/deterministic-fallback.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/deterministic-fallback.js +4 -0
- package/dist/core/extensions/builtin/compaction/deterministic-fallback.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/idle-retry.d.ts +21 -0
- package/dist/core/extensions/builtin/compaction/idle-retry.d.ts.map +1 -0
- package/dist/core/extensions/builtin/compaction/idle-retry.js +24 -0
- package/dist/core/extensions/builtin/compaction/idle-retry.js.map +1 -0
- package/dist/core/extensions/builtin/compaction/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/index.js +91 -13
- package/dist/core/extensions/builtin/compaction/index.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/lane-policy.d.ts +71 -0
- package/dist/core/extensions/builtin/compaction/lane-policy.d.ts.map +1 -0
- package/dist/core/extensions/builtin/compaction/lane-policy.js +94 -0
- package/dist/core/extensions/builtin/compaction/lane-policy.js.map +1 -0
- package/dist/core/extensions/builtin/compaction/log.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/log.js +1 -0
- package/dist/core/extensions/builtin/compaction/log.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/overflow-retry.d.ts +59 -0
- package/dist/core/extensions/builtin/compaction/overflow-retry.d.ts.map +1 -0
- package/dist/core/extensions/builtin/compaction/overflow-retry.js +155 -0
- package/dist/core/extensions/builtin/compaction/overflow-retry.js.map +1 -0
- package/dist/core/extensions/builtin/compaction/speculative.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/speculative.js +17 -98
- package/dist/core/extensions/builtin/compaction/speculative.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/transient-failure.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/transient-failure.js +3 -0
- package/dist/core/extensions/builtin/compaction/transient-failure.js.map +1 -1
- package/dist/core/extensions/builtin/goal/continuation.d.ts +2 -1
- package/dist/core/extensions/builtin/goal/continuation.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/continuation.js +2 -1
- package/dist/core/extensions/builtin/goal/continuation.js.map +1 -1
- package/dist/core/extensions/builtin/goal/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/index.js +14 -1
- package/dist/core/extensions/builtin/goal/index.js.map +1 -1
- package/dist/core/extensions/builtin/goal/monitor-continuation.d.ts +3 -2
- package/dist/core/extensions/builtin/goal/monitor-continuation.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/monitor-continuation.js +89 -46
- package/dist/core/extensions/builtin/goal/monitor-continuation.js.map +1 -1
- package/dist/core/extensions/builtin/goal/wait-progress.d.ts +11 -0
- package/dist/core/extensions/builtin/goal/wait-progress.d.ts.map +1 -0
- package/dist/core/extensions/builtin/goal/wait-progress.js +30 -0
- package/dist/core/extensions/builtin/goal/wait-progress.js.map +1 -0
- package/dist/core/extensions/builtin/goal/wait-ticker.d.ts +38 -0
- package/dist/core/extensions/builtin/goal/wait-ticker.d.ts.map +1 -0
- package/dist/core/extensions/builtin/goal/wait-ticker.js +71 -0
- package/dist/core/extensions/builtin/goal/wait-ticker.js.map +1 -0
- package/dist/core/extensions/builtin/gpt-apply-patch/apply.d.ts +1 -0
- package/dist/core/extensions/builtin/gpt-apply-patch/apply.d.ts.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/apply.js +13 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/apply.js.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/index.d.ts +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/index.js +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/index.js.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/tool.d.ts +1 -0
- package/dist/core/extensions/builtin/gpt-apply-patch/tool.d.ts.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/tool.js +23 -5
- package/dist/core/extensions/builtin/gpt-apply-patch/tool.js.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/detectors.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/detectors.js +42 -1
- package/dist/core/extensions/builtin/loop-guard/detectors.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/health.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/health.js +2 -1
- package/dist/core/extensions/builtin/mcp/health.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +5 -3
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js +8 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js.map +1 -1
- package/dist/core/extensions/builtin/rules/config.d.ts +3 -0
- package/dist/core/extensions/builtin/rules/config.d.ts.map +1 -0
- package/dist/core/extensions/builtin/rules/config.js +24 -0
- package/dist/core/extensions/builtin/rules/config.js.map +1 -0
- package/dist/core/extensions/builtin/rules/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/rules/index.js +5 -3
- package/dist/core/extensions/builtin/rules/index.js.map +1 -1
- package/dist/core/extensions/builtin/rules/rules/formatter.d.ts.map +1 -1
- package/dist/core/extensions/builtin/rules/rules/formatter.js +21 -5
- package/dist/core/extensions/builtin/rules/rules/formatter.js.map +1 -1
- package/dist/core/extensions/builtin/rules/rules/types.d.ts +1 -1
- package/dist/core/extensions/builtin/rules/rules/types.js.map +1 -1
- package/dist/core/extensions/builtin/service-tier.d.ts.map +1 -1
- package/dist/core/extensions/builtin/service-tier.js +2 -3
- package/dist/core/extensions/builtin/service-tier.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/context.d.ts +1 -1
- package/dist/core/extensions/builtin/terminal/tools/context.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/context.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/monitor.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/monitor.js +1 -0
- package/dist/core/extensions/builtin/terminal/tools/monitor.js.map +1 -1
- package/dist/core/extensions/builtin/tool-pair-guard/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/tool-pair-guard/index.js +1 -1
- package/dist/core/extensions/builtin/tool-pair-guard/index.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +14 -18
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +4 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +18 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +16 -1
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +10 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +1 -1
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/keybindings.d.ts +24 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/model-registry.d.ts +2 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +3 -0
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +1 -0
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +2 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +2 -2
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/package-manager.d.ts +0 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +18 -34
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/pi-manifest.d.ts +9 -0
- package/dist/core/pi-manifest.d.ts.map +1 -0
- package/dist/core/pi-manifest.js +25 -0
- package/dist/core/pi-manifest.js.map +1 -0
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +8 -3
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/provider-display-names.d.ts.map +1 -1
- package/dist/core/provider-display-names.js +1 -0
- package/dist/core/provider-display-names.js.map +1 -1
- package/dist/core/resource-loader.d.ts +15 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +55 -6
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/retry-fallback/hint-policy.d.ts +29 -0
- package/dist/core/retry-fallback/hint-policy.d.ts.map +1 -0
- package/dist/core/retry-fallback/hint-policy.js +54 -0
- package/dist/core/retry-fallback/hint-policy.js.map +1 -0
- package/dist/core/retry-fallback/probe-scheduler.d.ts +60 -0
- package/dist/core/retry-fallback/probe-scheduler.d.ts.map +1 -0
- package/dist/core/retry-fallback/probe-scheduler.js +206 -0
- package/dist/core/retry-fallback/probe-scheduler.js.map +1 -0
- package/dist/core/retry-fallback/settings.d.ts +9 -0
- package/dist/core/retry-fallback/settings.d.ts.map +1 -1
- package/dist/core/retry-fallback/settings.js +14 -0
- package/dist/core/retry-fallback/settings.js.map +1 -1
- package/dist/core/session-log.js +1 -1
- package/dist/core/session-log.js.map +1 -1
- package/dist/core/settings-manager.d.ts +10 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +21 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/extensions/llama/provider.js +1 -1
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +44 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +5 -2
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +16 -4
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/continuity-notice.d.ts +21 -0
- package/dist/modes/interactive/components/continuity-notice.d.ts.map +1 -0
- package/dist/modes/interactive/components/continuity-notice.js +58 -0
- package/dist/modes/interactive/components/continuity-notice.js.map +1 -0
- package/dist/modes/interactive/components/custom-editor.d.ts +5 -0
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +22 -1
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/markdown-transform.d.ts +3 -0
- package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -0
- package/dist/modes/interactive/components/markdown-transform.js +19 -0
- package/dist/modes/interactive/components/markdown-transform.js.map +1 -0
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +4 -1
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +6 -2
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +20 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts +3 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +8 -2
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/help-content.d.ts.map +1 -1
- package/dist/modes/interactive/help-content.js +1 -0
- package/dist/modes/interactive/help-content.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +21 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +151 -50
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/dark.json +1 -0
- package/dist/modes/interactive/theme/grok-day.json +1 -0
- package/dist/modes/interactive/theme/grok-night.json +1 -0
- package/dist/modes/interactive/theme/light.json +1 -0
- package/dist/modes/interactive/theme/theme-schema.json +5 -1
- package/dist/modes/interactive/theme/theme.d.ts +2 -2
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +13 -3
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
- package/dist/modes/rpc/connection-handler.js +13 -0
- package/dist/modes/rpc/connection-handler.js.map +1 -1
- package/dist/utils/clipboard.d.ts +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +22 -2
- package/dist/utils/clipboard.js.map +1 -1
- package/docs/AGENTS.md +1 -6
- package/docs/custom-provider.md +10 -3
- package/docs/development.md +1 -2
- package/docs/extensions.md +24 -1
- package/docs/keybindings.md +13 -0
- package/docs/mcp.md +63 -4
- package/docs/models.md +1 -0
- package/docs/providers.md +39 -0
- package/docs/release-guide.md +5 -3
- package/docs/session-format.md +2 -0
- package/docs/settings.md +2 -0
- package/docs/skills.md +29 -0
- package/docs/themes.md +5 -3
- package/docs/usage.md +5 -0
- package/examples/extensions/custom-compaction.ts +1 -2
- package/examples/extensions/custom-provider-anthropic/index.ts +8 -2
- package/examples/extensions/doom-overlay/wad-finder.ts +7 -3
- package/examples/extensions/handoff.ts +2 -3
- package/examples/extensions/qna.ts +2 -2
- package/examples/rpc-extension-ui.ts +11 -2
- package/examples/sdk/02-custom-model.ts +1 -2
- package/examples/sdk/12-full-control.ts +2 -0
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +36 -0
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts +14 -3
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js +156 -67
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/array-session-reader.d.ts +3 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/array-session-reader.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/array-session-reader.js +70 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/array-session-reader.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.d.ts +4 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.js +22 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-store.d.ts +13 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-store.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-store.js +304 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-store.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/keyed-operation-queue.d.ts +17 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/keyed-operation-queue.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/keyed-operation-queue.js +60 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/keyed-operation-queue.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-store.d.ts +6 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-store.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-store.js +107 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-store.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repository.d.ts +28 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repository.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repository.js +61 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repository.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search-backend.d.ts +8 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search-backend.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search-backend.js +22 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search-backend.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts +6 -10
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +154 -77
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts +49 -23
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts +6 -6
- package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/index.js +6 -6
- package/node_modules/@earendil-works/pi-agent-core/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +4 -4
- package/node_modules/@earendil-works/pi-ai/README.md +5 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +46 -10
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-tool-pairs.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-tool-pairs.d.ts.map +1 -0
- package/{dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.js → node_modules/@earendil-works/pi-ai/dist/api/anthropic-tool-pairs.js} +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-tool-pairs.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +5 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +64 -4
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +12 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js +13 -6
- package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +12 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +19 -10
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +84 -47
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +18 -9
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +11 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +7 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js +3 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openrouter.d.ts +3 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openrouter.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openrouter.js +81 -26
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openrouter.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +16 -8
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.d.ts +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.js +3 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/mistral.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-cn.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/together.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai-coding-cn.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +4 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/ollama.d.ts +9 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/ollama.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/ollama.js +142 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/ollama.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +14 -2
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js +23 -4
- package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js +10 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js +13 -12
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-hint.d.ts +24 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-hint.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-hint.js +233 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-hint.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/package.json +10 -6
- package/node_modules/@earendil-works/pi-pty/package.json +2 -2
- package/node_modules/@earendil-works/pi-tui/README.md +77 -14
- package/node_modules/@earendil-works/pi-tui/dist/TuiAltScreen.d.ts +83 -0
- package/node_modules/@earendil-works/pi-tui/dist/TuiAltScreen.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/TuiAltScreen.js +687 -0
- package/node_modules/@earendil-works/pi-tui/dist/TuiAltScreen.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/TuiMainScreen.d.ts +5 -0
- package/node_modules/@earendil-works/pi-tui/dist/TuiMainScreen.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/TuiMainScreen.js +5 -0
- package/node_modules/@earendil-works/pi-tui/dist/TuiMainScreen.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.d.ts +13 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.js +36 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +5 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.d.ts +7 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.js +43 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/image.js +4 -4
- package/node_modules/@earendil-works/pi-tui/dist/components/image.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts +2 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +3 -2
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.d.ts +51 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js +163 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +3 -6
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/stack.d.ts +32 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/stack.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/stack.js +109 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/stack.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.d.ts +8 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.js +21 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +10 -4
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js +10 -4
- package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +30 -0
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +18 -0
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/layout-node.d.ts +40 -0
- package/node_modules/@earendil-works/pi-tui/dist/layout-node.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/layout-node.js +6 -0
- package/node_modules/@earendil-works/pi-tui/dist/layout-node.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/layout.d.ts +40 -0
- package/node_modules/@earendil-works/pi-tui/dist/layout.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/layout.js +315 -0
- package/node_modules/@earendil-works/pi-tui/dist/layout.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/slash-command-autocomplete.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/slash-command-autocomplete.js +36 -8
- package/node_modules/@earendil-works/pi-tui/dist/slash-command-autocomplete.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts +10 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +61 -3
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-text.d.ts +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-text.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-text.js +12 -2
- package/node_modules/@earendil-works/pi-tui/dist/terminal-text.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +38 -16
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.js +121 -51
- package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +10 -0
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.js +95 -4
- package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +2 -2
- package/node_modules/typebox/build/compile/validator.d.mts +3 -11
- package/node_modules/typebox/build/compile/validator.mjs +6 -36
- package/node_modules/typebox/build/error/errors.d.mts +1 -7
- package/node_modules/typebox/build/format/_idna.mjs +36 -6
- package/node_modules/typebox/build/format/_puny.mjs +4 -1
- package/node_modules/typebox/build/format/uuid.d.mts +2 -2
- package/node_modules/typebox/build/format/uuid.mjs +3 -3
- package/node_modules/typebox/build/guard/emit.d.mts +0 -4
- package/node_modules/typebox/build/guard/emit.mjs +0 -8
- package/node_modules/typebox/build/guard/guard.d.mts +5 -9
- package/node_modules/typebox/build/guard/guard.mjs +10 -15
- package/node_modules/typebox/build/guard/string.mjs +16 -4
- package/node_modules/typebox/build/schema/engine/_functions.mjs +34 -15
- package/node_modules/typebox/build/schema/engine/boolean.d.mts +3 -3
- package/node_modules/typebox/build/schema/engine/boolean.mjs +4 -4
- package/node_modules/typebox/build/schema/engine/index.d.mts +0 -1
- package/node_modules/typebox/build/schema/engine/index.mjs +0 -1
- package/node_modules/typebox/build/schema/engine/schema.mjs +6 -11
- package/node_modules/typebox/build/schema/engine/type.mjs +14 -18
- package/node_modules/typebox/build/schema/types/dependencies.mjs +1 -1
- package/node_modules/typebox/build/schema/types/index.d.mts +0 -1
- package/node_modules/typebox/build/schema/types/index.mjs +0 -1
- package/node_modules/typebox/build/schema/types/schema.d.mts +1 -1
- package/node_modules/typebox/build/schema/types/schema.mjs +2 -2
- package/node_modules/typebox/build/system/locale/ar_001.mjs +0 -1
- package/node_modules/typebox/build/system/locale/bn_BD.mjs +0 -1
- package/node_modules/typebox/build/system/locale/cs_CZ.mjs +0 -1
- package/node_modules/typebox/build/system/locale/de_DE.mjs +0 -1
- package/node_modules/typebox/build/system/locale/el_GR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/en_US.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_419.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_AR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_ES.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_MX.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fa_IR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fil_PH.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fr_CA.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fr_FR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ha_NG.mjs +0 -1
- package/node_modules/typebox/build/system/locale/hi_IN.mjs +0 -1
- package/node_modules/typebox/build/system/locale/hu_HU.mjs +0 -1
- package/node_modules/typebox/build/system/locale/id_ID.mjs +0 -1
- package/node_modules/typebox/build/system/locale/it_IT.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ja_JP.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ko_KR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ms_MY.mjs +0 -1
- package/node_modules/typebox/build/system/locale/nl_NL.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pl_PL.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pt_BR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pt_PT.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ro_RO.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ru_RU.mjs +0 -1
- package/node_modules/typebox/build/system/locale/sv_SE.mjs +0 -1
- package/node_modules/typebox/build/system/locale/sw_TZ.mjs +0 -1
- package/node_modules/typebox/build/system/locale/th_TH.mjs +0 -1
- package/node_modules/typebox/build/system/locale/tr_TR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/uk_UA.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ur_PK.mjs +0 -1
- package/node_modules/typebox/build/system/locale/vi_VN.mjs +0 -1
- package/node_modules/typebox/build/system/locale/yo_NG.mjs +0 -1
- package/node_modules/typebox/build/system/locale/zh_Hans.mjs +0 -1
- package/node_modules/typebox/build/system/locale/zh_Hant.mjs +0 -1
- package/node_modules/typebox/build/system/memory/clone.d.mts +2 -3
- package/node_modules/typebox/build/system/memory/clone.mjs +73 -26
- package/node_modules/typebox/build/system/settings/settings.d.mts +15 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +3 -1
- package/node_modules/typebox/build/type/action/_add_immutable.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_immutable.mjs +11 -0
- package/node_modules/typebox/build/type/action/_add_optional.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_optional.mjs +11 -0
- package/node_modules/typebox/build/type/action/_add_readonly.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_readonly.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_immutable.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_immutable.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_optional.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_optional.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_readonly.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_readonly.mjs +11 -0
- package/node_modules/typebox/build/type/action/conditional.d.mts +2 -3
- package/node_modules/typebox/build/type/action/conditional.mjs +2 -1
- package/node_modules/typebox/build/type/action/index.d.mts +7 -4
- package/node_modules/typebox/build/type/action/index.mjs +7 -4
- package/node_modules/typebox/build/type/action/mapped.d.mts +2 -3
- package/node_modules/typebox/build/type/action/mapped.mjs +2 -1
- package/node_modules/typebox/build/type/action/module.d.mts +8 -7
- package/node_modules/typebox/build/type/action/module.mjs +7 -6
- package/node_modules/typebox/build/type/action/readonly_object.mjs +3 -0
- package/node_modules/typebox/build/type/action/with.d.mts +11 -0
- package/node_modules/typebox/build/type/action/with.mjs +11 -0
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +1 -1
- package/node_modules/typebox/build/type/engine/call/instantiate.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/call/instantiate.mjs +3 -2
- package/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs +2 -2
- package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.d.mts +3 -4
- package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs +2 -1
- package/node_modules/typebox/build/type/engine/cyclic/candidates.d.mts +2 -3
- package/node_modules/typebox/build/type/engine/cyclic/candidates.mjs +3 -6
- package/node_modules/typebox/build/type/engine/cyclic/check.d.mts +6 -9
- package/node_modules/typebox/build/type/engine/cyclic/check.mjs +10 -16
- package/node_modules/typebox/build/type/engine/cyclic/dependencies.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs +9 -15
- package/node_modules/typebox/build/type/engine/cyclic/extends.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/cyclic/extends.mjs +8 -14
- package/node_modules/typebox/build/type/engine/cyclic/instantiate.d.mts +2 -5
- package/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs +3 -2
- package/node_modules/typebox/build/type/engine/enum/index.d.mts +0 -1
- package/node_modules/typebox/build/type/engine/enum/index.mjs +0 -1
- package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +1 -2
- package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +2 -6
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +10 -6
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +10 -6
- package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +3 -3
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +17 -5
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +34 -8
- package/node_modules/typebox/build/type/engine/exclude/operation.d.mts +5 -6
- package/node_modules/typebox/build/type/engine/exclude/operation.mjs +11 -12
- package/node_modules/typebox/build/type/engine/extract/operation.d.mts +5 -6
- package/node_modules/typebox/build/type/engine/extract/operation.mjs +11 -12
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/index.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/index.mjs +2 -2
- package/node_modules/typebox/build/type/engine/indexable/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/indexable/from_enum.d.mts +3 -3
- package/node_modules/typebox/build/type/engine/indexable/from_enum.mjs +4 -4
- package/node_modules/typebox/build/type/engine/indexable/from_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/engine/indexable/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/indexable/from_type.mjs +9 -6
- package/node_modules/typebox/build/type/engine/indexed/instantiate.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/indexed/instantiate.mjs +5 -2
- package/node_modules/typebox/build/type/engine/instantiate.d.mts +44 -31
- package/node_modules/typebox/build/type/engine/instantiate.mjs +82 -83
- package/node_modules/typebox/build/type/engine/interface/instantiate.d.mts +3 -6
- package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/engine/keyof/instantiate.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/keyof/instantiate.mjs +5 -1
- package/node_modules/typebox/build/type/engine/mapped/mapped_operation.d.mts +4 -4
- package/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs +3 -3
- package/node_modules/typebox/build/type/engine/mapped/mapped_variants.d.mts +5 -4
- package/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs +10 -5
- package/node_modules/typebox/build/type/engine/module/instantiate.d.mts +7 -9
- package/node_modules/typebox/build/type/engine/module/instantiate.mjs +17 -15
- package/node_modules/typebox/build/type/engine/object/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/object/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/object/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/object/from_type.mjs +8 -5
- package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/parameters/instantiate.d.mts +3 -4
- package/node_modules/typebox/build/type/engine/parameters/instantiate.mjs +2 -1
- package/node_modules/typebox/build/type/engine/partial/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/partial/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/partial/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/partial/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/partial/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/partial/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/partial/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/partial/from_type.mjs +7 -4
- package/node_modules/typebox/build/type/engine/priority/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/priority/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/priority/priority.d.mts +20 -0
- package/node_modules/typebox/build/type/engine/priority/priority.mjs +28 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_array.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs +8 -5
- package/node_modules/typebox/build/type/engine/record/from_key_enum.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_enum.mjs +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs +2 -2
- package/node_modules/typebox/build/type/engine/ref/instantiate.d.mts +3 -3
- package/node_modules/typebox/build/type/engine/ref/instantiate.mjs +6 -6
- package/node_modules/typebox/build/type/engine/required/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/required/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/required/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/required/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/required/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/required/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/required/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/required/from_type.mjs +7 -4
- package/node_modules/typebox/build/type/engine/template_literal/decode.mjs +3 -3
- package/node_modules/typebox/build/type/engine/template_literal/encode.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/template_literal/encode.mjs +6 -6
- package/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs +1 -1
- package/node_modules/typebox/build/type/engine/template_literal/is_pattern.mjs +1 -0
- package/node_modules/typebox/build/type/engine/this/expand_this.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/this/expand_this.mjs +7 -13
- package/node_modules/typebox/build/type/engine/with/instantiate.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/{options → with}/instantiate.mjs +5 -5
- package/node_modules/typebox/build/type/extends/dependent.d.mts +6 -0
- package/node_modules/typebox/build/type/extends/dependent.mjs +6 -0
- package/node_modules/typebox/build/type/extends/enum.d.mts +4 -4
- package/node_modules/typebox/build/type/extends/enum.mjs +3 -2
- package/node_modules/typebox/build/type/extends/extends_left.d.mts +5 -7
- package/node_modules/typebox/build/type/extends/extends_left.mjs +24 -27
- package/node_modules/typebox/build/type/extends/extends_right.d.mts +7 -5
- package/node_modules/typebox/build/type/extends/extends_right.mjs +20 -15
- package/node_modules/typebox/build/type/extends/inference.mjs +1 -1
- package/node_modules/typebox/build/type/extends/object.d.mts +8 -1
- package/node_modules/typebox/build/type/extends/object.mjs +25 -3
- package/node_modules/typebox/build/type/extends/parameters.mjs +2 -2
- package/node_modules/typebox/build/type/extends/record.d.mts +13 -0
- package/node_modules/typebox/build/type/extends/record.mjs +23 -0
- package/node_modules/typebox/build/type/extends/template_literal.d.mts +3 -3
- package/node_modules/typebox/build/type/extends/template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/extends/tuple.d.mts +3 -6
- package/node_modules/typebox/build/type/extends/tuple.mjs +6 -5
- package/node_modules/typebox/build/type/extends/union.mjs +2 -2
- package/node_modules/typebox/build/type/script/mapping.d.mts +86 -98
- package/node_modules/typebox/build/type/script/mapping.mjs +95 -92
- package/node_modules/typebox/build/type/script/parser.d.mts +42 -40
- package/node_modules/typebox/build/type/script/parser.mjs +23 -22
- package/node_modules/typebox/build/type/script/script.d.mts +3 -4
- package/node_modules/typebox/build/type/script/script.mjs +3 -2
- package/node_modules/typebox/build/type/script/token/internal/guard.d.mts +1 -1
- package/node_modules/typebox/build/type/script/token/internal/guard.mjs +1 -1
- package/node_modules/typebox/build/type/script/token/internal/take.mjs +1 -1
- package/node_modules/typebox/build/type/script/token/until.mjs +2 -2
- package/node_modules/typebox/build/type/types/_codec.d.mts +12 -12
- package/node_modules/typebox/build/type/types/_codec.mjs +0 -1
- package/node_modules/typebox/build/type/types/_immutable.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_immutable.mjs +2 -10
- package/node_modules/typebox/build/type/types/_optional.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_optional.mjs +2 -11
- package/node_modules/typebox/build/type/types/_readonly.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_readonly.mjs +2 -10
- package/node_modules/typebox/build/type/types/_refine.d.mts +8 -10
- package/node_modules/typebox/build/type/types/_refine.mjs +1 -2
- package/node_modules/typebox/build/type/types/call.d.mts +3 -3
- package/node_modules/typebox/build/type/types/call.mjs +3 -2
- package/node_modules/typebox/build/type/types/deferred.d.mts +1 -0
- package/node_modules/typebox/build/type/types/deferred.mjs +1 -1
- package/node_modules/typebox/build/type/types/dependent.d.mts +17 -0
- package/node_modules/typebox/build/type/types/dependent.mjs +24 -0
- package/node_modules/typebox/build/type/types/enum.d.mts +3 -1
- package/node_modules/typebox/build/type/types/enum.mjs +5 -0
- package/node_modules/typebox/build/type/types/index.d.mts +1 -4
- package/node_modules/typebox/build/type/types/index.mjs +1 -4
- package/node_modules/typebox/build/type/types/number.d.mts +1 -1
- package/node_modules/typebox/build/type/types/number.mjs +1 -1
- package/node_modules/typebox/build/type/types/record.d.mts +13 -7
- package/node_modules/typebox/build/type/types/record.mjs +15 -9
- package/node_modules/typebox/build/type/types/static.d.mts +2 -5
- package/node_modules/typebox/build/typebox.d.mts +3 -7
- package/node_modules/typebox/build/typebox.mjs +3 -7
- package/node_modules/typebox/build/value/clean/clean.mjs +4 -2
- package/node_modules/typebox/build/value/clean/from_intersect.mjs +2 -2
- package/node_modules/typebox/build/value/clean/from_type.mjs +8 -10
- package/node_modules/typebox/build/value/clean/from_union.d.mts +1 -1
- package/node_modules/typebox/build/value/clean/from_union.mjs +1 -2
- package/node_modules/typebox/build/value/clone/clone.mjs +2 -73
- package/node_modules/typebox/build/value/codec/decode.mjs +4 -2
- package/node_modules/typebox/build/value/codec/encode.mjs +4 -2
- package/node_modules/typebox/build/value/codec/from_array.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_object.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_record.mjs +2 -7
- package/node_modules/typebox/build/value/codec/from_tuple.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_union.mjs +2 -3
- package/node_modules/typebox/build/value/convert/from_enum.mjs +3 -4
- package/node_modules/typebox/build/value/convert/from_template_literal.d.mts +1 -1
- package/node_modules/typebox/build/value/convert/from_template_literal.mjs +2 -3
- package/node_modules/typebox/build/value/convert/from_type.mjs +19 -21
- package/node_modules/typebox/build/value/create/from_enum.mjs +2 -2
- package/node_modules/typebox/build/value/create/from_type.mjs +23 -31
- package/node_modules/typebox/build/value/default/from_object.mjs +1 -1
- package/node_modules/typebox/build/value/default/from_type.mjs +8 -10
- package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
- package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
- package/node_modules/typebox/build/value/index.d.mts +0 -1
- package/node_modules/typebox/build/value/index.mjs +0 -1
- package/node_modules/typebox/build/value/repair/from_enum.mjs +2 -3
- package/node_modules/typebox/build/value/repair/from_type.mjs +24 -22
- package/node_modules/typebox/build/value/shared/union_priority_sort.d.mts +6 -2
- package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +62 -26
- package/node_modules/typebox/build/value/value.d.mts +0 -1
- package/node_modules/typebox/build/value/value.mjs +0 -1
- package/node_modules/typebox/package.json +33 -33
- package/node_modules/typebox/readme.md +117 -103
- package/package.json +16 -11
- package/vendor/pi-client/client.d.ts +25 -0
- package/vendor/pi-client/client.d.ts.map +1 -0
- package/vendor/pi-client/client.js +386 -0
- package/vendor/pi-client/client.js.map +1 -0
- package/vendor/pi-client/connection.d.ts +25 -0
- package/vendor/pi-client/connection.d.ts.map +1 -0
- package/vendor/pi-client/connection.js +204 -0
- package/vendor/pi-client/connection.js.map +1 -0
- package/vendor/pi-client/errors.d.ts +23 -0
- package/vendor/pi-client/errors.d.ts.map +1 -0
- package/vendor/pi-client/errors.js +42 -0
- package/vendor/pi-client/errors.js.map +1 -0
- package/vendor/pi-client/index.d.ts +6 -0
- package/vendor/pi-client/index.d.ts.map +1 -0
- package/vendor/pi-client/index.js +3 -0
- package/vendor/pi-client/index.js.map +1 -0
- package/vendor/pi-client/promise.d.ts +8 -0
- package/vendor/pi-client/promise.d.ts.map +1 -0
- package/vendor/pi-client/promise.js +11 -0
- package/vendor/pi-client/promise.js.map +1 -0
- package/vendor/pi-client/session-handle.d.ts +54 -0
- package/vendor/pi-client/session-handle.d.ts.map +1 -0
- package/vendor/pi-client/session-handle.js +50 -0
- package/vendor/pi-client/session-handle.js.map +1 -0
- package/vendor/pi-client/state.d.ts +22 -0
- package/vendor/pi-client/state.d.ts.map +1 -0
- package/vendor/pi-client/state.js +149 -0
- package/vendor/pi-client/state.js.map +1 -0
- package/vendor/pi-client/transport.d.ts +17 -0
- package/vendor/pi-client/transport.d.ts.map +1 -0
- package/vendor/pi-client/transport.js +2 -0
- package/vendor/pi-client/transport.js.map +1 -0
- package/vendor/pi-client/types.d.ts +23 -0
- package/vendor/pi-client/types.d.ts.map +1 -0
- package/vendor/pi-client/types.js +2 -0
- package/vendor/pi-client/types.js.map +1 -0
- package/vendor/pi-client/unix.d.ts +8 -0
- package/vendor/pi-client/unix.d.ts.map +1 -0
- package/vendor/pi-client/unix.js +151 -0
- package/vendor/pi-client/unix.js.map +1 -0
- package/vendor/pi-protocol/cbor/decoder.d.ts +4 -0
- package/vendor/pi-protocol/cbor/decoder.d.ts.map +1 -0
- package/vendor/pi-protocol/cbor/decoder.js +163 -0
- package/vendor/pi-protocol/cbor/decoder.js.map +1 -0
- package/vendor/pi-protocol/cbor/encoder.d.ts +4 -0
- package/vendor/pi-protocol/cbor/encoder.d.ts.map +1 -0
- package/vendor/pi-protocol/cbor/encoder.js +199 -0
- package/vendor/pi-protocol/cbor/encoder.js.map +1 -0
- package/vendor/pi-protocol/cbor/index.d.ts +4 -0
- package/vendor/pi-protocol/cbor/index.d.ts.map +1 -0
- package/vendor/pi-protocol/cbor/index.js +4 -0
- package/vendor/pi-protocol/cbor/index.js.map +1 -0
- package/vendor/pi-protocol/cbor/options.d.ts +26 -0
- package/vendor/pi-protocol/cbor/options.d.ts.map +1 -0
- package/vendor/pi-protocol/cbor/options.js +29 -0
- package/vendor/pi-protocol/cbor/options.js.map +1 -0
- package/vendor/pi-protocol/codec.d.ts +29 -0
- package/vendor/pi-protocol/codec.d.ts.map +1 -0
- package/vendor/pi-protocol/codec.js +140 -0
- package/vendor/pi-protocol/codec.js.map +1 -0
- package/vendor/pi-protocol/framing.d.ts +29 -0
- package/vendor/pi-protocol/framing.d.ts.map +1 -0
- package/vendor/pi-protocol/framing.js +152 -0
- package/vendor/pi-protocol/framing.js.map +1 -0
- package/vendor/pi-protocol/index.d.ts +5 -0
- package/vendor/pi-protocol/index.d.ts.map +1 -0
- package/vendor/pi-protocol/index.js +5 -0
- package/vendor/pi-protocol/index.js.map +1 -0
- package/vendor/pi-protocol/schemas.d.ts +13818 -0
- package/vendor/pi-protocol/schemas.d.ts.map +1 -0
- package/vendor/pi-protocol/schemas.js +382 -0
- package/vendor/pi-protocol/schemas.js.map +1 -0
- package/dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.d.ts +0 -3
- package/dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.d.ts.map +0 -1
- package/dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.d.ts +0 -26
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.js +0 -100
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.d.ts +0 -42
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.js +0 -286
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.d.ts +0 -18
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.js +0 -44
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.d.ts +0 -33
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.js +0 -163
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.d.ts +0 -11
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.js +0 -39
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.js.map +0 -1
- package/node_modules/typebox/build/schema/engine/_guard.d.mts +0 -6
- package/node_modules/typebox/build/schema/engine/_guard.mjs +0 -26
- package/node_modules/typebox/build/schema/types/_guard.d.mts +0 -10
- package/node_modules/typebox/build/schema/types/_guard.mjs +0 -16
- package/node_modules/typebox/build/type/action/_optional.d.mts +0 -19
- package/node_modules/typebox/build/type/action/_optional.mjs +0 -40
- package/node_modules/typebox/build/type/action/_readonly.d.mts +0 -19
- package/node_modules/typebox/build/type/action/_readonly.mjs +0 -40
- package/node_modules/typebox/build/type/action/awaited.d.mts +0 -15
- package/node_modules/typebox/build/type/action/awaited.mjs +0 -15
- package/node_modules/typebox/build/type/action/options.d.mts +0 -11
- package/node_modules/typebox/build/type/action/options.mjs +0 -11
- package/node_modules/typebox/build/type/engine/awaited/instantiate.d.mts +0 -11
- package/node_modules/typebox/build/type/engine/awaited/instantiate.mjs +0 -20
- package/node_modules/typebox/build/type/engine/enum/enum_to_union.d.mts +0 -14
- package/node_modules/typebox/build/type/engine/enum/enum_to_union.mjs +0 -24
- package/node_modules/typebox/build/type/engine/options/index.d.mts +0 -1
- package/node_modules/typebox/build/type/engine/options/index.mjs +0 -1
- package/node_modules/typebox/build/type/engine/options/instantiate.d.mts +0 -8
- package/node_modules/typebox/build/type/extends/async_iterator.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/async_iterator.mjs +0 -9
- package/node_modules/typebox/build/type/extends/iterator.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/iterator.mjs +0 -9
- package/node_modules/typebox/build/type/extends/promise.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/promise.mjs +0 -9
- package/node_modules/typebox/build/type/types/async_iterator.d.mts +0 -20
- package/node_modules/typebox/build/type/types/async_iterator.mjs +0 -28
- package/node_modules/typebox/build/type/types/base.d.mts +0 -50
- package/node_modules/typebox/build/type/types/base.mjs +0 -84
- package/node_modules/typebox/build/type/types/iterator.d.mts +0 -20
- package/node_modules/typebox/build/type/types/iterator.mjs +0 -28
- package/node_modules/typebox/build/type/types/promise.d.mts +0 -21
- package/node_modules/typebox/build/type/types/promise.mjs +0 -29
- package/node_modules/typebox/build/value/clean/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/clean/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/convert/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/convert/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/create/from_async_iterator.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_async_iterator.mjs +0 -5
- package/node_modules/typebox/build/value/create/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/create/from_iterator.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_iterator.mjs +0 -5
- package/node_modules/typebox/build/value/create/from_promise.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_promise.mjs +0 -5
- package/node_modules/typebox/build/value/default/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/default/from_base.mjs +0 -5
- package/node_modules/typebox/build/value/mutate/error.d.mts +0 -3
- package/node_modules/typebox/build/value/mutate/error.mjs +0 -6
- package/node_modules/typebox/build/value/mutate/from_array.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_array.mjs +0 -16
- package/node_modules/typebox/build/value/mutate/from_object.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_object.mjs +0 -40
- package/node_modules/typebox/build/value/mutate/from_unknown.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_unknown.mjs +0 -7
- package/node_modules/typebox/build/value/mutate/from_value.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_value.mjs +0 -12
- package/node_modules/typebox/build/value/mutate/index.d.mts +0 -1
- package/node_modules/typebox/build/value/mutate/index.mjs +0 -1
- package/node_modules/typebox/build/value/mutate/mutate.d.mts +0 -11
- package/node_modules/typebox/build/value/mutate/mutate.mjs +0 -41
- package/node_modules/typebox/build/value/repair/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/repair/from_base.mjs +0 -8
- /package/node_modules/typebox/build/type/engine/{awaited → with}/index.d.mts +0 -0
- /package/node_modules/typebox/build/type/engine/{awaited → with}/index.mjs +0 -0
|
@@ -18,6 +18,7 @@ import { basename, dirname } from "node:path";
|
|
|
18
18
|
import { prepareAgentToolCall } from "@earendil-works/pi-agent-core";
|
|
19
19
|
import { contentText, SERVER_FALLBACK_ABORTED_DIAGNOSTIC } from "@earendil-works/pi-ai";
|
|
20
20
|
import { cleanupSessionResources, isClassifierRefusal, isContextOverflow, isProviderStreamStallError, isProviderTimeoutError, isRetryableAssistantError, modelsAreEqual, resetApiProviders, streamSimple, } from "@earendil-works/pi-ai/compat";
|
|
21
|
+
import { extract429RetryAfterMs, parseRetryAfterMsMarker } from "@earendil-works/pi-ai/utils/retry-hint";
|
|
21
22
|
import { getAgentDir } from "../config.js";
|
|
22
23
|
import { getThemeByName, theme } from "../modes/interactive/theme/theme.js";
|
|
23
24
|
import { stripFrontmatter } from "../utils/frontmatter.js";
|
|
@@ -41,9 +42,12 @@ import { getModelNarrowingPatterns, resolveModelScope } from "./model-resolver.j
|
|
|
41
42
|
import { PROMPT_CACHE_SAFE_WAIT_ENV, resolvePromptCacheSafeWaitSeconds } from "./prompt-cache-budget.js";
|
|
42
43
|
import { expandPromptTemplate } from "./prompt-templates.js";
|
|
43
44
|
import { isBillingErrorMessage } from "./retry-fallback/billing.js";
|
|
45
|
+
import { formatSelector } from "./retry-fallback/chains.js";
|
|
44
46
|
import { RetryFallbackController } from "./retry-fallback/controller.js";
|
|
45
47
|
import { SelectorCooldowns } from "./retry-fallback/cooldown.js";
|
|
48
|
+
import { classifyRateLimitedWait, nextInTurnDelayMs, probeBackSchedule, } from "./retry-fallback/hint-policy.js";
|
|
46
49
|
import { createFallbackLogger } from "./retry-fallback/log.js";
|
|
50
|
+
import { ProbeBackScheduler } from "./retry-fallback/probe-scheduler.js";
|
|
47
51
|
import { validateFallbackChains } from "./retry-fallback/validate.js";
|
|
48
52
|
import { createSessionLogger } from "./session-log.js";
|
|
49
53
|
import { buildSessionContext, CURRENT_SESSION_VERSION, getLatestCompactionEntry, } from "./session-manager.js";
|
|
@@ -203,6 +207,7 @@ export class AgentSession {
|
|
|
203
207
|
/** Recovery-only order across both native queue modes and TUI compaction ownership. */
|
|
204
208
|
this._queuedInputOrder = [];
|
|
205
209
|
this._nextQueuedInputOrder = 0;
|
|
210
|
+
this._supersededCompactionLogAttemptIds = new Set();
|
|
206
211
|
/** Messages queued to be included with the next user prompt as context ("asides"). */
|
|
207
212
|
this._pendingNextTurnMessages = [];
|
|
208
213
|
// Queues held while the first post-compaction response is classified. Agent
|
|
@@ -233,6 +238,9 @@ export class AgentSession {
|
|
|
233
238
|
this._retryAbortController = undefined;
|
|
234
239
|
this._retryAttempt = 0;
|
|
235
240
|
this._consecutiveProviderStreamStalls = 0;
|
|
241
|
+
this._probePhase = "idle";
|
|
242
|
+
this._hintDeadlineMs = undefined;
|
|
243
|
+
this._cumulativeHintedWaitMs = 0;
|
|
236
244
|
this._retryPromise = undefined;
|
|
237
245
|
this._retryResolve = undefined;
|
|
238
246
|
this._userAbortPromise = undefined;
|
|
@@ -242,7 +250,7 @@ export class AgentSession {
|
|
|
242
250
|
this._hadClearedQueuedMessages = false;
|
|
243
251
|
this._extensionEventSignal = undefined;
|
|
244
252
|
// Bash execution state
|
|
245
|
-
this.
|
|
253
|
+
this._bashAbortControllers = new Set();
|
|
246
254
|
this._pendingBashMessages = [];
|
|
247
255
|
this._turnIndex = 0;
|
|
248
256
|
this._baseToolDefinitions = new Map();
|
|
@@ -306,7 +314,6 @@ export class AgentSession {
|
|
|
306
314
|
this.agent = config.agent;
|
|
307
315
|
this.sessionManager = config.sessionManager;
|
|
308
316
|
this.settingsManager = config.settingsManager;
|
|
309
|
-
this.agent.abortServerSideFallback = this.settingsManager.getAbortServerSideFallback();
|
|
310
317
|
const noModelFallback = config.resourceLoader.getExtensions().runtime.flagValues.get("no-model-fallback") === true ||
|
|
311
318
|
process.env.SENPI_NO_FALLBACK === "1";
|
|
312
319
|
if (noModelFallback) {
|
|
@@ -323,16 +330,19 @@ export class AgentSession {
|
|
|
323
330
|
}
|
|
324
331
|
this._modelRuntime = modelRuntime;
|
|
325
332
|
this._modelRegistry = config.modelRegistry ?? new ModelRegistry(modelRuntime);
|
|
326
|
-
|
|
327
|
-
|
|
333
|
+
this._agentDir = config.agentDir ?? getAgentDir();
|
|
334
|
+
const fallbackLogger = createFallbackLogger(this._agentDir);
|
|
335
|
+
this._sessionLogger = createSessionLogger(this._agentDir);
|
|
328
336
|
this._fallbackValidationWarnings = validateFallbackChains(this.settingsManager.getRawFallbackChains(), this._modelRegistry);
|
|
329
337
|
for (const warning of this._fallbackValidationWarnings) {
|
|
330
338
|
fallbackLogger.warn("validation_warning", { warning });
|
|
331
339
|
}
|
|
340
|
+
this._selectorCooldowns = new SelectorCooldowns(config.fallbackNow ?? (() => Date.now()));
|
|
341
|
+
this._fallbackNow = config.fallbackNow ?? (() => Date.now());
|
|
332
342
|
this._retryFallback = new RetryFallbackController({
|
|
333
343
|
getSettings: () => this.settingsManager.getRetryFallbackSettings(),
|
|
334
344
|
registry: this._modelRegistry,
|
|
335
|
-
cooldowns:
|
|
345
|
+
cooldowns: this._selectorCooldowns,
|
|
336
346
|
logger: fallbackLogger,
|
|
337
347
|
switchModel: async (model, thinking, reason) => {
|
|
338
348
|
await this._switchActiveModel(model, {
|
|
@@ -349,6 +359,9 @@ export class AgentSession {
|
|
|
349
359
|
getCurrentSelector: () => (this.model ? { model: this.model, thinkingLevel: this.thinkingLevel } : undefined),
|
|
350
360
|
isAuthAvailable: (provider) => this._modelRuntime.hasConfiguredAuth(provider),
|
|
351
361
|
});
|
|
362
|
+
this._probeBackScheduler = new ProbeBackScheduler({
|
|
363
|
+
now: this._fallbackNow,
|
|
364
|
+
});
|
|
352
365
|
this._extensionRunnerRef = config.extensionRunnerRef;
|
|
353
366
|
this._initialActiveToolNames = config.initialActiveToolNames;
|
|
354
367
|
this._allowedToolNames = config.allowedToolNames ? new Set(config.allowedToolNames) : undefined;
|
|
@@ -619,15 +632,77 @@ export class AgentSession {
|
|
|
619
632
|
}
|
|
620
633
|
/** Mirror stuck-prone lifecycle transitions into logs/session.log (content-free). */
|
|
621
634
|
_logSessionEvent(event) {
|
|
635
|
+
if (event.type === "compaction_start") {
|
|
636
|
+
const previousAttempt = this._activeCompactionLogAttempt;
|
|
637
|
+
if (previousAttempt) {
|
|
638
|
+
const tokensAfter = this._estimateCompactionLogTokens("persisted");
|
|
639
|
+
this._sessionLogger.info("compaction_decision", {
|
|
640
|
+
attemptId: previousAttempt.id,
|
|
641
|
+
reason: previousAttempt.reason,
|
|
642
|
+
mode: previousAttempt.reason === "manual" ? "manual" : "auto",
|
|
643
|
+
action: "compact",
|
|
644
|
+
disposition: "superseded",
|
|
645
|
+
accepted: false,
|
|
646
|
+
skipped: true,
|
|
647
|
+
aborted: true,
|
|
648
|
+
willRetry: false,
|
|
649
|
+
tokensBefore: previousAttempt.tokensBefore,
|
|
650
|
+
tokensAfter,
|
|
651
|
+
});
|
|
652
|
+
this._supersededCompactionLogAttemptIds.add(previousAttempt.id);
|
|
653
|
+
}
|
|
654
|
+
const attempt = {
|
|
655
|
+
id: event.requestId ?? randomUUID(),
|
|
656
|
+
reason: event.reason,
|
|
657
|
+
tokensBefore: this._estimateCompactionLogTokens("persisted"),
|
|
658
|
+
};
|
|
659
|
+
this._activeCompactionLogAttempt = attempt;
|
|
660
|
+
this._sessionLogger.info("compaction_start", {
|
|
661
|
+
attemptId: attempt.id,
|
|
662
|
+
reason: event.reason,
|
|
663
|
+
mode: event.reason === "manual" ? "manual" : "auto",
|
|
664
|
+
action: "compact",
|
|
665
|
+
tokensBefore: attempt.tokensBefore,
|
|
666
|
+
});
|
|
667
|
+
return;
|
|
668
|
+
}
|
|
622
669
|
if (event.type === "compaction_end") {
|
|
670
|
+
if (event.requestId && this._supersededCompactionLogAttemptIds.delete(event.requestId))
|
|
671
|
+
return;
|
|
672
|
+
const activeAttempt = this._activeCompactionLogAttempt;
|
|
673
|
+
const attempt = event.requestId !== undefined && activeAttempt?.id === event.requestId ? activeAttempt : undefined;
|
|
674
|
+
const accepted = event.accepted ?? event.result !== undefined;
|
|
675
|
+
const rejected = event.rejectionCause !== undefined;
|
|
676
|
+
const skipped = !accepted && (attempt === undefined || (!rejected && !event.aborted && !event.errorMessage));
|
|
677
|
+
const disposition = accepted
|
|
678
|
+
? "committed"
|
|
679
|
+
: attempt === undefined
|
|
680
|
+
? "skipped"
|
|
681
|
+
: rejected
|
|
682
|
+
? "rejected"
|
|
683
|
+
: event.aborted
|
|
684
|
+
? "aborted"
|
|
685
|
+
: event.errorMessage
|
|
686
|
+
? "failed"
|
|
687
|
+
: "skipped";
|
|
688
|
+
const tokensAfter = this._estimateCompactionLogTokens(accepted ? "active" : "persisted");
|
|
623
689
|
this._sessionLogger.info("compaction_decision", {
|
|
690
|
+
attemptId: attempt?.id ?? event.requestId,
|
|
624
691
|
reason: event.reason,
|
|
625
|
-
|
|
692
|
+
mode: event.reason === "manual" ? "manual" : "auto",
|
|
693
|
+
action: accepted || attempt ? "compact" : "none",
|
|
694
|
+
disposition,
|
|
695
|
+
accepted,
|
|
696
|
+
skipped,
|
|
626
697
|
aborted: event.aborted,
|
|
627
698
|
willRetry: event.willRetry,
|
|
628
699
|
rejectionCause: event.rejectionCause,
|
|
629
700
|
error: event.errorMessage,
|
|
701
|
+
tokensBefore: attempt?.tokensBefore ?? tokensAfter,
|
|
702
|
+
tokensAfter,
|
|
630
703
|
});
|
|
704
|
+
if (attempt)
|
|
705
|
+
this._activeCompactionLogAttempt = undefined;
|
|
631
706
|
return;
|
|
632
707
|
}
|
|
633
708
|
if (event.type === "message_end" && event.message.role === "assistant") {
|
|
@@ -642,6 +717,15 @@ export class AgentSession {
|
|
|
642
717
|
this._sessionLogger.warn("provider_error", { kind, error: message.errorMessage });
|
|
643
718
|
}
|
|
644
719
|
}
|
|
720
|
+
_estimateCompactionLogTokens(source) {
|
|
721
|
+
try {
|
|
722
|
+
const messages = source === "active" ? this.agent.state.messages : this.sessionManager.buildSessionContext().messages;
|
|
723
|
+
return estimateMessagesTokens(filterContextExcludedMessages(messages));
|
|
724
|
+
}
|
|
725
|
+
catch {
|
|
726
|
+
return undefined;
|
|
727
|
+
}
|
|
728
|
+
}
|
|
645
729
|
_emitQueueUpdate() {
|
|
646
730
|
this._emit({
|
|
647
731
|
type: "queue_update",
|
|
@@ -656,6 +740,10 @@ export class AgentSession {
|
|
|
656
740
|
getMessageRevision() {
|
|
657
741
|
return this._messageRevision;
|
|
658
742
|
}
|
|
743
|
+
/** Resolved agent state directory for this session. */
|
|
744
|
+
get agentDir() {
|
|
745
|
+
return this._agentDir;
|
|
746
|
+
}
|
|
659
747
|
async _waitForSettledSessionWork() {
|
|
660
748
|
await this._sessionWorkBarrier.waitForSettled(() => this._agentEventQueue);
|
|
661
749
|
}
|
|
@@ -716,6 +804,8 @@ export class AgentSession {
|
|
|
716
804
|
async _promptAgent(messages) {
|
|
717
805
|
this._isAgentRunActive = true;
|
|
718
806
|
this._requiredCompactionAdmissionError = undefined;
|
|
807
|
+
this.agent.abortServerSideFallback =
|
|
808
|
+
this.settingsManager.getAbortServerSideFallback() && this._retryFallback.hasConfiguredChain();
|
|
719
809
|
try {
|
|
720
810
|
await this.agent.prompt(messages);
|
|
721
811
|
// AgentSession's subscriber intentionally queues event work instead of
|
|
@@ -1018,6 +1108,7 @@ export class AgentSession {
|
|
|
1018
1108
|
attempt: this._retryAttempt,
|
|
1019
1109
|
});
|
|
1020
1110
|
this._retryAttempt = 0;
|
|
1111
|
+
this._resetHintTierState();
|
|
1021
1112
|
}
|
|
1022
1113
|
}
|
|
1023
1114
|
}
|
|
@@ -1107,6 +1198,77 @@ export class AgentSession {
|
|
|
1107
1198
|
this._retryPromise = undefined;
|
|
1108
1199
|
}
|
|
1109
1200
|
}
|
|
1201
|
+
_resetHintTierState() {
|
|
1202
|
+
this._probePhase = "idle";
|
|
1203
|
+
this._hintDeadlineMs = undefined;
|
|
1204
|
+
this._cumulativeHintedWaitMs = 0;
|
|
1205
|
+
}
|
|
1206
|
+
/**
|
|
1207
|
+
* Arm the probe-back scheduler for a tier-2 demoted selector. The scheduler
|
|
1208
|
+
* will fire at most two probes (half-hint, then deadline) and clear the
|
|
1209
|
+
* selector cooldown on success so maybeRestorePrimary reverts at the next
|
|
1210
|
+
* turn boundary.
|
|
1211
|
+
*/
|
|
1212
|
+
_armProbeBackForDemotedSelector(selector, hintMs) {
|
|
1213
|
+
if (!selector)
|
|
1214
|
+
return;
|
|
1215
|
+
// Guard: skip when the demoted selector is the ACTIVE model.
|
|
1216
|
+
const currentModel = this.model;
|
|
1217
|
+
if (currentModel && formatSelector(currentModel) === selector)
|
|
1218
|
+
return;
|
|
1219
|
+
// Guard: skip when auth is unavailable at arm time.
|
|
1220
|
+
const parts = selector.split("/");
|
|
1221
|
+
if (parts.length < 2)
|
|
1222
|
+
return;
|
|
1223
|
+
const provider = parts[0];
|
|
1224
|
+
if (!this._modelRuntime.hasConfiguredAuth(provider))
|
|
1225
|
+
return;
|
|
1226
|
+
const now = this._fallbackNow();
|
|
1227
|
+
const schedule = probeBackSchedule(hintMs, now);
|
|
1228
|
+
const modelId = parts.slice(1).join("/");
|
|
1229
|
+
const demotedModel = this._modelRuntime.getModel(provider, modelId);
|
|
1230
|
+
if (!demotedModel)
|
|
1231
|
+
return;
|
|
1232
|
+
this._probeBackScheduler.arm({
|
|
1233
|
+
selector,
|
|
1234
|
+
firstAtMs: schedule.firstAtMs,
|
|
1235
|
+
deadlineMs: schedule.deadlineMs,
|
|
1236
|
+
authAvailable: () => this._modelRuntime.hasConfiguredAuth(provider),
|
|
1237
|
+
runProbe: async (signal) => {
|
|
1238
|
+
try {
|
|
1239
|
+
const result = await this._modelRuntime.completeSimple(demotedModel, {
|
|
1240
|
+
systemPrompt: "Reply with OK.",
|
|
1241
|
+
messages: [{ role: "user", content: [{ type: "text", text: "OK" }], timestamp: now }],
|
|
1242
|
+
}, { maxTokens: 1, signal });
|
|
1243
|
+
return result.stopReason !== "error" && result.stopReason !== "aborted";
|
|
1244
|
+
}
|
|
1245
|
+
catch {
|
|
1246
|
+
return false;
|
|
1247
|
+
}
|
|
1248
|
+
},
|
|
1249
|
+
onCleared: (sel) => {
|
|
1250
|
+
this._selectorCooldowns.clear(sel);
|
|
1251
|
+
},
|
|
1252
|
+
emit: (event) => {
|
|
1253
|
+
if (event.type === "retry_probe_scheduled") {
|
|
1254
|
+
this._emit({
|
|
1255
|
+
type: "retry_probe_scheduled",
|
|
1256
|
+
selector: event.selector,
|
|
1257
|
+
atMs: event.atMs,
|
|
1258
|
+
probeIndex: event.probeIndex,
|
|
1259
|
+
});
|
|
1260
|
+
}
|
|
1261
|
+
else {
|
|
1262
|
+
this._emit({
|
|
1263
|
+
type: "retry_probe_result",
|
|
1264
|
+
selector: event.selector,
|
|
1265
|
+
ok: event.ok,
|
|
1266
|
+
errorMessage: event.errorMessage,
|
|
1267
|
+
});
|
|
1268
|
+
}
|
|
1269
|
+
},
|
|
1270
|
+
});
|
|
1271
|
+
}
|
|
1110
1272
|
/** Find the last assistant message in agent state (including aborted ones) */
|
|
1111
1273
|
_findLastAssistantMessage() {
|
|
1112
1274
|
const messages = this.agent.state.messages;
|
|
@@ -1318,6 +1480,7 @@ export class AgentSession {
|
|
|
1318
1480
|
*/
|
|
1319
1481
|
dispose() {
|
|
1320
1482
|
try {
|
|
1483
|
+
this._probeBackScheduler.cancel("dispose");
|
|
1321
1484
|
this.abortRetry();
|
|
1322
1485
|
this.abortCompaction();
|
|
1323
1486
|
this.abortBranchSummary();
|
|
@@ -2253,8 +2416,23 @@ export class AgentSession {
|
|
|
2253
2416
|
}
|
|
2254
2417
|
}
|
|
2255
2418
|
else if (options?.triggerTurn) {
|
|
2256
|
-
|
|
2257
|
-
|
|
2419
|
+
try {
|
|
2420
|
+
await this._enforceCompactionBeforeProvider(this._findLastAssistantMessage(), false, "pre_prompt");
|
|
2421
|
+
await this._enforceFinalProviderAdmission([appMessage]);
|
|
2422
|
+
}
|
|
2423
|
+
catch (error) {
|
|
2424
|
+
// Mirror sendUserMessage's retention contract: an admission
|
|
2425
|
+
// rejection must retain the message for later delivery instead
|
|
2426
|
+
// of silently dropping it (the fire-and-forget extension action
|
|
2427
|
+
// swallows this rejection).
|
|
2428
|
+
if (options.deliverAs === "followUp") {
|
|
2429
|
+
this.agent.followUp(appMessage);
|
|
2430
|
+
}
|
|
2431
|
+
else {
|
|
2432
|
+
this.agent.steer(appMessage);
|
|
2433
|
+
}
|
|
2434
|
+
throw error;
|
|
2435
|
+
}
|
|
2258
2436
|
await this._promptAgent(appMessage);
|
|
2259
2437
|
}
|
|
2260
2438
|
else {
|
|
@@ -2509,6 +2687,7 @@ export class AgentSession {
|
|
|
2509
2687
|
// A manual model change abandons any active fallback window; if a fallback
|
|
2510
2688
|
// retry sleep is still pending, cancel it so no surprise continuation fires.
|
|
2511
2689
|
const hadActiveFallback = this._retryFallback.activeState !== undefined;
|
|
2690
|
+
this._probeBackScheduler.cancel("manual-model-change");
|
|
2512
2691
|
this._retryFallback.clearForManualModelChange(model);
|
|
2513
2692
|
if (hadActiveFallback && this._retryAbortController) {
|
|
2514
2693
|
this.abortRetry();
|
|
@@ -2537,6 +2716,8 @@ export class AgentSession {
|
|
|
2537
2716
|
}
|
|
2538
2717
|
const thinkingLevel = this._getThinkingLevelForModelSwitch(opts.ephemeralThinkingLevel);
|
|
2539
2718
|
this.agent.state.model = model;
|
|
2719
|
+
this.agent.abortServerSideFallback =
|
|
2720
|
+
this.settingsManager.getAbortServerSideFallback() && this._retryFallback.hasConfiguredChain();
|
|
2540
2721
|
if (opts.appendSessionEntry) {
|
|
2541
2722
|
this.sessionManager.appendModelChange(model.provider, model.id, opts.entryReason, previousModel?.provider, previousModel?.id);
|
|
2542
2723
|
}
|
|
@@ -2594,6 +2775,7 @@ export class AgentSession {
|
|
|
2594
2775
|
if (invalidatesCompaction) {
|
|
2595
2776
|
this._invalidateCompactionForModelSelection();
|
|
2596
2777
|
}
|
|
2778
|
+
this._probeBackScheduler.cancel("manual-model-change");
|
|
2597
2779
|
this._retryFallback.clearForManualModelChange(next.model);
|
|
2598
2780
|
const thinkingLevel = this._getThinkingLevelForModelSwitch(next.thinkingLevel);
|
|
2599
2781
|
this.agent.state.model = next.model;
|
|
@@ -2855,6 +3037,7 @@ export class AgentSession {
|
|
|
2855
3037
|
async compact(customInstructions) {
|
|
2856
3038
|
const admission = this._claimPendingCompactionAdmission();
|
|
2857
3039
|
const controller = admission.controller;
|
|
3040
|
+
const requestId = randomUUID();
|
|
2858
3041
|
let outcome = "failed";
|
|
2859
3042
|
let disconnected = false;
|
|
2860
3043
|
try {
|
|
@@ -2864,11 +3047,12 @@ export class AgentSession {
|
|
|
2864
3047
|
await this._abortActiveAgentAndRetry("system");
|
|
2865
3048
|
this._disconnectFromAgent();
|
|
2866
3049
|
disconnected = true;
|
|
2867
|
-
this._emit({ type: "compaction_start", reason: "manual" });
|
|
3050
|
+
this._emit({ type: "compaction_start", reason: "manual", requestId });
|
|
2868
3051
|
const execution = await this._executeCompaction({
|
|
2869
3052
|
controller,
|
|
2870
3053
|
owner: "compaction",
|
|
2871
3054
|
reason: "manual",
|
|
3055
|
+
requestId,
|
|
2872
3056
|
customInstructions,
|
|
2873
3057
|
willRetry: false,
|
|
2874
3058
|
});
|
|
@@ -2894,6 +3078,7 @@ export class AgentSession {
|
|
|
2894
3078
|
result: undefined,
|
|
2895
3079
|
aborted,
|
|
2896
3080
|
willRetry: false,
|
|
3081
|
+
requestId,
|
|
2897
3082
|
errorMessage: aborted ? undefined : `Compaction failed: ${message}`,
|
|
2898
3083
|
});
|
|
2899
3084
|
throw error;
|
|
@@ -2905,6 +3090,8 @@ export class AgentSession {
|
|
|
2905
3090
|
this._releasePendingCompactionAdmission(admission, outcome);
|
|
2906
3091
|
if (disconnected && !this.isCompacting)
|
|
2907
3092
|
this._reconnectToAgent();
|
|
3093
|
+
if (outcome === "completed")
|
|
3094
|
+
this._resumeQueuedMessagesAfterCompaction();
|
|
2908
3095
|
}
|
|
2909
3096
|
}
|
|
2910
3097
|
async applyCompaction(precomputed, options) {
|
|
@@ -2915,9 +3102,13 @@ export class AgentSession {
|
|
|
2915
3102
|
return { applied: false, reason: "stale" };
|
|
2916
3103
|
}
|
|
2917
3104
|
const ownsController = this._compactionAbortController === undefined;
|
|
3105
|
+
const lifecycleState = this._compactionLifecycle.state;
|
|
3106
|
+
const requestId = !ownsController && lifecycleState.status === "running" && lifecycleState.stage === "feedback"
|
|
3107
|
+
? lifecycleState.operationId
|
|
3108
|
+
: randomUUID();
|
|
2918
3109
|
if (ownsController) {
|
|
2919
3110
|
this._claimCompactionController(new AbortController(), "compaction");
|
|
2920
|
-
this._emit({ type: "compaction_start", reason: options.reason });
|
|
3111
|
+
this._emit({ type: "compaction_start", reason: options.reason, requestId });
|
|
2921
3112
|
}
|
|
2922
3113
|
const controller = this._compactionAbortController;
|
|
2923
3114
|
if (!controller)
|
|
@@ -2928,12 +3119,14 @@ export class AgentSession {
|
|
|
2928
3119
|
controller,
|
|
2929
3120
|
owner: "compaction",
|
|
2930
3121
|
reason: options.reason,
|
|
3122
|
+
requestId,
|
|
2931
3123
|
willRetry: false,
|
|
2932
3124
|
precomputed,
|
|
2933
3125
|
});
|
|
2934
3126
|
if (!execution.accepted) {
|
|
2935
3127
|
return { applied: false, reason: "rejected" };
|
|
2936
3128
|
}
|
|
3129
|
+
this._resumeQueuedMessagesAfterCompaction();
|
|
2937
3130
|
return { applied: true, reason: "ok" };
|
|
2938
3131
|
}
|
|
2939
3132
|
catch (error) {
|
|
@@ -2948,6 +3141,7 @@ export class AgentSession {
|
|
|
2948
3141
|
result: undefined,
|
|
2949
3142
|
aborted,
|
|
2950
3143
|
willRetry: false,
|
|
3144
|
+
requestId,
|
|
2951
3145
|
errorMessage: aborted ? undefined : `Compaction failed: ${message}`,
|
|
2952
3146
|
});
|
|
2953
3147
|
return { applied: false, reason: "rejected" };
|
|
@@ -2962,14 +3156,15 @@ export class AgentSession {
|
|
|
2962
3156
|
const controller = new AbortController();
|
|
2963
3157
|
this._claimCompactionController(controller, "compaction");
|
|
2964
3158
|
const model = this.model;
|
|
3159
|
+
const requestId = randomUUID();
|
|
2965
3160
|
this._compactionLifecycle.begin({
|
|
2966
|
-
operationId:
|
|
3161
|
+
operationId: requestId,
|
|
2967
3162
|
stage: "feedback",
|
|
2968
3163
|
reason,
|
|
2969
3164
|
model: model ? { provider: model.provider, id: model.id } : undefined,
|
|
2970
3165
|
startedRevision: this._messageRevision,
|
|
2971
3166
|
}, controller);
|
|
2972
|
-
this._emit({ type: "compaction_start", reason });
|
|
3167
|
+
this._emit({ type: "compaction_start", reason, requestId });
|
|
2973
3168
|
return controller.signal;
|
|
2974
3169
|
}
|
|
2975
3170
|
_updateExtensionCompactionFeedback(options) {
|
|
@@ -3007,7 +3202,8 @@ export class AgentSession {
|
|
|
3007
3202
|
result: undefined,
|
|
3008
3203
|
aborted,
|
|
3009
3204
|
willRetry: false,
|
|
3010
|
-
|
|
3205
|
+
requestId: operation.operationId,
|
|
3206
|
+
errorMessage: aborted ? undefined : (options.errorMessage ?? "Compaction did not apply"),
|
|
3011
3207
|
});
|
|
3012
3208
|
this._releaseCompactionController(options.signal);
|
|
3013
3209
|
}
|
|
@@ -3022,7 +3218,7 @@ export class AgentSession {
|
|
|
3022
3218
|
if (!this._ownsCompactionController(controller, request.owner)) {
|
|
3023
3219
|
throw new CompactionExecutionError(new CompactionCancelledError(), false, true);
|
|
3024
3220
|
}
|
|
3025
|
-
const requestId = randomUUID();
|
|
3221
|
+
const requestId = request.requestId ?? randomUUID();
|
|
3026
3222
|
const operationId = this._compactionLifecycle.begin({
|
|
3027
3223
|
operationId: requestId,
|
|
3028
3224
|
stage: "execution",
|
|
@@ -3277,6 +3473,10 @@ export class AgentSession {
|
|
|
3277
3473
|
* Cancel in-progress compaction (manual or auto).
|
|
3278
3474
|
*/
|
|
3279
3475
|
abortCompaction() {
|
|
3476
|
+
const lifecycleState = this._compactionLifecycle.state;
|
|
3477
|
+
const activeFeedbackRequestId = lifecycleState.status === "running" && lifecycleState.stage === "feedback"
|
|
3478
|
+
? lifecycleState.operationId
|
|
3479
|
+
: undefined;
|
|
3280
3480
|
const feedbackOperation = this._compactionLifecycle.abort(this._messageRevision);
|
|
3281
3481
|
this._compactionAbortController?.abort();
|
|
3282
3482
|
this._autoCompactionAbortController?.abort();
|
|
@@ -3288,6 +3488,7 @@ export class AgentSession {
|
|
|
3288
3488
|
result: undefined,
|
|
3289
3489
|
aborted: true,
|
|
3290
3490
|
willRetry: false,
|
|
3491
|
+
requestId: activeFeedbackRequestId,
|
|
3291
3492
|
});
|
|
3292
3493
|
}
|
|
3293
3494
|
}
|
|
@@ -3532,13 +3733,15 @@ export class AgentSession {
|
|
|
3532
3733
|
}
|
|
3533
3734
|
async _runPrePromptCompaction(lastAssistantMessage, skipAbortedCheck, reason = "pre_prompt", willRetry = false, allowSummaryOnly = false) {
|
|
3534
3735
|
const controller = new AbortController();
|
|
3736
|
+
const requestId = randomUUID();
|
|
3535
3737
|
this._claimCompactionController(controller, "compaction");
|
|
3536
|
-
this._emit({ type: "compaction_start", reason });
|
|
3738
|
+
this._emit({ type: "compaction_start", reason, requestId });
|
|
3537
3739
|
try {
|
|
3538
3740
|
const execution = await this._executeCompaction({
|
|
3539
3741
|
controller,
|
|
3540
3742
|
owner: "compaction",
|
|
3541
3743
|
reason,
|
|
3744
|
+
requestId,
|
|
3542
3745
|
willRetry,
|
|
3543
3746
|
lastAssistantMessage,
|
|
3544
3747
|
skipAbortedCheck,
|
|
@@ -3566,6 +3769,7 @@ export class AgentSession {
|
|
|
3566
3769
|
result: undefined,
|
|
3567
3770
|
aborted,
|
|
3568
3771
|
willRetry: false,
|
|
3772
|
+
requestId,
|
|
3569
3773
|
errorMessage: aborted ? undefined : `Pre-prompt compaction failed: ${errorMessage}`,
|
|
3570
3774
|
});
|
|
3571
3775
|
return false;
|
|
@@ -3633,6 +3837,18 @@ export class AgentSession {
|
|
|
3633
3837
|
this._scheduledContinuationRecompacted = false;
|
|
3634
3838
|
}
|
|
3635
3839
|
}
|
|
3840
|
+
/**
|
|
3841
|
+
* Mirror _runAutoCompaction's post-success recovery for non-auto compaction
|
|
3842
|
+
* owners (manual, extension action, extension apply): a custom triggerTurn
|
|
3843
|
+
* message sent while the compaction was running is parked in the agent-level
|
|
3844
|
+
* queues without starting a turn, so a settled compaction must deliver it or
|
|
3845
|
+
* hidden continuations (e.g. goal) wedge until manual user input.
|
|
3846
|
+
*/
|
|
3847
|
+
_resumeQueuedMessagesAfterCompaction() {
|
|
3848
|
+
if (this.pendingMessageCount > 0 || this.agent.hasQueuedMessages()) {
|
|
3849
|
+
this._scheduleContinuationAfterCurrentEvent();
|
|
3850
|
+
}
|
|
3851
|
+
}
|
|
3636
3852
|
_scheduleContinuationAfterCurrentEvent(options = {}, retryContinuation = false) {
|
|
3637
3853
|
// Tool hooks wait for queued message persistence, so continue() cannot run inside this event promise.
|
|
3638
3854
|
const currentEventQueue = this._agentEventQueue;
|
|
@@ -3666,9 +3882,10 @@ export class AgentSession {
|
|
|
3666
3882
|
const finishCompactionWork = this._sessionWorkBarrier.begin();
|
|
3667
3883
|
const agentMessagesAtStart = this.agent.state.messages.slice();
|
|
3668
3884
|
const autoCompactionController = new AbortController();
|
|
3885
|
+
const requestId = randomUUID();
|
|
3669
3886
|
this._claimCompactionController(autoCompactionController, "auto");
|
|
3670
3887
|
const endBeforeExecution = () => {
|
|
3671
|
-
this._emit({ type: "compaction_start", reason });
|
|
3888
|
+
this._emit({ type: "compaction_start", reason, requestId });
|
|
3672
3889
|
if (reason === "overflow" && this._autoCompactionAbortController === autoCompactionController) {
|
|
3673
3890
|
this._overflowRecoveryAttempted = false;
|
|
3674
3891
|
}
|
|
@@ -3685,6 +3902,7 @@ export class AgentSession {
|
|
|
3685
3902
|
result: undefined,
|
|
3686
3903
|
aborted: autoCompactionController.signal.aborted,
|
|
3687
3904
|
willRetry: false,
|
|
3905
|
+
requestId,
|
|
3688
3906
|
});
|
|
3689
3907
|
return false;
|
|
3690
3908
|
};
|
|
@@ -3712,11 +3930,12 @@ export class AgentSession {
|
|
|
3712
3930
|
}
|
|
3713
3931
|
if (!this._ownsCompactionController(autoCompactionController, "auto"))
|
|
3714
3932
|
return false;
|
|
3715
|
-
this._emit({ type: "compaction_start", reason });
|
|
3933
|
+
this._emit({ type: "compaction_start", reason, requestId });
|
|
3716
3934
|
const execution = await this._executeCompaction({
|
|
3717
3935
|
controller: autoCompactionController,
|
|
3718
3936
|
owner: "auto",
|
|
3719
3937
|
reason,
|
|
3938
|
+
requestId,
|
|
3720
3939
|
willRetry,
|
|
3721
3940
|
agentMessagesAtStart,
|
|
3722
3941
|
});
|
|
@@ -3762,6 +3981,7 @@ export class AgentSession {
|
|
|
3762
3981
|
result: undefined,
|
|
3763
3982
|
aborted,
|
|
3764
3983
|
willRetry: false,
|
|
3984
|
+
requestId,
|
|
3765
3985
|
errorMessage: aborted
|
|
3766
3986
|
? undefined
|
|
3767
3987
|
: reason === "overflow"
|
|
@@ -3976,7 +4196,9 @@ export class AgentSession {
|
|
|
3976
4196
|
}, {
|
|
3977
4197
|
getModel: () => this.model,
|
|
3978
4198
|
getServiceTier: () => this.serviceTier,
|
|
4199
|
+
getScopedModels: () => this._scopedModels,
|
|
3979
4200
|
isIdle: () => this.isIdle,
|
|
4201
|
+
getAgentDir: () => this._agentDir,
|
|
3980
4202
|
isProjectTrusted: () => this.settingsManager.isProjectTrusted(),
|
|
3981
4203
|
getSignal: () => this._extensionEventSignal ?? this.agent.signal,
|
|
3982
4204
|
abort: () => {
|
|
@@ -4041,23 +4263,27 @@ export class AgentSession {
|
|
|
4041
4263
|
compact: (options) => {
|
|
4042
4264
|
const admission = this._claimPendingCompactionAdmission();
|
|
4043
4265
|
const controller = admission.controller;
|
|
4266
|
+
const requestId = randomUUID();
|
|
4044
4267
|
void (async () => {
|
|
4045
4268
|
let outcome = "failed";
|
|
4269
|
+
let compactionCompleted = false;
|
|
4046
4270
|
let disconnected = false;
|
|
4047
4271
|
try {
|
|
4048
4272
|
await this._abortActiveAgentAndRetry("system");
|
|
4049
4273
|
this._disconnectFromAgent();
|
|
4050
4274
|
disconnected = true;
|
|
4051
|
-
this._emit({ type: "compaction_start", reason: "extension" });
|
|
4275
|
+
this._emit({ type: "compaction_start", reason: "extension", requestId });
|
|
4052
4276
|
const execution = await this._executeCompaction({
|
|
4053
4277
|
controller,
|
|
4054
4278
|
owner: "compaction",
|
|
4055
4279
|
reason: "extension",
|
|
4280
|
+
requestId,
|
|
4056
4281
|
customInstructions: options?.customInstructions,
|
|
4057
4282
|
willRetry: false,
|
|
4058
4283
|
});
|
|
4059
4284
|
if (execution.accepted) {
|
|
4060
4285
|
outcome = "completed";
|
|
4286
|
+
compactionCompleted = true;
|
|
4061
4287
|
options?.onComplete?.(execution.result);
|
|
4062
4288
|
}
|
|
4063
4289
|
else {
|
|
@@ -4078,6 +4304,7 @@ export class AgentSession {
|
|
|
4078
4304
|
result: undefined,
|
|
4079
4305
|
aborted,
|
|
4080
4306
|
willRetry: false,
|
|
4307
|
+
requestId,
|
|
4081
4308
|
errorMessage: aborted ? undefined : `Compaction failed: ${message}`,
|
|
4082
4309
|
});
|
|
4083
4310
|
const err = error instanceof Error ? error : new Error(String(error));
|
|
@@ -4091,6 +4318,10 @@ export class AgentSession {
|
|
|
4091
4318
|
this._releasePendingCompactionAdmission(admission, outcome);
|
|
4092
4319
|
if (disconnected && !this.isCompacting)
|
|
4093
4320
|
this._reconnectToAgent();
|
|
4321
|
+
// A throwing onComplete consumer overwrites outcome in the catch
|
|
4322
|
+
// block, so recovery keys off whether compaction itself succeeded.
|
|
4323
|
+
if (compactionCompleted)
|
|
4324
|
+
this._resumeQueuedMessagesAfterCompaction();
|
|
4094
4325
|
}
|
|
4095
4326
|
})();
|
|
4096
4327
|
},
|
|
@@ -4352,32 +4583,11 @@ export class AgentSession {
|
|
|
4352
4583
|
this._retryFallback.canTryFallback());
|
|
4353
4584
|
}
|
|
4354
4585
|
_getProviderRetryDelayMs(errorMessage) {
|
|
4355
|
-
const
|
|
4356
|
-
if (
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
const retryAfterSecondsMatch = errorMessage.match(/\bretry[-_ ]?after\s*[:=]\s*(\d+(?:\.\d+)?)/i);
|
|
4361
|
-
if (retryAfterSecondsMatch) {
|
|
4362
|
-
const delayMs = Math.ceil(Number(retryAfterSecondsMatch[1]) * 1000);
|
|
4363
|
-
return Number.isFinite(delayMs) && delayMs > 0 ? delayMs : undefined;
|
|
4364
|
-
}
|
|
4365
|
-
const retryInMatch = errorMessage.match(/\b(?:retry|try again|wait)\s+(?:after|in)\s*(\d+(?:\.\d+)?)\s*(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m)\b/i);
|
|
4366
|
-
if (!retryInMatch) {
|
|
4367
|
-
return undefined;
|
|
4368
|
-
}
|
|
4369
|
-
const value = Number(retryInMatch[1]);
|
|
4370
|
-
if (!Number.isFinite(value) || value <= 0) {
|
|
4371
|
-
return undefined;
|
|
4372
|
-
}
|
|
4373
|
-
const unit = retryInMatch[2].toLowerCase();
|
|
4374
|
-
if (unit === "m" || unit.startsWith("min")) {
|
|
4375
|
-
return Math.ceil(value * 60_000);
|
|
4376
|
-
}
|
|
4377
|
-
if (unit.startsWith("s")) {
|
|
4378
|
-
return Math.ceil(value * 1000);
|
|
4379
|
-
}
|
|
4380
|
-
return Math.ceil(value);
|
|
4586
|
+
const markerMs = parseRetryAfterMsMarker(errorMessage);
|
|
4587
|
+
if (markerMs !== undefined)
|
|
4588
|
+
return markerMs;
|
|
4589
|
+
const hintMs = extract429RetryAfterMs({ bodyText: errorMessage });
|
|
4590
|
+
return hintMs;
|
|
4381
4591
|
}
|
|
4382
4592
|
_getProviderTimeoutRetryOptions(message) {
|
|
4383
4593
|
if (!isProviderTimeoutError(message))
|
|
@@ -4445,6 +4655,8 @@ export class AgentSession {
|
|
|
4445
4655
|
const isRefusal = isClassifierRefusal(message);
|
|
4446
4656
|
const hardErrorFallback = options.hardErrorFallback === true;
|
|
4447
4657
|
let switchedFallback = false;
|
|
4658
|
+
let is429TierRouted = false;
|
|
4659
|
+
let hintTierDelayMs;
|
|
4448
4660
|
if (hardErrorFallback) {
|
|
4449
4661
|
// A non-retryable provider failure must never replay on the same model.
|
|
4450
4662
|
// Billing-class failures never recover on this account, so the fallback
|
|
@@ -4471,6 +4683,7 @@ export class AgentSession {
|
|
|
4471
4683
|
});
|
|
4472
4684
|
}
|
|
4473
4685
|
this._retryAttempt = 0;
|
|
4686
|
+
this._resetHintTierState();
|
|
4474
4687
|
this._resolveRetry();
|
|
4475
4688
|
return "not-handled";
|
|
4476
4689
|
}
|
|
@@ -4489,6 +4702,7 @@ export class AgentSession {
|
|
|
4489
4702
|
});
|
|
4490
4703
|
}
|
|
4491
4704
|
this._retryAttempt = 0;
|
|
4705
|
+
this._resetHintTierState();
|
|
4492
4706
|
this._resolveRetry();
|
|
4493
4707
|
return "not-handled";
|
|
4494
4708
|
}
|
|
@@ -4508,8 +4722,159 @@ export class AgentSession {
|
|
|
4508
4722
|
const stallError = isProviderStreamStallError(message);
|
|
4509
4723
|
const escalateAfterRepeatedStall = stallError && this._consecutiveProviderStreamStalls > 0;
|
|
4510
4724
|
this._consecutiveProviderStreamStalls = stallError ? this._consecutiveProviderStreamStalls + 1 : 0;
|
|
4511
|
-
|
|
4512
|
-
|
|
4725
|
+
// 429-class detection: retryable AND message carries rate-limit markers.
|
|
4726
|
+
const is429Class = !stallError &&
|
|
4727
|
+
/rate.?limit|(?:^429(?=\s+\{)|(?:\bHTTP\/1\.[01]\s+|\bHTTP\s+|\bstatus(?:\s+code)?\s+|\berror\s+|\bcode\s+)429\b)|too many requests|resource.?exhausted/i.test(errorMessage);
|
|
4728
|
+
if (is429Class) {
|
|
4729
|
+
const hintMs = this._getProviderRetryDelayMs(errorMessage);
|
|
4730
|
+
const hintSettings = this.settingsManager.getHintPolicySettings();
|
|
4731
|
+
const tier = classifyRateLimitedWait(hintMs, hintSettings);
|
|
4732
|
+
is429TierRouted = true;
|
|
4733
|
+
if (tier === "no-hint-fast-fallback") {
|
|
4734
|
+
// Skip same-model retries entirely; fall back immediately.
|
|
4735
|
+
switchedFallback = await this._retryFallback.tryFallback("transient", { errorMessage });
|
|
4736
|
+
if (switchedFallback) {
|
|
4737
|
+
this._retryAttempt = 1;
|
|
4738
|
+
}
|
|
4739
|
+
else {
|
|
4740
|
+
const exhaustedChainKey = this._retryFallback.exhaustedChainKey;
|
|
4741
|
+
if (exhaustedChainKey) {
|
|
4742
|
+
this._emit({
|
|
4743
|
+
type: "retry_fallback_exhausted",
|
|
4744
|
+
chainKey: exhaustedChainKey,
|
|
4745
|
+
lastError: errorMessage,
|
|
4746
|
+
});
|
|
4747
|
+
}
|
|
4748
|
+
this._emit({
|
|
4749
|
+
type: "auto_retry_end",
|
|
4750
|
+
success: false,
|
|
4751
|
+
attempt: 0,
|
|
4752
|
+
finalError: message.errorMessage,
|
|
4753
|
+
});
|
|
4754
|
+
this._retryAttempt = 0;
|
|
4755
|
+
this._resetHintTierState();
|
|
4756
|
+
this._resolveRetry();
|
|
4757
|
+
return "not-handled";
|
|
4758
|
+
}
|
|
4759
|
+
}
|
|
4760
|
+
else if (tier === "tier1-in-turn") {
|
|
4761
|
+
this._retryAttempt++;
|
|
4762
|
+
if (this._retryAttempt > settings.maxRetries) {
|
|
4763
|
+
// Budget exhausted within tier1; fall back.
|
|
4764
|
+
switchedFallback = await this._retryFallback.tryFallback("transient", {
|
|
4765
|
+
errorMessage,
|
|
4766
|
+
retryAfterMs: this._getProviderRetryDelayMs(errorMessage),
|
|
4767
|
+
});
|
|
4768
|
+
if (switchedFallback) {
|
|
4769
|
+
this._retryAttempt = 1;
|
|
4770
|
+
}
|
|
4771
|
+
else {
|
|
4772
|
+
const exhaustedChainKey = this._retryFallback.exhaustedChainKey;
|
|
4773
|
+
if (exhaustedChainKey) {
|
|
4774
|
+
this._emit({
|
|
4775
|
+
type: "retry_fallback_exhausted",
|
|
4776
|
+
chainKey: exhaustedChainKey,
|
|
4777
|
+
lastError: errorMessage,
|
|
4778
|
+
});
|
|
4779
|
+
}
|
|
4780
|
+
this._emit({
|
|
4781
|
+
type: "auto_retry_end",
|
|
4782
|
+
success: false,
|
|
4783
|
+
attempt: this._retryAttempt - 1,
|
|
4784
|
+
finalError: message.errorMessage,
|
|
4785
|
+
});
|
|
4786
|
+
this._retryAttempt = 0;
|
|
4787
|
+
this._resetHintTierState();
|
|
4788
|
+
this._resolveRetry();
|
|
4789
|
+
return "not-handled";
|
|
4790
|
+
}
|
|
4791
|
+
}
|
|
4792
|
+
else {
|
|
4793
|
+
const inTurnResult = nextInTurnDelayMs({
|
|
4794
|
+
probePhase: this._probePhase,
|
|
4795
|
+
hintDeadlineMs: this._hintDeadlineMs,
|
|
4796
|
+
attempt: this._retryAttempt,
|
|
4797
|
+
cumulativeHintedWaitMs: this._cumulativeHintedWaitMs,
|
|
4798
|
+
}, hintMs, settings.baseDelayMs, hintSettings.hintedWaitCapMs, Date.now());
|
|
4799
|
+
this._probePhase = inTurnResult.probePhase;
|
|
4800
|
+
this._hintDeadlineMs = inTurnResult.hintDeadlineMs;
|
|
4801
|
+
this._cumulativeHintedWaitMs = inTurnResult.cumulativeHintedWaitMs;
|
|
4802
|
+
if (inTurnResult.demoteToProbeBack) {
|
|
4803
|
+
// Cumulative hinted wait exceeded cap; demote to tier2 fallback path.
|
|
4804
|
+
const remainingHintMs = Math.max(0, (this._hintDeadlineMs ?? Date.now()) - Date.now());
|
|
4805
|
+
switchedFallback = await this._retryFallback.tryFallback("transient", {
|
|
4806
|
+
errorMessage,
|
|
4807
|
+
retryAfterMs: remainingHintMs,
|
|
4808
|
+
});
|
|
4809
|
+
if (switchedFallback) {
|
|
4810
|
+
this._retryAttempt = 1;
|
|
4811
|
+
}
|
|
4812
|
+
else {
|
|
4813
|
+
const exhaustedChainKey = this._retryFallback.exhaustedChainKey;
|
|
4814
|
+
if (exhaustedChainKey) {
|
|
4815
|
+
this._emit({
|
|
4816
|
+
type: "retry_fallback_exhausted",
|
|
4817
|
+
chainKey: exhaustedChainKey,
|
|
4818
|
+
lastError: errorMessage,
|
|
4819
|
+
});
|
|
4820
|
+
}
|
|
4821
|
+
this._emit({
|
|
4822
|
+
type: "auto_retry_end",
|
|
4823
|
+
success: false,
|
|
4824
|
+
attempt: this._retryAttempt - 1,
|
|
4825
|
+
finalError: message.errorMessage,
|
|
4826
|
+
});
|
|
4827
|
+
this._retryAttempt = 0;
|
|
4828
|
+
this._resetHintTierState();
|
|
4829
|
+
this._resolveRetry();
|
|
4830
|
+
return "not-handled";
|
|
4831
|
+
}
|
|
4832
|
+
}
|
|
4833
|
+
else {
|
|
4834
|
+
hintTierDelayMs = inTurnResult.delayMs;
|
|
4835
|
+
}
|
|
4836
|
+
}
|
|
4837
|
+
}
|
|
4838
|
+
else {
|
|
4839
|
+
// tier2-fallback-probe-back or tier3-fallback-only: immediate fallback.
|
|
4840
|
+
const remainingHintMs = hintMs ?? 0;
|
|
4841
|
+
switchedFallback = await this._retryFallback.tryFallback("transient", {
|
|
4842
|
+
errorMessage,
|
|
4843
|
+
retryAfterMs: remainingHintMs,
|
|
4844
|
+
});
|
|
4845
|
+
if (switchedFallback) {
|
|
4846
|
+
this._retryAttempt = 1;
|
|
4847
|
+
if (tier === "tier2-fallback-probe-back") {
|
|
4848
|
+
const selector = this._retryFallback.activeState?.originalSelector ?? "";
|
|
4849
|
+
this._armProbeBackForDemotedSelector(selector, remainingHintMs);
|
|
4850
|
+
}
|
|
4851
|
+
}
|
|
4852
|
+
else {
|
|
4853
|
+
const exhaustedChainKey = this._retryFallback.exhaustedChainKey;
|
|
4854
|
+
if (exhaustedChainKey) {
|
|
4855
|
+
this._emit({
|
|
4856
|
+
type: "retry_fallback_exhausted",
|
|
4857
|
+
chainKey: exhaustedChainKey,
|
|
4858
|
+
lastError: errorMessage,
|
|
4859
|
+
});
|
|
4860
|
+
}
|
|
4861
|
+
this._emit({
|
|
4862
|
+
type: "auto_retry_end",
|
|
4863
|
+
success: false,
|
|
4864
|
+
attempt: 0,
|
|
4865
|
+
finalError: message.errorMessage,
|
|
4866
|
+
});
|
|
4867
|
+
this._retryAttempt = 0;
|
|
4868
|
+
this._resetHintTierState();
|
|
4869
|
+
this._resolveRetry();
|
|
4870
|
+
return "not-handled";
|
|
4871
|
+
}
|
|
4872
|
+
}
|
|
4873
|
+
}
|
|
4874
|
+
if (!is429TierRouted) {
|
|
4875
|
+
this._retryAttempt++;
|
|
4876
|
+
}
|
|
4877
|
+
if (!is429TierRouted && (this._retryAttempt > settings.maxRetries || escalateAfterRepeatedStall)) {
|
|
4513
4878
|
switchedFallback = await this._retryFallback.tryFallback("transient", {
|
|
4514
4879
|
errorMessage,
|
|
4515
4880
|
retryAfterMs: this._getProviderRetryDelayMs(errorMessage),
|
|
@@ -4534,6 +4899,7 @@ export class AgentSession {
|
|
|
4534
4899
|
finalError: message.errorMessage,
|
|
4535
4900
|
});
|
|
4536
4901
|
this._retryAttempt = 0;
|
|
4902
|
+
this._resetHintTierState();
|
|
4537
4903
|
this._resolveRetry();
|
|
4538
4904
|
return "not-handled";
|
|
4539
4905
|
}
|
|
@@ -4544,7 +4910,8 @@ export class AgentSession {
|
|
|
4544
4910
|
}
|
|
4545
4911
|
const providerDelayMs = isRefusal || hardErrorFallback ? undefined : this._getProviderRetryDelayMs(errorMessage);
|
|
4546
4912
|
const maxRetryDelayMs = this.settingsManager.getProviderRetrySettings().maxRetryDelayMs;
|
|
4547
|
-
|
|
4913
|
+
// For 429-class failures the tier routing replaces the over-budget gate.
|
|
4914
|
+
if (!is429TierRouted && providerDelayMs !== undefined && providerDelayMs > maxRetryDelayMs) {
|
|
4548
4915
|
// A wait this long means the model is unavailable rather than busy, so the
|
|
4549
4916
|
// configured chain beats failing the turn. The switch is gated: the over-budget
|
|
4550
4917
|
// branch above may have already switched on this same error, and hopping again
|
|
@@ -4566,6 +4933,7 @@ export class AgentSession {
|
|
|
4566
4933
|
finalError: `Provider requested retry delay ${providerDelayMs}ms, exceeding configured maximum ${maxRetryDelayMs}ms`,
|
|
4567
4934
|
});
|
|
4568
4935
|
this._retryAttempt = 0;
|
|
4936
|
+
this._resetHintTierState();
|
|
4569
4937
|
this._resolveRetry();
|
|
4570
4938
|
return "not-handled";
|
|
4571
4939
|
}
|
|
@@ -4575,7 +4943,12 @@ export class AgentSession {
|
|
|
4575
4943
|
// reach this point with a fallback already applied (hard-error, refusal) set
|
|
4576
4944
|
// switchedFallback first and force providerDelayMs undefined, so no branch may
|
|
4577
4945
|
// be reordered to fall through here expecting an implicit switch.
|
|
4578
|
-
const
|
|
4946
|
+
const nonTierProviderDelayMs = providerDelayMs === 0 ? undefined : providerDelayMs;
|
|
4947
|
+
const delayMs = switchedFallback
|
|
4948
|
+
? 0
|
|
4949
|
+
: is429TierRouted
|
|
4950
|
+
? (hintTierDelayMs ?? providerDelayMs ?? settings.baseDelayMs * 2 ** (this._retryAttempt - 1))
|
|
4951
|
+
: (nonTierProviderDelayMs ?? settings.baseDelayMs * 2 ** (this._retryAttempt - 1));
|
|
4579
4952
|
// Prepare before auto_retry_start so an immediate Esc can cancel the retry sleep.
|
|
4580
4953
|
this._retryAbortController = new AbortController();
|
|
4581
4954
|
this._emit({
|
|
@@ -4599,6 +4972,7 @@ export class AgentSession {
|
|
|
4599
4972
|
// Aborted during sleep - emit end event so UI can clean up
|
|
4600
4973
|
const attempt = this._retryAttempt;
|
|
4601
4974
|
this._retryAttempt = 0;
|
|
4975
|
+
this._resetHintTierState();
|
|
4602
4976
|
this._retryAbortController = undefined;
|
|
4603
4977
|
await this._emitAgentSettled();
|
|
4604
4978
|
this._emit({
|
|
@@ -4627,6 +5001,7 @@ export class AgentSession {
|
|
|
4627
5001
|
if (!preRetryCompaction && !this._isCompactionOnCooldown()) {
|
|
4628
5002
|
const attempt = this._retryAttempt;
|
|
4629
5003
|
this._retryAttempt = 0;
|
|
5004
|
+
this._resetHintTierState();
|
|
4630
5005
|
this._emit({
|
|
4631
5006
|
type: "auto_retry_end",
|
|
4632
5007
|
success: false,
|
|
@@ -4695,7 +5070,8 @@ export class AgentSession {
|
|
|
4695
5070
|
* @param options.operations Custom BashOperations for remote execution
|
|
4696
5071
|
*/
|
|
4697
5072
|
async executeBash(command, onChunk, options) {
|
|
4698
|
-
|
|
5073
|
+
const abortController = new AbortController();
|
|
5074
|
+
this._bashAbortControllers.add(abortController);
|
|
4699
5075
|
// Apply command prefix if configured (e.g., "shopt -s expand_aliases" for alias support)
|
|
4700
5076
|
const prefix = this.settingsManager.getShellCommandPrefix();
|
|
4701
5077
|
const shellPath = this.settingsManager.getShellPath();
|
|
@@ -4706,13 +5082,13 @@ export class AgentSession {
|
|
|
4706
5082
|
onChunk?.(delta);
|
|
4707
5083
|
this._emit({ type: "bash_execution_update", id: options?.id, delta });
|
|
4708
5084
|
},
|
|
4709
|
-
signal:
|
|
5085
|
+
signal: abortController.signal,
|
|
4710
5086
|
});
|
|
4711
5087
|
this.recordBashResult(command, result, options);
|
|
4712
5088
|
return result;
|
|
4713
5089
|
}
|
|
4714
5090
|
finally {
|
|
4715
|
-
this.
|
|
5091
|
+
this._bashAbortControllers.delete(abortController);
|
|
4716
5092
|
}
|
|
4717
5093
|
}
|
|
4718
5094
|
/**
|
|
@@ -4748,11 +5124,13 @@ export class AgentSession {
|
|
|
4748
5124
|
* Cancel running bash command.
|
|
4749
5125
|
*/
|
|
4750
5126
|
abortBash() {
|
|
4751
|
-
this.
|
|
5127
|
+
for (const abortController of [...this._bashAbortControllers]) {
|
|
5128
|
+
abortController.abort();
|
|
5129
|
+
}
|
|
4752
5130
|
}
|
|
4753
5131
|
/** Whether a bash command is currently running */
|
|
4754
5132
|
get isBashRunning() {
|
|
4755
|
-
return this.
|
|
5133
|
+
return this._bashAbortControllers.size > 0;
|
|
4756
5134
|
}
|
|
4757
5135
|
/** Whether there are pending bash messages waiting to be flushed */
|
|
4758
5136
|
get hasPendingBashMessages() {
|
|
@@ -4801,6 +5179,9 @@ export class AgentSession {
|
|
|
4801
5179
|
* @returns Result with editorText (if user message) and cancelled status
|
|
4802
5180
|
*/
|
|
4803
5181
|
async navigateTree(targetId, options = {}) {
|
|
5182
|
+
if (this.isStreaming) {
|
|
5183
|
+
throw new Error("Wait for the current response to finish before navigating the session tree.");
|
|
5184
|
+
}
|
|
4804
5185
|
const oldLeafId = this.sessionManager.getLeafId();
|
|
4805
5186
|
// No-op if already at target
|
|
4806
5187
|
if (targetId === oldLeafId) {
|