@code-yeongyu/senpi 2026.9.4 → 2026.9.5
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 +116 -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 +17 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +86 -3
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +31 -41
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +16 -7
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/credential-pool/state-store.d.ts +1 -0
- package/dist/core/credential-pool/state-store.d.ts.map +1 -1
- package/dist/core/credential-pool/state-store.js +22 -2
- package/dist/core/credential-pool/state-store.js.map +1 -1
- package/dist/core/extensions/builtin/bash-timeout/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/bash-timeout/index.js +1 -5
- package/dist/core/extensions/builtin/bash-timeout/index.js.map +1 -1
- package/dist/core/extensions/builtin/bash-timeout/timeout.d.ts +0 -2
- package/dist/core/extensions/builtin/bash-timeout/timeout.d.ts.map +1 -1
- package/dist/core/extensions/builtin/bash-timeout/timeout.js +3 -4
- package/dist/core/extensions/builtin/bash-timeout/timeout.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/model-usability-budget.d.ts +5 -0
- package/dist/core/extensions/builtin/compaction/model-usability-budget.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/model-usability-budget.js +11 -4
- package/dist/core/extensions/builtin/compaction/model-usability-budget.js.map +1 -1
- package/dist/core/extensions/builtin/goal/prompt.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/prompt.js +1 -3
- package/dist/core/extensions/builtin/goal/prompt.js.map +1 -1
- package/dist/core/extensions/builtin/goal/store.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/store.js +8 -20
- package/dist/core/extensions/builtin/goal/store.js.map +1 -1
- package/dist/core/extensions/builtin/goal/tool-registration.js +1 -1
- package/dist/core/extensions/builtin/goal/tool-registration.js.map +1 -1
- package/dist/core/extensions/builtin/hooks/trust-storage.d.ts.map +1 -1
- package/dist/core/extensions/builtin/hooks/trust-storage.js +3 -1
- package/dist/core/extensions/builtin/hooks/trust-storage.js.map +1 -1
- package/dist/core/extensions/builtin/imagegen/auth.d.ts.map +1 -1
- package/dist/core/extensions/builtin/imagegen/auth.js +10 -2
- package/dist/core/extensions/builtin/imagegen/auth.js.map +1 -1
- package/dist/core/extensions/builtin/loop/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop/index.js +20 -1
- package/dist/core/extensions/builtin/loop/index.js.map +1 -1
- package/dist/core/extensions/builtin/loop/store.d.ts +8 -6
- package/dist/core/extensions/builtin/loop/store.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop/store.js +54 -88
- package/dist/core/extensions/builtin/loop/store.js.map +1 -1
- package/dist/core/extensions/builtin/loop/tools.d.ts +6 -1
- package/dist/core/extensions/builtin/loop/tools.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop/tools.js +8 -1
- package/dist/core/extensions/builtin/loop/tools.js.map +1 -1
- package/dist/core/extensions/builtin/monitor-state-event.d.ts +2 -0
- package/dist/core/extensions/builtin/monitor-state-event.d.ts.map +1 -1
- package/dist/core/extensions/builtin/monitor-state-event.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.d.ts +9 -5
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js +20 -11
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js.map +1 -1
- package/dist/core/extensions/builtin/recommended-models/index.d.ts +1 -1
- package/dist/core/extensions/builtin/recommended-models/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/recommended-models/index.js +1 -0
- package/dist/core/extensions/builtin/recommended-models/index.js.map +1 -1
- package/dist/core/extensions/builtin/service-tier.d.ts.map +1 -1
- package/dist/core/extensions/builtin/service-tier.js +12 -4
- package/dist/core/extensions/builtin/service-tier.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/durable-command.d.ts +31 -0
- package/dist/core/extensions/builtin/terminal/durable-command.d.ts.map +1 -0
- package/dist/core/extensions/builtin/terminal/durable-command.js +96 -0
- package/dist/core/extensions/builtin/terminal/durable-command.js.map +1 -0
- package/dist/core/extensions/builtin/terminal/durable-file.d.ts +42 -0
- package/dist/core/extensions/builtin/terminal/durable-file.d.ts.map +1 -0
- package/dist/core/extensions/builtin/terminal/durable-file.js +102 -0
- package/dist/core/extensions/builtin/terminal/durable-file.js.map +1 -0
- package/dist/core/extensions/builtin/terminal/extension.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/extension.js +226 -3
- package/dist/core/extensions/builtin/terminal/extension.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/manager.d.ts +10 -0
- package/dist/core/extensions/builtin/terminal/manager.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/manager.js +21 -0
- package/dist/core/extensions/builtin/terminal/manager.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/manifest-lease.d.ts +24 -0
- package/dist/core/extensions/builtin/terminal/manifest-lease.d.ts.map +1 -0
- package/dist/core/extensions/builtin/terminal/manifest-lease.js +105 -0
- package/dist/core/extensions/builtin/terminal/manifest-lease.js.map +1 -0
- package/dist/core/extensions/builtin/terminal/monitor-notify.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-notify.js +5 -1
- package/dist/core/extensions/builtin/terminal/monitor-notify.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-registry.d.ts +42 -2
- package/dist/core/extensions/builtin/terminal/monitor-registry.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-registry.js +73 -2
- package/dist/core/extensions/builtin/terminal/monitor-registry.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-status.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-status.js +21 -1
- package/dist/core/extensions/builtin/terminal/monitor-status.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/prompt.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/prompt.js +9 -5
- package/dist/core/extensions/builtin/terminal/prompt.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/restore.d.ts +56 -0
- package/dist/core/extensions/builtin/terminal/restore.d.ts.map +1 -0
- package/dist/core/extensions/builtin/terminal/restore.js +177 -0
- package/dist/core/extensions/builtin/terminal/restore.js.map +1 -0
- package/dist/core/extensions/builtin/terminal/shared.d.ts +25 -0
- package/dist/core/extensions/builtin/terminal/shared.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/shared.js +25 -0
- package/dist/core/extensions/builtin/terminal/shared.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/terminal-manifest-model.d.ts +91 -0
- package/dist/core/extensions/builtin/terminal/terminal-manifest-model.d.ts.map +1 -0
- package/dist/core/extensions/builtin/terminal/terminal-manifest-model.js +14 -0
- package/dist/core/extensions/builtin/terminal/terminal-manifest-model.js.map +1 -0
- package/dist/core/extensions/builtin/terminal/terminal-manifest.d.ts +62 -0
- package/dist/core/extensions/builtin/terminal/terminal-manifest.d.ts.map +1 -0
- package/dist/core/extensions/builtin/terminal/terminal-manifest.js +204 -0
- package/dist/core/extensions/builtin/terminal/terminal-manifest.js.map +1 -0
- package/dist/core/extensions/builtin/terminal/tools/bash-input.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash-input.js +3 -2
- package/dist/core/extensions/builtin/terminal/tools/bash-input.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash-output.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash-output.js +5 -4
- package/dist/core/extensions/builtin/terminal/tools/bash-output.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash-resize.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash-resize.js +3 -2
- package/dist/core/extensions/builtin/terminal/tools/bash-resize.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/context.d.ts +8 -0
- package/dist/core/extensions/builtin/terminal/tools/context.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/context.js +10 -0
- package/dist/core/extensions/builtin/terminal/tools/context.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/kill-bash.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/kill-bash.js +5 -4
- package/dist/core/extensions/builtin/terminal/tools/kill-bash.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/monitor.d.ts +4 -1
- package/dist/core/extensions/builtin/terminal/tools/monitor.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/monitor.js +114 -22
- package/dist/core/extensions/builtin/terminal/tools/monitor.js.map +1 -1
- package/dist/core/extensions/builtin/todotools/prompt.d.ts +2 -2
- package/dist/core/extensions/builtin/todotools/prompt.d.ts.map +1 -1
- package/dist/core/extensions/builtin/todotools/prompt.js +3 -6
- package/dist/core/extensions/builtin/todotools/prompt.js.map +1 -1
- package/dist/core/extensions/builtin/tool-search/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/tool-search/index.js +1 -1
- package/dist/core/extensions/builtin/tool-search/index.js.map +1 -1
- package/dist/core/extensions/builtin/tool-search/native-search.d.ts +9 -4
- package/dist/core/extensions/builtin/tool-search/native-search.d.ts.map +1 -1
- package/dist/core/extensions/builtin/tool-search/native-search.js +11 -6
- package/dist/core/extensions/builtin/tool-search/native-search.js.map +1 -1
- package/dist/core/extensions/builtin/tool-search/native-support.d.ts +13 -0
- package/dist/core/extensions/builtin/tool-search/native-support.d.ts.map +1 -0
- package/dist/core/extensions/builtin/tool-search/native-support.js +45 -0
- package/dist/core/extensions/builtin/tool-search/native-support.js.map +1 -0
- package/dist/core/extensions/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/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +18 -1
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/http-dispatcher.js +2 -0
- package/dist/core/http-dispatcher.js.map +1 -1
- package/dist/core/lockfile-policy.d.ts +11 -0
- package/dist/core/lockfile-policy.d.ts.map +1 -1
- package/dist/core/lockfile-policy.js +19 -0
- package/dist/core/lockfile-policy.js.map +1 -1
- package/dist/core/manual-continue.d.ts +13 -0
- package/dist/core/manual-continue.d.ts.map +1 -0
- package/dist/core/manual-continue.js +19 -0
- package/dist/core/manual-continue.js.map +1 -0
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js +8 -2
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +3 -0
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +13 -2
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/retry-fallback/chains.d.ts +1 -13
- package/dist/core/retry-fallback/chains.d.ts.map +1 -1
- package/dist/core/retry-fallback/chains.js +3 -49
- package/dist/core/retry-fallback/chains.js.map +1 -1
- package/dist/core/retry-fallback/controller.d.ts.map +1 -1
- package/dist/core/retry-fallback/controller.js +4 -9
- package/dist/core/retry-fallback/controller.js.map +1 -1
- package/dist/core/retry-fallback/expansion.js +1 -1
- package/dist/core/retry-fallback/expansion.js.map +1 -1
- package/dist/core/retry-fallback/settings.d.ts +2 -4
- package/dist/core/retry-fallback/settings.d.ts.map +1 -1
- package/dist/core/retry-fallback/settings.js +7 -36
- package/dist/core/retry-fallback/settings.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +1 -1
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +10 -3
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-sidecar-store.d.ts +62 -0
- package/dist/core/session-sidecar-store.d.ts.map +1 -0
- package/dist/core/session-sidecar-store.js +149 -0
- package/dist/core/session-sidecar-store.js.map +1 -0
- package/dist/core/settings-manager.d.ts +5 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +45 -15
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +19 -2
- package/dist/core/skills.js.map +1 -1
- package/dist/core/terminal-settings.d.ts +3 -0
- package/dist/core/terminal-settings.d.ts.map +1 -1
- package/dist/core/terminal-settings.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +1 -1
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +2 -2
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +2 -2
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +2 -2
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +2 -2
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +1 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +3 -3
- package/dist/core/tools/write.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +2 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/app-server/daemon/process.d.ts +33 -3
- package/dist/modes/app-server/daemon/process.d.ts.map +1 -1
- package/dist/modes/app-server/daemon/process.js +57 -6
- package/dist/modes/app-server/daemon/process.js.map +1 -1
- package/dist/modes/app-server/daemon.js +9 -1
- package/dist/modes/app-server/daemon.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +5 -11
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +2 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +21 -8
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +2 -2
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/trust-selector.js +2 -2
- package/dist/modes/interactive/components/trust-selector.js.map +1 -1
- package/dist/modes/interactive/grok/welcome-card.d.ts.map +1 -1
- package/dist/modes/interactive/grok/welcome-card.js +5 -2
- package/dist/modes/interactive/grok/welcome-card.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +3 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +83 -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/rpc/host-ensure.d.ts +2 -0
- package/dist/modes/rpc/host-ensure.d.ts.map +1 -1
- package/dist/modes/rpc/host-ensure.js +77 -18
- package/dist/modes/rpc/host-ensure.js.map +1 -1
- package/dist/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 +1 -1
- package/docs/settings.md +13 -5
- package/docs/terminal-setup.md +27 -0
- package/docs/terminal-tools.md +35 -4
- package/docs/usage.md +5 -3
- 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 +45 -0
- package/node_modules/@code-yeongyu/senpi-codemode/README.md +4 -2
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +5 -5
- package/node_modules/@code-yeongyu/senpi-codemode/src/config/settings.ts +29 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/extension/session-manager.ts +8 -4
- package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +3 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/display-image.js +162 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/prelude.ts +2 -2
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/worker-runtime.js +29 -60
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/prelude.py +66 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt.ts +28 -94
- 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 +6 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +14 -2
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/types.ts +12 -7
- 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/cursor-agent.js +4 -4
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +3 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +30 -10
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.d.ts +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts +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 +8 -5
- 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/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/image-models.generated.d.ts +30 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +30 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.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 +3 -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 +27 -3
- 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/openai-codex.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/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/prompt-cache-ttl.d.ts +4 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +3 -3
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/README.md +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +36 -3
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts +2 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +106 -6
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +6 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js +17 -4
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts +11 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js +57 -15
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.js +22 -7
- package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/terminal/prompt.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,MAAM,UAAU,0BAA0B,CAAC,OAA8B;IACxE,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC;IACrD,MAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9D,OAAO;;;;;;MAMF,IAAI;;;;;;;;MAQJ,OAAO;;QAEL,OAAO;;;;;;QAMP,OAAO
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/terminal/prompt.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,MAAM,UAAU,0BAA0B,CAAC,OAA8B;IACxE,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC;IACrD,MAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9D,OAAO;;;;;;MAMF,IAAI;;;;;;;;MAQJ,OAAO;;QAEL,OAAO;;;;;;QAMP,OAAO;;;;;;;;;;;MAWT,OAAO,wDAAwD,OAAO;;;;;;CAM3E,CAAC;AACF,CAAC","sourcesContent":["export interface TerminalPromptOptions {\n\t/** True when the session routes shell tools through eval cells, so call shapes must be `tool.<name>(`. */\n\treadonly evalOnly: boolean;\n}\n\n/**\n * System-prompt guidance for the persistent-terminal tool suite (CC-close, snake_case).\n *\n * `bash` and `monitor` leave the model's direct tool list whenever the session has an\n * `eval` tool, so their call shapes are rendered per branch: a hardcoded direct shape\n * would teach a call the model cannot make. The steering companions\n * (`bash_output`/`bash_input`/`bash_resize`/`kill_bash`) stay directly callable in both.\n */\nexport function buildTerminalPromptSection(options: TerminalPromptOptions): string {\n\tconst bash = options.evalOnly ? \"tool.bash\" : \"bash\";\n\tconst monitor = options.evalOnly ? \"tool.monitor\" : \"monitor\";\n\treturn `\n## Persistent terminal sessions\n\nThe \\`bash\\` tool is PTY-backed. For long-running or interactive work, do NOT use tmux or\nmanual \\`&\\` backgrounding — use the built-in session tools:\n\n- \\`${bash}({ command, run_in_background: true })\\` starts a persistent session and returns a\n \\`bash_id\\` immediately. Foreground calls still block and return output; their \\`timeout\\`\n (seconds) is a kill deadline. Background sessions ignore \\`timeout\\` and live until they\n exit or you call \\`kill_bash\\`.\n- \\`bash_output({ bash_id, filter, view })\\` peeks at a session without blocking: new output\n since the last read, the status line, or a rendered full-screen snapshot of TUIs via\n \\`view: \"screen\"\\`. Completion arrives as a notification carrying the exit code and output\n tail — peeking is for steering, never for waiting.\n- \\`${monitor}\\` subscribes you to a change. Pass \\`command\\` XOR \\`path\\` — one branch per call,\n never both:\n - \\`${monitor}({ description, command, filter?, timeout_ms?, persistent? })\\` watches a command:\n newline-terminated PTY output lines (stderr included) matching \\`filter\\` arrive as injected\n events while you keep working; command exit always delivers a summary. One-shot gate: wait\n inside the command and print one sentinel (\\`until <cond>; do sleep 1; done;\n printf 'READY\\\\n'\\`). Stream: \\`tail -n 0 -F | grep --line-buffered\\`. Filter noise at the\n source and stop with \\`kill_bash\\`.\n - \\`${monitor}({ description, path, event?, persistent? })\\` natively watches one regular file and\n fires once — prefer it over a shell poll loop. \\`\"create\"\\` (the default) fires only when the file\n appears after registration, so watch an already-existing file with \\`\"modify\"\\`; registration needs\n the parent directory to exist already, so poll with a \\`command\\` when the run creates that\n directory too. This branch takes no \\`filter\\`.\n A standing watch is marked \\`persistent: true\\`: it has no deadline, survives a session restart\n (the command is re-run once, the file rescanned and any change missed while detached reported),\n expires 7 days after creation, is capped at 5 per session, and is accounted for in one\n restart-report line on session start.\n Identical updates are deduped; repeated monitor-only wakes pause the noisy monitor(s) that\n caused them, not all monitors. Completion still wakes the session, and\n \\`${monitor}({ action: \"rearm\", bash_id })\\` resumes one while \\`${monitor}({ action: \"rearm\" })\\`\n resumes all paused monitors; real user input also resumes paused monitors.\n- \\`bash_input({ bash_id, input, keys, submit })\\` sends stdin or named keys (e.g.\n \\`[\"ctrl+c\"]\\`, \\`[\"enter\"]\\`) to steer a REPL or interrupt a process.\n- \\`bash_resize({ bash_id, cols, rows })\\` resizes the PTY so full-screen programs reflow.\n- \\`kill_bash({ bash_id })\\` (or \\`{ all: true }\\`) tears the session tree down with no orphans.\n`;\n}\n"]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The terminal manifest's read side and restore orchestrator: the strict fail-closed
|
|
3
|
+
* parse every persisted manifest must survive, plus `restoreTerminalState`, which
|
|
4
|
+
* replays the manifest after a restart. Each monitor is classified by its durability
|
|
5
|
+
* class and handed to that class's handler; ephemeral monitors and background sessions
|
|
6
|
+
* are always lost, and an expired watch never reaches its handler. Both durable
|
|
7
|
+
* handler slots ship as stubs reporting `lost` — later phases plug the real ones in.
|
|
8
|
+
*/
|
|
9
|
+
import { InvalidSidecarStoreError, type SidecarStore, type SidecarStoreRef } from "../../../session-sidecar-store.ts";
|
|
10
|
+
import { type ManifestMonitor, type TerminalManifest } from "./terminal-manifest.ts";
|
|
11
|
+
export declare class InvalidTerminalManifestError extends InvalidSidecarStoreError {
|
|
12
|
+
constructor(message: string, options?: {
|
|
13
|
+
cause?: unknown;
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
/** Strict fail-closed domain parse; the sidecar store has already checked version and session. */
|
|
17
|
+
export declare function parseTerminalManifest(raw: unknown, ref: SidecarStoreRef): TerminalManifest;
|
|
18
|
+
export type RestoreOutcome = "restored" | "lost" | "muted" | "attachedElsewhere";
|
|
19
|
+
export interface RestoreHandlerResult {
|
|
20
|
+
readonly outcome: RestoreOutcome;
|
|
21
|
+
/** Why a durable monitor could not be restored; diagnostic only, never part of the digest counts. */
|
|
22
|
+
readonly reason?: string;
|
|
23
|
+
}
|
|
24
|
+
export type RestoreHandler = (monitor: ManifestMonitor) => RestoreHandlerResult | Promise<RestoreHandlerResult>;
|
|
25
|
+
export interface RestoreHandlers {
|
|
26
|
+
readonly "restartable-command": RestoreHandler;
|
|
27
|
+
readonly "checkpointed-file": RestoreHandler;
|
|
28
|
+
}
|
|
29
|
+
/** The registry surface a restore handler needs to re-apply a persisted mute. */
|
|
30
|
+
export interface PersistedMuteRegistry {
|
|
31
|
+
pause(ids: readonly string[]): string[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Re-apply a persisted `deliveryPaused` mute to a freshly restored monitor and report the
|
|
35
|
+
* outcome it contributes to the digest. The mute MUST be applied by the FRESH runtime id
|
|
36
|
+
* (bash_N/watch_N) the restore just allocated: `MonitorRegistry.pause` resolves records by
|
|
37
|
+
* runtime id only, so passing the persisted `mon_` id silently no-ops and the mute is lost.
|
|
38
|
+
*/
|
|
39
|
+
export declare function reapplyPersistedMute(registry: PersistedMuteRegistry, monitor: Pick<ManifestMonitor, "deliveryPaused">, runtimeId: string): RestoreOutcome;
|
|
40
|
+
/** Stub durability handlers: every durable monitor is reported lost until later phases land. */
|
|
41
|
+
export declare const stubRestoreHandlers: RestoreHandlers;
|
|
42
|
+
export interface RestoreDigest {
|
|
43
|
+
restored: number;
|
|
44
|
+
lost: number;
|
|
45
|
+
expired: number;
|
|
46
|
+
muted: number;
|
|
47
|
+
attachedElsewhere: number;
|
|
48
|
+
storeError: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface RestoreTerminalStateOptions {
|
|
51
|
+
readonly manifest: SidecarStore<TerminalManifest>;
|
|
52
|
+
readonly handlers?: Partial<RestoreHandlers>;
|
|
53
|
+
readonly now?: () => number;
|
|
54
|
+
}
|
|
55
|
+
export declare function restoreTerminalState(options: RestoreTerminalStateOptions): Promise<RestoreDigest>;
|
|
56
|
+
//# sourceMappingURL=restore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restore.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/terminal/restore.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,wBAAwB,EAAE,KAAK,YAAY,EAAE,KAAK,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACtH,OAAO,EAEN,KAAK,eAAe,EAEpB,KAAK,gBAAgB,EAErB,MAAM,wBAAwB,CAAC;AAEhC,qBAAa,4BAA6B,SAAQ,wBAAwB;gBAC7D,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAI1D;AAiGD,kGAAkG;AAClG,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,eAAe,GAAG,gBAAgB,CAW1F;AAED,MAAM,M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,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,aAAa,CAAC,CAmCvG"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The terminal manifest's read side and restore orchestrator: the strict fail-closed
|
|
3
|
+
* parse every persisted manifest must survive, plus `restoreTerminalState`, which
|
|
4
|
+
* replays the manifest after a restart. Each monitor is classified by its durability
|
|
5
|
+
* class and handed to that class's handler; ephemeral monitors and background sessions
|
|
6
|
+
* are always lost, and an expired watch never reaches its handler. Both durable
|
|
7
|
+
* handler slots ship as stubs reporting `lost` — later phases plug the real ones in.
|
|
8
|
+
*/
|
|
9
|
+
import { InvalidSidecarStoreError } from "../../../session-sidecar-store.js";
|
|
10
|
+
import { TERMINAL_MANIFEST_VERSION, } from "./terminal-manifest.js";
|
|
11
|
+
export class InvalidTerminalManifestError extends InvalidSidecarStoreError {
|
|
12
|
+
constructor(message, options) {
|
|
13
|
+
super(message, options);
|
|
14
|
+
this.name = "InvalidTerminalManifestError";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const RUNTIME_KINDS = ["command", "file"];
|
|
18
|
+
const DURABILITY_CLASSES = ["ephemeral", "restartable-command", "checkpointed-file"];
|
|
19
|
+
const FILE_EVENTS = ["create", "modify"];
|
|
20
|
+
const isStr = (value) => typeof value === "string" && value.length > 0;
|
|
21
|
+
const isNum = (value) => typeof value === "number" && Number.isFinite(value);
|
|
22
|
+
const isBool = (value) => typeof value === "boolean";
|
|
23
|
+
const isObj = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
24
|
+
function invalid(message) {
|
|
25
|
+
throw new InvalidTerminalManifestError(`terminal manifest is invalid: ${message}`);
|
|
26
|
+
}
|
|
27
|
+
function str(raw, field) {
|
|
28
|
+
if (!isStr(raw[field]))
|
|
29
|
+
invalid(`field ${field} must be a non-empty string`);
|
|
30
|
+
return raw[field];
|
|
31
|
+
}
|
|
32
|
+
function num(raw, field) {
|
|
33
|
+
if (!isNum(raw[field]))
|
|
34
|
+
invalid(`field ${field} must be a finite number`);
|
|
35
|
+
return raw[field];
|
|
36
|
+
}
|
|
37
|
+
function digest(raw, field) {
|
|
38
|
+
if (typeof raw[field] !== "string")
|
|
39
|
+
invalid(`field ${field} must be a string`);
|
|
40
|
+
return raw[field];
|
|
41
|
+
}
|
|
42
|
+
function bool(raw, field) {
|
|
43
|
+
if (!isBool(raw[field]))
|
|
44
|
+
invalid(`field ${field} must be a boolean`);
|
|
45
|
+
return raw[field];
|
|
46
|
+
}
|
|
47
|
+
function opt(raw, field, required) {
|
|
48
|
+
return raw[field] === undefined ? undefined : required(raw, field);
|
|
49
|
+
}
|
|
50
|
+
function oneOf(values, raw, field) {
|
|
51
|
+
const value = raw[field];
|
|
52
|
+
if (typeof value !== "string" || !values.includes(value))
|
|
53
|
+
invalid(`field ${field} must be one of: ${values.join(", ")}`);
|
|
54
|
+
return value;
|
|
55
|
+
}
|
|
56
|
+
function checkpoint(raw) {
|
|
57
|
+
if (!isObj(raw))
|
|
58
|
+
invalid("field lastCheckpoint must be an object");
|
|
59
|
+
return {
|
|
60
|
+
dev: num(raw, "dev"),
|
|
61
|
+
ino: num(raw, "ino"),
|
|
62
|
+
size: num(raw, "size"),
|
|
63
|
+
mtimeMs: num(raw, "mtimeMs"),
|
|
64
|
+
// A checkpoint without a digest cannot detect a same-size, same-mtime rewrite, so the field is
|
|
65
|
+
// required — but an absent file legitimately checkpoints an empty digest, so "" is valid.
|
|
66
|
+
digest: digest(raw, "digest"),
|
|
67
|
+
present: bool(raw, "present"),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function fireWindow(raw) {
|
|
71
|
+
if (!isObj(raw))
|
|
72
|
+
invalid("field fireWindow must be an object");
|
|
73
|
+
return { startMs: num(raw, "startMs"), count: num(raw, "count") };
|
|
74
|
+
}
|
|
75
|
+
function parseMonitor(entry) {
|
|
76
|
+
if (!isObj(entry))
|
|
77
|
+
invalid("a monitor entry must be an object");
|
|
78
|
+
return {
|
|
79
|
+
monitorId: str(entry, "monitorId"),
|
|
80
|
+
sessionId: str(entry, "sessionId"),
|
|
81
|
+
description: str(entry, "description"),
|
|
82
|
+
runtimeKind: oneOf(RUNTIME_KINDS, entry, "runtimeKind"),
|
|
83
|
+
durabilityClass: oneOf(DURABILITY_CLASSES, entry, "durabilityClass"),
|
|
84
|
+
command: opt(entry, "command", str),
|
|
85
|
+
path: opt(entry, "path", str),
|
|
86
|
+
event: opt(entry, "event", (raw, field) => oneOf(FILE_EVENTS, raw, field)),
|
|
87
|
+
filter: opt(entry, "filter", str),
|
|
88
|
+
cwd: opt(entry, "cwd", str),
|
|
89
|
+
approvedParent: opt(entry, "approvedParent", str),
|
|
90
|
+
createdAt: num(entry, "createdAt"),
|
|
91
|
+
expiresAt: entry.expiresAt === undefined || entry.expiresAt === null ? null : num(entry, "expiresAt"),
|
|
92
|
+
persistent: bool(entry, "persistent"),
|
|
93
|
+
suspended: bool(entry, "suspended"),
|
|
94
|
+
lastCheckpoint: entry.lastCheckpoint === null ? null : checkpoint(entry.lastCheckpoint),
|
|
95
|
+
deliveryPaused: bool(entry, "deliveryPaused"),
|
|
96
|
+
// Unknown keys are ignored by this field-by-field parse, so a manifest written before
|
|
97
|
+
// `wakeCount` was dropped still reads back cleanly; no version bump is needed.
|
|
98
|
+
fireWindow: fireWindow(entry.fireWindow),
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function parseBackgroundSession(entry) {
|
|
102
|
+
if (!isObj(entry))
|
|
103
|
+
invalid("a background session entry must be an object");
|
|
104
|
+
return { id: str(entry, "id"), command: str(entry, "command"), startedAtMs: num(entry, "startedAtMs") };
|
|
105
|
+
}
|
|
106
|
+
/** Strict fail-closed domain parse; the sidecar store has already checked version and session. */
|
|
107
|
+
export function parseTerminalManifest(raw, ref) {
|
|
108
|
+
if (!isObj(raw))
|
|
109
|
+
invalid("the payload must be an object");
|
|
110
|
+
if (!Array.isArray(raw.monitors))
|
|
111
|
+
invalid("field monitors must be an array");
|
|
112
|
+
if (!Array.isArray(raw.backgroundSessions))
|
|
113
|
+
invalid("field backgroundSessions must be an array");
|
|
114
|
+
return {
|
|
115
|
+
version: TERMINAL_MANIFEST_VERSION,
|
|
116
|
+
sessionId: ref.sessionId,
|
|
117
|
+
monitors: raw.monitors.map(parseMonitor),
|
|
118
|
+
backgroundSessions: raw.backgroundSessions.map(parseBackgroundSession),
|
|
119
|
+
updatedAt: num(raw, "updatedAt"),
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Re-apply a persisted `deliveryPaused` mute to a freshly restored monitor and report the
|
|
124
|
+
* outcome it contributes to the digest. The mute MUST be applied by the FRESH runtime id
|
|
125
|
+
* (bash_N/watch_N) the restore just allocated: `MonitorRegistry.pause` resolves records by
|
|
126
|
+
* runtime id only, so passing the persisted `mon_` id silently no-ops and the mute is lost.
|
|
127
|
+
*/
|
|
128
|
+
export function reapplyPersistedMute(registry, monitor, runtimeId) {
|
|
129
|
+
if (!monitor.deliveryPaused)
|
|
130
|
+
return "restored";
|
|
131
|
+
registry.pause([runtimeId]);
|
|
132
|
+
return "muted";
|
|
133
|
+
}
|
|
134
|
+
/** Stub durability handlers: every durable monitor is reported lost until later phases land. */
|
|
135
|
+
export const stubRestoreHandlers = {
|
|
136
|
+
"restartable-command": () => ({ outcome: "lost" }),
|
|
137
|
+
"checkpointed-file": () => ({ outcome: "lost" }),
|
|
138
|
+
};
|
|
139
|
+
export async function restoreTerminalState(options) {
|
|
140
|
+
const digest = {
|
|
141
|
+
restored: 0,
|
|
142
|
+
lost: 0,
|
|
143
|
+
expired: 0,
|
|
144
|
+
muted: 0,
|
|
145
|
+
attachedElsewhere: 0,
|
|
146
|
+
storeError: false,
|
|
147
|
+
};
|
|
148
|
+
let state;
|
|
149
|
+
try {
|
|
150
|
+
state = await options.manifest.read();
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
// Fail closed: a corrupt or foreign manifest restores nothing and reports the store error.
|
|
154
|
+
return { ...digest, storeError: true };
|
|
155
|
+
}
|
|
156
|
+
if (state === null)
|
|
157
|
+
return digest;
|
|
158
|
+
const now = (options.now ?? Date.now)();
|
|
159
|
+
const handlers = { ...stubRestoreHandlers, ...options.handlers };
|
|
160
|
+
for (const monitor of state.monitors) {
|
|
161
|
+
// At the deadline the entry is already expired: the handler must not see it at all.
|
|
162
|
+
if (monitor.expiresAt !== null && monitor.expiresAt <= now) {
|
|
163
|
+
digest.expired += 1;
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
if (monitor.durabilityClass === "ephemeral") {
|
|
167
|
+
digest.lost += 1;
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
const outcome = (await handlers[monitor.durabilityClass](monitor)).outcome;
|
|
171
|
+
digest[outcome] += 1;
|
|
172
|
+
}
|
|
173
|
+
// Background sessions carry no durable identity: every one of them is lost.
|
|
174
|
+
digest.lost += state.backgroundSessions.length;
|
|
175
|
+
return digest;
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=restore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restore.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/terminal/restore.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,wBAAwB,EAA2C,MAAM,mCAAmC,CAAC;AACtH,OAAO,EAGN,yBAAyB,GAGzB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,OAAO,4BAA6B,SAAQ,wBAAwB;IACzE,YAAY,OAAe,EAAE,OAA6B;QACzD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAC;IAC5C,CAAC;CACD;AAID,MAAM,aAAa,GAAG,CAAC,SAAS,EAAE,MAAM,CAAU,CAAC;AACnD,MAAM,kBAAkB,GAAG,CAAC,WAAW,EAAE,qBAAqB,EAAE,mBAAm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AAO,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;IACxC,CAAC;IACD,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC;IAClC,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IACxC,MAAM,QAAQ,GAAoB,EAAE,GAAG,mBAAmB,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAClF,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;QACtC,oFAAoF;QACpF,IAAI,OAAO,CAAC,SAAS,KAAK,IAAI,IAAI,OAAO,CAAC,SAAS,IAAI,GAAG,EAAE,CAAC;YAC5D,MAAM,CAAC,OAAO,IAAI,CAAC,CAAC;YACpB,SAAS;QACV,CAAC;QACD,IAAI,OAAO,CAAC,eAAe,KAAK,WAAW,EAAE,CAAC;YAC7C,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC;YACjB,SAAS;QACV,CAAC;QACD,MAAM,OAAO,GAAG,CAAC,MAAM,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;QAC3E,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IACD,4EAA4E;IAC5E,MAAM,CAAC,IAAI,IAAI,KAAK,CAAC,kBAAkB,CAAC,MAAM,CAAC;IAC/C,OAAO,MAAM,CAAC;AACf,CAAC","sourcesContent":["/**\n * The terminal manifest's read side and restore orchestrator: the strict fail-closed\n * parse every persisted manifest must survive, plus `restoreTerminalState`, which\n * replays the manifest after a restart. Each monitor is classified by its durability\n * class and handed to that class's handler; ephemeral monitors and background sessions\n * are always lost, and an expired watch never reaches its handler. Both durable\n * handler slots ship as stubs reporting `lost` — later phases plug the real ones in.\n */\n\nimport { InvalidSidecarStoreError, type SidecarStore, type SidecarStoreRef } from \"../../../session-sidecar-store.ts\";\nimport {\n\ttype ManifestBackgroundSession,\n\ttype ManifestMonitor,\n\tTERMINAL_MANIFEST_VERSION,\n\ttype TerminalManifest,\n\ttype TerminalManifestCheckpoint,\n} from \"./terminal-manifest.ts\";\n\nexport class InvalidTerminalManifestError extends InvalidSidecarStoreError {\n\tconstructor(message: string, options?: { cause?: unknown }) {\n\t\tsuper(message, options);\n\t\tthis.name = \"InvalidTerminalManifestError\";\n\t}\n}\n\ntype Raw = Record<string, unknown>;\n\nconst RUNTIME_KINDS = [\"command\", \"file\"] as const;\nconst DURABILITY_CLASSES = [\"ephemeral\", \"restartable-command\", \"checkpointed-file\"] as const;\nconst FILE_EVENTS = [\"create\", \"modify\"] as const;\nconst isStr = (value: unknown): value is string => typeof value === \"string\" && value.length > 0;\nconst isNum = (value: unknown): value is number => typeof value === \"number\" && Number.isFinite(value);\nconst isBool = (value: unknown): value is boolean => typeof value === \"boolean\";\nconst isObj = (value: unknown): value is Raw => typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nfunction invalid(message: string): never {\n\tthrow new InvalidTerminalManifestError(`terminal manifest is invalid: ${message}`);\n}\n\nfunction str(raw: Raw, field: string): string {\n\tif (!isStr(raw[field])) invalid(`field ${field} must be a non-empty string`);\n\treturn raw[field];\n}\n\nfunction num(raw: Raw, field: string): number {\n\tif (!isNum(raw[field])) invalid(`field ${field} must be a finite number`);\n\treturn raw[field];\n}\n\nfunction digest(raw: Raw, field: string): string {\n\tif (typeof raw[field] !== \"string\") invalid(`field ${field} must be a string`);\n\treturn raw[field];\n}\n\nfunction bool(raw: Raw, field: string): boolean {\n\tif (!isBool(raw[field])) invalid(`field ${field} must be a boolean`);\n\treturn raw[field];\n}\n\nfunction opt<T>(raw: Raw, field: string, required: (raw: Raw, field: string) => T): T | undefined {\n\treturn raw[field] === undefined ? undefined : required(raw, field);\n}\n\nfunction oneOf<T extends string>(values: readonly T[], raw: Raw, field: string): T {\n\tconst value = raw[field];\n\tif (typeof value !== \"string\" || !values.includes(value as T))\n\t\tinvalid(`field ${field} must be one of: ${values.join(\", \")}`);\n\treturn value as T;\n}\n\nfunction checkpoint(raw: unknown): TerminalManifestCheckpoint {\n\tif (!isObj(raw)) invalid(\"field lastCheckpoint must be an object\");\n\treturn {\n\t\tdev: num(raw, \"dev\"),\n\t\tino: num(raw, \"ino\"),\n\t\tsize: num(raw, \"size\"),\n\t\tmtimeMs: num(raw, \"mtimeMs\"),\n\t\t// A checkpoint without a digest cannot detect a same-size, same-mtime rewrite, so the field is\n\t\t// required — but an absent file legitimately checkpoints an empty digest, so \"\" is valid.\n\t\tdigest: digest(raw, \"digest\"),\n\t\tpresent: bool(raw, \"present\"),\n\t};\n}\n\nfunction fireWindow(raw: unknown): { startMs: number; count: number } {\n\tif (!isObj(raw)) invalid(\"field fireWindow must be an object\");\n\treturn { startMs: num(raw, \"startMs\"), count: num(raw, \"count\") };\n}\n\nfunction parseMonitor(entry: unknown): ManifestMonitor {\n\tif (!isObj(entry)) invalid(\"a monitor entry must be an object\");\n\treturn {\n\t\tmonitorId: str(entry, \"monitorId\"),\n\t\tsessionId: str(entry, \"sessionId\"),\n\t\tdescription: str(entry, \"description\"),\n\t\truntimeKind: oneOf(RUNTIME_KINDS, entry, \"runtimeKind\"),\n\t\tdurabilityClass: oneOf(DURABILITY_CLASSES, entry, \"durabilityClass\"),\n\t\tcommand: opt(entry, \"command\", str),\n\t\tpath: opt(entry, \"path\", str),\n\t\tevent: opt(entry, \"event\", (raw, field) => oneOf(FILE_EVENTS, raw, field)),\n\t\tfilter: opt(entry, \"filter\", str),\n\t\tcwd: opt(entry, \"cwd\", str),\n\t\tapprovedParent: opt(entry, \"approvedParent\", str),\n\t\tcreatedAt: num(entry, \"createdAt\"),\n\t\texpiresAt: entry.expiresAt === undefined || entry.expiresAt === null ? null : num(entry, \"expiresAt\"),\n\t\tpersistent: bool(entry, \"persistent\"),\n\t\tsuspended: bool(entry, \"suspended\"),\n\t\tlastCheckpoint: entry.lastCheckpoint === null ? null : checkpoint(entry.lastCheckpoint),\n\t\tdeliveryPaused: bool(entry, \"deliveryPaused\"),\n\t\t// Unknown keys are ignored by this field-by-field parse, so a manifest written before\n\t\t// `wakeCount` was dropped still reads back cleanly; no version bump is needed.\n\t\tfireWindow: fireWindow(entry.fireWindow),\n\t};\n}\n\nfunction parseBackgroundSession(entry: unknown): ManifestBackgroundSession {\n\tif (!isObj(entry)) invalid(\"a background session entry must be an object\");\n\treturn { id: str(entry, \"id\"), command: str(entry, \"command\"), startedAtMs: num(entry, \"startedAtMs\") };\n}\n\n/** Strict fail-closed domain parse; the sidecar store has already checked version and session. */\nexport function parseTerminalManifest(raw: unknown, ref: SidecarStoreRef): TerminalManifest {\n\tif (!isObj(raw)) invalid(\"the payload must be an object\");\n\tif (!Array.isArray(raw.monitors)) invalid(\"field monitors must be an array\");\n\tif (!Array.isArray(raw.backgroundSessions)) invalid(\"field backgroundSessions must be an array\");\n\treturn {\n\t\tversion: TERMINAL_MANIFEST_VERSION,\n\t\tsessionId: ref.sessionId,\n\t\tmonitors: raw.monitors.map(parseMonitor),\n\t\tbackgroundSessions: raw.backgroundSessions.map(parseBackgroundSession),\n\t\tupdatedAt: num(raw, \"updatedAt\"),\n\t};\n}\n\nexport type RestoreOutcome = \"restored\" | \"lost\" | \"muted\" | \"attachedElsewhere\";\n\nexport interface RestoreHandlerResult {\n\treadonly outcome: RestoreOutcome;\n\t/** Why a durable monitor could not be restored; diagnostic only, never part of the digest counts. */\n\treadonly reason?: string;\n}\n\nexport type RestoreHandler = (monitor: ManifestMonitor) => RestoreHandlerResult | Promise<RestoreHandlerResult>;\n\nexport interface RestoreHandlers {\n\treadonly \"restartable-command\": RestoreHandler;\n\treadonly \"checkpointed-file\": RestoreHandler;\n}\n\n/** The registry surface a restore handler needs to re-apply a persisted mute. */\nexport interface PersistedMuteRegistry {\n\tpause(ids: readonly string[]): string[];\n}\n\n/**\n * Re-apply a persisted `deliveryPaused` mute to a freshly restored monitor and report the\n * outcome it contributes to the digest. The mute MUST be applied by the FRESH runtime id\n * (bash_N/watch_N) the restore just allocated: `MonitorRegistry.pause` resolves records by\n * runtime id only, so passing the persisted `mon_` id silently no-ops and the mute is lost.\n */\nexport function reapplyPersistedMute(\n\tregistry: PersistedMuteRegistry,\n\tmonitor: Pick<ManifestMonitor, \"deliveryPaused\">,\n\truntimeId: string,\n): RestoreOutcome {\n\tif (!monitor.deliveryPaused) return \"restored\";\n\tregistry.pause([runtimeId]);\n\treturn \"muted\";\n}\n\n/** Stub durability handlers: every durable monitor is reported lost until later phases land. */\nexport const stubRestoreHandlers: RestoreHandlers = {\n\t\"restartable-command\": () => ({ outcome: \"lost\" }),\n\t\"checkpointed-file\": () => ({ outcome: \"lost\" }),\n};\n\nexport interface RestoreDigest {\n\trestored: number;\n\tlost: number;\n\texpired: number;\n\tmuted: number;\n\tattachedElsewhere: number;\n\tstoreError: boolean;\n}\n\nexport interface RestoreTerminalStateOptions {\n\treadonly manifest: SidecarStore<TerminalManifest>;\n\treadonly handlers?: Partial<RestoreHandlers>;\n\treadonly now?: () => number;\n}\n\nexport async function restoreTerminalState(options: RestoreTerminalStateOptions): Promise<RestoreDigest> {\n\tconst digest: RestoreDigest = {\n\t\trestored: 0,\n\t\tlost: 0,\n\t\texpired: 0,\n\t\tmuted: 0,\n\t\tattachedElsewhere: 0,\n\t\tstoreError: false,\n\t};\n\tlet state: TerminalManifest | null;\n\ttry {\n\t\tstate = await options.manifest.read();\n\t} catch {\n\t\t// Fail closed: a corrupt or foreign manifest restores nothing and reports the store error.\n\t\treturn { ...digest, storeError: true };\n\t}\n\tif (state === null) return digest;\n\tconst now = (options.now ?? Date.now)();\n\tconst handlers: RestoreHandlers = { ...stubRestoreHandlers, ...options.handlers };\n\tfor (const monitor of state.monitors) {\n\t\t// At the deadline the entry is already expired: the handler must not see it at all.\n\t\tif (monitor.expiresAt !== null && monitor.expiresAt <= now) {\n\t\t\tdigest.expired += 1;\n\t\t\tcontinue;\n\t\t}\n\t\tif (monitor.durabilityClass === \"ephemeral\") {\n\t\t\tdigest.lost += 1;\n\t\t\tcontinue;\n\t\t}\n\t\tconst outcome = (await handlers[monitor.durabilityClass](monitor)).outcome;\n\t\tdigest[outcome] += 1;\n\t}\n\t// Background sessions carry no durable identity: every one of them is lost.\n\tdigest.lost += state.backgroundSessions.length;\n\treturn digest;\n}\n"]}
|
|
@@ -24,6 +24,31 @@ export declare const BACKGROUND_START_GRACE_MS = 250;
|
|
|
24
24
|
* the agent blocked forever.
|
|
25
25
|
*/
|
|
26
26
|
export declare const KILLED_SESSION_EXIT_GRACE_MS = 5000;
|
|
27
|
+
/**
|
|
28
|
+
* Admission cap on durable (restart-surviving) monitors per session. Ephemeral monitors
|
|
29
|
+
* never count against it: only entries the manifest keeps across a restart do.
|
|
30
|
+
*/
|
|
31
|
+
export declare const MAX_DURABLE_MONITORS = 5;
|
|
32
|
+
/**
|
|
33
|
+
* Absolute lifetime of a durable monitor, measured from its registration. It is a deadline,
|
|
34
|
+
* never a sliding window: neither a restore nor a rearm extends it.
|
|
35
|
+
*/
|
|
36
|
+
export declare const DURABLE_MONITOR_EXPIRY_MS: number;
|
|
37
|
+
/**
|
|
38
|
+
* Per-monitor rolling fire budget: one durable command watch may deliver at most this many
|
|
39
|
+
* matched line events inside any FIRE_BUDGET_WINDOW_MS window before the registry auto-mutes
|
|
40
|
+
* it. The session-global wake budget only counts consecutive line-only wakes on an idle
|
|
41
|
+
* session, so a busy session needs this per-monitor backstop against a runaway watch.
|
|
42
|
+
*/
|
|
43
|
+
export declare const DEFAULT_DURABLE_MONITOR_FIRE_BUDGET = 200;
|
|
44
|
+
/** Width of the rolling fire-budget window: the budget replenishes after this span elapses. */
|
|
45
|
+
export declare const FIRE_BUDGET_WINDOW_MS: number;
|
|
46
|
+
/**
|
|
47
|
+
* The ONE summary emitted when the fire budget mutes a watch. Machine-consumed: the monitor
|
|
48
|
+
* notifier exempts exactly this summary from its completion handling, so the mute must not
|
|
49
|
+
* clear the session-global wake streak.
|
|
50
|
+
*/
|
|
51
|
+
export declare const FIRE_BUDGET_AUTO_MUTE_SUMMARY = "auto-muted: fire budget (200/24h) reached; rearm to resume";
|
|
27
52
|
/**
|
|
28
53
|
* Non-interactive environment for foreground one-shot commands (codex-style):
|
|
29
54
|
* cooperative tools (`gh`, `git`, pagers, color libs) skip spinners/colors at
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/terminal/shared.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,kBAAkB,SAAS,CAAC;AACzC,eAAO,MAAM,oBAAoB,gBAAgB,CAAC;AAClD,eAAO,MAAM,kBAAkB,cAAc,CAAC;AAC9C,eAAO,MAAM,mBAAmB,eAAe,CAAC;AAChD,eAAO,MAAM,oBAAoB,gBAAgB,CAAC;AAClD,eAAO,MAAM,qBAAqB,YAAY,CAAC;AAE/C,wEAAwE;AACxE,eAAO,MAAM,wBAAwB,+EAM3B,CAAC;AAEX,eAAO,MAAM,YAAY,MAAM,CAAC;AAChC,eAAO,MAAM,YAAY,KAAK,CAAC;AAC/B,eAAO,MAAM,kBAAkB,QAAS,CAAC;AACzC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,2FAA2F;AAC3F,eAAO,MAAM,wBAAwB,UAAY,CAAC;AAClD,gGAAgG;AAChG,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAC7C;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,OAAO,CAAC;AAEjD;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOrE,CAAC;AAiCF,iFAAiF;AACjF,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQ7D;AAED,2FAA2F;AAC3F,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG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MAAM,EAAE,MAAM,CAAC,CAOrE,CAAC;AAiCF,iFAAiF;AACjF,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQ7D;AAED,2FAA2F;AAC3F,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CASvF;AAED,oFAAoF;AACpF,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMzD"}
|
|
@@ -30,6 +30,31 @@ export const BACKGROUND_START_GRACE_MS = 250;
|
|
|
30
30
|
* the agent blocked forever.
|
|
31
31
|
*/
|
|
32
32
|
export const KILLED_SESSION_EXIT_GRACE_MS = 5000;
|
|
33
|
+
/**
|
|
34
|
+
* Admission cap on durable (restart-surviving) monitors per session. Ephemeral monitors
|
|
35
|
+
* never count against it: only entries the manifest keeps across a restart do.
|
|
36
|
+
*/
|
|
37
|
+
export const MAX_DURABLE_MONITORS = 5;
|
|
38
|
+
/**
|
|
39
|
+
* Absolute lifetime of a durable monitor, measured from its registration. It is a deadline,
|
|
40
|
+
* never a sliding window: neither a restore nor a rearm extends it.
|
|
41
|
+
*/
|
|
42
|
+
export const DURABLE_MONITOR_EXPIRY_MS = 7 * 24 * 60 * 60 * 1000;
|
|
43
|
+
/**
|
|
44
|
+
* Per-monitor rolling fire budget: one durable command watch may deliver at most this many
|
|
45
|
+
* matched line events inside any FIRE_BUDGET_WINDOW_MS window before the registry auto-mutes
|
|
46
|
+
* it. The session-global wake budget only counts consecutive line-only wakes on an idle
|
|
47
|
+
* session, so a busy session needs this per-monitor backstop against a runaway watch.
|
|
48
|
+
*/
|
|
49
|
+
export const DEFAULT_DURABLE_MONITOR_FIRE_BUDGET = 200;
|
|
50
|
+
/** Width of the rolling fire-budget window: the budget replenishes after this span elapses. */
|
|
51
|
+
export const FIRE_BUDGET_WINDOW_MS = 24 * 60 * 60 * 1000;
|
|
52
|
+
/**
|
|
53
|
+
* The ONE summary emitted when the fire budget mutes a watch. Machine-consumed: the monitor
|
|
54
|
+
* notifier exempts exactly this summary from its completion handling, so the mute must not
|
|
55
|
+
* clear the session-global wake streak.
|
|
56
|
+
*/
|
|
57
|
+
export const FIRE_BUDGET_AUTO_MUTE_SUMMARY = `auto-muted: fire budget (${DEFAULT_DURABLE_MONITOR_FIRE_BUDGET}/24h) reached; rearm to resume`;
|
|
33
58
|
/**
|
|
34
59
|
* Non-interactive environment for foreground one-shot commands (codex-style):
|
|
35
60
|
* cooperative tools (`gh`, `git`, pagers, color libs) skip spinners/colors at
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/terminal/shared.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AACzC,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAC;AAClD,MAAM,CAAC,MAAM,kBAAkB,GAAG,WAAW,CAAC;AAC9C,MAAM,CAAC,MAAM,mBAAmB,GAAG,YAAY,CAAC;AAChD,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAC;AAClD,MAAM,CAAC,MAAM,qBAAqB,GAAG,SAAS,CAAC;AAE/C,wEAAwE;AACxE,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACvC,oBAAoB;IACpB,kBAAkB;IAClB,mBAAmB;IACnB,oBAAoB;IACpB,qBAAqB;CACZ,CAAC;AAEX,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAC;AAChC,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAC;AAC/B,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AACzC,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AACvC,2FAA2F;AAC3F,MAAM,CAAC,M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,CAAC,UAAU,CAAC,CAAC;IACzC,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IACxC,sDAAsD;IACtD,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,GAAG,CAAC;IAC7C,OAAO,IAAI,CAAC;AACb,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,UAAU,CAAC,IAAuB;IACjD,IAAI,IAAI,GAAG,EAAE,CAAC;IACd,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACxB,MAAM,QAAQ,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;QACzC,IAAI,QAAQ,KAAK,IAAI;YAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;;YACpC,IAAI,IAAI,QAAQ,CAAC;IACvB,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC1B,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,UAAU,CAAC,OAAe;IACzC,IAAI,CAAC;QACJ,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,IAAI,CAAC;IACb,CAAC;AACF,CAAC","sourcesContent":["/**\n * Shared constants and helpers for the persistent-terminal builtin extension.\n */\n\nexport const TERMINAL_BASH_TOOL = \"bash\";\nexport const TERMINAL_OUTPUT_TOOL = \"bash_output\";\nexport const TERMINAL_KILL_TOOL = \"kill_bash\";\nexport const TERMINAL_INPUT_TOOL = \"bash_input\";\nexport const TERMINAL_RESIZE_TOOL = \"bash_resize\";\nexport const TERMINAL_MONITOR_TOOL = \"monitor\";\n\n/** Companion tools that must never dangle without a live PTY `bash`. */\nexport const TERMINAL_COMPANION_TOOLS = [\n\tTERMINAL_OUTPUT_TOOL,\n\tTERMINAL_KILL_TOOL,\n\tTERMINAL_INPUT_TOOL,\n\tTERMINAL_RESIZE_TOOL,\n\tTERMINAL_MONITOR_TOOL,\n] as const;\n\nexport const DEFAULT_COLS = 120;\nexport const DEFAULT_ROWS = 40;\nexport const DEFAULT_SCROLLBACK = 10_000;\nexport const DEFAULT_MAX_SESSIONS = 32;\n/** Upper bound on decoded output retained per session for delta reads and `view:\"log\"`. */\nexport const MAX_SESSION_OUTPUT_CHARS = 1_000_000;\n/** Grace window used to capture a background command's early output before returning its id. */\nexport const BACKGROUND_START_GRACE_MS = 250;\n/**\n * After a foreground session has been killed (abort or timeout), how long to keep\n * waiting for its exit to settle before releasing the tool anyway. A surviving\n * descendant that holds the PTY open (or a kill that never lands) must not keep\n * the agent blocked forever.\n */\nexport const KILLED_SESSION_EXIT_GRACE_MS = 5000;\n\n/**\n * Non-interactive environment for foreground one-shot commands (codex-style):\n * cooperative tools (`gh`, `git`, pagers, color libs) skip spinners/colors at\n * the source instead of flooding the captured stream with redraw frames.\n * Background sessions keep the user's real TERM for interactive apps.\n */\nexport const FOREGROUND_ENV_OVERRIDES: Readonly<Record<string, string>> = {\n\tNO_COLOR: \"1\",\n\tTERM: \"dumb\",\n\tCOLORTERM: \"\",\n\tPAGER: \"cat\",\n\tGIT_PAGER: \"cat\",\n\tGH_PAGER: \"cat\",\n};\n\n/**\n * Named-key aliases the model can send via `bash_input {keys:[...]}`. Values are the\n * raw byte sequences a PTY expects (control chars + xterm cursor/function escapes).\n */\nconst KEY_SEQUENCES: Record<string, string> = {\n\tenter: \"\\r\",\n\treturn: \"\\r\",\n\ttab: \"\\t\",\n\tescape: \"\\x1b\",\n\tesc: \"\\x1b\",\n\tspace: \" \",\n\tbackspace: \"\\x7f\",\n\tdelete: \"\\x1b[3~\",\n\tup: \"\\x1b[A\",\n\tdown: \"\\x1b[B\",\n\tright: \"\\x1b[C\",\n\tleft: \"\\x1b[D\",\n\thome: \"\\x1b[H\",\n\tend: \"\\x1b[F\",\n\tpageup: \"\\x1b[5~\",\n\tpagedown: \"\\x1b[6~\",\n\t\"ctrl+c\": \"\\x03\",\n\t\"ctrl+d\": \"\\x04\",\n\t\"ctrl+z\": \"\\x1a\",\n\t\"ctrl+l\": \"\\x0c\",\n\t\"ctrl+u\": \"\\x15\",\n\t\"ctrl+a\": \"\\x01\",\n\t\"ctrl+e\": \"\\x05\",\n\t\"ctrl+\\\\\": \"\\x1c\",\n};\n\n/** Resolve a single named key to its PTY byte sequence, or null when unknown. */\nexport function resolveKeySequence(key: string): string | null {\n\tconst normalized = key.trim().toLowerCase();\n\tif (normalized.length === 0) return null;\n\tconst mapped = KEY_SEQUENCES[normalized];\n\tif (mapped !== undefined) return mapped;\n\t// Single printable character passes through verbatim.\n\tif ([...normalized].length === 1) return key;\n\treturn null;\n}\n\n/** Build a PTY-ready payload from a list of named keys, returning the unknown keys too. */\nexport function encodeKeys(keys: readonly string[]): { data: string; unknown: string[] } {\n\tlet data = \"\";\n\tconst unknown: string[] = [];\n\tfor (const key of keys) {\n\t\tconst sequence = resolveKeySequence(key);\n\t\tif (sequence === null) unknown.push(key);\n\t\telse data += sequence;\n\t}\n\treturn { data, unknown };\n}\n\n/** Compile a user-supplied regex, tolerating invalid patterns by returning null. */\nexport function safeRegExp(pattern: string): RegExp | null {\n\ttry {\n\t\treturn new RegExp(pattern);\n\t} catch {\n\t\treturn null;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/terminal/shared.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AACzC,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAC;AAClD,MAAM,CAAC,MAAM,kBAAkB,GAAG,WAAW,CAAC;AAC9C,MAAM,CAAC,MAAM,mBAAmB,GAAG,YAAY,CAAC;AAChD,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAC;AAClD,MAAM,CAAC,MAAM,qBAAqB,GAAG,SAAS,CAAC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G,CAAC,CAAC;QACzC,IAAI,QAAQ,KAAK,IAAI;YAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;;YACpC,IAAI,IAAI,QAAQ,CAAC;IACvB,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC1B,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,UAAU,CAAC,OAAe;IACzC,IAAI,CAAC;QACJ,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,IAAI,CAAC;IACb,CAAC;AACF,CAAC","sourcesContent":["/**\n * Shared constants and helpers for the persistent-terminal builtin extension.\n */\n\nexport const TERMINAL_BASH_TOOL = \"bash\";\nexport const TERMINAL_OUTPUT_TOOL = \"bash_output\";\nexport const TERMINAL_KILL_TOOL = \"kill_bash\";\nexport const TERMINAL_INPUT_TOOL = \"bash_input\";\nexport const TERMINAL_RESIZE_TOOL = \"bash_resize\";\nexport const TERMINAL_MONITOR_TOOL = \"monitor\";\n\n/** Companion tools that must never dangle without a live PTY `bash`. */\nexport const TERMINAL_COMPANION_TOOLS = [\n\tTERMINAL_OUTPUT_TOOL,\n\tTERMINAL_KILL_TOOL,\n\tTERMINAL_INPUT_TOOL,\n\tTERMINAL_RESIZE_TOOL,\n\tTERMINAL_MONITOR_TOOL,\n] as const;\n\nexport const DEFAULT_COLS = 120;\nexport const DEFAULT_ROWS = 40;\nexport const DEFAULT_SCROLLBACK = 10_000;\nexport const DEFAULT_MAX_SESSIONS = 32;\n/** Upper bound on decoded output retained per session for delta reads and `view:\"log\"`. */\nexport const MAX_SESSION_OUTPUT_CHARS = 1_000_000;\n/** Grace window used to capture a background command's early output before returning its id. */\nexport const BACKGROUND_START_GRACE_MS = 250;\n/**\n * After a foreground session has been killed (abort or timeout), how long to keep\n * waiting for its exit to settle before releasing the tool anyway. A surviving\n * descendant that holds the PTY open (or a kill that never lands) must not keep\n * the agent blocked forever.\n */\nexport const KILLED_SESSION_EXIT_GRACE_MS = 5000;\n\n/**\n * Admission cap on durable (restart-surviving) monitors per session. Ephemeral monitors\n * never count against it: only entries the manifest keeps across a restart do.\n */\nexport const MAX_DURABLE_MONITORS = 5;\n/**\n * Absolute lifetime of a durable monitor, measured from its registration. It is a deadline,\n * never a sliding window: neither a restore nor a rearm extends it.\n */\nexport const DURABLE_MONITOR_EXPIRY_MS = 7 * 24 * 60 * 60 * 1000;\n/**\n * Per-monitor rolling fire budget: one durable command watch may deliver at most this many\n * matched line events inside any FIRE_BUDGET_WINDOW_MS window before the registry auto-mutes\n * it. The session-global wake budget only counts consecutive line-only wakes on an idle\n * session, so a busy session needs this per-monitor backstop against a runaway watch.\n */\nexport const DEFAULT_DURABLE_MONITOR_FIRE_BUDGET = 200;\n/** Width of the rolling fire-budget window: the budget replenishes after this span elapses. */\nexport const FIRE_BUDGET_WINDOW_MS = 24 * 60 * 60 * 1000;\n/**\n * The ONE summary emitted when the fire budget mutes a watch. Machine-consumed: the monitor\n * notifier exempts exactly this summary from its completion handling, so the mute must not\n * clear the session-global wake streak.\n */\nexport const FIRE_BUDGET_AUTO_MUTE_SUMMARY = `auto-muted: fire budget (${DEFAULT_DURABLE_MONITOR_FIRE_BUDGET}/24h) reached; rearm to resume`;\n\n/**\n * Non-interactive environment for foreground one-shot commands (codex-style):\n * cooperative tools (`gh`, `git`, pagers, color libs) skip spinners/colors at\n * the source instead of flooding the captured stream with redraw frames.\n * Background sessions keep the user's real TERM for interactive apps.\n */\nexport const FOREGROUND_ENV_OVERRIDES: Readonly<Record<string, string>> = {\n\tNO_COLOR: \"1\",\n\tTERM: \"dumb\",\n\tCOLORTERM: \"\",\n\tPAGER: \"cat\",\n\tGIT_PAGER: \"cat\",\n\tGH_PAGER: \"cat\",\n};\n\n/**\n * Named-key aliases the model can send via `bash_input {keys:[...]}`. Values are the\n * raw byte sequences a PTY expects (control chars + xterm cursor/function escapes).\n */\nconst KEY_SEQUENCES: Record<string, string> = {\n\tenter: \"\\r\",\n\treturn: \"\\r\",\n\ttab: \"\\t\",\n\tescape: \"\\x1b\",\n\tesc: \"\\x1b\",\n\tspace: \" \",\n\tbackspace: \"\\x7f\",\n\tdelete: \"\\x1b[3~\",\n\tup: \"\\x1b[A\",\n\tdown: \"\\x1b[B\",\n\tright: \"\\x1b[C\",\n\tleft: \"\\x1b[D\",\n\thome: \"\\x1b[H\",\n\tend: \"\\x1b[F\",\n\tpageup: \"\\x1b[5~\",\n\tpagedown: \"\\x1b[6~\",\n\t\"ctrl+c\": \"\\x03\",\n\t\"ctrl+d\": \"\\x04\",\n\t\"ctrl+z\": \"\\x1a\",\n\t\"ctrl+l\": \"\\x0c\",\n\t\"ctrl+u\": \"\\x15\",\n\t\"ctrl+a\": \"\\x01\",\n\t\"ctrl+e\": \"\\x05\",\n\t\"ctrl+\\\\\": \"\\x1c\",\n};\n\n/** Resolve a single named key to its PTY byte sequence, or null when unknown. */\nexport function resolveKeySequence(key: string): string | null {\n\tconst normalized = key.trim().toLowerCase();\n\tif (normalized.length === 0) return null;\n\tconst mapped = KEY_SEQUENCES[normalized];\n\tif (mapped !== undefined) return mapped;\n\t// Single printable character passes through verbatim.\n\tif ([...normalized].length === 1) return key;\n\treturn null;\n}\n\n/** Build a PTY-ready payload from a list of named keys, returning the unknown keys too. */\nexport function encodeKeys(keys: readonly string[]): { data: string; unknown: string[] } {\n\tlet data = \"\";\n\tconst unknown: string[] = [];\n\tfor (const key of keys) {\n\t\tconst sequence = resolveKeySequence(key);\n\t\tif (sequence === null) unknown.push(key);\n\t\telse data += sequence;\n\t}\n\treturn { data, unknown };\n}\n\n/** Compile a user-supplied regex, tolerating invalid patterns by returning null. */\nexport function safeRegExp(pattern: string): RegExp | null {\n\ttry {\n\t\treturn new RegExp(pattern);\n\t} catch {\n\t\treturn null;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The terminal manifest's data model: the durable per-session record of live monitors and
|
|
3
|
+
* background sessions that `restore.ts` strict-parses back after a restart. Types and the
|
|
4
|
+
* constants that govern them live here; all runtime behaviour is in `terminal-manifest.ts`.
|
|
5
|
+
*/
|
|
6
|
+
import type { SessionManager } from "../../../session-manager.ts";
|
|
7
|
+
export declare const TERMINAL_MANIFEST_VERSION = 1;
|
|
8
|
+
/** Minimum debounce for checkpoint writes; a burst inside this window collapses to one write. */
|
|
9
|
+
export declare const TERMINAL_MANIFEST_CHECKPOINT_DEBOUNCE_MS = 30000;
|
|
10
|
+
/**
|
|
11
|
+
* Re-exported so manifest consumers read one durability deadline. The value lives in
|
|
12
|
+
* `shared.ts` with the rest of the terminal caps; there is exactly one definition of it.
|
|
13
|
+
*/
|
|
14
|
+
export { DURABLE_MONITOR_EXPIRY_MS } from "./shared.ts";
|
|
15
|
+
export type TerminalManifestSession = Pick<SessionManager, "getSessionDir" | "getSessionId">;
|
|
16
|
+
export type MonitorRuntimeKind = "command" | "file";
|
|
17
|
+
export type MonitorDurabilityClass = "ephemeral" | "restartable-command" | "checkpointed-file";
|
|
18
|
+
/**
|
|
19
|
+
* File-monitor checkpoint persisted by the writer: the registry's live identity tuple. `digest`
|
|
20
|
+
* is required — without it a same-size, same-mtime rewrite is undetectable across a restart.
|
|
21
|
+
*/
|
|
22
|
+
export interface TerminalManifestCheckpoint {
|
|
23
|
+
readonly dev: number;
|
|
24
|
+
readonly ino: number;
|
|
25
|
+
readonly size: number;
|
|
26
|
+
readonly mtimeMs: number;
|
|
27
|
+
readonly digest: string;
|
|
28
|
+
readonly present: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface ManifestMonitor {
|
|
31
|
+
readonly monitorId: string;
|
|
32
|
+
/** Owning agent session id — never the bash_N/watch_N runtime id. */
|
|
33
|
+
readonly sessionId: string;
|
|
34
|
+
readonly description: string;
|
|
35
|
+
readonly runtimeKind: MonitorRuntimeKind;
|
|
36
|
+
readonly durabilityClass: MonitorDurabilityClass;
|
|
37
|
+
readonly command?: string;
|
|
38
|
+
readonly path?: string;
|
|
39
|
+
readonly event?: "create" | "modify";
|
|
40
|
+
readonly filter?: string;
|
|
41
|
+
readonly cwd?: string;
|
|
42
|
+
readonly approvedParent?: string;
|
|
43
|
+
readonly createdAt: number;
|
|
44
|
+
readonly expiresAt: number | null;
|
|
45
|
+
readonly persistent: boolean;
|
|
46
|
+
readonly suspended: boolean;
|
|
47
|
+
readonly lastCheckpoint: TerminalManifestCheckpoint | null;
|
|
48
|
+
readonly deliveryPaused: boolean;
|
|
49
|
+
readonly fireWindow: {
|
|
50
|
+
startMs: number;
|
|
51
|
+
count: number;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export interface ManifestBackgroundSession {
|
|
55
|
+
readonly id: string;
|
|
56
|
+
readonly command: string;
|
|
57
|
+
readonly startedAtMs: number;
|
|
58
|
+
}
|
|
59
|
+
export interface TerminalManifest {
|
|
60
|
+
readonly version: typeof TERMINAL_MANIFEST_VERSION;
|
|
61
|
+
readonly sessionId: string;
|
|
62
|
+
readonly monitors: readonly ManifestMonitor[];
|
|
63
|
+
readonly backgroundSessions: readonly ManifestBackgroundSession[];
|
|
64
|
+
readonly updatedAt: number;
|
|
65
|
+
}
|
|
66
|
+
/** What the monitor tool captures at its call site — the only place the branch inputs live. */
|
|
67
|
+
export interface CommandMonitorSpec {
|
|
68
|
+
readonly kind: "command";
|
|
69
|
+
readonly description: string;
|
|
70
|
+
readonly command: string;
|
|
71
|
+
readonly filter?: string;
|
|
72
|
+
readonly cwd?: string;
|
|
73
|
+
readonly persistent: boolean;
|
|
74
|
+
}
|
|
75
|
+
export interface FileMonitorSpec {
|
|
76
|
+
readonly kind: "file";
|
|
77
|
+
readonly description: string;
|
|
78
|
+
readonly path: string;
|
|
79
|
+
readonly event: "create" | "modify";
|
|
80
|
+
readonly timeoutMs: number;
|
|
81
|
+
readonly cwd: string;
|
|
82
|
+
readonly approvedParent?: string;
|
|
83
|
+
/** Persistent file watches are the durable `checkpointed-file` class; one-shot ones stay ephemeral. */
|
|
84
|
+
readonly persistent: boolean;
|
|
85
|
+
}
|
|
86
|
+
export type MonitorSpec = CommandMonitorSpec | FileMonitorSpec;
|
|
87
|
+
export interface MonitorRegistration {
|
|
88
|
+
readonly monitorId: string;
|
|
89
|
+
readonly spec: MonitorSpec;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=terminal-manifest-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-manifest-model.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/terminal/terminal-manifest-model.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAC3C,iGAAiG;AACjG,eAAO,MAAM,wCAAwC,QAAS,CAAC;AAC/D;;;GAGG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACxD,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,cAAc,EAAE,eAAe,GAAG,cAAc,CAAC,CAAC;AAC7F,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,MAAM,CAAC;AACpD,MAAM,MAAM,sBAAsB,GAAG,WAAW,GAAG,qBAAqB,GAAG,mBAAmB,CAAC;AAC/F;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,qEAAqE;IACrE,Q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,QAAQ,CAAC,kBAAkB,EAAE,SAAS,yBAAyB,EAAE,CAAC;IAClE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC3B;AAED,+FAA+F;AAC/F,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,uGAAuG;IACvG,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;CAC7B;AACD,MAAM,MAAM,WAAW,GAAG,kBAAkB,GAAG,eAAe,CAAC;AAE/D,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;CAC3B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The terminal manifest's data model: the durable per-session record of live monitors and
|
|
3
|
+
* background sessions that `restore.ts` strict-parses back after a restart. Types and the
|
|
4
|
+
* constants that govern them live here; all runtime behaviour is in `terminal-manifest.ts`.
|
|
5
|
+
*/
|
|
6
|
+
export const TERMINAL_MANIFEST_VERSION = 1;
|
|
7
|
+
/** Minimum debounce for checkpoint writes; a burst inside this window collapses to one write. */
|
|
8
|
+
export const TERMINAL_MANIFEST_CHECKPOINT_DEBOUNCE_MS = 30_000;
|
|
9
|
+
/**
|
|
10
|
+
* Re-exported so manifest consumers read one durability deadline. The value lives in
|
|
11
|
+
* `shared.ts` with the rest of the terminal caps; there is exactly one definition of it.
|
|
12
|
+
*/
|
|
13
|
+
export { DURABLE_MONITOR_EXPIRY_MS } from "./shared.js";
|
|
14
|
+
//# sourceMappingURL=terminal-manifest-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-manifest-model.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/terminal/terminal-manifest-model.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAC3C,iGAAiG;AACjG,MAAM,CAAC,MAAM,wCAAwC,GAAG,MAAM,CAAC;AAC/D;;;GAGG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC","sourcesContent":["/**\n * The terminal manifest's data model: the durable per-session record of live monitors and\n * background sessions that `restore.ts` strict-parses back after a restart. Types and the\n * constants that govern them live here; all runtime behaviour is in `terminal-manifest.ts`.\n */\n\nimport type { SessionManager } from \"../../../session-manager.ts\";\n\nexport const TERMINAL_MANIFEST_VERSION = 1;\n/** Minimum debounce for checkpoint writes; a burst inside this window collapses to one write. */\nexport const TERMINAL_MANIFEST_CHECKPOINT_DEBOUNCE_MS = 30_000;\n/**\n * Re-exported so manifest consumers read one durability deadline. The value lives in\n * `shared.ts` with the rest of the terminal caps; there is exactly one definition of it.\n */\nexport { DURABLE_MONITOR_EXPIRY_MS } from \"./shared.ts\";\nexport type TerminalManifestSession = Pick<SessionManager, \"getSessionDir\" | \"getSessionId\">;\nexport type MonitorRuntimeKind = \"command\" | \"file\";\nexport type MonitorDurabilityClass = \"ephemeral\" | \"restartable-command\" | \"checkpointed-file\";\n/**\n * File-monitor checkpoint persisted by the writer: the registry's live identity tuple. `digest`\n * is required — without it a same-size, same-mtime rewrite is undetectable across a restart.\n */\nexport interface TerminalManifestCheckpoint {\n\treadonly dev: number;\n\treadonly ino: number;\n\treadonly size: number;\n\treadonly mtimeMs: number;\n\treadonly digest: string;\n\treadonly present: boolean;\n}\n\nexport interface ManifestMonitor {\n\treadonly monitorId: string;\n\t/** Owning agent session id — never the bash_N/watch_N runtime id. */\n\treadonly sessionId: string;\n\treadonly description: string;\n\treadonly runtimeKind: MonitorRuntimeKind;\n\treadonly durabilityClass: MonitorDurabilityClass;\n\treadonly command?: string;\n\treadonly path?: string;\n\treadonly event?: \"create\" | \"modify\";\n\treadonly filter?: string;\n\treadonly cwd?: string;\n\treadonly approvedParent?: string;\n\treadonly createdAt: number;\n\treadonly expiresAt: number | null;\n\treadonly persistent: boolean;\n\treadonly suspended: boolean;\n\treadonly lastCheckpoint: TerminalManifestCheckpoint | null;\n\treadonly deliveryPaused: boolean;\n\treadonly fireWindow: { startMs: number; count: number };\n}\n\nexport interface ManifestBackgroundSession {\n\treadonly id: string;\n\treadonly command: string;\n\treadonly startedAtMs: number;\n}\n\nexport interface TerminalManifest {\n\treadonly version: typeof TERMINAL_MANIFEST_VERSION;\n\treadonly sessionId: string;\n\treadonly monitors: readonly ManifestMonitor[];\n\treadonly backgroundSessions: readonly ManifestBackgroundSession[];\n\treadonly updatedAt: number;\n}\n\n/** What the monitor tool captures at its call site — the only place the branch inputs live. */\nexport interface CommandMonitorSpec {\n\treadonly kind: \"command\";\n\treadonly description: string;\n\treadonly command: string;\n\treadonly filter?: string;\n\treadonly cwd?: string;\n\treadonly persistent: boolean;\n}\n\nexport interface FileMonitorSpec {\n\treadonly kind: \"file\";\n\treadonly description: string;\n\treadonly path: string;\n\treadonly event: \"create\" | \"modify\";\n\treadonly timeoutMs: number;\n\treadonly cwd: string;\n\treadonly approvedParent?: string;\n\t/** Persistent file watches are the durable `checkpointed-file` class; one-shot ones stay ephemeral. */\n\treadonly persistent: boolean;\n}\nexport type MonitorSpec = CommandMonitorSpec | FileMonitorSpec;\n\nexport interface MonitorRegistration {\n\treadonly monitorId: string;\n\treadonly spec: MonitorSpec;\n}\n"]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The manifest write side: `createTerminalManifestStore` plus `TerminalManifestWriter`,
|
|
3
|
+
* persisting ONLY lifecycle transitions and debounced checkpoints of the record shaped in
|
|
4
|
+
* `terminal-manifest-model.ts` — never per-line output and never a runtime handle.
|
|
5
|
+
*/
|
|
6
|
+
import { type SidecarStore } from "../../../session-sidecar-store.ts";
|
|
7
|
+
import type { MonitorSnapshotEntry } from "./monitor-registry.ts";
|
|
8
|
+
import { type ManifestMonitor, type MonitorRegistration, type TerminalManifest, type TerminalManifestCheckpoint, type TerminalManifestSession } from "./terminal-manifest-model.ts";
|
|
9
|
+
export type { CommandMonitorSpec, FileMonitorSpec, ManifestBackgroundSession, ManifestMonitor, MonitorDurabilityClass, MonitorRegistration, MonitorRuntimeKind, MonitorSpec, TerminalManifest, TerminalManifestCheckpoint, TerminalManifestSession, } from "./terminal-manifest-model.ts";
|
|
10
|
+
export { DURABLE_MONITOR_EXPIRY_MS, TERMINAL_MANIFEST_CHECKPOINT_DEBOUNCE_MS, TERMINAL_MANIFEST_VERSION, } from "./terminal-manifest-model.ts";
|
|
11
|
+
export declare function createTerminalManifestStore(session: TerminalManifestSession): SidecarStore<TerminalManifest>;
|
|
12
|
+
export declare class TerminalManifestWriter {
|
|
13
|
+
#private;
|
|
14
|
+
readonly store: SidecarStore<TerminalManifest>;
|
|
15
|
+
/** Last persist failure: transitions never reject, so a durability write can never fail a live tool call. */
|
|
16
|
+
persistFailure: unknown;
|
|
17
|
+
constructor(options: {
|
|
18
|
+
session: TerminalManifestSession;
|
|
19
|
+
debounceMs?: number;
|
|
20
|
+
now?: () => number;
|
|
21
|
+
});
|
|
22
|
+
recordRegister(registration: MonitorRegistration): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Re-adopt an entry a restore handler just brought back to life, so THIS generation's
|
|
25
|
+
* in-memory map owns it again. Without this, the writer starts every generation empty and
|
|
26
|
+
* the next persist (a register, a background start, a checkpoint flush, recordShutdown)
|
|
27
|
+
* rewrites the manifest WITHOUT the restored monitors — the monitor survives one restart
|
|
28
|
+
* and is erased on the second.
|
|
29
|
+
*
|
|
30
|
+
* Every persisted field is preserved verbatim, notably `createdAt` and `expiresAt`: the
|
|
31
|
+
* durability deadline is set once at registration and a restore NEVER extends it. Only
|
|
32
|
+
* `suspended` is cleared, because the monitor is live again in this process.
|
|
33
|
+
*
|
|
34
|
+
* Deliberately does NOT write: re-adoption is not a state transition, it is recovery of
|
|
35
|
+
* state already on disk. The entry reaches the file again on the restore's own next
|
|
36
|
+
* persist (the file class's checkpoint, any later transition, or recordShutdown), so a
|
|
37
|
+
* restart costs zero extra writes and the write-on-transition invariant holds.
|
|
38
|
+
*/
|
|
39
|
+
adoptRestored(entry: ManifestMonitor): void;
|
|
40
|
+
/**
|
|
41
|
+
* Live durable-monitor count for admission control: entries that survive a restart.
|
|
42
|
+
* Ephemeral entries are never counted, so any number of one-shot watches can coexist
|
|
43
|
+
* with the durable ones.
|
|
44
|
+
*/
|
|
45
|
+
durableCount(): number;
|
|
46
|
+
/**
|
|
47
|
+
* Reconcile a registry transition snapshot (the bundle's single onChange consumer
|
|
48
|
+
* forwards it here): settle removes entries, pause/resume/rearm flips deliveryPaused.
|
|
49
|
+
* An entry missing its stable monitorId throws — never silently skipped; entries not
|
|
50
|
+
* registered through the tool call site are left alone (durability spec unknown).
|
|
51
|
+
*/
|
|
52
|
+
observeMonitorState(snapshot: readonly MonitorSnapshotEntry[]): Promise<void>;
|
|
53
|
+
/** Debounced checkpoint persist: a burst inside the window collapses into one write. */
|
|
54
|
+
scheduleCheckpoint(monitorId: string, checkpoint: TerminalManifestCheckpoint): void;
|
|
55
|
+
/** Drain: apply any pending checkpoints and await every in-flight write. */
|
|
56
|
+
flush(): Promise<void>;
|
|
57
|
+
/** Shutdown transition: flush checkpoints and mark every live monitor suspended in one write. */
|
|
58
|
+
recordShutdown(): Promise<void>;
|
|
59
|
+
recordBackgroundStart(id: string, command: string, startedAtMs?: number): Promise<void>;
|
|
60
|
+
recordBackgroundExit(id: string): Promise<void>;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=terminal-manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-manifest.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/terminal/terminal-manifest.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAC1F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAGlE,OAAO,EAEN,KAAK,eAAe,EACpB,KAAK,mBAAmB,EAGxB,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,MAAM,8BAA8B,CAAC;AAEtC,YAAY,EACX,kBAAkB,EAClB,eAAe,EACf,yBAAyB,EACzB,eAAe,EACf,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EAChB,0BAA0B,EAC1B,uBAAuB,GACvB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EACN,yBAAyB,EACzB,wCAAwC,EACxC,yBAAyB,GACzB,MAAM,8BAA8B,CAAC;AAEtC,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,uBAAuB,GAAG,YAAY,CAAC,gBAAgB,CAAC,CAQ5G;AAED,qBAAa,sBAAsB;;IAClC,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC;IAS/C,6GAA6G;IAC7G,cAAc,EAAE,OAAO,CAAC;gBAEZ,OAAO,EAAE;QAAE,OAAO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