@code-yeongyu/senpi 2026.9.3 → 2026.9.4-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 +164 -0
- package/README.md +5 -4
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +2 -1
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/core/agent-session-runtime.js +2 -2
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +2 -5
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +56 -30
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +31 -41
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +16 -7
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/credential-pool/state-store.d.ts +1 -0
- package/dist/core/credential-pool/state-store.d.ts.map +1 -1
- package/dist/core/credential-pool/state-store.js +22 -2
- package/dist/core/credential-pool/state-store.js.map +1 -1
- package/dist/core/dynamic-prompt/style.js +1 -1
- package/dist/core/dynamic-prompt/style.js.map +1 -1
- package/dist/core/dynamic-prompt/working-task.js +1 -1
- package/dist/core/dynamic-prompt/working-task.js.map +1 -1
- package/dist/core/extensions/builtin/bash-timeout/index.d.ts +1 -1
- package/dist/core/extensions/builtin/bash-timeout/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/bash-timeout/index.js +3 -1
- package/dist/core/extensions/builtin/bash-timeout/index.js.map +1 -1
- package/dist/core/extensions/builtin/bash-timeout/timeout.d.ts +9 -7
- package/dist/core/extensions/builtin/bash-timeout/timeout.d.ts.map +1 -1
- package/dist/core/extensions/builtin/bash-timeout/timeout.js +4 -9
- package/dist/core/extensions/builtin/bash-timeout/timeout.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/auth-lane.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/auth-lane.js +15 -18
- package/dist/core/extensions/builtin/claude-sdk-oauth/auth-lane.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/content-blocks.d.ts +3 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/content-blocks.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/content-blocks.js +80 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/content-blocks.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/errors.d.ts +18 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/errors.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/errors.js +57 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/errors.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/guidance.d.ts +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/guidance.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/guidance.js +13 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/guidance.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/oauth-login.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/oauth-login.js +6 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/oauth-login.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/prompt-bridge.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/prompt-bridge.js +2 -23
- package/dist/core/extensions/builtin/claude-sdk-oauth/prompt-bridge.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.d.ts +2 -2
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.js +30 -24
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.d.ts +2 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.js +15 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.d.ts +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.js +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.d.ts +6 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.js +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.js.map +1 -1
- 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 +19 -3
- 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 +31 -13
- 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 +1 -0
- 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 +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.js.map +1 -1
- 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 +8 -14
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-attempt.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-attempt.js +23 -6
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-attempt.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream-guidance.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream-guidance.js +4 -2
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream-guidance.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream-protocol.d.ts +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream-protocol.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream.js +13 -6
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/tools.d.ts +11 -3
- package/dist/core/extensions/builtin/claude-sdk-oauth/tools.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/tools.js +12 -3
- package/dist/core/extensions/builtin/claude-sdk-oauth/tools.js.map +1 -1
- package/dist/core/extensions/builtin/eval-only-routing.d.ts +10 -0
- package/dist/core/extensions/builtin/eval-only-routing.d.ts.map +1 -0
- package/dist/core/extensions/builtin/eval-only-routing.js +16 -0
- package/dist/core/extensions/builtin/eval-only-routing.js.map +1 -0
- package/dist/core/extensions/builtin/goal/prompt.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/prompt.js +1 -3
- package/dist/core/extensions/builtin/goal/prompt.js.map +1 -1
- package/dist/core/extensions/builtin/goal/store.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/store.js +8 -20
- package/dist/core/extensions/builtin/goal/store.js.map +1 -1
- package/dist/core/extensions/builtin/goal/tool-registration.js +1 -1
- package/dist/core/extensions/builtin/goal/tool-registration.js.map +1 -1
- package/dist/core/extensions/builtin/gpt-account.d.ts +3 -0
- package/dist/core/extensions/builtin/gpt-account.d.ts.map +1 -0
- package/dist/core/extensions/builtin/gpt-account.js +115 -0
- package/dist/core/extensions/builtin/gpt-account.js.map +1 -0
- package/dist/core/extensions/builtin/hooks/trust-storage.d.ts.map +1 -1
- package/dist/core/extensions/builtin/hooks/trust-storage.js +3 -1
- package/dist/core/extensions/builtin/hooks/trust-storage.js.map +1 -1
- package/dist/core/extensions/builtin/imagegen/auth.d.ts.map +1 -1
- package/dist/core/extensions/builtin/imagegen/auth.js +10 -2
- package/dist/core/extensions/builtin/imagegen/auth.js.map +1 -1
- package/dist/core/extensions/builtin/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/index.js +2 -0
- package/dist/core/extensions/builtin/index.js.map +1 -1
- package/dist/core/extensions/builtin/loop/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop/index.js +20 -1
- package/dist/core/extensions/builtin/loop/index.js.map +1 -1
- package/dist/core/extensions/builtin/loop/store.d.ts +8 -6
- package/dist/core/extensions/builtin/loop/store.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop/store.js +54 -88
- package/dist/core/extensions/builtin/loop/store.js.map +1 -1
- package/dist/core/extensions/builtin/loop/tools.d.ts +6 -1
- package/dist/core/extensions/builtin/loop/tools.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop/tools.js +8 -1
- package/dist/core/extensions/builtin/loop/tools.js.map +1 -1
- package/dist/core/extensions/builtin/monitor-state-event.d.ts +2 -0
- package/dist/core/extensions/builtin/monitor-state-event.d.ts.map +1 -1
- package/dist/core/extensions/builtin/monitor-state-event.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.js +1 -3
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-5.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.js +1 -11
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-6.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.js +2 -2
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-7.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.js +3 -3
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.js +56 -43
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/execution-tooling.d.ts +4 -15
- package/dist/core/extensions/builtin/prompt-preset/execution-tooling.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/execution-tooling.js +12 -21
- package/dist/core/extensions/builtin/prompt-preset/execution-tooling.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/glm-5-2.d.ts +1 -1
- package/dist/core/extensions/builtin/prompt-preset/glm-5-2.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/glm-5-2.js +2 -11
- package/dist/core/extensions/builtin/prompt-preset/glm-5-2.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/glm-5-3.d.ts +1 -1
- package/dist/core/extensions/builtin/prompt-preset/glm-5-3.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/glm-5-3.js +2 -11
- package/dist/core/extensions/builtin/prompt-preset/glm-5-3.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/glm-5.d.ts +4 -0
- package/dist/core/extensions/builtin/prompt-preset/glm-5.d.ts.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/glm-5.js +16 -0
- package/dist/core/extensions/builtin/prompt-preset/glm-5.js.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts +1 -5
- 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 +1 -6
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.d.ts +123 -0
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.d.ts.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js +202 -0
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/gpt-eval-routing.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-eval-routing.js +1 -2
- package/dist/core/extensions/builtin/prompt-preset/gpt-eval-routing.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 +60 -76
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/presets.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/presets.js +17 -0
- package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.d.ts +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.js +1 -0
- package/dist/core/extensions/builtin/prompt-preset/settings.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/extension.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/extension.js +186 -5
- package/dist/core/extensions/builtin/terminal/extension.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/manager.d.ts +10 -0
- package/dist/core/extensions/builtin/terminal/manager.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/manager.js +21 -0
- package/dist/core/extensions/builtin/terminal/manager.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/manifest-lease.d.ts +24 -0
- package/dist/core/extensions/builtin/terminal/manifest-lease.d.ts.map +1 -0
- package/dist/core/extensions/builtin/terminal/manifest-lease.js +105 -0
- package/dist/core/extensions/builtin/terminal/manifest-lease.js.map +1 -0
- package/dist/core/extensions/builtin/terminal/monitor-registry.d.ts +13 -2
- package/dist/core/extensions/builtin/terminal/monitor-registry.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-registry.js +24 -2
- package/dist/core/extensions/builtin/terminal/monitor-registry.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/prompt.d.ts +13 -2
- package/dist/core/extensions/builtin/terminal/prompt.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/prompt.js +18 -7
- package/dist/core/extensions/builtin/terminal/prompt.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/restore.d.ts +43 -0
- package/dist/core/extensions/builtin/terminal/restore.d.ts.map +1 -0
- package/dist/core/extensions/builtin/terminal/restore.js +149 -0
- package/dist/core/extensions/builtin/terminal/restore.js.map +1 -0
- package/dist/core/extensions/builtin/terminal/terminal-manifest.d.ts +110 -0
- package/dist/core/extensions/builtin/terminal/terminal-manifest.d.ts.map +1 -0
- package/dist/core/extensions/builtin/terminal/terminal-manifest.js +158 -0
- package/dist/core/extensions/builtin/terminal/terminal-manifest.js.map +1 -0
- package/dist/core/extensions/builtin/terminal/tools/bash-input.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash-input.js +3 -2
- package/dist/core/extensions/builtin/terminal/tools/bash-input.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash-output.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash-output.js +5 -4
- package/dist/core/extensions/builtin/terminal/tools/bash-output.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash-resize.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash-resize.js +3 -2
- package/dist/core/extensions/builtin/terminal/tools/bash-resize.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/context.d.ts +8 -0
- package/dist/core/extensions/builtin/terminal/tools/context.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/context.js +10 -0
- package/dist/core/extensions/builtin/terminal/tools/context.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/kill-bash.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/kill-bash.js +5 -4
- package/dist/core/extensions/builtin/terminal/tools/kill-bash.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/monitor.d.ts +4 -1
- package/dist/core/extensions/builtin/terminal/tools/monitor.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/monitor.js +58 -14
- package/dist/core/extensions/builtin/terminal/tools/monitor.js.map +1 -1
- package/dist/core/extensions/builtin/todotools/prompt.d.ts +2 -2
- package/dist/core/extensions/builtin/todotools/prompt.d.ts.map +1 -1
- package/dist/core/extensions/builtin/todotools/prompt.js +3 -6
- package/dist/core/extensions/builtin/todotools/prompt.js.map +1 -1
- package/dist/core/extensions/builtin/tool-search/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/tool-search/index.js +1 -1
- package/dist/core/extensions/builtin/tool-search/index.js.map +1 -1
- package/dist/core/extensions/builtin/tool-search/native-search.d.ts +10 -5
- package/dist/core/extensions/builtin/tool-search/native-search.d.ts.map +1 -1
- package/dist/core/extensions/builtin/tool-search/native-search.js +12 -7
- package/dist/core/extensions/builtin/tool-search/native-search.js.map +1 -1
- package/dist/core/extensions/builtin/tool-search/native-support.d.ts +13 -0
- package/dist/core/extensions/builtin/tool-search/native-support.d.ts.map +1 -0
- package/dist/core/extensions/builtin/tool-search/native-support.js +45 -0
- package/dist/core/extensions/builtin/tool-search/native-support.js.map +1 -0
- package/dist/core/extensions/builtin/ttsr/detectors/collapse-paragraphs.d.ts +34 -0
- package/dist/core/extensions/builtin/ttsr/detectors/collapse-paragraphs.d.ts.map +1 -0
- package/dist/core/extensions/builtin/ttsr/detectors/collapse-paragraphs.js +121 -0
- package/dist/core/extensions/builtin/ttsr/detectors/collapse-paragraphs.js.map +1 -0
- package/dist/core/extensions/builtin/ttsr/detectors/collapse.d.ts +2 -0
- package/dist/core/extensions/builtin/ttsr/detectors/collapse.d.ts.map +1 -1
- package/dist/core/extensions/builtin/ttsr/detectors/collapse.js +6 -2
- package/dist/core/extensions/builtin/ttsr/detectors/collapse.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/runner.d.ts +5 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +44 -1
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +26 -3
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/http-dispatcher.js +2 -0
- package/dist/core/http-dispatcher.js.map +1 -1
- package/dist/core/lockfile-policy.d.ts +11 -0
- package/dist/core/lockfile-policy.d.ts.map +1 -1
- package/dist/core/lockfile-policy.js +19 -0
- package/dist/core/lockfile-policy.js.map +1 -1
- package/dist/core/manual-continue.d.ts +13 -0
- package/dist/core/manual-continue.d.ts.map +1 -0
- package/dist/core/manual-continue.js +19 -0
- package/dist/core/manual-continue.js.map +1 -0
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js +8 -2
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +3 -0
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +13 -2
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +28 -4
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-sidecar-store.d.ts +62 -0
- package/dist/core/session-sidecar-store.d.ts.map +1 -0
- package/dist/core/session-sidecar-store.js +149 -0
- package/dist/core/session-sidecar-store.js.map +1 -0
- package/dist/core/settings-manager.d.ts +5 -5
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +45 -21
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +19 -2
- package/dist/core/skills.js.map +1 -1
- package/dist/core/terminal-settings.d.ts +3 -0
- package/dist/core/terminal-settings.d.ts.map +1 -1
- package/dist/core/terminal-settings.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +1 -1
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +2 -2
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +2 -2
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +2 -2
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +2 -2
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +1 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +3 -3
- package/dist/core/tools/write.js.map +1 -1
- package/dist/index.d.ts +1 -1
- 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 +2 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/app-server/daemon/process.d.ts +33 -3
- package/dist/modes/app-server/daemon/process.d.ts.map +1 -1
- package/dist/modes/app-server/daemon/process.js +57 -6
- package/dist/modes/app-server/daemon/process.js.map +1 -1
- package/dist/modes/app-server/daemon.js +9 -1
- package/dist/modes/app-server/daemon.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +5 -11
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +2 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +21 -8
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +2 -2
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/trust-selector.js +2 -2
- package/dist/modes/interactive/components/trust-selector.js.map +1 -1
- package/dist/modes/interactive/grok/welcome-card.d.ts.map +1 -1
- package/dist/modes/interactive/grok/welcome-card.js +5 -2
- package/dist/modes/interactive/grok/welcome-card.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +3 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +74 -14
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/version-label.d.ts +7 -0
- package/dist/modes/interactive/version-label.d.ts.map +1 -0
- package/dist/modes/interactive/version-label.js +9 -0
- package/dist/modes/interactive/version-label.js.map +1 -0
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +9 -0
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/connection-handler.d.ts +2 -0
- package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
- package/dist/modes/rpc/connection-handler.js +71 -12
- package/dist/modes/rpc/connection-handler.js.map +1 -1
- package/dist/modes/rpc/custom-capability.d.ts +5 -0
- package/dist/modes/rpc/custom-capability.d.ts.map +1 -1
- package/dist/modes/rpc/custom-capability.js +5 -0
- package/dist/modes/rpc/custom-capability.js.map +1 -1
- package/dist/modes/rpc/host-ensure.d.ts +2 -0
- package/dist/modes/rpc/host-ensure.d.ts.map +1 -1
- package/dist/modes/rpc/host-ensure.js +77 -18
- package/dist/modes/rpc/host-ensure.js.map +1 -1
- package/dist/modes/rpc/login-prompts.d.ts +24 -0
- package/dist/modes/rpc/login-prompts.d.ts.map +1 -0
- package/dist/modes/rpc/login-prompts.js +44 -0
- package/dist/modes/rpc/login-prompts.js.map +1 -0
- package/dist/modes/rpc/media-placeholders.d.ts +49 -0
- package/dist/modes/rpc/media-placeholders.d.ts.map +1 -0
- package/dist/modes/rpc/media-placeholders.js +151 -0
- package/dist/modes/rpc/media-placeholders.js.map +1 -0
- package/dist/modes/rpc/multi-session-host.js +3 -0
- package/dist/modes/rpc/multi-session-host.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +8 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +11 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +23 -1
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js +1 -0
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/modes/rpc/session-command-router.d.ts.map +1 -1
- package/dist/modes/rpc/session-command-router.js +2 -1
- package/dist/modes/rpc/session-command-router.js.map +1 -1
- package/dist/modes/rpc/session-event-fanout.d.ts +13 -2
- package/dist/modes/rpc/session-event-fanout.d.ts.map +1 -1
- package/dist/modes/rpc/session-event-fanout.js +36 -12
- package/dist/modes/rpc/session-event-fanout.js.map +1 -1
- package/dist/modes/rpc/session-event-writer.d.ts +3 -1
- package/dist/modes/rpc/session-event-writer.d.ts.map +1 -1
- package/dist/modes/rpc/session-event-writer.js +23 -13
- package/dist/modes/rpc/session-event-writer.js.map +1 -1
- package/dist/modes/rpc/socket-event-fanout.d.ts +8 -1
- package/dist/modes/rpc/socket-event-fanout.d.ts.map +1 -1
- package/dist/modes/rpc/socket-event-fanout.js +32 -9
- package/dist/modes/rpc/socket-event-fanout.js.map +1 -1
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +3 -4
- package/dist/utils/version-check.js.map +1 -1
- package/docs/compaction.md +2 -0
- package/docs/environment-variables.md +5 -0
- package/docs/extensions.md +22 -2
- package/docs/keybindings.md +1 -1
- package/docs/models.md +3 -0
- package/docs/quickstart.md +1 -1
- package/docs/rpc.md +105 -1
- package/docs/settings.md +17 -32
- package/docs/terminal-setup.md +27 -0
- package/docs/usage.md +5 -3
- package/docs/windows.md +1 -1
- package/node_modules/@anthropic-ai/claude-agent-sdk/bridge.d.ts +18 -1
- package/node_modules/@anthropic-ai/claude-agent-sdk/bridge.mjs +155 -106
- package/node_modules/@anthropic-ai/claude-agent-sdk/browser-sdk.js +144 -83
- package/node_modules/@anthropic-ai/claude-agent-sdk/manifest.json +21 -32
- package/node_modules/@anthropic-ai/claude-agent-sdk/manifest.zst.json +25 -36
- package/node_modules/@anthropic-ai/claude-agent-sdk/package.json +2 -2
- package/node_modules/@anthropic-ai/claude-agent-sdk/sdk-tools.d.ts +93 -31
- package/node_modules/@anthropic-ai/claude-agent-sdk/sdk.d.ts +473 -31
- package/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs +140 -93
- package/node_modules/@anthropic-ai/sdk/CHANGELOG.md +96 -0
- package/node_modules/@anthropic-ai/sdk/README.md +1 -1
- package/node_modules/@anthropic-ai/sdk/core/credentials.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/credentials.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/credentials.js +5 -7
- package/node_modules/@anthropic-ai/sdk/core/credentials.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/credentials.mjs +5 -7
- package/node_modules/@anthropic-ai/sdk/core/credentials.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/middleware.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/middleware.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/middleware.js +4 -4
- package/node_modules/@anthropic-ai/sdk/core/middleware.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/middleware.mjs +4 -4
- package/node_modules/@anthropic-ai/sdk/core/middleware.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/standard-schema.d.mts +45 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/standard-schema.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/standard-schema.d.ts +45 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/standard-schema.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/standard-schema.js +58 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/standard-schema.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/standard-schema.mjs +54 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/standard-schema.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.js +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/errors.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/errors.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/errors.js +3 -1
- package/node_modules/@anthropic-ai/sdk/internal/errors.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/errors.mjs +3 -1
- package/node_modules/@anthropic-ai/sdk/internal/errors.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/file-store.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/file-store.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/file-store.js +23 -25
- package/node_modules/@anthropic-ai/sdk/internal/file-store.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/file-store.mjs +5 -6
- package/node_modules/@anthropic-ai/sdk/internal/file-store.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/node.browser.d.mts +9 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.browser.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.browser.d.ts +9 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.browser.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.browser.js +22 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.browser.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.browser.mjs +19 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.browser.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.d.mts +14 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.d.ts +14 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.js +24 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.mjs +14 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/parse.js +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/parse.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/parse.mjs +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/parse.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/uploads.js +10 -6
- package/node_modules/@anthropic-ai/sdk/internal/uploads.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/uploads.mjs +10 -6
- package/node_modules/@anthropic-ai/sdk/internal/uploads.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.d.mts +6 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.d.ts +6 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.js +7 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.mjs +6 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.js +6 -4
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs +4 -2
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.js +3 -4
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs +1 -2
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.js +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.mjs +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.js +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.mjs +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.js +2 -3
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.mjs +2 -3
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.js +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.mjs +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/middleware.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/middleware.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/middleware.js +30 -7
- package/node_modules/@anthropic-ai/sdk/lib/middleware.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/middleware.mjs +30 -7
- package/node_modules/@anthropic-ai/sdk/lib/middleware.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.d.mts +3 -2
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.d.ts +3 -2
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.js +3 -46
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.mjs +3 -46
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/standard-schema.d.mts +131 -0
- package/node_modules/@anthropic-ai/sdk/lib/standard-schema.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/standard-schema.d.ts +131 -0
- package/node_modules/@anthropic-ai/sdk/lib/standard-schema.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/standard-schema.js +45 -0
- package/node_modules/@anthropic-ai/sdk/lib/standard-schema.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/standard-schema.mjs +41 -0
- package/node_modules/@anthropic-ai/sdk/lib/standard-schema.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.js +35 -6
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.mjs +35 -6
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/package.json +4 -11
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.d.mts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.d.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.mts +13 -9
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.ts +13 -9
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.js +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.d.mts +6 -6
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.d.ts +6 -6
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.d.mts +3 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.d.ts +3 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.d.mts +28 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.d.ts +28 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.d.mts +8 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.d.ts +8 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.mts +25 -5
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.ts +25 -5
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.js +6 -6
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.mjs +7 -7
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.mts +5 -4
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.ts +5 -4
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.js +11 -9
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.d.mts +12 -9
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.d.ts +12 -9
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.d.mts +8 -5
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.d.ts +8 -5
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.mts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.mts +198 -29
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.ts +198 -29
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.d.mts +177 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.d.ts +177 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.js +56 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.mjs +52 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.d.mts +74 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.d.ts +74 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.js +52 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.mjs +48 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.d.mts +272 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.d.ts +272 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.js +119 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.mjs +115 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.d.mts +14 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.d.ts +14 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.js +21 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.mjs +16 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/index.d.mts +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/index.d.ts +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/index.js +11 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/index.mjs +5 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.d.mts +353 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.d.ts +353 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.js +169 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.mjs +165 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/index.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/index.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/index.js +9 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/index.mjs +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.d.mts +468 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.d.ts +468 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.js +198 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.mjs +193 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.d.mts +124 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.d.ts +124 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.js +114 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.mjs +110 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules.js +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation.js +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/index.d.mts +11 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/index.d.ts +11 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/index.js +25 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/index.mjs +12 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.d.mts +162 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.d.ts +162 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.js +76 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.mjs +72 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.d.mts +73 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.d.ts +73 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.js +62 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.mjs +57 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.d.mts +77 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.d.ts +77 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.js +31 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.mjs +27 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/index.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/index.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/index.js +9 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/index.mjs +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.d.mts +258 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.d.ts +258 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.js +174 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.mjs +169 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.d.mts +141 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.d.ts +141 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.js +125 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.mjs +121 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts.js +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.d.mts +124 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.d.ts +124 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.js +67 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.mjs +63 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/index.d.mts +5 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/index.d.ts +5 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/index.js +13 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/index.mjs +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.d.mts +135 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.d.ts +135 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.js +102 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.mjs +98 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.d.mts +83 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.d.ts +83 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.js +34 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.mjs +30 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.d.mts +210 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.d.ts +210 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.js +189 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.mjs +185 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.d.mts +303 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.d.ts +303 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.js +112 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.mjs +107 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces.js +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization.js +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.d.mts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.d.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.d.mts +10 -10
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.d.ts +10 -10
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.d.mts +2 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.d.ts +2 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.d.mts +2 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.d.ts +2 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.d.mts +48 -120
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.d.ts +48 -120
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.js +12 -8
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.mjs +12 -8
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.d.mts +35 -138
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.d.ts +35 -138
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.js +18 -18
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.mjs +18 -18
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.d.mts +21 -25
- package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.d.ts +21 -25
- package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.d.mts +16 -17
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.d.ts +16 -17
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.js +21 -8
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.mjs +21 -8
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.mts +1 -3
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.ts +1 -3
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/src/core/credentials.ts +5 -7
- package/node_modules/@anthropic-ai/sdk/src/core/middleware.ts +4 -3
- package/node_modules/@anthropic-ai/sdk/src/helpers/beta/standard-schema.ts +99 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/detect-platform.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/src/internal/errors.ts +3 -1
- package/node_modules/@anthropic-ai/sdk/src/internal/file-store.ts +11 -10
- package/node_modules/@anthropic-ai/sdk/src/internal/node.browser.ts +22 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/node.ts +14 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/parse.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/src/internal/uploads.ts +10 -7
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/values.ts +7 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/BetaMessageStream.ts +5 -3
- package/node_modules/@anthropic-ai/sdk/src/lib/MessageStream.ts +1 -3
- package/node_modules/@anthropic-ai/sdk/src/lib/credentials/credential-chain.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/src/lib/credentials/identity-token.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/src/lib/credentials/types.ts +2 -3
- package/node_modules/@anthropic-ai/sdk/src/lib/credentials/user-oauth.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/src/lib/middleware.ts +33 -9
- package/node_modules/@anthropic-ai/sdk/src/lib/sessions/accumulate.ts +7 -49
- package/node_modules/@anthropic-ai/sdk/src/lib/standard-schema.ts +209 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/tools/BetaToolRunner.ts +38 -6
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/agents/agents.ts +1 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/beta.ts +45 -15
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/deployment-runs.ts +6 -6
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/deployments.ts +3 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/dreams.ts +42 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/environments/environments.ts +8 -1
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/files.ts +34 -11
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/index.ts +13 -7
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/memory-stores/memories.ts +12 -9
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/memory-stores/memory-versions.ts +8 -5
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/index.ts +5 -1
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/messages.ts +221 -38
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/api-keys.ts +231 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/compliance-settings.ts +96 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/external-keys.ts +365 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/federation.ts +71 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/index.ts +31 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/issuers.ts +486 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/rules/index.ts +23 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/rules/rules.ts +624 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/rules/workspaces.ts +196 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/rules.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/index.ts +92 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/invites.ts +207 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/organization.ts +269 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/rate-limits.ts +104 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/service-accounts/index.ts +21 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/service-accounts/service-accounts.ts +389 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/service-accounts/workspaces.ts +217 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/service-accounts.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/users.ts +163 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces/index.ts +43 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces/members.ts +209 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces/rate-limits.ts +113 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces/service-accounts.ts +325 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces/workspaces.ts +450 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/events.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/sessions.ts +10 -10
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/threads/threads.ts +2 -1
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/skills/index.ts +7 -10
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/skills/skills.ts +60 -150
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/skills/versions.ts +43 -166
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/user-profiles.ts +24 -27
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/webhooks.ts +25 -29
- package/node_modules/@anthropic-ai/sdk/src/resources/messages/messages.ts +2 -8
- package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/fs-util.ts +6 -5
- package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/memories.ts +5 -3
- package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/node.browser.ts +1 -5
- package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/node.ts +122 -17
- package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/skills.ts +10 -43
- package/node_modules/@anthropic-ai/sdk/src/version.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.js +13 -15
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.mjs +3 -4
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.js +6 -4
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.mjs +5 -3
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.d.mts +1 -2
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.d.ts +1 -2
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.js +0 -4
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.mjs +0 -3
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.d.mts +11 -9
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.d.ts +11 -9
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.js +96 -8
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.mjs +96 -7
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.d.mts +0 -8
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.d.ts +0 -8
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.js +20 -46
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.mjs +9 -33
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/version.d.mts +1 -1
- package/node_modules/@anthropic-ai/sdk/version.d.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/version.js +1 -1
- package/node_modules/@anthropic-ai/sdk/version.mjs +1 -1
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +71 -0
- package/node_modules/@code-yeongyu/senpi-codemode/README.md +2 -0
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +5 -5
- package/node_modules/@code-yeongyu/senpi-codemode/src/config/settings.ts +29 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +20 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/worker-runtime.js +6 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/worker-shell-capture.d.ts +10 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/worker-shell-capture.js +126 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt.ts +34 -92
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-execution.ts +7 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool-options.ts +8 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +15 -2
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/types.ts +10 -5
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +58 -64
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +16 -6
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.d.ts +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.js +6 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/write.js +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/write.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts +2 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js +40 -10
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +6 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts +1 -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 +130 -15
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/context-room.d.ts +20 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/context-room.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/context-room.js +40 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/context-room.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js +4 -4
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +1 -1
- 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-completions.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +16 -1
- 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.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js +6 -0
- 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 +1 -3
- 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 +2 -16
- package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/warm-prompt-cache.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/warm-prompt-cache.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.d.ts +16 -3
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.js +40 -6
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/compat/extension-oauth-types.d.ts +8 -0
- package/node_modules/@earendil-works/pi-ai/dist/compat/extension-oauth-types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/compat/extension-oauth-types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.js +3 -2
- package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/openai-responses-compat.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/openai-responses-compat.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/openai-responses-compat.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/anthropic.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/azure-openai-responses.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/baseten.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/nvidia.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.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/openrouter.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.js +8 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +14 -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/drop-failed-assistant-turns.d.ts +23 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/drop-failed-assistant-turns.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/drop-failed-assistant-turns.js +58 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/drop-failed-assistant-turns.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.js +53 -12
- package/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts +4 -2
- 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 +3 -0
- 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/retry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +3 -3
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/README.md +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +36 -3
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts +2 -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 +106 -6
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +6 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js +17 -4
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts +11 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js +57 -15
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.js +22 -7
- package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +17 -17
package/CHANGELOG.md
CHANGED
|
@@ -2,12 +2,174 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
### Breaking Changes
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
### Removed
|
|
14
|
+
|
|
15
|
+
## [2026.9.4-3] - 2026-09-04
|
|
16
|
+
|
|
17
|
+
### Breaking Changes
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- Terminal monitors and background Bash sessions are now recorded per session, and a fresh startup reports what was carried over, lost, expired, or unreadable in exactly one notification instead of silently dropping the state; durable watches are reported as lost rather than resumed for now, while reloads continue preserving live terminal state without this report.
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- Terminal monitors now expose a stable `mon_` id in their result while retaining the runtime `bash_N` handle as `details.bash_id`, and `bash_output`, `bash_input`, `bash_resize`, `kill_bash`, and monitor rearming accept either id.
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- A clean checkout no longer fails `bun install --frozen-lockfile`, because the committed lockfile now matches the `@anthropic-ai/sdk` override in `package.json`.
|
|
30
|
+
- A spawned RPC host that never answers `get_protocol_info` now reports why. Its teardown validated pid ownership with a process-identity probe that throws when the platform query fails (on Windows a starved `powershell.exe` CIM read), so the failure surfaced as `Command failed: powershell.exe …` instead of the readiness diagnostic and the pidfile and socket were left behind. A just-spawned host is now stopped through its own process handle, a probe that fails against a live pid is retried and then reported as a typed unreadable-identity error instead of the raw shell failure, and a probe that fails against a dead pid simply reads as gone — so the same Windows probe flake can no longer surface from concurrent starts, attach, or teardown.
|
|
31
|
+
- Fixed Anthropic native tool search sending `tool_reference` blocks under a `name` field instead of the API's `tool_name`, and restricted the injected BM25 server tool to models that actually support tool search (Opus/Sonnet 4.5+ and Fable), so Anthropic-compatible gateways and proxies no longer 400 and permanently fall back to local `tool_search` for the session.
|
|
32
|
+
- Image generation no longer fails with an OpenAI 401 when a placeholder API key is stored for the `openai` provider. A seeded `SK-SENTINEL-DO-NOT-LOG` value is treated as absent instead of as a credential, so resolution falls through to a configured OpenAI-compatible gateway, and image generation is reported as not configured when no gateway exists.
|
|
33
|
+
- Hook trust-state reads no longer fail tool execution when the lock directory cannot be created (`EPERM`/`EACCES`/`EROFS` in sandboxed or read-only children); writers still fail closed on those errors.
|
|
34
|
+
- File-backed credential, auth, and settings locks now wait through bounded contention retries; exhausted waits report an actionable transient `CredentialStoreBusyError` instead of burning the provider fallback chain.
|
|
35
|
+
### Removed
|
|
36
|
+
|
|
37
|
+
## [2026.9.4-2] - 2026-09-04
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
|
|
41
|
+
- Branded build labels now render verbatim in the startup UI instead of gaining a `v` prefix, and unorderable version pairs no longer advertise a bogus engine update.
|
|
42
|
+
- Starting an RPC socket host or app-server daemon on a loaded Windows machine no longer fails with `spawned daemon pid N had no process start time` while the process is running normally. The process-identity probe defaults to a one-second timeout on Windows, so a busy `Get-CimInstance` could exhaust the whole startup budget; an unreadable identity for a live process is now treated as unknown and retried once at length instead of being reported as a startup failure.
|
|
43
|
+
|
|
44
|
+
### Breaking Changes
|
|
45
|
+
|
|
46
|
+
### Added
|
|
47
|
+
|
|
48
|
+
- **Terminal capability overrides** — Override detected terminal hyperlink, image, and truecolor support. See [Capability Overrides](docs/terminal-setup.md#capability-overrides).
|
|
49
|
+
- **Extension UI prompt events** — Integrations can distinguish active agent work from time spent waiting for `ctx.ui` prompts. See [Extension UI prompt events](docs/extensions.md#ui_prompt_start--ui_prompt_end).
|
|
50
|
+
- **RPC queue clearing** — Retrieve and clear queued steering and follow-up messages with `clear_queue`. See [RPC `clear_queue`](docs/rpc.md#clear_queue).
|
|
51
|
+
- **Fullscreen selection copy controls** — Disable automatic selection copying in fullscreen mode and use Ctrl+X to copy the active selection. See [UI & Display](docs/settings.md#ui--display).
|
|
52
|
+
- **DeepSeek V4 Flash Vision (experimental)** — Use the vision-capable model through the built-in DeepSeek provider. See [API Keys](docs/providers.md#api-keys).
|
|
53
|
+
|
|
54
|
+
- Added `supportsMidConvoEffort` to custom Anthropic Messages model compatibility settings.
|
|
55
|
+
- Added transcript notices for Anthropic thinking blocks dropped during provider recovery when cache miss notices are enabled.
|
|
56
|
+
- Added `ui_prompt_start` and `ui_prompt_end` extension events so host integrations can distinguish active agent work from waiting on user-facing `ctx.ui` prompts ([#8355](https://github.com/earendil-works/pi/pull/8355) by [@cristinaponcela](https://github.com/cristinaponcela)).
|
|
57
|
+
- Added `detectSupportedImageMimeTypeFromFile()` to the public library exports ([#8600](https://github.com/earendil-works/pi/pull/8600) by [@xl0](https://github.com/xl0)).
|
|
58
|
+
- Added inherited experimental vision-capable `deepseek-v4-flash-vision-exp` model support.
|
|
59
|
+
- Added transcript usage notices for compaction and branch summaries when cache miss notices are enabled.
|
|
60
|
+
- Added RPC `clear_queue` to retrieve and remove queued steering and follow-up messages ([#8432](https://github.com/earendil-works/pi/issues/8432)).
|
|
61
|
+
- Added environment variables and advanced settings for overriding auto-detected terminal hyperlink, image, and truecolor capabilities ([#8665](https://github.com/earendil-works/pi/issues/8665)).
|
|
62
|
+
- Added `fullscreenCopyOnSelect` to disable automatic fullscreen selection copy; when disabled, `Ctrl+X` copies the active text selection before falling back to the last assistant message, while `/tree` still copies the selected message ([#7720](https://github.com/earendil-works/pi/issues/7720)).
|
|
63
|
+
|
|
64
|
+
- The skills prompt section aliases each shared skill root to an `r0`/`r1` prefix once and renders per-skill locations relative to it, so the long absolute root is no longer billed per skill (145 skills, -1,137 tokens/turn).
|
|
65
|
+
|
|
66
|
+
- Typing `.` alone in the editor now resumes the agent's most recent intent (manual continue): no user message is created or rendered, and a hidden `manual-continue` custom message (display off) drives the next turn — a new turn when idle, steer/follow-up while streaming. A lone `.` on an empty session remains an ordinary user message.
|
|
67
|
+
|
|
68
|
+
### Changed
|
|
69
|
+
|
|
70
|
+
- `schedule_wakeup` is no longer a resident tool: it registers search-exposed with lazy activation disabled, and the `/loop` extension activates it only while a dynamic loop is live and retires it when that loop ends or suspends (-234 prompt tokens per turn in every session without a dynamic loop). Its description keeps the delay guidance and drops the monitor/`bash_output`/`kill_bash` waiting rule that the dynamic tick prompt already carries.
|
|
71
|
+
- Changed selectors in `/thinking`, `/model`, `/scoped-models`, `/trust`, per-model thinking settings, and theme settings to keep active options marked while browsing. `/scoped-models` now uses consistent per-item toggles and strikes through unavailable models ([#8900](https://github.com/earendil-works/pi/pull/8900)).
|
|
72
|
+
|
|
73
|
+
### Fixed
|
|
74
|
+
|
|
75
|
+
- Fixed the write tool reporting UTF-16 code-unit counts as byte counts by removing the misleading count ([#8979](https://github.com/earendil-works/pi/issues/8979)).
|
|
76
|
+
- Fixed proxied plain-HTTP provider requests hanging after a tool call by tunneling them with CONNECT ([#8134](https://github.com/earendil-works/pi/issues/8134)).
|
|
77
|
+
- Fixed RPC `abort` reporting success without cancelling an in-progress manual compaction ([#8920](https://github.com/earendil-works/pi/issues/8920)).
|
|
78
|
+
- Fixed toggling thinking visibility clearing partial output from running Bash tools ([#8611](https://github.com/earendil-works/pi/issues/8611)).
|
|
79
|
+
- Fixed Windows shell aborts crashing Pi when `taskkill.exe` is unavailable on `PATH` ([#6596](https://github.com/earendil-works/pi/issues/6596)).
|
|
80
|
+
- Fixed resumed sessions corrupting the next appended entry when their JSONL file lacks a trailing newline ([#8345](https://github.com/earendil-works/pi/issues/8345)).
|
|
81
|
+
- Fixed extension messages sent with `triggerTurn: false` while the agent is running being inserted between a tool call and its result, which made providers that validate message order reject the replayed history. They are now appended once the turn's tool results are in ([#8537](https://github.com/earendil-works/pi/issues/8537)).
|
|
82
|
+
- Fixed compaction and branch summaries forcing `toolChoice: "none"` ([#8649](https://github.com/earendil-works/pi/issues/8649), [#8638](https://github.com/earendil-works/pi/issues/8638)).
|
|
83
|
+
- Fixed large tool results crossing the auto-compaction threshold being sent to the provider before compaction. Pi now compacts between tool execution and the next assistant response in the same run, and restores interactive progress when that run resumes ([#6879](https://github.com/earendil-works/pi/issues/6879)).
|
|
84
|
+
- Fixed Google Vertex requests failing with `HttpsProxyAgent is not a constructor` when the bundled Node.js runtime uses an HTTP(S) proxy ([#8610](https://github.com/earendil-works/pi/issues/8610)).
|
|
85
|
+
- Fixed inherited `@` file autocomplete ranking to prefer direct and shallower matches over similarly ranked nested paths ([#8669](https://github.com/earendil-works/pi/pull/8669)).
|
|
86
|
+
- Fixed inherited OpenAI-compatible streams serializing thinking signatures repeatedly during streaming ([#8671](https://github.com/earendil-works/pi/pull/8671)).
|
|
87
|
+
- Fixed inherited main-screen rendering crashing when image-heavy output exceeded V8's string length limit ([#8028](https://github.com/earendil-works/pi/issues/8028)).
|
|
88
|
+
- Fixed inherited fullscreen double-click word selection splitting paths and kebab-case tokens on `/` and `-` ([#8676](https://github.com/earendil-works/pi/pull/8676)).
|
|
89
|
+
- Fixed inherited Cloudflare AI Gateway catalogs omitting supported `workers-ai/*` passthrough models.
|
|
90
|
+
- Fixed inherited OpenAI-compatible reasoning replay to merge consecutive streamed text and summary `reasoning_details` deltas.
|
|
91
|
+
- Fixed inherited OpenRouter reasoning controls so reasoning-mandatory models do not receive `effort: "none"` ([#8614](https://github.com/earendil-works/pi/pull/8614) by [@davidbrai](https://github.com/davidbrai)).
|
|
92
|
+
- Fixed inherited OpenAI-compatible Chat Completions ignoring an explicitly requested `toolChoice` when no tools are defined.
|
|
93
|
+
- Fixed inherited fragmented Mistral tool calls splitting when continuation chunks omit the tool-call ID ([#8387](https://github.com/earendil-works/pi/issues/8387)).
|
|
94
|
+
|
|
95
|
+
- Fixed queued steering and follow-up messages still reaching the provider after a queue clear on a terminating continuation: the terminating continuation boundary now runs before the drained queue is refreshed, so a clear or replacement at `turn_start` wins over pending input.
|
|
96
|
+
- Fixed `prepareNextTurn` and `prepareNextTurnWithContext` being skipped on completed turns without tool calls: the next-turn preparation now runs after every completed assistant turn that can reach the preparation boundary, including a normal stop response, while the terminating queue boundary and ownership refresh are preserved before a continuation provider request.
|
|
97
|
+
- Fixed next-turn compaction firing on completed turns that will not reach the provider: compaction is now gated on real provider admission (a tool continuation or queued message actually being admitted), while the next-turn callback keeps running on every completed turn and the late queue re-sample and one bounded callback replay after compaction are retained.
|
|
98
|
+
|
|
99
|
+
- Errored and aborted provider turns are now excluded from every LLM request at the session level: `convertToLlm` runs the shared `dropFailedAssistantTurns` from `@earendil-works/pi-ai` as its final step, so lanes that build requests straight from its output (the claude-sdk-oauth prompt bridge's `<conversation_history>` rendering and cursor turn building) no longer replay a failed turn's partial text and unexecuted tool calls, and token estimation (`estimateContextTokens(buildSessionContext(...))`) no longer counts them. A tool call id re-declared by a later kept assistant keeps its result; `stop`/`length`/`toolUse` turns are untouched; the provider transform layer's existing drop in `transform-messages.ts` stays as-is.
|
|
100
|
+
|
|
101
|
+
### Removed
|
|
102
|
+
|
|
103
|
+
## [2026.9.4] - 2026-09-04
|
|
104
|
+
|
|
105
|
+
### Breaking Changes
|
|
106
|
+
|
|
107
|
+
### Added
|
|
108
|
+
|
|
109
|
+
- New `gpt-6-astra` prompt preset, written from scratch against the GPT-6 Astra prompting guide: every `gpt-6-astra` model id (bare, `-fast`, dated snapshots, provider-prefixed, Bedrock `openai.gpt-6-astra`, display name "GPT-6 Astra") now gets a full-core system prompt with an initiative section (bias to action, approval as the last step on a concrete result), explicit instruction precedence for skills and project files, an asynchronous-work section mapping Astra's async-tool training onto background sessions, monitors, child tasks, and detached eval cells (end the turn to wait; no wait tool), calibrated test-first verification, and an engineer-prose writing style with the guide's slop-phrase ban. `promptPreset: "gpt-6-astra"` forces it.
|
|
110
|
+
|
|
111
|
+
### Changed
|
|
112
|
+
|
|
113
|
+
### Fixed
|
|
114
|
+
|
|
115
|
+
- Anthropic Messages requests that carry deferred (`defer_loading`) tools no longer fail with `invalid_request_error: tools.N.tool_search_tool_bm25_20251119.name: Input should be 'tool_search_tool_bm25'`. The injected native tool-search server tool is now named `tool_search_tool_bm25` as the API contract requires; the local `tool_search` custom tool is unchanged.
|
|
116
|
+
- Prompt surfaces no longer ship the same guidance twice per turn: the `Task_Management` section stops re-sending the todo tool description, `update_goal` points at the goal audits instead of restating them, and the bash timeout policy hands the waiting doctrine to the terminal section. Roughly 1.5K tokens leave every turn with no rule removed.
|
|
117
|
+
- The shared GPT eval-routing bridge no longer routes multi-call work to the `exec`/`wait` Code Mode tools that were removed in favor of detached `eval` cells; every GPT preset now points at `eval` only.
|
|
118
|
+
- Resuming a session left on a `-fast` catalog variant (or any model with an `upstreamModelId`) now restores that exact selection instead of its upstream base model, so the priority tier and the fast indicator survive the resume; assistant messages no longer override an explicit same-provider model selection during session restore.
|
|
119
|
+
- TTSR now interrupts a single streamed assistant message that repeats the same paragraph three times (a within-message narration loop such as re-announcing the same "now writing the DAG cell" step for minutes without ever issuing the tool call): the collapse guard gains a paragraph-repeat mechanism, truncates the message from the first repeat, and injects the usual recovery nudge. Scalar runs, short periods, and line cycles were the only mechanisms before, and blank lines reset line-cycle tracking, so paragraph-level loops streamed unchecked until the user aborted. Tool-argument streams are not affected.
|
|
120
|
+
|
|
121
|
+
### Removed
|
|
122
|
+
|
|
123
|
+
## [2026.9.3-3] - 2026-09-03
|
|
124
|
+
|
|
125
|
+
### Added
|
|
126
|
+
|
|
127
|
+
- `/gpt-account` manages OpenAI Codex OAuth accounts the way `/claude-account` manages claude-sdk-oauth ones: `add` runs an interactive Codex login and stores the new account beside the existing ones, `remove <name>`, `pin <name>` and `unpin` select which account is used, and the bare command lists every stored account with its source, availability and pin state without printing token material.
|
|
128
|
+
- RPC clients that send `media_placeholders` in `set_client_info` now receive inline tool-result images as `image_ref` placeholders shaped with `mimeType`, `byteLength` and a `{ toolCallId, contentIndex }` reference, and can retrieve an omitted image through the `get_media` command; default clients remain byte-identical, while classic stdio mode is not covered. This prevented inline image tool results from overflowing a desktop client's socket queue.
|
|
129
|
+
|
|
130
|
+
### Changed
|
|
131
|
+
|
|
132
|
+
### Fixed
|
|
133
|
+
- Claude SDK OAuth restart continuity now persists from the compaction-aware active context, survives goal-continuation metadata and a resident entry closing before `message_end`, and therefore avoids flattening and re-sending an oversized full transcript after restart.
|
|
134
|
+
|
|
135
|
+
- Multi-session RPC socket clients no longer lose assistant text when they fall behind: a queued `message_update` snapshot superseded by a newer one is now delivered in its delta-only form instead of being replaced, so `text_delta` streams stay lossless the way the stdout path already was. A stalled omo-desktop reader had lost a 411-character window and rendered a message that started mid-word.
|
|
136
|
+
- A multi-session RPC socket whose per-connection event queue overflows is now closed (after the `overflow` record), instead of being left open while the host silently dropped every later record and command response for it; the client reconnects and resyncs. The overflow is reported to stderr with the queued/incoming/max byte counts and a preview of the offending record, and the default per-connection cap rises from 4 MiB to 64 MiB, which four inline image tool results had exceeded in one burst.
|
|
137
|
+
- `/gpt-account remove` (and every other account-removal path) now leaves the remaining account actually in use. Removing the account the stored credential's top-level fields projected used to keep those fields pointing at the deleted account's tokens, and a provider left with one account does not enter credential rotation, so requests kept authenticating as the removed account; the surviving account's material is now projected onto those fields.
|
|
138
|
+
- Claude SDK OAuth classifies Fable-style "requires usage credits" failures as a non-retryable entitlement instead of a rate limit, so the account is not blocked for 60s and AgentSession can fall through to the next model ([#709](https://github.com/code-yeongyu/senpi/issues/709)).
|
|
139
|
+
- Print mode (`-p` / `--mode json`) now writes a stderr notice when retry fallback substitutes a model, so silent wrong-model answers are visible without corrupting JSON stdout ([oh-my-openagent#7626](https://github.com/code-yeongyu/oh-my-openagent/issues/7626)).
|
|
140
|
+
- Claude SDK OAuth host-tool denial now states that Senpi executes the tool on the host and returns the result as the next user message, so models no longer treat "Do not retry with other tools; end the turn." as a failure ([#784](https://github.com/code-yeongyu/senpi/issues/784), [oh-my-openagent#7115](https://github.com/code-yeongyu/oh-my-openagent/issues/7115)).
|
|
141
|
+
- Claude SDK OAuth no longer falls back to the host `claude` CLI login when a managed lane is selected and its account pool is empty: `oauth-slots` and `config-dir` now fail with `No Claude SDK OAuth accounts configured for the managed lane` instead of silently answering with ambient credentials after `/logout`. The ambient lane (no `tokenInjection` and no stored accounts) is unchanged.
|
|
142
|
+
### New Features
|
|
143
|
+
|
|
144
|
+
### Breaking Changes
|
|
145
|
+
|
|
5
146
|
### Added
|
|
6
147
|
|
|
7
148
|
### Changed
|
|
8
149
|
|
|
9
150
|
### Fixed
|
|
10
151
|
|
|
152
|
+
### Removed
|
|
153
|
+
|
|
154
|
+
## [2026.9.3-2] - 2026-09-03
|
|
155
|
+
|
|
156
|
+
### Added
|
|
157
|
+
|
|
158
|
+
### Changed
|
|
159
|
+
|
|
160
|
+
- `bash`, `powershell`, `workflow` and `monitor` now run only inside eval cells whenever the `eval` tool is available, with no setting to enable it. They leave the model's direct tool list and are called as `tool.bash(...)`, `tool.workflow(...)` and `tool.monitor(...)`; hooks and permission checks still apply, a direct call returns a hint naming the eval form, and a session without `eval` (codemode disabled, or a child agent whose allowlist omits it) keeps all four directly callable. The prompt surfaces that document these tools render the reachable call form to match, and no session is told about a tool its registry does not hold.
|
|
161
|
+
- The wait-as-subscription guidance moved from the model presets into the `eval` tool description, where it can name the reachable `tool.monitor(...)` form. Because the preset rule was gated on `monitor` being directly selectable, it would otherwise have stopped rendering entirely once monitor became eval-only.
|
|
162
|
+
- Per-model system prompt presets for Claude Opus 4.5-4.8, Claude Opus 5, and GLM 5.2/5.3 are audited against their prompting guides and the dieted shared core: the Opus 5 core is rebuilt on the Fable 5.1 skeleton with the Opus 5 guide behaviors stated once each and gains the guide's outcome-first final-summary shape; Opus 4.7/4.8 keep only their documented deltas and gain the same-turn subagent fan-out direction; Opus 4.6 drops tuning text the core now carries; GLM 5.2/5.3 share one builder, gain the eval/monitor execution-tooling stance, and lose the lineage preamble, undefined-mode reference, and unconditional todo procedure. The shared core gains a conditional delegation rule and states the auto-compaction mechanism behind the context-limits rule.
|
|
163
|
+
- The Kimi K3 prompt preset is rebuilt on the Fable 5.1 skeleton for Moonshot's documented K3 "excessive proactiveness": a Scope section makes the request the deliverable (pre-existing problems become follow-ups, tests are committed only where the task or repository calls for them), the ambiguity gate does the answer-independent work first and then asks one question, a bounded failure cap stops improvisation after three failed approaches, delegation propagates a stop condition to subagents, and the K2.6-era act-bias repetition that outvoted those boundaries is gone - at 11 fewer Kimi K3 tokens than before.
|
|
164
|
+
### Fixed
|
|
165
|
+
|
|
166
|
+
- RPC logins now answer providers' mid-flow prompts over the extension UI dialog channel (`extension_ui_request` `input` for pasted codes, text, and secrets; `select` for account choices) and release an unanswered dialog when the login settles, so Anthropic Claude Pro/Max and other prompt-driven OAuth flows complete through the browser callback instead of failing with `Interactive login input is not supported over RPC` and a dead callback port ([#1316](https://github.com/code-yeongyu/senpi/issues/1316)).
|
|
167
|
+
- Claude SDK OAuth no longer loops on `No conversation found with session ID` after a failed cold seed: a session id is resumed only once Claude Code acknowledged it (init or replay echo), and an id Claude Code reports missing is dropped instead of retried ([oh-my-openagent#7562](https://github.com/code-yeongyu/oh-my-openagent/issues/7562)).
|
|
168
|
+
- Bundled Claude Code is now 2.1.259 via `@anthropic-ai/claude-agent-sdk` 0.3.259, so `claude-sdk-oauth` sessions on `claude-fable-5-1` no longer fail with the API 400 that required version 2.1.251 or newer ([#1298](https://github.com/code-yeongyu/senpi/issues/1298)).
|
|
169
|
+
- Claude SDK OAuth maps malformed or raw-string content entries to text (or an omission placeholder) instead of image blocks with undefined `media_type`/`data`, which made Claude Code abort the next query ([oh-my-openagent#7660](https://github.com/code-yeongyu/oh-my-openagent/issues/7660)).
|
|
170
|
+
- A second `claude-sdk-oauth` login now stores the newly issued OAuth tokens instead of a broken slot holding the managed placeholder, and no longer fails with `Provider is not configured: claude-sdk-oauth` when account rotation has selected a single account ([#1279](https://github.com/code-yeongyu/senpi/issues/1279)).
|
|
171
|
+
- Claude SDK OAuth `is_error` results now trigger model fallback and multi-account failover instead of being treated as successful results ([#1169](https://github.com/code-yeongyu/senpi/issues/1169)).
|
|
172
|
+
- Claude SDK OAuth now surfaces the SDK assistant's API error text and explains version-floor and unknown-model failures instead of reporting `unknown` ([#1298](https://github.com/code-yeongyu/senpi/issues/1298), [oh-my-openagent#7626](https://github.com/code-yeongyu/oh-my-openagent/issues/7626)).
|
|
11
173
|
### New Features
|
|
12
174
|
|
|
13
175
|
### Breaking Changes
|
|
@@ -20,6 +182,8 @@
|
|
|
20
182
|
|
|
21
183
|
### Removed
|
|
22
184
|
|
|
185
|
+
- The `experimental.bashEvalOnly` and `experimental.workflowEvalOnly` settings are removed; the behaviour they enabled is now the default and needs no configuration. Existing entries in a settings file are ignored.
|
|
186
|
+
|
|
23
187
|
## [2026.9.3] - 2026-09-03
|
|
24
188
|
|
|
25
189
|
### Added
|
package/README.md
CHANGED
|
@@ -102,7 +102,7 @@ Then just talk to pi. By default, pi gives the model four tools: `read`, `write`
|
|
|
102
102
|
|
|
103
103
|
## Providers & Models
|
|
104
104
|
|
|
105
|
-
For each built-in provider, pi maintains a list of tool-capable models. Configured provider catalogs refresh automatically; run `pi update --models` to force an immediate refresh. Authenticate via subscription (`/login`) or API key, then select any model from that provider via `/model` (or Ctrl+L).
|
|
105
|
+
For each built-in provider, pi maintains a list of tool-capable models. Configured provider catalogs refresh automatically; run `pi update --models` to force an immediate refresh. Authenticate via subscription (`/login`) or API key, then select any model from that provider via `/model` (or Ctrl+L). Press Ctrl+S in the model picker to save the highlighted model as the startup default.
|
|
106
106
|
|
|
107
107
|
**Subscriptions:**
|
|
108
108
|
- Anthropic Claude Pro/Max
|
|
@@ -187,9 +187,10 @@ Type `/` in the editor to trigger commands. [Extensions](#extensions) can regist
|
|
|
187
187
|
|---------|-------------|
|
|
188
188
|
| `/login`, `/logout` | Manage provider credentials |
|
|
189
189
|
| [`/llama`](docs/llama-cpp.md) | Download, load, and unload llama.cpp router models |
|
|
190
|
-
| `/model` | Switch models |
|
|
190
|
+
| `/model` | Switch models; Ctrl+S in the picker saves the startup default |
|
|
191
|
+
| `/thinking` | Switch thinking level; Ctrl+S in the picker saves the startup default |
|
|
191
192
|
| `/scoped-models` | Enable/disable models for Ctrl+P cycling |
|
|
192
|
-
| `/settings` |
|
|
193
|
+
| `/settings` | Theme, message delivery, transport, and other preferences |
|
|
193
194
|
| `/resume` | Pick from previous sessions |
|
|
194
195
|
| `/new` | Start a new session |
|
|
195
196
|
| `/name <name>` | Set session display name |
|
|
@@ -225,7 +226,7 @@ See `/hotkeys` for the full list. Customize via `~/.pi/agent/keybindings.json`.
|
|
|
225
226
|
| Shift+Tab | Cycle thinking level |
|
|
226
227
|
| Ctrl+O | Collapse/expand tool output |
|
|
227
228
|
| Ctrl+T | Collapse/expand thinking blocks |
|
|
228
|
-
| Ctrl+X | Copy the last assistant message |
|
|
229
|
+
| Ctrl+X | Copy the last assistant message; with fullscreen copy-on-select disabled, copy the active text selection |
|
|
229
230
|
|
|
230
231
|
### Message Queue
|
|
231
232
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startup-ui.d.ts","sourceRoot":"","sources":["../../src/cli/startup-ui.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"startup-ui.d.ts","sourceRoot":"","sources":["../../src/cli/startup-ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2D,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAOtG,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAsE9D,wBAAsB,gBAAgB,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,CAYrF;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,GAAG,EAAE,eAAe,EAAE,eAAe,GAAG,IAAI,CAG/E;AAkBD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,GAAE,MAA0B,GAAG,OAAO,CAiBzF;AAED,wBAAsB,mBAAmB,CAAC,CAAC,EAC1C,eAAe,EAAE,eAAe,EAChC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAAC,GACzC,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAyBxB;AAED,8DAA8D;AAC9D,wBAAsB,kBAAkB,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAuCxF;AAED,wBAAsB,gBAAgB,CACrC,eAAe,EAAE,eAAe,EAChC,KAAK,EAAE,MAAM,EACb,WAAW,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CA4B7B"}
|
package/dist/cli/startup-ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProcessTerminal, setKeybindings, TUI } from "@earendil-works/pi-tui";
|
|
1
|
+
import { ProcessTerminal, setCapabilityOverrides, setKeybindings, TUI } from "@earendil-works/pi-tui";
|
|
2
2
|
import { existsSync } from "fs";
|
|
3
3
|
import { APP_NAME, CONFIG_DIR_NAME, ENV_AGENT_DIR, getAgentDir, getSettingsPath, PACKAGE_NAME } from "../config.js";
|
|
4
4
|
import { areExperimentalFeaturesEnabled } from "../core/experimental.js";
|
|
@@ -53,6 +53,7 @@ async function loadStartupThemes(settingsManager) {
|
|
|
53
53
|
return loadThemes(resolvedPaths.themes);
|
|
54
54
|
}
|
|
55
55
|
export async function createStartupTui(settingsManager) {
|
|
56
|
+
setCapabilityOverrides(settingsManager.getTerminalCapabilityOverrides());
|
|
56
57
|
setRegisteredThemes(await loadStartupThemes(settingsManager));
|
|
57
58
|
const terminalTheme = detectTerminalBackgroundFromEnv().theme;
|
|
58
59
|
initTheme(resolveThemeSetting(settingsManager.getThemeSetting(), terminalTheme) ?? terminalTheme);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startup-ui.js","sourceRoot":"","sources":["../../src/cli/startup-ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACh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QAAQ,CAAC,KAAK,CAAC,CAAC;QACnB,eAAe,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { ProcessTerminal, setKeybindings, TUI } from \"@earendil-works/pi-tui\";\nimport { existsSync } from \"fs\";\nimport { APP_NAME, CONFIG_DIR_NAME, ENV_AGENT_DIR, getAgentDir, getSettingsPath, PACKAGE_NAME } from \"../config.ts\";\nimport { areExperimentalFeaturesEnabled } from \"../core/experimental.ts\";\nimport { appendHiddenTuiStdout } from \"../core/hidden-stdout-log.ts\";\nimport { KeybindingsManager } from \"../core/keybindings.ts\";\nimport { DefaultPackageManager, type ResolvedResource } from \"../core/package-manager.ts\";\nimport { SettingsManager } from \"../core/settings-manager.ts\";\nimport { ExtensionInputComponent } from \"../modes/interactive/components/extension-input.ts\";\nimport { ExtensionSelectorComponent } from \"../modes/interactive/components/extension-selector.ts\";\nimport {\n\tFirstTimeSetupComponent,\n\ttype FirstTimeSetupResult,\n} from \"../modes/interactive/components/first-time-setup.ts\";\nimport {\n\tdetectTerminalBackgroundFromEnv,\n\tdetectTerminalThemeForAuto,\n\tinitTheme,\n\tloadThemeFromPath,\n\tparseAutoThemeSetting,\n\tresolveThemeSetting,\n\tsetRegisteredThemes,\n\tsetTheme,\n\ttype Theme,\n} from \"../modes/interactive/theme/theme.ts\";\n\nconst OFFICIAL_PACKAGE_NAME = \"@earendil-works/pi-coding-agent\";\nconst OFFICIAL_APP_NAME = \"pi\";\nconst OFFICIAL_CONFIG_DIR_NAME = \".pi\";\n\ninterface DistributionMetadata {\n\tpackageName: string;\n\tappName: string;\n\tconfigDirName: string;\n}\n\nfunction isOfficialDistribution({ packageName, appName, configDirName }: DistributionMetadata): boolean {\n\treturn (\n\t\tpackageName === OFFICIAL_PACKAGE_NAME &&\n\t\tappName === OFFICIAL_APP_NAME &&\n\t\tconfigDirName === OFFICIAL_CONFIG_DIR_NAME\n\t);\n}\n\nfunction loadThemes(resources: ResolvedResource[]): Theme[] {\n\tconst themes: Theme[] = [];\n\tconst seen = new Set<string>();\n\tfor (const resource of resources) {\n\t\tif (!resource.enabled) continue;\n\t\ttry {\n\t\t\tconst loadedTheme = loadThemeFromPath(resource.path);\n\t\t\tif (loadedTheme.name) {\n\t\t\t\tif (seen.has(loadedTheme.name)) continue;\n\t\t\t\tseen.add(loadedTheme.name);\n\t\t\t}\n\t\t\tthemes.push(loadedTheme);\n\t\t} catch {\n\t\t\t// Startup prompts should not fail because a theme is broken. The normal\n\t\t\t// resource loader reports theme diagnostics later in startup.\n\t\t}\n\t}\n\treturn themes;\n}\n\nasync function loadStartupThemes(settingsManager: SettingsManager): Promise<Theme[]> {\n\tconst globalSettingsManager = SettingsManager.inMemory(settingsManager.getGlobalSettings(), {\n\t\tprojectTrusted: false,\n\t});\n\tconst packageManager = new DefaultPackageManager({\n\t\tcwd: process.cwd(),\n\t\tagentDir: getAgentDir(),\n\t\tsettingsManager: globalSettingsManager,\n\t});\n\tconst resolvedPaths = await packageManager.resolve(async () => \"skip\");\n\treturn loadThemes(resolvedPaths.themes);\n}\n\nexport async function createStartupTui(settingsManager: SettingsManager): Promise<TUI> {\n\tsetRegisteredThemes(await loadStartupThemes(settingsManager));\n\tconst terminalTheme = detectTerminalBackgroundFromEnv().theme;\n\tinitTheme(resolveThemeSetting(settingsManager.getThemeSetting(), terminalTheme) ?? terminalTheme);\n\tsetKeybindings(KeybindingsManager.create());\n\tconst ui = new TUI(\n\t\tnew ProcessTerminal({ onExternalStdoutWrite: appendHiddenTuiStdout }),\n\t\tsettingsManager.getShowHardwareCursor(),\n\t);\n\tui.setClearOnShrink(settingsManager.getClearOnShrink());\n\treturn ui;\n}\n\nexport function startStartupTui(ui: TUI, settingsManager: SettingsManager): void {\n\tui.start();\n\tvoid applyDetectedStartupTheme(ui, settingsManager);\n}\n\nasync function applyDetectedStartupTheme(ui: TUI, settingsManager: SettingsManager): Promise<void> {\n\tconst themeSetting = settingsManager.getThemeSetting();\n\tif (themeSetting && !parseAutoThemeSetting(themeSetting)) return;\n\n\tconst terminalTheme = await detectTerminalThemeForAuto({ ui, timeoutMs: 100 });\n\tsetTheme(resolveThemeSetting(themeSetting, terminalTheme) ?? terminalTheme);\n\tui.invalidate();\n\tui.requestRender();\n}\n\nasync function clearStartupTui(ui: TUI): Promise<void> {\n\tui.clear();\n\tui.requestRender();\n\tawait new Promise((resolve) => setTimeout(resolve, 25));\n}\n\n/**\n * First-time setup runs when all of these hold:\n * - this is the official Pi distribution (not a fork/rebrand)\n * - experimental features are enabled (PI_EXPERIMENTAL=1)\n * - the default agent directory is used (no custom agent dir override)\n * - setup was not completed before (settings.json does not exist)\n */\nexport function shouldRunFirstTimeSetup(settingsPath: string = getSettingsPath()): boolean {\n\tif (\n\t\t!isOfficialDistribution({\n\t\t\tpackageName: PACKAGE_NAME,\n\t\t\tappName: APP_NAME,\n\t\t\tconfigDirName: CONFIG_DIR_NAME,\n\t\t})\n\t) {\n\t\treturn false;\n\t}\n\tif (!areExperimentalFeaturesEnabled()) {\n\t\treturn false;\n\t}\n\tif (process.env[ENV_AGENT_DIR]) {\n\t\treturn false;\n\t}\n\treturn !existsSync(settingsPath);\n}\n\nexport async function showStartupSelector<T>(\n\tsettingsManager: SettingsManager,\n\ttitle: string,\n\toptions: Array<{ label: string; value: T }>,\n): Promise<T | undefined> {\n\tconst ui = await createStartupTui(settingsManager);\n\treturn new Promise((resolve) => {\n\t\tlet settled = false;\n\t\tconst finish = async (result: T | undefined) => {\n\t\t\tif (settled) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsettled = true;\n\t\t\tawait clearStartupTui(ui);\n\t\t\tui.stop();\n\t\t\tresolve(result);\n\t\t};\n\n\t\tconst selector = new ExtensionSelectorComponent(\n\t\t\ttitle,\n\t\t\toptions.map((option) => option.label),\n\t\t\t(option) => void finish(options.find((entry) => entry.label === option)?.value),\n\t\t\t() => void finish(undefined),\n\t\t\t{ tui: ui },\n\t\t);\n\t\tui.addChild(selector);\n\t\tui.setFocus(selector);\n\t\tstartStartupTui(ui, settingsManager);\n\t});\n}\n\n/** Show the first-time setup dialog and persist the result */\nexport async function showFirstTimeSetup(settingsManager: SettingsManager): Promise<void> {\n\tconst ui = await createStartupTui(settingsManager);\n\treturn new Promise((resolve) => {\n\t\tlet settled = false;\n\t\tconst finish = async (result: FirstTimeSetupResult | undefined) => {\n\t\t\tif (settled) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsettled = true;\n\t\t\tif (result) {\n\t\t\t\tsettingsManager.setTheme(result.theme);\n\t\t\t\tsettingsManager.setEnableAnalytics(result.shareAnalytics);\n\t\t\t\tawait settingsManager.flush();\n\t\t\t}\n\t\t\tawait clearStartupTui(ui);\n\t\t\tui.stop();\n\t\t\tresolve();\n\t\t};\n\n\t\tconst showSetup = async () => {\n\t\t\tui.start();\n\t\t\tconst detectedTheme = await detectTerminalThemeForAuto({ ui, timeoutMs: 100 });\n\t\t\tsetTheme(detectedTheme);\n\t\t\tconst component = new FirstTimeSetupComponent({\n\t\t\t\tdetectedTheme,\n\t\t\t\tonThemePreview: (themeName) => {\n\t\t\t\t\tsetTheme(themeName);\n\t\t\t\t\tui.requestRender();\n\t\t\t\t},\n\t\t\t\tonSubmit: (result) => void finish(result),\n\t\t\t\tonCancel: () => void finish(undefined),\n\t\t\t});\n\t\t\tui.addChild(component);\n\t\t\tui.setFocus(component);\n\t\t\tui.requestRender();\n\t\t};\n\n\t\tvoid showSetup();\n\t});\n}\n\nexport async function showStartupInput(\n\tsettingsManager: SettingsManager,\n\ttitle: string,\n\tplaceholder?: string,\n): Promise<string | undefined> {\n\tconst ui = await createStartupTui(settingsManager);\n\treturn new Promise((resolve) => {\n\t\tlet settled = false;\n\t\tconst finish = async (result: string | undefined) => {\n\t\t\tif (settled) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsettled = true;\n\t\t\tinput.dispose();\n\t\t\tawait clearStartupTui(ui);\n\t\t\tui.stop();\n\t\t\tresolve(result);\n\t\t};\n\n\t\tconst input = new ExtensionInputComponent(\n\t\t\ttitle,\n\t\t\tplaceholder,\n\t\t\t(value) => void finish(value),\n\t\t\t() => void finish(undefined),\n\t\t\t{\n\t\t\t\ttui: ui,\n\t\t\t},\n\t\t);\n\t\tui.addChild(input);\n\t\tui.setFocus(input);\n\t\tstartStartupTui(ui, settingsManager);\n\t});\n}\n"]}
|
|
1
|
+
{"version":3,"file":"startup-ui.js","sourceRoot":"","sources":["../../src/cli/startup-ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AACtG,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACpH,OAAO,EAAE,8BAA8B,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAyB,MAAM,4BAA4B,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oDAAoD,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,uDAAuD,CAAC;AACnG,OAAO,EACN,uBAAuB,GAEvB,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EACN,+BAA+B,EAC/B,0BAA0B,EAC1B,SAAS,EACT,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,QAAQ,GAER,MAAM,qCAAqC,CAAC;AAE7C,MAAM,qBAAqB,GAAG,iCAAiC,CAAC;AAChE,MAAM,iBAAiB,GAAG,IAAI,CAAC;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O,EAAE,CAAC;gBACb,OAAO;YACR,CAAC;YACD,OAAO,GAAG,IAAI,CAAC;YACf,KAAK,CAAC,OAAO,EAAE,CAAC;YAChB,MAAM,eAAe,CAAC,EAAE,CAAC,CAAC;YAC1B,EAAE,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,CAAC,MAAM,CAAC,CAAC;QACjB,CAAC,CAAC;QAEF,MAAM,KAAK,GAAG,IAAI,uBAAuB,CACxC,KAAK,EACL,WAAW,EACX,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,MAAM,CAAC,KAAK,CAAC,EAC7B,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC,SAAS,CAAC,EAC5B;YACC,GAAG,EAAE,EAAE;SACP,CACD,CAAC;QACF,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACnB,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACnB,eAAe,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { ProcessTerminal, setCapabilityOverrides, setKeybindings, TUI } from \"@earendil-works/pi-tui\";\nimport { existsSync } from \"fs\";\nimport { APP_NAME, CONFIG_DIR_NAME, ENV_AGENT_DIR, getAgentDir, getSettingsPath, PACKAGE_NAME } from \"../config.ts\";\nimport { areExperimentalFeaturesEnabled } from \"../core/experimental.ts\";\nimport { appendHiddenTuiStdout } from \"../core/hidden-stdout-log.ts\";\nimport { KeybindingsManager } from \"../core/keybindings.ts\";\nimport { DefaultPackageManager, type ResolvedResource } from \"../core/package-manager.ts\";\nimport { SettingsManager } from \"../core/settings-manager.ts\";\nimport { ExtensionInputComponent } from \"../modes/interactive/components/extension-input.ts\";\nimport { ExtensionSelectorComponent } from \"../modes/interactive/components/extension-selector.ts\";\nimport {\n\tFirstTimeSetupComponent,\n\ttype FirstTimeSetupResult,\n} from \"../modes/interactive/components/first-time-setup.ts\";\nimport {\n\tdetectTerminalBackgroundFromEnv,\n\tdetectTerminalThemeForAuto,\n\tinitTheme,\n\tloadThemeFromPath,\n\tparseAutoThemeSetting,\n\tresolveThemeSetting,\n\tsetRegisteredThemes,\n\tsetTheme,\n\ttype Theme,\n} from \"../modes/interactive/theme/theme.ts\";\n\nconst OFFICIAL_PACKAGE_NAME = \"@earendil-works/pi-coding-agent\";\nconst OFFICIAL_APP_NAME = \"pi\";\nconst OFFICIAL_CONFIG_DIR_NAME = \".pi\";\n\ninterface DistributionMetadata {\n\tpackageName: string;\n\tappName: string;\n\tconfigDirName: string;\n}\n\nfunction isOfficialDistribution({ packageName, appName, configDirName }: DistributionMetadata): boolean {\n\treturn (\n\t\tpackageName === OFFICIAL_PACKAGE_NAME &&\n\t\tappName === OFFICIAL_APP_NAME &&\n\t\tconfigDirName === OFFICIAL_CONFIG_DIR_NAME\n\t);\n}\n\nfunction loadThemes(resources: ResolvedResource[]): Theme[] {\n\tconst themes: Theme[] = [];\n\tconst seen = new Set<string>();\n\tfor (const resource of resources) {\n\t\tif (!resource.enabled) continue;\n\t\ttry {\n\t\t\tconst loadedTheme = loadThemeFromPath(resource.path);\n\t\t\tif (loadedTheme.name) {\n\t\t\t\tif (seen.has(loadedTheme.name)) continue;\n\t\t\t\tseen.add(loadedTheme.name);\n\t\t\t}\n\t\t\tthemes.push(loadedTheme);\n\t\t} catch {\n\t\t\t// Startup prompts should not fail because a theme is broken. The normal\n\t\t\t// resource loader reports theme diagnostics later in startup.\n\t\t}\n\t}\n\treturn themes;\n}\n\nasync function loadStartupThemes(settingsManager: SettingsManager): Promise<Theme[]> {\n\tconst globalSettingsManager = SettingsManager.inMemory(settingsManager.getGlobalSettings(), {\n\t\tprojectTrusted: false,\n\t});\n\tconst packageManager = new DefaultPackageManager({\n\t\tcwd: process.cwd(),\n\t\tagentDir: getAgentDir(),\n\t\tsettingsManager: globalSettingsManager,\n\t});\n\tconst resolvedPaths = await packageManager.resolve(async () => \"skip\");\n\treturn loadThemes(resolvedPaths.themes);\n}\n\nexport async function createStartupTui(settingsManager: SettingsManager): Promise<TUI> {\n\tsetCapabilityOverrides(settingsManager.getTerminalCapabilityOverrides());\n\tsetRegisteredThemes(await loadStartupThemes(settingsManager));\n\tconst terminalTheme = detectTerminalBackgroundFromEnv().theme;\n\tinitTheme(resolveThemeSetting(settingsManager.getThemeSetting(), terminalTheme) ?? terminalTheme);\n\tsetKeybindings(KeybindingsManager.create());\n\tconst ui = new TUI(\n\t\tnew ProcessTerminal({ onExternalStdoutWrite: appendHiddenTuiStdout }),\n\t\tsettingsManager.getShowHardwareCursor(),\n\t);\n\tui.setClearOnShrink(settingsManager.getClearOnShrink());\n\treturn ui;\n}\n\nexport function startStartupTui(ui: TUI, settingsManager: SettingsManager): void {\n\tui.start();\n\tvoid applyDetectedStartupTheme(ui, settingsManager);\n}\n\nasync function applyDetectedStartupTheme(ui: TUI, settingsManager: SettingsManager): Promise<void> {\n\tconst themeSetting = settingsManager.getThemeSetting();\n\tif (themeSetting && !parseAutoThemeSetting(themeSetting)) return;\n\n\tconst terminalTheme = await detectTerminalThemeForAuto({ ui, timeoutMs: 100 });\n\tsetTheme(resolveThemeSetting(themeSetting, terminalTheme) ?? terminalTheme);\n\tui.invalidate();\n\tui.requestRender();\n}\n\nasync function clearStartupTui(ui: TUI): Promise<void> {\n\tui.clear();\n\tui.requestRender();\n\tawait new Promise((resolve) => setTimeout(resolve, 25));\n}\n\n/**\n * First-time setup runs when all of these hold:\n * - this is the official Pi distribution (not a fork/rebrand)\n * - experimental features are enabled (PI_EXPERIMENTAL=1)\n * - the default agent directory is used (no custom agent dir override)\n * - setup was not completed before (settings.json does not exist)\n */\nexport function shouldRunFirstTimeSetup(settingsPath: string = getSettingsPath()): boolean {\n\tif (\n\t\t!isOfficialDistribution({\n\t\t\tpackageName: PACKAGE_NAME,\n\t\t\tappName: APP_NAME,\n\t\t\tconfigDirName: CONFIG_DIR_NAME,\n\t\t})\n\t) {\n\t\treturn false;\n\t}\n\tif (!areExperimentalFeaturesEnabled()) {\n\t\treturn false;\n\t}\n\tif (process.env[ENV_AGENT_DIR]) {\n\t\treturn false;\n\t}\n\treturn !existsSync(settingsPath);\n}\n\nexport async function showStartupSelector<T>(\n\tsettingsManager: SettingsManager,\n\ttitle: string,\n\toptions: Array<{ label: string; value: T }>,\n): Promise<T | undefined> {\n\tconst ui = await createStartupTui(settingsManager);\n\treturn new Promise((resolve) => {\n\t\tlet settled = false;\n\t\tconst finish = async (result: T | undefined) => {\n\t\t\tif (settled) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsettled = true;\n\t\t\tawait clearStartupTui(ui);\n\t\t\tui.stop();\n\t\t\tresolve(result);\n\t\t};\n\n\t\tconst selector = new ExtensionSelectorComponent(\n\t\t\ttitle,\n\t\t\toptions.map((option) => option.label),\n\t\t\t(option) => void finish(options.find((entry) => entry.label === option)?.value),\n\t\t\t() => void finish(undefined),\n\t\t\t{ tui: ui },\n\t\t);\n\t\tui.addChild(selector);\n\t\tui.setFocus(selector);\n\t\tstartStartupTui(ui, settingsManager);\n\t});\n}\n\n/** Show the first-time setup dialog and persist the result */\nexport async function showFirstTimeSetup(settingsManager: SettingsManager): Promise<void> {\n\tconst ui = await createStartupTui(settingsManager);\n\treturn new Promise((resolve) => {\n\t\tlet settled = false;\n\t\tconst finish = async (result: FirstTimeSetupResult | undefined) => {\n\t\t\tif (settled) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsettled = true;\n\t\t\tif (result) {\n\t\t\t\tsettingsManager.setTheme(result.theme);\n\t\t\t\tsettingsManager.setEnableAnalytics(result.shareAnalytics);\n\t\t\t\tawait settingsManager.flush();\n\t\t\t}\n\t\t\tawait clearStartupTui(ui);\n\t\t\tui.stop();\n\t\t\tresolve();\n\t\t};\n\n\t\tconst showSetup = async () => {\n\t\t\tui.start();\n\t\t\tconst detectedTheme = await detectTerminalThemeForAuto({ ui, timeoutMs: 100 });\n\t\t\tsetTheme(detectedTheme);\n\t\t\tconst component = new FirstTimeSetupComponent({\n\t\t\t\tdetectedTheme,\n\t\t\t\tonThemePreview: (themeName) => {\n\t\t\t\t\tsetTheme(themeName);\n\t\t\t\t\tui.requestRender();\n\t\t\t\t},\n\t\t\t\tonSubmit: (result) => void finish(result),\n\t\t\t\tonCancel: () => void finish(undefined),\n\t\t\t});\n\t\t\tui.addChild(component);\n\t\t\tui.setFocus(component);\n\t\t\tui.requestRender();\n\t\t};\n\n\t\tvoid showSetup();\n\t});\n}\n\nexport async function showStartupInput(\n\tsettingsManager: SettingsManager,\n\ttitle: string,\n\tplaceholder?: string,\n): Promise<string | undefined> {\n\tconst ui = await createStartupTui(settingsManager);\n\treturn new Promise((resolve) => {\n\t\tlet settled = false;\n\t\tconst finish = async (result: string | undefined) => {\n\t\t\tif (settled) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsettled = true;\n\t\t\tinput.dispose();\n\t\t\tawait clearStartupTui(ui);\n\t\t\tui.stop();\n\t\t\tresolve(result);\n\t\t};\n\n\t\tconst input = new ExtensionInputComponent(\n\t\t\ttitle,\n\t\t\tplaceholder,\n\t\t\t(value) => void finish(value),\n\t\t\t() => void finish(undefined),\n\t\t\t{\n\t\t\t\ttui: ui,\n\t\t\t},\n\t\t);\n\t\tui.addChild(input);\n\t\tui.setFocus(input);\n\t\tstartStartupTui(ui, settingsManager);\n\t});\n}\n"]}
|
|
@@ -257,13 +257,13 @@ export class AgentSessionRuntime {
|
|
|
257
257
|
return { cancelled: false, selectedText };
|
|
258
258
|
}
|
|
259
259
|
const sessionManager = this.session.sessionManager;
|
|
260
|
+
await this.teardownCurrent("fork", sessionManager.getSessionFile());
|
|
260
261
|
if (!targetLeafId) {
|
|
261
|
-
sessionManager.newSession({ parentSession:
|
|
262
|
+
sessionManager.newSession({ parentSession: previousSessionFile });
|
|
262
263
|
}
|
|
263
264
|
else {
|
|
264
265
|
sessionManager.createBranchedSession(targetLeafId);
|
|
265
266
|
}
|
|
266
|
-
await this.teardownCurrent("fork", sessionManager.getSessionFile());
|
|
267
267
|
await this.apply(await this.createRuntime({
|
|
268
268
|
cwd: this.cwd,
|
|
269
269
|
agentDir: this.services.agentDir,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-session-runtime.js","sourceRoot":"","sources":["../../src/core/agent-session-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD,OAAO,EAAwB,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAExF,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAqCtD;;GAEG;AACH,MAAM,OAAO,8BAA+B,SAAQ,KAAK;IAGxD,YAAY,QAAgB;QAC3B,KAAK,CAAC,mBAAmB,QAAQ,EAAE,CAAC,CAAC;QACrC,IAAI,CAAC,IAAI,GAAG,gCAAgC,CAAC;QAC7C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC1B,CAAC;CACD;AAED,SAAS,sBAAsB,CAAC,OAAwD;IACvF,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QACjC,OAAO,OAAO,CAAC;IAChB,CAAC;IAED,OAAO,OAAO;SACZ,MAAM,CAAC,CAAC,IAAI,EAA0C,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC;SAC/G,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;SACxB,IAAI,CAAC,EAAE,CAAC,CAAC;AACZ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,OAAO,mBAAmB;IAe/B,YACC,QAAsB,EAC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B,CAC7B,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,QAAQ,EACf,aAAa,EACb,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,oBAAoB,EAC3B,OAAO,CAAC,aAAa,CACrB,CAAC;AACH,CAAC;AAED,OAAO,EAKN,8BAA8B,EAC9B,0BAA0B,GAC1B,MAAM,6BAA6B,CAAC","sourcesContent":["import { copyFileSync, existsSync, mkdirSync } from \"node:fs\";\nimport { basename, join, resolve } from \"node:path\";\nimport { resolvePath } from \"../utils/paths.ts\";\nimport type { AgentSession } from \"./agent-session.ts\";\nimport type { AgentSessionRuntimeDiagnostic, AgentSessionServices } from \"./agent-session-services.ts\";\nimport type {\n\tProjectTrustContext,\n\tReplacedSessionContext,\n\tSessionShutdownEvent,\n\tSessionStartEvent,\n} from \"./extensions/index.ts\";\nimport { type ExtensionRunner, emitSessionShutdownEvent } from \"./extensions/runner.ts\";\nimport type { CreateAgentSessionResult } from \"./sdk.ts\";\nimport { assertSessionCwdExists } from \"./session-cwd.ts\";\nimport { SessionManager } from \"./session-manager.ts\";\n\n/**\n * Result returned by runtime creation.\n *\n * The caller gets the created session, its cwd-bound services, and all\n * diagnostics collected during setup.\n */\nexport interface CreateAgentSessionRuntimeResult extends CreateAgentSessionResult {\n\tservices: AgentSessionServices;\n\tdiagnostics: AgentSessionRuntimeDiagnostic[];\n}\n\n/** Immutable flags selected when a runtime is first launched. */\nexport interface AgentSessionLaunchProfile {\n\tcwd: string;\n\tpermissionPreset?: string;\n\tcreationModel?: { provider: string; modelId: string };\n\tinitialThinkingLevel?: string;\n}\n\n/**\n * Creates a full runtime for a target cwd and session manager.\n *\n * The factory closes over process-global fixed inputs, recreates cwd-bound\n * services for the effective cwd, resolves session options against those\n * services, and finally creates the AgentSession.\n */\nexport type CreateAgentSessionRuntimeFactory = (options: {\n\tcwd: string;\n\tagentDir: string;\n\tsessionManager: SessionManager;\n\tsessionStartEvent?: SessionStartEvent;\n\tprojectTrustContext?: ProjectTrustContext;\n\tlaunchProfile?: Readonly<AgentSessionLaunchProfile>;\n}) => Promise<CreateAgentSessionRuntimeResult>;\n\n/**\n * Thrown when /import references a JSONL file path that does not exist.\n */\nexport class SessionImportFileNotFoundError extends Error {\n\treadonly filePath: string;\n\n\tconstructor(filePath: string) {\n\t\tsuper(`File not found: ${filePath}`);\n\t\tthis.name = \"SessionImportFileNotFoundError\";\n\t\tthis.filePath = filePath;\n\t}\n}\n\nfunction extractUserMessageText(content: string | Array<{ type: string; text?: string }>): string {\n\tif (typeof content === \"string\") {\n\t\treturn content;\n\t}\n\n\treturn content\n\t\t.filter((part): part is { type: \"text\"; text: string } => part.type === \"text\" && typeof part.text === \"string\")\n\t\t.map((part) => part.text)\n\t\t.join(\"\");\n}\n\n/**\n * Owns the current AgentSession plus its cwd-bound services.\n *\n * Session replacement methods tear down the current runtime first, then create\n * and apply the next runtime. If creation fails, the error is propagated to the\n * caller. The caller is responsible for user-facing error handling.\n */\nexport class AgentSessionRuntime {\n\tprivate rebindSession?: (session: AgentSession) => Promise<void>;\n\tprivate beforeSessionInvalidate?: () => void;\n\tprivate _session: AgentSession;\n\tprivate _services: AgentSessionServices;\n\tprivate readonly createRuntime: CreateAgentSessionRuntimeFactory;\n\tprivate _diagnostics: AgentSessionRuntimeDiagnostic[];\n\tprivate _modelFallbackMessage?: string;\n\tprivate readonly _launchProfile?: Readonly<AgentSessionLaunchProfile>;\n\tprivate _removedOnReplacement?: {\n\t\toldRunner: ExtensionRunner;\n\t\toldIdentities: Array<{ path: string; resolvedPath: string }>;\n\t\treason: SessionShutdownEvent[\"reason\"];\n\t};\n\n\tconstructor(\n\t\t_session: AgentSession,\n\t\t_services: AgentSessionServices,\n\t\tcreateRuntime: CreateAgentSessionRuntimeFactory,\n\t\t_diagnostics: AgentSessionRuntimeDiagnostic[] = [],\n\t\t_modelFallbackMessage?: string,\n\t\tlaunchProfile?: Readonly<AgentSessionLaunchProfile>,\n\t) {\n\t\tthis._session = _session;\n\t\tthis._services = _services;\n\t\tthis.createRuntime = createRuntime;\n\t\tthis._diagnostics = _diagnostics;\n\t\tthis._modelFallbackMessage = _modelFallbackMessage;\n\t\tthis._launchProfile = launchProfile;\n\t}\n\n\tget services(): AgentSessionServices {\n\t\treturn this._services;\n\t}\n\n\tget session(): AgentSession {\n\t\treturn this._session;\n\t}\n\n\tget cwd(): string {\n\t\treturn this._services.cwd;\n\t}\n\n\tget diagnostics(): readonly AgentSessionRuntimeDiagnostic[] {\n\t\treturn this._diagnostics;\n\t}\n\n\tget modelFallbackMessage(): string | undefined {\n\t\treturn this._modelFallbackMessage;\n\t}\n\n\tget launchProfile(): Readonly<AgentSessionLaunchProfile> | undefined {\n\t\treturn this._launchProfile;\n\t}\n\n\tsetRebindSession(rebindSession?: (session: AgentSession) => Promise<void>): void {\n\t\tthis.rebindSession = rebindSession;\n\t}\n\n\t/**\n\t * Set a synchronous callback that runs after `session_shutdown` handlers finish\n\t * but before the current session is invalidated.\n\t *\n\t * This is for host-owned UI teardown that must not yield to the event loop,\n\t * such as detaching extension-provided TUI components before the old extension\n\t * context becomes stale.\n\t */\n\tsetBeforeSessionInvalidate(beforeSessionInvalidate?: () => void): void {\n\t\tthis.beforeSessionInvalidate = beforeSessionInvalidate;\n\t}\n\n\tprivate async emitBeforeSwitch(\n\t\treason: \"new\" | \"resume\",\n\t\ttargetSessionFile?: string,\n\t): Promise<{ cancelled: boolean }> {\n\t\tconst runner = this.session.extensionRunner;\n\t\tif (!runner.hasHandlers(\"session_before_switch\")) {\n\t\t\treturn { cancelled: false };\n\t\t}\n\n\t\tconst result = await runner.emit({\n\t\t\ttype: \"session_before_switch\",\n\t\t\treason,\n\t\t\ttargetSessionFile,\n\t\t});\n\t\treturn { cancelled: result?.cancel === true };\n\t}\n\n\tprivate async emitBeforeFork(\n\t\tentryId: string,\n\t\toptions: { position: \"before\" | \"at\" },\n\t): Promise<{ cancelled: boolean }> {\n\t\tconst runner = this.session.extensionRunner;\n\t\tif (!runner.hasHandlers(\"session_before_fork\")) {\n\t\t\treturn { cancelled: false };\n\t\t}\n\n\t\tconst result = await runner.emit({\n\t\t\ttype: \"session_before_fork\",\n\t\t\tentryId,\n\t\t\t...options,\n\t\t});\n\t\treturn { cancelled: result?.cancel === true };\n\t}\n\n\tprivate async teardownCurrent(reason: SessionShutdownEvent[\"reason\"], targetSessionFile?: string): Promise<void> {\n\t\t// Settle the active response before replacement so the outgoing turn and\n\t\t// any completed tool results are persisted to the old session.\n\t\tawait this.session.abort();\n\t\tconst oldRunner = this.session.extensionRunner;\n\t\t// Test hosts and partial runner implementations may lack identity introspection;\n\t\t// skip removal reporting there rather than break the replacement itself.\n\t\tif (typeof oldRunner.getExtensionIdentities === \"function\") {\n\t\t\tthis._removedOnReplacement = {\n\t\t\t\toldRunner,\n\t\t\t\toldIdentities: oldRunner.getExtensionIdentities(),\n\t\t\t\treason,\n\t\t\t};\n\t\t}\n\t\tawait emitSessionShutdownEvent(oldRunner, {\n\t\t\ttype: \"session_shutdown\",\n\t\t\treason,\n\t\t\ttargetSessionFile,\n\t\t});\n\t\tthis.beforeSessionInvalidate?.();\n\t\tthis.session.dispose();\n\t}\n\n\tprivate async reportRemovedExtensions(): Promise<void> {\n\t\tconst pending = this._removedOnReplacement;\n\t\tthis._removedOnReplacement = undefined;\n\t\tif (!pending) return;\n\t\tconst newRunner = this.session.extensionRunner;\n\t\tif (typeof newRunner.getExtensionIdentities !== \"function\") return;\n\t\tconst newResolvedPaths = new Set(newRunner.getExtensionIdentities().map((extension) => extension.resolvedPath));\n\t\tconst removed = pending.oldIdentities.filter((extension) => !newResolvedPaths.has(extension.resolvedPath));\n\t\tif (removed.length === 0) return;\n\t\tawait pending.oldRunner.emit({ type: \"session_extensions_removed\", reason: pending.reason, removed });\n\t}\n\n\tprivate async apply(result: CreateAgentSessionRuntimeResult): Promise<void> {\n\t\tthis._session = result.session;\n\t\tthis._services = result.services;\n\t\tthis._diagnostics = result.diagnostics;\n\t\tthis._modelFallbackMessage = result.modelFallbackMessage;\n\t\tawait this.reportRemovedExtensions();\n\t}\n\n\tprivate async finishSessionReplacement(withSession?: (ctx: ReplacedSessionContext) => Promise<void>): Promise<void> {\n\t\tif (this.rebindSession) {\n\t\t\tawait this.rebindSession(this.session);\n\t\t}\n\t\tif (withSession) {\n\t\t\tawait withSession(this.session.createReplacedSessionContext());\n\t\t}\n\t}\n\n\tasync switchSession(\n\t\tsessionPath: string,\n\t\toptions?: {\n\t\t\tcwdOverride?: string;\n\t\t\twithSession?: (ctx: ReplacedSessionContext) => Promise<void>;\n\t\t\tprojectTrustContextFactory?: (cwd: string) => ProjectTrustContext;\n\t\t},\n\t): Promise<{ cancelled: boolean }> {\n\t\tconst beforeResult = await this.emitBeforeSwitch(\"resume\", sessionPath);\n\t\tif (beforeResult.cancelled) {\n\t\t\treturn beforeResult;\n\t\t}\n\n\t\tconst previousSessionFile = this.session.sessionFile;\n\t\tconst sessionManager = SessionManager.open(sessionPath, undefined, options?.cwdOverride);\n\t\tassertSessionCwdExists(sessionManager, this.cwd);\n\t\tawait this.teardownCurrent(\"resume\", sessionManager.getSessionFile());\n\t\tawait this.apply(\n\t\t\tawait this.createRuntime({\n\t\t\t\tcwd: sessionManager.getCwd(),\n\t\t\t\tagentDir: this.services.agentDir,\n\t\t\t\tsessionManager,\n\t\t\t\tsessionStartEvent: { type: \"session_start\", reason: \"resume\", previousSessionFile },\n\t\t\t\tprojectTrustContext: options?.projectTrustContextFactory?.(sessionManager.getCwd()),\n\t\t\t\tlaunchProfile: this._launchProfile,\n\t\t\t}),\n\t\t);\n\t\tawait this.finishSessionReplacement(options?.withSession);\n\t\treturn { cancelled: false };\n\t}\n\n\tasync newSession(options?: {\n\t\tparentSession?: string;\n\t\tsetup?: (sessionManager: SessionManager) => Promise<void>;\n\t\twithSession?: (ctx: ReplacedSessionContext) => Promise<void>;\n\t}): Promise<{ cancelled: boolean }> {\n\t\tconst beforeResult = await this.emitBeforeSwitch(\"new\");\n\t\tif (beforeResult.cancelled) {\n\t\t\treturn beforeResult;\n\t\t}\n\n\t\tconst previousSessionFile = this.session.sessionFile;\n\t\tconst sessionDir = this.session.sessionManager.getSessionDir();\n\t\tconst sessionManager = this.session.sessionManager.isPersisted()\n\t\t\t? SessionManager.create(this.cwd, sessionDir)\n\t\t\t: SessionManager.inMemory(this.cwd);\n\t\tif (options?.parentSession) {\n\t\t\tsessionManager.newSession({ parentSession: options.parentSession });\n\t\t}\n\n\t\tawait this.teardownCurrent(\"new\", sessionManager.getSessionFile());\n\t\tawait this.apply(\n\t\t\tawait this.createRuntime({\n\t\t\t\tcwd: this.cwd,\n\t\t\t\tagentDir: this.services.agentDir,\n\t\t\t\tsessionManager,\n\t\t\t\tsessionStartEvent: { type: \"session_start\", reason: \"new\", previousSessionFile },\n\t\t\t\tlaunchProfile: this._launchProfile,\n\t\t\t}),\n\t\t);\n\t\tif (options?.setup) {\n\t\t\tawait options.setup(this.session.sessionManager);\n\t\t\tthis.session.agent.state.messages = this.session.sessionManager.buildSessionContext().messages;\n\t\t}\n\t\tawait this.finishSessionReplacement(options?.withSession);\n\t\treturn { cancelled: false };\n\t}\n\n\tasync fork(\n\t\tentryId: string,\n\t\toptions?: { position?: \"before\" | \"at\"; withSession?: (ctx: ReplacedSessionContext) => Promise<void> },\n\t): Promise<{ cancelled: boolean; selectedText?: string }> {\n\t\tconst position = options?.position ?? \"before\";\n\t\tconst beforeResult = await this.emitBeforeFork(entryId, { position });\n\t\tif (beforeResult.cancelled) {\n\t\t\treturn { cancelled: true };\n\t\t}\n\t\tlet targetLeafId: string | null;\n\t\tlet selectedText: string | undefined;\n\n\t\tconst selectedEntry = this.session.sessionManager.getEntry(entryId);\n\t\tif (!selectedEntry) {\n\t\t\tthrow new Error(\"Invalid entry ID for forking\");\n\t\t}\n\n\t\tif (position === \"at\") {\n\t\t\ttargetLeafId = selectedEntry.id;\n\t\t} else {\n\t\t\tif (selectedEntry.type !== \"message\" || selectedEntry.message.role !== \"user\") {\n\t\t\t\tthrow new Error(\"Invalid entry ID for forking\");\n\t\t\t}\n\t\t\ttargetLeafId = selectedEntry.parentId;\n\t\t\tselectedText = extractUserMessageText(selectedEntry.message.content);\n\t\t}\n\n\t\tconst previousSessionFile = this.session.sessionFile;\n\t\tif (this.session.sessionManager.isPersisted()) {\n\t\t\tconst currentSessionFile = this.session.sessionFile;\n\t\t\tif (!currentSessionFile) {\n\t\t\t\tthrow new Error(\"Persisted session is missing a session file\");\n\t\t\t}\n\t\t\tconst sessionDir = this.session.sessionManager.getSessionDir();\n\t\t\tif (!targetLeafId) {\n\t\t\t\tconst sessionManager = SessionManager.create(this.cwd, sessionDir);\n\t\t\t\tsessionManager.newSession({ parentSession: currentSessionFile });\n\t\t\t\tawait this.teardownCurrent(\"fork\", sessionManager.getSessionFile());\n\t\t\t\tawait this.apply(\n\t\t\t\t\tawait this.createRuntime({\n\t\t\t\t\t\tcwd: this.cwd,\n\t\t\t\t\t\tagentDir: this.services.agentDir,\n\t\t\t\t\t\tsessionManager,\n\t\t\t\t\t\tsessionStartEvent: { type: \"session_start\", reason: \"fork\", previousSessionFile },\n\t\t\t\t\t\tlaunchProfile: this._launchProfile,\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\tawait this.finishSessionReplacement(options?.withSession);\n\t\t\t\treturn { cancelled: false, selectedText };\n\t\t\t}\n\n\t\t\tif (!existsSync(currentSessionFile)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"This session has not been saved yet. Wait for the first assistant response before cloning or forking it.\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst sessionManager = SessionManager.open(currentSessionFile, sessionDir);\n\t\t\tconst forkedSessionPath = sessionManager.createBranchedSession(targetLeafId);\n\t\t\tif (!forkedSessionPath) {\n\t\t\t\tthrow new Error(\"Failed to create forked session\");\n\t\t\t}\n\t\t\tawait this.teardownCurrent(\"fork\", sessionManager.getSessionFile());\n\t\t\tawait this.apply(\n\t\t\t\tawait this.createRuntime({\n\t\t\t\t\tcwd: sessionManager.getCwd(),\n\t\t\t\t\tagentDir: this.services.agentDir,\n\t\t\t\t\tsessionManager,\n\t\t\t\t\tsessionStartEvent: { type: \"session_start\", reason: \"fork\", previousSessionFile },\n\t\t\t\t\tlaunchProfile: this._launchProfile,\n\t\t\t\t}),\n\t\t\t);\n\t\t\tawait this.finishSessionReplacement(options?.withSession);\n\t\t\treturn { cancelled: false, selectedText };\n\t\t}\n\n\t\tconst sessionManager = this.session.sessionManager;\n\t\tif (!targetLeafId) {\n\t\t\tsessionManager.newSession({ parentSession: this.session.sessionFile });\n\t\t} else {\n\t\t\tsessionManager.createBranchedSession(targetLeafId);\n\t\t}\n\t\tawait this.teardownCurrent(\"fork\", sessionManager.getSessionFile());\n\t\tawait this.apply(\n\t\t\tawait this.createRuntime({\n\t\t\t\tcwd: this.cwd,\n\t\t\t\tagentDir: this.services.agentDir,\n\t\t\t\tsessionManager,\n\t\t\t\tsessionStartEvent: { type: \"session_start\", reason: \"fork\", previousSessionFile },\n\t\t\t\tlaunchProfile: this._launchProfile,\n\t\t\t}),\n\t\t);\n\t\tawait this.finishSessionReplacement(options?.withSession);\n\t\treturn { cancelled: false, selectedText };\n\t}\n\n\t/**\n\t * Import a session JSONL file and switch runtime state to the imported session.\n\t *\n\t * @returns `{ cancelled: true }` when cancelled by `session_before_switch`, otherwise `{ cancelled: false }`.\n\t * @throws {SessionImportFileNotFoundError} When the input path does not exist.\n\t * @throws {MissingSessionCwdError} When the imported session cwd cannot be resolved and no override is provided.\n\t */\n\tasync importFromJsonl(inputPath: string, cwdOverride?: string): Promise<{ cancelled: boolean }> {\n\t\tconst resolvedPath = resolvePath(inputPath);\n\t\tif (!existsSync(resolvedPath)) {\n\t\t\tthrow new SessionImportFileNotFoundError(resolvedPath);\n\t\t}\n\n\t\tconst sessionDir = this.session.sessionManager.getSessionDir();\n\t\tif (!existsSync(sessionDir)) {\n\t\t\tmkdirSync(sessionDir, { recursive: true });\n\t\t}\n\n\t\tconst destinationPath = join(sessionDir, basename(resolvedPath));\n\t\tconst beforeResult = await this.emitBeforeSwitch(\"resume\", destinationPath);\n\t\tif (beforeResult.cancelled) {\n\t\t\treturn beforeResult;\n\t\t}\n\n\t\tconst previousSessionFile = this.session.sessionFile;\n\t\tif (resolve(destinationPath) !== resolvedPath) {\n\t\t\tcopyFileSync(resolvedPath, destinationPath);\n\t\t}\n\n\t\tconst sessionManager = SessionManager.open(destinationPath, sessionDir, cwdOverride);\n\t\tassertSessionCwdExists(sessionManager, this.cwd);\n\t\tawait this.teardownCurrent(\"resume\", sessionManager.getSessionFile());\n\t\tawait this.apply(\n\t\t\tawait this.createRuntime({\n\t\t\t\tcwd: sessionManager.getCwd(),\n\t\t\t\tagentDir: this.services.agentDir,\n\t\t\t\tsessionManager,\n\t\t\t\tsessionStartEvent: { type: \"session_start\", reason: \"resume\", previousSessionFile },\n\t\t\t\tlaunchProfile: this._launchProfile,\n\t\t\t}),\n\t\t);\n\t\tawait this.finishSessionReplacement();\n\t\treturn { cancelled: false };\n\t}\n\n\tasync dispose(): Promise<void> {\n\t\tawait emitSessionShutdownEvent(this.session.extensionRunner, {\n\t\t\ttype: \"session_shutdown\",\n\t\t\treason: \"quit\",\n\t\t});\n\t\tthis.beforeSessionInvalidate?.();\n\t\tthis.session.dispose();\n\t}\n}\n\n/**\n * Create the initial runtime from a runtime factory and initial session target.\n *\n * The same factory is stored on the returned AgentSessionRuntime and reused for\n * later /new, /resume, /fork, and import flows.\n */\nexport async function createAgentSessionRuntime(\n\tcreateRuntime: CreateAgentSessionRuntimeFactory,\n\toptions: {\n\t\tcwd: string;\n\t\tagentDir: string;\n\t\tsessionManager: SessionManager;\n\t\tsessionStartEvent?: SessionStartEvent;\n\t\tlaunchProfile?: Readonly<AgentSessionLaunchProfile>;\n\t},\n): Promise<AgentSessionRuntime> {\n\tassertSessionCwdExists(options.sessionManager, options.cwd);\n\tconst result = await createRuntime(options);\n\treturn new AgentSessionRuntime(\n\t\tresult.session,\n\t\tresult.services,\n\t\tcreateRuntime,\n\t\tresult.diagnostics,\n\t\tresult.modelFallbackMessage,\n\t\toptions.launchProfile,\n\t);\n}\n\nexport {\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionServices,\n\ttype CreateAgentSessionFromServicesOptions,\n\ttype CreateAgentSessionServicesOptions,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionServices,\n} from \"./agent-session-services.ts\";\n"]}
|
|
1
|
+
{"version":3,"file":"agent-session-runtime.js","sourceRoot":"","sources":["../../src/core/agent-session-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD,OAAO,EAAwB,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAExF,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAqCtD;;GAEG;AACH,MAAM,OAAO,8BAA+B,SAAQ,KAAK;IAGxD,YAAY,QAAgB;QAC3B,KAAK,CAAC,mBAAmB,QAAQ,EAAE,CAAC,CAAC;QACrC,IAAI,CAAC,IAAI,GAAG,gCAAgC,CAAC;QAC7C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC1B,CAAC;CACD;AAED,SAAS,sBAAsB,CAAC,OAAwD;IACvF,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QACjC,OAAO,OAAO,CAAC;IAChB,CAAC;IAED,OAAO,OAAO;SACZ,MAAM,CAAC,CAAC,IAAI,EAA0C,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC;SAC/G,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,C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E,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5D,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,CAAC;IAC5C,OAAO,IAAI,mBAAmB,CAC7B,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,QAAQ,EACf,aAAa,EACb,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,oBAAoB,EAC3B,OAAO,CAAC,aAAa,CACrB,CAAC;AACH,CAAC;AAED,OAAO,EAKN,8BAA8B,EAC9B,0BAA0B,GAC1B,MAAM,6BAA6B,CAAC","sourcesContent":["import { copyFileSync, existsSync, mkdirSync } from \"node:fs\";\nimport { basename, join, resolve } from \"node:path\";\nimport { resolvePath } from \"../utils/paths.ts\";\nimport type { AgentSession } from \"./agent-session.ts\";\nimport type { AgentSessionRuntimeDiagnostic, AgentSessionServices } from \"./agent-session-services.ts\";\nimport type {\n\tProjectTrustContext,\n\tReplacedSessionContext,\n\tSessionShutdownEvent,\n\tSessionStartEvent,\n} from \"./extensions/index.ts\";\nimport { type ExtensionRunner, emitSessionShutdownEvent } from \"./extensions/runner.ts\";\nimport type { CreateAgentSessionResult } from \"./sdk.ts\";\nimport { assertSessionCwdExists } from \"./session-cwd.ts\";\nimport { SessionManager } from \"./session-manager.ts\";\n\n/**\n * Result returned by runtime creation.\n *\n * The caller gets the created session, its cwd-bound services, and all\n * diagnostics collected during setup.\n */\nexport interface CreateAgentSessionRuntimeResult extends CreateAgentSessionResult {\n\tservices: AgentSessionServices;\n\tdiagnostics: AgentSessionRuntimeDiagnostic[];\n}\n\n/** Immutable flags selected when a runtime is first launched. */\nexport interface AgentSessionLaunchProfile {\n\tcwd: string;\n\tpermissionPreset?: string;\n\tcreationModel?: { provider: string; modelId: string };\n\tinitialThinkingLevel?: string;\n}\n\n/**\n * Creates a full runtime for a target cwd and session manager.\n *\n * The factory closes over process-global fixed inputs, recreates cwd-bound\n * services for the effective cwd, resolves session options against those\n * services, and finally creates the AgentSession.\n */\nexport type CreateAgentSessionRuntimeFactory = (options: {\n\tcwd: string;\n\tagentDir: string;\n\tsessionManager: SessionManager;\n\tsessionStartEvent?: SessionStartEvent;\n\tprojectTrustContext?: ProjectTrustContext;\n\tlaunchProfile?: Readonly<AgentSessionLaunchProfile>;\n}) => Promise<CreateAgentSessionRuntimeResult>;\n\n/**\n * Thrown when /import references a JSONL file path that does not exist.\n */\nexport class SessionImportFileNotFoundError extends Error {\n\treadonly filePath: string;\n\n\tconstructor(filePath: string) {\n\t\tsuper(`File not found: ${filePath}`);\n\t\tthis.name = \"SessionImportFileNotFoundError\";\n\t\tthis.filePath = filePath;\n\t}\n}\n\nfunction extractUserMessageText(content: string | Array<{ type: string; text?: string }>): string {\n\tif (typeof content === \"string\") {\n\t\treturn content;\n\t}\n\n\treturn content\n\t\t.filter((part): part is { type: \"text\"; text: string } => part.type === \"text\" && typeof part.text === \"string\")\n\t\t.map((part) => part.text)\n\t\t.join(\"\");\n}\n\n/**\n * Owns the current AgentSession plus its cwd-bound services.\n *\n * Session replacement methods tear down the current runtime first, then create\n * and apply the next runtime. If creation fails, the error is propagated to the\n * caller. The caller is responsible for user-facing error handling.\n */\nexport class AgentSessionRuntime {\n\tprivate rebindSession?: (session: AgentSession) => Promise<void>;\n\tprivate beforeSessionInvalidate?: () => void;\n\tprivate _session: AgentSession;\n\tprivate _services: AgentSessionServices;\n\tprivate readonly createRuntime: CreateAgentSessionRuntimeFactory;\n\tprivate _diagnostics: AgentSessionRuntimeDiagnostic[];\n\tprivate _modelFallbackMessage?: string;\n\tprivate readonly _launchProfile?: Readonly<AgentSessionLaunchProfile>;\n\tprivate _removedOnReplacement?: {\n\t\toldRunner: ExtensionRunner;\n\t\toldIdentities: Array<{ path: string; resolvedPath: string }>;\n\t\treason: SessionShutdownEvent[\"reason\"];\n\t};\n\n\tconstructor(\n\t\t_session: AgentSession,\n\t\t_services: AgentSessionServices,\n\t\tcreateRuntime: CreateAgentSessionRuntimeFactory,\n\t\t_diagnostics: AgentSessionRuntimeDiagnostic[] = [],\n\t\t_modelFallbackMessage?: string,\n\t\tlaunchProfile?: Readonly<AgentSessionLaunchProfile>,\n\t) {\n\t\tthis._session = _session;\n\t\tthis._services = _services;\n\t\tthis.createRuntime = createRuntime;\n\t\tthis._diagnostics = _diagnostics;\n\t\tthis._modelFallbackMessage = _modelFallbackMessage;\n\t\tthis._launchProfile = launchProfile;\n\t}\n\n\tget services(): AgentSessionServices {\n\t\treturn this._services;\n\t}\n\n\tget session(): AgentSession {\n\t\treturn this._session;\n\t}\n\n\tget cwd(): string {\n\t\treturn this._services.cwd;\n\t}\n\n\tget diagnostics(): readonly AgentSessionRuntimeDiagnostic[] {\n\t\treturn this._diagnostics;\n\t}\n\n\tget modelFallbackMessage(): string | undefined {\n\t\treturn this._modelFallbackMessage;\n\t}\n\n\tget launchProfile(): Readonly<AgentSessionLaunchProfile> | undefined {\n\t\treturn this._launchProfile;\n\t}\n\n\tsetRebindSession(rebindSession?: (session: AgentSession) => Promise<void>): void {\n\t\tthis.rebindSession = rebindSession;\n\t}\n\n\t/**\n\t * Set a synchronous callback that runs after `session_shutdown` handlers finish\n\t * but before the current session is invalidated.\n\t *\n\t * This is for host-owned UI teardown that must not yield to the event loop,\n\t * such as detaching extension-provided TUI components before the old extension\n\t * context becomes stale.\n\t */\n\tsetBeforeSessionInvalidate(beforeSessionInvalidate?: () => void): void {\n\t\tthis.beforeSessionInvalidate = beforeSessionInvalidate;\n\t}\n\n\tprivate async emitBeforeSwitch(\n\t\treason: \"new\" | \"resume\",\n\t\ttargetSessionFile?: string,\n\t): Promise<{ cancelled: boolean }> {\n\t\tconst runner = this.session.extensionRunner;\n\t\tif (!runner.hasHandlers(\"session_before_switch\")) {\n\t\t\treturn { cancelled: false };\n\t\t}\n\n\t\tconst result = await runner.emit({\n\t\t\ttype: \"session_before_switch\",\n\t\t\treason,\n\t\t\ttargetSessionFile,\n\t\t});\n\t\treturn { cancelled: result?.cancel === true };\n\t}\n\n\tprivate async emitBeforeFork(\n\t\tentryId: string,\n\t\toptions: { position: \"before\" | \"at\" },\n\t): Promise<{ cancelled: boolean }> {\n\t\tconst runner = this.session.extensionRunner;\n\t\tif (!runner.hasHandlers(\"session_before_fork\")) {\n\t\t\treturn { cancelled: false };\n\t\t}\n\n\t\tconst result = await runner.emit({\n\t\t\ttype: \"session_before_fork\",\n\t\t\tentryId,\n\t\t\t...options,\n\t\t});\n\t\treturn { cancelled: result?.cancel === true };\n\t}\n\n\tprivate async teardownCurrent(reason: SessionShutdownEvent[\"reason\"], targetSessionFile?: string): Promise<void> {\n\t\t// Settle the active response before replacement so the outgoing turn and\n\t\t// any completed tool results are persisted to the old session.\n\t\tawait this.session.abort();\n\t\tconst oldRunner = this.session.extensionRunner;\n\t\t// Test hosts and partial runner implementations may lack identity introspection;\n\t\t// skip removal reporting there rather than break the replacement itself.\n\t\tif (typeof oldRunner.getExtensionIdentities === \"function\") {\n\t\t\tthis._removedOnReplacement = {\n\t\t\t\toldRunner,\n\t\t\t\toldIdentities: oldRunner.getExtensionIdentities(),\n\t\t\t\treason,\n\t\t\t};\n\t\t}\n\t\tawait emitSessionShutdownEvent(oldRunner, {\n\t\t\ttype: \"session_shutdown\",\n\t\t\treason,\n\t\t\ttargetSessionFile,\n\t\t});\n\t\tthis.beforeSessionInvalidate?.();\n\t\tthis.session.dispose();\n\t}\n\n\tprivate async reportRemovedExtensions(): Promise<void> {\n\t\tconst pending = this._removedOnReplacement;\n\t\tthis._removedOnReplacement = undefined;\n\t\tif (!pending) return;\n\t\tconst newRunner = this.session.extensionRunner;\n\t\tif (typeof newRunner.getExtensionIdentities !== \"function\") return;\n\t\tconst newResolvedPaths = new Set(newRunner.getExtensionIdentities().map((extension) => extension.resolvedPath));\n\t\tconst removed = pending.oldIdentities.filter((extension) => !newResolvedPaths.has(extension.resolvedPath));\n\t\tif (removed.length === 0) return;\n\t\tawait pending.oldRunner.emit({ type: \"session_extensions_removed\", reason: pending.reason, removed });\n\t}\n\n\tprivate async apply(result: CreateAgentSessionRuntimeResult): Promise<void> {\n\t\tthis._session = result.session;\n\t\tthis._services = result.services;\n\t\tthis._diagnostics = result.diagnostics;\n\t\tthis._modelFallbackMessage = result.modelFallbackMessage;\n\t\tawait this.reportRemovedExtensions();\n\t}\n\n\tprivate async finishSessionReplacement(withSession?: (ctx: ReplacedSessionContext) => Promise<void>): Promise<void> {\n\t\tif (this.rebindSession) {\n\t\t\tawait this.rebindSession(this.session);\n\t\t}\n\t\tif (withSession) {\n\t\t\tawait withSession(this.session.createReplacedSessionContext());\n\t\t}\n\t}\n\n\tasync switchSession(\n\t\tsessionPath: string,\n\t\toptions?: {\n\t\t\tcwdOverride?: string;\n\t\t\twithSession?: (ctx: ReplacedSessionContext) => Promise<void>;\n\t\t\tprojectTrustContextFactory?: (cwd: string) => ProjectTrustContext;\n\t\t},\n\t): Promise<{ cancelled: boolean }> {\n\t\tconst beforeResult = await this.emitBeforeSwitch(\"resume\", sessionPath);\n\t\tif (beforeResult.cancelled) {\n\t\t\treturn beforeResult;\n\t\t}\n\n\t\tconst previousSessionFile = this.session.sessionFile;\n\t\tconst sessionManager = SessionManager.open(sessionPath, undefined, options?.cwdOverride);\n\t\tassertSessionCwdExists(sessionManager, this.cwd);\n\t\tawait this.teardownCurrent(\"resume\", sessionManager.getSessionFile());\n\t\tawait this.apply(\n\t\t\tawait this.createRuntime({\n\t\t\t\tcwd: sessionManager.getCwd(),\n\t\t\t\tagentDir: this.services.agentDir,\n\t\t\t\tsessionManager,\n\t\t\t\tsessionStartEvent: { type: \"session_start\", reason: \"resume\", previousSessionFile },\n\t\t\t\tprojectTrustContext: options?.projectTrustContextFactory?.(sessionManager.getCwd()),\n\t\t\t\tlaunchProfile: this._launchProfile,\n\t\t\t}),\n\t\t);\n\t\tawait this.finishSessionReplacement(options?.withSession);\n\t\treturn { cancelled: false };\n\t}\n\n\tasync newSession(options?: {\n\t\tparentSession?: string;\n\t\tsetup?: (sessionManager: SessionManager) => Promise<void>;\n\t\twithSession?: (ctx: ReplacedSessionContext) => Promise<void>;\n\t}): Promise<{ cancelled: boolean }> {\n\t\tconst beforeResult = await this.emitBeforeSwitch(\"new\");\n\t\tif (beforeResult.cancelled) {\n\t\t\treturn beforeResult;\n\t\t}\n\n\t\tconst previousSessionFile = this.session.sessionFile;\n\t\tconst sessionDir = this.session.sessionManager.getSessionDir();\n\t\tconst sessionManager = this.session.sessionManager.isPersisted()\n\t\t\t? SessionManager.create(this.cwd, sessionDir)\n\t\t\t: SessionManager.inMemory(this.cwd);\n\t\tif (options?.parentSession) {\n\t\t\tsessionManager.newSession({ parentSession: options.parentSession });\n\t\t}\n\n\t\tawait this.teardownCurrent(\"new\", sessionManager.getSessionFile());\n\t\tawait this.apply(\n\t\t\tawait this.createRuntime({\n\t\t\t\tcwd: this.cwd,\n\t\t\t\tagentDir: this.services.agentDir,\n\t\t\t\tsessionManager,\n\t\t\t\tsessionStartEvent: { type: \"session_start\", reason: \"new\", previousSessionFile },\n\t\t\t\tlaunchProfile: this._launchProfile,\n\t\t\t}),\n\t\t);\n\t\tif (options?.setup) {\n\t\t\tawait options.setup(this.session.sessionManager);\n\t\t\tthis.session.agent.state.messages = this.session.sessionManager.buildSessionContext().messages;\n\t\t}\n\t\tawait this.finishSessionReplacement(options?.withSession);\n\t\treturn { cancelled: false };\n\t}\n\n\tasync fork(\n\t\tentryId: string,\n\t\toptions?: { position?: \"before\" | \"at\"; withSession?: (ctx: ReplacedSessionContext) => Promise<void> },\n\t): Promise<{ cancelled: boolean; selectedText?: string }> {\n\t\tconst position = options?.position ?? \"before\";\n\t\tconst beforeResult = await this.emitBeforeFork(entryId, { position });\n\t\tif (beforeResult.cancelled) {\n\t\t\treturn { cancelled: true };\n\t\t}\n\t\tlet targetLeafId: string | null;\n\t\tlet selectedText: string | undefined;\n\n\t\tconst selectedEntry = this.session.sessionManager.getEntry(entryId);\n\t\tif (!selectedEntry) {\n\t\t\tthrow new Error(\"Invalid entry ID for forking\");\n\t\t}\n\n\t\tif (position === \"at\") {\n\t\t\ttargetLeafId = selectedEntry.id;\n\t\t} else {\n\t\t\tif (selectedEntry.type !== \"message\" || selectedEntry.message.role !== \"user\") {\n\t\t\t\tthrow new Error(\"Invalid entry ID for forking\");\n\t\t\t}\n\t\t\ttargetLeafId = selectedEntry.parentId;\n\t\t\tselectedText = extractUserMessageText(selectedEntry.message.content);\n\t\t}\n\n\t\tconst previousSessionFile = this.session.sessionFile;\n\t\tif (this.session.sessionManager.isPersisted()) {\n\t\t\tconst currentSessionFile = this.session.sessionFile;\n\t\t\tif (!currentSessionFile) {\n\t\t\t\tthrow new Error(\"Persisted session is missing a session file\");\n\t\t\t}\n\t\t\tconst sessionDir = this.session.sessionManager.getSessionDir();\n\t\t\tif (!targetLeafId) {\n\t\t\t\tconst sessionManager = SessionManager.create(this.cwd, sessionDir);\n\t\t\t\tsessionManager.newSession({ parentSession: currentSessionFile });\n\t\t\t\tawait this.teardownCurrent(\"fork\", sessionManager.getSessionFile());\n\t\t\t\tawait this.apply(\n\t\t\t\t\tawait this.createRuntime({\n\t\t\t\t\t\tcwd: this.cwd,\n\t\t\t\t\t\tagentDir: this.services.agentDir,\n\t\t\t\t\t\tsessionManager,\n\t\t\t\t\t\tsessionStartEvent: { type: \"session_start\", reason: \"fork\", previousSessionFile },\n\t\t\t\t\t\tlaunchProfile: this._launchProfile,\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\tawait this.finishSessionReplacement(options?.withSession);\n\t\t\t\treturn { cancelled: false, selectedText };\n\t\t\t}\n\n\t\t\tif (!existsSync(currentSessionFile)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"This session has not been saved yet. Wait for the first assistant response before cloning or forking it.\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst sessionManager = SessionManager.open(currentSessionFile, sessionDir);\n\t\t\tconst forkedSessionPath = sessionManager.createBranchedSession(targetLeafId);\n\t\t\tif (!forkedSessionPath) {\n\t\t\t\tthrow new Error(\"Failed to create forked session\");\n\t\t\t}\n\t\t\tawait this.teardownCurrent(\"fork\", sessionManager.getSessionFile());\n\t\t\tawait this.apply(\n\t\t\t\tawait this.createRuntime({\n\t\t\t\t\tcwd: sessionManager.getCwd(),\n\t\t\t\t\tagentDir: this.services.agentDir,\n\t\t\t\t\tsessionManager,\n\t\t\t\t\tsessionStartEvent: { type: \"session_start\", reason: \"fork\", previousSessionFile },\n\t\t\t\t\tlaunchProfile: this._launchProfile,\n\t\t\t\t}),\n\t\t\t);\n\t\t\tawait this.finishSessionReplacement(options?.withSession);\n\t\t\treturn { cancelled: false, selectedText };\n\t\t}\n\n\t\tconst sessionManager = this.session.sessionManager;\n\t\tawait this.teardownCurrent(\"fork\", sessionManager.getSessionFile());\n\t\tif (!targetLeafId) {\n\t\t\tsessionManager.newSession({ parentSession: previousSessionFile });\n\t\t} else {\n\t\t\tsessionManager.createBranchedSession(targetLeafId);\n\t\t}\n\t\tawait this.apply(\n\t\t\tawait this.createRuntime({\n\t\t\t\tcwd: this.cwd,\n\t\t\t\tagentDir: this.services.agentDir,\n\t\t\t\tsessionManager,\n\t\t\t\tsessionStartEvent: { type: \"session_start\", reason: \"fork\", previousSessionFile },\n\t\t\t\tlaunchProfile: this._launchProfile,\n\t\t\t}),\n\t\t);\n\t\tawait this.finishSessionReplacement(options?.withSession);\n\t\treturn { cancelled: false, selectedText };\n\t}\n\n\t/**\n\t * Import a session JSONL file and switch runtime state to the imported session.\n\t *\n\t * @returns `{ cancelled: true }` when cancelled by `session_before_switch`, otherwise `{ cancelled: false }`.\n\t * @throws {SessionImportFileNotFoundError} When the input path does not exist.\n\t * @throws {MissingSessionCwdError} When the imported session cwd cannot be resolved and no override is provided.\n\t */\n\tasync importFromJsonl(inputPath: string, cwdOverride?: string): Promise<{ cancelled: boolean }> {\n\t\tconst resolvedPath = resolvePath(inputPath);\n\t\tif (!existsSync(resolvedPath)) {\n\t\t\tthrow new SessionImportFileNotFoundError(resolvedPath);\n\t\t}\n\n\t\tconst sessionDir = this.session.sessionManager.getSessionDir();\n\t\tif (!existsSync(sessionDir)) {\n\t\t\tmkdirSync(sessionDir, { recursive: true });\n\t\t}\n\n\t\tconst destinationPath = join(sessionDir, basename(resolvedPath));\n\t\tconst beforeResult = await this.emitBeforeSwitch(\"resume\", destinationPath);\n\t\tif (beforeResult.cancelled) {\n\t\t\treturn beforeResult;\n\t\t}\n\n\t\tconst previousSessionFile = this.session.sessionFile;\n\t\tif (resolve(destinationPath) !== resolvedPath) {\n\t\t\tcopyFileSync(resolvedPath, destinationPath);\n\t\t}\n\n\t\tconst sessionManager = SessionManager.open(destinationPath, sessionDir, cwdOverride);\n\t\tassertSessionCwdExists(sessionManager, this.cwd);\n\t\tawait this.teardownCurrent(\"resume\", sessionManager.getSessionFile());\n\t\tawait this.apply(\n\t\t\tawait this.createRuntime({\n\t\t\t\tcwd: sessionManager.getCwd(),\n\t\t\t\tagentDir: this.services.agentDir,\n\t\t\t\tsessionManager,\n\t\t\t\tsessionStartEvent: { type: \"session_start\", reason: \"resume\", previousSessionFile },\n\t\t\t\tlaunchProfile: this._launchProfile,\n\t\t\t}),\n\t\t);\n\t\tawait this.finishSessionReplacement();\n\t\treturn { cancelled: false };\n\t}\n\n\tasync dispose(): Promise<void> {\n\t\tawait emitSessionShutdownEvent(this.session.extensionRunner, {\n\t\t\ttype: \"session_shutdown\",\n\t\t\treason: \"quit\",\n\t\t});\n\t\tthis.beforeSessionInvalidate?.();\n\t\tthis.session.dispose();\n\t}\n}\n\n/**\n * Create the initial runtime from a runtime factory and initial session target.\n *\n * The same factory is stored on the returned AgentSessionRuntime and reused for\n * later /new, /resume, /fork, and import flows.\n */\nexport async function createAgentSessionRuntime(\n\tcreateRuntime: CreateAgentSessionRuntimeFactory,\n\toptions: {\n\t\tcwd: string;\n\t\tagentDir: string;\n\t\tsessionManager: SessionManager;\n\t\tsessionStartEvent?: SessionStartEvent;\n\t\tlaunchProfile?: Readonly<AgentSessionLaunchProfile>;\n\t},\n): Promise<AgentSessionRuntime> {\n\tassertSessionCwdExists(options.sessionManager, options.cwd);\n\tconst result = await createRuntime(options);\n\treturn new AgentSessionRuntime(\n\t\tresult.session,\n\t\tresult.services,\n\t\tcreateRuntime,\n\t\tresult.diagnostics,\n\t\tresult.modelFallbackMessage,\n\t\toptions.launchProfile,\n\t);\n}\n\nexport {\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionServices,\n\ttype CreateAgentSessionFromServicesOptions,\n\ttype CreateAgentSessionServicesOptions,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionServices,\n} from \"./agent-session-services.ts\";\n"]}
|
|
@@ -485,7 +485,7 @@ export declare class AgentSession {
|
|
|
485
485
|
private _initialActiveToolNames?;
|
|
486
486
|
private _defaultToolNames?;
|
|
487
487
|
private _evalOnlyToolNames?;
|
|
488
|
-
/** Explicit config override; when supplied it wins over the
|
|
488
|
+
/** Explicit config override; when supplied it wins over the fixed policy across reloads. */
|
|
489
489
|
private readonly _evalOnlyToolNamesOverride?;
|
|
490
490
|
/** Policy tools withheld from the model, retained so disarming can restore direct access. */
|
|
491
491
|
private readonly _withheldEvalOnlyToolNames;
|
|
@@ -748,10 +748,7 @@ export declare class AgentSession {
|
|
|
748
748
|
*/
|
|
749
749
|
private _activateLazyTool;
|
|
750
750
|
private _isEvalOnlyPolicyArmed;
|
|
751
|
-
/**
|
|
752
|
-
* Resolve the eval-only policy from settings so a reload picks up a flag change.
|
|
753
|
-
* An explicitly configured set stays authoritative for SDK embedders and tests.
|
|
754
|
-
*/
|
|
751
|
+
/** Resolve the fixed eval-only policy, unless an SDK embedder supplied an override. */
|
|
755
752
|
private _resolveEvalOnlyToolNames;
|
|
756
753
|
/**
|
|
757
754
|
* Publish per-tool eval-only redirect hints so a direct call names its own eval helper.
|