@code-yeongyu/senpi 2026.8.24 → 2026.8.26
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 +98 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +24 -9
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/file-processor.d.ts.map +1 -1
- package/dist/cli/file-processor.js +2 -1
- package/dist/cli/file-processor.js.map +1 -1
- package/dist/config.d.ts +6 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +24 -14
- package/dist/config.js.map +1 -1
- package/dist/core/agent-abort-provenance.d.ts.map +1 -1
- package/dist/core/agent-abort-provenance.js +5 -1
- package/dist/core/agent-abort-provenance.js.map +1 -1
- package/dist/core/agent-session.d.ts +11 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +154 -29
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +4 -0
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +35 -8
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/brand.d.ts +2 -0
- package/dist/core/brand.d.ts.map +1 -1
- package/dist/core/brand.js +1 -0
- package/dist/core/brand.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +1 -0
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +24 -8
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/defaults.d.ts +1 -0
- package/dist/core/defaults.d.ts.map +1 -1
- package/dist/core/defaults.js +9 -0
- package/dist/core/defaults.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/per-turn-cap.d.ts +5 -9
- package/dist/core/extensions/builtin/compaction/per-turn-cap.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/per-turn-cap.js +5 -11
- package/dist/core/extensions/builtin/compaction/per-turn-cap.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/todo-bridge.d.ts +2 -3
- package/dist/core/extensions/builtin/compaction/todo-bridge.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/todo-bridge.js +53 -14
- package/dist/core/extensions/builtin/compaction/todo-bridge.js.map +1 -1
- package/dist/core/extensions/builtin/goal/terminal-provider-error.js +1 -1
- package/dist/core/extensions/builtin/goal/terminal-provider-error.js.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/notice.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/notice.js +5 -1
- package/dist/core/extensions/builtin/loop-guard/notice.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/config-schema.d.ts +2 -2
- package/dist/core/extensions/builtin/ttsr/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/ttsr/index.js +6 -6
- package/dist/core/extensions/builtin/ttsr/index.js.map +1 -1
- package/dist/core/extensions/builtin/ttsr/message-update.d.ts +10 -0
- package/dist/core/extensions/builtin/ttsr/message-update.d.ts.map +1 -0
- package/dist/core/extensions/builtin/ttsr/message-update.js +38 -0
- package/dist/core/extensions/builtin/ttsr/message-update.js.map +1 -0
- package/dist/core/extensions/builtin/ttsr/remediation.d.ts +5 -10
- package/dist/core/extensions/builtin/ttsr/remediation.d.ts.map +1 -1
- package/dist/core/extensions/builtin/ttsr/remediation.js +19 -3
- package/dist/core/extensions/builtin/ttsr/remediation.js.map +1 -1
- package/dist/core/extensions/builtin/ttsr/stream-remediation.d.ts +1 -1
- package/dist/core/extensions/builtin/ttsr/stream-remediation.d.ts.map +1 -1
- package/dist/core/extensions/builtin/ttsr/stream-remediation.js.map +1 -1
- package/dist/core/extensions/builtin/ttsr/types.d.ts +1 -1
- package/dist/core/extensions/builtin/ttsr/types.d.ts.map +1 -1
- package/dist/core/extensions/builtin/ttsr/types.js.map +1 -1
- package/dist/core/extensions/builtin/ttsr/watch.d.ts +1 -1
- package/dist/core/extensions/builtin/ttsr/watch.d.ts.map +1 -1
- package/dist/core/extensions/builtin/ttsr/watch.js +2 -2
- package/dist/core/extensions/builtin/ttsr/watch.js.map +1 -1
- package/dist/core/extensions/index.d.ts +2 -2
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +107 -45
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/types.d.ts +17 -6
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js +3 -0
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +1 -1
- package/dist/core/footer-data-provider.js +1 -1
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/keybindings.d.ts +20 -19
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +26 -5
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-config-schema.d.ts +17 -5
- package/dist/core/model-config-schema.d.ts.map +1 -1
- package/dist/core/model-config-schema.js +1 -1
- package/dist/core/model-config-schema.js.map +1 -1
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +7 -5
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-resolver.d.ts +3 -2
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +3 -2
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +0 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +0 -18
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/models-store.d.ts.map +1 -1
- package/dist/core/models-store.js +2 -1
- package/dist/core/models-store.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +14 -10
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/pi-manifest.d.ts.map +1 -1
- package/dist/core/pi-manifest.js +2 -1
- package/dist/core/pi-manifest.js.map +1 -1
- package/dist/core/provider-composer.d.ts +2 -0
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +3 -6
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/provider-display-names.d.ts.map +1 -1
- package/dist/core/provider-display-names.js +0 -1
- package/dist/core/provider-display-names.js.map +1 -1
- package/dist/core/provider-timeout-retry.d.ts.map +1 -1
- package/dist/core/provider-timeout-retry.js +8 -12
- package/dist/core/provider-timeout-retry.js.map +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +3 -2
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/retry-fallback/profile-override.d.ts +24 -0
- package/dist/core/retry-fallback/profile-override.d.ts.map +1 -0
- package/dist/core/retry-fallback/profile-override.js +138 -0
- package/dist/core/retry-fallback/profile-override.js.map +1 -0
- package/dist/core/retry-fallback/settings.d.ts +1 -0
- package/dist/core/retry-fallback/settings.d.ts.map +1 -1
- package/dist/core/retry-fallback/settings.js.map +1 -1
- package/dist/core/sdk.d.ts +2 -2
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +20 -5
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-export.d.ts +4 -0
- package/dist/core/session-export.d.ts.map +1 -0
- package/dist/core/session-export.js +32 -0
- package/dist/core/session-export.js.map +1 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +2 -1
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-diagnostics.d.ts +9 -0
- package/dist/core/settings-diagnostics.d.ts.map +1 -0
- package/dist/core/settings-diagnostics.js +21 -0
- package/dist/core/settings-diagnostics.js.map +1 -0
- package/dist/core/settings-manager.d.ts +18 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +88 -7
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +2 -1
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +11 -2
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts +14 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +35 -19
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts +0 -5
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js +2 -5
- package/dist/core/tools/edit-diff.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +3 -2
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/index.d.ts +4 -1
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +13 -1
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/powershell.d.ts +16 -0
- package/dist/core/tools/powershell.d.ts.map +1 -0
- package/dist/core/tools/powershell.js +39 -0
- package/dist/core/tools/powershell.js.map +1 -0
- package/dist/core/trust-manager.d.ts.map +1 -1
- package/dist/core/trust-manager.js +2 -1
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/extensions/llama/client.d.ts +6 -0
- package/dist/extensions/llama/client.d.ts.map +1 -1
- package/dist/extensions/llama/client.js +7 -0
- package/dist/extensions/llama/client.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts +3 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +27 -6
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +13 -2
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +4 -3
- package/dist/migrations.js.map +1 -1
- package/dist/modes/app-server/daemon/probe.js +1 -1
- package/dist/modes/app-server/daemon/probe.js.map +1 -1
- package/dist/modes/app-server/daemon.js +13 -2
- package/dist/modes/app-server/daemon.js.map +1 -1
- package/dist/modes/app-server/transports/websocket-connection-handler.d.ts.map +1 -1
- package/dist/modes/app-server/transports/websocket-connection-handler.js +4 -0
- package/dist/modes/app-server/transports/websocket-connection-handler.js.map +1 -1
- package/dist/modes/interactive/aborted-error-label.d.ts +2 -0
- package/dist/modes/interactive/aborted-error-label.d.ts.map +1 -1
- package/dist/modes/interactive/aborted-error-label.js +7 -0
- package/dist/modes/interactive/aborted-error-label.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts +15 -3
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +68 -17
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts.map +1 -1
- package/dist/modes/interactive/external-editor.js +2 -1
- package/dist/modes/interactive/external-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +6 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +19 -12
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/json-event.d.ts +16 -13
- package/dist/modes/json-event.d.ts.map +1 -1
- package/dist/modes/json-event.js +20 -6
- package/dist/modes/json-event.js.map +1 -1
- package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
- package/dist/modes/rpc/connection-handler.js +3 -0
- package/dist/modes/rpc/connection-handler.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +7 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +7 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +12 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/package-manager-cli.d.ts +1 -0
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +186 -2
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/frontmatter.d.ts.map +1 -1
- package/dist/utils/frontmatter.js +2 -1
- package/dist/utils/frontmatter.js.map +1 -1
- package/dist/utils/shell.d.ts +3 -0
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +17 -5
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/syntax-highlight.d.ts +1 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -1
- package/dist/utils/syntax-highlight.js +60 -1
- package/dist/utils/syntax-highlight.js.map +1 -1
- package/dist/utils/text.d.ts +8 -0
- package/dist/utils/text.d.ts.map +1 -0
- package/dist/utils/text.js +9 -0
- package/dist/utils/text.js.map +1 -0
- package/docs/compaction.md +0 -2
- package/docs/custom-provider.md +6 -6
- package/docs/environment-variables.md +8 -8
- package/docs/extensions.md +6 -5
- package/docs/json.md +7 -2
- package/docs/keybindings.md +1 -1
- package/docs/packages.md +2 -2
- package/docs/rpc.md +32 -3
- package/docs/sdk.md +7 -2
- package/docs/settings.md +9 -1
- package/docs/terminal-setup.md +11 -9
- package/docs/usage.md +4 -1
- package/docs/windows.md +24 -2
- package/examples/extensions/custom-provider-anthropic/package-lock.json +28 -5
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/node_modules/@anthropic-ai/sdk/CHANGELOG.md +558 -0
- package/node_modules/@anthropic-ai/sdk/README.md +16 -1
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.js +14 -2
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs +14 -2
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/api-promise.d.mts +1 -0
- package/node_modules/@anthropic-ai/sdk/api-promise.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/api-promise.d.ts +1 -0
- package/node_modules/@anthropic-ai/sdk/api-promise.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/api-promise.mjs +1 -0
- package/node_modules/@anthropic-ai/sdk/api-promise.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/bin/migration-config.json +481 -0
- package/node_modules/@anthropic-ai/sdk/client.d.mts +165 -11
- package/node_modules/@anthropic-ai/sdk/client.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/client.d.ts +165 -11
- package/node_modules/@anthropic-ai/sdk/client.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/client.js +415 -38
- package/node_modules/@anthropic-ai/sdk/client.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/client.mjs +414 -37
- package/node_modules/@anthropic-ai/sdk/client.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/api-promise.d.mts +1 -0
- package/node_modules/@anthropic-ai/sdk/core/api-promise.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/api-promise.d.ts +1 -0
- package/node_modules/@anthropic-ai/sdk/core/api-promise.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/api-promise.js +7 -2
- package/node_modules/@anthropic-ai/sdk/core/api-promise.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/api-promise.mjs +8 -3
- package/node_modules/@anthropic-ai/sdk/core/api-promise.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/api.d.mts +11 -0
- package/node_modules/@anthropic-ai/sdk/core/api.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/api.d.ts +11 -0
- package/node_modules/@anthropic-ai/sdk/core/api.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/api.js +3 -0
- package/node_modules/@anthropic-ai/sdk/core/api.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/api.mjs +2 -0
- package/node_modules/@anthropic-ai/sdk/core/api.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/credentials.d.mts +131 -0
- package/node_modules/@anthropic-ai/sdk/core/credentials.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/credentials.d.ts +131 -0
- package/node_modules/@anthropic-ai/sdk/core/credentials.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/credentials.js +317 -0
- package/node_modules/@anthropic-ai/sdk/core/credentials.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/credentials.mjs +277 -0
- package/node_modules/@anthropic-ai/sdk/core/credentials.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/error.d.mts +12 -0
- package/node_modules/@anthropic-ai/sdk/core/error.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/error.d.ts +12 -0
- package/node_modules/@anthropic-ai/sdk/core/error.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/error.js +18 -1
- package/node_modules/@anthropic-ai/sdk/core/error.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/error.mjs +16 -0
- package/node_modules/@anthropic-ai/sdk/core/error.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/middleware.d.mts +154 -0
- package/node_modules/@anthropic-ai/sdk/core/middleware.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/middleware.d.ts +154 -0
- package/node_modules/@anthropic-ai/sdk/core/middleware.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/middleware.js +174 -0
- package/node_modules/@anthropic-ai/sdk/core/middleware.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/middleware.mjs +168 -0
- package/node_modules/@anthropic-ai/sdk/core/middleware.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/pagination.d.mts +20 -0
- package/node_modules/@anthropic-ai/sdk/core/pagination.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/pagination.d.ts +20 -0
- package/node_modules/@anthropic-ai/sdk/core/pagination.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/pagination.js +26 -1
- package/node_modules/@anthropic-ai/sdk/core/pagination.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/pagination.mjs +24 -0
- package/node_modules/@anthropic-ai/sdk/core/pagination.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/resource.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/resource.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/streaming.d.mts +9 -0
- package/node_modules/@anthropic-ai/sdk/core/streaming.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/streaming.d.ts +9 -0
- package/node_modules/@anthropic-ai/sdk/core/streaming.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/streaming.js +34 -1
- package/node_modules/@anthropic-ai/sdk/core/streaming.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/streaming.mjs +34 -1
- package/node_modules/@anthropic-ai/sdk/core/streaming.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/uploads.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/uploads.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/uploads.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/error.d.mts +1 -0
- package/node_modules/@anthropic-ai/sdk/error.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/error.d.ts +1 -0
- package/node_modules/@anthropic-ai/sdk/error.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/error.mjs +1 -0
- package/node_modules/@anthropic-ai/sdk/error.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/environments.d.mts +23 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/environments.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/environments.d.ts +23 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/environments.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/environments.js +31 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/environments.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/environments.mjs +23 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/environments.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/json-schema.d.mts +6 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/json-schema.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/json-schema.d.ts +6 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/json-schema.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/json-schema.js +1 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/json-schema.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/json-schema.mjs +1 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/json-schema.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/mcp.d.mts +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/mcp.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/mcp.d.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/mcp.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/mcp.js +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/mcp.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/mcp.mjs +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/mcp.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/memory.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/memory.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/zod.d.mts +11 -5
- package/node_modules/@anthropic-ai/sdk/helpers/beta/zod.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/zod.d.ts +11 -5
- package/node_modules/@anthropic-ai/sdk/helpers/beta/zod.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/zod.js +2 -2
- package/node_modules/@anthropic-ai/sdk/helpers/beta/zod.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/zod.mjs +2 -2
- package/node_modules/@anthropic-ai/sdk/helpers/beta/zod.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/index.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/index.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/index.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/json-schema.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/json-schema.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/json-schema.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/zod.d.mts +2 -2
- package/node_modules/@anthropic-ai/sdk/helpers/zod.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/zod.d.ts +2 -2
- package/node_modules/@anthropic-ai/sdk/helpers/zod.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/zod.js +1 -2
- package/node_modules/@anthropic-ai/sdk/helpers/zod.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/zod.mjs +1 -2
- package/node_modules/@anthropic-ai/sdk/helpers/zod.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/index.d.mts +4 -2
- package/node_modules/@anthropic-ai/sdk/index.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/index.d.ts +4 -2
- package/node_modules/@anthropic-ai/sdk/index.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/index.js +5 -1
- package/node_modules/@anthropic-ai/sdk/index.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/index.mjs +3 -2
- package/node_modules/@anthropic-ai/sdk/index.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/constants.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/constants.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/constants.js +0 -5
- package/node_modules/@anthropic-ai/sdk/internal/constants.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/constants.mjs +0 -5
- package/node_modules/@anthropic-ai/sdk/internal/constants.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/file-store.d.mts +136 -0
- package/node_modules/@anthropic-ai/sdk/internal/file-store.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/file-store.d.ts +136 -0
- package/node_modules/@anthropic-ai/sdk/internal/file-store.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/file-store.js +531 -0
- package/node_modules/@anthropic-ai/sdk/internal/file-store.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/file-store.mjs +523 -0
- package/node_modules/@anthropic-ai/sdk/internal/file-store.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/headers.d.mts +7 -0
- package/node_modules/@anthropic-ai/sdk/internal/headers.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/headers.d.ts +7 -0
- package/node_modules/@anthropic-ai/sdk/internal/headers.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/headers.js +45 -4
- package/node_modules/@anthropic-ai/sdk/internal/headers.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/headers.mjs +43 -3
- package/node_modules/@anthropic-ai/sdk/internal/headers.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/message-stream-utils.d.mts +10 -0
- package/node_modules/@anthropic-ai/sdk/internal/message-stream-utils.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/message-stream-utils.d.ts +10 -0
- package/node_modules/@anthropic-ai/sdk/internal/message-stream-utils.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/message-stream-utils.js +34 -0
- package/node_modules/@anthropic-ai/sdk/internal/message-stream-utils.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/message-stream-utils.mjs +30 -0
- package/node_modules/@anthropic-ai/sdk/internal/message-stream-utils.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/parse.d.mts +2 -1
- package/node_modules/@anthropic-ai/sdk/internal/parse.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/parse.d.ts +2 -1
- package/node_modules/@anthropic-ai/sdk/internal/parse.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/parse.js +16 -10
- package/node_modules/@anthropic-ai/sdk/internal/parse.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/parse.mjs +15 -9
- package/node_modules/@anthropic-ai/sdk/internal/parse.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/qs/formats.d.mts +7 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/formats.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/formats.d.ts +7 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/formats.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/formats.js +13 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/formats.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/formats.mjs +9 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/formats.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/index.d.mts +10 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/index.d.ts +10 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/index.js +14 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/index.mjs +10 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/stringify.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/stringify.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/stringify.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/stringify.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/stringify.js +277 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/stringify.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/stringify.mjs +274 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/stringify.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/types.d.mts +57 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/types.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/types.d.ts +57 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/types.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/types.js +3 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/types.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/types.mjs +2 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/types.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/utils.d.mts +15 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/utils.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/utils.d.ts +15 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/utils.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/utils.js +230 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/utils.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/utils.mjs +217 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/utils.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-options.d.mts +52 -2
- package/node_modules/@anthropic-ai/sdk/internal/request-options.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/request-options.d.ts +52 -2
- package/node_modules/@anthropic-ai/sdk/internal/request-options.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/request-options.js +12 -1
- package/node_modules/@anthropic-ai/sdk/internal/request-options.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/request-options.mjs +10 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-options.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/request-signal.d.mts +4 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-signal.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-signal.d.ts +4 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-signal.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-signal.js +50 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-signal.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-signal.mjs +45 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-signal.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/shims.d.mts +6 -0
- package/node_modules/@anthropic-ai/sdk/internal/shims.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/shims.d.ts +6 -0
- package/node_modules/@anthropic-ai/sdk/internal/shims.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.d.mts +60 -0
- package/node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.d.ts +60 -0
- package/node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/{lib → internal}/stainless-helper-header.js +27 -6
- package/node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/{lib → internal}/stainless-helper-header.mjs +25 -5
- package/node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/to-file.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/to-file.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/to-file.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/types.d.mts +12 -6
- package/node_modules/@anthropic-ai/sdk/internal/types.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/types.d.ts +12 -6
- package/node_modules/@anthropic-ai/sdk/internal/types.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/uploads.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/uploads.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/uploads.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/abort.d.mts +13 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/abort.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/abort.d.ts +13 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/abort.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/abort.js +26 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/abort.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/abort.mjs +23 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/abort.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.d.mts +31 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.d.ts +31 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.js +75 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.mjs +71 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/backoff.d.mts +23 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/backoff.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/backoff.d.ts +23 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/backoff.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/backoff.js +44 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/backoff.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/backoff.mjs +36 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/backoff.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.d.mts +11 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.d.ts +11 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.js +37 -11
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.mjs +35 -10
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/path.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/promise.d.mts +11 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/promise.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/promise.d.ts +11 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/promise.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/promise.js +18 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/promise.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/promise.mjs +15 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/promise.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/query.d.mts +0 -3
- package/node_modules/@anthropic-ai/sdk/internal/utils/query.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/query.d.ts +0 -3
- package/node_modules/@anthropic-ai/sdk/internal/utils/query.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/query.js +3 -16
- package/node_modules/@anthropic-ai/sdk/internal/utils/query.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/query.mjs +2 -16
- package/node_modules/@anthropic-ai/sdk/internal/utils/query.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.mts +9 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.ts +9 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.js +23 -2
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs +23 -2
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/time.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/time.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/time.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/time.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/time.js +8 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/time.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/time.mjs +5 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/time.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.js +66 -31
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs +66 -31
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.js +37 -26
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs +34 -23
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/beta-parser.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/beta-parser.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/beta-parser.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.d.mts +39 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.d.ts +39 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.js +245 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.mjs +208 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.d.mts +11 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.d.ts +11 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.js +72 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.mjs +35 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.d.mts +40 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.d.ts +40 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.js +82 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.mjs +79 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.d.mts +54 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.d.ts +54 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.js +112 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.mjs +108 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.d.mts +96 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.d.ts +96 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.js +266 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.mjs +224 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.d.mts +21 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.d.ts +21 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.js +130 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.mjs +94 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials.d.mts +4 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials.d.ts +4 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials.js +8 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/index.d.mts +4 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/index.d.ts +4 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/index.js +18 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/index.mjs +4 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/poller.d.mts +95 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/poller.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/poller.d.ts +95 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/poller.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/poller.js +226 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/poller.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/poller.mjs +217 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/poller.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/worker.d.mts +227 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/worker.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/worker.d.ts +227 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/worker.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/worker.js +569 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/worker.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/worker.mjs +564 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/worker.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/helper-client.d.mts +31 -0
- package/node_modules/@anthropic-ai/sdk/lib/helper-client.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/helper-client.d.ts +31 -0
- package/node_modules/@anthropic-ai/sdk/lib/helper-client.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/helper-client.js +58 -0
- package/node_modules/@anthropic-ai/sdk/lib/helper-client.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/helper-client.mjs +55 -0
- package/node_modules/@anthropic-ai/sdk/lib/helper-client.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/middleware.d.mts +98 -0
- package/node_modules/@anthropic-ai/sdk/lib/middleware.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/middleware.d.ts +98 -0
- package/node_modules/@anthropic-ai/sdk/lib/middleware.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/middleware.js +754 -0
- package/node_modules/@anthropic-ai/sdk/lib/middleware.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/middleware.mjs +749 -0
- package/node_modules/@anthropic-ai/sdk/lib/middleware.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/parser.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/parser.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/parser.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.d.mts +22 -0
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.d.ts +22 -0
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.js +88 -0
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.mjs +85 -0
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.d.mts +38 -5
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.d.ts +38 -5
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.js +28 -0
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.mjs +25 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.d.mts +1 -1
- 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 +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 +107 -29
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.mjs +105 -27
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/CompactionControl.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/CompactionControl.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.d.mts +179 -0
- package/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.d.ts +179 -0
- package/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.js +728 -0
- package/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.mjs +724 -0
- package/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/tools/ToolError.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/ToolError.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/transform-json-schema.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/package.json +32 -15
- package/node_modules/@anthropic-ai/sdk/pagination.d.mts +1 -0
- package/node_modules/@anthropic-ai/sdk/pagination.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/pagination.d.ts +1 -0
- package/node_modules/@anthropic-ai/sdk/pagination.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/pagination.mjs +1 -0
- package/node_modules/@anthropic-ai/sdk/pagination.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resource.d.mts +1 -0
- package/node_modules/@anthropic-ai/sdk/resource.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resource.d.ts +1 -0
- package/node_modules/@anthropic-ai/sdk/resource.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resource.mjs +1 -0
- package/node_modules/@anthropic-ai/sdk/resource.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.d.mts +608 -68
- 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 +608 -68
- 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 +2 -2
- 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 +2 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/index.d.mts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/index.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/index.d.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/index.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/index.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/index.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/versions.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/versions.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/versions.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.mts +51 -13
- 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 +51 -13
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.js +22 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs +22 -2
- 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 +306 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.d.ts +306 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.js +55 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.mjs +51 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.d.mts +698 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.d.ts +698 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.js +196 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.mjs +192 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.d.mts +309 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.d.ts +309 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.js +116 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.mjs +112 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.d.mts +426 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.d.ts +426 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.js +150 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.mjs +145 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/index.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/index.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/index.js +9 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/index.mjs +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.d.mts +501 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.d.ts +501 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.js +257 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.mjs +251 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments.d.mts +1 -388
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments.d.ts +1 -388
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments.js +2 -138
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments.mjs +1 -136
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.mts +22 -22
- 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 +22 -22
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.js +5 -5
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.mjs +5 -5
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.mts +11 -6
- 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 +11 -6
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.js +23 -13
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs +6 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/index.d.mts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/index.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/index.d.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/index.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/index.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/index.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.d.mts +136 -24
- 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 +136 -24
- 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/memories.js +10 -10
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.mjs +10 -10
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.d.mts +60 -16
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.d.ts +60 -16
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.js +12 -12
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.mjs +12 -12
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.d.mts +105 -7
- 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 +105 -7
- 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/memory-stores/memory-versions.js +6 -6
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.mjs +6 -6
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.mts +81 -30
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.ts +81 -30
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.js +12 -9
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs +12 -9
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs.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 +2453 -380
- 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 +2453 -380
- 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 +16 -22
- 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 +16 -22
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.d.mts +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.d.ts +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.d.mts +643 -19
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.d.ts +643 -19
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.js +29 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.mjs +27 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/index.d.mts +3 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/index.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/index.d.ts +3 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/index.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/index.js +3 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/index.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/index.mjs +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/index.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/resources.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/resources.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/resources.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.d.mts +455 -8
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.d.ts +455 -8
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.js +5 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.mjs +6 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.d.mts +78 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.d.ts +78 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.js +61 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.mjs +57 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/index.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/index.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/index.js +9 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/index.mjs +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.d.mts +195 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.d.ts +195 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.js +88 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.mjs +83 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads.js +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.d.mts +1 -1
- 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 +1 -1
- 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 +13 -11
- 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 +13 -11
- 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 +5 -3
- 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 +5 -3
- 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 +31 -3
- 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 +31 -3
- 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 +32 -3
- 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 +32 -3
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.d.mts +163 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.d.ts +163 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.js +129 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.mjs +125 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/index.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/index.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/index.js +9 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/index.mjs +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.d.mts +212 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.d.ts +212 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.js +181 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.mjs +176 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels.js +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.d.mts +62 -0
- 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 +62 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.js +5 -5
- package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.mjs +5 -5
- package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.d.mts +256 -4
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.d.ts +256 -4
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.js +22 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.mjs +22 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/index.d.mts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/index.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/index.d.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/index.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/index.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/index.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.d.mts +2 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.d.ts +2 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.d.mts +466 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.d.ts +466 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.js +20 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.mjs +16 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/completions.d.mts +18 -11
- package/node_modules/@anthropic-ai/sdk/resources/completions.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/completions.d.ts +18 -11
- package/node_modules/@anthropic-ai/sdk/resources/completions.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/completions.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/files.d.mts +105 -0
- package/node_modules/@anthropic-ai/sdk/resources/files.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/files.d.ts +105 -0
- package/node_modules/@anthropic-ai/sdk/resources/files.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/files.js +52 -0
- package/node_modules/@anthropic-ai/sdk/resources/files.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/files.mjs +48 -0
- package/node_modules/@anthropic-ai/sdk/resources/files.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/index.d.mts +4 -2
- package/node_modules/@anthropic-ai/sdk/resources/index.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/index.d.ts +4 -2
- package/node_modules/@anthropic-ai/sdk/resources/index.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/index.js +5 -1
- package/node_modules/@anthropic-ai/sdk/resources/index.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/index.mjs +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/index.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.mts +20 -11
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.ts +20 -11
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.js +17 -9
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs +17 -9
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.d.mts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.d.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.mts +1782 -162
- 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 +1782 -162
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.js +23 -28
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs +23 -28
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/models.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/models.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/models.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/skills/index.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/index.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/index.js +9 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/index.mjs +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/skills.d.mts +129 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/skills.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/skills.d.ts +129 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/skills.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/skills.js +44 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/skills.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/skills.mjs +39 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/skills.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/versions.d.mts +104 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/versions.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/versions.d.ts +104 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/versions.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/versions.js +41 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/versions.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/versions.mjs +37 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/versions.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills.js +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/src/_vendor/partial-json-parser/parser.ts +18 -2
- package/node_modules/@anthropic-ai/sdk/src/client.ts +749 -42
- package/node_modules/@anthropic-ai/sdk/src/core/api-promise.ts +14 -4
- package/node_modules/@anthropic-ai/sdk/src/core/api.ts +11 -0
- package/node_modules/@anthropic-ai/sdk/src/core/credentials.ts +379 -0
- package/node_modules/@anthropic-ai/sdk/src/core/error.ts +17 -0
- package/node_modules/@anthropic-ai/sdk/src/core/middleware.ts +339 -0
- package/node_modules/@anthropic-ai/sdk/src/core/pagination.ts +60 -0
- package/node_modules/@anthropic-ai/sdk/src/core/streaming.ts +38 -1
- package/node_modules/@anthropic-ai/sdk/src/helpers/beta/environments.ts +34 -0
- package/node_modules/@anthropic-ai/sdk/src/helpers/beta/json-schema.ts +7 -0
- package/node_modules/@anthropic-ai/sdk/src/helpers/beta/mcp.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/src/helpers/beta/zod.ts +14 -10
- package/node_modules/@anthropic-ai/sdk/src/helpers/zod.ts +3 -6
- package/node_modules/@anthropic-ai/sdk/src/index.ts +16 -1
- package/node_modules/@anthropic-ai/sdk/src/internal/constants.ts +0 -5
- package/node_modules/@anthropic-ai/sdk/src/internal/file-store.ts +550 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/headers.ts +47 -4
- package/node_modules/@anthropic-ai/sdk/src/internal/message-stream-utils.ts +30 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/parse.ts +16 -11
- package/node_modules/@anthropic-ai/sdk/src/internal/qs/LICENSE.md +13 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/qs/README.md +3 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/qs/formats.ts +10 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/qs/index.ts +13 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/qs/stringify.ts +385 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/qs/types.ts +71 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/qs/utils.ts +265 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/request-options.ts +55 -2
- package/node_modules/@anthropic-ai/sdk/src/internal/request-signal.ts +68 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/stainless-helper-header.ts +122 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/abort.ts +21 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/async-queue.ts +66 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/backoff.ts +41 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/log.ts +41 -10
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/promise.ts +18 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/query.ts +2 -18
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/sleep.ts +25 -2
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/time.ts +4 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/BetaMessageStream.ts +72 -33
- package/node_modules/@anthropic-ai/sdk/src/lib/MessageStream.ts +36 -24
- package/node_modules/@anthropic-ai/sdk/src/lib/credentials/credential-chain.ts +292 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/credentials/identity-token.ts +37 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/credentials/oidc-federation.ts +140 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/credentials/token-cache.ts +130 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/credentials/types.ts +295 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/credentials/user-oauth.ts +144 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/credentials.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/environments/index.ts +23 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/environments/poller.ts +299 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/environments/worker.ts +779 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/helper-client.ts +86 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/middleware.ts +994 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/sessions/accumulate.ts +130 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/tools/BetaRunnableTool.ts +71 -7
- package/node_modules/@anthropic-ai/sdk/src/lib/tools/BetaToolRunner.ts +135 -35
- package/node_modules/@anthropic-ai/sdk/src/lib/tools/SessionToolRunner.ts +885 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/agents/agents.ts +806 -69
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/agents/index.ts +34 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/beta.ts +690 -28
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/deployment-runs.ts +441 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/deployments.ts +996 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/dreams.ts +453 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/environments/environments.ts +626 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/environments/index.ts +42 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/environments/work.ts +705 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/environments.ts +1 -540
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/files.ts +28 -28
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/index.ts +312 -5
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/memory-stores/index.ts +1 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/memory-stores/memories.ts +141 -31
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/memory-stores/memory-stores.ts +66 -20
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/memory-stores/memory-versions.ts +112 -9
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/batches.ts +90 -33
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/index.ts +90 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/messages.ts +2755 -211
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/models.ts +7 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/events.ts +888 -18
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/index.ts +60 -1
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/sessions.ts +669 -14
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/threads/events.ts +123 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/threads/index.ts +15 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/threads/threads.ts +330 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/threads.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/skills/index.ts +1 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/skills/skills.ts +15 -14
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/skills/versions.ts +49 -3
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/tunnels/certificates.ts +252 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/tunnels/index.ts +23 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/tunnels/tunnels.ts +347 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/tunnels.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/user-profiles.ts +76 -5
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/vaults/credentials.ts +347 -3
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/vaults/index.ts +17 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/vaults/vaults.ts +34 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/webhooks.ts +762 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/completions.ts +18 -11
- package/node_modules/@anthropic-ai/sdk/src/resources/files.ts +163 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/index.ts +89 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/messages/batches.ts +30 -12
- package/node_modules/@anthropic-ai/sdk/src/resources/messages/index.ts +70 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/messages/messages.ts +2202 -226
- package/node_modules/@anthropic-ai/sdk/src/resources/skills/index.ts +21 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/skills/skills.ts +194 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/skills/versions.ts +160 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/skills.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/fs-util.ts +190 -0
- package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/memories.ts +1017 -0
- package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/node.browser.ts +172 -0
- package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/node.ts +914 -0
- package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/skills.ts +372 -0
- package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/sync-interval.ts +30 -0
- package/node_modules/@anthropic-ai/sdk/src/tools/memory/node.browser.ts +64 -0
- package/node_modules/@anthropic-ai/sdk/src/version.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/streaming.d.mts +1 -0
- package/node_modules/@anthropic-ai/sdk/streaming.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/streaming.d.ts +1 -0
- package/node_modules/@anthropic-ai/sdk/streaming.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/streaming.mjs +1 -0
- package/node_modules/@anthropic-ai/sdk/streaming.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.d.mts +75 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.d.ts +75 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.js +196 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.mjs +185 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.d.mts +173 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.d.ts +173 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.js +902 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.mjs +895 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.d.mts +82 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.d.ts +82 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.js +151 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.mjs +131 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.d.mts +190 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.d.ts +190 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.js +819 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.mjs +797 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.d.mts +82 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.d.ts +82 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.js +352 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.mjs +344 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.d.mts +19 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.d.ts +19 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.js +29 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.mjs +25 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/memory/node.browser.d.mts +27 -0
- package/node_modules/@anthropic-ai/sdk/tools/memory/node.browser.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/memory/node.browser.d.ts +27 -0
- package/node_modules/@anthropic-ai/sdk/tools/memory/node.browser.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/memory/node.browser.js +49 -0
- package/node_modules/@anthropic-ai/sdk/tools/memory/node.browser.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/memory/node.browser.mjs +44 -0
- package/node_modules/@anthropic-ai/sdk/tools/memory/node.browser.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/memory/node.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/memory/node.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/memory/node.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/uploads.d.mts +1 -0
- package/node_modules/@anthropic-ai/sdk/uploads.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/uploads.d.ts +1 -0
- package/node_modules/@anthropic-ai/sdk/uploads.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/uploads.mjs +1 -0
- package/node_modules/@anthropic-ai/sdk/uploads.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/version.d.mts +1 -1
- package/node_modules/@anthropic-ai/sdk/version.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/version.d.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/version.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/version.js +1 -1
- package/node_modules/@anthropic-ai/sdk/version.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/version.mjs +1 -1
- package/node_modules/@anthropic-ai/sdk/version.mjs.map +1 -1
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +24 -0
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
- package/node_modules/@code-yeongyu/senpi-codemode/src/extension/session-manager-proxy.ts +39 -5
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +7 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts +2 -3
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js +7 -6
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/assistant-terminal-state.d.ts +4 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/assistant-terminal-state.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/assistant-terminal-state.js +8 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/assistant-terminal-state.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/index.js +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +5 -5
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts +1 -5
- 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 +25 -13
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +91 -5
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +4 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +4 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +93 -54
- 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.js +2 -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/transform-messages.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/transform-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/github-copilot.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/github-copilot.js +97 -46
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/github-copilot.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-coding.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-coding.js +1 -14
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-coding.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.d.ts +50 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.js +129 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +3 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts +8 -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 +16 -3
- package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.d.ts +3 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.js +10 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.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/cloudflare-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/nvidia.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.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/opengateway.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/data/zai-coding-cn.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.d.ts +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.js +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +8 -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/overflow.d.ts +16 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +17 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/backoff.d.ts +14 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/backoff.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/backoff.js +24 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/backoff.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/classifiers.d.ts +36 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/classifiers.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/classifiers.js +109 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/classifiers.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/failure.d.ts +12 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/failure.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/failure.js +109 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/failure.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/index.d.ts +9 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/index.js +6 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/planner.d.ts +46 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/planner.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/planner.js +41 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/planner.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/profiles.d.ts +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/profiles.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/profiles.js +93 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/profiles.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/types.d.ts +121 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/types.js +11 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/types.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts +12 -0
- 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 +25 -5
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/sleep.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/sleep.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/sleep.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/sleep.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/package.json +21 -17
- package/node_modules/@earendil-works/pi-pty/dist/index.d.ts +1 -0
- package/node_modules/@earendil-works/pi-pty/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-pty/dist/index.js +1 -0
- package/node_modules/@earendil-works/pi-pty/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-pty/dist/session-bun.d.ts +30 -0
- package/node_modules/@earendil-works/pi-pty/dist/session-bun.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-pty/dist/session-bun.js +76 -0
- package/node_modules/@earendil-works/pi-pty/dist/session-bun.js.map +1 -0
- package/node_modules/@earendil-works/pi-pty/dist/session-types.d.ts +3 -1
- package/node_modules/@earendil-works/pi-pty/dist/session-types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-pty/dist/session-types.js.map +1 -1
- package/node_modules/@earendil-works/pi-pty/dist/session.d.ts +2 -0
- package/node_modules/@earendil-works/pi-pty/dist/session.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-pty/dist/session.js +19 -9
- package/node_modules/@earendil-works/pi-pty/dist/session.js.map +1 -1
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-telemetry/package.json +3 -3
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +9 -4
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts +8 -2
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +24 -4
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +2 -2
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +2 -2
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +2 -8
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/native-module-path.d.ts +7 -0
- package/node_modules/@earendil-works/pi-tui/dist/native-module-path.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/native-module-path.js +19 -0
- package/node_modules/@earendil-works/pi-tui/dist/native-module-path.js.map +1 -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 +4 -10
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +5 -5
- package/node_modules/@stablelib/base64/LICENSE +21 -0
- package/node_modules/@stablelib/base64/base64.bench.ts +25 -0
- package/node_modules/@stablelib/base64/base64.test.ts +85 -0
- package/node_modules/@stablelib/base64/base64.ts +283 -0
- package/node_modules/@stablelib/base64/lib/base64.bench.d.ts +1 -0
- package/node_modules/@stablelib/base64/lib/base64.bench.js +23 -0
- package/node_modules/@stablelib/base64/lib/base64.bench.js.map +1 -0
- package/node_modules/@stablelib/base64/lib/base64.d.ts +34 -0
- package/node_modules/@stablelib/base64/lib/base64.js +282 -0
- package/node_modules/@stablelib/base64/lib/base64.js.map +1 -0
- package/node_modules/@stablelib/base64/lib/base64.test.d.ts +1 -0
- package/node_modules/@stablelib/base64/lib/base64.test.js +82 -0
- package/node_modules/@stablelib/base64/lib/base64.test.js.map +1 -0
- package/node_modules/@stablelib/base64/package.json +25 -0
- package/node_modules/@stablelib/base64/tsconfig.json +27 -0
- package/node_modules/fast-sha256/LICENSE +24 -0
- package/node_modules/fast-sha256/README.md +127 -0
- package/node_modules/fast-sha256/package.json +42 -0
- package/node_modules/fast-sha256/sha256.d.ts +39 -0
- package/node_modules/fast-sha256/sha256.js +427 -0
- package/node_modules/fast-sha256/sha256.min.js +1 -0
- package/node_modules/standardwebhooks/README.md +41 -0
- package/node_modules/standardwebhooks/dist/index.d.ts +24 -0
- package/node_modules/standardwebhooks/dist/index.js +106 -0
- package/node_modules/standardwebhooks/dist/index.js.map +1 -0
- package/node_modules/standardwebhooks/dist/timing_safe_equal.d.ts +1 -0
- package/node_modules/standardwebhooks/dist/timing_safe_equal.js +30 -0
- package/node_modules/standardwebhooks/dist/timing_safe_equal.js.map +1 -0
- package/node_modules/standardwebhooks/package.json +45 -0
- package/package.json +100 -89
- package/dist/core/radius.d.ts +0 -2
- package/dist/core/radius.d.ts.map +0 -1
- package/dist/core/radius.js +0 -2
- package/dist/core/radius.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/lib/stainless-helper-header.d.mts +0 -34
- package/node_modules/@anthropic-ai/sdk/lib/stainless-helper-header.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/lib/stainless-helper-header.d.ts +0 -34
- package/node_modules/@anthropic-ai/sdk/lib/stainless-helper-header.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/lib/stainless-helper-header.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/lib/stainless-helper-header.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/ToolRunner.d.mts +0 -132
- package/node_modules/@anthropic-ai/sdk/lib/tools/ToolRunner.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/ToolRunner.d.ts +0 -132
- package/node_modules/@anthropic-ai/sdk/lib/tools/ToolRunner.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/ToolRunner.js +0 -294
- package/node_modules/@anthropic-ai/sdk/lib/tools/ToolRunner.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/ToolRunner.mjs +0 -290
- package/node_modules/@anthropic-ai/sdk/lib/tools/ToolRunner.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/src/lib/stainless-helper-header.ts +0 -80
- package/node_modules/@anthropic-ai/sdk/src/lib/tools/ToolRunner.ts +0 -381
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"todo-bridge.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/compaction/todo-bridge.ts"],"names":[],"mappings":"AAIA,MAAM,yBAAyB,GAAG,0BAA0B,CAAC;AAC7D,MAAM,oBAAoB,GAAG,mCAAmC,CAAC;AACjE,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAiCjD,SAAS,QAAQ,CAAC,KAAc;IAC/B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AACpD,CAAC;AAED,SAAS,YAAY,CAAC,KAAc;IACnC,8EAA8E;IAC9E,2EAA2E;IAC3E,0EAA0E;IAC1E,OAAO,KAAK,KAAK,SAAS,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;AACzD,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IAClC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACnC,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,EAAE,KAAK,QAAQ,CAAC;IAC3C,MAAM,UAAU,GAAG,OAAO,KAAK,C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7C,MAAM,GAAG,GAAG,iBAAqC,CAAC;IAClD,IAAI,eAAe,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO;IAE5C,MAAM,QAAQ,GAAG,sBAAsB,CAAC,GAAG,CAAC,CAAC;IAC7C,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAErD,EAAE,CAAC,WAAW,CACb;QACC,UAAU,EAAE,iCAAiC;QAC7C,OAAO,EAAE,6CAA6C,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QACtF,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,QAAQ;KACjB,EACD,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAC5C,CAAC;AACH,CAAC","sourcesContent":["import type { CustomEntry, SessionEntry } from \"../../../session-manager.ts\";\nimport type { ExtensionAPI, ExtensionContext } from \"../../types.ts\";\nimport type { TodoPhase } from \"../todotools/state.ts\";\n\nconst TODO_SNAPSHOT_CUSTOM_TYPE = \"compaction.todo-snapshot\";\nconst TODO_SNAPSHOT_SCHEMA = \"senpi.compaction.todo-snapshot.v1\";\nconst TODO_STATE_ENTRY_TYPE = \"senpi.todo-state\";\n\nexport interface TodoEntry {\n\tid?: string;\n\tcontent?: string;\n\ttext?: string;\n\tstatus?: string;\n}\n\nexport type TodoSnapshotItems = TodoEntry[] | TodoPhase[];\n\nexport interface TodoSnapshotPayload {\n\tschema: typeof TODO_SNAPSHOT_SCHEMA;\n\ttodos: TodoSnapshotItems | SessionEntry[];\n\tcapturedAt: number;\n}\n\ninterface AppendEntryTarget {\n\tappendEntry<T = unknown>(customType: string, data?: T): void;\n}\n\ninterface SendMessageTarget extends AppendEntryTarget {\n\tsendMessage<T = unknown>(\n\t\tmessage: { customType: string; content: string; display: boolean; details?: T },\n\t\toptions?: { triggerTurn?: boolean; deliverAs?: \"steer\" | \"followUp\" | \"nextTurn\" },\n\t): void;\n}\n\nexport interface RestoreResult<T extends TodoSnapshotItems = TodoSnapshotItems> {\n\tapplied: boolean;\n\trestoredTodos: T;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null;\n}\n\nfunction isTodoStatus(value: unknown): value is TodoEntry[\"status\"] {\n\t// Legacy todowrite entries carried arbitrary status strings (e.g. \"blocked\").\n\t// The bridge is a pass-through snapshot carrier, not a validator: preserve\n\t// every string-status entry so restore never silently drops legacy todos.\n\treturn value === undefined || typeof value === \"string\";\n}\n\nfunction isTodoEntry(value: unknown): value is TodoEntry {\n\tif (!isRecord(value)) return false;\n\tconst hasId = typeof value.id === \"string\";\n\tconst hasContent = typeof value.content === \"string\" || typeof value.text === \"string\";\n\treturn (hasId || hasContent) && isTodoStatus(value.status);\n}\n\nfunction isTodoPhase(value: unknown): value is TodoPhase {\n\tif (!isRecord(value) || typeof value.name !== \"string\" || !Array.isArray(value.tasks)) return false;\n\treturn value.tasks.every(isTodoEntry);\n}\n\nfunction isCustomTodoEntry(entry: SessionEntry): entry is CustomEntry {\n\treturn (\n\t\tentry.type === \"custom\" &&\n\t\t(entry.customType.startsWith(\"todowrite\") || entry.customType === TODO_STATE_ENTRY_TYPE)\n\t);\n}\n\nfunction isLegacyTodoListEntry(entry: SessionEntry): entry is CustomEntry {\n\treturn entry.type === \"custom\" && entry.customType === \"todo-list\";\n}\n\nfunction readTodosFromEntry(entry: CustomEntry): TodoEntry[] {\n\tconst data = entry.data;\n\tif (!isRecord(data)) return [];\n\tif (Array.isArray(data.todos)) return data.todos.filter(isTodoEntry);\n\tif (Array.isArray(data.phases)) {\n\t\treturn data.phases.filter(isTodoPhase).flatMap((phase) => phase.tasks);\n\t}\n\treturn [];\n}\n\nfunction findLatestTodoSnapshot(ctx: ExtensionContext): TodoSnapshotPayload | null {\n\tconst entries = ctx.sessionManager.getEntries();\n\tfor (let index = entries.length - 1; index >= 0; index -= 1) {\n\t\tconst entry = entries[index];\n\t\tif (entry.type !== \"custom\" || entry.customType !== TODO_SNAPSHOT_CUSTOM_TYPE) continue;\n\t\tconst data = entry.data;\n\t\tif (isRecord(data) && data.schema === TODO_SNAPSHOT_SCHEMA && Array.isArray(data.todos)) {\n\t\t\treturn data as unknown as TodoSnapshotPayload;\n\t\t}\n\t}\n\treturn null;\n}\n\nexport function findTodoEntries(ctx: ExtensionContext): SessionEntry[];\nexport function findTodoEntries(entries: SessionEntry[], options?: { branchId?: string }): TodoEntry[];\nexport function findTodoEntries(\n\tctxOrEntries: ExtensionContext | SessionEntry[],\n\toptions?: { branchId?: string },\n): SessionEntry[] | TodoEntry[] {\n\tif (Array.isArray(ctxOrEntries)) {\n\t\treturn ctxOrEntries\n\t\t\t.filter((entry) => isLegacyTodoListEntry(entry) || isCustomTodoEntry(entry))\n\t\t\t.filter((entry) => options?.branchId === undefined || entry.parentId === options.branchId)\n\t\t\t.flatMap(readTodosFromEntry);\n\t}\n\n\treturn ctxOrEntries.sessionManager.getEntries().filter(isCustomTodoEntry);\n}\n\nexport function createTodoSnapshot(ctx: ExtensionContext): TodoSnapshotPayload {\n\treturn {\n\t\tschema: TODO_SNAPSHOT_SCHEMA,\n\t\ttodos: findTodoEntries(ctx),\n\t\tcapturedAt: Date.now(),\n\t};\n}\n\nexport function persistTodoSnapshot(pi: AppendEntryTarget, snapshot: TodoSnapshotPayload): void {\n\tpi.appendEntry(TODO_SNAPSHOT_CUSTOM_TYPE, snapshot);\n}\n\nexport function captureTodoSnapshot(pi: ExtensionAPI, ctx: ExtensionContext): void;\nexport function captureTodoSnapshot(currentTodos: TodoSnapshotItems, pi: AppendEntryTarget, branchId?: string): void;\nexport function captureTodoSnapshot(\n\tpiOrTodos: ExtensionAPI | TodoSnapshotItems,\n\tctxOrPi: ExtensionContext | AppendEntryTarget,\n\t_branchId?: string,\n): void {\n\tif (Array.isArray(piOrTodos)) {\n\t\tconst pi = ctxOrPi as AppendEntryTarget;\n\t\tpersistTodoSnapshot(pi, {\n\t\t\tschema: TODO_SNAPSHOT_SCHEMA,\n\t\t\ttodos: piOrTodos,\n\t\t\tcapturedAt: Date.now(),\n\t\t});\n\t\treturn;\n\t}\n\n\tpersistTodoSnapshot(piOrTodos, createTodoSnapshot(ctxOrPi as ExtensionContext));\n}\n\nexport function restoreTodosIfMissing(pi: ExtensionAPI, ctx: ExtensionContext): void;\nexport function restoreTodosIfMissing<T extends TodoSnapshotItems>(\n\tsnapshot: T,\n\tcurrentTodos: T,\n\tpi: AppendEntryTarget,\n): RestoreResult<T>;\nexport function restoreTodosIfMissing(\n\tpiOrSnapshot: ExtensionAPI | TodoSnapshotItems,\n\tctxOrCurrentTodos: ExtensionContext | TodoSnapshotItems,\n\t_pi?: AppendEntryTarget,\n): undefined | RestoreResult {\n\tif (Array.isArray(piOrSnapshot) && Array.isArray(ctxOrCurrentTodos)) {\n\t\tif (ctxOrCurrentTodos.length > 0) {\n\t\t\treturn { applied: false, restoredTodos: ctxOrCurrentTodos };\n\t\t}\n\t\treturn { applied: piOrSnapshot.length > 0, restoredTodos: piOrSnapshot };\n\t}\n\n\tconst pi = piOrSnapshot as SendMessageTarget;\n\tconst ctx = ctxOrCurrentTodos as ExtensionContext;\n\tif (findTodoEntries(ctx).length > 0) return;\n\n\tconst snapshot = findLatestTodoSnapshot(ctx);\n\tif (!snapshot || snapshot.todos.length === 0) return;\n\n\tpi.sendMessage(\n\t\t{\n\t\t\tcustomType: \"compaction.todo-restore-request\",\n\t\t\tcontent: `Restore missing todo tasks from snapshot: ${JSON.stringify(snapshot.todos)}`,\n\t\t\tdisplay: false,\n\t\t\tdetails: snapshot,\n\t\t},\n\t\t{ triggerTurn: true, deliverAs: \"nextTurn\" },\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"todo-bridge.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/compaction/todo-bridge.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gCAAgC,EAAkB,MAAM,uBAAuB,CA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OAAO,EAAE,KAAK;QACd,OAAO,EAAE,QAAQ;KACjB,EACD,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAC5C,CAAC;AACH,CAAC","sourcesContent":["import type { CustomEntry, SessionEntry } from \"../../../session-manager.ts\";\nimport type { ExtensionAPI, ExtensionContext } from \"../../types.ts\";\nimport { getLatestPhasesFromBranchEntries, type TodoPhase } from \"../todotools/state.ts\";\n\nconst TODO_SNAPSHOT_CUSTOM_TYPE = \"compaction.todo-snapshot\";\nconst TODO_SNAPSHOT_SCHEMA = \"senpi.compaction.todo-snapshot.v1\";\nconst TODO_STATE_ENTRY_TYPE = \"senpi.todo-state\";\n\nexport interface TodoEntry {\n\tid?: string;\n\tcontent?: string;\n\ttext?: string;\n\tstatus?: string;\n}\n\nexport type TodoSnapshotItems = TodoEntry[] | TodoPhase[];\n\nexport interface TodoSnapshotPayload {\n\tschema: typeof TODO_SNAPSHOT_SCHEMA;\n\ttodos: TodoSnapshotItems;\n\tcapturedAt: number;\n}\n\ninterface AppendEntryTarget {\n\tappendEntry<T = unknown>(customType: string, data?: T): void;\n}\n\ninterface SendMessageTarget extends AppendEntryTarget {\n\tsendMessage<T = unknown>(\n\t\tmessage: { customType: string; content: string; display: boolean; details?: T },\n\t\toptions?: { triggerTurn?: boolean; deliverAs?: \"steer\" | \"followUp\" | \"nextTurn\" },\n\t): void;\n}\n\nexport interface RestoreResult<T extends TodoSnapshotItems = TodoSnapshotItems> {\n\tapplied: boolean;\n\trestoredTodos: T;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null;\n}\n\nfunction isTodoStatus(value: unknown): value is TodoEntry[\"status\"] {\n\t// Legacy todowrite entries carried arbitrary status strings (e.g. \"blocked\").\n\t// The bridge is a pass-through snapshot carrier, not a validator: preserve\n\t// every string-status entry so restore never silently drops legacy todos.\n\treturn value === undefined || typeof value === \"string\";\n}\n\nfunction isTodoEntry(value: unknown): value is TodoEntry {\n\tif (!isRecord(value)) return false;\n\tconst hasId = typeof value.id === \"string\";\n\tconst hasContent = typeof value.content === \"string\" || typeof value.text === \"string\";\n\treturn (hasId || hasContent) && isTodoStatus(value.status);\n}\n\nfunction isTodoPhase(value: unknown): value is TodoPhase {\n\tif (!isRecord(value) || typeof value.name !== \"string\" || !Array.isArray(value.tasks)) return false;\n\treturn value.tasks.every(isTodoEntry);\n}\n\nfunction isCustomTodoEntry(entry: SessionEntry): entry is CustomEntry {\n\treturn (\n\t\tentry.type === \"custom\" &&\n\t\t(entry.customType.startsWith(\"todowrite\") || entry.customType === TODO_STATE_ENTRY_TYPE)\n\t);\n}\n\nfunction isLegacyTodoListEntry(entry: SessionEntry): entry is CustomEntry {\n\treturn entry.type === \"custom\" && entry.customType === \"todo-list\";\n}\n\nfunction readTodosFromEntry(entry: CustomEntry): TodoEntry[] {\n\tconst data = entry.data;\n\tif (!isRecord(data)) return [];\n\tif (Array.isArray(data.todos)) return data.todos.filter(isTodoEntry);\n\tif (Array.isArray(data.phases)) {\n\t\treturn data.phases.filter(isTodoPhase).flatMap((phase) => phase.tasks);\n\t}\n\treturn [];\n}\n\nfunction isCustomEntryEnvelope(value: unknown): value is CustomEntry {\n\treturn (\n\t\tisRecord(value) &&\n\t\tvalue.type === \"custom\" &&\n\t\ttypeof value.id === \"string\" &&\n\t\t(value.parentId === null || typeof value.parentId === \"string\") &&\n\t\ttypeof value.timestamp === \"string\" &&\n\t\ttypeof value.customType === \"string\"\n\t);\n}\n\nfunction normalizeLegacySnapshotEntries(entries: CustomEntry[]): TodoSnapshotItems {\n\tfor (let index = entries.length - 1; index >= 0; index -= 1) {\n\t\tconst entry = entries[index];\n\t\tif (!isLegacyTodoListEntry(entry) && !isCustomTodoEntry(entry)) continue;\n\t\tif (entry.customType === TODO_STATE_ENTRY_TYPE) {\n\t\t\treturn getLatestPhasesFromBranchEntries(entries.slice(0, index + 1));\n\t\t}\n\t\treturn readTodosFromEntry(entry);\n\t}\n\treturn [];\n}\n\nfunction normalizeSnapshotItems(value: unknown): TodoSnapshotItems | null {\n\tif (!Array.isArray(value)) return null;\n\tif (value.every(isTodoPhase)) return value;\n\tif (value.every(isCustomEntryEnvelope)) return normalizeLegacySnapshotEntries(value);\n\tif (value.every(isTodoEntry)) return value;\n\treturn null;\n}\n\nfunction getCurrentTodoPhases(ctx: ExtensionContext): TodoPhase[] {\n\treturn getLatestPhasesFromBranchEntries(ctx.sessionManager.getBranch());\n}\n\nfunction findLatestTodoSnapshot(ctx: ExtensionContext): TodoSnapshotPayload | null {\n\tconst entries = ctx.sessionManager.getBranch();\n\tfor (let index = entries.length - 1; index >= 0; index -= 1) {\n\t\tconst entry = entries[index];\n\t\tif (entry.type !== \"custom\" || entry.customType !== TODO_SNAPSHOT_CUSTOM_TYPE) continue;\n\t\tconst data = entry.data;\n\t\tif (!isRecord(data) || data.schema !== TODO_SNAPSHOT_SCHEMA) continue;\n\t\tconst todos = normalizeSnapshotItems(data.todos);\n\t\tif (!todos) continue;\n\t\treturn {\n\t\t\tschema: TODO_SNAPSHOT_SCHEMA,\n\t\t\ttodos,\n\t\t\tcapturedAt: typeof data.capturedAt === \"number\" ? data.capturedAt : 0,\n\t\t};\n\t}\n\treturn null;\n}\n\nexport function findTodoEntries(entries: SessionEntry[], options?: { branchId?: string }): TodoEntry[] {\n\treturn entries\n\t\t.filter((entry) => isLegacyTodoListEntry(entry) || isCustomTodoEntry(entry))\n\t\t.filter((entry) => options?.branchId === undefined || entry.parentId === options.branchId)\n\t\t.flatMap(readTodosFromEntry);\n}\n\nexport function createTodoSnapshot(ctx: ExtensionContext): TodoSnapshotPayload {\n\treturn {\n\t\tschema: TODO_SNAPSHOT_SCHEMA,\n\t\ttodos: getCurrentTodoPhases(ctx),\n\t\tcapturedAt: Date.now(),\n\t};\n}\n\nexport function persistTodoSnapshot(pi: AppendEntryTarget, snapshot: TodoSnapshotPayload): void {\n\tpi.appendEntry(TODO_SNAPSHOT_CUSTOM_TYPE, snapshot);\n}\n\nexport function captureTodoSnapshot(pi: ExtensionAPI, ctx: ExtensionContext): void;\nexport function captureTodoSnapshot(currentTodos: TodoSnapshotItems, pi: AppendEntryTarget, branchId?: string): void;\nexport function captureTodoSnapshot(\n\tpiOrTodos: ExtensionAPI | TodoSnapshotItems,\n\tctxOrPi: ExtensionContext | AppendEntryTarget,\n\t_branchId?: string,\n): void {\n\tif (Array.isArray(piOrTodos)) {\n\t\tconst pi = ctxOrPi as AppendEntryTarget;\n\t\tpersistTodoSnapshot(pi, {\n\t\t\tschema: TODO_SNAPSHOT_SCHEMA,\n\t\t\ttodos: piOrTodos,\n\t\t\tcapturedAt: Date.now(),\n\t\t});\n\t\treturn;\n\t}\n\n\tpersistTodoSnapshot(piOrTodos, createTodoSnapshot(ctxOrPi as ExtensionContext));\n}\n\nexport function restoreTodosIfMissing(pi: ExtensionAPI, ctx: ExtensionContext): void;\nexport function restoreTodosIfMissing<T extends TodoSnapshotItems>(\n\tsnapshot: T,\n\tcurrentTodos: T,\n\tpi: AppendEntryTarget,\n): RestoreResult<T>;\nexport function restoreTodosIfMissing(\n\tpiOrSnapshot: ExtensionAPI | TodoSnapshotItems,\n\tctxOrCurrentTodos: ExtensionContext | TodoSnapshotItems,\n\t_pi?: AppendEntryTarget,\n): undefined | RestoreResult {\n\tif (Array.isArray(piOrSnapshot) && Array.isArray(ctxOrCurrentTodos)) {\n\t\tif (ctxOrCurrentTodos.length > 0) {\n\t\t\treturn { applied: false, restoredTodos: ctxOrCurrentTodos };\n\t\t}\n\t\treturn { applied: piOrSnapshot.length > 0, restoredTodos: piOrSnapshot };\n\t}\n\n\tconst pi = piOrSnapshot as SendMessageTarget;\n\tconst ctx = ctxOrCurrentTodos as ExtensionContext;\n\tif (getCurrentTodoPhases(ctx).length > 0) return;\n\n\tconst snapshot = findLatestTodoSnapshot(ctx);\n\tif (!snapshot || snapshot.todos.length === 0) return;\n\n\tpi.sendMessage(\n\t\t{\n\t\t\tcustomType: \"compaction.todo-restore-request\",\n\t\t\tcontent: `Restore missing todo tasks from snapshot: ${JSON.stringify(snapshot.todos)}`,\n\t\t\tdisplay: false,\n\t\t\tdetails: snapshot,\n\t\t},\n\t\t{ triggerTurn: true, deliverAs: \"nextTurn\" },\n\t);\n}\n"]}
|
|
@@ -21,6 +21,6 @@ export function didTerminalProviderErrorEndTurn(event) {
|
|
|
21
21
|
const message = lastAssistantMessage(event.messages);
|
|
22
22
|
if (isSdkOauthAccountExhaustion(message))
|
|
23
23
|
return true;
|
|
24
|
-
return message?.stopReason === "error" || (message?.stopReason === "aborted" && event.abortSource
|
|
24
|
+
return message?.stopReason === "error" || (message?.stopReason === "aborted" && event.abortSource !== "user");
|
|
25
25
|
}
|
|
26
26
|
//# sourceMappingURL=terminal-provider-error.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal-provider-error.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/goal/terminal-provider-error.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,kFAAkF;AAClF,kFAAkF;AAClF,mFAAmF;AACnF,iFAAiF;AACjF,wDAAwD;AACxD,MAAM,4BAA4B,GAAG,CAAC,oDAAoD,EAAE,oBAAoB,CAAC,CAAC;AAElH,SAAS,2BAA2B,CACnC,OAA6E;IAE7E,IAAI,OAAO,EAAE,GAAG,KAAK,kBAAkB,IAAI,OAAO,CAAC,UAAU,KAAK,MAAM;QAAE,OAAO,KAAK,CAAC;IACvF,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;QAC1C,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QACpF,CAAC,CAAC,EAAE,CAAC;IACN,OAAO,4BAA4B,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AAC9E,CAAC;AAED,MAAM,UAAU,+BAA+B,CAAC,KAAoB;IACnE,IAAI,KAAK,CAAC,WAAW,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACjD,IAAI,KAAK,CAAC,SAAS,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC;IAC5C,MAAM,OAAO,GAAG,oBAAoB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACrD,IAAI,2BAA2B,CAAC,OAAO,CAAC;QAAE,OAAO,IAAI,CAAC;IACtD,OAAO,OAAO,EAAE,UAAU,KAAK,OAAO,IAAI,CAAC,OAAO,EAAE,UAAU,KAAK,SAAS,IAAI,KAAK,CAAC,WAAW,KAAK,
|
|
1
|
+
{"version":3,"file":"terminal-provider-error.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/goal/terminal-provider-error.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,kFAAkF;AAClF,kFAAkF;AAClF,mFAAmF;AACnF,iFAAiF;AACjF,wDAAwD;AACxD,MAAM,4BAA4B,GAAG,CAAC,oDAAoD,EAAE,oBAAoB,CAAC,CAAC;AAElH,SAAS,2BAA2B,CACnC,OAA6E;IAE7E,IAAI,OAAO,EAAE,GAAG,KAAK,kBAAkB,IAAI,OAAO,CAAC,UAAU,KAAK,MAAM;QAAE,OAAO,KAAK,CAAC;IACvF,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;QAC1C,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QACpF,CAAC,CAAC,EAAE,CAAC;IACN,OAAO,4BAA4B,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AAC9E,CAAC;AAED,MAAM,UAAU,+BAA+B,CAAC,KAAoB;IACnE,IAAI,KAAK,CAAC,WAAW,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACjD,IAAI,KAAK,CAAC,SAAS,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC;IAC5C,MAAM,OAAO,GAAG,oBAAoB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACrD,IAAI,2BAA2B,CAAC,OAAO,CAAC;QAAE,OAAO,IAAI,CAAC;IACtD,OAAO,OAAO,EAAE,UAAU,KAAK,OAAO,IAAI,CAAC,OAAO,EAAE,UAAU,KAAK,SAAS,IAAI,KAAK,CAAC,WAAW,KAAK,MAAM,CAAC,CAAC;AAC/G,CAAC","sourcesContent":["import type { AgentEndEvent } from \"../../types.ts\";\nimport { lastAssistantMessage } from \"./last-assistant-message.ts\";\n\n// The claude-sdk-oauth account-rotating proxy reports total account exhaustion as\n// an assistant message with `stopReason: \"stop\"` and zero usage, so it slips past\n// the stopReason checks below and the goal reads it as a clean turn end. Match the\n// two stable phrases of that exact response; the account count and the `Retry in\n// NNNs` suffix vary, so they are not part of the match.\nconst SDK_OAUTH_EXHAUSTION_MARKERS = [\"API Error: Server is temporarily limiting requests\", \"accounts exhausted\"];\n\nfunction isSdkOauthAccountExhaustion(\n\tmessage: { api?: string; stopReason?: string; content?: unknown } | undefined,\n): boolean {\n\tif (message?.api !== \"claude-sdk-oauth\" || message.stopReason !== \"stop\") return false;\n\tconst text = Array.isArray(message.content)\n\t\t? message.content.map((part) => (part?.type === \"text\" ? part.text : \"\")).join(\"\\n\")\n\t\t: \"\";\n\treturn SDK_OAUTH_EXHAUSTION_MARKERS.every((marker) => text.includes(marker));\n}\n\nexport function didTerminalProviderErrorEndTurn(event: AgentEndEvent): boolean {\n\tif (event.abortSource === \"system\") return false;\n\tif (event.willRetry !== false) return false;\n\tconst message = lastAssistantMessage(event.messages);\n\tif (isSdkOauthAccountExhaustion(message)) return true;\n\treturn message?.stopReason === \"error\" || (message?.stopReason === \"aborted\" && event.abortSource !== \"user\");\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notice.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/notice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,eAAO,MAAM,6BAA6B,sBAAsB,CAAC;AACjE,eAAO,MAAM,iCAAiC,0BAA0B,CAAC;AACzE,eAAO,MAAM,+BAA+B,wBAAwB,CAAC;AAErE,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AAExD,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CAClC;
|
|
1
|
+
{"version":3,"file":"notice.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/notice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,eAAO,MAAM,6BAA6B,sBAAsB,CAAC;AACjE,eAAO,MAAM,iCAAiC,0BAA0B,CAAC;AACzE,eAAO,MAAM,+BAA+B,wBAAwB,CAAC;AAErE,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AAExD,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CAClC;AAID,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAQ5F;AAED,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAEhG;AAED,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKpE;AAED,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,kBAAkB,GAAG,MAAM,CAuC5E"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
export const LOOP_GUARD_NOTICE_CUSTOM_TYPE = "loop-guard:notice";
|
|
2
2
|
export const LOOP_GUARD_ESCALATION_CUSTOM_TYPE = "loop-guard:escalation";
|
|
3
3
|
export const LOOP_GUARD_RECOVERY_CUSTOM_TYPE = "loop-guard:recovery";
|
|
4
|
+
const POLLING_TOOL_NAMES = new Set(["bash_output", "task_output"]);
|
|
4
5
|
export function buildLoopGuardBlockReason(toolName, blockedCallCount) {
|
|
6
|
+
const recovery = POLLING_TOOL_NAMES.has(toolName)
|
|
7
|
+
? "Stop polling this target. If you need to wait for a change, arm a monitor or rely on a completion notification when this mode supports it; otherwise re-plan or choose a different tool."
|
|
8
|
+
: "Reuse the existing result, stop repeating this call, and re-plan from the current goal or choose a different tool.";
|
|
5
9
|
return [
|
|
6
10
|
`Loop guard blocked repeated call ${blockedCallCount} to \`${toolName}\` with arguments that already triggered two identical-call warnings.`,
|
|
7
|
-
|
|
11
|
+
recovery,
|
|
8
12
|
].join(" ");
|
|
9
13
|
}
|
|
10
14
|
export function buildLoopGuardHardStopWarning(toolName, blockedCallCount) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notice.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/notice.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,6BAA6B,GAAG,mBAAmB,CAAC;AACjE,MAAM,CAAC,MAAM,iCAAiC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AM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,SAAS,CAAC;YACtC,OAAO;gBACN,mBAAmB;gBACnB,mDAAmD,QAAQ,MAAM,KAAK,oPAAoP;gBAC1T,+DAA+D;gBAC/D,mJAAmJ;gBACnJ,kIAAkI;gBAClI,iBAAiB,QAAQ,oCAAoC;gBAC7D,oBAAoB;aACpB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,CAAC;QACD,KAAK,SAAS,CAAC,CAAC,CAAC;YAChB,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,SAAS,CAAC;YAClD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,GAAG,CAAC,CAAC;YAC7C,OAAO;gBACN,mBAAmB;gBACnB,qDAAqD,KAAK,eAAe,QAAQ,0BAA0B,OAAO,mKAAmK;gBACrR,oMAAoM;gBACpM,uJAAuJ;gBACvJ,iJAAiJ;gBACjJ,oBAAoB;aACpB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,CAAC;QACD,KAAK,OAAO,CAAC,CAAC,CAAC;YACd,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,SAAS,CAAC;YAChD,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACxC,OAAO;gBACN,mBAAmB;gBACnB,sFAAsF,OAAO,KAAK,KAAK,kBAAkB,MAAM,uJAAuJ;gBACtR,kKAAkK;gBAClK,sMAAsM;gBACtM,yKAAyK;gBACzK,oBAAoB;aACpB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["import type { LoopGuardDetection } from \"./detectors.ts\";\n\nexport const LOOP_GUARD_NOTICE_CUSTOM_TYPE = \"loop-guard:notice\";\nexport const LOOP_GUARD_ESCALATION_CUSTOM_TYPE = \"loop-guard:escalation\";\nexport const LOOP_GUARD_RECOVERY_CUSTOM_TYPE = \"loop-guard:recovery\";\n\nexport type LoopGuardNoticeDetails = LoopGuardDetection;\n\nexport interface LoopGuardEscalationDetails {\n\treadonly toolName: string;\n\treadonly blockedCallCount: number;\n}\n\nconst POLLING_TOOL_NAMES = new Set([\"bash_output\", \"task_output\"]);\n\nexport function buildLoopGuardBlockReason(toolName: string, blockedCallCount: number): string {\n\tconst recovery = POLLING_TOOL_NAMES.has(toolName)\n\t\t? \"Stop polling this target. If you need to wait for a change, arm a monitor or rely on a completion notification when this mode supports it; otherwise re-plan or choose a different tool.\"\n\t\t: \"Reuse the existing result, stop repeating this call, and re-plan from the current goal or choose a different tool.\";\n\treturn [\n\t\t`Loop guard blocked repeated call ${blockedCallCount} to \\`${toolName}\\` with arguments that already triggered two identical-call warnings.`,\n\t\trecovery,\n\t].join(\" \");\n}\n\nexport function buildLoopGuardHardStopWarning(toolName: string, blockedCallCount: number): string {\n\treturn `Loop guard interrupted the turn after blocking ${blockedCallCount} repeated calls to ${toolName}.`;\n}\n\nexport function buildLoopGuardHardStopSteer(toolName: string): string {\n\treturn [\n\t\t`The loop guard stopped the previous turn because you kept calling \\`${toolName}\\` with arguments that had already been blocked.`,\n\t\t\"Do not repeat that call. Re-plan from the current goal and use a different tool or deliberately changed arguments.\",\n\t].join(\" \");\n}\n\nexport function buildLoopGuardReminder(detection: LoopGuardDetection): string {\n\tswitch (detection.kind) {\n\t\tcase \"identical\": {\n\t\t\tconst { toolName, count } = detection;\n\t\t\treturn [\n\t\t\t\t`<system-reminder>`,\n\t\t\t\t`LOOP GUARD - IDENTICAL TOOL CALLS: you called \\`${toolName}\\` ${count} times in a row with the EXACT same arguments. This is the tool-call stream, not consecutive text - another tool ran between these calls and it changed nothing about your plan. Re-issuing the same call returns the same result. Snap out of it:`,\n\t\t\t\t`- reuse the result you already received from this exact call;`,\n\t\t\t\t`- if you were re-checking for new output or state, switch to the monitor/watch tool or change one parameter deliberately (filter, offset, query);`,\n\t\t\t\t`- if nothing is actually changing, stop calling this tool, state what is blocking you, and try a different tool or ask the user.`,\n\t\t\t\t`Do not call \\`${toolName}\\` again with identical arguments.`,\n\t\t\t\t`</system-reminder>`,\n\t\t\t].join(\"\\n\");\n\t\t}\n\t\tcase \"similar\": {\n\t\t\tconst { toolName, count, similarity } = detection;\n\t\t\tconst percent = Math.round(similarity * 100);\n\t\t\treturn [\n\t\t\t\t`<system-reminder>`,\n\t\t\t\t`LOOP GUARD - NEAR-IDENTICAL TOOL CALLS: your last ${count} calls to \\`${toolName}\\` had arguments about ${percent}% identical (bigram similarity over canonical args). This may be legitimate batch work - or it may be a lazy loop that only LOOKS like progress. Attention check:`,\n\t\t\t\t`- if these calls target genuinely different inputs (distinct files, queries, offsets), continue deliberately - but consider batching or widening the scope instead of one call per tiny variation;`,\n\t\t\t\t`- if you are scanning output incrementally (reads, peeks, polls), widen the window once or use the monitor/watch tool rather than nudging parameters;`,\n\t\t\t\t`- if the results keep saying the same thing, change strategy now - a different tool, a wider query, or asking the user beats a sixth near-copy.`,\n\t\t\t\t`</system-reminder>`,\n\t\t\t].join(\"\\n\");\n\t\t}\n\t\tcase \"cycle\": {\n\t\t\tconst { period, count, cycleTools } = detection;\n\t\t\tconst pattern = cycleTools.join(\" -> \");\n\t\t\treturn [\n\t\t\t\t`<system-reminder>`,\n\t\t\t\t`LOOP GUARD - REPEATING TOOL-CALL PATTERN: your recent tool calls repeat the cycle [${pattern}] ${count} times (period ${period}), with other calls possibly interleaved between repetitions. A fixed rotation usually means waiting, guessing, or searching without a discriminator:`,\n\t\t\t\t`- if this is a wait/poll rotation (spawn then peek, write then check), replace the rotation with the monitor/watch tool and react to the decisive event instead;`,\n\t\t\t\t`- if this is a search rotation, change ONE axis decisively: broader query, different tool, or a different source - repeating the same rotation at the same parameters will not find new information;`,\n\t\t\t\t`- if the cycle is genuinely progressing (each rotation moves distinct work forward), keep going - but say what each rotation accomplished so the next rotation can end.`,\n\t\t\t\t`</system-reminder>`,\n\t\t\t].join(\"\\n\");\n\t\t}\n\t}\n}\n"]}
|
|
@@ -188,6 +188,7 @@ export declare const validateConfig: import("typebox/compile").Validator<{}, Typ
|
|
|
188
188
|
auth?: false | "oauth" | "bearer" | undefined;
|
|
189
189
|
url?: string | undefined;
|
|
190
190
|
type?: "stdio" | "http" | undefined;
|
|
191
|
+
enabled?: boolean | undefined;
|
|
191
192
|
env?: Record<string, string> | undefined;
|
|
192
193
|
args?: string[] | undefined;
|
|
193
194
|
oauth?: {
|
|
@@ -197,7 +198,6 @@ export declare const validateConfig: import("typebox/compile").Validator<{}, Typ
|
|
|
197
198
|
clientMetadataUrl?: string | undefined;
|
|
198
199
|
flow?: "code" | "client_credentials" | undefined;
|
|
199
200
|
} | undefined;
|
|
200
|
-
enabled?: boolean | undefined;
|
|
201
201
|
cwd?: string | undefined;
|
|
202
202
|
exposure?: "search" | "auto" | "direct" | "proxy" | undefined;
|
|
203
203
|
bearerTokenEnv?: string | undefined;
|
|
@@ -231,6 +231,7 @@ export declare const validateConfig: import("typebox/compile").Validator<{}, Typ
|
|
|
231
231
|
auth?: false | "oauth" | "bearer" | undefined;
|
|
232
232
|
url?: string | undefined;
|
|
233
233
|
type?: "stdio" | "http" | undefined;
|
|
234
|
+
enabled?: boolean | undefined;
|
|
234
235
|
env?: Record<string, string> | undefined;
|
|
235
236
|
args?: string[] | undefined;
|
|
236
237
|
oauth?: {
|
|
@@ -240,7 +241,6 @@ export declare const validateConfig: import("typebox/compile").Validator<{}, Typ
|
|
|
240
241
|
clientMetadataUrl?: string | undefined;
|
|
241
242
|
flow?: "code" | "client_credentials" | undefined;
|
|
242
243
|
} | undefined;
|
|
243
|
-
enabled?: boolean | undefined;
|
|
244
244
|
cwd?: string | undefined;
|
|
245
245
|
exposure?: "search" | "auto" | "direct" | "proxy" | undefined;
|
|
246
246
|
bearerTokenEnv?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ttsr/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAiB,YAAY,EAAwC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ttsr/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAiB,YAAY,EAAwC,MAAM,gBAAgB,CAAC;AAoDxG,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CA0N5D"}
|
|
@@ -7,6 +7,7 @@ import { claimAbort, createGenerationState, markUserCancelled } from "./coordina
|
|
|
7
7
|
import { REPETITIVE_TURNS_RULE_NAME } from "./detectors/repetitive-turns.js";
|
|
8
8
|
import { discoverTtsrRulesSync } from "./discovery.js";
|
|
9
9
|
import { TtsrManager } from "./manager.js";
|
|
10
|
+
import { getTtsrStreamDelta } from "./message-update.js";
|
|
10
11
|
import { REPETITIVE_TURNS_RULE_CONTENT } from "./prompts.js";
|
|
11
12
|
import { buildNudgeMessage } from "./remediation.js";
|
|
12
13
|
import { collectAssistantText, RepetitiveTurnsLane, readPersistedAssistantTexts } from "./repetitive-turns-lane.js";
|
|
@@ -160,12 +161,11 @@ export default function ttsrExtension(pi) {
|
|
|
160
161
|
ensureInitialized(ctx);
|
|
161
162
|
if (disabled || manager === null || watcher === null)
|
|
162
163
|
return;
|
|
163
|
-
const
|
|
164
|
-
if (
|
|
164
|
+
const streamDelta = getTtsrStreamDelta(event);
|
|
165
|
+
if (streamDelta === null)
|
|
165
166
|
return;
|
|
166
|
-
const source
|
|
167
|
-
const
|
|
168
|
-
const outcome = watcher.handleDelta(source, streamKey, deltaEvent.delta, generation);
|
|
167
|
+
const { source, streamKey, delta, toolName } = streamDelta;
|
|
168
|
+
const outcome = watcher.handleDelta(source, streamKey, delta, generation, toolName);
|
|
169
169
|
if (outcome.resolution !== null && claimAbort(genState, outcome.resolution)) {
|
|
170
170
|
pendingRemediation = { resolution: outcome.resolution, streamKind: source };
|
|
171
171
|
ctx.abort("system");
|
|
@@ -173,7 +173,7 @@ export default function ttsrExtension(pi) {
|
|
|
173
173
|
}
|
|
174
174
|
if (source === "text") {
|
|
175
175
|
const canArm = pendingRuleNudge === null && !genState.abortClaimed;
|
|
176
|
-
if (repetitiveTurns.observeTextDelta(
|
|
176
|
+
if (repetitiveTurns.observeTextDelta(delta, canArm) && !genState.abortClaimed) {
|
|
177
177
|
genState.abortClaimed = true;
|
|
178
178
|
genState.abortOwner = "collapse-repetition";
|
|
179
179
|
genState.selfAbortAt = Date.now();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ttsr/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGxD,OAAO,EAAE,oBAAoB,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AACnG,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACrG,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAwB,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACxF,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAyB,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACpH,OAAO,EAAE,oBAAoB,EAAE,MAAM,q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CAAC;QACrE,OAAO,SAAS,CAAC;IAClB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,EAAE,CAAC,eAAe,EAAE,GAAG,EAAE;QAC3B,IAAI,YAAY,KAAK,IAAI,IAAI,QAAQ,CAAC,aAAa,IAAI,gBAAgB,EAAE,WAAW,KAAK,MAAM,EAAE,CAAC;YACjG,YAAY,GAAG,IAAI,CAAC;YACpB,gBAAgB,GAAG,IAAI,CAAC;YACxB,OAAO;QACR,CAAC;QACD,MAAM,KAAK,GAAG,YAAY,CAAC;QAC3B,YAAY,GAAG,IAAI,CAAC;QACpB,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { getKeybindings } from \"@earendil-works/pi-tui\";\n\nimport type { AgentEndEvent, ExtensionAPI, ExtensionContext, MessageUpdateEvent } from \"../../types.ts\";\nimport { appendRuleActivation, registerRuleActivationRenderer } from \"../rule-activation/index.ts\";\nimport { parseRuleActivationDetails, RULE_ACTIVATION_ENTRY_TYPE } from \"../rule-activation/types.ts\";\nimport { BUILTIN_TTSR_RULES } from \"./builtin-rules.ts\";\nimport { registerTtsrCommands, type TtsrPublicState } from \"./commands.ts\";\nimport { claimAbort, createGenerationState, markUserCancelled } from \"./coordinator.ts\";\nimport { REPETITIVE_TURNS_RULE_NAME } from \"./detectors/repetitive-turns.ts\";\nimport { discoverTtsrRulesSync } from \"./discovery.ts\";\nimport { TtsrManager } from \"./manager.ts\";\nimport { REPETITIVE_TURNS_RULE_CONTENT } from \"./prompts.ts\";\nimport { buildNudgeMessage, type TtsrNudgeMessage } from \"./remediation.ts\";\nimport { collectAssistantText, RepetitiveTurnsLane, readPersistedAssistantTexts } from \"./repetitive-turns-lane.ts\";\nimport { compileRuleCondition } from \"./rule-condition.ts\";\nimport { buildStreamRemediation } from \"./stream-remediation.ts\";\nimport {\n\tDEFAULT_TTSR_SETTINGS,\n\ttype DetectionResolution,\n\ttype GenerationDetectionState,\n\tTTSR_INJECTION_CUSTOM_TYPE,\n\ttype TtsrRule,\n} from \"./types.ts\";\nimport { StreamWatcher } from \"./watch.ts\";\n\ninterface PendingRemediation {\n\treadonly resolution: DetectionResolution;\n\treadonly streamKind: \"text\" | \"thinking\";\n}\n\ninterface PendingRuleNudge {\n\treadonly rule: TtsrRule;\n}\n\nconst INTERRUPT_KEYBINDING = \"app.interrupt\";\n\nfunction isInterruptKey(data: string): boolean {\n\ttry {\n\t\treturn getKeybindings().matches(data, INTERRUPT_KEYBINDING);\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nfunction parseDisabledRules(raw: boolean | string | undefined): string[] {\n\treturn typeof raw === \"string\" && raw.length > 0\n\t\t? raw\n\t\t\t\t.split(\",\")\n\t\t\t\t.map((name) => name.trim())\n\t\t\t\t.filter((name) => name.length > 0)\n\t\t: [];\n}\n\nexport default function ttsrExtension(pi: ExtensionAPI): void {\n\tregisterRuleActivationRenderer(pi);\n\tpi.registerFlag(\"ttsr-disabled\", {\n\t\ttype: \"boolean\",\n\t\tdefault: false,\n\t\tdescription: \"Disable TTSR stream-rule detection.\",\n\t});\n\tpi.registerFlag(\"ttsr-rules-disabled\", {\n\t\ttype: \"string\",\n\t\tdefault: \"\",\n\t\tdescription: \"Comma-separated TTSR rule names to disable.\",\n\t});\n\n\tlet manager: TtsrManager | null = null;\n\tlet watcher: StreamWatcher | null = null;\n\tlet genState: GenerationDetectionState = createGenerationState();\n\tlet generation = 0;\n\tlet pendingRemediation: PendingRemediation | null = null;\n\tlet pendingRuleNudge: PendingRuleNudge | null = null;\n\tlet pendingNudge: TtsrNudgeMessage | null = null;\n\tlet settlingAgentEnd: AgentEndEvent | null = null;\n\tlet disabled = false;\n\tconst repetitiveTurns = new RepetitiveTurnsLane();\n\n\tfunction cancelRemediation(): void {\n\t\tif (pendingRemediation !== null || pendingNudge !== null || pendingRuleNudge !== null) {\n\t\t\tmarkUserCancelled(genState);\n\t\t\tpendingRemediation = null;\n\t\t\tpendingRuleNudge = null;\n\t\t\tpendingNudge = null;\n\t\t\trepetitiveTurns.disarm();\n\t\t}\n\t}\n\n\tfunction resetGenerationState(): void {\n\t\tgeneration += 1;\n\t\tgenState = createGenerationState();\n\t\tpendingRemediation = null;\n\t\tpendingRuleNudge = null;\n\t\trepetitiveTurns.resetTurn();\n\t\twatcher?.reset();\n\t}\n\n\tfunction recordInjection(owner: string, observed: readonly string[], retryMode: \"nudge\" | \"provider-error\"): void {\n\t\tappendRuleActivation(pi, {\n\t\t\tkind: \"ttsr\",\n\t\t\towner,\n\t\t\trules: observed,\n\t\t\tremediation: retryMode,\n\t\t});\n\t}\n\n\tfunction ensureInitialized(ctx: ExtensionContext): void {\n\t\tif (manager !== null) return;\n\t\tdisabled = pi.getFlag(\"ttsr-disabled\") === true;\n\t\tconst disabledRules = parseDisabledRules(pi.getFlag(\"ttsr-rules-disabled\"));\n\t\trepetitiveTurns.configure(new Set(disabledRules));\n\t\tconst settings = { ...DEFAULT_TTSR_SETTINGS, enabled: !disabled, disabledRules };\n\t\tmanager = new TtsrManager(settings, (pattern) => compileRuleCondition(pattern).regex);\n\t\tconst injectedNames = ctx.sessionManager.getEntries().flatMap((entry) => {\n\t\t\tif (entry.type !== \"custom\") return [];\n\t\t\tif (entry.customType === RULE_ACTIVATION_ENTRY_TYPE) {\n\t\t\t\tconst details = parseRuleActivationDetails(entry.data);\n\t\t\t\treturn details?.kind === \"ttsr\" ? [...details.rules] : [];\n\t\t\t}\n\t\t\tif (entry.customType !== TTSR_INJECTION_CUSTOM_TYPE) return [];\n\t\t\tconst data = entry.data;\n\t\t\tif (typeof data !== \"object\" || data === null || !(\"rules\" in data)) return [];\n\t\t\tconst rules = (data as { rules?: unknown }).rules;\n\t\t\treturn Array.isArray(rules) ? rules.filter((rule): rule is string => typeof rule === \"string\") : [];\n\t\t});\n\t\tmanager.restoreInjected(injectedNames);\n\t\tfor (const rule of BUILTIN_TTSR_RULES) {\n\t\t\tmanager.addRule(rule);\n\t\t}\n\t\tconst discovered = discoverTtsrRulesSync(ctx.cwd);\n\t\tfor (const rule of discovered.rules) {\n\t\t\tmanager.addRule(rule);\n\t\t}\n\t\twatcher = new StreamWatcher(manager, disabledRules);\n\t\trepetitiveTurns.restoreFromHistory(readPersistedAssistantTexts(ctx));\n\t\tif (ctx.mode === \"tui\") {\n\t\t\ttry {\n\t\t\t\tctx.ui.onTerminalInput((data) => {\n\t\t\t\t\tif (isInterruptKey(data)) cancelRemediation();\n\t\t\t\t});\n\t\t\t} catch {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction publicState(): TtsrPublicState {\n\t\treturn {\n\t\t\trules: manager?.getRules() ?? [],\n\t\t\tinjectedRuleNames: manager?.getInjectedRuleNames() ?? [],\n\t\t\tdisabled,\n\t\t};\n\t}\n\n\tregisterTtsrCommands(pi, publicState);\n\n\tpi.on(\"session_start\", (_event, ctx) => {\n\t\tensureInitialized(ctx);\n\t});\n\n\tpi.on(\"session_abort\", () => {\n\t\tcancelRemediation();\n\t});\n\n\tpi.on(\"input\", () => {\n\t\tcancelRemediation();\n\t});\n\n\tpi.on(\"agent_end\", (event) => {\n\t\tsettlingAgentEnd = event;\n\t\tif (event.abortSource === \"user\") {\n\t\t\tcancelRemediation();\n\t\t\treturn;\n\t\t}\n\t\tif (event.willRetry === true) resetGenerationState();\n\t});\n\n\tpi.on(\"turn_start\", (_event, ctx) => {\n\t\tensureInitialized(ctx);\n\t\tresetGenerationState();\n\t});\n\n\tpi.on(\"turn_end\", () => {\n\t\tmanager?.incrementMessageCount();\n\t});\n\n\tpi.on(\"message_update\", (event: MessageUpdateEvent, ctx) => {\n\t\tensureInitialized(ctx);\n\t\tif (disabled || manager === null || watcher === null) return;\n\t\tconst deltaEvent = event.assistantMessageEvent;\n\t\tif (deltaEvent.type !== \"text_delta\" && deltaEvent.type !== \"thinking_delta\") return;\n\t\tconst source = deltaEvent.type === \"text_delta\" ? \"text\" : \"thinking\";\n\t\tconst streamKey = `${source}:${String(deltaEvent.contentIndex)}`;\n\t\tconst outcome = watcher.handleDelta(source, streamKey, deltaEvent.delta, generation);\n\t\tif (outcome.resolution !== null && claimAbort(genState, outcome.resolution)) {\n\t\t\tpendingRemediation = { resolution: outcome.resolution, streamKind: source };\n\t\t\tctx.abort(\"system\");\n\t\t\treturn;\n\t\t}\n\t\tif (source === \"text\") {\n\t\t\tconst canArm = pendingRuleNudge === null && !genState.abortClaimed;\n\t\t\tif (repetitiveTurns.observeTextDelta(deltaEvent.delta, canArm) && !genState.abortClaimed) {\n\t\t\t\tgenState.abortClaimed = true;\n\t\t\t\tgenState.abortOwner = \"collapse-repetition\";\n\t\t\t\tgenState.selfAbortAt = Date.now();\n\t\t\t\tctx.abort(\"system\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tconst interrupting = outcome.ruleMatches.filter((rule) => rule.interruptMode === \"always\");\n\t\tconst rule = interrupting[0];\n\t\tif (rule !== undefined && pendingRuleNudge === null && !genState.abortClaimed) {\n\t\t\tgenState.abortClaimed = true;\n\t\t\tgenState.abortOwner = \"collapse-repetition\";\n\t\t\tgenState.selfAbortAt = Date.now();\n\t\t\tpendingRuleNudge = { rule };\n\t\t\tctx.abort(\"system\");\n\t\t}\n\t});\n\n\tpi.on(\"message_end\", (event) => {\n\t\tif (genState.userCancelled) return undefined;\n\t\tif (event.message.role !== \"assistant\") return undefined;\n\t\tconst turnText = collectAssistantText(event.message);\n\t\tif (repetitiveTurns.armed) {\n\t\t\trepetitiveTurns.commitArmedTurn(turnText);\n\t\t\tmanager?.markInjectedByNames([REPETITIVE_TURNS_RULE_NAME]);\n\t\t\trecordInjection(REPETITIVE_TURNS_RULE_NAME, [REPETITIVE_TURNS_RULE_NAME], \"nudge\");\n\t\t\tpendingNudge = buildNudgeMessage(REPETITIVE_TURNS_RULE_NAME, REPETITIVE_TURNS_RULE_CONTENT);\n\t\t\treturn undefined;\n\t\t}\n\t\tif (pendingRuleNudge !== null) {\n\t\t\tconst pending = pendingRuleNudge;\n\t\t\tpendingRuleNudge = null;\n\t\t\tmanager?.markInjectedByNames([pending.rule.name]);\n\t\t\trecordInjection(pending.rule.name, [pending.rule.name], \"nudge\");\n\t\t\tpendingNudge = buildNudgeMessage(pending.rule.name, pending.rule.content);\n\t\t\treturn undefined;\n\t\t}\n\t\tif (pendingRemediation !== null) {\n\t\t\tif (turnText !== null) repetitiveTurns.recordCompletedTurn(turnText);\n\t\t\tconst pending = pendingRemediation;\n\t\t\tpendingRemediation = null;\n\t\t\ttry {\n\t\t\t\tconst outcome = buildStreamRemediation(pending, event.message);\n\t\t\t\trecordInjection(outcome.owner, outcome.observedRules, outcome.retryMode);\n\t\t\t\tif (outcome.nudge !== null) {\n\t\t\t\t\tpendingNudge = outcome.nudge;\n\t\t\t\t}\n\t\t\t\tconst merged = { ...event.message, ...outcome.replacement };\n\t\t\t\treturn { message: merged as unknown as typeof event.message };\n\t\t\t} catch (error) {\n\t\t\t\tpi.appendEntry(\"ttsr-remediation-error\", {\n\t\t\t\t\tmessage: error instanceof Error ? error.message : String(error),\n\t\t\t\t\tat: Date.now(),\n\t\t\t\t});\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\t\tif (turnText !== null) repetitiveTurns.recordCompletedTurn(turnText);\n\t\treturn undefined;\n\t});\n\n\tpi.on(\"agent_settled\", () => {\n\t\tif (pendingNudge === null || genState.userCancelled || settlingAgentEnd?.abortSource === \"user\") {\n\t\t\tpendingNudge = null;\n\t\t\tsettlingAgentEnd = null;\n\t\t\treturn;\n\t\t}\n\t\tconst nudge = pendingNudge;\n\t\tpendingNudge = null;\n\t\tpi.sendMessage(nudge, { triggerTurn: true });\n\t});\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ttsr/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AA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,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC;gBAC9B,CAAC;gBACD,MAAM,MAAM,GAAG,EAAE,GAAG,KAAK,CAAC,OAAO,EAAE,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;gBAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;YAC5B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,EAAE,CAAC,WAAW,CAAC,wBAAwB,EAAE;oBACxC,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;oBAC/D,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE;iBACd,CAAC,CAAC;gBACH,OAAO,SAAS,CAAC;YAClB,CAAC;QACF,CAAC;QACD,IAAI,QAAQ,KAAK,IAAI;YAAE,eAAe,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;QACrE,OAAO,SAAS,CAAC;IAClB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,EAAE,CAAC,eAAe,EAAE,GAAG,EAAE;QAC3B,IAAI,YAAY,KAAK,IAAI,IAAI,QAAQ,CAAC,aAAa,IAAI,gBAAgB,EAAE,WAAW,KAAK,MAAM,EAAE,CAAC;YACjG,YAAY,GAAG,IAAI,CAAC;YACpB,gBAAgB,GAAG,IAAI,CAAC;YACxB,OAAO;QACR,CAAC;QACD,MAAM,KAAK,GAAG,YAAY,CAAC;QAC3B,YAAY,GAAG,IAAI,CAAC;QACpB,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { getKeybindings } from \"@earendil-works/pi-tui\";\n\nimport type { AgentEndEvent, ExtensionAPI, ExtensionContext, MessageUpdateEvent } from \"../../types.ts\";\nimport { appendRuleActivation, registerRuleActivationRenderer } from \"../rule-activation/index.ts\";\nimport { parseRuleActivationDetails, RULE_ACTIVATION_ENTRY_TYPE } from \"../rule-activation/types.ts\";\nimport { BUILTIN_TTSR_RULES } from \"./builtin-rules.ts\";\nimport { registerTtsrCommands, type TtsrPublicState } from \"./commands.ts\";\nimport { claimAbort, createGenerationState, markUserCancelled } from \"./coordinator.ts\";\nimport { REPETITIVE_TURNS_RULE_NAME } from \"./detectors/repetitive-turns.ts\";\nimport { discoverTtsrRulesSync } from \"./discovery.ts\";\nimport { TtsrManager } from \"./manager.ts\";\nimport { getTtsrStreamDelta } from \"./message-update.ts\";\nimport { REPETITIVE_TURNS_RULE_CONTENT } from \"./prompts.ts\";\nimport { buildNudgeMessage, type TtsrNudgeMessage } from \"./remediation.ts\";\nimport { collectAssistantText, RepetitiveTurnsLane, readPersistedAssistantTexts } from \"./repetitive-turns-lane.ts\";\nimport { compileRuleCondition } from \"./rule-condition.ts\";\nimport { buildStreamRemediation } from \"./stream-remediation.ts\";\nimport {\n\tDEFAULT_TTSR_SETTINGS,\n\ttype DetectionResolution,\n\ttype GenerationDetectionState,\n\tTTSR_INJECTION_CUSTOM_TYPE,\n\ttype TtsrRule,\n} from \"./types.ts\";\nimport { StreamWatcher } from \"./watch.ts\";\n\ninterface PendingRemediation {\n\treadonly resolution: DetectionResolution;\n\treadonly streamKind: \"text\" | \"thinking\" | \"tool\";\n}\n\ninterface PendingRuleNudge {\n\treadonly rule: TtsrRule;\n}\n\nconst INTERRUPT_KEYBINDING = \"app.interrupt\";\n\nfunction isInterruptKey(data: string): boolean {\n\ttry {\n\t\treturn getKeybindings().matches(data, INTERRUPT_KEYBINDING);\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nfunction parseDisabledRules(raw: boolean | string | undefined): string[] {\n\treturn typeof raw === \"string\" && raw.length > 0\n\t\t? raw\n\t\t\t\t.split(\",\")\n\t\t\t\t.map((name) => name.trim())\n\t\t\t\t.filter((name) => name.length > 0)\n\t\t: [];\n}\n\nexport default function ttsrExtension(pi: ExtensionAPI): void {\n\tregisterRuleActivationRenderer(pi);\n\tpi.registerFlag(\"ttsr-disabled\", {\n\t\ttype: \"boolean\",\n\t\tdefault: false,\n\t\tdescription: \"Disable TTSR stream-rule detection.\",\n\t});\n\tpi.registerFlag(\"ttsr-rules-disabled\", {\n\t\ttype: \"string\",\n\t\tdefault: \"\",\n\t\tdescription: \"Comma-separated TTSR rule names to disable.\",\n\t});\n\n\tlet manager: TtsrManager | null = null;\n\tlet watcher: StreamWatcher | null = null;\n\tlet genState: GenerationDetectionState = createGenerationState();\n\tlet generation = 0;\n\tlet pendingRemediation: PendingRemediation | null = null;\n\tlet pendingRuleNudge: PendingRuleNudge | null = null;\n\tlet pendingNudge: TtsrNudgeMessage | null = null;\n\tlet settlingAgentEnd: AgentEndEvent | null = null;\n\tlet disabled = false;\n\tconst repetitiveTurns = new RepetitiveTurnsLane();\n\n\tfunction cancelRemediation(): void {\n\t\tif (pendingRemediation !== null || pendingNudge !== null || pendingRuleNudge !== null) {\n\t\t\tmarkUserCancelled(genState);\n\t\t\tpendingRemediation = null;\n\t\t\tpendingRuleNudge = null;\n\t\t\tpendingNudge = null;\n\t\t\trepetitiveTurns.disarm();\n\t\t}\n\t}\n\n\tfunction resetGenerationState(): void {\n\t\tgeneration += 1;\n\t\tgenState = createGenerationState();\n\t\tpendingRemediation = null;\n\t\tpendingRuleNudge = null;\n\t\trepetitiveTurns.resetTurn();\n\t\twatcher?.reset();\n\t}\n\n\tfunction recordInjection(owner: string, observed: readonly string[], retryMode: \"nudge\" | \"provider-error\"): void {\n\t\tappendRuleActivation(pi, {\n\t\t\tkind: \"ttsr\",\n\t\t\towner,\n\t\t\trules: observed,\n\t\t\tremediation: retryMode,\n\t\t});\n\t}\n\n\tfunction ensureInitialized(ctx: ExtensionContext): void {\n\t\tif (manager !== null) return;\n\t\tdisabled = pi.getFlag(\"ttsr-disabled\") === true;\n\t\tconst disabledRules = parseDisabledRules(pi.getFlag(\"ttsr-rules-disabled\"));\n\t\trepetitiveTurns.configure(new Set(disabledRules));\n\t\tconst settings = { ...DEFAULT_TTSR_SETTINGS, enabled: !disabled, disabledRules };\n\t\tmanager = new TtsrManager(settings, (pattern) => compileRuleCondition(pattern).regex);\n\t\tconst injectedNames = ctx.sessionManager.getEntries().flatMap((entry) => {\n\t\t\tif (entry.type !== \"custom\") return [];\n\t\t\tif (entry.customType === RULE_ACTIVATION_ENTRY_TYPE) {\n\t\t\t\tconst details = parseRuleActivationDetails(entry.data);\n\t\t\t\treturn details?.kind === \"ttsr\" ? [...details.rules] : [];\n\t\t\t}\n\t\t\tif (entry.customType !== TTSR_INJECTION_CUSTOM_TYPE) return [];\n\t\t\tconst data = entry.data;\n\t\t\tif (typeof data !== \"object\" || data === null || !(\"rules\" in data)) return [];\n\t\t\tconst rules = (data as { rules?: unknown }).rules;\n\t\t\treturn Array.isArray(rules) ? rules.filter((rule): rule is string => typeof rule === \"string\") : [];\n\t\t});\n\t\tmanager.restoreInjected(injectedNames);\n\t\tfor (const rule of BUILTIN_TTSR_RULES) {\n\t\t\tmanager.addRule(rule);\n\t\t}\n\t\tconst discovered = discoverTtsrRulesSync(ctx.cwd);\n\t\tfor (const rule of discovered.rules) {\n\t\t\tmanager.addRule(rule);\n\t\t}\n\t\twatcher = new StreamWatcher(manager, disabledRules);\n\t\trepetitiveTurns.restoreFromHistory(readPersistedAssistantTexts(ctx));\n\t\tif (ctx.mode === \"tui\") {\n\t\t\ttry {\n\t\t\t\tctx.ui.onTerminalInput((data) => {\n\t\t\t\t\tif (isInterruptKey(data)) cancelRemediation();\n\t\t\t\t});\n\t\t\t} catch {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction publicState(): TtsrPublicState {\n\t\treturn {\n\t\t\trules: manager?.getRules() ?? [],\n\t\t\tinjectedRuleNames: manager?.getInjectedRuleNames() ?? [],\n\t\t\tdisabled,\n\t\t};\n\t}\n\n\tregisterTtsrCommands(pi, publicState);\n\n\tpi.on(\"session_start\", (_event, ctx) => {\n\t\tensureInitialized(ctx);\n\t});\n\n\tpi.on(\"session_abort\", () => {\n\t\tcancelRemediation();\n\t});\n\n\tpi.on(\"input\", () => {\n\t\tcancelRemediation();\n\t});\n\n\tpi.on(\"agent_end\", (event) => {\n\t\tsettlingAgentEnd = event;\n\t\tif (event.abortSource === \"user\") {\n\t\t\tcancelRemediation();\n\t\t\treturn;\n\t\t}\n\t\tif (event.willRetry === true) resetGenerationState();\n\t});\n\n\tpi.on(\"turn_start\", (_event, ctx) => {\n\t\tensureInitialized(ctx);\n\t\tresetGenerationState();\n\t});\n\n\tpi.on(\"turn_end\", () => {\n\t\tmanager?.incrementMessageCount();\n\t});\n\n\tpi.on(\"message_update\", (event: MessageUpdateEvent, ctx) => {\n\t\tensureInitialized(ctx);\n\t\tif (disabled || manager === null || watcher === null) return;\n\t\tconst streamDelta = getTtsrStreamDelta(event);\n\t\tif (streamDelta === null) return;\n\t\tconst { source, streamKey, delta, toolName } = streamDelta;\n\t\tconst outcome = watcher.handleDelta(source, streamKey, delta, generation, toolName);\n\t\tif (outcome.resolution !== null && claimAbort(genState, outcome.resolution)) {\n\t\t\tpendingRemediation = { resolution: outcome.resolution, streamKind: source };\n\t\t\tctx.abort(\"system\");\n\t\t\treturn;\n\t\t}\n\t\tif (source === \"text\") {\n\t\t\tconst canArm = pendingRuleNudge === null && !genState.abortClaimed;\n\t\t\tif (repetitiveTurns.observeTextDelta(delta, canArm) && !genState.abortClaimed) {\n\t\t\t\tgenState.abortClaimed = true;\n\t\t\t\tgenState.abortOwner = \"collapse-repetition\";\n\t\t\t\tgenState.selfAbortAt = Date.now();\n\t\t\t\tctx.abort(\"system\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tconst interrupting = outcome.ruleMatches.filter((rule) => rule.interruptMode === \"always\");\n\t\tconst rule = interrupting[0];\n\t\tif (rule !== undefined && pendingRuleNudge === null && !genState.abortClaimed) {\n\t\t\tgenState.abortClaimed = true;\n\t\t\tgenState.abortOwner = \"collapse-repetition\";\n\t\t\tgenState.selfAbortAt = Date.now();\n\t\t\tpendingRuleNudge = { rule };\n\t\t\tctx.abort(\"system\");\n\t\t}\n\t});\n\n\tpi.on(\"message_end\", (event) => {\n\t\tif (genState.userCancelled) return undefined;\n\t\tif (event.message.role !== \"assistant\") return undefined;\n\t\tconst turnText = collectAssistantText(event.message);\n\t\tif (repetitiveTurns.armed) {\n\t\t\trepetitiveTurns.commitArmedTurn(turnText);\n\t\t\tmanager?.markInjectedByNames([REPETITIVE_TURNS_RULE_NAME]);\n\t\t\trecordInjection(REPETITIVE_TURNS_RULE_NAME, [REPETITIVE_TURNS_RULE_NAME], \"nudge\");\n\t\t\tpendingNudge = buildNudgeMessage(REPETITIVE_TURNS_RULE_NAME, REPETITIVE_TURNS_RULE_CONTENT);\n\t\t\treturn undefined;\n\t\t}\n\t\tif (pendingRuleNudge !== null) {\n\t\t\tconst pending = pendingRuleNudge;\n\t\t\tpendingRuleNudge = null;\n\t\t\tmanager?.markInjectedByNames([pending.rule.name]);\n\t\t\trecordInjection(pending.rule.name, [pending.rule.name], \"nudge\");\n\t\t\tpendingNudge = buildNudgeMessage(pending.rule.name, pending.rule.content);\n\t\t\treturn undefined;\n\t\t}\n\t\tif (pendingRemediation !== null) {\n\t\t\tif (turnText !== null) repetitiveTurns.recordCompletedTurn(turnText);\n\t\t\tconst pending = pendingRemediation;\n\t\t\tpendingRemediation = null;\n\t\t\ttry {\n\t\t\t\tconst outcome = buildStreamRemediation(pending, event.message);\n\t\t\t\trecordInjection(outcome.owner, outcome.observedRules, outcome.retryMode);\n\t\t\t\tif (outcome.nudge !== null) {\n\t\t\t\t\tpendingNudge = outcome.nudge;\n\t\t\t\t}\n\t\t\t\tconst merged = { ...event.message, ...outcome.replacement };\n\t\t\t\treturn { message: merged };\n\t\t\t} catch (error) {\n\t\t\t\tpi.appendEntry(\"ttsr-remediation-error\", {\n\t\t\t\t\tmessage: error instanceof Error ? error.message : String(error),\n\t\t\t\t\tat: Date.now(),\n\t\t\t\t});\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\t\tif (turnText !== null) repetitiveTurns.recordCompletedTurn(turnText);\n\t\treturn undefined;\n\t});\n\n\tpi.on(\"agent_settled\", () => {\n\t\tif (pendingNudge === null || genState.userCancelled || settlingAgentEnd?.abortSource === \"user\") {\n\t\t\tpendingNudge = null;\n\t\t\tsettlingAgentEnd = null;\n\t\t\treturn;\n\t\t}\n\t\tconst nudge = pendingNudge;\n\t\tpendingNudge = null;\n\t\tpi.sendMessage(nudge, { triggerTurn: true });\n\t});\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MessageUpdateEvent } from "../../types.ts";
|
|
2
|
+
import type { TtsrStreamSource } from "./types.ts";
|
|
3
|
+
export interface TtsrStreamDelta {
|
|
4
|
+
readonly source: TtsrStreamSource;
|
|
5
|
+
readonly streamKey: string;
|
|
6
|
+
readonly delta: string;
|
|
7
|
+
readonly toolName?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function getTtsrStreamDelta(event: MessageUpdateEvent): TtsrStreamDelta | null;
|
|
10
|
+
//# sourceMappingURL=message-update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-update.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ttsr/message-update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAMnD,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,kBAAkB,GAAG,eAAe,GAAG,IAAI,CAiCpF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
function assertNever(value) {
|
|
2
|
+
throw new Error(`unexpected assistant message event: ${String(value)}`);
|
|
3
|
+
}
|
|
4
|
+
export function getTtsrStreamDelta(event) {
|
|
5
|
+
const deltaEvent = event.assistantMessageEvent;
|
|
6
|
+
switch (deltaEvent.type) {
|
|
7
|
+
case "text_delta":
|
|
8
|
+
return { source: "text", streamKey: `text:${String(deltaEvent.contentIndex)}`, delta: deltaEvent.delta };
|
|
9
|
+
case "thinking_delta":
|
|
10
|
+
return {
|
|
11
|
+
source: "thinking",
|
|
12
|
+
streamKey: `thinking:${String(deltaEvent.contentIndex)}`,
|
|
13
|
+
delta: deltaEvent.delta,
|
|
14
|
+
};
|
|
15
|
+
case "toolcall_delta": {
|
|
16
|
+
const block = deltaEvent.partial.content[deltaEvent.contentIndex];
|
|
17
|
+
return {
|
|
18
|
+
source: "tool",
|
|
19
|
+
streamKey: `tool:${String(deltaEvent.contentIndex)}`,
|
|
20
|
+
delta: deltaEvent.delta,
|
|
21
|
+
toolName: block?.type === "toolCall" ? block.name : undefined,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
case "start":
|
|
25
|
+
case "text_start":
|
|
26
|
+
case "text_end":
|
|
27
|
+
case "thinking_start":
|
|
28
|
+
case "thinking_end":
|
|
29
|
+
case "toolcall_start":
|
|
30
|
+
case "toolcall_end":
|
|
31
|
+
case "done":
|
|
32
|
+
case "error":
|
|
33
|
+
return null;
|
|
34
|
+
default:
|
|
35
|
+
return assertNever(deltaEvent);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=message-update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-update.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ttsr/message-update.ts"],"names":[],"mappings":"AAGA,SAAS,WAAW,CAAC,KAAY;IAChC,MAAM,IAAI,KAAK,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IACjC,CAAC;AACF,CAAC","sourcesContent":["import type { MessageUpdateEvent } from \"../../types.ts\";\nimport type { TtsrStreamSource } from \"./types.ts\";\n\nfunction assertNever(value: never): never {\n\tthrow new Error(`unexpected assistant message event: ${String(value)}`);\n}\n\nexport interface TtsrStreamDelta {\n\treadonly source: TtsrStreamSource;\n\treadonly streamKey: string;\n\treadonly delta: string;\n\treadonly toolName?: string;\n}\n\nexport function getTtsrStreamDelta(event: MessageUpdateEvent): TtsrStreamDelta | null {\n\tconst deltaEvent = event.assistantMessageEvent;\n\tswitch (deltaEvent.type) {\n\t\tcase \"text_delta\":\n\t\t\treturn { source: \"text\", streamKey: `text:${String(deltaEvent.contentIndex)}`, delta: deltaEvent.delta };\n\t\tcase \"thinking_delta\":\n\t\t\treturn {\n\t\t\t\tsource: \"thinking\",\n\t\t\t\tstreamKey: `thinking:${String(deltaEvent.contentIndex)}`,\n\t\t\t\tdelta: deltaEvent.delta,\n\t\t\t};\n\t\tcase \"toolcall_delta\": {\n\t\t\tconst block = deltaEvent.partial.content[deltaEvent.contentIndex];\n\t\t\treturn {\n\t\t\t\tsource: \"tool\",\n\t\t\t\tstreamKey: `tool:${String(deltaEvent.contentIndex)}`,\n\t\t\t\tdelta: deltaEvent.delta,\n\t\t\t\ttoolName: block?.type === \"toolCall\" ? block.name : undefined,\n\t\t\t};\n\t\t}\n\t\tcase \"start\":\n\t\tcase \"text_start\":\n\t\tcase \"text_end\":\n\t\tcase \"thinking_start\":\n\t\tcase \"thinking_end\":\n\t\tcase \"toolcall_start\":\n\t\tcase \"toolcall_end\":\n\t\tcase \"done\":\n\t\tcase \"error\":\n\t\t\treturn null;\n\t\tdefault:\n\t\t\treturn assertNever(deltaEvent);\n\t}\n}\n"]}
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
+
import type { AssistantMessage } from "@earendil-works/pi-ai";
|
|
1
2
|
import { TTSR_INJECTION_CUSTOM_TYPE } from "./types.ts";
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
readonly content: unknown[];
|
|
5
|
-
readonly stopReason: string;
|
|
6
|
-
readonly errorMessage?: string;
|
|
7
|
-
readonly [key: string]: unknown;
|
|
8
|
-
}
|
|
9
|
-
export interface ErrorShellReplacement {
|
|
3
|
+
export type TruncatableAssistantMessage = AssistantMessage;
|
|
4
|
+
export type ErrorShellReplacement = {
|
|
10
5
|
readonly role: "assistant";
|
|
11
6
|
readonly content: never[];
|
|
12
7
|
readonly stopReason: "error";
|
|
13
8
|
readonly errorMessage: string;
|
|
14
|
-
}
|
|
9
|
+
};
|
|
15
10
|
export interface TtsrNudgeMessage {
|
|
16
11
|
readonly customType: typeof TTSR_INJECTION_CUSTOM_TYPE;
|
|
17
12
|
readonly content: string;
|
|
@@ -20,7 +15,7 @@ export interface TtsrNudgeMessage {
|
|
|
20
15
|
readonly rules: readonly string[];
|
|
21
16
|
};
|
|
22
17
|
}
|
|
23
|
-
type StreamKind = "text" | "thinking";
|
|
18
|
+
type StreamKind = "text" | "thinking" | "tool";
|
|
24
19
|
export declare function buildTruncateReplacement(message: TruncatableAssistantMessage, garbageStartOffset: number, streamKind: StreamKind): TruncatableAssistantMessage;
|
|
25
20
|
export declare function buildErrorShellReplacement(): ErrorShellReplacement;
|
|
26
21
|
export declare function buildNudgeMessage(ruleName: string, ruleContent: string): TtsrNudgeMessage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remediation.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ttsr/remediation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remediation.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ttsr/remediation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAKxD,MAAM,MAAM,2BAA2B,GAAG,gBAAgB,CAAC;AAC3D,MAAM,MAAM,qBAAqB,GAAG;IACnC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,UAAU,EAAE,OAAO,0BAA0B,CAAC;IACvD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,CAAC;CACxD;AAED,KAAK,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC;AAoB/C,wBAAgB,wBAAwB,CACvC,OAAO,EAAE,2BAA2B,EACpC,kBAAkB,EAAE,MAAM,EAC1B,UAAU,EAAE,UAAU,GACpB,2BAA2B,CAgC7B;AAED,wBAAgB,0BAA0B,IAAI,qBAAqB,CAElE;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,gBAAgB,CAOzF"}
|
|
@@ -3,6 +3,8 @@ import { TTSR_INJECTION_CUSTOM_TYPE } from "./types.js";
|
|
|
3
3
|
const TRUNCATION_MARKER = "[output interrupted by stream rule]";
|
|
4
4
|
const TRANSPORT_TIMEOUT_ERROR_PATTERN = /^Request timed out\.?$/i;
|
|
5
5
|
function streamBlockText(block, kind) {
|
|
6
|
+
if (kind === "tool")
|
|
7
|
+
return undefined;
|
|
6
8
|
if (typeof block !== "object" || block === null)
|
|
7
9
|
return undefined;
|
|
8
10
|
if (!("type" in block) || block.type !== kind)
|
|
@@ -11,11 +13,25 @@ function streamBlockText(block, kind) {
|
|
|
11
13
|
return typeof value === "string" ? value : undefined;
|
|
12
14
|
}
|
|
13
15
|
function replaceStreamBlockText(block, kind, text) {
|
|
14
|
-
if (
|
|
15
|
-
return block;
|
|
16
|
-
|
|
16
|
+
if (kind === "text" && block.type === "text")
|
|
17
|
+
return { ...block, text };
|
|
18
|
+
if (kind === "thinking" && block.type === "thinking")
|
|
19
|
+
return { ...block, thinking: text };
|
|
20
|
+
return block;
|
|
17
21
|
}
|
|
18
22
|
export function buildTruncateReplacement(message, garbageStartOffset, streamKind) {
|
|
23
|
+
if (streamKind === "tool") {
|
|
24
|
+
const content = message.content.filter((block) => {
|
|
25
|
+
if (typeof block !== "object" || block === null || !("type" in block))
|
|
26
|
+
return true;
|
|
27
|
+
return block.type !== "toolCall";
|
|
28
|
+
});
|
|
29
|
+
return {
|
|
30
|
+
...message,
|
|
31
|
+
content: [...content, { type: "text", text: TRUNCATION_MARKER }],
|
|
32
|
+
stopReason: message.stopReason === "toolUse" ? "aborted" : message.stopReason,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
19
35
|
let remaining = Math.max(0, garbageStartOffset);
|
|
20
36
|
let truncated = false;
|
|
21
37
|
const content = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remediation.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ttsr/remediation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remediation.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ttsr/remediation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAExD,MAAM,iBAAiB,GAAG,qCAAqC,CAAC;AAChE,MAAM,+BAA+B,GAAG,yBAAyB,CAAC;AAmBlE,SAAS,eAAe,CAAC,KAAc,EAAE,IAAgB;IACxD,IAAI,IAAI,KAAK,MAAM;QAAE,OAAO,SAAS,CAAC;IACtC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,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C,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,CAAC;AAClG,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,QAAgB,EAAE,WAAmB;IACtE,OAAO;QACN,UAAU,EAAE,0BAA0B;QACtC,OAAO,EAAE,qBAAqB,CAAC,QAAQ,EAAE,WAAW,CAAC;QACrD,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE;KAC9B,CAAC;AACH,CAAC","sourcesContent":["import type { AssistantMessage } from \"@earendil-works/pi-ai\";\nimport { LEAK_ERROR_MESSAGE, renderSystemInterrupt } from \"./prompts.ts\";\nimport { TTSR_INJECTION_CUSTOM_TYPE } from \"./types.ts\";\n\nconst TRUNCATION_MARKER = \"[output interrupted by stream rule]\";\nconst TRANSPORT_TIMEOUT_ERROR_PATTERN = /^Request timed out\\.?$/i;\n\nexport type TruncatableAssistantMessage = AssistantMessage;\nexport type ErrorShellReplacement = {\n\treadonly role: \"assistant\";\n\treadonly content: never[];\n\treadonly stopReason: \"error\";\n\treadonly errorMessage: string;\n};\n\nexport interface TtsrNudgeMessage {\n\treadonly customType: typeof TTSR_INJECTION_CUSTOM_TYPE;\n\treadonly content: string;\n\treadonly display: false;\n\treadonly details: { readonly rules: readonly string[] };\n}\n\ntype StreamKind = \"text\" | \"thinking\" | \"tool\";\n\nfunction streamBlockText(block: unknown, kind: StreamKind): string | undefined {\n\tif (kind === \"tool\") return undefined;\n\tif (typeof block !== \"object\" || block === null) return undefined;\n\tif (!(\"type\" in block) || block.type !== kind) return undefined;\n\tconst value: unknown = Reflect.get(block, kind);\n\treturn typeof value === \"string\" ? value : undefined;\n}\n\nfunction replaceStreamBlockText(\n\tblock: AssistantMessage[\"content\"][number],\n\tkind: StreamKind,\n\ttext: string,\n): AssistantMessage[\"content\"][number] {\n\tif (kind === \"text\" && block.type === \"text\") return { ...block, text };\n\tif (kind === \"thinking\" && block.type === \"thinking\") return { ...block, thinking: text };\n\treturn block;\n}\n\nexport function buildTruncateReplacement(\n\tmessage: TruncatableAssistantMessage,\n\tgarbageStartOffset: number,\n\tstreamKind: StreamKind,\n): TruncatableAssistantMessage {\n\tif (streamKind === \"tool\") {\n\t\tconst content = message.content.filter((block) => {\n\t\t\tif (typeof block !== \"object\" || block === null || !(\"type\" in block)) return true;\n\t\t\treturn block.type !== \"toolCall\";\n\t\t});\n\t\treturn {\n\t\t\t...message,\n\t\t\tcontent: [...content, { type: \"text\", text: TRUNCATION_MARKER }],\n\t\t\tstopReason: message.stopReason === \"toolUse\" ? \"aborted\" : message.stopReason,\n\t\t};\n\t}\n\tlet remaining = Math.max(0, garbageStartOffset);\n\tlet truncated = false;\n\tconst content: AssistantMessage[\"content\"] = [];\n\tfor (const block of message.content) {\n\t\tconst text = streamBlockText(block, streamKind);\n\t\tif (truncated && text !== undefined) continue;\n\t\tif (text === undefined || remaining > text.length) {\n\t\t\tcontent.push(block);\n\t\t\tif (text !== undefined) remaining -= text.length;\n\t\t\tcontinue;\n\t\t}\n\t\tcontent.push(replaceStreamBlockText(block, streamKind, text.slice(0, remaining)));\n\t\ttruncated = true;\n\t}\n\tcontent.push({ type: \"text\", text: TRUNCATION_MARKER });\n\tconst result: AssistantMessage = { ...message, content };\n\tif (result.errorMessage !== undefined && TRANSPORT_TIMEOUT_ERROR_PATTERN.test(result.errorMessage)) {\n\t\tdelete result.errorMessage;\n\t}\n\treturn result;\n}\n\nexport function buildErrorShellReplacement(): ErrorShellReplacement {\n\treturn { role: \"assistant\", content: [], stopReason: \"error\", errorMessage: LEAK_ERROR_MESSAGE };\n}\n\nexport function buildNudgeMessage(ruleName: string, ruleContent: string): TtsrNudgeMessage {\n\treturn {\n\t\tcustomType: TTSR_INJECTION_CUSTOM_TYPE,\n\t\tcontent: renderSystemInterrupt(ruleName, ruleContent),\n\t\tdisplay: false,\n\t\tdetails: { rules: [ruleName] },\n\t};\n}\n"]}
|
|
@@ -2,7 +2,7 @@ import { type ErrorShellReplacement, type TruncatableAssistantMessage, type Ttsr
|
|
|
2
2
|
import type { DetectionResolution } from "./types.ts";
|
|
3
3
|
export interface StreamRemediationInput {
|
|
4
4
|
readonly resolution: DetectionResolution;
|
|
5
|
-
readonly streamKind: "text" | "thinking";
|
|
5
|
+
readonly streamKind: "text" | "thinking" | "tool";
|
|
6
6
|
}
|
|
7
7
|
export interface StreamRemediationOutcome {
|
|
8
8
|
readonly replacement: ErrorShellReplacement | TruncatableAssistantMessage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream-remediation.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ttsr/stream-remediation.ts"],"names":[],"mappings":"AACA,OAAO,EAIN,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,gBAAgB,EACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,UAAU,EAAE,mBAAmB,CAAC;IACzC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"stream-remediation.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ttsr/stream-remediation.ts"],"names":[],"mappings":"AACA,OAAO,EAIN,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,gBAAgB,EACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,UAAU,EAAE,mBAAmB,CAAC;IACzC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC;CAClD;AAED,MAAM,WAAW,wBAAwB;IACxC,QAAQ,CAAC,WAAW,EAAE,qBAAqB,GAAG,2BAA2B,CAAC;IAC1E,QAAQ,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,QAAQ,CAAC,SAAS,EAAE,OAAO,GAAG,gBAAgB,CAAC;CAC/C;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,sBAAsB,EAAE,OAAO,EAAE,OAAO,GAAG,wBAAwB,CAsBlH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream-remediation.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ttsr/stream-remediation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EACN,0BAA0B,EAC1B,iBAAiB,EACjB,wBAAwB,GAIxB,MAAM,kBAAkB,CAAC;AAgB1B,MAAM,UAAU,sBAAsB,CAAC,OAA+B,EAAE,OAAgB;IACvF,IAAI,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,eAAe,KAAK,YAAY,EAAE,CAAC;QACrE,OAAO;YACN,WAAW,EAAE,0BAA0B,EAAE;YACzC,KAAK,EAAE,IAAI;YACX,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK;YAC/B,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,aAAa;YAC/C,SAAS,EAAE,gBAAgB;SAC3B,CAAC;IACH,CAAC;IACD,MAAM,QAAQ,GAAG,wBAAwB,CACxC,OAAsC,EACtC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,kBAAkB,EAC3C,OAAO,CAAC,UAAU,CAClB,CAAC;IACF,OAAO;QACN,WAAW,EAAE,QAAQ;QACrB,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,EAAE,qBAAqB,CAAC;QACzE,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK;QAC/B,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,aAAa;QAC/C,SAAS,EAAE,OAAO;KAClB,CAAC;AACH,CAAC","sourcesContent":["import { COLLAPSE_RULE_CONTENT } from \"./prompts.ts\";\nimport {\n\tbuildErrorShellReplacement,\n\tbuildNudgeMessage,\n\tbuildTruncateReplacement,\n\ttype ErrorShellReplacement,\n\ttype TruncatableAssistantMessage,\n\ttype TtsrNudgeMessage,\n} from \"./remediation.ts\";\nimport type { DetectionResolution } from \"./types.ts\";\n\nexport interface StreamRemediationInput {\n\treadonly resolution: DetectionResolution;\n\treadonly streamKind: \"text\" | \"thinking\";\n}\n\nexport interface StreamRemediationOutcome {\n\treadonly replacement: ErrorShellReplacement | TruncatableAssistantMessage;\n\treadonly nudge: TtsrNudgeMessage | null;\n\treadonly owner: string;\n\treadonly observedRules: readonly string[];\n\treadonly retryMode: \"nudge\" | \"provider-error\";\n}\n\nexport function buildStreamRemediation(pending: StreamRemediationInput, message: unknown): StreamRemediationOutcome {\n\tif (pending.resolution.remediation.corruptionScope === \"generation\") {\n\t\treturn {\n\t\t\treplacement: buildErrorShellReplacement(),\n\t\t\tnudge: null,\n\t\t\towner: pending.resolution.owner,\n\t\t\tobservedRules: pending.resolution.observedRules,\n\t\t\tretryMode: \"provider-error\",\n\t\t};\n\t}\n\tconst replaced = buildTruncateReplacement(\n\t\tmessage as TruncatableAssistantMessage,\n\t\tpending.resolution.match.garbageStartOffset,\n\t\tpending.streamKind,\n\t);\n\treturn {\n\t\treplacement: replaced,\n\t\tnudge: buildNudgeMessage(pending.resolution.owner, COLLAPSE_RULE_CONTENT),\n\t\towner: pending.resolution.owner,\n\t\tobservedRules: pending.resolution.observedRules,\n\t\tretryMode: \"nudge\",\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"stream-remediation.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ttsr/stream-remediation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EACN,0BAA0B,EAC1B,iBAAiB,EACjB,wBAAwB,GAIxB,MAAM,kBAAkB,CAAC;AAgB1B,MAAM,UAAU,sBAAsB,CAAC,OAA+B,EAAE,OAAgB;IACvF,IAAI,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,eAAe,KAAK,YAAY,EAAE,CAAC;QACrE,OAAO;YACN,WAAW,EAAE,0BAA0B,EAAE;YACzC,KAAK,EAAE,IAAI;YACX,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK;YAC/B,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,aAAa;YAC/C,SAAS,EAAE,gBAAgB;SAC3B,CAAC;IACH,CAAC;IACD,MAAM,QAAQ,GAAG,wBAAwB,CACxC,OAAsC,EACtC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,kBAAkB,EAC3C,OAAO,CAAC,UAAU,CAClB,CAAC;IACF,OAAO;QACN,WAAW,EAAE,QAAQ;QACrB,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,EAAE,qBAAqB,CAAC;QACzE,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK;QAC/B,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,aAAa;QAC/C,SAAS,EAAE,OAAO;KAClB,CAAC;AACH,CAAC","sourcesContent":["import { COLLAPSE_RULE_CONTENT } from \"./prompts.ts\";\nimport {\n\tbuildErrorShellReplacement,\n\tbuildNudgeMessage,\n\tbuildTruncateReplacement,\n\ttype ErrorShellReplacement,\n\ttype TruncatableAssistantMessage,\n\ttype TtsrNudgeMessage,\n} from \"./remediation.ts\";\nimport type { DetectionResolution } from \"./types.ts\";\n\nexport interface StreamRemediationInput {\n\treadonly resolution: DetectionResolution;\n\treadonly streamKind: \"text\" | \"thinking\" | \"tool\";\n}\n\nexport interface StreamRemediationOutcome {\n\treadonly replacement: ErrorShellReplacement | TruncatableAssistantMessage;\n\treadonly nudge: TtsrNudgeMessage | null;\n\treadonly owner: string;\n\treadonly observedRules: readonly string[];\n\treadonly retryMode: \"nudge\" | \"provider-error\";\n}\n\nexport function buildStreamRemediation(pending: StreamRemediationInput, message: unknown): StreamRemediationOutcome {\n\tif (pending.resolution.remediation.corruptionScope === \"generation\") {\n\t\treturn {\n\t\t\treplacement: buildErrorShellReplacement(),\n\t\t\tnudge: null,\n\t\t\towner: pending.resolution.owner,\n\t\t\tobservedRules: pending.resolution.observedRules,\n\t\t\tretryMode: \"provider-error\",\n\t\t};\n\t}\n\tconst replaced = buildTruncateReplacement(\n\t\tmessage as TruncatableAssistantMessage,\n\t\tpending.resolution.match.garbageStartOffset,\n\t\tpending.streamKind,\n\t);\n\treturn {\n\t\treplacement: replaced,\n\t\tnudge: buildNudgeMessage(pending.resolution.owner, COLLAPSE_RULE_CONTENT),\n\t\towner: pending.resolution.owner,\n\t\tobservedRules: pending.resolution.observedRules,\n\t\tretryMode: \"nudge\",\n\t};\n}\n"]}
|
|
@@ -28,7 +28,7 @@ export interface TtsrSettings {
|
|
|
28
28
|
}
|
|
29
29
|
export declare const DEFAULT_TTSR_SETTINGS: TtsrSettings;
|
|
30
30
|
export interface DetectorContext {
|
|
31
|
-
readonly source:
|
|
31
|
+
readonly source: TtsrStreamSource;
|
|
32
32
|
readonly streamKey: string;
|
|
33
33
|
readonly generation: number;
|
|
34
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ttsr/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC;AAE5D,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,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AAE,gBAAgB;IAC3B,WAAW,EAAE,SAAS;IACtB,eAAe,EAAE,YAAY;IAC7B,SAAS,EAAE,oBAAoB;CAC/B,CAAC;AAuBF,MAAM,CAAC,MAAM,0BAA0B,GAAG,gBAAgB,CAAC","sourcesContent":["export type TtsrStreamSource = \"text\" | \"thinking\" | \"tool\";\n\nexport interface TtsrToolScope {\n\treadonly toolName: string;\n\treadonly pathGlob?: string;\n}\n\nexport interface TtsrScope {\n\treadonly allowText: boolean;\n\treadonly allowThinking: boolean;\n\treadonly toolScopes: readonly TtsrToolScope[];\n}\n\nexport type TtsrInterruptMode = \"always\" | \"never\";\n\nexport interface TtsrRule {\n\treadonly name: string;\n\treadonly path?: string;\n\treadonly content: string;\n\treadonly description?: string;\n\treadonly globs?: readonly string[];\n\treadonly condition: readonly string[];\n\treadonly scope: TtsrScope;\n\treadonly interruptMode: TtsrInterruptMode;\n\treadonly source: \"builtin\" | \"project\" | \"global\";\n}\n\nexport interface TtsrSettings {\n\treadonly enabled: boolean;\n\treadonly repeatMode: \"once\" | \"after-gap\";\n\treadonly repeatGap: number;\n\treadonly disabledRules: readonly string[];\n}\n\nexport const DEFAULT_TTSR_SETTINGS: TtsrSettings = {\n\tenabled: true,\n\trepeatMode: \"once\",\n\trepeatGap: 10,\n\tdisabledRules: [],\n};\n\nexport interface DetectorContext {\n\treadonly source:
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ttsr/types.ts"],"names":[],"mappings":"AAkCA,MAAM,CAAC,MAAM,qBAAqB,GAAiB;IAClD,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE,EAAE;IACb,aAAa,EAAE,EAAE;CACjB,CAAC;AAsCF,MAAM,CAAC,MAAM,oBAAoB,GAAoB;IACpD,SAAS,EAAE,OAAO;IAClB,WAAW,EAAE,UAAU;IACvB,eAAe,EAAE,eAAe;IAChC,QAAQ,EAAE,qBAAqB;CAC/B,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAoB;IACxD,SAAS,EAAE,gBAAgB;IAC3B,WAAW,EAAE,SAAS;IACtB,eAAe,EAAE,YAAY;IAC7B,SAAS,EAAE,oBAAoB;CAC/B,CAAC;AAuBF,MAAM,CAAC,MAAM,0BAA0B,GAAG,gBAAgB,CAAC","sourcesContent":["export type TtsrStreamSource = \"text\" | \"thinking\" | \"tool\";\n\nexport interface TtsrToolScope {\n\treadonly toolName: string;\n\treadonly pathGlob?: string;\n}\n\nexport interface TtsrScope {\n\treadonly allowText: boolean;\n\treadonly allowThinking: boolean;\n\treadonly toolScopes: readonly TtsrToolScope[];\n}\n\nexport type TtsrInterruptMode = \"always\" | \"never\";\n\nexport interface TtsrRule {\n\treadonly name: string;\n\treadonly path?: string;\n\treadonly content: string;\n\treadonly description?: string;\n\treadonly globs?: readonly string[];\n\treadonly condition: readonly string[];\n\treadonly scope: TtsrScope;\n\treadonly interruptMode: TtsrInterruptMode;\n\treadonly source: \"builtin\" | \"project\" | \"global\";\n}\n\nexport interface TtsrSettings {\n\treadonly enabled: boolean;\n\treadonly repeatMode: \"once\" | \"after-gap\";\n\treadonly repeatGap: number;\n\treadonly disabledRules: readonly string[];\n}\n\nexport const DEFAULT_TTSR_SETTINGS: TtsrSettings = {\n\tenabled: true,\n\trepeatMode: \"once\",\n\trepeatGap: 10,\n\tdisabledRules: [],\n};\n\nexport interface DetectorContext {\n\treadonly source: TtsrStreamSource;\n\treadonly streamKey: string;\n\treadonly generation: number;\n}\n\nexport interface DetectorMatch {\n\treadonly rule: \"collapse-repetition\" | \"control-token-leak\" | \"repetitive-turns\";\n\treadonly reason: string;\n\treadonly anomalyStartOffset: number;\n\treadonly garbageStartOffset: number;\n\treadonly detail: Readonly<Record<string, string | number | boolean>>;\n}\n\nexport interface StreamDetector<State> {\n\tcreateState(): State;\n\tcheckDelta(state: State, delta: string, ctx: DetectorContext): DetectorMatch | null;\n\tflush?(state: State, ctx: DetectorContext): DetectorMatch | null;\n}\n\nexport type TtsrContextMode = \"keep\" | \"truncate\" | \"discard\";\n\nexport type RuleRemediation =\n\t| {\n\t\t\treadonly retryMode: \"nudge\";\n\t\t\treadonly contextMode: TtsrContextMode;\n\t\t\treadonly corruptionScope: \"output-region\";\n\t\t\treadonly nudgeKey: string;\n\t }\n\t| {\n\t\t\treadonly retryMode: \"provider-error\";\n\t\t\treadonly contextMode: \"discard\";\n\t\t\treadonly corruptionScope: \"generation\";\n\t\t\treadonly errorKind: \"control-token-leak\";\n\t };\n\nexport const COLLAPSE_REMEDIATION: RuleRemediation = {\n\tretryMode: \"nudge\",\n\tcontextMode: \"truncate\",\n\tcorruptionScope: \"output-region\",\n\tnudgeKey: \"collapse-repetition\",\n};\n\nexport const CONTROL_LEAK_REMEDIATION: RuleRemediation = {\n\tretryMode: \"provider-error\",\n\tcontextMode: \"discard\",\n\tcorruptionScope: \"generation\",\n\terrorKind: \"control-token-leak\",\n};\n\nexport interface DetectionResolution {\n\treadonly owner: \"collapse-repetition\" | \"control-token-leak\";\n\treadonly observedRules: readonly (\"collapse-repetition\" | \"control-token-leak\")[];\n\treadonly match: DetectorMatch;\n\treadonly remediation: RuleRemediation;\n}\n\nexport interface GenerationDetectionState {\n\tabortClaimed: boolean;\n\tabortOwner?: DetectionResolution[\"owner\"];\n\tselfAbortAt?: number;\n\tuserCancelled: boolean;\n}\n\nexport interface TtsrInjectionRecord {\n\treadonly rules: readonly string[];\n\treadonly owner: DetectionResolution[\"owner\"];\n\treadonly remediation: RuleRemediation[\"retryMode\"];\n\treadonly at: number;\n}\n\nexport const TTSR_INJECTION_CUSTOM_TYPE = \"ttsr-injection\";\n"]}
|
|
@@ -8,6 +8,6 @@ export declare class StreamWatcher {
|
|
|
8
8
|
#private;
|
|
9
9
|
constructor(manager: TtsrManager, disabledBuiltinRules: readonly string[]);
|
|
10
10
|
reset(): void;
|
|
11
|
-
handleDelta(source: "text" | "thinking", streamKey: string, delta: string, generation: number): WatchOutcome;
|
|
11
|
+
handleDelta(source: "text" | "thinking" | "tool", streamKey: string, delta: string, generation: number, toolName?: string): WatchOutcome;
|
|
12
12
|
}
|
|
13
13
|
//# sourceMappingURL=watch.d.ts.map
|