@code-yeongyu/senpi 2026.8.1 → 2026.8.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 +33 -0
- package/README.md +1 -0
- package/dist/cli/args.d.ts +2 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +27 -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 +36 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +325 -41
- 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/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/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-runtime.d.ts +2 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- 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/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/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/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 +20 -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 +12 -0
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +3 -3
- 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 +2 -1
- 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 +17 -8
- 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/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/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.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/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 +13 -1
- 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-client/CHANGELOG.md +7 -0
- package/node_modules/@earendil-works/pi-client/README.md +64 -0
- package/node_modules/@earendil-works/pi-client/dist/client.d.ts +25 -0
- package/node_modules/@earendil-works/pi-client/dist/client.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/client.js +386 -0
- package/node_modules/@earendil-works/pi-client/dist/client.js.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/connection.d.ts +25 -0
- package/node_modules/@earendil-works/pi-client/dist/connection.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/connection.js +204 -0
- package/node_modules/@earendil-works/pi-client/dist/connection.js.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/errors.d.ts +23 -0
- package/node_modules/@earendil-works/pi-client/dist/errors.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/errors.js +42 -0
- package/node_modules/@earendil-works/pi-client/dist/errors.js.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/index.d.ts +6 -0
- package/node_modules/@earendil-works/pi-client/dist/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/index.js +3 -0
- package/node_modules/@earendil-works/pi-client/dist/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/promise.d.ts +8 -0
- package/node_modules/@earendil-works/pi-client/dist/promise.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/promise.js +11 -0
- package/node_modules/@earendil-works/pi-client/dist/promise.js.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/session-handle.d.ts +54 -0
- package/node_modules/@earendil-works/pi-client/dist/session-handle.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/session-handle.js +50 -0
- package/node_modules/@earendil-works/pi-client/dist/session-handle.js.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/state.d.ts +22 -0
- package/node_modules/@earendil-works/pi-client/dist/state.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/state.js +149 -0
- package/node_modules/@earendil-works/pi-client/dist/state.js.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/transport.d.ts +17 -0
- package/node_modules/@earendil-works/pi-client/dist/transport.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/transport.js +2 -0
- package/node_modules/@earendil-works/pi-client/dist/transport.js.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/types.d.ts +23 -0
- package/node_modules/@earendil-works/pi-client/dist/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/types.js +2 -0
- package/node_modules/@earendil-works/pi-client/dist/types.js.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/unix.d.ts +8 -0
- package/node_modules/@earendil-works/pi-client/dist/unix.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/unix.js +151 -0
- package/node_modules/@earendil-works/pi-client/dist/unix.js.map +1 -0
- package/node_modules/@earendil-works/pi-client/package.json +56 -0
- package/node_modules/@earendil-works/pi-protocol/README.md +68 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/decoder.d.ts +4 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/decoder.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/decoder.js +163 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/decoder.js.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/encoder.d.ts +4 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/encoder.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/encoder.js +199 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/encoder.js.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/index.d.ts +4 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/index.js +4 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/options.d.ts +26 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/options.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/options.js +29 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/options.js.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/codec.d.ts +29 -0
- package/node_modules/@earendil-works/pi-protocol/dist/codec.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/codec.js +140 -0
- package/node_modules/@earendil-works/pi-protocol/dist/codec.js.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/framing.d.ts +29 -0
- package/node_modules/@earendil-works/pi-protocol/dist/framing.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/framing.js +152 -0
- package/node_modules/@earendil-works/pi-protocol/dist/framing.js.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/index.d.ts +5 -0
- package/node_modules/@earendil-works/pi-protocol/dist/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/index.js +5 -0
- package/node_modules/@earendil-works/pi-protocol/dist/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/schemas.d.ts +13818 -0
- package/node_modules/@earendil-works/pi-protocol/dist/schemas.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/schemas.js +382 -0
- package/node_modules/@earendil-works/pi-protocol/dist/schemas.js.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/package.json +48 -0
- 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/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/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 +36 -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 +72 -18
- 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 +20 -10
- 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
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export const BINDING_ENTRY_TYPE = "claude-sdk-oauth-binding";
|
|
2
|
+
function isInvalidation(data) {
|
|
3
|
+
return typeof data === "object" && data !== null && data.invalidated === true;
|
|
4
|
+
}
|
|
5
|
+
function isCheckpoint(data) {
|
|
6
|
+
return typeof data === "object" && data !== null && typeof data.sdkSessionId === "string";
|
|
7
|
+
}
|
|
8
|
+
export function latestBindingOnBranch(branch) {
|
|
9
|
+
for (let index = branch.length - 1; index >= 0; index -= 1) {
|
|
10
|
+
const entry = branch[index];
|
|
11
|
+
if (entry?.type !== "custom" || entry.customType !== BINDING_ENTRY_TYPE)
|
|
12
|
+
continue;
|
|
13
|
+
if (isInvalidation(entry.data))
|
|
14
|
+
return undefined;
|
|
15
|
+
if (isCheckpoint(entry.data))
|
|
16
|
+
return entry.data;
|
|
17
|
+
}
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
export function verifyBindingAgainstTranscript(input) {
|
|
21
|
+
const { binding } = input;
|
|
22
|
+
if (!input.transcriptExists)
|
|
23
|
+
return { kind: "flatten", reason: "transcript_missing" };
|
|
24
|
+
if (!binding.lastAssistantUuid || !input.transcriptHasBoundaryUuid) {
|
|
25
|
+
return { kind: "flatten", reason: "branch_boundary_unavailable" };
|
|
26
|
+
}
|
|
27
|
+
if (input.currentSentPrefixHash === binding.sentPrefixHash) {
|
|
28
|
+
return {
|
|
29
|
+
kind: "reattach",
|
|
30
|
+
sdkSessionId: binding.sdkSessionId,
|
|
31
|
+
from: binding.sentCount,
|
|
32
|
+
reason: "registry_miss",
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
kind: "fork",
|
|
37
|
+
sdkSessionId: binding.sdkSessionId,
|
|
38
|
+
atUuid: binding.lastAssistantUuid,
|
|
39
|
+
from: binding.sentCount,
|
|
40
|
+
reason: "sent_stream_diverged",
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=session-binding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-binding.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/claude-sdk-oauth/session-binding.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAG,0BAA0B,CAAC;AAwB7D,SAAS,cAAc,CAAC,IAAa;IACpC,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAK,IAA4B,CAAC,WAAW,KAAK,IAAI,CAAC;AACxG,CAAC;AAED,SAAS,YAAY,CAAC,IAAa;IAClC,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,OAAQ,IAA0B,CAAC,YAAY,KAAK,QAAQ,CAAC;AAClH,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,MAA8B;IACnE,KAAK,IAAI,KAAK,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAC5D,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5B,IAAI,KAAK,EAAE,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,UAAU,KAAK,kBAAkB;YAAE,SAAS;QAClF,IAAI,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC;YAAE,OAAO,SAAS,CAAC;QACjD,IAAI,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC;YAAE,OAAO,KAAK,CAAC,IAAI,CAAC;IACjD,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,8BAA8B,CAAC,KAA+B;IAC7E,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAC1B,IAAI,CAAC,KAAK,CAAC,gBAAgB;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,oBAAoB,EAAE,CAAC;IACtF,IAAI,CAAC,OAAO,CAAC,iBAAiB,IAAI,CAAC,KAAK,CAAC,yBAAyB,EAAE,CAAC;QACpE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,6BAA6B,EAAE,CAAC;IACnE,CAAC;IACD,IAAI,KAAK,CAAC,qBAAqB,KAAK,OAAO,CAAC,cAAc,EAAE,CAAC;QAC5D,OAAO;YACN,IAAI,EAAE,UAAU;YAChB,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,IAAI,EAAE,OAAO,CAAC,SAAS;YACvB,MAAM,EAAE,eAAe;SACvB,CAAC;IACH,CAAC;IACD,OAAO;QACN,IAAI,EAAE,MAAM;QACZ,YAAY,EAAE,OAAO,CAAC,YAAY;QAClC,MAAM,EAAE,OAAO,CAAC,iBAAiB;QACjC,IAAI,EAAE,OAAO,CAAC,SAAS;QACvB,MAAM,EAAE,sBAAsB;KAC9B,CAAC;AACH,CAAC","sourcesContent":["import type { ContinuityDecision } from \"./session-continuity.ts\";\n\nexport const BINDING_ENTRY_TYPE = \"claude-sdk-oauth-binding\";\n\nexport type BindingCheckpoint = {\n\tschemaVersion: 1;\n\tsdkSessionId: string;\n\tsentCount: number;\n\tsentPrefixHash: string;\n\tlastAssistantUuid: string | null;\n\taccountName: string;\n\tclaudeConfigDir: string;\n\tmodelId: string;\n};\n\nexport type BindingInvalidation = { schemaVersion: 1; invalidated: true; reason: string };\n\ntype BranchEntry = { type: string; customType?: string; data?: unknown };\n\nexport type BindingVerificationInput = {\n\tbinding: BindingCheckpoint;\n\ttranscriptExists: boolean;\n\ttranscriptHasBoundaryUuid: boolean;\n\tcurrentSentPrefixHash: string;\n};\n\nfunction isInvalidation(data: unknown): data is BindingInvalidation {\n\treturn typeof data === \"object\" && data !== null && (data as BindingInvalidation).invalidated === true;\n}\n\nfunction isCheckpoint(data: unknown): data is BindingCheckpoint {\n\treturn typeof data === \"object\" && data !== null && typeof (data as BindingCheckpoint).sdkSessionId === \"string\";\n}\n\nexport function latestBindingOnBranch(branch: readonly BranchEntry[]): BindingCheckpoint | undefined {\n\tfor (let index = branch.length - 1; index >= 0; index -= 1) {\n\t\tconst entry = branch[index];\n\t\tif (entry?.type !== \"custom\" || entry.customType !== BINDING_ENTRY_TYPE) continue;\n\t\tif (isInvalidation(entry.data)) return undefined;\n\t\tif (isCheckpoint(entry.data)) return entry.data;\n\t}\n\treturn undefined;\n}\n\nexport function verifyBindingAgainstTranscript(input: BindingVerificationInput): ContinuityDecision {\n\tconst { binding } = input;\n\tif (!input.transcriptExists) return { kind: \"flatten\", reason: \"transcript_missing\" };\n\tif (!binding.lastAssistantUuid || !input.transcriptHasBoundaryUuid) {\n\t\treturn { kind: \"flatten\", reason: \"branch_boundary_unavailable\" };\n\t}\n\tif (input.currentSentPrefixHash === binding.sentPrefixHash) {\n\t\treturn {\n\t\t\tkind: \"reattach\",\n\t\t\tsdkSessionId: binding.sdkSessionId,\n\t\t\tfrom: binding.sentCount,\n\t\t\treason: \"registry_miss\",\n\t\t};\n\t}\n\treturn {\n\t\tkind: \"fork\",\n\t\tsdkSessionId: binding.sdkSessionId,\n\t\tatUuid: binding.lastAssistantUuid,\n\t\tfrom: binding.sentCount,\n\t\treason: \"sent_stream_diverged\",\n\t};\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AssistantMessage } from "@earendil-works/pi-ai";
|
|
2
|
+
export type AssistantCommitOutcome = "clean" | "rewritten" | "not-resident";
|
|
3
|
+
export declare function assistantContentHash(message: AssistantMessage): string;
|
|
4
|
+
export declare function isResidentAssistant(message: AssistantMessage, modelId: string): boolean;
|
|
5
|
+
export declare function isTerminalFailure(message: AssistantMessage): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Divergence is decided by comparing what the provider streamed against what the
|
|
8
|
+
* session ledger committed, never by in-flight staging: a result-only turn fills
|
|
9
|
+
* its content at the terminal message with no preceding delta, so a staged-hash
|
|
10
|
+
* comparison reports false divergence on a perfectly valid SDK response shape.
|
|
11
|
+
*/
|
|
12
|
+
export declare class AssistantCommitBoundary {
|
|
13
|
+
private readonly providerFinalByKey;
|
|
14
|
+
captureProviderFinal(key: string, message: AssistantMessage): void;
|
|
15
|
+
commit(key: string, message: AssistantMessage, modelId: string): AssistantCommitOutcome;
|
|
16
|
+
forget(key: string): void;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=session-commit-boundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-commit-boundary.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAI9D,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,WAAW,GAAG,cAAc,CAAC;AAE5E,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAQtE;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAMvF;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAEpE;AAED;;;;;GAKG;AACH,qBAAa,uBAAuB;IACnC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA6B;IAEhE,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAEjE;IAED,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,GAAG,sBAAsB,CAMtF;IAED,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAExB;CACD"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { CLAUDE_SDK_OAUTH_PROVIDER_ID } from "./account-management.js";
|
|
2
|
+
import { sessionSyncDigest } from "./session-sync.js";
|
|
3
|
+
export function assistantContentHash(message) {
|
|
4
|
+
return sessionSyncDigest({
|
|
5
|
+
role: message.role,
|
|
6
|
+
api: message.api,
|
|
7
|
+
provider: message.provider,
|
|
8
|
+
model: message.model,
|
|
9
|
+
content: message.content,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export function isResidentAssistant(message, modelId) {
|
|
13
|
+
return (message.api === CLAUDE_SDK_OAUTH_PROVIDER_ID &&
|
|
14
|
+
message.provider === CLAUDE_SDK_OAUTH_PROVIDER_ID &&
|
|
15
|
+
message.model === modelId);
|
|
16
|
+
}
|
|
17
|
+
export function isTerminalFailure(message) {
|
|
18
|
+
return message.stopReason === "error" || message.stopReason === "aborted";
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Divergence is decided by comparing what the provider streamed against what the
|
|
22
|
+
* session ledger committed, never by in-flight staging: a result-only turn fills
|
|
23
|
+
* its content at the terminal message with no preceding delta, so a staged-hash
|
|
24
|
+
* comparison reports false divergence on a perfectly valid SDK response shape.
|
|
25
|
+
*/
|
|
26
|
+
export class AssistantCommitBoundary {
|
|
27
|
+
constructor() {
|
|
28
|
+
this.providerFinalByKey = new Map();
|
|
29
|
+
}
|
|
30
|
+
captureProviderFinal(key, message) {
|
|
31
|
+
this.providerFinalByKey.set(key, assistantContentHash(message));
|
|
32
|
+
}
|
|
33
|
+
commit(key, message, modelId) {
|
|
34
|
+
const providerFinal = this.providerFinalByKey.get(key);
|
|
35
|
+
this.providerFinalByKey.delete(key);
|
|
36
|
+
if (!isResidentAssistant(message, modelId))
|
|
37
|
+
return "not-resident";
|
|
38
|
+
if (providerFinal === undefined)
|
|
39
|
+
return "clean";
|
|
40
|
+
return providerFinal === assistantContentHash(message) ? "clean" : "rewritten";
|
|
41
|
+
}
|
|
42
|
+
forget(key) {
|
|
43
|
+
this.providerFinalByKey.delete(key);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=session-commit-boundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-commit-boundary.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAItD,MAAM,UAAU,oBAAoB,CAAC,OAAyB;IAC7D,OAAO,iBAAiB,CAAC;QACxB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,OAAO,EAAE,OAAO,CAAC,OAAO;KACxB,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,OAAyB,EAAE,OAAe;IAC7E,OAAO,CACN,OAAO,CAAC,GAAG,KAAK,4BAA4B;QAC5C,OAAO,CAAC,QAAQ,KAAK,4BAA4B;QACjD,OAAO,CAAC,KAAK,KAAK,OAAO,CACzB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAyB;IAC1D,OAAO,OAAO,CAAC,UAAU,KAAK,OAAO,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS,CAAC;AAC3E,CAAC;AAED;;;;;GAKG;AACH,MAAM,OAAO,uBAAuB;IAApC;QACkB,uBAAkB,GAAG,IAAI,GAAG,EAAkB,CAAC;IAiBjE,CAAC;IAfA,oBAAoB,CAAC,GAAW,EAAE,OAAyB;QAC1D,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,CAAC,GAAW,EAAE,OAAyB,EAAE,OAAe;QAC7D,MAAM,aAAa,GAAG,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACvD,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC;YAAE,OAAO,cAAc,CAAC;QAClE,IAAI,aAAa,KAAK,SAAS;YAAE,OAAO,OAAO,CAAC;QAChD,OAAO,aAAa,KAAK,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC;IAChF,CAAC;IAED,MAAM,CAAC,GAAW;QACjB,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC;CACD","sourcesContent":["import type { AssistantMessage } from \"@earendil-works/pi-ai\";\nimport { CLAUDE_SDK_OAUTH_PROVIDER_ID } from \"./account-management.ts\";\nimport { sessionSyncDigest } from \"./session-sync.ts\";\n\nexport type AssistantCommitOutcome = \"clean\" | \"rewritten\" | \"not-resident\";\n\nexport function assistantContentHash(message: AssistantMessage): string {\n\treturn sessionSyncDigest({\n\t\trole: message.role,\n\t\tapi: message.api,\n\t\tprovider: message.provider,\n\t\tmodel: message.model,\n\t\tcontent: message.content,\n\t});\n}\n\nexport function isResidentAssistant(message: AssistantMessage, modelId: string): boolean {\n\treturn (\n\t\tmessage.api === CLAUDE_SDK_OAUTH_PROVIDER_ID &&\n\t\tmessage.provider === CLAUDE_SDK_OAUTH_PROVIDER_ID &&\n\t\tmessage.model === modelId\n\t);\n}\n\nexport function isTerminalFailure(message: AssistantMessage): boolean {\n\treturn message.stopReason === \"error\" || message.stopReason === \"aborted\";\n}\n\n/**\n * Divergence is decided by comparing what the provider streamed against what the\n * session ledger committed, never by in-flight staging: a result-only turn fills\n * its content at the terminal message with no preceding delta, so a staged-hash\n * comparison reports false divergence on a perfectly valid SDK response shape.\n */\nexport class AssistantCommitBoundary {\n\tprivate readonly providerFinalByKey = new Map<string, string>();\n\n\tcaptureProviderFinal(key: string, message: AssistantMessage): void {\n\t\tthis.providerFinalByKey.set(key, assistantContentHash(message));\n\t}\n\n\tcommit(key: string, message: AssistantMessage, modelId: string): AssistantCommitOutcome {\n\t\tconst providerFinal = this.providerFinalByKey.get(key);\n\t\tthis.providerFinalByKey.delete(key);\n\t\tif (!isResidentAssistant(message, modelId)) return \"not-resident\";\n\t\tif (providerFinal === undefined) return \"clean\";\n\t\treturn providerFinal === assistantContentHash(message) ? \"clean\" : \"rewritten\";\n\t}\n\n\tforget(key: string): void {\n\t\tthis.providerFinalByKey.delete(key);\n\t}\n}\n"]}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { ContinuityReason } from "./session-observability.ts";
|
|
2
|
+
export type ContinuityEntrySnapshot = {
|
|
3
|
+
sdkSessionId: string;
|
|
4
|
+
accountName: string;
|
|
5
|
+
modelId: string;
|
|
6
|
+
systemPromptHash: string;
|
|
7
|
+
toolsetHash: string;
|
|
8
|
+
sentCount: number;
|
|
9
|
+
sentHashes: readonly string[];
|
|
10
|
+
lastAssistantUuid: string | null;
|
|
11
|
+
assistantUuidByIndex: ReadonlyMap<number, string>;
|
|
12
|
+
pendingForkReason: string | null;
|
|
13
|
+
taintedReason?: string | null;
|
|
14
|
+
};
|
|
15
|
+
export type ContinuityBindingSnapshot = {
|
|
16
|
+
sdkSessionId: string;
|
|
17
|
+
sentCount: number;
|
|
18
|
+
sentHashes: readonly string[];
|
|
19
|
+
lastAssistantUuid: string | null;
|
|
20
|
+
accountName: string;
|
|
21
|
+
modelId: string;
|
|
22
|
+
systemPromptHash: string;
|
|
23
|
+
toolsetHash: string;
|
|
24
|
+
};
|
|
25
|
+
export type ContinuityDecisionInput = {
|
|
26
|
+
entry: ContinuityEntrySnapshot | undefined;
|
|
27
|
+
binding: ContinuityBindingSnapshot | undefined;
|
|
28
|
+
currentHashes: readonly string[];
|
|
29
|
+
accountName: string;
|
|
30
|
+
modelId: string;
|
|
31
|
+
fingerprint: {
|
|
32
|
+
systemPromptHash: string;
|
|
33
|
+
toolsetHash: string;
|
|
34
|
+
};
|
|
35
|
+
transcriptAvailable: boolean;
|
|
36
|
+
idleExpired?: boolean;
|
|
37
|
+
};
|
|
38
|
+
export type ContinuityDecision = {
|
|
39
|
+
kind: "bootstrap";
|
|
40
|
+
} | {
|
|
41
|
+
kind: "delta";
|
|
42
|
+
from: number;
|
|
43
|
+
} | {
|
|
44
|
+
kind: "reattach";
|
|
45
|
+
sdkSessionId: string;
|
|
46
|
+
from: number;
|
|
47
|
+
reason: ContinuityReason;
|
|
48
|
+
} | {
|
|
49
|
+
kind: "fork";
|
|
50
|
+
sdkSessionId: string;
|
|
51
|
+
atUuid: string;
|
|
52
|
+
from: number;
|
|
53
|
+
reason: ContinuityReason;
|
|
54
|
+
} | {
|
|
55
|
+
kind: "flatten";
|
|
56
|
+
reason: ContinuityReason;
|
|
57
|
+
};
|
|
58
|
+
export type FailoverLane = "oauth-slots" | "ambient" | "config-dir";
|
|
59
|
+
export type FailoverContinuityInput = {
|
|
60
|
+
authLane: FailoverLane;
|
|
61
|
+
crossAccountResumeSupported: boolean;
|
|
62
|
+
entry: {
|
|
63
|
+
sdkSessionId: string;
|
|
64
|
+
sentCount: number;
|
|
65
|
+
lastAssistantUuid: string | null;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* The config-dir lane keeps each account's credentials inside its own
|
|
70
|
+
* CLAUDE_CONFIG_DIR, and no official SDK API moves a transcript across roots, so
|
|
71
|
+
* its failover is the one declared residual that must still flatten.
|
|
72
|
+
*/
|
|
73
|
+
export declare function decideFailoverContinuity(input: FailoverContinuityInput): ContinuityDecision;
|
|
74
|
+
/**
|
|
75
|
+
* Resume-first: a live session is never abandoned for a flattened re-send. Only a
|
|
76
|
+
* missing transcript or an unrecoverable boundary reaches `flatten`; every other
|
|
77
|
+
* divergence resolves to `fork` (same lineage, new branch) or `reattach` (same
|
|
78
|
+
* session, new query).
|
|
79
|
+
*/
|
|
80
|
+
export declare function decideNativeContinuity(input: ContinuityDecisionInput): ContinuityDecision;
|
|
81
|
+
//# sourceMappingURL=session-continuity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-continuity.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/claude-sdk-oauth/session-continuity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,MAAM,MAAM,uBAAuB,GAAG;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,oBAAoB,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClD,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACrC,KAAK,EAAE,uBAAuB,GAAG,SAAS,CAAC;IAC3C,OAAO,EAAE,yBAAyB,GAAG,SAAS,CAAC;IAC/C,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE;QAAE,gBAAgB,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/D,mBAAmB,EAAE,OAAO,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAC3B;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,gBAAgB,CAAA;CAAE,GAClF;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,gBAAgB,CAAA;CAAE,GAC9F;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,gBAAgB,CAAA;CAAE,CAAC;AAqEjD,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,SAAS,GAAG,YAAY,CAAC;AAEpE,MAAM,MAAM,uBAAuB,GAAG;IACrC,QAAQ,EAAE,YAAY,CAAC;IACvB,2BAA2B,EAAE,OAAO,CAAC;IACrC,KAAK,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;CACrF,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,uBAAuB,GAAG,kBAAkB,CAmB3F;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,uBAAuB,GAAG,kBAAkB,CA8BzF"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
const PENDING_FORK_REASONS = {
|
|
2
|
+
assistant_rewritten: "assistant_rewritten",
|
|
3
|
+
compaction: "tainted_compaction",
|
|
4
|
+
fork: "tainted_fork",
|
|
5
|
+
abort: "tainted_abort",
|
|
6
|
+
};
|
|
7
|
+
function commonPrefixLength(left, right) {
|
|
8
|
+
const limit = Math.min(left.length, right.length);
|
|
9
|
+
let index = 0;
|
|
10
|
+
while (index < limit && left[index] === right[index])
|
|
11
|
+
index += 1;
|
|
12
|
+
return index;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The fork point is the last assistant boundary STRICTLY BEFORE the divergence:
|
|
16
|
+
* forking at the diverged turn itself would carry the stale assistant into the new
|
|
17
|
+
* branch and leave nothing to re-send.
|
|
18
|
+
*/
|
|
19
|
+
function boundaryBefore(entry, count) {
|
|
20
|
+
for (let candidate = count - 1; candidate >= 1; candidate -= 1) {
|
|
21
|
+
const uuid = entry.assistantUuidByIndex.get(candidate);
|
|
22
|
+
if (uuid)
|
|
23
|
+
return { index: candidate, uuid };
|
|
24
|
+
}
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
function forkOrFlatten(entry, divergesAt, reason) {
|
|
28
|
+
const boundary = boundaryBefore(entry, divergesAt);
|
|
29
|
+
if (!boundary)
|
|
30
|
+
return { kind: "flatten", reason };
|
|
31
|
+
return {
|
|
32
|
+
kind: "fork",
|
|
33
|
+
sdkSessionId: entry.sdkSessionId,
|
|
34
|
+
atUuid: boundary.uuid,
|
|
35
|
+
from: boundary.index,
|
|
36
|
+
reason,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function identityDrift(input, entry) {
|
|
40
|
+
if (entry.accountName !== input.accountName)
|
|
41
|
+
return "account_changed";
|
|
42
|
+
if (entry.modelId !== input.modelId)
|
|
43
|
+
return "model_changed";
|
|
44
|
+
if (entry.systemPromptHash !== input.fingerprint.systemPromptHash)
|
|
45
|
+
return "options_changed";
|
|
46
|
+
if (entry.toolsetHash !== input.fingerprint.toolsetHash)
|
|
47
|
+
return "options_changed";
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
function decideFromBinding(input, binding) {
|
|
51
|
+
if (!input.transcriptAvailable)
|
|
52
|
+
return { kind: "flatten", reason: "transcript_missing" };
|
|
53
|
+
const shared = commonPrefixLength(binding.sentHashes, input.currentHashes);
|
|
54
|
+
if (shared === binding.sentCount) {
|
|
55
|
+
return { kind: "reattach", sdkSessionId: binding.sdkSessionId, from: binding.sentCount, reason: "registry_miss" };
|
|
56
|
+
}
|
|
57
|
+
if (!binding.lastAssistantUuid)
|
|
58
|
+
return { kind: "flatten", reason: "registry_miss" };
|
|
59
|
+
return {
|
|
60
|
+
kind: "fork",
|
|
61
|
+
sdkSessionId: binding.sdkSessionId,
|
|
62
|
+
atUuid: binding.lastAssistantUuid,
|
|
63
|
+
from: shared,
|
|
64
|
+
reason: shared < binding.sentCount ? "history_rolled_back" : "sent_stream_diverged",
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The config-dir lane keeps each account's credentials inside its own
|
|
69
|
+
* CLAUDE_CONFIG_DIR, and no official SDK API moves a transcript across roots, so
|
|
70
|
+
* its failover is the one declared residual that must still flatten.
|
|
71
|
+
*/
|
|
72
|
+
export function decideFailoverContinuity(input) {
|
|
73
|
+
const { entry } = input;
|
|
74
|
+
if (input.authLane === "config-dir")
|
|
75
|
+
return { kind: "flatten", reason: "cross_root_unsupported" };
|
|
76
|
+
if (input.crossAccountResumeSupported) {
|
|
77
|
+
return {
|
|
78
|
+
kind: "reattach",
|
|
79
|
+
sdkSessionId: entry.sdkSessionId,
|
|
80
|
+
from: entry.sentCount,
|
|
81
|
+
reason: "account_changed",
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
if (!entry.lastAssistantUuid)
|
|
85
|
+
return { kind: "flatten", reason: "branch_boundary_unavailable" };
|
|
86
|
+
return {
|
|
87
|
+
kind: "fork",
|
|
88
|
+
sdkSessionId: entry.sdkSessionId,
|
|
89
|
+
atUuid: entry.lastAssistantUuid,
|
|
90
|
+
from: entry.sentCount,
|
|
91
|
+
reason: "account_changed",
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Resume-first: a live session is never abandoned for a flattened re-send. Only a
|
|
96
|
+
* missing transcript or an unrecoverable boundary reaches `flatten`; every other
|
|
97
|
+
* divergence resolves to `fork` (same lineage, new branch) or `reattach` (same
|
|
98
|
+
* session, new query).
|
|
99
|
+
*/
|
|
100
|
+
export function decideNativeContinuity(input) {
|
|
101
|
+
const { entry, binding } = input;
|
|
102
|
+
if (!entry) {
|
|
103
|
+
if (!binding)
|
|
104
|
+
return { kind: "bootstrap" };
|
|
105
|
+
return decideFromBinding(input, binding);
|
|
106
|
+
}
|
|
107
|
+
const divergence = entry.pendingForkReason ?? entry.taintedReason;
|
|
108
|
+
if (divergence) {
|
|
109
|
+
return forkOrFlatten(entry, entry.sentCount, PENDING_FORK_REASONS[divergence] ?? "other");
|
|
110
|
+
}
|
|
111
|
+
const shared = commonPrefixLength(entry.sentHashes, input.currentHashes);
|
|
112
|
+
if (shared < entry.sentCount) {
|
|
113
|
+
const rolledBack = input.currentHashes.length < entry.sentCount && shared === input.currentHashes.length;
|
|
114
|
+
return rolledBack
|
|
115
|
+
? forkOrFlatten(entry, input.currentHashes.length, "history_rolled_back")
|
|
116
|
+
: forkOrFlatten(entry, shared + 1, "sent_stream_diverged");
|
|
117
|
+
}
|
|
118
|
+
if (input.idleExpired) {
|
|
119
|
+
return { kind: "reattach", sdkSessionId: entry.sdkSessionId, from: entry.sentCount, reason: "idle_ttl" };
|
|
120
|
+
}
|
|
121
|
+
const drift = identityDrift(input, entry);
|
|
122
|
+
if (drift) {
|
|
123
|
+
return { kind: "reattach", sdkSessionId: entry.sdkSessionId, from: entry.sentCount, reason: drift };
|
|
124
|
+
}
|
|
125
|
+
return { kind: "delta", from: entry.sentCount };
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=session-continuity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-continuity.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/claude-sdk-oauth/session-continuity.ts"],"names":[],"mappings":"AA6CA,MAAM,oBAAoB,GAA+C;IACxE,mBAAmB,EAAE,qBAAqB;IAC1C,UAAU,EAAE,oBAAoB;IAChC,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,eAAe;CACtB,CAAC;AAEF,SAAS,kBAAkB,CAAC,IAAuB,EAAE,KAAwB;IAC5E,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAClD,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,OAAO,KAAK,GAAG,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,KAAK,CAAC;QAAE,KAAK,IAAI,CAAC,CAAC;IACjE,OAAO,KAAK,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,SAAS,cAAc,CAAC,KAA8B,EAAE,KAAa;IACpE,KAAK,IAAI,SAAS,GAAG,KAAK,GAAG,CAAC,EAAE,SAAS,IAAI,CAAC,EAAE,SAAS,IAAI,CAAC,EAAE,CAAC;QAChE,MAAM,IAAI,GAAG,KAAK,CAAC,oBAAoB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACvD,IAAI,IAAI;YAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IAC7C,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,SAAS,aAAa,CACrB,KAA8B,EAC9B,UAAkB,EAClB,MAAwB;IAExB,MAAM,QAAQ,GAAG,cAAc,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IACnD,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;IAClD,OAAO;QACN,IAAI,EAAE,MAAM;QACZ,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,MAAM,EAAE,QAAQ,CAAC,IAAI;QACrB,IAAI,EAAE,QAAQ,CAAC,KAAK;QACpB,MAAM;KACN,CAAC;AACH,CAAC;AAED,SAAS,aAAa,CAAC,KAA8B,EAAE,KAA8B;IACpF,IAAI,KAAK,CAAC,WAAW,KAAK,KAAK,CAAC,WAAW;QAAE,OAAO,iBAAiB,CAAC;IACtE,IAAI,KAAK,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO;QAAE,OAAO,eAAe,CAAC;IAC5D,IAAI,KAAK,CAAC,gBAAgB,KAAK,KAAK,CAAC,WAAW,CAAC,gBAAgB;QAAE,OAAO,iBAAiB,CAAC;IAC5F,IAAI,KAAK,CAAC,WAAW,KAAK,KAAK,CAAC,WAAW,CAAC,WAAW;QAAE,OAAO,iBAAiB,CAAC;IAClF,OAAO,IAAI,CAAC;AACb,CAAC;AAED,SAAS,iBAAiB,CAAC,KAA8B,EAAE,OAAkC;IAC5F,IAAI,CAAC,KAAK,CAAC,mBAAmB;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,oBAAoB,EAAE,CAAC;IACzF,MAAM,MAAM,GAAG,kBAAkB,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IAC3E,IAAI,MAAM,KAAK,OAAO,CAAC,SAAS,EAAE,CAAC;QAClC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,IAAI,EAAE,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC;IACnH,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,iBAAiB;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC;IACpF,OAAO;QACN,IAAI,EAAE,MAAM;QACZ,YAAY,EAAE,OAAO,CAAC,YAAY;QAClC,MAAM,EAAE,OAAO,CAAC,iBAAiB;QACjC,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,sBAAsB;KACnF,CAAC;AACH,CAAC;AAUD;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAA8B;IACtE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACxB,IAAI,KAAK,CAAC,QAAQ,KAAK,YAAY;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,wBAAwB,EAAE,CAAC;IAClG,IAAI,KAAK,CAAC,2BAA2B,EAAE,CAAC;QACvC,OAAO;YACN,IAAI,EAAE,UAAU;YAChB,YAAY,EAAE,KAAK,CAAC,YAAY;YAChC,IAAI,EAAE,KAAK,CAAC,SAAS;YACrB,MAAM,EAAE,iBAAiB;SACzB,CAAC;IACH,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,iBAAiB;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,6BAA6B,EAAE,CAAC;IAChG,OAAO;QACN,IAAI,EAAE,MAAM;QACZ,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,MAAM,EAAE,KAAK,CAAC,iBAAiB;QAC/B,IAAI,EAAE,KAAK,CAAC,SAAS;QACrB,MAAM,EAAE,iBAAiB;KACzB,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAA8B;IACpE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IACjC,IAAI,CAAC,KAAK,EAAE,CAAC;QACZ,IAAI,CAAC,OAAO;YAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;QAC3C,OAAO,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,UAAU,GAAG,KAAK,CAAC,iBAAiB,IAAI,KAAK,CAAC,aAAa,CAAC;IAClE,IAAI,UAAU,EAAE,CAAC;QAChB,OAAO,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,EAAE,oBAAoB,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,CAAC;IAC3F,CAAC;IAED,MAAM,MAAM,GAAG,kBAAkB,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IACzE,IAAI,MAAM,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAC9B,MAAM,UAAU,GAAG,KAAK,CAAC,aAAa,CAAC,MAAM,GAAG,KAAK,CAAC,SAAS,IAAI,MAAM,KAAK,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC;QACzG,OAAO,UAAU;YAChB,CAAC,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,qBAAqB,CAAC;YACzE,CAAC,CAAC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,EAAE,sBAAsB,CAAC,CAAC;IAC7D,CAAC;IAED,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;QACvB,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,IAAI,EAAE,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;IAC1G,CAAC;IAED,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC1C,IAAI,KAAK,EAAE,CAAC;QACX,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,IAAI,EAAE,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IACrG,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;AACjD,CAAC","sourcesContent":["import type { ContinuityReason } from \"./session-observability.ts\";\n\nexport type ContinuityEntrySnapshot = {\n\tsdkSessionId: string;\n\taccountName: string;\n\tmodelId: string;\n\tsystemPromptHash: string;\n\ttoolsetHash: string;\n\tsentCount: number;\n\tsentHashes: readonly string[];\n\tlastAssistantUuid: string | null;\n\tassistantUuidByIndex: ReadonlyMap<number, string>;\n\tpendingForkReason: string | null;\n\ttaintedReason?: string | null;\n};\n\nexport type ContinuityBindingSnapshot = {\n\tsdkSessionId: string;\n\tsentCount: number;\n\tsentHashes: readonly string[];\n\tlastAssistantUuid: string | null;\n\taccountName: string;\n\tmodelId: string;\n\tsystemPromptHash: string;\n\ttoolsetHash: string;\n};\n\nexport type ContinuityDecisionInput = {\n\tentry: ContinuityEntrySnapshot | undefined;\n\tbinding: ContinuityBindingSnapshot | undefined;\n\tcurrentHashes: readonly string[];\n\taccountName: string;\n\tmodelId: string;\n\tfingerprint: { systemPromptHash: string; toolsetHash: string };\n\ttranscriptAvailable: boolean;\n\tidleExpired?: boolean;\n};\n\nexport type ContinuityDecision =\n\t| { kind: \"bootstrap\" }\n\t| { kind: \"delta\"; from: number }\n\t| { kind: \"reattach\"; sdkSessionId: string; from: number; reason: ContinuityReason }\n\t| { kind: \"fork\"; sdkSessionId: string; atUuid: string; from: number; reason: ContinuityReason }\n\t| { kind: \"flatten\"; reason: ContinuityReason };\n\nconst PENDING_FORK_REASONS: Readonly<Record<string, ContinuityReason>> = {\n\tassistant_rewritten: \"assistant_rewritten\",\n\tcompaction: \"tainted_compaction\",\n\tfork: \"tainted_fork\",\n\tabort: \"tainted_abort\",\n};\n\nfunction commonPrefixLength(left: readonly string[], right: readonly string[]): number {\n\tconst limit = Math.min(left.length, right.length);\n\tlet index = 0;\n\twhile (index < limit && left[index] === right[index]) index += 1;\n\treturn index;\n}\n\n/**\n * The fork point is the last assistant boundary STRICTLY BEFORE the divergence:\n * forking at the diverged turn itself would carry the stale assistant into the new\n * branch and leave nothing to re-send.\n */\nfunction boundaryBefore(entry: ContinuityEntrySnapshot, count: number): { index: number; uuid: string } | undefined {\n\tfor (let candidate = count - 1; candidate >= 1; candidate -= 1) {\n\t\tconst uuid = entry.assistantUuidByIndex.get(candidate);\n\t\tif (uuid) return { index: candidate, uuid };\n\t}\n\treturn undefined;\n}\n\nfunction forkOrFlatten(\n\tentry: ContinuityEntrySnapshot,\n\tdivergesAt: number,\n\treason: ContinuityReason,\n): ContinuityDecision {\n\tconst boundary = boundaryBefore(entry, divergesAt);\n\tif (!boundary) return { kind: \"flatten\", reason };\n\treturn {\n\t\tkind: \"fork\",\n\t\tsdkSessionId: entry.sdkSessionId,\n\t\tatUuid: boundary.uuid,\n\t\tfrom: boundary.index,\n\t\treason,\n\t};\n}\n\nfunction identityDrift(input: ContinuityDecisionInput, entry: ContinuityEntrySnapshot): ContinuityReason | null {\n\tif (entry.accountName !== input.accountName) return \"account_changed\";\n\tif (entry.modelId !== input.modelId) return \"model_changed\";\n\tif (entry.systemPromptHash !== input.fingerprint.systemPromptHash) return \"options_changed\";\n\tif (entry.toolsetHash !== input.fingerprint.toolsetHash) return \"options_changed\";\n\treturn null;\n}\n\nfunction decideFromBinding(input: ContinuityDecisionInput, binding: ContinuityBindingSnapshot): ContinuityDecision {\n\tif (!input.transcriptAvailable) return { kind: \"flatten\", reason: \"transcript_missing\" };\n\tconst shared = commonPrefixLength(binding.sentHashes, input.currentHashes);\n\tif (shared === binding.sentCount) {\n\t\treturn { kind: \"reattach\", sdkSessionId: binding.sdkSessionId, from: binding.sentCount, reason: \"registry_miss\" };\n\t}\n\tif (!binding.lastAssistantUuid) return { kind: \"flatten\", reason: \"registry_miss\" };\n\treturn {\n\t\tkind: \"fork\",\n\t\tsdkSessionId: binding.sdkSessionId,\n\t\tatUuid: binding.lastAssistantUuid,\n\t\tfrom: shared,\n\t\treason: shared < binding.sentCount ? \"history_rolled_back\" : \"sent_stream_diverged\",\n\t};\n}\n\nexport type FailoverLane = \"oauth-slots\" | \"ambient\" | \"config-dir\";\n\nexport type FailoverContinuityInput = {\n\tauthLane: FailoverLane;\n\tcrossAccountResumeSupported: boolean;\n\tentry: { sdkSessionId: string; sentCount: number; lastAssistantUuid: string | null };\n};\n\n/**\n * The config-dir lane keeps each account's credentials inside its own\n * CLAUDE_CONFIG_DIR, and no official SDK API moves a transcript across roots, so\n * its failover is the one declared residual that must still flatten.\n */\nexport function decideFailoverContinuity(input: FailoverContinuityInput): ContinuityDecision {\n\tconst { entry } = input;\n\tif (input.authLane === \"config-dir\") return { kind: \"flatten\", reason: \"cross_root_unsupported\" };\n\tif (input.crossAccountResumeSupported) {\n\t\treturn {\n\t\t\tkind: \"reattach\",\n\t\t\tsdkSessionId: entry.sdkSessionId,\n\t\t\tfrom: entry.sentCount,\n\t\t\treason: \"account_changed\",\n\t\t};\n\t}\n\tif (!entry.lastAssistantUuid) return { kind: \"flatten\", reason: \"branch_boundary_unavailable\" };\n\treturn {\n\t\tkind: \"fork\",\n\t\tsdkSessionId: entry.sdkSessionId,\n\t\tatUuid: entry.lastAssistantUuid,\n\t\tfrom: entry.sentCount,\n\t\treason: \"account_changed\",\n\t};\n}\n\n/**\n * Resume-first: a live session is never abandoned for a flattened re-send. Only a\n * missing transcript or an unrecoverable boundary reaches `flatten`; every other\n * divergence resolves to `fork` (same lineage, new branch) or `reattach` (same\n * session, new query).\n */\nexport function decideNativeContinuity(input: ContinuityDecisionInput): ContinuityDecision {\n\tconst { entry, binding } = input;\n\tif (!entry) {\n\t\tif (!binding) return { kind: \"bootstrap\" };\n\t\treturn decideFromBinding(input, binding);\n\t}\n\n\tconst divergence = entry.pendingForkReason ?? entry.taintedReason;\n\tif (divergence) {\n\t\treturn forkOrFlatten(entry, entry.sentCount, PENDING_FORK_REASONS[divergence] ?? \"other\");\n\t}\n\n\tconst shared = commonPrefixLength(entry.sentHashes, input.currentHashes);\n\tif (shared < entry.sentCount) {\n\t\tconst rolledBack = input.currentHashes.length < entry.sentCount && shared === input.currentHashes.length;\n\t\treturn rolledBack\n\t\t\t? forkOrFlatten(entry, input.currentHashes.length, \"history_rolled_back\")\n\t\t\t: forkOrFlatten(entry, shared + 1, \"sent_stream_diverged\");\n\t}\n\n\tif (input.idleExpired) {\n\t\treturn { kind: \"reattach\", sdkSessionId: entry.sdkSessionId, from: entry.sentCount, reason: \"idle_ttl\" };\n\t}\n\n\tconst drift = identityDrift(input, entry);\n\tif (drift) {\n\t\treturn { kind: \"reattach\", sdkSessionId: entry.sdkSessionId, from: entry.sentCount, reason: drift };\n\t}\n\n\treturn { kind: \"delta\", from: entry.sentCount };\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ClaudeSdkOauthSessionEntry, SessionBranchInfo } from "./session-registry.ts";
|
|
2
|
+
export type AnnotatableRegistry = {
|
|
3
|
+
get(senpiSessionId: string): ClaudeSdkOauthSessionEntry | undefined;
|
|
4
|
+
touch(entry: ClaudeSdkOauthSessionEntry): void;
|
|
5
|
+
};
|
|
6
|
+
export declare function switchEntryModel(registry: AnnotatableRegistry, senpiSessionId: string, modelId: string): Promise<boolean>;
|
|
7
|
+
export declare function annotatePendingFork(registry: AnnotatableRegistry, senpiSessionId: string, reason: string): void;
|
|
8
|
+
export declare function annotateTainted(registry: AnnotatableRegistry, senpiSessionId: string, reason: string): void;
|
|
9
|
+
export declare function annotateBranchInfo(registry: AnnotatableRegistry, senpiSessionId: string, info: SessionBranchInfo): void;
|
|
10
|
+
//# sourceMappingURL=session-entry-annotations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-entry-annotations.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/claude-sdk-oauth/session-entry-annotations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG3F,MAAM,MAAM,mBAAmB,GAAG;IACjC,GAAG,CAAC,cAAc,EAAE,MAAM,GAAG,0BAA0B,GAAG,SAAS,CAAC;IACpE,KAAK,CAAC,KAAK,EAAE,0BAA0B,GAAG,IAAI,CAAC;CAC/C,CAAC;AAEF,wBAAsB,gBAAgB,CACrC,QAAQ,EAAE,mBAAmB,EAC7B,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,GACb,OAAO,CAAC,OAAO,CAAC,CAOlB;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAK/G;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAM3G;AAED,wBAAgB,kBAAkB,CACjC,QAAQ,EAAE,mBAAmB,EAC7B,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,iBAAiB,GACrB,IAAI,CAKN"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { transitionToTainted } from "./session-registry-state.js";
|
|
2
|
+
export async function switchEntryModel(registry, senpiSessionId, modelId) {
|
|
3
|
+
const entry = registry.get(senpiSessionId);
|
|
4
|
+
if (!entry?.query.setModel)
|
|
5
|
+
return false;
|
|
6
|
+
await entry.query.setModel(modelId);
|
|
7
|
+
entry.modelId = modelId;
|
|
8
|
+
registry.touch(entry);
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
export function annotatePendingFork(registry, senpiSessionId, reason) {
|
|
12
|
+
const entry = registry.get(senpiSessionId);
|
|
13
|
+
if (!entry)
|
|
14
|
+
return;
|
|
15
|
+
entry.pendingForkReason = reason;
|
|
16
|
+
registry.touch(entry);
|
|
17
|
+
}
|
|
18
|
+
export function annotateTainted(registry, senpiSessionId, reason) {
|
|
19
|
+
const entry = registry.get(senpiSessionId);
|
|
20
|
+
if (!entry)
|
|
21
|
+
return;
|
|
22
|
+
entry.taintedReason = reason;
|
|
23
|
+
if (entry.state !== "TAINTED")
|
|
24
|
+
transitionToTainted(entry);
|
|
25
|
+
registry.touch(entry);
|
|
26
|
+
}
|
|
27
|
+
export function annotateBranchInfo(registry, senpiSessionId, info) {
|
|
28
|
+
const entry = registry.get(senpiSessionId);
|
|
29
|
+
if (!entry)
|
|
30
|
+
return;
|
|
31
|
+
entry.branchInfo = { ...info };
|
|
32
|
+
registry.touch(entry);
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=session-entry-annotations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-entry-annotations.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/claude-sdk-oauth/session-entry-annotations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAOlE,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACrC,QAA6B,EAC7B,cAAsB,EACtB,OAAe;IAEf,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC3C,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,QAAQ;QAAE,OAAO,KAAK,CAAC;IACzC,MAAM,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACpC,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACtB,OAAO,IAAI,CAAC;AACb,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,QAA6B,EAAE,cAAsB,EAAE,MAAc;IACxG,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC3C,IAAI,CAAC,KAAK;QAAE,OAAO;IACnB,KAAK,CAAC,iBAAiB,GAAG,MAAM,CAAC;IACjC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,QAA6B,EAAE,cAAsB,EAAE,MAAc;IACpG,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC3C,IAAI,CAAC,KAAK;QAAE,OAAO;IACnB,KAAK,CAAC,aAAa,GAAG,MAAM,CAAC;IAC7B,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;QAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC1D,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,kBAAkB,CACjC,QAA6B,EAC7B,cAAsB,EACtB,IAAuB;IAEvB,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC3C,IAAI,CAAC,KAAK;QAAE,OAAO;IACnB,KAAK,CAAC,UAAU,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC;IAC/B,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC","sourcesContent":["import type { ClaudeSdkOauthSessionEntry, SessionBranchInfo } from \"./session-registry.ts\";\nimport { transitionToTainted } from \"./session-registry-state.ts\";\n\nexport type AnnotatableRegistry = {\n\tget(senpiSessionId: string): ClaudeSdkOauthSessionEntry | undefined;\n\ttouch(entry: ClaudeSdkOauthSessionEntry): void;\n};\n\nexport async function switchEntryModel(\n\tregistry: AnnotatableRegistry,\n\tsenpiSessionId: string,\n\tmodelId: string,\n): Promise<boolean> {\n\tconst entry = registry.get(senpiSessionId);\n\tif (!entry?.query.setModel) return false;\n\tawait entry.query.setModel(modelId);\n\tentry.modelId = modelId;\n\tregistry.touch(entry);\n\treturn true;\n}\n\nexport function annotatePendingFork(registry: AnnotatableRegistry, senpiSessionId: string, reason: string): void {\n\tconst entry = registry.get(senpiSessionId);\n\tif (!entry) return;\n\tentry.pendingForkReason = reason;\n\tregistry.touch(entry);\n}\n\nexport function annotateTainted(registry: AnnotatableRegistry, senpiSessionId: string, reason: string): void {\n\tconst entry = registry.get(senpiSessionId);\n\tif (!entry) return;\n\tentry.taintedReason = reason;\n\tif (entry.state !== \"TAINTED\") transitionToTainted(entry);\n\tregistry.touch(entry);\n}\n\nexport function annotateBranchInfo(\n\tregistry: AnnotatableRegistry,\n\tsenpiSessionId: string,\n\tinfo: SessionBranchInfo,\n): void {\n\tconst entry = registry.get(senpiSessionId);\n\tif (!entry) return;\n\tentry.branchInfo = { ...info };\n\tregistry.touch(entry);\n}\n"]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-turn continuity observability for the claude-sdk-oauth lane.
|
|
3
|
+
*
|
|
4
|
+
* Emission semantics: a decision is STAGED per attempt at its final outcome
|
|
5
|
+
* point and EMITTED only when the auth-lane retain/discard wrapper retains that
|
|
6
|
+
* attempt (auth-attempt.ts). A discarded attempt emits nothing, so every
|
|
7
|
+
* completed turn yields exactly one observation; a turn where every attempt
|
|
8
|
+
* fails yields one terminal error observation instead.
|
|
9
|
+
*/
|
|
10
|
+
export type ContinuityKind = "bootstrap" | "delta" | "reattach" | "fork" | "flatten" | "disabled";
|
|
11
|
+
/** Fixed vocabulary — arbitrary error text never reaches an observation. */
|
|
12
|
+
export type ContinuityReason = "prefix_matched" | "registry_miss" | "idle_ttl" | "capacity" | "model_selected" | "thinking_level_selected" | "bound_account_token_expiring" | "account_changed" | "model_changed" | "toolset_changed" | "system_prompt_changed" | "assistant_stream_diverged" | "sent_stream_diverged" | "options_changed" | "history_rolled_back" | "assistant_rewritten" | "transcript_missing" | "cross_root_unsupported" | "branch_diverged" | "branch_boundary_unavailable" | "branch_resume" | "tainted_compaction" | "tainted_fork" | "tainted_abort" | "tainted_assistant_provenance_unverified" | "resume_initialization_failed" | "resume_initialization_aborted" | "resume_mode_off" | "query_failed" | "turn_attribution_failed" | "abort_timeout" | "extensions_removed" | "session_shutdown" | "other";
|
|
13
|
+
export type ContinuityObservation = {
|
|
14
|
+
kind: ContinuityKind;
|
|
15
|
+
reason: ContinuityReason;
|
|
16
|
+
deltaMessages?: number;
|
|
17
|
+
};
|
|
18
|
+
export type ContinuityObservabilityBoundary = {
|
|
19
|
+
emit: (observation: ContinuityObservation) => void;
|
|
20
|
+
log: (event: string, data: Record<string, unknown>) => void;
|
|
21
|
+
};
|
|
22
|
+
export declare function overrideContinuityObservabilityBoundary(override: Partial<ContinuityObservabilityBoundary>): void;
|
|
23
|
+
export declare function resetContinuityObservabilityBoundary(): void;
|
|
24
|
+
/** Maps a fixed vocabulary member through, and anything else to a bucketed cause. */
|
|
25
|
+
export declare function sanitizeReason(value: unknown): ContinuityReason;
|
|
26
|
+
/** Buckets arbitrary close/pump failures into the fixed close-cause vocabulary. */
|
|
27
|
+
export declare function sanitizeCloseCause(value: unknown): ContinuityReason;
|
|
28
|
+
/**
|
|
29
|
+
* Classifies the failure that ended a turn after every auth attempt failed.
|
|
30
|
+
* Anything reaching here came out of the SDK query path, so an Error is a query
|
|
31
|
+
* failure unless it matches a more specific bucket; the raw text never escapes.
|
|
32
|
+
*/
|
|
33
|
+
export declare function sanitizeTerminalFailure(value: unknown): ContinuityReason;
|
|
34
|
+
export declare function recordPendingCloseCause(senpiSessionId: string, reason: unknown): void;
|
|
35
|
+
/** Read the pending close cause WITHOUT consuming it (consumed at emit time). */
|
|
36
|
+
export declare function peekPendingCloseCause(senpiSessionId: string): ContinuityReason | undefined;
|
|
37
|
+
export declare function consumePendingCloseCause(senpiSessionId: string): ContinuityReason | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Maps the continuity decision families onto the observation vocabulary:
|
|
40
|
+
* incremental→delta, resume→fork, cold-seed→flatten.
|
|
41
|
+
*/
|
|
42
|
+
export declare function observeSessionSyncDecision(input: {
|
|
43
|
+
kind: "incremental" | "resume" | "cold-seed";
|
|
44
|
+
reason?: string;
|
|
45
|
+
deltaMessages: number;
|
|
46
|
+
firstTurn: boolean;
|
|
47
|
+
senpiSessionId: string;
|
|
48
|
+
}): ContinuityObservation;
|
|
49
|
+
export type StagedContinuityDecision = {
|
|
50
|
+
observation: ContinuityObservation;
|
|
51
|
+
emit: () => void;
|
|
52
|
+
};
|
|
53
|
+
/** Stages an attempt's decision; `emit` fires only when the attempt is retained. */
|
|
54
|
+
export declare function stageContinuityDecision(observation: ContinuityObservation, onDecision?: (observation: ContinuityObservation) => void, beforeEmit?: () => void): StagedContinuityDecision;
|
|
55
|
+
export declare function emitContinuityObservation(observation: ContinuityObservation, onDecision?: (observation: ContinuityObservation) => void): void;
|
|
56
|
+
//# sourceMappingURL=session-observability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-observability.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/claude-sdk-oauth/session-observability.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;AAElG,4EAA4E;AAC5E,MAAM,MAAM,gBAAgB,GACzB,gBAAgB,GAChB,eAAe,GACf,UAAU,GACV,UAAU,GACV,gBAAgB,GAChB,yBAAyB,GACzB,8BAA8B,GAC9B,iBAAiB,GACjB,eAAe,GACf,iBAAiB,GACjB,uBAAuB,GACvB,2BAA2B,GAC3B,sBAAsB,GACtB,iBAAiB,GACjB,qBAAqB,GACrB,qBAAqB,GACrB,oBAAoB,GACpB,wBAAwB,GACxB,iBAAiB,GACjB,6BAA6B,GAC7B,eAAe,GACf,oBAAoB,GACpB,cAAc,GACd,eAAe,GACf,yCAAyC,GACzC,8BAA8B,GAC9B,+BAA+B,GAC/B,iBAAiB,GACjB,cAAc,GACd,yBAAyB,GACzB,eAAe,GACf,oBAAoB,GACpB,kBAAkB,GAClB,OAAO,CAAC;AAEX,MAAM,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,cAAc,CAAC;IACrB,MAAM,EAAE,gBAAgB,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG;IAC7C,IAAI,EAAE,CAAC,WAAW,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACnD,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CAC5D,CAAC;AAoDF,wBAAgB,uCAAuC,CAAC,QAAQ,EAAE,OAAO,CAAC,+BAA+B,CAAC,GAAG,IAAI,CAEhH;AAED,wBAAgB,oCAAoC,IAAI,IAAI,CAE3D;AAED,qFAAqF;AACrF,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAS/D;AAED,mFAAmF;AACnF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CASnE;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAIxE;AAaD,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAUrF;AAED,iFAAiF;AACjF,wBAAgB,qBAAqB,CAAC,cAAc,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAE1F;AAED,wBAAgB,wBAAwB,CAAC,cAAc,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAI7F;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE;IACjD,IAAI,EAAE,aAAa,GAAG,QAAQ,GAAG,WAAW,CAAC;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;CACvB,GAAG,qBAAqB,CAuBxB;AAED,MAAM,MAAM,wBAAwB,GAAG;IACtC,WAAW,EAAE,qBAAqB,CAAC;IACnC,IAAI,EAAE,MAAM,IAAI,CAAC;CACjB,CAAC;AAEF,oFAAoF;AACpF,wBAAgB,uBAAuB,CACtC,WAAW,EAAE,qBAAqB,EAClC,UAAU,CAAC,EAAE,CAAC,WAAW,EAAE,qBAAqB,KAAK,IAAI,EACzD,UAAU,CAAC,EAAE,MAAM,IAAI,GACrB,wBAAwB,CAW1B;AAED,wBAAgB,yBAAyB,CACxC,WAAW,EAAE,qBAAqB,EAClC,UAAU,CAAC,EAAE,CAAC,WAAW,EAAE,qBAAqB,KAAK,IAAI,GACvD,IAAI,CAQN"}
|