@code-yeongyu/senpi 2026.9.3 → 2026.9.4-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +141 -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/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/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/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/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/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/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 +5 -2
- package/dist/core/extensions/builtin/terminal/extension.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/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/native-search.d.ts +1 -1
- package/dist/core/extensions/builtin/tool-search/native-search.d.ts.map +1 -1
- package/dist/core/extensions/builtin/tool-search/native-search.js +1 -1
- package/dist/core/extensions/builtin/tool-search/native-search.js.map +1 -1
- 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/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/settings-manager.d.ts +5 -5
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +34 -6
- 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/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/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 +57 -0
- package/node_modules/@code-yeongyu/senpi-codemode/README.md +2 -0
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
- 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 +33 -91
- 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/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/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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-capability.js","sourceRoot":"","sources":["../../../src/modes/rpc/custom-capability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAGtC,oFAAoF;AACpF,MAAM,CAAC,MAAM,6BAA6B,GAAG,oBAAoB,CAAC;AAClE,MAAM,CAAC,MAAM,2BAA2B,GAAG,kBAAkB,CAAC;AAC9D,MAAM,CAAC,MAAM,8BAA8B,GAAG,qBAAqB,CAAC;AACpE,MAAM,CAAC,MAAM,8BAA8B,GAAG,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"custom-capability.js","sourceRoot":"","sources":["../../../src/modes/rpc/custom-capability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAGtC,oFAAoF;AACpF,MAAM,CAAC,MAAM,6BAA6B,GAAG,oBAAoB,CAAC;AAClE,MAAM,CAAC,MAAM,2BAA2B,GAAG,kBAAkB,CAAC;AAC9D,MAAM,CAAC,MAAM,8BAA8B,GAAG,qBAAqB,CAAC;AACpE,MAAM,CAAC,MAAM,8BAA8B,GAAG,qBAAqB,CAAC;AACpE;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,oBAAoB,CAAC;AAElE;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,+BAA+B,CAAC;AAE3E,4EAA4E;AAC5E,MAAM,UAAU,uBAAuB,CAAC,KAAyB;IAChE,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IACtB,OAAO,KAAK;SACV,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC1B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACrC,CAAC;AAED,6EAA6E;AAC7E,MAAM,CAAC,MAAM,8BAA8B,GAAG,qBAAqB,CAAC;AAEpE;;;;;;GAMG;AACH,MAAM,UAAU,6BAA6B,CAC5C,YAA2C,EAC3C,aAAqB;IAErB,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,6BAA6B,CAAC,EAAE,CAAC;QAC5D,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,EAAE,IAAI,8BAA8B,CAAC;IACpE,OAAO;QACN,IAAI,EAAE,sBAAsB;QAC5B,EAAE,EAAE,MAAM,CAAC,UAAU,EAAE;QACvB,MAAM,EAAE,oBAAoB;QAC5B,aAAa,EAAE,IAAI;KACnB,CAAC;AACH,CAAC","sourcesContent":["/**\n * The `custom_unsupported` capability gate (plan tasks 13/14).\n *\n * In RPC mode `ctx.ui.custom` cannot render a third-party component — there is no\n * TUI to render it FROM. Historically it returned `undefined` synchronously with\n * NO wire message, so a default RPC client saw nothing at all. A client that\n * can present a native \"this extension UI requires the classic TUI\" notice opts\n * in via a capability flag.\n *\n * This gate is a PURE function so the additive-only guarantee is unit-provable:\n * only a client that advertised the `custom_unsupported` capability gets the\n * additive `extension_ui_request{method:\"custom_unsupported\"}` notice; every\n * other (default) client gets `undefined` — byte-identical to the prior\n * behavior, no extra bytes on the wire.\n */\n\nimport * as crypto from \"node:crypto\";\nimport type { RpcExtensionUIRequest } from \"./rpc-types.ts\";\n\n/** The capability string a client sends in its handshake to opt into the notice. */\nexport const CUSTOM_UNSUPPORTED_CAPABILITY = \"custom_unsupported\";\nexport const EXTENSION_EVENTS_CAPABILITY = \"extension_events\";\nexport const RENDERED_COMPONENTS_CAPABILITY = \"rendered_components\";\nexport const AUTO_TITLE_SESSIONS_CAPABILITY = \"auto_title_sessions\";\n/**\n * Opt-in: the host replaces inline image bytes inside tool results with `image_ref`\n * placeholders for this connection; the client fetches a block on demand with `get_media`.\n */\nexport const MEDIA_PLACEHOLDERS_CAPABILITY = \"media_placeholders\";\n\n/**\n * Env var carrying client capabilities to a single-connection stdio RPC host\n * (comma-separated). A launcher may set it from a client handshake; a plain\n * stdio client leaves it unset and sees byte-identical default behavior.\n */\nexport const RPC_CLIENT_CAPABILITIES_ENV = \"SENPI_RPC_CLIENT_CAPABILITIES\";\n\n/** Parse the comma-separated capabilities env value into a trimmed list. */\nexport function parseClientCapabilities(value: string | undefined): string[] {\n\tif (!value) return [];\n\treturn value\n\t\t.split(\",\")\n\t\t.map((part) => part.trim())\n\t\t.filter((part) => part.length > 0);\n}\n\n/** Fallback label when the calling extension's name cannot be determined. */\nexport const DEFAULT_CUSTOM_EXTENSION_LABEL = \"custom UI component\";\n\n/**\n * Build the additive `custom_unsupported` request for a `ctx.ui.custom` call, or\n * `undefined` when the client did not opt in.\n *\n * Returning `undefined` is the load-bearing default-client path: the caller must\n * emit NOTHING in that case, preserving the exact prior wire behavior.\n */\nexport function buildCustomUnsupportedRequest(\n\tcapabilities: readonly string[] | undefined,\n\textensionName: string,\n): RpcExtensionUIRequest | undefined {\n\tif (!capabilities?.includes(CUSTOM_UNSUPPORTED_CAPABILITY)) {\n\t\treturn undefined;\n\t}\n\tconst name = extensionName.trim() || DEFAULT_CUSTOM_EXTENSION_LABEL;\n\treturn {\n\t\ttype: \"extension_ui_request\",\n\t\tid: crypto.randomUUID(),\n\t\tmethod: \"custom_unsupported\",\n\t\textensionName: name,\n\t};\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bridge OAuth login prompts onto the RPC extension UI dialog channel.
|
|
3
|
+
*
|
|
4
|
+
* Providers whose flow needs mid-flow input (a pasted authorization code, an
|
|
5
|
+
* account choice) call `interaction.prompt(...)`, which AuthStorage routes to
|
|
6
|
+
* `onPrompt`/`onSelect`. Over RPC those become `extension_ui_request` dialogs
|
|
7
|
+
* the client answers with `extension_ui_response`.
|
|
8
|
+
*
|
|
9
|
+
* Cancellation has two independent sources and both must release the dialog:
|
|
10
|
+
* the login-wide signal (login_cancel, or the login having settled) and the
|
|
11
|
+
* per-prompt `AuthPrompt.signal` a provider aborts when an out-of-band step
|
|
12
|
+
* wins the race — e.g. `loginAnthropic` racing a manual-code prompt against
|
|
13
|
+
* its local callback server. A released dialog rejects with "Login cancelled",
|
|
14
|
+
* matching the interactive TUI.
|
|
15
|
+
*
|
|
16
|
+
* Only the prompt text, placeholder, and option labels cross the wire; the
|
|
17
|
+
* client's answer is consumed in-process and never echoed back.
|
|
18
|
+
*/
|
|
19
|
+
import type { OAuthLoginCallbacks } from "@earendil-works/pi-ai";
|
|
20
|
+
import type { ExtensionUIContext } from "../../core/extensions/types.ts";
|
|
21
|
+
type RpcLoginPromptCallbacks = Pick<OAuthLoginCallbacks, "onPrompt" | "onSelect">;
|
|
22
|
+
export declare function createRpcLoginPromptCallbacks(ui: Pick<ExtensionUIContext, "input" | "select">, signal: AbortSignal): RpcLoginPromptCallbacks;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=login-prompts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login-prompts.d.ts","sourceRoot":"","sources":["../../../src/modes/rpc/login-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,KAAK,uBAAuB,GAAG,IAAI,CAAC,mBAAmB,EAAE,UAAU,GAAG,UAAU,CAAC,CAAC;AAElF,wBAAgB,6BAA6B,CAC5C,EAAE,EAAE,IAAI,CAAC,kBAAkB,EAAE,OAAO,GAAG,QAAQ,CAAC,EAChD,MAAM,EAAE,WAAW,GACjB,uBAAuB,CA0BzB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bridge OAuth login prompts onto the RPC extension UI dialog channel.
|
|
3
|
+
*
|
|
4
|
+
* Providers whose flow needs mid-flow input (a pasted authorization code, an
|
|
5
|
+
* account choice) call `interaction.prompt(...)`, which AuthStorage routes to
|
|
6
|
+
* `onPrompt`/`onSelect`. Over RPC those become `extension_ui_request` dialogs
|
|
7
|
+
* the client answers with `extension_ui_response`.
|
|
8
|
+
*
|
|
9
|
+
* Cancellation has two independent sources and both must release the dialog:
|
|
10
|
+
* the login-wide signal (login_cancel, or the login having settled) and the
|
|
11
|
+
* per-prompt `AuthPrompt.signal` a provider aborts when an out-of-band step
|
|
12
|
+
* wins the race — e.g. `loginAnthropic` racing a manual-code prompt against
|
|
13
|
+
* its local callback server. A released dialog rejects with "Login cancelled",
|
|
14
|
+
* matching the interactive TUI.
|
|
15
|
+
*
|
|
16
|
+
* Only the prompt text, placeholder, and option labels cross the wire; the
|
|
17
|
+
* client's answer is consumed in-process and never echoed back.
|
|
18
|
+
*/
|
|
19
|
+
export function createRpcLoginPromptCallbacks(ui, signal) {
|
|
20
|
+
const dialogSignalFor = (promptSignal) => promptSignal ? AbortSignal.any([signal, promptSignal]) : signal;
|
|
21
|
+
return {
|
|
22
|
+
async onPrompt(prompt) {
|
|
23
|
+
const dialogSignal = dialogSignalFor(prompt.signal);
|
|
24
|
+
if (dialogSignal.aborted)
|
|
25
|
+
throw new Error("Login cancelled");
|
|
26
|
+
const value = await ui.input(prompt.message, prompt.placeholder, { signal: dialogSignal });
|
|
27
|
+
if (dialogSignal.aborted || value === undefined)
|
|
28
|
+
throw new Error("Login cancelled");
|
|
29
|
+
return value;
|
|
30
|
+
},
|
|
31
|
+
async onSelect(prompt) {
|
|
32
|
+
const dialogSignal = dialogSignalFor(prompt.signal);
|
|
33
|
+
if (dialogSignal.aborted)
|
|
34
|
+
throw new Error("Login cancelled");
|
|
35
|
+
const value = await ui.select(prompt.message, prompt.options.map((option) => option.label), { signal: dialogSignal });
|
|
36
|
+
if (dialogSignal.aborted)
|
|
37
|
+
throw new Error("Login cancelled");
|
|
38
|
+
if (value === undefined)
|
|
39
|
+
return undefined;
|
|
40
|
+
return prompt.options.find((option) => option.label === value)?.id;
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=login-prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login-prompts.js","sourceRoot":"","sources":["../../../src/modes/rpc/login-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAOH,MAAM,UAAU,6BAA6B,CAC5C,EAAgD,EAChD,MAAmB;IAEnB,MAAM,eAAe,GAAG,CAAC,YAAqC,EAAe,EAAE,CAC9E,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAEjE,OAAO;QACN,KAAK,CAAC,QAAQ,CAAC,MAAM;YACpB,MAAM,YAAY,GAAG,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACpD,IAAI,YAAY,CAAC,OAAO;gBAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;YAC7D,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;YAC3F,IAAI,YAAY,CAAC,OAAO,IAAI,KAAK,KAAK,SAAS;gBAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;YACpF,OAAO,KAAK,CAAC;QACd,CAAC;QAED,KAAK,CAAC,QAAQ,CAAC,MAAM;YACpB,MAAM,YAAY,GAAG,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACpD,IAAI,YAAY,CAAC,OAAO;gBAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;YAC7D,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,MAAM,CAC5B,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EAC5C,EAAE,MAAM,EAAE,YAAY,EAAE,CACxB,CAAC;YACF,IAAI,YAAY,CAAC,OAAO;gBAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;YAC7D,IAAI,KAAK,KAAK,SAAS;gBAAE,OAAO,SAAS,CAAC;YAC1C,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,KAAK,CAAC,EAAE,EAAE,CAAC;QACpE,CAAC;KACD,CAAC;AACH,CAAC","sourcesContent":["/**\n * Bridge OAuth login prompts onto the RPC extension UI dialog channel.\n *\n * Providers whose flow needs mid-flow input (a pasted authorization code, an\n * account choice) call `interaction.prompt(...)`, which AuthStorage routes to\n * `onPrompt`/`onSelect`. Over RPC those become `extension_ui_request` dialogs\n * the client answers with `extension_ui_response`.\n *\n * Cancellation has two independent sources and both must release the dialog:\n * the login-wide signal (login_cancel, or the login having settled) and the\n * per-prompt `AuthPrompt.signal` a provider aborts when an out-of-band step\n * wins the race — e.g. `loginAnthropic` racing a manual-code prompt against\n * its local callback server. A released dialog rejects with \"Login cancelled\",\n * matching the interactive TUI.\n *\n * Only the prompt text, placeholder, and option labels cross the wire; the\n * client's answer is consumed in-process and never echoed back.\n */\n\nimport type { OAuthLoginCallbacks } from \"@earendil-works/pi-ai\";\nimport type { ExtensionUIContext } from \"../../core/extensions/types.ts\";\n\ntype RpcLoginPromptCallbacks = Pick<OAuthLoginCallbacks, \"onPrompt\" | \"onSelect\">;\n\nexport function createRpcLoginPromptCallbacks(\n\tui: Pick<ExtensionUIContext, \"input\" | \"select\">,\n\tsignal: AbortSignal,\n): RpcLoginPromptCallbacks {\n\tconst dialogSignalFor = (promptSignal: AbortSignal | undefined): AbortSignal =>\n\t\tpromptSignal ? AbortSignal.any([signal, promptSignal]) : signal;\n\n\treturn {\n\t\tasync onPrompt(prompt) {\n\t\t\tconst dialogSignal = dialogSignalFor(prompt.signal);\n\t\t\tif (dialogSignal.aborted) throw new Error(\"Login cancelled\");\n\t\t\tconst value = await ui.input(prompt.message, prompt.placeholder, { signal: dialogSignal });\n\t\t\tif (dialogSignal.aborted || value === undefined) throw new Error(\"Login cancelled\");\n\t\t\treturn value;\n\t\t},\n\n\t\tasync onSelect(prompt) {\n\t\t\tconst dialogSignal = dialogSignalFor(prompt.signal);\n\t\t\tif (dialogSignal.aborted) throw new Error(\"Login cancelled\");\n\t\t\tconst value = await ui.select(\n\t\t\t\tprompt.message,\n\t\t\t\tprompt.options.map((option) => option.label),\n\t\t\t\t{ signal: dialogSignal },\n\t\t\t);\n\t\t\tif (dialogSignal.aborted) throw new Error(\"Login cancelled\");\n\t\t\tif (value === undefined) return undefined;\n\t\t\treturn prompt.options.find((option) => option.label === value)?.id;\n\t\t},\n\t};\n}\n"]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `media_placeholders` transform (one choke point, not five).
|
|
3
|
+
*
|
|
4
|
+
* A client that advertised `MEDIA_PLACEHOLDERS_CAPABILITY` must never receive
|
|
5
|
+
* `{type:"image", data:<base64>}` inside a tool result — four inline images once
|
|
6
|
+
* overflowed a 4 MiB socket queue and froze the desktop. Rather than patching each
|
|
7
|
+
* wire path that can carry a tool result (`message_start`/`message_end`,
|
|
8
|
+
* `turn_end.toolResults`, `agent_end`, `entry_appended`, and the `get_messages`,
|
|
9
|
+
* `get_entries`, `get_tree`, `get_state`, `open_session` responses — a list that has
|
|
10
|
+
* already been wrong once), every record is funnelled through this pure transform at
|
|
11
|
+
* `SessionEventWriter.enqueue`.
|
|
12
|
+
*
|
|
13
|
+
* Two hard rules:
|
|
14
|
+
* - Type-gate FIRST. `message_update` is the hot path (one record per token) and must
|
|
15
|
+
* never be walked.
|
|
16
|
+
* - Copy-on-write. Responses hand out live agent state by reference
|
|
17
|
+
* (`success(id, "get_messages", { messages: session.messages })`), so the input graph
|
|
18
|
+
* is never mutated and unchanged sub-trees keep their identity. When nothing changed
|
|
19
|
+
* the SAME record reference comes back, which lets the caller reuse the line it
|
|
20
|
+
* already serialized.
|
|
21
|
+
*
|
|
22
|
+
* User-authored images (`prompt.images`) stay intact: they are bounded by the client
|
|
23
|
+
* that sent them; the fan-out hazard is tool output.
|
|
24
|
+
*/
|
|
25
|
+
/** The block a capable client receives in place of inline image bytes. */
|
|
26
|
+
export interface ImageRefBlock {
|
|
27
|
+
readonly type: "image_ref";
|
|
28
|
+
readonly mimeType: string;
|
|
29
|
+
readonly byteLength: number;
|
|
30
|
+
readonly ref: {
|
|
31
|
+
readonly toolCallId: string;
|
|
32
|
+
readonly contentIndex: number;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Decoded byte length of a base64 string, derived from its length alone.
|
|
37
|
+
*
|
|
38
|
+
* Decoding a multi-MiB payload just to report its size would defeat the purpose of
|
|
39
|
+
* omitting it.
|
|
40
|
+
*/
|
|
41
|
+
export declare function base64ByteLength(data: string): number;
|
|
42
|
+
/**
|
|
43
|
+
* Replace inline tool-result images with `image_ref` placeholders.
|
|
44
|
+
*
|
|
45
|
+
* Returns the SAME reference when nothing changed, so the caller can skip the second
|
|
46
|
+
* serialization entirely.
|
|
47
|
+
*/
|
|
48
|
+
export declare function omitInlineMedia<T extends object>(record: T): T;
|
|
49
|
+
//# sourceMappingURL=media-placeholders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-placeholders.d.ts","sourceRoot":"","sources":["../../../src/modes/rpc/media-placeholders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAuBH,0EAA0E;AAC1E,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,GAAG,EAAE;QAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7E;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGrD;AAqFD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAM9D"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `media_placeholders` transform (one choke point, not five).
|
|
3
|
+
*
|
|
4
|
+
* A client that advertised `MEDIA_PLACEHOLDERS_CAPABILITY` must never receive
|
|
5
|
+
* `{type:"image", data:<base64>}` inside a tool result — four inline images once
|
|
6
|
+
* overflowed a 4 MiB socket queue and froze the desktop. Rather than patching each
|
|
7
|
+
* wire path that can carry a tool result (`message_start`/`message_end`,
|
|
8
|
+
* `turn_end.toolResults`, `agent_end`, `entry_appended`, and the `get_messages`,
|
|
9
|
+
* `get_entries`, `get_tree`, `get_state`, `open_session` responses — a list that has
|
|
10
|
+
* already been wrong once), every record is funnelled through this pure transform at
|
|
11
|
+
* `SessionEventWriter.enqueue`.
|
|
12
|
+
*
|
|
13
|
+
* Two hard rules:
|
|
14
|
+
* - Type-gate FIRST. `message_update` is the hot path (one record per token) and must
|
|
15
|
+
* never be walked.
|
|
16
|
+
* - Copy-on-write. Responses hand out live agent state by reference
|
|
17
|
+
* (`success(id, "get_messages", { messages: session.messages })`), so the input graph
|
|
18
|
+
* is never mutated and unchanged sub-trees keep their identity. When nothing changed
|
|
19
|
+
* the SAME record reference comes back, which lets the caller reuse the line it
|
|
20
|
+
* already serialized.
|
|
21
|
+
*
|
|
22
|
+
* User-authored images (`prompt.images`) stay intact: they are bounded by the client
|
|
23
|
+
* that sent them; the fan-out hazard is tool output.
|
|
24
|
+
*/
|
|
25
|
+
/** Record types that can carry a tool result somewhere in their payload. */
|
|
26
|
+
const MEDIA_BEARING_RECORD_TYPES = new Set([
|
|
27
|
+
"tool_execution_end",
|
|
28
|
+
"message_start",
|
|
29
|
+
"message_end",
|
|
30
|
+
"turn_end",
|
|
31
|
+
"agent_end",
|
|
32
|
+
"entry_appended",
|
|
33
|
+
]);
|
|
34
|
+
/** Response commands whose payload can carry a tool result. */
|
|
35
|
+
const MEDIA_BEARING_RESPONSE_COMMANDS = new Set([
|
|
36
|
+
"get_messages",
|
|
37
|
+
"get_entries",
|
|
38
|
+
"get_tree",
|
|
39
|
+
"get_state",
|
|
40
|
+
"open_session",
|
|
41
|
+
]);
|
|
42
|
+
/**
|
|
43
|
+
* Decoded byte length of a base64 string, derived from its length alone.
|
|
44
|
+
*
|
|
45
|
+
* Decoding a multi-MiB payload just to report its size would defeat the purpose of
|
|
46
|
+
* omitting it.
|
|
47
|
+
*/
|
|
48
|
+
export function base64ByteLength(data) {
|
|
49
|
+
const padding = data.endsWith("==") ? 2 : data.endsWith("=") ? 1 : 0;
|
|
50
|
+
return Math.max(0, Math.floor((data.length * 3) / 4) - padding);
|
|
51
|
+
}
|
|
52
|
+
function isPlainObject(value) {
|
|
53
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
54
|
+
}
|
|
55
|
+
function isInlineImage(value) {
|
|
56
|
+
return isPlainObject(value) && value.type === "image" && typeof value.data === "string";
|
|
57
|
+
}
|
|
58
|
+
/** Replace inline images in one tool-result content array; same reference when none. */
|
|
59
|
+
function omitContentImages(content, toolCallId) {
|
|
60
|
+
let replaced;
|
|
61
|
+
for (let index = 0; index < content.length; index++) {
|
|
62
|
+
const block = content[index];
|
|
63
|
+
if (!isInlineImage(block))
|
|
64
|
+
continue;
|
|
65
|
+
replaced ??= [...content];
|
|
66
|
+
replaced[index] = {
|
|
67
|
+
type: "image_ref",
|
|
68
|
+
mimeType: typeof block.mimeType === "string" ? block.mimeType : "application/octet-stream",
|
|
69
|
+
byteLength: base64ByteLength(block.data),
|
|
70
|
+
ref: { toolCallId, contentIndex: index },
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
return replaced ?? content;
|
|
74
|
+
}
|
|
75
|
+
/** A toolResult message whose content array carries images, rebuilt without them. */
|
|
76
|
+
function omitToolResultImages(message) {
|
|
77
|
+
const content = message.content;
|
|
78
|
+
const toolCallId = typeof message.toolCallId === "string" ? message.toolCallId : "";
|
|
79
|
+
if (!Array.isArray(content))
|
|
80
|
+
return message;
|
|
81
|
+
const omitted = omitContentImages(content, toolCallId);
|
|
82
|
+
return omitted === content ? message : { ...message, content: omitted };
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Copy-on-write walk. Every object with `role:"toolResult"` has its content array
|
|
86
|
+
* scrubbed, wherever it sits (message arrays, `turn_end.toolResults`, session entries,
|
|
87
|
+
* tree nodes, `state.entries`). Unchanged sub-trees are returned by reference.
|
|
88
|
+
*/
|
|
89
|
+
function walk(value) {
|
|
90
|
+
if (Array.isArray(value)) {
|
|
91
|
+
let replaced;
|
|
92
|
+
for (let index = 0; index < value.length; index++) {
|
|
93
|
+
const next = walk(value[index]);
|
|
94
|
+
if (next === value[index])
|
|
95
|
+
continue;
|
|
96
|
+
replaced ??= [...value];
|
|
97
|
+
replaced[index] = next;
|
|
98
|
+
}
|
|
99
|
+
return replaced ?? value;
|
|
100
|
+
}
|
|
101
|
+
if (!isPlainObject(value))
|
|
102
|
+
return value;
|
|
103
|
+
const scrubbed = value.role === "toolResult" ? omitToolResultImages(value) : value;
|
|
104
|
+
let replaced = scrubbed === value ? undefined : { ...scrubbed };
|
|
105
|
+
for (const [key, child] of Object.entries(scrubbed)) {
|
|
106
|
+
if (key === "content" && scrubbed !== value)
|
|
107
|
+
continue;
|
|
108
|
+
if (!isPlainObject(child) && !Array.isArray(child))
|
|
109
|
+
continue;
|
|
110
|
+
const next = walk(child);
|
|
111
|
+
if (next === child)
|
|
112
|
+
continue;
|
|
113
|
+
replaced ??= { ...scrubbed };
|
|
114
|
+
replaced[key] = next;
|
|
115
|
+
}
|
|
116
|
+
return replaced ?? value;
|
|
117
|
+
}
|
|
118
|
+
/** `tool_execution_end.result.content` is not a toolResult message; scrub it explicitly. */
|
|
119
|
+
function omitToolExecutionEndImages(record) {
|
|
120
|
+
const result = record.result;
|
|
121
|
+
if (!isPlainObject(result) || !Array.isArray(result.content))
|
|
122
|
+
return record;
|
|
123
|
+
const toolCallId = typeof record.toolCallId === "string" ? record.toolCallId : "";
|
|
124
|
+
const omitted = omitContentImages(result.content, toolCallId);
|
|
125
|
+
return omitted === result.content ? record : { ...record, result: { ...result, content: omitted } };
|
|
126
|
+
}
|
|
127
|
+
/** True when this record type can carry a tool result at all (cheap gate). */
|
|
128
|
+
function carriesMedia(record) {
|
|
129
|
+
if (typeof record.type !== "string")
|
|
130
|
+
return false;
|
|
131
|
+
if (MEDIA_BEARING_RECORD_TYPES.has(record.type))
|
|
132
|
+
return true;
|
|
133
|
+
return record.type === "response" && typeof record.command === "string"
|
|
134
|
+
? MEDIA_BEARING_RESPONSE_COMMANDS.has(record.command)
|
|
135
|
+
: false;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Replace inline tool-result images with `image_ref` placeholders.
|
|
139
|
+
*
|
|
140
|
+
* Returns the SAME reference when nothing changed, so the caller can skip the second
|
|
141
|
+
* serialization entirely.
|
|
142
|
+
*/
|
|
143
|
+
export function omitInlineMedia(record) {
|
|
144
|
+
const typed = record;
|
|
145
|
+
if (!carriesMedia(typed))
|
|
146
|
+
return record;
|
|
147
|
+
const scrubbed = typed.type === "tool_execution_end" ? omitToolExecutionEndImages(typed) : typed;
|
|
148
|
+
const walked = walk(scrubbed);
|
|
149
|
+
return (walked === typed ? record : walked);
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=media-placeholders.js.map
|
|
@@ -0,0 +1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AAC;QAAE,OAAO,MAAM,CAAC;IACxC,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,KAAK,oBAAoB,CAAC,CAAC,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACjG,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9B,OAAO,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAM,CAAC;AAClD,CAAC","sourcesContent":["/**\n * The `media_placeholders` transform (one choke point, not five).\n *\n * A client that advertised `MEDIA_PLACEHOLDERS_CAPABILITY` must never receive\n * `{type:\"image\", data:<base64>}` inside a tool result — four inline images once\n * overflowed a 4 MiB socket queue and froze the desktop. Rather than patching each\n * wire path that can carry a tool result (`message_start`/`message_end`,\n * `turn_end.toolResults`, `agent_end`, `entry_appended`, and the `get_messages`,\n * `get_entries`, `get_tree`, `get_state`, `open_session` responses — a list that has\n * already been wrong once), every record is funnelled through this pure transform at\n * `SessionEventWriter.enqueue`.\n *\n * Two hard rules:\n * - Type-gate FIRST. `message_update` is the hot path (one record per token) and must\n * never be walked.\n * - Copy-on-write. Responses hand out live agent state by reference\n * (`success(id, \"get_messages\", { messages: session.messages })`), so the input graph\n * is never mutated and unchanged sub-trees keep their identity. When nothing changed\n * the SAME record reference comes back, which lets the caller reuse the line it\n * already serialized.\n *\n * User-authored images (`prompt.images`) stay intact: they are bounded by the client\n * that sent them; the fan-out hazard is tool output.\n */\n\ntype RpcRecord = Record<string, unknown>;\n\n/** Record types that can carry a tool result somewhere in their payload. */\nconst MEDIA_BEARING_RECORD_TYPES = new Set([\n\t\"tool_execution_end\",\n\t\"message_start\",\n\t\"message_end\",\n\t\"turn_end\",\n\t\"agent_end\",\n\t\"entry_appended\",\n]);\n\n/** Response commands whose payload can carry a tool result. */\nconst MEDIA_BEARING_RESPONSE_COMMANDS = new Set([\n\t\"get_messages\",\n\t\"get_entries\",\n\t\"get_tree\",\n\t\"get_state\",\n\t\"open_session\",\n]);\n\n/** The block a capable client receives in place of inline image bytes. */\nexport interface ImageRefBlock {\n\treadonly type: \"image_ref\";\n\treadonly mimeType: string;\n\treadonly byteLength: number;\n\treadonly ref: { readonly toolCallId: string; readonly contentIndex: number };\n}\n\n/**\n * Decoded byte length of a base64 string, derived from its length alone.\n *\n * Decoding a multi-MiB payload just to report its size would defeat the purpose of\n * omitting it.\n */\nexport function base64ByteLength(data: string): number {\n\tconst padding = data.endsWith(\"==\") ? 2 : data.endsWith(\"=\") ? 1 : 0;\n\treturn Math.max(0, Math.floor((data.length * 3) / 4) - padding);\n}\n\nfunction isPlainObject(value: unknown): value is RpcRecord {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction isInlineImage(value: unknown): value is { type: \"image\"; data: string; mimeType?: string } {\n\treturn isPlainObject(value) && value.type === \"image\" && typeof value.data === \"string\";\n}\n\n/** Replace inline images in one tool-result content array; same reference when none. */\nfunction omitContentImages(content: readonly unknown[], toolCallId: string): readonly unknown[] {\n\tlet replaced: unknown[] | undefined;\n\tfor (let index = 0; index < content.length; index++) {\n\t\tconst block = content[index];\n\t\tif (!isInlineImage(block)) continue;\n\t\treplaced ??= [...content];\n\t\treplaced[index] = {\n\t\t\ttype: \"image_ref\",\n\t\t\tmimeType: typeof block.mimeType === \"string\" ? block.mimeType : \"application/octet-stream\",\n\t\t\tbyteLength: base64ByteLength(block.data),\n\t\t\tref: { toolCallId, contentIndex: index },\n\t\t} satisfies ImageRefBlock;\n\t}\n\treturn replaced ?? content;\n}\n\n/** A toolResult message whose content array carries images, rebuilt without them. */\nfunction omitToolResultImages(message: RpcRecord): RpcRecord {\n\tconst content = message.content;\n\tconst toolCallId = typeof message.toolCallId === \"string\" ? message.toolCallId : \"\";\n\tif (!Array.isArray(content)) return message;\n\tconst omitted = omitContentImages(content, toolCallId);\n\treturn omitted === content ? message : { ...message, content: omitted };\n}\n\n/**\n * Copy-on-write walk. Every object with `role:\"toolResult\"` has its content array\n * scrubbed, wherever it sits (message arrays, `turn_end.toolResults`, session entries,\n * tree nodes, `state.entries`). Unchanged sub-trees are returned by reference.\n */\nfunction walk(value: unknown): unknown {\n\tif (Array.isArray(value)) {\n\t\tlet replaced: unknown[] | undefined;\n\t\tfor (let index = 0; index < value.length; index++) {\n\t\t\tconst next = walk(value[index]);\n\t\t\tif (next === value[index]) continue;\n\t\t\treplaced ??= [...value];\n\t\t\treplaced[index] = next;\n\t\t}\n\t\treturn replaced ?? value;\n\t}\n\tif (!isPlainObject(value)) return value;\n\n\tconst scrubbed = value.role === \"toolResult\" ? omitToolResultImages(value) : value;\n\tlet replaced: RpcRecord | undefined = scrubbed === value ? undefined : { ...scrubbed };\n\tfor (const [key, child] of Object.entries(scrubbed)) {\n\t\tif (key === \"content\" && scrubbed !== value) continue;\n\t\tif (!isPlainObject(child) && !Array.isArray(child)) continue;\n\t\tconst next = walk(child);\n\t\tif (next === child) continue;\n\t\treplaced ??= { ...scrubbed };\n\t\treplaced[key] = next;\n\t}\n\treturn replaced ?? value;\n}\n\n/** `tool_execution_end.result.content` is not a toolResult message; scrub it explicitly. */\nfunction omitToolExecutionEndImages(record: RpcRecord): RpcRecord {\n\tconst result = record.result;\n\tif (!isPlainObject(result) || !Array.isArray(result.content)) return record;\n\tconst toolCallId = typeof record.toolCallId === \"string\" ? record.toolCallId : \"\";\n\tconst omitted = omitContentImages(result.content, toolCallId);\n\treturn omitted === result.content ? record : { ...record, result: { ...result, content: omitted } };\n}\n\n/** True when this record type can carry a tool result at all (cheap gate). */\nfunction carriesMedia(record: RpcRecord): boolean {\n\tif (typeof record.type !== \"string\") return false;\n\tif (MEDIA_BEARING_RECORD_TYPES.has(record.type)) return true;\n\treturn record.type === \"response\" && typeof record.command === \"string\"\n\t\t? MEDIA_BEARING_RESPONSE_COMMANDS.has(record.command)\n\t\t: false;\n}\n\n/**\n * Replace inline tool-result images with `image_ref` placeholders.\n *\n * Returns the SAME reference when nothing changed, so the caller can skip the second\n * serialization entirely.\n */\nexport function omitInlineMedia<T extends object>(record: T): T {\n\tconst typed = record as unknown as RpcRecord;\n\tif (!carriesMedia(typed)) return record;\n\tconst scrubbed = typed.type === \"tool_execution_end\" ? omitToolExecutionEndImages(typed) : typed;\n\tconst walked = walk(scrubbed);\n\treturn (walked === typed ? record : walked) as T;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi-session-host.js","sourceRoot":"","sources":["../../../src/modes/rpc/multi-session-host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAA4B,MAAM,UAAU,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EACN,cAAc,EACd,cAAc,EACd,4BAA4B,EAC5B,cAAc,GACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AAEnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,kCAAkC,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAA0B,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACN,kBAAk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AQ,CAAW,EAAE,CAAC;QAC/G,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;YACvB,2BAA2B,EAAE,CAAC;YAC9B,KAAK,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;IACJ,CAAC;AACF,CAAC","sourcesContent":["import { access, chmod, mkdir, unlink } from \"node:fs/promises\";\nimport { createConnection, createServer, type Server, type Socket } from \"node:net\";\nimport { dirname, join } from \"node:path\";\nimport type { CreateAgentSessionRuntimeFactory } from \"../../core/agent-session-runtime.ts\";\nimport { envValue } from \"../../core/brand.ts\";\nimport {\n\tflushRawStdout,\n\ttakeOverStdout,\n\twaitForRawStdoutBackpressure,\n\twriteRawStdout,\n} from \"../../core/output-guard.ts\";\nimport { killTrackedDetachedChildren } from \"../../utils/shell.ts\";\nimport type { RpcConnectionSink } from \"./connection-handler.ts\";\nimport { parseClientCapabilities } from \"./custom-capability.ts\";\nimport { parseIdleExitMs } from \"./host-lifecycle.ts\";\nimport { armHostWatchdog, readHostWatchdogConfigFromBrandEnv } from \"./host-watchdog.ts\";\nimport { attachJsonlLineReader, MAX_RPC_LINE_CHARACTERS } from \"./jsonl.ts\";\nimport { rpcCommandShapeError } from \"./rpc-input-validation.ts\";\nimport type { RpcCommand, RpcResponse } from \"./rpc-types.ts\";\nimport { type RpcBindingFactory, SessionCommandRouter } from \"./session-command-router.ts\";\nimport { SessionEventWriter } from \"./session-event-writer.ts\";\nimport { RpcSessionRegistry } from \"./session-registry.ts\";\nimport {\n\tauthenticateSocket,\n\tensureSocketSecret,\n\tresolveSocketTransportAddress,\n\tSOCKET_SECRET_FILE_ENV,\n\tsocketSecretPath,\n} from \"./socket-transport.ts\";\n\nexport interface MultiSessionHostOptions {\n\tagentDir: string;\n\tcreateRuntime: CreateAgentSessionRuntimeFactory;\n\tcwd: string;\n\tpermissionPreset?: string;\n\tcreationModel?: { provider: string; modelId: string };\n\tinitialThinkingLevel?: string;\n\tlisten?: string;\n\t/** Test seam: defaults to the real shared-session binding. */\n\tcreateBinding?: RpcBindingFactory;\n}\n\n/** Environment override for the idle-session eviction window, in milliseconds. */\nexport const RPC_SESSION_IDLE_EVICTION_MS_ENV = \"SENPI_RPC_SESSION_IDLE_EVICTION_MS\";\n/** Environment override for the concurrent open-session cap. */\nexport const RPC_MAX_SESSIONS_ENV = \"SENPI_RPC_MAX_SESSIONS\";\n/** Environment override for the empty-host exit window, in milliseconds. */\nexport const RPC_HOST_EMPTY_EXIT_MS_ENV = \"SENPI_RPC_HOST_EMPTY_EXIT_MS\";\n/** Environment override for the graceful close_session teardown window, in milliseconds. */\nexport const RPC_CLOSE_GRACE_MS_ENV = \"SENPI_RPC_CLOSE_GRACE_MS\";\n/** Default idle-eviction window: 30 minutes after a session's last routed command or settled turn. */\nexport const DEFAULT_SESSION_IDLE_EVICTION_MS = 30 * 60_000;\n/** Default session cap: an idle session holds a full runtime (~340-510 MB RSS measured). */\nexport const DEFAULT_MAX_SESSIONS = 8;\n/** Default empty-host exit: 15 minutes with zero open sessions, matching the supervisor's idle window. */\nexport const DEFAULT_HOST_EMPTY_EXIT_MS = 15 * 60_000;\n/** Win32 named-pipe close can leave libuv's server callback pending after handles are destroyed. */\nconst WINDOWS_SHUTDOWN_HARD_EXIT_MS = 2_000;\n\n/** Explicit occupancy-policy overrides for createHostCore; tests inject clocks and hooks here. */\nexport interface HostIdleOverrides {\n\tnow?: () => number;\n\tidleEvictionMs?: number;\n\temptyExitMs?: number;\n\tmaxSessions?: number;\n\tcloseGraceMs?: number;\n\t/** Shutdown hook the empty-exit window invokes; hosts pass their exit path. */\n\tonEmptyExit?: () => void;\n\t/** Gate consulted before the empty-exit window advances (connected clients block it). */\n\tcanExitWhenEmpty?: () => boolean;\n}\n\nfunction parseSessionCap(value: string | undefined): number | undefined {\n\tif (value === undefined || !/^\\d+$/.test(value.trim())) return undefined;\n\tconst parsed = Number(value.trim());\n\treturn Number.isFinite(parsed) && parsed > 0 ? parsed : undefined;\n}\n\n/** Precedence: explicit overrides beat environment variables beat documented defaults. */\nexport function resolveHostIdlePolicy(\n\tenv: Readonly<Record<string, string | undefined>>,\n\toverrides: HostIdleOverrides = {},\n): { now: () => number; idleEvictionMs: number; emptyExitMs: number; maxSessions: number } {\n\treturn {\n\t\tnow: overrides.now ?? Date.now,\n\t\tidleEvictionMs:\n\t\t\toverrides.idleEvictionMs ??\n\t\t\tparseIdleExitMs(env[RPC_SESSION_IDLE_EVICTION_MS_ENV]) ??\n\t\t\tDEFAULT_SESSION_IDLE_EVICTION_MS,\n\t\temptyExitMs:\n\t\t\toverrides.emptyExitMs ?? parseIdleExitMs(env[RPC_HOST_EMPTY_EXIT_MS_ENV]) ?? DEFAULT_HOST_EMPTY_EXIT_MS,\n\t\tmaxSessions: overrides.maxSessions ?? parseSessionCap(env[RPC_MAX_SESSIONS_ENV]) ?? DEFAULT_MAX_SESSIONS,\n\t};\n}\n\ninterface Connection {\n\treadonly id: string;\n\treadonly sink: RpcConnectionSink;\n\treadonly detach: () => void;\n\treadonly close: () => void;\n}\n\n/**\n * Socket agent events are delivered only to connections attached to their\n * session, tagged with its routing sessionId. Content-free session lifecycle\n * events remain visible to every connection. Responses and extension UI\n * requests remain requester-only; foreign observation uses attach-on-open.\n */\nexport async function runMultiSessionHost(options: MultiSessionHostOptions): Promise<never> {\n\tif (options.listen === undefined || options.listen === \"stdio://\") return runStdioHost(options);\n\treturn runSocketHost(options, resolveSocketPath(options.listen, options.agentDir));\n}\n\nexport function createHostCore(\n\toptions: MultiSessionHostOptions,\n\twriter: SessionEventWriter,\n\tcapabilities = parseClientCapabilities(envValue(\"RPC_CLIENT_CAPABILITIES\")),\n\tidle: HostIdleOverrides = {},\n) {\n\tconst policy = resolveHostIdlePolicy(process.env, idle);\n\tconst router = new SessionCommandRouter(\n\t\tnew RpcSessionRegistry({\n\t\t\tagentDir: options.agentDir,\n\t\t\tcreateRuntime: options.createRuntime,\n\t\t\tnow: policy.now,\n\t\t\tmaxSessions: policy.maxSessions,\n\t\t\tcloseGraceMs: idle.closeGraceMs ?? parseIdleExitMs(process.env[RPC_CLOSE_GRACE_MS_ENV]) ?? 10_000,\n\t\t}),\n\t\twriter,\n\t\toptions,\n\t\toptions.createBinding,\n\t\t{ capabilities },\n\t\t{\n\t\t\tnow: policy.now,\n\t\t\tidleEvictionMs: policy.idleEvictionMs,\n\t\t\temptyExitMs: policy.emptyExitMs,\n\t\t\tonEmptyExit: idle.onEmptyExit,\n\t\t\tcanExitWhenEmpty: idle.canExitWhenEmpty,\n\t\t},\n\t);\n\tconst handle = async (line: string): Promise<void> => {\n\t\tlet parsed: unknown;\n\t\ttry {\n\t\t\tparsed = JSON.parse(line);\n\t\t} catch (cause) {\n\t\t\tawait writer.enqueueControl(parseError(`Failed to parse command: ${errorMessage(cause)}`));\n\t\t\treturn;\n\t\t}\n\t\tconst shapeError = rpcCommandShapeError(parsed);\n\t\tif (shapeError) {\n\t\t\tawait writer.enqueueControl(parseError(shapeError));\n\t\t\treturn;\n\t\t}\n\t\tconst response = await router.handle(parsed as RpcCommand);\n\t\tif (response) await writer.enqueueControl(response);\n\t};\n\treturn { router, handle };\n}\n\n/** Plain-stdio host with no eagerly-created AgentSessionRuntime. */\nasync function runStdioHost(options: MultiSessionHostOptions): Promise<never> {\n\ttakeOverStdout();\n\tconst sink: RpcConnectionSink = { writeRaw: writeRawStdout, waitForBackpressure: waitForRawStdoutBackpressure };\n\tconst writer = new SessionEventWriter(sink.writeRaw, sink.waitForBackpressure);\n\t// An empty host (no session ever opened, or all closed) must not stay resident\n\t// forever: exit through the normal shutdown path once the window elapses.\n\tconst { router, handle } = createHostCore(options, writer, undefined, {\n\t\tonEmptyExit: () => void shutdown(0),\n\t});\n\tlet shuttingDown = false;\n\tconst shutdown = async (exitCode = 0): Promise<never> => {\n\t\tif (shuttingDown) process.exit(exitCode);\n\t\tshuttingDown = true;\n\t\tdetach();\n\t\tawait router.dispose();\n\t\tawait writer.flush();\n\t\tawait flushRawStdout();\n\t\tprocess.exit(exitCode);\n\t};\n\tconst onEnd = () => void shutdown();\n\tprocess.stdin.on(\"end\", onEnd);\n\tconst detachReader = attachJsonlLineReader(process.stdin, (line) => void handle(line), {\n\t\tmaxLineLength: MAX_RPC_LINE_CHARACTERS,\n\t\tonOversizedLine: () => void writer.enqueueControl(parseError(oversizedLineError())),\n\t});\n\tconst detach = () => {\n\t\tdetachReader();\n\t\tprocess.stdin.off(\"end\", onEnd);\n\t};\n\tregisterShutdownSignals(shutdown);\n\treturn new Promise(() => {});\n}\n\nasync function runSocketHost(options: MultiSessionHostOptions, socketPath: string): Promise<never> {\n\tawait prepareSocketPath(socketPath);\n\tconst writer = new SessionEventWriter(() => {});\n\tconst connections = new Map<string, Connection>();\n\tconst { router, handle } = createHostCore(\n\t\toptions,\n\t\twriter,\n\t\tparseClientCapabilities(envValue(\"RPC_CLIENT_CAPABILITIES\")).filter(\n\t\t\t(capability) => capability !== \"rendered_components\",\n\t\t),\n\t\t// Supervised hosts idle-exit via the supervisor, but a socket host that\n\t\t// outlives its supervisor (or is started bare) still self-exits when empty.\n\t\t// A connected client counts as occupancy even with no session open: exiting\n\t\t// under it would drop its socket and read as a crash to the supervisor.\n\t\t{ onEmptyExit: () => void shutdown(0), canExitWhenEmpty: () => connections.size === 0 },\n\t);\n\tlet nextConnection = 0;\n\tlet shuttingDown = false;\n\tconst secret =\n\t\tprocess.platform === \"win32\"\n\t\t\t? await ensureSocketSecret(process.env[SOCKET_SECRET_FILE_ENV] ?? socketSecretPath(socketPath))\n\t\t\t: undefined;\n\tconst server = createServer((socket) => {\n\t\tconst accept = (): void => {\n\t\t\tconst id = `socket-${++nextConnection}`;\n\t\t\tconst sink = socketSink(socket);\n\t\t\twriter.registerConnection(id, sink);\n\t\t\tconst detachReader = attachJsonlLineReader(\n\t\t\t\tsocket,\n\t\t\t\t(line) => {\n\t\t\t\t\t// Do not serialize awaited commands: extension_ui_response and other\n\t\t\t\t\t// re-entrant frames must be able to resolve a command already awaiting them.\n\t\t\t\t\tvoid writer\n\t\t\t\t\t\t.withConnection(id, () => handle(line))\n\t\t\t\t\t\t.catch((cause) => {\n\t\t\t\t\t\t\tprocess.stderr.write(`senpi rpc connection ${id} failed: ${errorMessage(cause)}\\n`);\n\t\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmaxLineLength: MAX_RPC_LINE_CHARACTERS,\n\t\t\t\t\tonOversizedLine: () => {\n\t\t\t\t\t\tvoid writer\n\t\t\t\t\t\t\t.withConnection(id, () => writer.enqueueControl(parseError(oversizedLineError())))\n\t\t\t\t\t\t\t.catch((cause) =>\n\t\t\t\t\t\t\t\tprocess.stderr.write(`senpi rpc connection ${id} failed: ${errorMessage(cause)}\\n`),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t);\n\t\t\tlet detached = false;\n\t\t\tconst detach = () => {\n\t\t\t\tif (detached) return;\n\t\t\t\tdetached = true;\n\t\t\t\tdetachReader();\n\t\t\t\twriter.unregisterConnection(id);\n\t\t\t\tconnections.delete(id);\n\t\t\t\t// A socket that dies without close_session still owns its sessions' attachments\n\t\t\t\t// and path reservations. Release them on the command chain so this runs after any\n\t\t\t\t// in-flight command for this connection settles, otherwise the path stays pinned\n\t\t\t\t// by a runtime whose client is gone and later resumes attach to that orphan.\n\t\t\t\tvoid router.releaseConnection(id).catch((cause) => {\n\t\t\t\t\tprocess.stderr.write(`senpi rpc connection ${id} release failed: ${errorMessage(cause)}\\n`);\n\t\t\t\t});\n\t\t\t};\n\t\t\tconnections.set(id, { id, sink, detach, close: () => socket.destroy() });\n\t\t\tsocket.once(\"close\", detach);\n\t\t\tsocket.once(\"error\", () => detach());\n\t\t};\n\t\tif (secret) authenticateSocket(socket, secret, accept);\n\t\telse accept();\n\t});\n\tserver.on(\"error\", (cause) => {\n\t\tif (!shuttingDown) process.stderr.write(`senpi rpc socket listener failed: ${errorMessage(cause)}\\n`);\n\t});\n\tconst shutdown = async (exitCode = 0, watchdogCleanup?: Promise<void>): Promise<never> => {\n\t\tif (shuttingDown) process.exit(exitCode);\n\t\tshuttingDown = true;\n\t\t// On Windows, destroying named-pipe sockets does not always make libuv's\n\t\t// server.close callback fire: connected pipe instances can remain in the\n\t\t// kernel after the JavaScript handles are destroyed. Keep the normal drain\n\t\t// path, but never let that platform-specific close stall orphan the host.\n\t\ttry {\n\t\t\tfor (const connection of connections.values()) {\n\t\t\t\tconnection.detach();\n\t\t\t\tconnection.close();\n\t\t\t}\n\t\t\tawait (process.platform === \"win32\"\n\t\t\t\t? Promise.race([closeServer(server), delay(WINDOWS_SHUTDOWN_HARD_EXIT_MS)])\n\t\t\t\t: closeServer(server));\n\t\t\tawait router.dispose();\n\t\t\tawait writer.flush();\n\t\t\tawait removeSocketPath(socketPath);\n\t\t\tif (watchdogCleanup) await watchdogCleanup;\n\t\t} finally {\n\t\t\t// Explicitly terminate after every shutdown trigger. Windows named-pipe\n\t\t\t// handles are not fully controllable from JS, and an unresolved cleanup\n\t\t\t// must not leave this daemon or its public endpoint alive.\n\t\t\tprocess.exit(exitCode);\n\t\t}\n\t};\n\tregisterShutdownSignals(shutdown);\n\t// Arm before listen: a supervisor death during the listen transition must\n\t// still close the child and clean its private endpoint.\n\tarmHostWatchdog(readHostWatchdogConfigFromBrandEnv(), (reason, cleanup) => {\n\t\tprocess.stderr.write(`senpi rpc host: ${reason}; shutting down\\n`);\n\t\t// Enter shutdown before killing session-owned child processes. The Windows\n\t\t// tree killer is synchronous, while the shutdown fallback must be armed\n\t\t// before any such cleanup can delay the event loop.\n\t\tvoid shutdown(0, cleanup);\n\t\tsetImmediate(killTrackedDetachedChildren);\n\t});\n\tawait listen(server, socketPath, secret);\n\tprocess.stderr.write(`senpi rpc listening on ${formatSocketAddress(socketPath)}\\n`);\n\n\t// Opt-in only: set by the lifecycle supervisor so this host can never outlive\n\t// it, including when the supervisor is SIGKILLed and runs no handler at all.\n\treturn new Promise(() => {});\n}\n\nfunction delay(ms: number): Promise<void> {\n\treturn new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nfunction parseError(error: string): RpcResponse {\n\treturn { type: \"response\", command: \"parse\", success: false, error };\n}\n\nfunction oversizedLineError(): string {\n\treturn `RPC input line exceeds ${MAX_RPC_LINE_CHARACTERS} characters.`;\n}\n\nfunction errorMessage(cause: unknown): string {\n\treturn cause instanceof Error ? cause.message : String(cause);\n}\n\nfunction resolveSocketPath(value: string, agentDir: string): string {\n\tif (value === \"unix://\") return join(agentDir, \"rpc\", \"rpc.sock\");\n\tif (value.startsWith(\"unix://\")) {\n\t\tconst path = value.slice(\"unix://\".length);\n\t\tif (path.length === 0) return join(agentDir, \"rpc\", \"rpc.sock\");\n\t\tif (path.startsWith(\"@\") && process.platform === \"linux\") return `\\0${path.slice(1)}`;\n\t\treturn path;\n\t}\n\treturn value;\n}\n\nfunction formatSocketAddress(socketPath: string): string {\n\treturn socketPath.startsWith(\"\\0\") ? `unix://@${socketPath.slice(1)}` : `unix://${socketPath}`;\n}\n\nfunction socketSink(socket: Socket): RpcConnectionSink {\n\tlet needsDrain = false;\n\treturn {\n\t\twriteRaw(chunk) {\n\t\t\tif (!socket.destroyed) needsDrain = !socket.write(chunk);\n\t\t},\n\t\twaitForBackpressure() {\n\t\t\tif (socket.destroyed || !needsDrain) return Promise.resolve();\n\t\t\tneedsDrain = false;\n\t\t\treturn new Promise<void>((resolve) => {\n\t\t\t\tconst done = () => {\n\t\t\t\t\tsocket.off(\"drain\", done);\n\t\t\t\t\tsocket.off(\"close\", done);\n\t\t\t\t\tresolve();\n\t\t\t\t};\n\t\t\t\tsocket.once(\"drain\", done);\n\t\t\t\tsocket.once(\"close\", done);\n\t\t\t});\n\t\t},\n\t};\n}\n\nasync function prepareSocketPath(socketPath: string): Promise<void> {\n\tif (process.platform === \"win32\" || socketPath.startsWith(\"\\0\")) return;\n\tawait mkdir(dirname(socketPath), { recursive: true, mode: 0o700 });\n\ttry {\n\t\tawait access(socketPath);\n\t} catch (cause) {\n\t\tif (isNodeErrorCode(cause, \"ENOENT\")) return;\n\t\tthrow cause;\n\t}\n\tif (await probeSocket(socketPath)) throw new Error(`${socketPath}: address already in use by a live server.`);\n\tawait unlink(socketPath);\n}\n\nfunction probeSocket(socketPath: string): Promise<boolean> {\n\treturn new Promise((resolve) => {\n\t\tconst socket = createConnection(resolveSocketTransportAddress(socketPath, process.platform));\n\t\tconst settle = (live: boolean) => {\n\t\t\tsocket.destroy();\n\t\t\tresolve(live);\n\t\t};\n\t\tsocket.once(\"connect\", () => settle(true));\n\t\tsocket.once(\"error\", () => settle(false));\n\t\tsocket.setTimeout(1_000, () => settle(false));\n\t});\n}\n\nfunction listen(server: Server, socketPath: string, secret?: Uint8Array): Promise<void> {\n\treturn new Promise((resolve, reject) => {\n\t\tserver.once(\"error\", reject);\n\t\tserver.listen(resolveSocketTransportAddress(socketPath, process.platform, secret), async () => {\n\t\t\tserver.off(\"error\", reject);\n\t\t\ttry {\n\t\t\t\tif (process.platform !== \"win32\" && !socketPath.startsWith(\"\\0\")) await chmod(socketPath, 0o600);\n\t\t\t\tresolve();\n\t\t\t} catch (cause) {\n\t\t\t\treject(cause);\n\t\t\t}\n\t\t});\n\t});\n}\n\nfunction closeServer(server: Server): Promise<void> {\n\treturn new Promise((resolve, reject) => {\n\t\tserver.close((cause) => (cause ? reject(cause) : resolve()));\n\t});\n}\n\nasync function removeSocketPath(socketPath: string): Promise<void> {\n\tif (process.platform === \"win32\" || socketPath.startsWith(\"\\0\")) return;\n\ttry {\n\t\tawait unlink(socketPath);\n\t} catch (cause) {\n\t\tif (!isNodeErrorCode(cause, \"ENOENT\")) throw cause;\n\t}\n}\n\nfunction isNodeErrorCode(cause: unknown, code: string): boolean {\n\treturn cause instanceof Error && \"code\" in cause && cause.code === code;\n}\n\nfunction registerShutdownSignals(shutdown: (exitCode?: number) => Promise<never>): void {\n\tfor (const signal of process.platform === \"win32\" ? ([\"SIGTERM\"] as const) : ([\"SIGTERM\", \"SIGHUP\"] as const)) {\n\t\tprocess.on(signal, () => {\n\t\t\tkillTrackedDetachedChildren();\n\t\t\tvoid shutdown(signal === \"SIGHUP\" ? 129 : 143);\n\t\t});\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"multi-session-host.js","sourceRoot":"","sources":["../../../src/modes/rpc/multi-session-host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAA4B,MAAM,UAAU,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EACN,cAAc,EACd,cAAc,EACd,4BAA4B,EAC5B,cAAc,GACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AAEnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,kCAAkC,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAA0B,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACN,kBAAkB,EAClB,kBAAkB,EAClB,6BAA6B,EAC7B,sBAAsB,EACtB,gBAAgB,GAChB,MAAM,uBAAuB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;QAC/G,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;YACvB,2BAA2B,EAAE,CAAC;YAC9B,KAAK,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;IACJ,CAAC;AACF,CAAC","sourcesContent":["import { access, chmod, mkdir, unlink } from \"node:fs/promises\";\nimport { createConnection, createServer, type Server, type Socket } from \"node:net\";\nimport { dirname, join } from \"node:path\";\nimport type { CreateAgentSessionRuntimeFactory } from \"../../core/agent-session-runtime.ts\";\nimport { envValue } from \"../../core/brand.ts\";\nimport {\n\tflushRawStdout,\n\ttakeOverStdout,\n\twaitForRawStdoutBackpressure,\n\twriteRawStdout,\n} from \"../../core/output-guard.ts\";\nimport { killTrackedDetachedChildren } from \"../../utils/shell.ts\";\nimport type { RpcConnectionSink } from \"./connection-handler.ts\";\nimport { parseClientCapabilities } from \"./custom-capability.ts\";\nimport { parseIdleExitMs } from \"./host-lifecycle.ts\";\nimport { armHostWatchdog, readHostWatchdogConfigFromBrandEnv } from \"./host-watchdog.ts\";\nimport { attachJsonlLineReader, MAX_RPC_LINE_CHARACTERS } from \"./jsonl.ts\";\nimport { rpcCommandShapeError } from \"./rpc-input-validation.ts\";\nimport type { RpcCommand, RpcResponse } from \"./rpc-types.ts\";\nimport { type RpcBindingFactory, SessionCommandRouter } from \"./session-command-router.ts\";\nimport { SessionEventWriter } from \"./session-event-writer.ts\";\nimport { RpcSessionRegistry } from \"./session-registry.ts\";\nimport {\n\tauthenticateSocket,\n\tensureSocketSecret,\n\tresolveSocketTransportAddress,\n\tSOCKET_SECRET_FILE_ENV,\n\tsocketSecretPath,\n} from \"./socket-transport.ts\";\n\nexport interface MultiSessionHostOptions {\n\tagentDir: string;\n\tcreateRuntime: CreateAgentSessionRuntimeFactory;\n\tcwd: string;\n\tpermissionPreset?: string;\n\tcreationModel?: { provider: string; modelId: string };\n\tinitialThinkingLevel?: string;\n\tlisten?: string;\n\t/** Test seam: defaults to the real shared-session binding. */\n\tcreateBinding?: RpcBindingFactory;\n}\n\n/** Environment override for the idle-session eviction window, in milliseconds. */\nexport const RPC_SESSION_IDLE_EVICTION_MS_ENV = \"SENPI_RPC_SESSION_IDLE_EVICTION_MS\";\n/** Environment override for the concurrent open-session cap. */\nexport const RPC_MAX_SESSIONS_ENV = \"SENPI_RPC_MAX_SESSIONS\";\n/** Environment override for the empty-host exit window, in milliseconds. */\nexport const RPC_HOST_EMPTY_EXIT_MS_ENV = \"SENPI_RPC_HOST_EMPTY_EXIT_MS\";\n/** Environment override for the graceful close_session teardown window, in milliseconds. */\nexport const RPC_CLOSE_GRACE_MS_ENV = \"SENPI_RPC_CLOSE_GRACE_MS\";\n/** Default idle-eviction window: 30 minutes after a session's last routed command or settled turn. */\nexport const DEFAULT_SESSION_IDLE_EVICTION_MS = 30 * 60_000;\n/** Default session cap: an idle session holds a full runtime (~340-510 MB RSS measured). */\nexport const DEFAULT_MAX_SESSIONS = 8;\n/** Default empty-host exit: 15 minutes with zero open sessions, matching the supervisor's idle window. */\nexport const DEFAULT_HOST_EMPTY_EXIT_MS = 15 * 60_000;\n/** Win32 named-pipe close can leave libuv's server callback pending after handles are destroyed. */\nconst WINDOWS_SHUTDOWN_HARD_EXIT_MS = 2_000;\n\n/** Explicit occupancy-policy overrides for createHostCore; tests inject clocks and hooks here. */\nexport interface HostIdleOverrides {\n\tnow?: () => number;\n\tidleEvictionMs?: number;\n\temptyExitMs?: number;\n\tmaxSessions?: number;\n\tcloseGraceMs?: number;\n\t/** Shutdown hook the empty-exit window invokes; hosts pass their exit path. */\n\tonEmptyExit?: () => void;\n\t/** Gate consulted before the empty-exit window advances (connected clients block it). */\n\tcanExitWhenEmpty?: () => boolean;\n}\n\nfunction parseSessionCap(value: string | undefined): number | undefined {\n\tif (value === undefined || !/^\\d+$/.test(value.trim())) return undefined;\n\tconst parsed = Number(value.trim());\n\treturn Number.isFinite(parsed) && parsed > 0 ? parsed : undefined;\n}\n\n/** Precedence: explicit overrides beat environment variables beat documented defaults. */\nexport function resolveHostIdlePolicy(\n\tenv: Readonly<Record<string, string | undefined>>,\n\toverrides: HostIdleOverrides = {},\n): { now: () => number; idleEvictionMs: number; emptyExitMs: number; maxSessions: number } {\n\treturn {\n\t\tnow: overrides.now ?? Date.now,\n\t\tidleEvictionMs:\n\t\t\toverrides.idleEvictionMs ??\n\t\t\tparseIdleExitMs(env[RPC_SESSION_IDLE_EVICTION_MS_ENV]) ??\n\t\t\tDEFAULT_SESSION_IDLE_EVICTION_MS,\n\t\temptyExitMs:\n\t\t\toverrides.emptyExitMs ?? parseIdleExitMs(env[RPC_HOST_EMPTY_EXIT_MS_ENV]) ?? DEFAULT_HOST_EMPTY_EXIT_MS,\n\t\tmaxSessions: overrides.maxSessions ?? parseSessionCap(env[RPC_MAX_SESSIONS_ENV]) ?? DEFAULT_MAX_SESSIONS,\n\t};\n}\n\ninterface Connection {\n\treadonly id: string;\n\treadonly sink: RpcConnectionSink;\n\treadonly detach: () => void;\n\treadonly close: () => void;\n}\n\n/**\n * Socket agent events are delivered only to connections attached to their\n * session, tagged with its routing sessionId. Content-free session lifecycle\n * events remain visible to every connection. Responses and extension UI\n * requests remain requester-only; foreign observation uses attach-on-open.\n */\nexport async function runMultiSessionHost(options: MultiSessionHostOptions): Promise<never> {\n\tif (options.listen === undefined || options.listen === \"stdio://\") return runStdioHost(options);\n\treturn runSocketHost(options, resolveSocketPath(options.listen, options.agentDir));\n}\n\nexport function createHostCore(\n\toptions: MultiSessionHostOptions,\n\twriter: SessionEventWriter,\n\tcapabilities = parseClientCapabilities(envValue(\"RPC_CLIENT_CAPABILITIES\")),\n\tidle: HostIdleOverrides = {},\n) {\n\tconst policy = resolveHostIdlePolicy(process.env, idle);\n\tconst router = new SessionCommandRouter(\n\t\tnew RpcSessionRegistry({\n\t\t\tagentDir: options.agentDir,\n\t\t\tcreateRuntime: options.createRuntime,\n\t\t\tnow: policy.now,\n\t\t\tmaxSessions: policy.maxSessions,\n\t\t\tcloseGraceMs: idle.closeGraceMs ?? parseIdleExitMs(process.env[RPC_CLOSE_GRACE_MS_ENV]) ?? 10_000,\n\t\t}),\n\t\twriter,\n\t\toptions,\n\t\toptions.createBinding,\n\t\t{ capabilities },\n\t\t{\n\t\t\tnow: policy.now,\n\t\t\tidleEvictionMs: policy.idleEvictionMs,\n\t\t\temptyExitMs: policy.emptyExitMs,\n\t\t\tonEmptyExit: idle.onEmptyExit,\n\t\t\tcanExitWhenEmpty: idle.canExitWhenEmpty,\n\t\t},\n\t);\n\tconst handle = async (line: string): Promise<void> => {\n\t\tlet parsed: unknown;\n\t\ttry {\n\t\t\tparsed = JSON.parse(line);\n\t\t} catch (cause) {\n\t\t\tawait writer.enqueueControl(parseError(`Failed to parse command: ${errorMessage(cause)}`));\n\t\t\treturn;\n\t\t}\n\t\tconst shapeError = rpcCommandShapeError(parsed);\n\t\tif (shapeError) {\n\t\t\tawait writer.enqueueControl(parseError(shapeError));\n\t\t\treturn;\n\t\t}\n\t\tconst response = await router.handle(parsed as RpcCommand);\n\t\tif (response) await writer.enqueueControl(response);\n\t};\n\treturn { router, handle };\n}\n\n/** Plain-stdio host with no eagerly-created AgentSessionRuntime. */\nasync function runStdioHost(options: MultiSessionHostOptions): Promise<never> {\n\ttakeOverStdout();\n\tconst sink: RpcConnectionSink = { writeRaw: writeRawStdout, waitForBackpressure: waitForRawStdoutBackpressure };\n\tconst writer = new SessionEventWriter(sink.writeRaw, sink.waitForBackpressure);\n\t// An empty host (no session ever opened, or all closed) must not stay resident\n\t// forever: exit through the normal shutdown path once the window elapses.\n\tconst { router, handle } = createHostCore(options, writer, undefined, {\n\t\tonEmptyExit: () => void shutdown(0),\n\t});\n\tlet shuttingDown = false;\n\tconst shutdown = async (exitCode = 0): Promise<never> => {\n\t\tif (shuttingDown) process.exit(exitCode);\n\t\tshuttingDown = true;\n\t\tdetach();\n\t\tawait router.dispose();\n\t\tawait writer.flush();\n\t\tawait flushRawStdout();\n\t\tprocess.exit(exitCode);\n\t};\n\tconst onEnd = () => void shutdown();\n\tprocess.stdin.on(\"end\", onEnd);\n\tconst detachReader = attachJsonlLineReader(process.stdin, (line) => void handle(line), {\n\t\tmaxLineLength: MAX_RPC_LINE_CHARACTERS,\n\t\tonOversizedLine: () => void writer.enqueueControl(parseError(oversizedLineError())),\n\t});\n\tconst detach = () => {\n\t\tdetachReader();\n\t\tprocess.stdin.off(\"end\", onEnd);\n\t};\n\tregisterShutdownSignals(shutdown);\n\treturn new Promise(() => {});\n}\n\nasync function runSocketHost(options: MultiSessionHostOptions, socketPath: string): Promise<never> {\n\tawait prepareSocketPath(socketPath);\n\tconst writer = new SessionEventWriter(() => {});\n\tconst connections = new Map<string, Connection>();\n\tconst { router, handle } = createHostCore(\n\t\toptions,\n\t\twriter,\n\t\tparseClientCapabilities(envValue(\"RPC_CLIENT_CAPABILITIES\")).filter(\n\t\t\t(capability) => capability !== \"rendered_components\",\n\t\t),\n\t\t// Supervised hosts idle-exit via the supervisor, but a socket host that\n\t\t// outlives its supervisor (or is started bare) still self-exits when empty.\n\t\t// A connected client counts as occupancy even with no session open: exiting\n\t\t// under it would drop its socket and read as a crash to the supervisor.\n\t\t{ onEmptyExit: () => void shutdown(0), canExitWhenEmpty: () => connections.size === 0 },\n\t);\n\tlet nextConnection = 0;\n\tlet shuttingDown = false;\n\tconst secret =\n\t\tprocess.platform === \"win32\"\n\t\t\t? await ensureSocketSecret(process.env[SOCKET_SECRET_FILE_ENV] ?? socketSecretPath(socketPath))\n\t\t\t: undefined;\n\tconst server = createServer((socket) => {\n\t\tconst accept = (): void => {\n\t\t\tconst id = `socket-${++nextConnection}`;\n\t\t\tconst sink = socketSink(socket);\n\t\t\twriter.registerConnection(id, sink);\n\t\t\tconst detachReader = attachJsonlLineReader(\n\t\t\t\tsocket,\n\t\t\t\t(line) => {\n\t\t\t\t\t// Do not serialize awaited commands: extension_ui_response and other\n\t\t\t\t\t// re-entrant frames must be able to resolve a command already awaiting them.\n\t\t\t\t\tvoid writer\n\t\t\t\t\t\t.withConnection(id, () => handle(line))\n\t\t\t\t\t\t.catch((cause) => {\n\t\t\t\t\t\t\tprocess.stderr.write(`senpi rpc connection ${id} failed: ${errorMessage(cause)}\\n`);\n\t\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmaxLineLength: MAX_RPC_LINE_CHARACTERS,\n\t\t\t\t\tonOversizedLine: () => {\n\t\t\t\t\t\tvoid writer\n\t\t\t\t\t\t\t.withConnection(id, () => writer.enqueueControl(parseError(oversizedLineError())))\n\t\t\t\t\t\t\t.catch((cause) =>\n\t\t\t\t\t\t\t\tprocess.stderr.write(`senpi rpc connection ${id} failed: ${errorMessage(cause)}\\n`),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t);\n\t\t\tlet detached = false;\n\t\t\tconst detach = () => {\n\t\t\t\tif (detached) return;\n\t\t\t\tdetached = true;\n\t\t\t\tdetachReader();\n\t\t\t\twriter.unregisterConnection(id);\n\t\t\t\tconnections.delete(id);\n\t\t\t\t// A socket that dies without close_session still owns its sessions' attachments\n\t\t\t\t// and path reservations. Release them on the command chain so this runs after any\n\t\t\t\t// in-flight command for this connection settles, otherwise the path stays pinned\n\t\t\t\t// by a runtime whose client is gone and later resumes attach to that orphan.\n\t\t\t\tvoid router.releaseConnection(id).catch((cause) => {\n\t\t\t\t\tprocess.stderr.write(`senpi rpc connection ${id} release failed: ${errorMessage(cause)}\\n`);\n\t\t\t\t});\n\t\t\t};\n\t\t\tconnections.set(id, { id, sink, detach, close: () => socket.destroy() });\n\t\t\tsocket.once(\"close\", detach);\n\t\t\tsocket.once(\"error\", () => detach());\n\t\t};\n\t\tif (secret) authenticateSocket(socket, secret, accept);\n\t\telse accept();\n\t});\n\tserver.on(\"error\", (cause) => {\n\t\tif (!shuttingDown) process.stderr.write(`senpi rpc socket listener failed: ${errorMessage(cause)}\\n`);\n\t});\n\tconst shutdown = async (exitCode = 0, watchdogCleanup?: Promise<void>): Promise<never> => {\n\t\tif (shuttingDown) process.exit(exitCode);\n\t\tshuttingDown = true;\n\t\t// On Windows, destroying named-pipe sockets does not always make libuv's\n\t\t// server.close callback fire: connected pipe instances can remain in the\n\t\t// kernel after the JavaScript handles are destroyed. Keep the normal drain\n\t\t// path, but never let that platform-specific close stall orphan the host.\n\t\ttry {\n\t\t\tfor (const connection of connections.values()) {\n\t\t\t\tconnection.detach();\n\t\t\t\tconnection.close();\n\t\t\t}\n\t\t\tawait (process.platform === \"win32\"\n\t\t\t\t? Promise.race([closeServer(server), delay(WINDOWS_SHUTDOWN_HARD_EXIT_MS)])\n\t\t\t\t: closeServer(server));\n\t\t\tawait router.dispose();\n\t\t\tawait writer.flush();\n\t\t\tawait removeSocketPath(socketPath);\n\t\t\tif (watchdogCleanup) await watchdogCleanup;\n\t\t} finally {\n\t\t\t// Explicitly terminate after every shutdown trigger. Windows named-pipe\n\t\t\t// handles are not fully controllable from JS, and an unresolved cleanup\n\t\t\t// must not leave this daemon or its public endpoint alive.\n\t\t\tprocess.exit(exitCode);\n\t\t}\n\t};\n\tregisterShutdownSignals(shutdown);\n\t// Arm before listen: a supervisor death during the listen transition must\n\t// still close the child and clean its private endpoint.\n\tarmHostWatchdog(readHostWatchdogConfigFromBrandEnv(), (reason, cleanup) => {\n\t\tprocess.stderr.write(`senpi rpc host: ${reason}; shutting down\\n`);\n\t\t// Enter shutdown before killing session-owned child processes. The Windows\n\t\t// tree killer is synchronous, while the shutdown fallback must be armed\n\t\t// before any such cleanup can delay the event loop.\n\t\tvoid shutdown(0, cleanup);\n\t\tsetImmediate(killTrackedDetachedChildren);\n\t});\n\tawait listen(server, socketPath, secret);\n\tprocess.stderr.write(`senpi rpc listening on ${formatSocketAddress(socketPath)}\\n`);\n\n\t// Opt-in only: set by the lifecycle supervisor so this host can never outlive\n\t// it, including when the supervisor is SIGKILLed and runs no handler at all.\n\treturn new Promise(() => {});\n}\n\nfunction delay(ms: number): Promise<void> {\n\treturn new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nfunction parseError(error: string): RpcResponse {\n\treturn { type: \"response\", command: \"parse\", success: false, error };\n}\n\nfunction oversizedLineError(): string {\n\treturn `RPC input line exceeds ${MAX_RPC_LINE_CHARACTERS} characters.`;\n}\n\nfunction errorMessage(cause: unknown): string {\n\treturn cause instanceof Error ? cause.message : String(cause);\n}\n\nfunction resolveSocketPath(value: string, agentDir: string): string {\n\tif (value === \"unix://\") return join(agentDir, \"rpc\", \"rpc.sock\");\n\tif (value.startsWith(\"unix://\")) {\n\t\tconst path = value.slice(\"unix://\".length);\n\t\tif (path.length === 0) return join(agentDir, \"rpc\", \"rpc.sock\");\n\t\tif (path.startsWith(\"@\") && process.platform === \"linux\") return `\\0${path.slice(1)}`;\n\t\treturn path;\n\t}\n\treturn value;\n}\n\nfunction formatSocketAddress(socketPath: string): string {\n\treturn socketPath.startsWith(\"\\0\") ? `unix://@${socketPath.slice(1)}` : `unix://${socketPath}`;\n}\n\nfunction socketSink(socket: Socket): RpcConnectionSink {\n\tlet needsDrain = false;\n\treturn {\n\t\twriteRaw(chunk) {\n\t\t\tif (!socket.destroyed) needsDrain = !socket.write(chunk);\n\t\t},\n\t\tclose() {\n\t\t\tsocket.destroy();\n\t\t},\n\t\twaitForBackpressure() {\n\t\t\tif (socket.destroyed || !needsDrain) return Promise.resolve();\n\t\t\tneedsDrain = false;\n\t\t\treturn new Promise<void>((resolve) => {\n\t\t\t\tconst done = () => {\n\t\t\t\t\tsocket.off(\"drain\", done);\n\t\t\t\t\tsocket.off(\"close\", done);\n\t\t\t\t\tresolve();\n\t\t\t\t};\n\t\t\t\tsocket.once(\"drain\", done);\n\t\t\t\tsocket.once(\"close\", done);\n\t\t\t});\n\t\t},\n\t};\n}\n\nasync function prepareSocketPath(socketPath: string): Promise<void> {\n\tif (process.platform === \"win32\" || socketPath.startsWith(\"\\0\")) return;\n\tawait mkdir(dirname(socketPath), { recursive: true, mode: 0o700 });\n\ttry {\n\t\tawait access(socketPath);\n\t} catch (cause) {\n\t\tif (isNodeErrorCode(cause, \"ENOENT\")) return;\n\t\tthrow cause;\n\t}\n\tif (await probeSocket(socketPath)) throw new Error(`${socketPath}: address already in use by a live server.`);\n\tawait unlink(socketPath);\n}\n\nfunction probeSocket(socketPath: string): Promise<boolean> {\n\treturn new Promise((resolve) => {\n\t\tconst socket = createConnection(resolveSocketTransportAddress(socketPath, process.platform));\n\t\tconst settle = (live: boolean) => {\n\t\t\tsocket.destroy();\n\t\t\tresolve(live);\n\t\t};\n\t\tsocket.once(\"connect\", () => settle(true));\n\t\tsocket.once(\"error\", () => settle(false));\n\t\tsocket.setTimeout(1_000, () => settle(false));\n\t});\n}\n\nfunction listen(server: Server, socketPath: string, secret?: Uint8Array): Promise<void> {\n\treturn new Promise((resolve, reject) => {\n\t\tserver.once(\"error\", reject);\n\t\tserver.listen(resolveSocketTransportAddress(socketPath, process.platform, secret), async () => {\n\t\t\tserver.off(\"error\", reject);\n\t\t\ttry {\n\t\t\t\tif (process.platform !== \"win32\" && !socketPath.startsWith(\"\\0\")) await chmod(socketPath, 0o600);\n\t\t\t\tresolve();\n\t\t\t} catch (cause) {\n\t\t\t\treject(cause);\n\t\t\t}\n\t\t});\n\t});\n}\n\nfunction closeServer(server: Server): Promise<void> {\n\treturn new Promise((resolve, reject) => {\n\t\tserver.close((cause) => (cause ? reject(cause) : resolve()));\n\t});\n}\n\nasync function removeSocketPath(socketPath: string): Promise<void> {\n\tif (process.platform === \"win32\" || socketPath.startsWith(\"\\0\")) return;\n\ttry {\n\t\tawait unlink(socketPath);\n\t} catch (cause) {\n\t\tif (!isNodeErrorCode(cause, \"ENOENT\")) throw cause;\n\t}\n}\n\nfunction isNodeErrorCode(cause: unknown, code: string): boolean {\n\treturn cause instanceof Error && \"code\" in cause && cause.code === code;\n}\n\nfunction registerShutdownSignals(shutdown: (exitCode?: number) => Promise<never>): void {\n\tfor (const signal of process.platform === \"win32\" ? ([\"SIGTERM\"] as const) : ([\"SIGTERM\", \"SIGHUP\"] as const)) {\n\t\tprocess.on(signal, () => {\n\t\t\tkillTrackedDetachedChildren();\n\t\t\tvoid shutdown(signal === \"SIGHUP\" ? 129 : 143);\n\t\t});\n\t}\n}\n"]}
|
|
@@ -385,6 +385,14 @@ export declare class RpcClient {
|
|
|
385
385
|
* Get all messages in the session.
|
|
386
386
|
*/
|
|
387
387
|
getMessages(): Promise<AgentMessage[]>;
|
|
388
|
+
/**
|
|
389
|
+
* Fetch one media block that arrived as an `image_ref` placeholder.
|
|
390
|
+
*
|
|
391
|
+
* `contentIndex` is the index inside the tool result's `content` array carried by
|
|
392
|
+
* the placeholder's `ref`. Rejects with `media_not_found` when the tool call is
|
|
393
|
+
* unknown or the index does not point at an image block.
|
|
394
|
+
*/
|
|
395
|
+
getMedia(toolCallId: string, contentIndex: number): Promise<ImageContent>;
|
|
388
396
|
/**
|
|
389
397
|
* Get available commands (extension commands, prompt templates, skills).
|
|
390
398
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-client.d.ts","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAEjF,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACnF,OAAO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GAAG,OAAO,CAAC,IAAI,CAAC;IAI9E,iFAAiF;IAC3E,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ1E;;;OAGG;IACH,WAAW,CAAC,OAAO,SAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB3C;;OAEG;IACH,aAAa,CAAC,OAAO,SAAQ,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IA6BhE;;OAEG;IACG,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,EAAE,EAAE,OAAO,SAAQ,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAUhH,OAAO,CAAC,UAAU;IA0ClB,OAAO,CAAC,yBAAyB;IAUjC,OAAO,CAAC,sBAAsB;IAI9B,OAAO,CAAC,gBAAgB;IAQxB,OAAO,CAAC,qBAAqB;YAQf,IAAI;IAsElB,OAAO,CAAC,OAAO;CAef"}
|
|
@@ -601,6 +601,17 @@ export class RpcClient {
|
|
|
601
601
|
const response = await this.send({ type: "get_messages" });
|
|
602
602
|
return this.getData(response).messages;
|
|
603
603
|
}
|
|
604
|
+
/**
|
|
605
|
+
* Fetch one media block that arrived as an `image_ref` placeholder.
|
|
606
|
+
*
|
|
607
|
+
* `contentIndex` is the index inside the tool result's `content` array carried by
|
|
608
|
+
* the placeholder's `ref`. Rejects with `media_not_found` when the tool call is
|
|
609
|
+
* unknown or the index does not point at an image block.
|
|
610
|
+
*/
|
|
611
|
+
async getMedia(toolCallId, contentIndex) {
|
|
612
|
+
const response = await this.send({ type: "get_media", toolCallId, contentIndex });
|
|
613
|
+
return this.getData(response).content;
|
|
614
|
+
}
|
|
604
615
|
/**
|
|
605
616
|
* Get available commands (extension commands, prompt templates, skills).
|
|
606
617
|
*/
|