maka-agent 0.2.0-dev.62.20260928 → 0.2.0-dev.64.20260929
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/LICENSE +15 -15
- package/THIRD_PARTY_NOTICES.txt +26 -26
- package/native/runtime-host-windows-task-launcher/prebuilds/win32-x64/maka-runtime-host-task-launcher.exe +0 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.js +12 -12
- package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js +52 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.js +5 -4
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.js +7 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.js +51 -8
- package/node_modules/@agentclientprotocol/sdk/package.json +2 -2
- package/node_modules/@agentclientprotocol/sdk/schema/schema.json +90 -2
- package/node_modules/@agentclientprotocol/sdk/schema/v2/schema.unstable.json +103 -12
- package/node_modules/@ai-sdk/anthropic/CHANGELOG.md +140 -0
- package/node_modules/@ai-sdk/anthropic/README.md +1 -1
- package/node_modules/@ai-sdk/anthropic/dist/index.js +1622 -868
- package/node_modules/@ai-sdk/anthropic/dist/internal/index.js +1516 -763
- package/node_modules/@ai-sdk/anthropic/docs/05-anthropic.mdx +483 -62
- package/node_modules/@ai-sdk/anthropic/package.json +4 -4
- package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/dist/approval-continuation.js +0 -1
- package/node_modules/@ai-sdk/code-mode/dist/code-mode-tool.js +59 -0
- package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/dist/errors.js +0 -8
- package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/dist/interrupt-continuation.js +0 -2
- package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/dist/tool-prompt.js +43 -15
- package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/package.json +3 -3
- package/node_modules/@ai-sdk/cohere/CHANGELOG.md +99 -0
- package/node_modules/@ai-sdk/cohere/README.md +1 -1
- package/node_modules/@ai-sdk/cohere/dist/index.js +35 -49
- package/node_modules/@ai-sdk/cohere/docs/25-cohere.mdx +11 -9
- package/node_modules/@ai-sdk/cohere/package.json +4 -4
- package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/gateway/CHANGELOG.md +183 -0
- package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/gateway/README.md +1 -1
- package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/gateway/dist/index.js +587 -245
- package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/gateway/docs/00-ai-gateway.mdx +235 -30
- package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/gateway/package.json +4 -4
- package/node_modules/@ai-sdk/google/CHANGELOG.md +180 -0
- package/node_modules/@ai-sdk/google/README.md +1 -1
- package/node_modules/@ai-sdk/google/dist/index.js +1147 -1130
- package/node_modules/@ai-sdk/google/dist/internal/index.js +809 -889
- package/node_modules/@ai-sdk/google/docs/15-google.mdx +224 -41
- package/node_modules/@ai-sdk/google/package.json +4 -4
- package/node_modules/@ai-sdk/open-responses/CHANGELOG.md +109 -0
- package/node_modules/@ai-sdk/open-responses/dist/index.js +419 -183
- package/node_modules/@ai-sdk/open-responses/docs/06-open-responses.mdx +121 -6
- package/node_modules/@ai-sdk/open-responses/package.json +4 -4
- package/node_modules/@ai-sdk/openai/CHANGELOG.md +147 -0
- package/node_modules/@ai-sdk/openai/README.md +27 -2
- package/node_modules/@ai-sdk/openai/dist/index.js +2445 -1828
- package/node_modules/@ai-sdk/openai/dist/internal/index.js +2170 -2041
- package/node_modules/@ai-sdk/openai/docs/03-openai.mdx +311 -102
- package/node_modules/@ai-sdk/openai/package.json +4 -4
- package/node_modules/@ai-sdk/openai-compatible/CHANGELOG.md +110 -0
- package/node_modules/@ai-sdk/openai-compatible/dist/index.js +120 -130
- package/node_modules/@ai-sdk/openai-compatible/dist/internal/index.js +22 -14
- package/node_modules/@ai-sdk/openai-compatible/docs/index.mdx +2 -0
- package/node_modules/@ai-sdk/openai-compatible/package.json +4 -4
- package/node_modules/@ai-sdk/{anthropic/node_modules/@ai-sdk/provider → provider}/CHANGELOG.md +47 -0
- package/node_modules/@ai-sdk/{cohere/node_modules/@ai-sdk/provider → provider}/dist/index.js +127 -102
- package/node_modules/@ai-sdk/{anthropic/node_modules/@ai-sdk/provider → provider}/package.json +1 -1
- package/node_modules/@ai-sdk/provider-utils/CHANGELOG.md +99 -0
- package/node_modules/@ai-sdk/provider-utils/dist/experimental-evaluation/index.js +1618 -0
- package/node_modules/@ai-sdk/provider-utils/dist/index.js +470 -268
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +3 -1
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/docs/docs/api/Dispatcher.md +1 -0
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/core/request.js +23 -2
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/balanced-pool.js +4 -2
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/client-h1.js +23 -8
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/client-h2.js +84 -19
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/client.js +6 -2
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/handler/cache-handler.js +21 -5
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/handler/retry-handler.js +109 -23
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/interceptor/cache.js +20 -1
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/interceptor/decompress.js +338 -46
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/interceptor/dump.js +10 -23
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/eventsource/eventsource-stream.js +245 -150
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/websocket/connection.js +19 -9
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
- package/node_modules/@ai-sdk/provider-utils/node_modules/undici/package.json +1 -1
- package/node_modules/@ai-sdk/provider-utils/package.json +7 -2
- package/node_modules/@earendil-works/pi-tui/README.md +8 -2
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +18 -11
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +7 -6
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js +23 -22
- package/node_modules/@earendil-works/pi-tui/dist/index.js +2 -0
- package/node_modules/@earendil-works/pi-tui/dist/latex.js +109 -16
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +3 -44
- package/node_modules/@earendil-works/pi-tui/dist/native-platform.js +42 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js +2 -20
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js +25 -6
- package/node_modules/@earendil-works/pi-tui/dist/utils.js +4 -0
- package/node_modules/@earendil-works/pi-tui/native/clipboard.h +170 -0
- package/node_modules/@earendil-works/pi-tui/native/darwin/README.md +8 -6
- package/node_modules/@earendil-works/pi-tui/native/darwin/build.sh +12 -5
- package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-arm64/{darwin-modifiers.node → darwin-platform.node} +0 -0
- package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/{darwin-modifiers.node → darwin-platform.node} +0 -0
- package/node_modules/@earendil-works/pi-tui/native/darwin/src/darwin-platform.m +93 -0
- package/node_modules/@earendil-works/pi-tui/native/linux/README.md +23 -0
- package/node_modules/@earendil-works/pi-tui/native/linux/build.sh +65 -0
- package/node_modules/@earendil-works/pi-tui/native/linux/prebuilds/linux-arm64/linux-platform-x11.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/linux/prebuilds/linux-x64/linux-platform-x11.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/linux/src/clipboard-worker.h +70 -0
- package/node_modules/@earendil-works/pi-tui/native/linux/src/linux-platform-x11.c +274 -0
- package/node_modules/@earendil-works/pi-tui/native/napi.h +89 -0
- package/node_modules/@earendil-works/pi-tui/native/win32/README.md +16 -7
- package/node_modules/@earendil-works/pi-tui/native/win32/build.mjs +7 -4
- package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-platform.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-platform.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/win32/src/win32-platform.c +241 -0
- package/node_modules/@earendil-works/pi-tui/package.json +11 -4
- package/node_modules/@larksuiteoapi/node-sdk/README.md +20 -0
- package/node_modules/@larksuiteoapi/node-sdk/README.zh.md +20 -0
- package/node_modules/@larksuiteoapi/node-sdk/es/index.js +33 -1
- package/node_modules/@larksuiteoapi/node-sdk/lib/index.js +33 -1
- package/node_modules/@larksuiteoapi/node-sdk/package.json +1 -1
- package/node_modules/@maka/acp-executor-plugin/dist/plugin.mjs +17 -0
- package/node_modules/@maka/acp-executor-plugin/package.json +1 -1
- package/node_modules/@maka/core/dist/model-web-search.js +2 -3
- package/node_modules/@maka/core/dist/relative-time.js +19 -20
- package/node_modules/@maka/eval/harbor/egress_filter.py +64 -47
- package/node_modules/@maka/eval/harbor/eval_framework.py +3 -3
- package/node_modules/@maka/eval/harbor/run_trial.py +2 -2
- package/node_modules/@maka/eval/node_modules/undici/README.md +10 -1
- package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Agent.md +8 -8
- package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +9 -6
- package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Dispatcher.md +9 -0
- package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Errors.md +25 -0
- package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Fetch.md +10 -0
- package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Interceptors.md +4 -3
- package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Pool.md +5 -6
- package/node_modules/@maka/eval/node_modules/undici/docs/docs/index.md +10 -1
- package/node_modules/@maka/eval/node_modules/undici/lib/api/readable.js +1 -2
- package/node_modules/@maka/eval/node_modules/undici/lib/core/request.js +23 -2
- package/node_modules/@maka/eval/node_modules/undici/lib/core/util.js +0 -39
- package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/client-h1.js +11 -4
- package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/client-h2.js +52 -8
- package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/client.js +6 -1
- package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +21 -6
- package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/pool-base.js +63 -2
- package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/pool.js +90 -7
- package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/proxy-agent.js +16 -3
- package/node_modules/@maka/eval/node_modules/undici/lib/handler/deduplication-handler.js +24 -11
- package/node_modules/@maka/eval/node_modules/undici/lib/handler/redirect-handler.js +5 -0
- package/node_modules/@maka/eval/node_modules/undici/lib/handler/retry-handler.js +72 -13
- package/node_modules/@maka/eval/node_modules/undici/lib/interceptor/cache.js +4 -1
- package/node_modules/@maka/eval/node_modules/undici/lib/interceptor/decompress.js +236 -69
- package/node_modules/@maka/eval/node_modules/undici/lib/web/cache/cache.js +17 -8
- package/node_modules/@maka/eval/node_modules/undici/lib/web/cache/cachestorage.js +11 -5
- package/node_modules/@maka/eval/node_modules/undici/lib/web/cookies/index.js +19 -7
- package/node_modules/@maka/eval/node_modules/undici/lib/web/cookies/util.js +3 -1
- package/node_modules/@maka/eval/node_modules/undici/lib/web/eventsource/eventsource.js +25 -1
- package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/body.js +22 -15
- package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/data-url.js +6 -6
- package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/formdata.js +30 -36
- package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/headers.js +34 -31
- package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/index.js +46 -25
- package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/request.js +74 -79
- package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/response.js +43 -44
- package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/util.js +7 -7
- package/node_modules/@maka/eval/node_modules/undici/lib/web/infra/index.js +16 -1
- package/node_modules/@maka/eval/node_modules/undici/lib/web/webidl/index.js +2 -14
- package/node_modules/@maka/eval/node_modules/undici/lib/web/websocket/connection.js +33 -12
- package/node_modules/@maka/eval/node_modules/undici/lib/web/websocket/events.js +43 -26
- package/node_modules/@maka/eval/node_modules/undici/lib/web/websocket/receiver.js +2 -0
- package/node_modules/@maka/eval/node_modules/undici/lib/web/websocket/stream/websocketerror.js +13 -10
- package/node_modules/@maka/eval/node_modules/undici/lib/web/websocket/stream/websocketstream.js +19 -4
- package/node_modules/@maka/eval/node_modules/undici/lib/web/websocket/websocket.js +44 -41
- package/node_modules/@maka/eval/node_modules/undici/package.json +1 -1
- package/node_modules/@maka/mcp/package.json +1 -1
- package/node_modules/@maka/runtime/dist/ai-sdk-compaction.js +15 -3
- package/node_modules/@maka/runtime/dist/ai-sdk-message-projection.js +33 -3
- package/node_modules/@maka/runtime/dist/deepseek-web-search-codec.js +71 -0
- package/node_modules/@maka/runtime/dist/history-compaction.js +11 -4
- package/node_modules/@maka/runtime/dist/model-adapter.js +9 -5
- package/node_modules/@maka/runtime/dist/model-factory.js +4 -0
- package/node_modules/@maka/runtime/dist/plugin-agent-service.js +5 -13
- package/node_modules/@maka/runtime/dist/plugin-attachment-service.js +5 -13
- package/node_modules/@maka/runtime/dist/plugin-composition-loader.js +26 -36
- package/node_modules/@maka/runtime/dist/plugin-data-services.js +9 -26
- package/node_modules/@maka/runtime/dist/plugin-fs-service.js +5 -13
- package/node_modules/@maka/runtime/dist/plugin-goal-service.js +5 -13
- package/node_modules/@maka/runtime/dist/plugin-internals.js +78 -0
- package/node_modules/@maka/runtime/dist/plugin-llm-service.js +5 -13
- package/node_modules/@maka/runtime/dist/plugin-runtime.js +4 -32
- package/node_modules/@maka/runtime/dist/plugin-session-query-service.js +5 -13
- package/node_modules/@maka/runtime/dist/plugin-shell-service.js +5 -13
- package/node_modules/@maka/runtime/dist/plugin-web-service.js +5 -13
- package/node_modules/@maka/runtime/dist/stream-graph-coordinator.js +3 -3
- package/node_modules/@maka/runtime/dist/workers/filesystem-worker.js +161 -104
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +3 -1
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/docs/docs/api/Dispatcher.md +1 -0
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/core/request.js +23 -2
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/balanced-pool.js +4 -2
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/client-h1.js +23 -8
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/client-h2.js +84 -19
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/client.js +6 -2
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/handler/cache-handler.js +21 -5
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/handler/retry-handler.js +109 -23
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/interceptor/cache.js +20 -1
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/interceptor/decompress.js +338 -46
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/interceptor/dump.js +10 -23
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/eventsource/eventsource-stream.js +245 -150
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/websocket/connection.js +19 -9
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/package.json +1 -1
- package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/package.json +1 -1
- package/node_modules/@maka/runtime/node_modules/undici/README.md +10 -1
- package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Agent.md +8 -8
- package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +9 -6
- package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Dispatcher.md +9 -0
- package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Errors.md +25 -0
- package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Fetch.md +10 -0
- package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Interceptors.md +4 -3
- package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Pool.md +5 -6
- package/node_modules/@maka/runtime/node_modules/undici/docs/docs/index.md +10 -1
- package/node_modules/@maka/runtime/node_modules/undici/lib/api/readable.js +1 -2
- package/node_modules/@maka/runtime/node_modules/undici/lib/core/request.js +23 -2
- package/node_modules/@maka/runtime/node_modules/undici/lib/core/util.js +0 -39
- package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/client-h1.js +11 -4
- package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/client-h2.js +52 -8
- package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/client.js +6 -1
- package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +21 -6
- package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/pool-base.js +63 -2
- package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/pool.js +90 -7
- package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/proxy-agent.js +16 -3
- package/node_modules/@maka/runtime/node_modules/undici/lib/handler/deduplication-handler.js +24 -11
- package/node_modules/@maka/runtime/node_modules/undici/lib/handler/redirect-handler.js +5 -0
- package/node_modules/@maka/runtime/node_modules/undici/lib/handler/retry-handler.js +72 -13
- package/node_modules/@maka/runtime/node_modules/undici/lib/interceptor/cache.js +4 -1
- package/node_modules/@maka/runtime/node_modules/undici/lib/interceptor/decompress.js +236 -69
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/cache/cache.js +17 -8
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/cache/cachestorage.js +11 -5
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/cookies/index.js +19 -7
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/cookies/util.js +3 -1
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/eventsource/eventsource.js +25 -1
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/body.js +22 -15
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/data-url.js +6 -6
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/formdata.js +30 -36
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/headers.js +34 -31
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/index.js +46 -25
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/request.js +74 -79
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/response.js +43 -44
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/util.js +7 -7
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/infra/index.js +16 -1
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/webidl/index.js +2 -14
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/websocket/connection.js +33 -12
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/websocket/events.js +43 -26
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/websocket/receiver.js +2 -0
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/websocket/stream/websocketerror.js +13 -10
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/websocket/stream/websocketstream.js +19 -4
- package/node_modules/@maka/runtime/node_modules/undici/lib/web/websocket/websocket.js +44 -41
- package/node_modules/@maka/runtime/node_modules/undici/package.json +1 -1
- package/node_modules/@maka/runtime/package.json +11 -11
- package/node_modules/@maka/runtime-host/dist/adapter/session-projector.js +3 -7
- package/node_modules/@maka/runtime-host/dist/candidate-cli.js +7 -7
- package/node_modules/@maka/runtime-host/dist/protocol/turn.js +20 -8
- package/node_modules/@maka/runtime-host/dist/server/message-coordinator.js +107 -63
- package/node_modules/@maka/runtime-host/dist/server/root-turn-coordinator.js +1 -3
- package/node_modules/@maka/runtime-host/dist/server/session-continuity-coordinator.js +51 -16
- package/node_modules/@maka/runtime-host/package.json +2 -2
- package/node_modules/@maka/storage/dist/project-catalog.js +13 -20
- package/node_modules/@modelcontextprotocol/client/dist/index-BCtJi0p5.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index-CEk3qkZM.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/client/dist/index.cjs +375 -60
- package/node_modules/@modelcontextprotocol/client/dist/index.d.cts.map +1 -1
- package/node_modules/@modelcontextprotocol/client/dist/index.d.mts.map +1 -1
- package/node_modules/@modelcontextprotocol/client/dist/index.mjs +369 -61
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.cjs +1 -1
- package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.mjs +1 -1
- package/node_modules/@modelcontextprotocol/client/dist/{src-NAgB4Mp8.cjs → src-D0qEN74R.cjs} +111 -38
- package/node_modules/@modelcontextprotocol/client/dist/{src-D_zzAWoS.mjs → src-DDAAhLnO.mjs} +106 -33
- package/node_modules/@modelcontextprotocol/client/dist/stdio.cjs +8 -2
- package/node_modules/@modelcontextprotocol/client/dist/stdio.d.cts.map +1 -1
- package/node_modules/@modelcontextprotocol/client/dist/stdio.d.mts.map +1 -1
- package/node_modules/@modelcontextprotocol/client/dist/stdio.mjs +8 -2
- package/node_modules/@modelcontextprotocol/{core/dist/auth-hYtaIUZm.d.cts.map → client/node_modules/@modelcontextprotocol/core/dist/auth--n_Yzytt.d.cts.map} +1 -1
- package/node_modules/@modelcontextprotocol/{core/dist/auth-CfDMXiII.cjs → client/node_modules/@modelcontextprotocol/core/dist/auth-4-zilcqg.cjs} +3 -2
- package/node_modules/@modelcontextprotocol/{core/dist/auth-CUe6YdwF.mjs → client/node_modules/@modelcontextprotocol/core/dist/auth-CGP0BDVq.mjs} +3 -2
- package/node_modules/@modelcontextprotocol/{core/dist/auth-BWdKR39I.d.mts.map → client/node_modules/@modelcontextprotocol/core/dist/auth-YUQV3RRv.d.mts.map} +1 -1
- package/node_modules/@modelcontextprotocol/{core → client/node_modules/@modelcontextprotocol/core}/dist/index.cjs +1 -1
- package/node_modules/@modelcontextprotocol/{core → client/node_modules/@modelcontextprotocol/core}/dist/index.mjs +1 -1
- package/node_modules/@modelcontextprotocol/{core → client/node_modules/@modelcontextprotocol/core}/dist/internal.cjs +1 -1
- package/node_modules/@modelcontextprotocol/{core → client/node_modules/@modelcontextprotocol/core}/dist/internal.mjs +1 -1
- package/node_modules/@modelcontextprotocol/{core → client/node_modules/@modelcontextprotocol/core}/package.json +1 -1
- package/node_modules/@modelcontextprotocol/client/package.json +4 -4
- package/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/node/package.json +2 -17
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/CHANGELOG.md +311 -0
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/README.md +6 -6
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/dist/index.js +4830 -1974
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/dist/internal/index.js +694 -332
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/00-introduction/index.mdx +1 -1
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-foundations/02-providers-and-models.mdx +5 -0
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-foundations/03-prompts.mdx +1 -1
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-foundations/04-tools.mdx +2 -2
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-foundations/06-provider-options.mdx +11 -11
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-getting-started/00-choosing-a-provider.mdx +4 -4
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-getting-started/02-nextjs-app-router.mdx +3 -3
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-getting-started/03-nextjs-pages-router.mdx +4 -4
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-getting-started/04-svelte.mdx +7 -7
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-getting-started/05-nuxt.mdx +8 -8
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-getting-started/06-nodejs.mdx +3 -3
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-getting-started/07-expo.mdx +10 -3
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-getting-started/08-tanstack-start.mdx +3 -3
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-getting-started/09-coding-agents.mdx +1 -1
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-agents/02-building-agents.mdx +2 -2
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-agents/03-workflows.mdx +2 -2
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-agents/04-loop-control.mdx +1 -1
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-agents/05-configuring-call-options.mdx +4 -2
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-agents/06-memory.mdx +2 -2
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-agents/06-policy-tool-approvals.mdx +2 -2
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-agents/06-tool-approvals.mdx +16 -0
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-agents/07-workflow-agent.mdx +12 -12
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-agents/08-terminal-ui.mdx +14 -10
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/05-generating-text.mdx +2 -2
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/15-tools-and-tool-calling.mdx +6 -1
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/16-mcp-tools.mdx +31 -0
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/17-mcp-apps.mdx +2 -2
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/18-code-mode.mdx +50 -0
- package/node_modules/ai/docs/03-ai-sdk-core/19-tool-search.mdx +82 -0
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/20-prompt-engineering.mdx +1 -1
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/26-reasoning.mdx +15 -14
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/31-reranking.mdx +12 -10
- package/node_modules/ai/docs/03-ai-sdk-core/32-evaluation.mdx +287 -0
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/35-image-generation.mdx +40 -2
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/36-realtime.mdx +41 -18
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/36-transcription.mdx +1 -0
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/37-speech.mdx +8 -6
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/39-file-uploads.mdx +1 -1
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/40-middleware.mdx +92 -7
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/41-skill-uploads.mdx +1 -1
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/42-batch.mdx +2 -3
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/45-provider-management.mdx +31 -21
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/55-testing.mdx +75 -0
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/60-telemetry.mdx +57 -4
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/65-devtools.mdx +3 -3
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/65-lifecycle-callbacks.mdx +132 -7
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/index.mdx +6 -0
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-harnesses/01-overview.mdx +3 -2
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-harnesses/02-harness-agent.mdx +151 -112
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-harnesses/03-tools.mdx +47 -22
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-harnesses/04-skills.mdx +0 -4
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-harnesses/05-harness-adapters.mdx +3 -3
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-harnesses/06-workflow-utilities.mdx +43 -9
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-harnesses/07-ui.mdx +33 -30
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-harnesses/08-terminal-ui.mdx +8 -6
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/01-overview.mdx +1 -1
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/02-chatbot.mdx +47 -21
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/03-chatbot-message-persistence.mdx +46 -3
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/03-chatbot-resume-streams.mdx +11 -4
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/03-chatbot-tool-usage.mdx +10 -1
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/05-completion.mdx +1 -1
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/08-object-generation.mdx +4 -1
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/21-error-handling.mdx +28 -2
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/21-transport.mdx +1 -1
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/05-ai-sdk-rsc/02-streaming-react-components.mdx +5 -5
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/05-ai-sdk-rsc/04-multistep-interfaces.mdx +2 -2
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/05-ai-sdk-rsc/06-loading-state.mdx +1 -1
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/05-ai-sdk-rsc/10-migrating-to-ui.mdx +3 -3
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/06-advanced/02-stopping-streams.mdx +8 -0
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/06-advanced/04-caching.mdx +2 -1
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/06-advanced/11-secure-url-fetching.mdx +47 -2
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/01-generate-text.mdx +13 -4
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/02-stream-text.mdx +16 -7
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/06-rerank.mdx +5 -5
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/11-transcribe.mdx +1 -1
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/12-generate-speech.mdx +3 -3
- package/node_modules/ai/docs/07-reference/01-ai-sdk-core/14-evaluate.mdx +74 -0
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/16-tool-loop-agent.mdx +4 -2
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/20-start-batch.mdx +1 -1
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/20-tool.mdx +7 -0
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/22-dynamic-tool.mdx +7 -0
- package/node_modules/ai/docs/07-reference/01-ai-sdk-core/23-tool-search.mdx +76 -0
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/32-validate-ui-messages.mdx +30 -0
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/33-safe-validate-ui-messages.mdx +12 -0
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/40-provider-registry.mdx +19 -1
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/42-custom-provider.mdx +22 -4
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/60-wrap-language-model.mdx +1 -1
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/61-wrap-image-model.mdx +17 -2
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/index.mdx +6 -0
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/01-use-chat.mdx +1 -1
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/03-use-object.mdx +4 -1
- package/node_modules/ai/docs/07-reference/02-ai-sdk-ui/05-use-realtime.mdx +563 -0
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/31-convert-to-model-messages.mdx +12 -0
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/40-create-ui-message-stream.mdx +9 -3
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/50-direct-chat-transport.mdx +3 -3
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/03-ai-sdk-rsc/01-stream-ui.mdx +2 -1
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/03-ai-sdk-rsc/02-create-ai.mdx +1 -1
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/03-ai-sdk-rsc/03-create-streamable-ui.mdx +1 -1
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/04-ai-sdk-workflow/01-workflow-agent.mdx +8 -8
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/04-ai-sdk-workflow/02-workflow-chat-transport.mdx +4 -4
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-api-call-error.mdx +4 -0
- package/node_modules/ai/docs/07-reference/05-ai-sdk-errors/ai-evaluation-unsupported-question-type-error.mdx +31 -0
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-no-such-model-error.mdx +4 -0
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-no-such-provider-error.mdx +4 -0
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-ui-message-stream-error.mdx +6 -2
- package/node_modules/ai/docs/07-reference/05-ai-sdk-errors/index.mdx +138 -0
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/06-ai-sdk-tui/01-run-agent-tui.mdx +13 -9
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/08-migration-guides/29-migration-guide-4-0.mdx +5 -5
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/08-migration-guides/37-migration-guide-3-3.mdx +1 -1
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/11-use-chat-custom-request-options.mdx +3 -3
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/13-repeated-assistant-messages.mdx +2 -2
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/17-use-chat-stale-body-data.mdx +1 -1
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/70-high-memory-usage-with-images.mdx +2 -2
- package/node_modules/{@maka/runtime/node_modules/ai → ai}/package.json +13 -13
- package/node_modules/image-dimensions/cli.js +18 -3
- package/node_modules/image-dimensions/index.js +7 -5
- package/node_modules/image-dimensions/package.json +4 -1
- package/node_modules/image-dimensions/readme.md +2 -1
- package/node_modules/image-dimensions/types/avif.js +2 -24
- package/node_modules/image-dimensions/types/heic.js +2 -24
- package/node_modules/image-dimensions/types/jpeg.js +28 -7
- package/node_modules/image-dimensions/types/png.js +13 -2
- package/node_modules/image-dimensions/types/webp.js +20 -36
- package/node_modules/image-dimensions/utilities.js +184 -60
- package/node_modules/ip-address/README.md +145 -135
- package/node_modules/ip-address/dist/common.js +48 -0
- package/node_modules/ip-address/dist/ipv4.js +117 -11
- package/node_modules/ip-address/dist/ipv6.js +162 -48
- package/node_modules/ip-address/dist/v4/constants.js +40 -1
- package/node_modules/ip-address/dist/v6/constants.js +47 -1
- package/node_modules/ip-address/package.json +1 -1
- package/node_modules/marked/README.md +1 -0
- package/node_modules/marked/lib/marked.esm.js +30 -29
- package/node_modules/marked/lib/marked.umd.js +30 -29
- package/node_modules/marked/man/marked.1 +1 -1
- package/node_modules/marked/package.json +11 -11
- package/node_modules/systeminformation/lib/battery.js +32 -11
- package/node_modules/systeminformation/lib/cpu.js +23 -23
- package/node_modules/systeminformation/lib/filesystem.js +14 -8
- package/node_modules/systeminformation/lib/memory.js +3 -5
- package/node_modules/systeminformation/lib/network.js +8 -2
- package/node_modules/systeminformation/lib/osinfo.js +17 -3
- package/node_modules/systeminformation/lib/util.js +7 -0
- package/node_modules/systeminformation/package.json +1 -1
- package/node_modules/undici/README.md +10 -1
- package/node_modules/undici/docs/docs/api/Agent.md +8 -8
- package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +9 -6
- package/node_modules/undici/docs/docs/api/Dispatcher.md +9 -0
- package/node_modules/undici/docs/docs/api/Errors.md +25 -0
- package/node_modules/undici/docs/docs/api/Fetch.md +10 -0
- package/node_modules/undici/docs/docs/api/Interceptors.md +4 -3
- package/node_modules/undici/docs/docs/api/Pool.md +5 -6
- package/node_modules/undici/docs/docs/index.md +10 -1
- package/node_modules/undici/lib/api/readable.js +1 -2
- package/node_modules/undici/lib/core/request.js +23 -2
- package/node_modules/undici/lib/core/util.js +0 -39
- package/node_modules/undici/lib/dispatcher/client-h1.js +11 -4
- package/node_modules/undici/lib/dispatcher/client-h2.js +52 -8
- package/node_modules/undici/lib/dispatcher/client.js +6 -1
- package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +21 -6
- package/node_modules/undici/lib/dispatcher/pool-base.js +63 -2
- package/node_modules/undici/lib/dispatcher/pool.js +90 -7
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +16 -3
- package/node_modules/undici/lib/handler/deduplication-handler.js +24 -11
- package/node_modules/undici/lib/handler/redirect-handler.js +5 -0
- package/node_modules/undici/lib/handler/retry-handler.js +72 -13
- package/node_modules/undici/lib/interceptor/cache.js +4 -1
- package/node_modules/undici/lib/interceptor/decompress.js +236 -69
- package/node_modules/undici/lib/web/cache/cache.js +17 -8
- package/node_modules/undici/lib/web/cache/cachestorage.js +11 -5
- package/node_modules/undici/lib/web/cookies/index.js +19 -7
- package/node_modules/undici/lib/web/cookies/util.js +3 -1
- package/node_modules/undici/lib/web/eventsource/eventsource.js +25 -1
- package/node_modules/undici/lib/web/fetch/body.js +22 -15
- package/node_modules/undici/lib/web/fetch/data-url.js +6 -6
- package/node_modules/undici/lib/web/fetch/formdata.js +30 -36
- package/node_modules/undici/lib/web/fetch/headers.js +34 -31
- package/node_modules/undici/lib/web/fetch/index.js +46 -25
- package/node_modules/undici/lib/web/fetch/request.js +74 -79
- package/node_modules/undici/lib/web/fetch/response.js +43 -44
- package/node_modules/undici/lib/web/fetch/util.js +7 -7
- package/node_modules/undici/lib/web/infra/index.js +16 -1
- package/node_modules/undici/lib/web/webidl/index.js +2 -14
- package/node_modules/undici/lib/web/websocket/connection.js +33 -12
- package/node_modules/undici/lib/web/websocket/events.js +43 -26
- package/node_modules/undici/lib/web/websocket/receiver.js +2 -0
- package/node_modules/undici/lib/web/websocket/stream/websocketerror.js +13 -10
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +19 -4
- package/node_modules/undici/lib/web/websocket/websocket.js +44 -41
- package/node_modules/undici/package.json +1 -1
- package/package.json +4 -4
- package/node_modules/@ai-sdk/anthropic/node_modules/@ai-sdk/provider/dist/index.js +0 -426
- package/node_modules/@ai-sdk/cohere/node_modules/@ai-sdk/provider/CHANGELOG.md +0 -1262
- package/node_modules/@ai-sdk/cohere/node_modules/@ai-sdk/provider/README.md +0 -1
- package/node_modules/@ai-sdk/cohere/node_modules/@ai-sdk/provider/package.json +0 -63
- package/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider/CHANGELOG.md +0 -1262
- package/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider/README.md +0 -1
- package/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider/dist/index.js +0 -426
- package/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider/package.json +0 -63
- package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider/CHANGELOG.md +0 -1262
- package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider/README.md +0 -1
- package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider/dist/index.js +0 -426
- package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider/package.json +0 -63
- package/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider/CHANGELOG.md +0 -1262
- package/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider/LICENSE +0 -13
- package/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider/README.md +0 -1
- package/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider/dist/index.js +0 -426
- package/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider/package.json +0 -63
- package/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider/CHANGELOG.md +0 -1262
- package/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider/LICENSE +0 -13
- package/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider/README.md +0 -1
- package/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider/dist/index.js +0 -426
- package/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider/package.json +0 -63
- package/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/CHANGELOG.md +0 -1262
- package/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/LICENSE +0 -13
- package/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/README.md +0 -1
- package/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/dist/index.js +0 -426
- package/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/package.json +0 -63
- package/node_modules/@earendil-works/pi-tui/native/darwin/src/darwin-modifiers.c +0 -70
- package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/win32/src/win32-console-mode.c +0 -119
- package/node_modules/@maka/runtime/node_modules/@ai-sdk/code-mode/LICENSE +0 -13
- package/node_modules/@maka/runtime/node_modules/@ai-sdk/code-mode/dist/code-mode-tool.js +0 -40
- package/node_modules/@maka/runtime/node_modules/@ai-sdk/gateway/LICENSE +0 -13
- package/node_modules/@maka/runtime/node_modules/@ai-sdk/provider/CHANGELOG.md +0 -1262
- package/node_modules/@maka/runtime/node_modules/@ai-sdk/provider/LICENSE +0 -13
- package/node_modules/@maka/runtime/node_modules/@ai-sdk/provider/README.md +0 -1
- package/node_modules/@maka/runtime/node_modules/@ai-sdk/provider/dist/index.js +0 -426
- package/node_modules/@maka/runtime/node_modules/@ai-sdk/provider/package.json +0 -63
- package/node_modules/@maka/runtime/node_modules/ai/LICENSE +0 -13
- package/node_modules/@maka/runtime/node_modules/ai/docs/07-reference/02-ai-sdk-ui/05-use-realtime.mdx +0 -247
- package/node_modules/@maka/runtime/node_modules/ai/docs/07-reference/05-ai-sdk-errors/index.mdx +0 -43
- package/node_modules/@modelcontextprotocol/client/dist/index-CHhhk6PQ.d.cts.map +0 -1
- package/node_modules/@modelcontextprotocol/client/dist/index-D4xIIEF6.d.mts.map +0 -1
- /package/node_modules/@ai-sdk/{anthropic/node_modules/@ai-sdk/provider → code-mode}/LICENSE +0 -0
- /package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/README.md +0 -0
- /package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/dist/approval.js +0 -0
- /package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/dist/continuation-capability.js +0 -0
- /package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/dist/direct-tool-call.js +0 -0
- /package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/dist/host-interrupt.js +0 -0
- /package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/dist/index.js +0 -0
- /package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/dist/run-code-mode.js +0 -0
- /package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/dist/tool-invocation.js +0 -0
- /package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/dist/types.js +0 -0
- /package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/dist/utils/serialization.js +0 -0
- /package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/src/tsconfig.json +0 -0
- /package/node_modules/@ai-sdk/{cohere/node_modules/@ai-sdk/provider → gateway}/LICENSE +0 -0
- /package/node_modules/@ai-sdk/{google/node_modules/@ai-sdk/provider → provider}/LICENSE +0 -0
- /package/node_modules/@ai-sdk/{anthropic/node_modules/@ai-sdk/provider → provider}/README.md +0 -0
- /package/node_modules/@modelcontextprotocol/{core → client/node_modules/@modelcontextprotocol/core}/LICENSE +0 -0
- /package/node_modules/@modelcontextprotocol/{core → client/node_modules/@modelcontextprotocol/core}/README.md +0 -0
- /package/node_modules/@modelcontextprotocol/{core → client/node_modules/@modelcontextprotocol/core}/dist/internal.d.cts.map +0 -0
- /package/node_modules/@modelcontextprotocol/{core → client/node_modules/@modelcontextprotocol/core}/dist/internal.d.mts.map +0 -0
- /package/node_modules/{@ai-sdk/open-responses/node_modules/@ai-sdk/provider → ai}/LICENSE +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-foundations/01-overview.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-foundations/05-streaming.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-foundations/index.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-getting-started/01-navigating-the-library.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-getting-started/index.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-agents/01-overview.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-agents/06-subagents.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-agents/index.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/01-overview.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/10-generating-structured-data.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/17-runtime-and-tool-context.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/25-settings.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/30-embeddings.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/36-translation.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/38-video-generation.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/50-error-handling.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-harnesses/index.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/04-generative-user-interfaces.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/20-streaming-data.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/24-reading-ui-message-streams.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/25-message-metadata.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/50-stream-protocol.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/index.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/05-ai-sdk-rsc/01-overview.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/05-ai-sdk-rsc/03-generative-ui-state.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/05-ai-sdk-rsc/03-saving-and-restoring-states.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/05-ai-sdk-rsc/05-streaming-values.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/05-ai-sdk-rsc/08-error-handling.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/05-ai-sdk-rsc/09-authentication.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/05-ai-sdk-rsc/index.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/06-advanced/01-prompt-engineering.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/06-advanced/03-backpressure.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/06-advanced/05-multiple-streamables.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/06-advanced/06-rate-limiting.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/06-advanced/07-rendering-ui-with-language-models.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/06-advanced/08-model-as-router.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/06-advanced/09-multistep-interfaces.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/06-advanced/09-sequential-generations.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/06-advanced/10-vercel-deployment-guide.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/06-advanced/index.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/05-embed.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/06-embed-many.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/10-generate-image.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/11-stream-transcribe.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/11-stream-translate.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/13-generate-video.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/14-upload-file.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/14-upload-skill.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/15-agent.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/17-create-agent-ui-stream.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/18-create-agent-ui-stream-response.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/18-pipe-agent-ui-stream-to-response.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/21-get-batch-status.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/22-get-batch-results.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/23-cancel-batch.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/23-create-mcp-client.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/23-get-realtime-tool-definitions.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/24-list-batches.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/24-mcp-apps.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/24-mcp-stdio-transport.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/25-json-schema.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/26-zod-schema.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/27-valibot-schema.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/28-output.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/29-filter-active-tools.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/30-model-message.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/31-ui-message.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/34-sandbox.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/50-cosine-similarity.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/65-language-model-v2-middleware.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/66-extract-reasoning-middleware.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/67-simulate-streaming-middleware.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/68-default-instructions-middleware.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/68-default-settings-middleware.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/69-add-tool-input-examples-middleware.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/70-extract-json-middleware.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/70-is-step-count.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/71-has-tool-call.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/72-loop-finished.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/75-simulate-readable-stream.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/80-smooth-stream.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/90-generate-id.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/91-create-id-generator.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/92-default-generated-file.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/02-use-completion.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/32-prune-messages.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/41-create-ui-message-stream-response.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/42-pipe-ui-message-stream-to-response.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/43-read-ui-message-stream.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/46-infer-ui-tools.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/47-infer-ui-tool.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/48-mcp-app-renderer.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/index.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/03-ai-sdk-rsc/04-create-streamable-value.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/03-ai-sdk-rsc/05-read-streamable-value.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/03-ai-sdk-rsc/06-get-ai-state.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/03-ai-sdk-rsc/07-get-mutable-ai-state.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/03-ai-sdk-rsc/08-use-ai-state.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/03-ai-sdk-rsc/09-use-actions.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/03-ai-sdk-rsc/10-use-ui-state.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/03-ai-sdk-rsc/11-use-streamable-value.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/03-ai-sdk-rsc/20-render.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/03-ai-sdk-rsc/index.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/04-ai-sdk-workflow/03-generate-video.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/04-ai-sdk-workflow/index.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-download-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-empty-response-body-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-argument-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-data-content-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-message-role-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-prompt-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-response-data-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-tool-approval-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-tool-approval-signature-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-tool-input-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-json-parse-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-load-api-key-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-load-setting-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-message-conversion-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-no-content-generated-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-no-image-generated-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-no-object-generated-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-no-output-generated-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-no-speech-generated-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-no-such-provider-reference-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-no-such-tool-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-no-transcript-generated-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-no-translation-generated-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-no-video-generated-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-retry-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-stream-provider-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-too-many-embedding-values-for-call-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-tool-call-not-found-for-approval-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-tool-call-repair-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-tool-choice-violation-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-type-validation-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-unsupported-functionality-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/06-ai-sdk-tui/index.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/index.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/08-migration-guides/00-versioning.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/08-migration-guides/23-migration-guide-7-0.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/08-migration-guides/24-migration-guide-6-0.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/08-migration-guides/25-migration-guide-5-0-data.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/08-migration-guides/26-migration-guide-5-0.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/08-migration-guides/27-migration-guide-4-2.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/08-migration-guides/28-migration-guide-4-1.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/08-migration-guides/36-migration-guide-3-4.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/08-migration-guides/38-migration-guide-3-2.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/08-migration-guides/39-migration-guide-3-1.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/08-migration-guides/index.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/01-azure-stream-slow.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/03-server-actions-in-client-components.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/04-strange-stream-output.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/05-streamable-ui-errors.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/05-tool-invocation-missing-result.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/06-streaming-not-working-when-deployed.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/06-streaming-not-working-when-proxied.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/06-timeout-on-vercel.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/07-unclosed-streams.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/08-use-chat-failed-to-parse-stream.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/09-client-stream-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/10-use-chat-tools-no-response.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/12-typescript-performance-zod.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/12-use-chat-an-error-occurred.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/14-stream-abort-handling.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/14-tool-calling-with-structured-outputs.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/15-abort-breaks-resumable-streams.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/15-stream-text-not-working.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/16-streaming-status-delay.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/18-ontoolcall-type-narrowing.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/19-unsupported-model-version.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/20-no-object-generated-content-filter.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/21-missing-tool-results-error.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/30-model-is-not-assignable-to-type.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/40-typescript-cannot-find-namespace-jsx.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/50-react-maximum-update-depth-exceeded.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/60-jest-cannot-find-module-ai-rsc.mdx +0 -0
- /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/index.mdx +0 -0
|
@@ -61,7 +61,6 @@ var AnthropicFiles = class {
|
|
|
61
61
|
abortSignal,
|
|
62
62
|
headers
|
|
63
63
|
}) {
|
|
64
|
-
var _a, _b;
|
|
65
64
|
const fileBytes = convertInlineFileDataToUint8Array(data);
|
|
66
65
|
const blob = new Blob([fileBytes], { type: mediaType });
|
|
67
66
|
const formData = new FormData();
|
|
@@ -88,8 +87,8 @@ var AnthropicFiles = class {
|
|
|
88
87
|
return {
|
|
89
88
|
warnings: [],
|
|
90
89
|
providerReference: { anthropic: response.id },
|
|
91
|
-
mediaType:
|
|
92
|
-
filename:
|
|
90
|
+
mediaType: response.mime_type ?? mediaType,
|
|
91
|
+
filename: response.filename ?? filename,
|
|
93
92
|
providerMetadata: {
|
|
94
93
|
anthropic: {
|
|
95
94
|
filename: response.filename,
|
|
@@ -106,6 +105,7 @@ var AnthropicFiles = class {
|
|
|
106
105
|
// src/anthropic-language-model.ts
|
|
107
106
|
import {
|
|
108
107
|
APICallError,
|
|
108
|
+
InvalidArgumentError,
|
|
109
109
|
InvalidResponseDataError
|
|
110
110
|
} from "@ai-sdk/provider";
|
|
111
111
|
import {
|
|
@@ -141,6 +141,20 @@ var anthropicStopDetailsSchema = z3.object({
|
|
|
141
141
|
explanation: z3.string().nullish(),
|
|
142
142
|
recommended_model: z3.string().nullish()
|
|
143
143
|
});
|
|
144
|
+
var anthropicSafeguardResultSchema = z3.object({
|
|
145
|
+
type: z3.string(),
|
|
146
|
+
status: z3.object({
|
|
147
|
+
type: z3.string(),
|
|
148
|
+
tool_uses: z3.record(
|
|
149
|
+
z3.string(),
|
|
150
|
+
z3.object({
|
|
151
|
+
type: z3.string(),
|
|
152
|
+
outcome: z3.string().nullish(),
|
|
153
|
+
explanation: z3.string().nullish()
|
|
154
|
+
})
|
|
155
|
+
).nullish()
|
|
156
|
+
})
|
|
157
|
+
});
|
|
144
158
|
var anthropicToolCallCallerSchema = z3.union([
|
|
145
159
|
z3.object({
|
|
146
160
|
type: z3.literal("code_execution_20250825"),
|
|
@@ -243,7 +257,8 @@ var anthropicResponseSchema = lazySchema3(
|
|
|
243
257
|
}),
|
|
244
258
|
z3.object({
|
|
245
259
|
type: z3.literal("compaction"),
|
|
246
|
-
content: z3.string()
|
|
260
|
+
content: z3.string().nullish(),
|
|
261
|
+
signature: z3.string().nullish()
|
|
247
262
|
}),
|
|
248
263
|
z3.object({
|
|
249
264
|
type: z3.literal("tool_use"),
|
|
@@ -251,7 +266,9 @@ var anthropicResponseSchema = lazySchema3(
|
|
|
251
266
|
name: z3.string(),
|
|
252
267
|
input: z3.unknown(),
|
|
253
268
|
// Programmatic tool calling: caller info when triggered from code execution
|
|
254
|
-
caller: anthropicToolCallCallerSchema.optional()
|
|
269
|
+
caller: anthropicToolCallCallerSchema.optional(),
|
|
270
|
+
// Toolsets (e.g. computer toolset): name of the toolset this member call belongs to
|
|
271
|
+
toolset_name: z3.string().nullish()
|
|
255
272
|
}),
|
|
256
273
|
z3.object({
|
|
257
274
|
type: z3.literal("server_tool_use"),
|
|
@@ -474,6 +491,7 @@ var anthropicResponseSchema = lazySchema3(
|
|
|
474
491
|
stop_sequence: z3.string().nullish(),
|
|
475
492
|
stop_details: anthropicStopDetailsSchema.nullish(),
|
|
476
493
|
input_transformations: z3.array(anthropicInputTransformationSchema).nullish(),
|
|
494
|
+
safeguard_results: z3.array(anthropicSafeguardResultSchema).nullish(),
|
|
477
495
|
usage: z3.looseObject({
|
|
478
496
|
input_tokens: z3.number(),
|
|
479
497
|
output_tokens: z3.number(),
|
|
@@ -553,7 +571,8 @@ var anthropicChunkSchema = lazySchema3(
|
|
|
553
571
|
id: z3.string(),
|
|
554
572
|
name: z3.string(),
|
|
555
573
|
input: z3.unknown(),
|
|
556
|
-
caller: anthropicToolCallCallerSchema.optional()
|
|
574
|
+
caller: anthropicToolCallCallerSchema.optional(),
|
|
575
|
+
toolset_name: z3.string().nullish()
|
|
557
576
|
})
|
|
558
577
|
])
|
|
559
578
|
).nullish(),
|
|
@@ -584,7 +603,9 @@ var anthropicChunkSchema = lazySchema3(
|
|
|
584
603
|
// Programmatic tool calling: input may be present directly for deferred tool calls
|
|
585
604
|
input: z3.record(z3.string(), z3.unknown()).optional(),
|
|
586
605
|
// Programmatic tool calling: caller info when triggered from code execution
|
|
587
|
-
caller: anthropicToolCallCallerSchema.optional()
|
|
606
|
+
caller: anthropicToolCallCallerSchema.optional(),
|
|
607
|
+
// Toolsets (e.g. computer toolset): name of the toolset this member call belongs to
|
|
608
|
+
toolset_name: z3.string().nullish()
|
|
588
609
|
}),
|
|
589
610
|
z3.object({
|
|
590
611
|
type: z3.literal("redacted_thinking"),
|
|
@@ -592,7 +613,8 @@ var anthropicChunkSchema = lazySchema3(
|
|
|
592
613
|
}),
|
|
593
614
|
z3.object({
|
|
594
615
|
type: z3.literal("compaction"),
|
|
595
|
-
content: z3.string().nullish()
|
|
616
|
+
content: z3.string().nullish(),
|
|
617
|
+
signature: z3.string().nullish()
|
|
596
618
|
}),
|
|
597
619
|
z3.object({
|
|
598
620
|
type: z3.literal("server_tool_use"),
|
|
@@ -857,6 +879,7 @@ var anthropicChunkSchema = lazySchema3(
|
|
|
857
879
|
stop_reason: z3.string().nullish(),
|
|
858
880
|
stop_sequence: z3.string().nullish(),
|
|
859
881
|
stop_details: anthropicStopDetailsSchema.nullish(),
|
|
882
|
+
safeguard_results: z3.array(anthropicSafeguardResultSchema).nullish(),
|
|
860
883
|
container: z3.object({
|
|
861
884
|
expires_at: z3.string(),
|
|
862
885
|
id: z3.string(),
|
|
@@ -975,9 +998,10 @@ var anthropicSystemMessageProviderOptions = z4.object({
|
|
|
975
998
|
*/
|
|
976
999
|
clearAt: z4.literal("next_user_message").optional(),
|
|
977
1000
|
/**
|
|
978
|
-
* Sets the model effort
|
|
979
|
-
*
|
|
980
|
-
*
|
|
1001
|
+
* Sets the model effort from the next user turn until a later message
|
|
1002
|
+
* changes it. An effort-only system message with empty content can appear
|
|
1003
|
+
* first. The required `mid-conversation-output-config-2026-07-01` beta is
|
|
1004
|
+
* added automatically.
|
|
981
1005
|
*/
|
|
982
1006
|
effort: z4.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
983
1007
|
/**
|
|
@@ -1027,6 +1051,14 @@ var anthropicLanguageModelOptions = z4.object({
|
|
|
1027
1051
|
*
|
|
1028
1052
|
* When enabled, responses include thinking content blocks showing Claude's thinking process before the final answer.
|
|
1029
1053
|
* Requires a minimum budget of 1,024 tokens and counts towards the `max_tokens` limit.
|
|
1054
|
+
*
|
|
1055
|
+
* Models that always use adaptive thinking (e.g. `claude-opus-5-5`,
|
|
1056
|
+
* `claude-fable-5-1`) reject `enabled` and `disabled`. For those models the
|
|
1057
|
+
* provider drops the unsupported setting, emits a warning, and sends an
|
|
1058
|
+
* adaptive thinking request. Use `effort` to control how much they think.
|
|
1059
|
+
*
|
|
1060
|
+
* `claude-sonnet-5-5` supports `between_tools`, its lowest thinking setting,
|
|
1061
|
+
* and the provider uses it in place of `disabled` for that model.
|
|
1030
1062
|
*/
|
|
1031
1063
|
thinking: z4.union([
|
|
1032
1064
|
z4.discriminatedUnion("type", [
|
|
@@ -1055,6 +1087,14 @@ var anthropicLanguageModelOptions = z4.object({
|
|
|
1055
1087
|
}),
|
|
1056
1088
|
z4.object({
|
|
1057
1089
|
type: z4.literal("disabled")
|
|
1090
|
+
}),
|
|
1091
|
+
z4.object({
|
|
1092
|
+
/**
|
|
1093
|
+
* for `claude-sonnet-5-5`: no upfront thinking, but progress notes
|
|
1094
|
+
* between tool calls are returned as summarized thinking blocks.
|
|
1095
|
+
* Only supported at `low`, `medium`, and `high` effort.
|
|
1096
|
+
*/
|
|
1097
|
+
type: z4.literal("between_tools")
|
|
1058
1098
|
})
|
|
1059
1099
|
]),
|
|
1060
1100
|
z4.object({
|
|
@@ -1139,7 +1179,11 @@ var anthropicLanguageModelOptions = z4.object({
|
|
|
1139
1179
|
*/
|
|
1140
1180
|
toolStreaming: z4.boolean().optional(),
|
|
1141
1181
|
/**
|
|
1142
|
-
*
|
|
1182
|
+
* Controls how much effort the model spends on thinking, text responses,
|
|
1183
|
+
* and tool calls. On models that always use adaptive thinking
|
|
1184
|
+
* (e.g. `claude-opus-5-5`), effort is the main lever for latency and cost.
|
|
1185
|
+
*
|
|
1186
|
+
* The API default is `high` for most models and `medium` for `claude-opus-5-5`.
|
|
1143
1187
|
*/
|
|
1144
1188
|
effort: z4.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
1145
1189
|
/**
|
|
@@ -1205,6 +1249,32 @@ var anthropicLanguageModelOptions = z4.object({
|
|
|
1205
1249
|
* Allow a provider to receive the full `betas` set if it needs it.
|
|
1206
1250
|
*/
|
|
1207
1251
|
anthropicBeta: z4.array(z4.string()).optional(),
|
|
1252
|
+
/**
|
|
1253
|
+
* Server-side safeguards to run as part of the request.
|
|
1254
|
+
*
|
|
1255
|
+
* `dangerous_tool_use` asks the API to classify every `tool_use` block in
|
|
1256
|
+
* the response for dangerous actions (the check Claude Code's auto mode
|
|
1257
|
+
* relies on). The per-call verdicts are returned in
|
|
1258
|
+
* `providerMetadata.anthropic.safeguardResults`, keyed by tool call id.
|
|
1259
|
+
* `classifierContext` is passed through to the API as `classifier_context`.
|
|
1260
|
+
* The `dangerous-tool-use-2026-09-03` beta is added automatically.
|
|
1261
|
+
*/
|
|
1262
|
+
safeguards: z4.array(
|
|
1263
|
+
z4.object({
|
|
1264
|
+
type: z4.literal("dangerous_tool_use"),
|
|
1265
|
+
classifierContext: z4.record(z4.string(), z4.unknown()).optional()
|
|
1266
|
+
})
|
|
1267
|
+
).optional(),
|
|
1268
|
+
/**
|
|
1269
|
+
* Requests an on-demand summary of the supplied conversation.
|
|
1270
|
+
*
|
|
1271
|
+
* The required `compact-2026-09-04` beta is added automatically.
|
|
1272
|
+
* Cannot be combined with `contextManagement`.
|
|
1273
|
+
*/
|
|
1274
|
+
compaction: z4.object({
|
|
1275
|
+
type: z4.literal("summarize"),
|
|
1276
|
+
instructions: z4.string().optional()
|
|
1277
|
+
}).optional(),
|
|
1208
1278
|
contextManagement: z4.object({
|
|
1209
1279
|
edits: z4.array(
|
|
1210
1280
|
z4.discriminatedUnion("type", [
|
|
@@ -1263,9 +1333,8 @@ import {
|
|
|
1263
1333
|
// src/get-cache-control.ts
|
|
1264
1334
|
var MAX_CACHE_BREAKPOINTS = 4;
|
|
1265
1335
|
function getCacheControl(providerMetadata) {
|
|
1266
|
-
|
|
1267
|
-
const
|
|
1268
|
-
const cacheControlValue = (_a = anthropic == null ? void 0 : anthropic.cacheControl) != null ? _a : anthropic == null ? void 0 : anthropic.cache_control;
|
|
1336
|
+
const anthropic = providerMetadata?.anthropic;
|
|
1337
|
+
const cacheControlValue = anthropic?.cacheControl ?? anthropic?.cache_control;
|
|
1269
1338
|
return cacheControlValue;
|
|
1270
1339
|
}
|
|
1271
1340
|
var CacheControlValidator = class {
|
|
@@ -1355,103 +1424,114 @@ var advisor_20260301 = (args) => {
|
|
|
1355
1424
|
return factory(args);
|
|
1356
1425
|
};
|
|
1357
1426
|
|
|
1358
|
-
// src/tool/
|
|
1427
|
+
// src/tool/computer-toolset_20260801.ts
|
|
1359
1428
|
import {
|
|
1360
1429
|
createProviderDefinedToolFactory,
|
|
1361
1430
|
lazySchema as lazySchema5,
|
|
1362
1431
|
zodSchema as zodSchema5
|
|
1363
1432
|
} from "@ai-sdk/provider-utils";
|
|
1364
1433
|
import { z as z6 } from "zod/v4";
|
|
1365
|
-
var
|
|
1434
|
+
var computerToolset_20260801Members = [
|
|
1435
|
+
"screenshot",
|
|
1436
|
+
"zoom",
|
|
1437
|
+
"left_click",
|
|
1438
|
+
"right_click",
|
|
1439
|
+
"middle_click",
|
|
1440
|
+
"double_click",
|
|
1441
|
+
"triple_click",
|
|
1442
|
+
"left_click_drag",
|
|
1443
|
+
"mouse_move",
|
|
1444
|
+
"left_mouse_down",
|
|
1445
|
+
"left_mouse_up",
|
|
1446
|
+
"cursor_position",
|
|
1447
|
+
"scroll",
|
|
1448
|
+
"type",
|
|
1449
|
+
"key",
|
|
1450
|
+
"hold_key",
|
|
1451
|
+
"wait"
|
|
1452
|
+
];
|
|
1453
|
+
var computerToolset_20260801InputSchema = lazySchema5(
|
|
1366
1454
|
() => zodSchema5(
|
|
1367
1455
|
z6.object({
|
|
1368
|
-
|
|
1456
|
+
action: z6.enum(computerToolset_20260801Members),
|
|
1457
|
+
coordinate: z6.tuple([z6.number().int(), z6.number().int()]).optional(),
|
|
1458
|
+
duration: z6.number().optional(),
|
|
1459
|
+
region: z6.tuple([
|
|
1460
|
+
z6.number().int(),
|
|
1461
|
+
z6.number().int(),
|
|
1462
|
+
z6.number().int(),
|
|
1463
|
+
z6.number().int()
|
|
1464
|
+
]).optional(),
|
|
1465
|
+
repeat: z6.number().int().optional(),
|
|
1466
|
+
scroll_amount: z6.number().optional(),
|
|
1467
|
+
scroll_direction: z6.enum(["up", "down", "left", "right"]).optional(),
|
|
1468
|
+
start_coordinate: z6.tuple([z6.number().int(), z6.number().int()]).optional(),
|
|
1469
|
+
text: z6.string().optional()
|
|
1369
1470
|
})
|
|
1370
1471
|
)
|
|
1371
1472
|
);
|
|
1372
|
-
var
|
|
1473
|
+
var computerToolset_20260801ArgsSchema = lazySchema5(
|
|
1373
1474
|
() => zodSchema5(
|
|
1374
1475
|
z6.object({
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
view_range: z6.array(z6.number().int()).optional()
|
|
1476
|
+
configs: z6.partialRecord(
|
|
1477
|
+
z6.enum(computerToolset_20260801Members),
|
|
1478
|
+
z6.object({
|
|
1479
|
+
enabled: z6.boolean().optional(),
|
|
1480
|
+
deferLoading: z6.boolean().optional()
|
|
1481
|
+
})
|
|
1482
|
+
).optional()
|
|
1383
1483
|
})
|
|
1384
1484
|
)
|
|
1385
1485
|
);
|
|
1386
|
-
var
|
|
1387
|
-
id: "anthropic.
|
|
1388
|
-
inputSchema:
|
|
1486
|
+
var computerToolset_20260801 = createProviderDefinedToolFactory({
|
|
1487
|
+
id: "anthropic.computer_toolset_20260801",
|
|
1488
|
+
inputSchema: computerToolset_20260801InputSchema
|
|
1389
1489
|
});
|
|
1390
|
-
var textEditor_20250728 = (args = {}) => {
|
|
1391
|
-
return factory2(args);
|
|
1392
|
-
};
|
|
1393
1490
|
|
|
1394
|
-
// src/tool/
|
|
1491
|
+
// src/tool/text-editor_20250728.ts
|
|
1395
1492
|
import {
|
|
1396
|
-
|
|
1493
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory2,
|
|
1397
1494
|
lazySchema as lazySchema6,
|
|
1398
1495
|
zodSchema as zodSchema6
|
|
1399
1496
|
} from "@ai-sdk/provider-utils";
|
|
1400
1497
|
import { z as z7 } from "zod/v4";
|
|
1401
|
-
var
|
|
1498
|
+
var textEditor_20250728ArgsSchema = lazySchema6(
|
|
1402
1499
|
() => zodSchema6(
|
|
1403
1500
|
z7.object({
|
|
1404
|
-
|
|
1405
|
-
allowedDomains: z7.array(z7.string()).optional(),
|
|
1406
|
-
blockedDomains: z7.array(z7.string()).optional(),
|
|
1407
|
-
userLocation: z7.object({
|
|
1408
|
-
type: z7.literal("approximate"),
|
|
1409
|
-
city: z7.string().optional(),
|
|
1410
|
-
region: z7.string().optional(),
|
|
1411
|
-
country: z7.string().optional(),
|
|
1412
|
-
timezone: z7.string().optional()
|
|
1413
|
-
}).optional()
|
|
1501
|
+
maxCharacters: z7.number().optional()
|
|
1414
1502
|
})
|
|
1415
1503
|
)
|
|
1416
1504
|
);
|
|
1417
|
-
var
|
|
1418
|
-
() => zodSchema6(
|
|
1419
|
-
z7.array(
|
|
1420
|
-
z7.object({
|
|
1421
|
-
url: z7.string(),
|
|
1422
|
-
title: z7.string().nullable(),
|
|
1423
|
-
pageAge: z7.string().nullable(),
|
|
1424
|
-
encryptedContent: z7.string(),
|
|
1425
|
-
type: z7.literal("web_search_result")
|
|
1426
|
-
})
|
|
1427
|
-
)
|
|
1428
|
-
)
|
|
1429
|
-
);
|
|
1430
|
-
var webSearch_20260209InputSchema = lazySchema6(
|
|
1505
|
+
var textEditor_20250728InputSchema = lazySchema6(
|
|
1431
1506
|
() => zodSchema6(
|
|
1432
1507
|
z7.object({
|
|
1433
|
-
|
|
1508
|
+
command: z7.enum(["view", "create", "str_replace", "insert"]),
|
|
1509
|
+
path: z7.string(),
|
|
1510
|
+
file_text: z7.string().optional(),
|
|
1511
|
+
insert_line: z7.number().int().optional(),
|
|
1512
|
+
new_str: z7.string().optional(),
|
|
1513
|
+
insert_text: z7.string().optional(),
|
|
1514
|
+
old_str: z7.string().optional(),
|
|
1515
|
+
view_range: z7.array(z7.number().int()).optional()
|
|
1434
1516
|
})
|
|
1435
1517
|
)
|
|
1436
1518
|
);
|
|
1437
|
-
var
|
|
1438
|
-
id: "anthropic.
|
|
1439
|
-
inputSchema:
|
|
1440
|
-
outputSchema: webSearch_20260209OutputSchema,
|
|
1441
|
-
supportsDeferredResults: true
|
|
1519
|
+
var factory2 = createProviderDefinedToolFactory2({
|
|
1520
|
+
id: "anthropic.text_editor_20250728",
|
|
1521
|
+
inputSchema: textEditor_20250728InputSchema
|
|
1442
1522
|
});
|
|
1443
|
-
var
|
|
1444
|
-
return
|
|
1523
|
+
var textEditor_20250728 = (args = {}) => {
|
|
1524
|
+
return factory2(args);
|
|
1445
1525
|
};
|
|
1446
1526
|
|
|
1447
|
-
// src/tool/web-
|
|
1527
|
+
// src/tool/web-search_20260318.ts
|
|
1448
1528
|
import {
|
|
1449
|
-
createProviderExecutedToolFactory as
|
|
1529
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory2,
|
|
1450
1530
|
lazySchema as lazySchema7,
|
|
1451
1531
|
zodSchema as zodSchema7
|
|
1452
1532
|
} from "@ai-sdk/provider-utils";
|
|
1453
1533
|
import { z as z8 } from "zod/v4";
|
|
1454
|
-
var
|
|
1534
|
+
var webSearch_20260318ArgsSchema = lazySchema7(
|
|
1455
1535
|
() => zodSchema7(
|
|
1456
1536
|
z8.object({
|
|
1457
1537
|
maxUses: z8.number().optional(),
|
|
@@ -1463,11 +1543,12 @@ var webSearch_20250305ArgsSchema = lazySchema7(
|
|
|
1463
1543
|
region: z8.string().optional(),
|
|
1464
1544
|
country: z8.string().optional(),
|
|
1465
1545
|
timezone: z8.string().optional()
|
|
1466
|
-
}).optional()
|
|
1546
|
+
}).optional(),
|
|
1547
|
+
responseInclusion: z8.enum(["full", "excluded"]).optional()
|
|
1467
1548
|
})
|
|
1468
1549
|
)
|
|
1469
1550
|
);
|
|
1470
|
-
var
|
|
1551
|
+
var webSearch_20260318OutputSchema = lazySchema7(
|
|
1471
1552
|
() => zodSchema7(
|
|
1472
1553
|
z8.array(
|
|
1473
1554
|
z8.object({
|
|
@@ -1480,143 +1561,312 @@ var webSearch_20250305OutputSchema = lazySchema7(
|
|
|
1480
1561
|
)
|
|
1481
1562
|
)
|
|
1482
1563
|
);
|
|
1483
|
-
var
|
|
1564
|
+
var webSearch_20260318InputSchema = lazySchema7(
|
|
1484
1565
|
() => zodSchema7(
|
|
1485
1566
|
z8.object({
|
|
1486
1567
|
query: z8.string()
|
|
1487
1568
|
})
|
|
1488
1569
|
)
|
|
1489
1570
|
);
|
|
1490
|
-
var
|
|
1491
|
-
id: "anthropic.
|
|
1492
|
-
inputSchema:
|
|
1493
|
-
outputSchema:
|
|
1571
|
+
var factory3 = createProviderExecutedToolFactory2({
|
|
1572
|
+
id: "anthropic.web_search_20260318",
|
|
1573
|
+
inputSchema: webSearch_20260318InputSchema,
|
|
1574
|
+
outputSchema: webSearch_20260318OutputSchema,
|
|
1494
1575
|
supportsDeferredResults: true
|
|
1495
1576
|
});
|
|
1496
|
-
var
|
|
1497
|
-
return
|
|
1577
|
+
var webSearch_20260318 = (args = {}) => {
|
|
1578
|
+
return factory3(args);
|
|
1498
1579
|
};
|
|
1499
1580
|
|
|
1500
|
-
// src/tool/web-
|
|
1581
|
+
// src/tool/web-search_20260209.ts
|
|
1501
1582
|
import {
|
|
1502
|
-
createProviderExecutedToolFactory as
|
|
1583
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory3,
|
|
1503
1584
|
lazySchema as lazySchema8,
|
|
1504
1585
|
zodSchema as zodSchema8
|
|
1505
1586
|
} from "@ai-sdk/provider-utils";
|
|
1506
1587
|
import { z as z9 } from "zod/v4";
|
|
1507
|
-
var
|
|
1588
|
+
var webSearch_20260209ArgsSchema = lazySchema8(
|
|
1508
1589
|
() => zodSchema8(
|
|
1509
1590
|
z9.object({
|
|
1510
1591
|
maxUses: z9.number().optional(),
|
|
1511
1592
|
allowedDomains: z9.array(z9.string()).optional(),
|
|
1512
1593
|
blockedDomains: z9.array(z9.string()).optional(),
|
|
1513
|
-
|
|
1514
|
-
|
|
1594
|
+
userLocation: z9.object({
|
|
1595
|
+
type: z9.literal("approximate"),
|
|
1596
|
+
city: z9.string().optional(),
|
|
1597
|
+
region: z9.string().optional(),
|
|
1598
|
+
country: z9.string().optional(),
|
|
1599
|
+
timezone: z9.string().optional()
|
|
1600
|
+
}).optional()
|
|
1515
1601
|
})
|
|
1516
1602
|
)
|
|
1517
1603
|
);
|
|
1518
|
-
var
|
|
1604
|
+
var webSearch_20260209OutputSchema = lazySchema8(
|
|
1519
1605
|
() => zodSchema8(
|
|
1520
|
-
z9.
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
content: z9.object({
|
|
1524
|
-
type: z9.literal("document"),
|
|
1606
|
+
z9.array(
|
|
1607
|
+
z9.object({
|
|
1608
|
+
url: z9.string(),
|
|
1525
1609
|
title: z9.string().nullable(),
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
data: z9.string()
|
|
1532
|
-
}),
|
|
1533
|
-
z9.object({
|
|
1534
|
-
type: z9.literal("text"),
|
|
1535
|
-
mediaType: z9.literal("text/plain"),
|
|
1536
|
-
data: z9.string()
|
|
1537
|
-
})
|
|
1538
|
-
])
|
|
1539
|
-
}),
|
|
1540
|
-
retrievedAt: z9.string().nullable()
|
|
1541
|
-
})
|
|
1610
|
+
pageAge: z9.string().nullable(),
|
|
1611
|
+
encryptedContent: z9.string(),
|
|
1612
|
+
type: z9.literal("web_search_result")
|
|
1613
|
+
})
|
|
1614
|
+
)
|
|
1542
1615
|
)
|
|
1543
1616
|
);
|
|
1544
|
-
var
|
|
1617
|
+
var webSearch_20260209InputSchema = lazySchema8(
|
|
1545
1618
|
() => zodSchema8(
|
|
1546
1619
|
z9.object({
|
|
1547
|
-
|
|
1620
|
+
query: z9.string()
|
|
1548
1621
|
})
|
|
1549
1622
|
)
|
|
1550
1623
|
);
|
|
1551
|
-
var
|
|
1552
|
-
id: "anthropic.
|
|
1553
|
-
inputSchema:
|
|
1554
|
-
outputSchema:
|
|
1624
|
+
var factory4 = createProviderExecutedToolFactory3({
|
|
1625
|
+
id: "anthropic.web_search_20260209",
|
|
1626
|
+
inputSchema: webSearch_20260209InputSchema,
|
|
1627
|
+
outputSchema: webSearch_20260209OutputSchema,
|
|
1555
1628
|
supportsDeferredResults: true
|
|
1556
1629
|
});
|
|
1557
|
-
var
|
|
1558
|
-
return
|
|
1630
|
+
var webSearch_20260209 = (args = {}) => {
|
|
1631
|
+
return factory4(args);
|
|
1559
1632
|
};
|
|
1560
1633
|
|
|
1561
|
-
// src/tool/web-
|
|
1634
|
+
// src/tool/web-search_20250305.ts
|
|
1562
1635
|
import {
|
|
1563
|
-
createProviderExecutedToolFactory as
|
|
1636
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory4,
|
|
1564
1637
|
lazySchema as lazySchema9,
|
|
1565
1638
|
zodSchema as zodSchema9
|
|
1566
1639
|
} from "@ai-sdk/provider-utils";
|
|
1567
1640
|
import { z as z10 } from "zod/v4";
|
|
1568
|
-
var
|
|
1641
|
+
var webSearch_20250305ArgsSchema = lazySchema9(
|
|
1569
1642
|
() => zodSchema9(
|
|
1570
1643
|
z10.object({
|
|
1571
1644
|
maxUses: z10.number().optional(),
|
|
1572
1645
|
allowedDomains: z10.array(z10.string()).optional(),
|
|
1573
1646
|
blockedDomains: z10.array(z10.string()).optional(),
|
|
1574
|
-
|
|
1575
|
-
|
|
1647
|
+
userLocation: z10.object({
|
|
1648
|
+
type: z10.literal("approximate"),
|
|
1649
|
+
city: z10.string().optional(),
|
|
1650
|
+
region: z10.string().optional(),
|
|
1651
|
+
country: z10.string().optional(),
|
|
1652
|
+
timezone: z10.string().optional()
|
|
1653
|
+
}).optional()
|
|
1576
1654
|
})
|
|
1577
1655
|
)
|
|
1578
1656
|
);
|
|
1579
|
-
var
|
|
1657
|
+
var webSearch_20250305OutputSchema = lazySchema9(
|
|
1580
1658
|
() => zodSchema9(
|
|
1581
|
-
z10.
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
content: z10.object({
|
|
1585
|
-
type: z10.literal("document"),
|
|
1659
|
+
z10.array(
|
|
1660
|
+
z10.object({
|
|
1661
|
+
url: z10.string(),
|
|
1586
1662
|
title: z10.string().nullable(),
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1663
|
+
pageAge: z10.string().nullable(),
|
|
1664
|
+
encryptedContent: z10.string(),
|
|
1665
|
+
type: z10.literal("web_search_result")
|
|
1666
|
+
})
|
|
1667
|
+
)
|
|
1668
|
+
)
|
|
1669
|
+
);
|
|
1670
|
+
var webSearch_20250305InputSchema = lazySchema9(
|
|
1671
|
+
() => zodSchema9(
|
|
1672
|
+
z10.object({
|
|
1673
|
+
query: z10.string()
|
|
1674
|
+
})
|
|
1675
|
+
)
|
|
1676
|
+
);
|
|
1677
|
+
var factory5 = createProviderExecutedToolFactory4({
|
|
1678
|
+
id: "anthropic.web_search_20250305",
|
|
1679
|
+
inputSchema: webSearch_20250305InputSchema,
|
|
1680
|
+
outputSchema: webSearch_20250305OutputSchema,
|
|
1681
|
+
supportsDeferredResults: true
|
|
1682
|
+
});
|
|
1683
|
+
var webSearch_20250305 = (args = {}) => {
|
|
1684
|
+
return factory5(args);
|
|
1685
|
+
};
|
|
1686
|
+
|
|
1687
|
+
// src/tool/web-fetch-20260318.ts
|
|
1688
|
+
import {
|
|
1689
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory5,
|
|
1690
|
+
lazySchema as lazySchema10,
|
|
1691
|
+
zodSchema as zodSchema10
|
|
1692
|
+
} from "@ai-sdk/provider-utils";
|
|
1693
|
+
import { z as z11 } from "zod/v4";
|
|
1694
|
+
var webFetch_20260318ArgsSchema = lazySchema10(
|
|
1695
|
+
() => zodSchema10(
|
|
1696
|
+
z11.object({
|
|
1697
|
+
maxUses: z11.number().optional(),
|
|
1698
|
+
allowedDomains: z11.array(z11.string()).optional(),
|
|
1699
|
+
blockedDomains: z11.array(z11.string()).optional(),
|
|
1700
|
+
citations: z11.object({ enabled: z11.boolean() }).optional(),
|
|
1701
|
+
maxContentTokens: z11.number().optional(),
|
|
1702
|
+
useCache: z11.boolean().optional(),
|
|
1703
|
+
responseInclusion: z11.enum(["full", "excluded"]).optional()
|
|
1704
|
+
})
|
|
1705
|
+
)
|
|
1706
|
+
);
|
|
1707
|
+
var webFetch_20260318OutputSchema = lazySchema10(
|
|
1708
|
+
() => zodSchema10(
|
|
1709
|
+
z11.object({
|
|
1710
|
+
type: z11.literal("web_fetch_result"),
|
|
1711
|
+
url: z11.string(),
|
|
1712
|
+
content: z11.object({
|
|
1713
|
+
type: z11.literal("document"),
|
|
1714
|
+
title: z11.string().nullable(),
|
|
1715
|
+
citations: z11.object({ enabled: z11.boolean() }).optional(),
|
|
1716
|
+
source: z11.union([
|
|
1717
|
+
z11.object({
|
|
1718
|
+
type: z11.literal("base64"),
|
|
1719
|
+
mediaType: z11.literal("application/pdf"),
|
|
1720
|
+
data: z11.string()
|
|
1593
1721
|
}),
|
|
1594
|
-
|
|
1595
|
-
type:
|
|
1596
|
-
mediaType:
|
|
1597
|
-
data:
|
|
1722
|
+
z11.object({
|
|
1723
|
+
type: z11.literal("text"),
|
|
1724
|
+
mediaType: z11.literal("text/plain"),
|
|
1725
|
+
data: z11.string()
|
|
1598
1726
|
})
|
|
1599
1727
|
])
|
|
1600
1728
|
}),
|
|
1601
|
-
retrievedAt:
|
|
1729
|
+
retrievedAt: z11.string().nullable()
|
|
1602
1730
|
})
|
|
1603
1731
|
)
|
|
1604
1732
|
);
|
|
1605
|
-
var
|
|
1606
|
-
() =>
|
|
1607
|
-
|
|
1608
|
-
url:
|
|
1733
|
+
var webFetch_20260318InputSchema = lazySchema10(
|
|
1734
|
+
() => zodSchema10(
|
|
1735
|
+
z11.object({
|
|
1736
|
+
url: z11.string()
|
|
1609
1737
|
})
|
|
1610
1738
|
)
|
|
1611
1739
|
);
|
|
1612
1740
|
var factory6 = createProviderExecutedToolFactory5({
|
|
1741
|
+
id: "anthropic.web_fetch_20260318",
|
|
1742
|
+
inputSchema: webFetch_20260318InputSchema,
|
|
1743
|
+
outputSchema: webFetch_20260318OutputSchema,
|
|
1744
|
+
supportsDeferredResults: true
|
|
1745
|
+
});
|
|
1746
|
+
var webFetch_20260318 = (args = {}) => {
|
|
1747
|
+
return factory6(args);
|
|
1748
|
+
};
|
|
1749
|
+
|
|
1750
|
+
// src/tool/web-fetch-20260209.ts
|
|
1751
|
+
import {
|
|
1752
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory6,
|
|
1753
|
+
lazySchema as lazySchema11,
|
|
1754
|
+
zodSchema as zodSchema11
|
|
1755
|
+
} from "@ai-sdk/provider-utils";
|
|
1756
|
+
import { z as z12 } from "zod/v4";
|
|
1757
|
+
var webFetch_20260209ArgsSchema = lazySchema11(
|
|
1758
|
+
() => zodSchema11(
|
|
1759
|
+
z12.object({
|
|
1760
|
+
maxUses: z12.number().optional(),
|
|
1761
|
+
allowedDomains: z12.array(z12.string()).optional(),
|
|
1762
|
+
blockedDomains: z12.array(z12.string()).optional(),
|
|
1763
|
+
citations: z12.object({ enabled: z12.boolean() }).optional(),
|
|
1764
|
+
maxContentTokens: z12.number().optional()
|
|
1765
|
+
})
|
|
1766
|
+
)
|
|
1767
|
+
);
|
|
1768
|
+
var webFetch_20260209OutputSchema = lazySchema11(
|
|
1769
|
+
() => zodSchema11(
|
|
1770
|
+
z12.object({
|
|
1771
|
+
type: z12.literal("web_fetch_result"),
|
|
1772
|
+
url: z12.string(),
|
|
1773
|
+
content: z12.object({
|
|
1774
|
+
type: z12.literal("document"),
|
|
1775
|
+
title: z12.string().nullable(),
|
|
1776
|
+
citations: z12.object({ enabled: z12.boolean() }).optional(),
|
|
1777
|
+
source: z12.union([
|
|
1778
|
+
z12.object({
|
|
1779
|
+
type: z12.literal("base64"),
|
|
1780
|
+
mediaType: z12.literal("application/pdf"),
|
|
1781
|
+
data: z12.string()
|
|
1782
|
+
}),
|
|
1783
|
+
z12.object({
|
|
1784
|
+
type: z12.literal("text"),
|
|
1785
|
+
mediaType: z12.literal("text/plain"),
|
|
1786
|
+
data: z12.string()
|
|
1787
|
+
})
|
|
1788
|
+
])
|
|
1789
|
+
}),
|
|
1790
|
+
retrievedAt: z12.string().nullable()
|
|
1791
|
+
})
|
|
1792
|
+
)
|
|
1793
|
+
);
|
|
1794
|
+
var webFetch_20260209InputSchema = lazySchema11(
|
|
1795
|
+
() => zodSchema11(
|
|
1796
|
+
z12.object({
|
|
1797
|
+
url: z12.string()
|
|
1798
|
+
})
|
|
1799
|
+
)
|
|
1800
|
+
);
|
|
1801
|
+
var factory7 = createProviderExecutedToolFactory6({
|
|
1802
|
+
id: "anthropic.web_fetch_20260209",
|
|
1803
|
+
inputSchema: webFetch_20260209InputSchema,
|
|
1804
|
+
outputSchema: webFetch_20260209OutputSchema,
|
|
1805
|
+
supportsDeferredResults: true
|
|
1806
|
+
});
|
|
1807
|
+
var webFetch_20260209 = (args = {}) => {
|
|
1808
|
+
return factory7(args);
|
|
1809
|
+
};
|
|
1810
|
+
|
|
1811
|
+
// src/tool/web-fetch-20250910.ts
|
|
1812
|
+
import {
|
|
1813
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory7,
|
|
1814
|
+
lazySchema as lazySchema12,
|
|
1815
|
+
zodSchema as zodSchema12
|
|
1816
|
+
} from "@ai-sdk/provider-utils";
|
|
1817
|
+
import { z as z13 } from "zod/v4";
|
|
1818
|
+
var webFetch_20250910ArgsSchema = lazySchema12(
|
|
1819
|
+
() => zodSchema12(
|
|
1820
|
+
z13.object({
|
|
1821
|
+
maxUses: z13.number().optional(),
|
|
1822
|
+
allowedDomains: z13.array(z13.string()).optional(),
|
|
1823
|
+
blockedDomains: z13.array(z13.string()).optional(),
|
|
1824
|
+
citations: z13.object({ enabled: z13.boolean() }).optional(),
|
|
1825
|
+
maxContentTokens: z13.number().optional()
|
|
1826
|
+
})
|
|
1827
|
+
)
|
|
1828
|
+
);
|
|
1829
|
+
var webFetch_20250910OutputSchema = lazySchema12(
|
|
1830
|
+
() => zodSchema12(
|
|
1831
|
+
z13.object({
|
|
1832
|
+
type: z13.literal("web_fetch_result"),
|
|
1833
|
+
url: z13.string(),
|
|
1834
|
+
content: z13.object({
|
|
1835
|
+
type: z13.literal("document"),
|
|
1836
|
+
title: z13.string().nullable(),
|
|
1837
|
+
citations: z13.object({ enabled: z13.boolean() }).optional(),
|
|
1838
|
+
source: z13.union([
|
|
1839
|
+
z13.object({
|
|
1840
|
+
type: z13.literal("base64"),
|
|
1841
|
+
mediaType: z13.literal("application/pdf"),
|
|
1842
|
+
data: z13.string()
|
|
1843
|
+
}),
|
|
1844
|
+
z13.object({
|
|
1845
|
+
type: z13.literal("text"),
|
|
1846
|
+
mediaType: z13.literal("text/plain"),
|
|
1847
|
+
data: z13.string()
|
|
1848
|
+
})
|
|
1849
|
+
])
|
|
1850
|
+
}),
|
|
1851
|
+
retrievedAt: z13.string().nullable()
|
|
1852
|
+
})
|
|
1853
|
+
)
|
|
1854
|
+
);
|
|
1855
|
+
var webFetch_20250910InputSchema = lazySchema12(
|
|
1856
|
+
() => zodSchema12(
|
|
1857
|
+
z13.object({
|
|
1858
|
+
url: z13.string()
|
|
1859
|
+
})
|
|
1860
|
+
)
|
|
1861
|
+
);
|
|
1862
|
+
var factory8 = createProviderExecutedToolFactory7({
|
|
1613
1863
|
id: "anthropic.web_fetch_20250910",
|
|
1614
1864
|
inputSchema: webFetch_20250910InputSchema,
|
|
1615
1865
|
outputSchema: webFetch_20250910OutputSchema,
|
|
1616
1866
|
supportsDeferredResults: true
|
|
1617
1867
|
});
|
|
1618
1868
|
var webFetch_20250910 = (args = {}) => {
|
|
1619
|
-
return
|
|
1869
|
+
return factory8(args);
|
|
1620
1870
|
};
|
|
1621
1871
|
|
|
1622
1872
|
// src/anthropic-prepare-tools.ts
|
|
@@ -1628,10 +1878,10 @@ async function prepareTools({
|
|
|
1628
1878
|
cacheControlValidator,
|
|
1629
1879
|
supportsStructuredOutput,
|
|
1630
1880
|
supportsStrictTools,
|
|
1631
|
-
defaultEagerInputStreaming = false
|
|
1881
|
+
defaultEagerInputStreaming = false,
|
|
1882
|
+
rejectsForcedToolUse = false
|
|
1632
1883
|
}) {
|
|
1633
|
-
|
|
1634
|
-
tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
|
|
1884
|
+
tools = tools?.length ? tools : void 0;
|
|
1635
1885
|
const toolWarnings = [];
|
|
1636
1886
|
const betas = /* @__PURE__ */ new Set();
|
|
1637
1887
|
const validator = cacheControlValidator || new CacheControlValidator();
|
|
@@ -1646,10 +1896,10 @@ async function prepareTools({
|
|
|
1646
1896
|
type: "tool definition",
|
|
1647
1897
|
canCache: true
|
|
1648
1898
|
});
|
|
1649
|
-
const anthropicOptions =
|
|
1650
|
-
const eagerInputStreaming =
|
|
1651
|
-
const deferLoading = anthropicOptions
|
|
1652
|
-
const allowedCallers = anthropicOptions
|
|
1899
|
+
const anthropicOptions = tool.providerOptions?.anthropic;
|
|
1900
|
+
const eagerInputStreaming = anthropicOptions?.eagerInputStreaming ?? defaultEagerInputStreaming;
|
|
1901
|
+
const deferLoading = anthropicOptions?.deferLoading;
|
|
1902
|
+
const allowedCallers = anthropicOptions?.allowedCallers;
|
|
1653
1903
|
if (!supportsStrictTools && tool.strict != null) {
|
|
1654
1904
|
toolWarnings.push({
|
|
1655
1905
|
type: "unsupported",
|
|
@@ -1731,6 +1981,31 @@ async function prepareTools({
|
|
|
1731
1981
|
});
|
|
1732
1982
|
break;
|
|
1733
1983
|
}
|
|
1984
|
+
case "anthropic.computer_toolset_20260801": {
|
|
1985
|
+
const args = await validateTypes({
|
|
1986
|
+
value: tool.args,
|
|
1987
|
+
schema: computerToolset_20260801ArgsSchema
|
|
1988
|
+
});
|
|
1989
|
+
const configs = args.configs != null ? Object.fromEntries(
|
|
1990
|
+
Object.entries(args.configs).map(([member, config]) => [
|
|
1991
|
+
member,
|
|
1992
|
+
{
|
|
1993
|
+
...config?.enabled != null && {
|
|
1994
|
+
enabled: config.enabled
|
|
1995
|
+
},
|
|
1996
|
+
...config?.deferLoading != null && {
|
|
1997
|
+
defer_loading: config.deferLoading
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
2000
|
+
])
|
|
2001
|
+
) : void 0;
|
|
2002
|
+
anthropicTools2.push({
|
|
2003
|
+
type: "computer_toolset_20260801",
|
|
2004
|
+
...configs != null && { configs },
|
|
2005
|
+
cache_control: void 0
|
|
2006
|
+
});
|
|
2007
|
+
break;
|
|
2008
|
+
}
|
|
1734
2009
|
case "anthropic.computer_20241022": {
|
|
1735
2010
|
betas.add("computer-use-2024-10-22");
|
|
1736
2011
|
anthropicTools2.push({
|
|
@@ -1845,6 +2120,25 @@ async function prepareTools({
|
|
|
1845
2120
|
});
|
|
1846
2121
|
break;
|
|
1847
2122
|
}
|
|
2123
|
+
case "anthropic.web_fetch_20260318": {
|
|
2124
|
+
const args = await validateTypes({
|
|
2125
|
+
value: tool.args,
|
|
2126
|
+
schema: webFetch_20260318ArgsSchema
|
|
2127
|
+
});
|
|
2128
|
+
anthropicTools2.push({
|
|
2129
|
+
type: "web_fetch_20260318",
|
|
2130
|
+
name: "web_fetch",
|
|
2131
|
+
max_uses: args.maxUses,
|
|
2132
|
+
allowed_domains: args.allowedDomains,
|
|
2133
|
+
blocked_domains: args.blockedDomains,
|
|
2134
|
+
citations: args.citations,
|
|
2135
|
+
max_content_tokens: args.maxContentTokens,
|
|
2136
|
+
use_cache: args.useCache,
|
|
2137
|
+
response_inclusion: args.responseInclusion,
|
|
2138
|
+
cache_control: void 0
|
|
2139
|
+
});
|
|
2140
|
+
break;
|
|
2141
|
+
}
|
|
1848
2142
|
case "anthropic.web_search_20250305": {
|
|
1849
2143
|
const args = await validateTypes({
|
|
1850
2144
|
value: tool.args,
|
|
@@ -1878,6 +2172,23 @@ async function prepareTools({
|
|
|
1878
2172
|
});
|
|
1879
2173
|
break;
|
|
1880
2174
|
}
|
|
2175
|
+
case "anthropic.web_search_20260318": {
|
|
2176
|
+
const args = await validateTypes({
|
|
2177
|
+
value: tool.args,
|
|
2178
|
+
schema: webSearch_20260318ArgsSchema
|
|
2179
|
+
});
|
|
2180
|
+
anthropicTools2.push({
|
|
2181
|
+
type: "web_search_20260318",
|
|
2182
|
+
name: "web_search",
|
|
2183
|
+
max_uses: args.maxUses,
|
|
2184
|
+
allowed_domains: args.allowedDomains,
|
|
2185
|
+
blocked_domains: args.blockedDomains,
|
|
2186
|
+
user_location: args.userLocation,
|
|
2187
|
+
response_inclusion: args.responseInclusion,
|
|
2188
|
+
cache_control: void 0
|
|
2189
|
+
});
|
|
2190
|
+
break;
|
|
2191
|
+
}
|
|
1881
2192
|
case "anthropic.tool_search_regex_20251119": {
|
|
1882
2193
|
anthropicTools2.push({
|
|
1883
2194
|
type: "tool_search_tool_regex_20251119",
|
|
@@ -1950,6 +2261,22 @@ async function prepareTools({
|
|
|
1950
2261
|
betas
|
|
1951
2262
|
};
|
|
1952
2263
|
case "required":
|
|
2264
|
+
if (rejectsForcedToolUse) {
|
|
2265
|
+
toolWarnings.push({
|
|
2266
|
+
type: "unsupported",
|
|
2267
|
+
feature: "toolChoice",
|
|
2268
|
+
details: `toolChoice 'required' is not supported by this model because it rejects forced tool use. Using 'auto' instead. Instruct the model to use a tool in the prompt and verify that a tool call was made.`
|
|
2269
|
+
});
|
|
2270
|
+
return {
|
|
2271
|
+
tools: anthropicTools2,
|
|
2272
|
+
toolChoice: {
|
|
2273
|
+
type: "auto",
|
|
2274
|
+
disable_parallel_tool_use: disableParallelToolUse
|
|
2275
|
+
},
|
|
2276
|
+
toolWarnings,
|
|
2277
|
+
betas
|
|
2278
|
+
};
|
|
2279
|
+
}
|
|
1953
2280
|
return {
|
|
1954
2281
|
tools: anthropicTools2,
|
|
1955
2282
|
toolChoice: {
|
|
@@ -1962,6 +2289,24 @@ async function prepareTools({
|
|
|
1962
2289
|
case "none":
|
|
1963
2290
|
return { tools: void 0, toolChoice: void 0, toolWarnings, betas };
|
|
1964
2291
|
case "tool":
|
|
2292
|
+
if (rejectsForcedToolUse) {
|
|
2293
|
+
toolWarnings.push({
|
|
2294
|
+
type: "unsupported",
|
|
2295
|
+
feature: "toolChoice",
|
|
2296
|
+
details: `toolChoice 'tool' is not supported by this model because it rejects forced tool use. Only the '${toolChoice.toolName}' tool is sent with 'auto' tool choice. Instruct the model to use the tool in the prompt and verify that a tool call was made.`
|
|
2297
|
+
});
|
|
2298
|
+
return {
|
|
2299
|
+
tools: anthropicTools2.filter(
|
|
2300
|
+
(tool) => "name" in tool && tool.name === toolChoice.toolName
|
|
2301
|
+
),
|
|
2302
|
+
toolChoice: {
|
|
2303
|
+
type: "auto",
|
|
2304
|
+
disable_parallel_tool_use: disableParallelToolUse
|
|
2305
|
+
},
|
|
2306
|
+
toolWarnings,
|
|
2307
|
+
betas
|
|
2308
|
+
};
|
|
2309
|
+
}
|
|
1965
2310
|
return {
|
|
1966
2311
|
tools: anthropicTools2,
|
|
1967
2312
|
toolChoice: {
|
|
@@ -1986,13 +2331,12 @@ function convertAnthropicUsage({
|
|
|
1986
2331
|
usage,
|
|
1987
2332
|
rawUsage
|
|
1988
2333
|
}) {
|
|
1989
|
-
|
|
1990
|
-
const
|
|
1991
|
-
const
|
|
1992
|
-
const reasoningTokens = (_d = (_c = usage.output_tokens_details) == null ? void 0 : _c.thinking_tokens) != null ? _d : void 0;
|
|
2334
|
+
const cacheCreationTokens = usage.cache_creation_input_tokens ?? 0;
|
|
2335
|
+
const cacheReadTokens = usage.cache_read_input_tokens ?? 0;
|
|
2336
|
+
const reasoningTokens = usage.output_tokens_details?.thinking_tokens ?? void 0;
|
|
1993
2337
|
let inputTokens;
|
|
1994
2338
|
let outputTokens;
|
|
1995
|
-
const servedByFallback =
|
|
2339
|
+
const servedByFallback = usage.iterations?.some(
|
|
1996
2340
|
(iter) => iter.type === "fallback_message"
|
|
1997
2341
|
);
|
|
1998
2342
|
if (usage.iterations && usage.iterations.length > 0 && !servedByFallback) {
|
|
@@ -2029,7 +2373,7 @@ function convertAnthropicUsage({
|
|
|
2029
2373
|
text: reasoningTokens == null ? void 0 : outputTokens - reasoningTokens,
|
|
2030
2374
|
reasoning: reasoningTokens
|
|
2031
2375
|
},
|
|
2032
|
-
raw: rawUsage
|
|
2376
|
+
raw: rawUsage ?? usage
|
|
2033
2377
|
};
|
|
2034
2378
|
}
|
|
2035
2379
|
|
|
@@ -2051,145 +2395,145 @@ import {
|
|
|
2051
2395
|
|
|
2052
2396
|
// src/tool/code-execution_20250522.ts
|
|
2053
2397
|
import {
|
|
2054
|
-
createProviderExecutedToolFactory as
|
|
2055
|
-
lazySchema as
|
|
2056
|
-
zodSchema as
|
|
2398
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory8,
|
|
2399
|
+
lazySchema as lazySchema13,
|
|
2400
|
+
zodSchema as zodSchema13
|
|
2057
2401
|
} from "@ai-sdk/provider-utils";
|
|
2058
|
-
import { z as
|
|
2059
|
-
var codeExecution_20250522OutputSchema =
|
|
2060
|
-
() =>
|
|
2061
|
-
|
|
2062
|
-
type:
|
|
2063
|
-
stdout:
|
|
2064
|
-
stderr:
|
|
2065
|
-
return_code:
|
|
2066
|
-
content:
|
|
2067
|
-
|
|
2068
|
-
type:
|
|
2069
|
-
file_id:
|
|
2402
|
+
import { z as z14 } from "zod/v4";
|
|
2403
|
+
var codeExecution_20250522OutputSchema = lazySchema13(
|
|
2404
|
+
() => zodSchema13(
|
|
2405
|
+
z14.object({
|
|
2406
|
+
type: z14.literal("code_execution_result"),
|
|
2407
|
+
stdout: z14.string(),
|
|
2408
|
+
stderr: z14.string(),
|
|
2409
|
+
return_code: z14.number(),
|
|
2410
|
+
content: z14.array(
|
|
2411
|
+
z14.object({
|
|
2412
|
+
type: z14.literal("code_execution_output"),
|
|
2413
|
+
file_id: z14.string()
|
|
2070
2414
|
})
|
|
2071
2415
|
).optional().default([])
|
|
2072
2416
|
})
|
|
2073
2417
|
)
|
|
2074
2418
|
);
|
|
2075
|
-
var codeExecution_20250522InputSchema =
|
|
2076
|
-
() =>
|
|
2077
|
-
|
|
2078
|
-
code:
|
|
2419
|
+
var codeExecution_20250522InputSchema = lazySchema13(
|
|
2420
|
+
() => zodSchema13(
|
|
2421
|
+
z14.object({
|
|
2422
|
+
code: z14.string()
|
|
2079
2423
|
})
|
|
2080
2424
|
)
|
|
2081
2425
|
);
|
|
2082
|
-
var
|
|
2426
|
+
var factory9 = createProviderExecutedToolFactory8({
|
|
2083
2427
|
id: "anthropic.code_execution_20250522",
|
|
2084
2428
|
inputSchema: codeExecution_20250522InputSchema,
|
|
2085
2429
|
outputSchema: codeExecution_20250522OutputSchema
|
|
2086
2430
|
});
|
|
2087
2431
|
var codeExecution_20250522 = (args = {}) => {
|
|
2088
|
-
return
|
|
2432
|
+
return factory9(args);
|
|
2089
2433
|
};
|
|
2090
2434
|
|
|
2091
2435
|
// src/tool/code-execution_20250825.ts
|
|
2092
2436
|
import {
|
|
2093
|
-
createProviderExecutedToolFactory as
|
|
2437
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory9,
|
|
2094
2438
|
experimental_toolCaller,
|
|
2095
|
-
lazySchema as
|
|
2096
|
-
zodSchema as
|
|
2439
|
+
lazySchema as lazySchema14,
|
|
2440
|
+
zodSchema as zodSchema14
|
|
2097
2441
|
} from "@ai-sdk/provider-utils";
|
|
2098
|
-
import { z as
|
|
2099
|
-
var codeExecution_20250825OutputSchema =
|
|
2100
|
-
() =>
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
type:
|
|
2104
|
-
stdout:
|
|
2105
|
-
stderr:
|
|
2106
|
-
return_code:
|
|
2107
|
-
content:
|
|
2108
|
-
|
|
2109
|
-
type:
|
|
2110
|
-
file_id:
|
|
2442
|
+
import { z as z15 } from "zod/v4";
|
|
2443
|
+
var codeExecution_20250825OutputSchema = lazySchema14(
|
|
2444
|
+
() => zodSchema14(
|
|
2445
|
+
z15.discriminatedUnion("type", [
|
|
2446
|
+
z15.object({
|
|
2447
|
+
type: z15.literal("code_execution_result"),
|
|
2448
|
+
stdout: z15.string(),
|
|
2449
|
+
stderr: z15.string(),
|
|
2450
|
+
return_code: z15.number(),
|
|
2451
|
+
content: z15.array(
|
|
2452
|
+
z15.object({
|
|
2453
|
+
type: z15.literal("code_execution_output"),
|
|
2454
|
+
file_id: z15.string()
|
|
2111
2455
|
})
|
|
2112
2456
|
).optional().default([])
|
|
2113
2457
|
}),
|
|
2114
|
-
|
|
2115
|
-
type:
|
|
2116
|
-
content:
|
|
2117
|
-
|
|
2118
|
-
type:
|
|
2119
|
-
file_id:
|
|
2458
|
+
z15.object({
|
|
2459
|
+
type: z15.literal("bash_code_execution_result"),
|
|
2460
|
+
content: z15.array(
|
|
2461
|
+
z15.object({
|
|
2462
|
+
type: z15.literal("bash_code_execution_output"),
|
|
2463
|
+
file_id: z15.string()
|
|
2120
2464
|
})
|
|
2121
2465
|
),
|
|
2122
|
-
stdout:
|
|
2123
|
-
stderr:
|
|
2124
|
-
return_code:
|
|
2466
|
+
stdout: z15.string(),
|
|
2467
|
+
stderr: z15.string(),
|
|
2468
|
+
return_code: z15.number()
|
|
2125
2469
|
}),
|
|
2126
|
-
|
|
2127
|
-
type:
|
|
2128
|
-
error_code:
|
|
2470
|
+
z15.object({
|
|
2471
|
+
type: z15.literal("bash_code_execution_tool_result_error"),
|
|
2472
|
+
error_code: z15.string()
|
|
2129
2473
|
}),
|
|
2130
|
-
|
|
2131
|
-
type:
|
|
2132
|
-
error_code:
|
|
2474
|
+
z15.object({
|
|
2475
|
+
type: z15.literal("text_editor_code_execution_tool_result_error"),
|
|
2476
|
+
error_code: z15.string()
|
|
2133
2477
|
}),
|
|
2134
|
-
|
|
2135
|
-
type:
|
|
2136
|
-
content:
|
|
2137
|
-
file_type:
|
|
2138
|
-
num_lines:
|
|
2139
|
-
start_line:
|
|
2140
|
-
total_lines:
|
|
2478
|
+
z15.object({
|
|
2479
|
+
type: z15.literal("text_editor_code_execution_view_result"),
|
|
2480
|
+
content: z15.string(),
|
|
2481
|
+
file_type: z15.string(),
|
|
2482
|
+
num_lines: z15.number().nullable(),
|
|
2483
|
+
start_line: z15.number().nullable(),
|
|
2484
|
+
total_lines: z15.number().nullable()
|
|
2141
2485
|
}),
|
|
2142
|
-
|
|
2143
|
-
type:
|
|
2144
|
-
is_file_update:
|
|
2486
|
+
z15.object({
|
|
2487
|
+
type: z15.literal("text_editor_code_execution_create_result"),
|
|
2488
|
+
is_file_update: z15.boolean()
|
|
2145
2489
|
}),
|
|
2146
|
-
|
|
2147
|
-
type:
|
|
2148
|
-
lines:
|
|
2149
|
-
new_lines:
|
|
2150
|
-
new_start:
|
|
2151
|
-
old_lines:
|
|
2152
|
-
old_start:
|
|
2490
|
+
z15.object({
|
|
2491
|
+
type: z15.literal("text_editor_code_execution_str_replace_result"),
|
|
2492
|
+
lines: z15.array(z15.string()).nullable(),
|
|
2493
|
+
new_lines: z15.number().nullable(),
|
|
2494
|
+
new_start: z15.number().nullable(),
|
|
2495
|
+
old_lines: z15.number().nullable(),
|
|
2496
|
+
old_start: z15.number().nullable()
|
|
2153
2497
|
})
|
|
2154
2498
|
])
|
|
2155
2499
|
)
|
|
2156
2500
|
);
|
|
2157
|
-
var codeExecution_20250825InputSchema =
|
|
2158
|
-
() =>
|
|
2159
|
-
|
|
2501
|
+
var codeExecution_20250825InputSchema = lazySchema14(
|
|
2502
|
+
() => zodSchema14(
|
|
2503
|
+
z15.discriminatedUnion("type", [
|
|
2160
2504
|
// Programmatic tool calling format (mapped from { code } by AI SDK)
|
|
2161
|
-
|
|
2162
|
-
type:
|
|
2163
|
-
code:
|
|
2505
|
+
z15.object({
|
|
2506
|
+
type: z15.literal("programmatic-tool-call"),
|
|
2507
|
+
code: z15.string()
|
|
2164
2508
|
}),
|
|
2165
|
-
|
|
2166
|
-
type:
|
|
2167
|
-
command:
|
|
2509
|
+
z15.object({
|
|
2510
|
+
type: z15.literal("bash_code_execution"),
|
|
2511
|
+
command: z15.string()
|
|
2168
2512
|
}),
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
type:
|
|
2172
|
-
command:
|
|
2173
|
-
path:
|
|
2513
|
+
z15.discriminatedUnion("command", [
|
|
2514
|
+
z15.object({
|
|
2515
|
+
type: z15.literal("text_editor_code_execution"),
|
|
2516
|
+
command: z15.literal("view"),
|
|
2517
|
+
path: z15.string()
|
|
2174
2518
|
}),
|
|
2175
|
-
|
|
2176
|
-
type:
|
|
2177
|
-
command:
|
|
2178
|
-
path:
|
|
2179
|
-
file_text:
|
|
2519
|
+
z15.object({
|
|
2520
|
+
type: z15.literal("text_editor_code_execution"),
|
|
2521
|
+
command: z15.literal("create"),
|
|
2522
|
+
path: z15.string(),
|
|
2523
|
+
file_text: z15.string().nullish()
|
|
2180
2524
|
}),
|
|
2181
|
-
|
|
2182
|
-
type:
|
|
2183
|
-
command:
|
|
2184
|
-
path:
|
|
2185
|
-
old_str:
|
|
2186
|
-
new_str:
|
|
2525
|
+
z15.object({
|
|
2526
|
+
type: z15.literal("text_editor_code_execution"),
|
|
2527
|
+
command: z15.literal("str_replace"),
|
|
2528
|
+
path: z15.string(),
|
|
2529
|
+
old_str: z15.string(),
|
|
2530
|
+
new_str: z15.string()
|
|
2187
2531
|
})
|
|
2188
2532
|
])
|
|
2189
2533
|
])
|
|
2190
2534
|
)
|
|
2191
2535
|
);
|
|
2192
|
-
var
|
|
2536
|
+
var factory10 = createProviderExecutedToolFactory9({
|
|
2193
2537
|
id: "anthropic.code_execution_20250825",
|
|
2194
2538
|
inputSchema: codeExecution_20250825InputSchema,
|
|
2195
2539
|
outputSchema: codeExecution_20250825OutputSchema,
|
|
@@ -2199,18 +2543,17 @@ var factory8 = createProviderExecutedToolFactory7({
|
|
|
2199
2543
|
supportsDeferredResults: true
|
|
2200
2544
|
});
|
|
2201
2545
|
var codeExecution_20250825 = (args = {}) => {
|
|
2202
|
-
return experimental_toolCaller(
|
|
2546
|
+
return experimental_toolCaller(factory10(args), {
|
|
2203
2547
|
type: "provider",
|
|
2204
2548
|
prepareProviderOptions: (providerOptions) => {
|
|
2205
|
-
|
|
2206
|
-
const anthropicOptions = providerOptions == null ? void 0 : providerOptions.anthropic;
|
|
2549
|
+
const anthropicOptions = providerOptions?.anthropic;
|
|
2207
2550
|
return {
|
|
2208
2551
|
...providerOptions,
|
|
2209
2552
|
anthropic: {
|
|
2210
2553
|
...anthropicOptions,
|
|
2211
2554
|
allowedCallers: [
|
|
2212
2555
|
.../* @__PURE__ */ new Set([
|
|
2213
|
-
...
|
|
2556
|
+
...anthropicOptions?.allowedCallers ?? [],
|
|
2214
2557
|
"code_execution_20250825"
|
|
2215
2558
|
])
|
|
2216
2559
|
]
|
|
@@ -2222,135 +2565,134 @@ var codeExecution_20250825 = (args = {}) => {
|
|
|
2222
2565
|
|
|
2223
2566
|
// src/tool/code-execution_20260120.ts
|
|
2224
2567
|
import {
|
|
2225
|
-
createProviderExecutedToolFactory as
|
|
2568
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory10,
|
|
2226
2569
|
experimental_toolCaller as experimental_toolCaller2,
|
|
2227
|
-
lazySchema as
|
|
2228
|
-
zodSchema as
|
|
2570
|
+
lazySchema as lazySchema15,
|
|
2571
|
+
zodSchema as zodSchema15
|
|
2229
2572
|
} from "@ai-sdk/provider-utils";
|
|
2230
|
-
import { z as
|
|
2231
|
-
var codeExecution_20260120OutputSchema =
|
|
2232
|
-
() =>
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
type:
|
|
2236
|
-
stdout:
|
|
2237
|
-
stderr:
|
|
2238
|
-
return_code:
|
|
2239
|
-
content:
|
|
2240
|
-
|
|
2241
|
-
type:
|
|
2242
|
-
file_id:
|
|
2573
|
+
import { z as z16 } from "zod/v4";
|
|
2574
|
+
var codeExecution_20260120OutputSchema = lazySchema15(
|
|
2575
|
+
() => zodSchema15(
|
|
2576
|
+
z16.discriminatedUnion("type", [
|
|
2577
|
+
z16.object({
|
|
2578
|
+
type: z16.literal("code_execution_result"),
|
|
2579
|
+
stdout: z16.string(),
|
|
2580
|
+
stderr: z16.string(),
|
|
2581
|
+
return_code: z16.number(),
|
|
2582
|
+
content: z16.array(
|
|
2583
|
+
z16.object({
|
|
2584
|
+
type: z16.literal("code_execution_output"),
|
|
2585
|
+
file_id: z16.string()
|
|
2243
2586
|
})
|
|
2244
2587
|
).optional().default([])
|
|
2245
2588
|
}),
|
|
2246
|
-
|
|
2247
|
-
type:
|
|
2248
|
-
encrypted_stdout:
|
|
2249
|
-
stderr:
|
|
2250
|
-
return_code:
|
|
2251
|
-
content:
|
|
2252
|
-
|
|
2253
|
-
type:
|
|
2254
|
-
file_id:
|
|
2589
|
+
z16.object({
|
|
2590
|
+
type: z16.literal("encrypted_code_execution_result"),
|
|
2591
|
+
encrypted_stdout: z16.string(),
|
|
2592
|
+
stderr: z16.string(),
|
|
2593
|
+
return_code: z16.number(),
|
|
2594
|
+
content: z16.array(
|
|
2595
|
+
z16.object({
|
|
2596
|
+
type: z16.literal("code_execution_output"),
|
|
2597
|
+
file_id: z16.string()
|
|
2255
2598
|
})
|
|
2256
2599
|
).optional().default([])
|
|
2257
2600
|
}),
|
|
2258
|
-
|
|
2259
|
-
type:
|
|
2260
|
-
content:
|
|
2261
|
-
|
|
2262
|
-
type:
|
|
2263
|
-
file_id:
|
|
2601
|
+
z16.object({
|
|
2602
|
+
type: z16.literal("bash_code_execution_result"),
|
|
2603
|
+
content: z16.array(
|
|
2604
|
+
z16.object({
|
|
2605
|
+
type: z16.literal("bash_code_execution_output"),
|
|
2606
|
+
file_id: z16.string()
|
|
2264
2607
|
})
|
|
2265
2608
|
),
|
|
2266
|
-
stdout:
|
|
2267
|
-
stderr:
|
|
2268
|
-
return_code:
|
|
2609
|
+
stdout: z16.string(),
|
|
2610
|
+
stderr: z16.string(),
|
|
2611
|
+
return_code: z16.number()
|
|
2269
2612
|
}),
|
|
2270
|
-
|
|
2271
|
-
type:
|
|
2272
|
-
error_code:
|
|
2613
|
+
z16.object({
|
|
2614
|
+
type: z16.literal("bash_code_execution_tool_result_error"),
|
|
2615
|
+
error_code: z16.string()
|
|
2273
2616
|
}),
|
|
2274
|
-
|
|
2275
|
-
type:
|
|
2276
|
-
error_code:
|
|
2617
|
+
z16.object({
|
|
2618
|
+
type: z16.literal("text_editor_code_execution_tool_result_error"),
|
|
2619
|
+
error_code: z16.string()
|
|
2277
2620
|
}),
|
|
2278
|
-
|
|
2279
|
-
type:
|
|
2280
|
-
content:
|
|
2281
|
-
file_type:
|
|
2282
|
-
num_lines:
|
|
2283
|
-
start_line:
|
|
2284
|
-
total_lines:
|
|
2621
|
+
z16.object({
|
|
2622
|
+
type: z16.literal("text_editor_code_execution_view_result"),
|
|
2623
|
+
content: z16.string(),
|
|
2624
|
+
file_type: z16.string(),
|
|
2625
|
+
num_lines: z16.number().nullable(),
|
|
2626
|
+
start_line: z16.number().nullable(),
|
|
2627
|
+
total_lines: z16.number().nullable()
|
|
2285
2628
|
}),
|
|
2286
|
-
|
|
2287
|
-
type:
|
|
2288
|
-
is_file_update:
|
|
2629
|
+
z16.object({
|
|
2630
|
+
type: z16.literal("text_editor_code_execution_create_result"),
|
|
2631
|
+
is_file_update: z16.boolean()
|
|
2289
2632
|
}),
|
|
2290
|
-
|
|
2291
|
-
type:
|
|
2292
|
-
lines:
|
|
2293
|
-
new_lines:
|
|
2294
|
-
new_start:
|
|
2295
|
-
old_lines:
|
|
2296
|
-
old_start:
|
|
2633
|
+
z16.object({
|
|
2634
|
+
type: z16.literal("text_editor_code_execution_str_replace_result"),
|
|
2635
|
+
lines: z16.array(z16.string()).nullable(),
|
|
2636
|
+
new_lines: z16.number().nullable(),
|
|
2637
|
+
new_start: z16.number().nullable(),
|
|
2638
|
+
old_lines: z16.number().nullable(),
|
|
2639
|
+
old_start: z16.number().nullable()
|
|
2297
2640
|
})
|
|
2298
2641
|
])
|
|
2299
2642
|
)
|
|
2300
2643
|
);
|
|
2301
|
-
var codeExecution_20260120InputSchema =
|
|
2302
|
-
() =>
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
type:
|
|
2306
|
-
code:
|
|
2644
|
+
var codeExecution_20260120InputSchema = lazySchema15(
|
|
2645
|
+
() => zodSchema15(
|
|
2646
|
+
z16.discriminatedUnion("type", [
|
|
2647
|
+
z16.object({
|
|
2648
|
+
type: z16.literal("programmatic-tool-call"),
|
|
2649
|
+
code: z16.string()
|
|
2307
2650
|
}),
|
|
2308
|
-
|
|
2309
|
-
type:
|
|
2310
|
-
command:
|
|
2651
|
+
z16.object({
|
|
2652
|
+
type: z16.literal("bash_code_execution"),
|
|
2653
|
+
command: z16.string()
|
|
2311
2654
|
}),
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
type:
|
|
2315
|
-
command:
|
|
2316
|
-
path:
|
|
2655
|
+
z16.discriminatedUnion("command", [
|
|
2656
|
+
z16.object({
|
|
2657
|
+
type: z16.literal("text_editor_code_execution"),
|
|
2658
|
+
command: z16.literal("view"),
|
|
2659
|
+
path: z16.string()
|
|
2317
2660
|
}),
|
|
2318
|
-
|
|
2319
|
-
type:
|
|
2320
|
-
command:
|
|
2321
|
-
path:
|
|
2322
|
-
file_text:
|
|
2661
|
+
z16.object({
|
|
2662
|
+
type: z16.literal("text_editor_code_execution"),
|
|
2663
|
+
command: z16.literal("create"),
|
|
2664
|
+
path: z16.string(),
|
|
2665
|
+
file_text: z16.string().nullish()
|
|
2323
2666
|
}),
|
|
2324
|
-
|
|
2325
|
-
type:
|
|
2326
|
-
command:
|
|
2327
|
-
path:
|
|
2328
|
-
old_str:
|
|
2329
|
-
new_str:
|
|
2667
|
+
z16.object({
|
|
2668
|
+
type: z16.literal("text_editor_code_execution"),
|
|
2669
|
+
command: z16.literal("str_replace"),
|
|
2670
|
+
path: z16.string(),
|
|
2671
|
+
old_str: z16.string(),
|
|
2672
|
+
new_str: z16.string()
|
|
2330
2673
|
})
|
|
2331
2674
|
])
|
|
2332
2675
|
])
|
|
2333
2676
|
)
|
|
2334
2677
|
);
|
|
2335
|
-
var
|
|
2678
|
+
var factory11 = createProviderExecutedToolFactory10({
|
|
2336
2679
|
id: "anthropic.code_execution_20260120",
|
|
2337
2680
|
inputSchema: codeExecution_20260120InputSchema,
|
|
2338
2681
|
outputSchema: codeExecution_20260120OutputSchema,
|
|
2339
2682
|
supportsDeferredResults: true
|
|
2340
2683
|
});
|
|
2341
2684
|
var codeExecution_20260120 = (args = {}) => {
|
|
2342
|
-
return experimental_toolCaller2(
|
|
2685
|
+
return experimental_toolCaller2(factory11(args), {
|
|
2343
2686
|
type: "provider",
|
|
2344
2687
|
prepareProviderOptions: (providerOptions) => {
|
|
2345
|
-
|
|
2346
|
-
const anthropicOptions = providerOptions == null ? void 0 : providerOptions.anthropic;
|
|
2688
|
+
const anthropicOptions = providerOptions?.anthropic;
|
|
2347
2689
|
return {
|
|
2348
2690
|
...providerOptions,
|
|
2349
2691
|
anthropic: {
|
|
2350
2692
|
...anthropicOptions,
|
|
2351
2693
|
allowedCallers: [
|
|
2352
2694
|
.../* @__PURE__ */ new Set([
|
|
2353
|
-
...
|
|
2695
|
+
...anthropicOptions?.allowedCallers ?? [],
|
|
2354
2696
|
"code_execution_20260120"
|
|
2355
2697
|
])
|
|
2356
2698
|
]
|
|
@@ -2362,24 +2704,24 @@ var codeExecution_20260120 = (args = {}) => {
|
|
|
2362
2704
|
|
|
2363
2705
|
// src/tool/tool-search-regex_20251119.ts
|
|
2364
2706
|
import {
|
|
2365
|
-
createProviderExecutedToolFactory as
|
|
2366
|
-
lazySchema as
|
|
2367
|
-
zodSchema as
|
|
2707
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory11,
|
|
2708
|
+
lazySchema as lazySchema16,
|
|
2709
|
+
zodSchema as zodSchema16
|
|
2368
2710
|
} from "@ai-sdk/provider-utils";
|
|
2369
|
-
import { z as
|
|
2370
|
-
var toolSearchRegex_20251119OutputSchema =
|
|
2371
|
-
() =>
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
type:
|
|
2375
|
-
toolName:
|
|
2711
|
+
import { z as z17 } from "zod/v4";
|
|
2712
|
+
var toolSearchRegex_20251119OutputSchema = lazySchema16(
|
|
2713
|
+
() => zodSchema16(
|
|
2714
|
+
z17.array(
|
|
2715
|
+
z17.object({
|
|
2716
|
+
type: z17.literal("tool_reference"),
|
|
2717
|
+
toolName: z17.string()
|
|
2376
2718
|
})
|
|
2377
2719
|
)
|
|
2378
2720
|
)
|
|
2379
2721
|
);
|
|
2380
|
-
var toolSearchRegex_20251119InputSchema =
|
|
2381
|
-
() =>
|
|
2382
|
-
|
|
2722
|
+
var toolSearchRegex_20251119InputSchema = lazySchema16(
|
|
2723
|
+
() => zodSchema16(
|
|
2724
|
+
z17.object({
|
|
2383
2725
|
/**
|
|
2384
2726
|
* A regex pattern to search for tools.
|
|
2385
2727
|
* Uses Python re.search() syntax. Maximum 200 characters.
|
|
@@ -2390,22 +2732,22 @@ var toolSearchRegex_20251119InputSchema = lazySchema13(
|
|
|
2390
2732
|
* - "database.*query|query.*database" - OR patterns for flexibility
|
|
2391
2733
|
* - "(?i)slack" - case-insensitive search
|
|
2392
2734
|
*/
|
|
2393
|
-
pattern:
|
|
2735
|
+
pattern: z17.string(),
|
|
2394
2736
|
/**
|
|
2395
2737
|
* Maximum number of tools to return. Optional.
|
|
2396
2738
|
*/
|
|
2397
|
-
limit:
|
|
2739
|
+
limit: z17.number().optional()
|
|
2398
2740
|
})
|
|
2399
2741
|
)
|
|
2400
2742
|
);
|
|
2401
|
-
var
|
|
2743
|
+
var factory12 = createProviderExecutedToolFactory11({
|
|
2402
2744
|
id: "anthropic.tool_search_regex_20251119",
|
|
2403
2745
|
inputSchema: toolSearchRegex_20251119InputSchema,
|
|
2404
2746
|
outputSchema: toolSearchRegex_20251119OutputSchema,
|
|
2405
2747
|
supportsDeferredResults: true
|
|
2406
2748
|
});
|
|
2407
2749
|
var toolSearchRegex_20251119 = (args = {}) => {
|
|
2408
|
-
return
|
|
2750
|
+
return factory12(args);
|
|
2409
2751
|
};
|
|
2410
2752
|
|
|
2411
2753
|
// src/convert-to-anthropic-prompt.ts
|
|
@@ -2422,8 +2764,8 @@ function extractErrorValue(value) {
|
|
|
2422
2764
|
} else if (typeof value === "object" && value !== null) {
|
|
2423
2765
|
return value;
|
|
2424
2766
|
}
|
|
2425
|
-
} catch
|
|
2426
|
-
const extractedErrorCode = value
|
|
2767
|
+
} catch {
|
|
2768
|
+
const extractedErrorCode = value?.errorCode;
|
|
2427
2769
|
return {
|
|
2428
2770
|
errorCode: typeof extractedErrorCode === "string" ? extractedErrorCode : "unavailable"
|
|
2429
2771
|
};
|
|
@@ -2435,31 +2777,30 @@ async function convertToAnthropicPrompt({
|
|
|
2435
2777
|
sendReasoning,
|
|
2436
2778
|
warnings,
|
|
2437
2779
|
cacheControlValidator,
|
|
2438
|
-
toolNameMapping
|
|
2780
|
+
toolNameMapping,
|
|
2781
|
+
toolsetNames = {}
|
|
2439
2782
|
}) {
|
|
2440
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
2441
2783
|
const betas = /* @__PURE__ */ new Set();
|
|
2442
2784
|
const blocks = groupIntoBlocks(prompt);
|
|
2443
2785
|
const validator = cacheControlValidator || new CacheControlValidator();
|
|
2444
2786
|
let system = void 0;
|
|
2445
2787
|
const messages = [];
|
|
2788
|
+
let lastUserMessageIndex = -1;
|
|
2446
2789
|
async function shouldEnableCitations(providerMetadata) {
|
|
2447
|
-
var _a2, _b2;
|
|
2448
2790
|
const anthropicOptions = await parseProviderOptions({
|
|
2449
2791
|
provider: "anthropic",
|
|
2450
2792
|
providerOptions: providerMetadata,
|
|
2451
2793
|
schema: anthropicFilePartProviderOptions
|
|
2452
2794
|
});
|
|
2453
|
-
return
|
|
2795
|
+
return anthropicOptions?.citations?.enabled ?? false;
|
|
2454
2796
|
}
|
|
2455
2797
|
async function shouldUseContainerUpload(providerMetadata) {
|
|
2456
|
-
var _a2;
|
|
2457
2798
|
const anthropicOptions = await parseProviderOptions({
|
|
2458
2799
|
provider: "anthropic",
|
|
2459
2800
|
providerOptions: providerMetadata,
|
|
2460
2801
|
schema: anthropicFilePartProviderOptions
|
|
2461
2802
|
});
|
|
2462
|
-
return
|
|
2803
|
+
return anthropicOptions?.containerUpload ?? false;
|
|
2463
2804
|
}
|
|
2464
2805
|
async function getDocumentMetadata(providerMetadata) {
|
|
2465
2806
|
const anthropicOptions = await parseProviderOptions({
|
|
@@ -2468,8 +2809,8 @@ async function convertToAnthropicPrompt({
|
|
|
2468
2809
|
schema: anthropicFilePartProviderOptions
|
|
2469
2810
|
});
|
|
2470
2811
|
return {
|
|
2471
|
-
title: anthropicOptions
|
|
2472
|
-
context: anthropicOptions
|
|
2812
|
+
title: anthropicOptions?.title,
|
|
2813
|
+
context: anthropicOptions?.context
|
|
2473
2814
|
};
|
|
2474
2815
|
}
|
|
2475
2816
|
for (let i = 0; i < blocks.length; i++) {
|
|
@@ -2485,9 +2826,9 @@ async function convertToAnthropicPrompt({
|
|
|
2485
2826
|
providerOptions,
|
|
2486
2827
|
schema: anthropicSystemMessageProviderOptions
|
|
2487
2828
|
});
|
|
2488
|
-
const toolChanges =
|
|
2829
|
+
const toolChanges = systemMessageOptions?.toolChanges ?? [];
|
|
2489
2830
|
const content = [];
|
|
2490
|
-
if (text !== "" || toolChanges.length === 0 &&
|
|
2831
|
+
if (text !== "" || toolChanges.length === 0 && systemMessageOptions?.clearAt == null && systemMessageOptions?.effort == null) {
|
|
2491
2832
|
content.push({
|
|
2492
2833
|
type: "text",
|
|
2493
2834
|
text,
|
|
@@ -2508,8 +2849,8 @@ async function convertToAnthropicPrompt({
|
|
|
2508
2849
|
}
|
|
2509
2850
|
convertedMessages.push({
|
|
2510
2851
|
content,
|
|
2511
|
-
clearAt: systemMessageOptions
|
|
2512
|
-
effort: systemMessageOptions
|
|
2852
|
+
clearAt: systemMessageOptions?.clearAt,
|
|
2853
|
+
effort: systemMessageOptions?.effort,
|
|
2513
2854
|
toolChangeCount: toolChanges.length
|
|
2514
2855
|
});
|
|
2515
2856
|
}
|
|
@@ -2528,10 +2869,17 @@ async function convertToAnthropicPrompt({
|
|
|
2528
2869
|
});
|
|
2529
2870
|
}
|
|
2530
2871
|
for (const message of convertedMessages) {
|
|
2531
|
-
if (message.clearAt
|
|
2872
|
+
if (message.content.length === 0 && message.clearAt == null && message.effort != null) {
|
|
2873
|
+
messages.push({
|
|
2874
|
+
role: "system",
|
|
2875
|
+
content: [],
|
|
2876
|
+
output_config: { effort: message.effort }
|
|
2877
|
+
});
|
|
2878
|
+
betas.add("mid-conversation-output-config-2026-07-01");
|
|
2879
|
+
} else if (message.clearAt != null || message.effort != null) {
|
|
2532
2880
|
warnings.push({
|
|
2533
2881
|
type: "other",
|
|
2534
|
-
message: "clearAt and effort on
|
|
2882
|
+
message: "clearAt and effort on this initial system message are not supported by Anthropic. Use a separate effort-only system message with empty content to set effort. These options have been ignored."
|
|
2535
2883
|
});
|
|
2536
2884
|
}
|
|
2537
2885
|
}
|
|
@@ -2558,7 +2906,7 @@ async function convertToAnthropicPrompt({
|
|
|
2558
2906
|
betas.add("mid-conversation-system-clear-at-2026-08-21");
|
|
2559
2907
|
}
|
|
2560
2908
|
if (message.effort != null) {
|
|
2561
|
-
betas.add("mid-conversation-
|
|
2909
|
+
betas.add("mid-conversation-output-config-2026-07-01");
|
|
2562
2910
|
}
|
|
2563
2911
|
}
|
|
2564
2912
|
}
|
|
@@ -2570,16 +2918,19 @@ async function convertToAnthropicPrompt({
|
|
|
2570
2918
|
const { role, content } = message;
|
|
2571
2919
|
switch (role) {
|
|
2572
2920
|
case "user": {
|
|
2921
|
+
if (content.length > 0) {
|
|
2922
|
+
lastUserMessageIndex = messages.length;
|
|
2923
|
+
}
|
|
2573
2924
|
for (let j = 0; j < content.length; j++) {
|
|
2574
2925
|
const part = content[j];
|
|
2575
2926
|
const isLastPart = j === content.length - 1;
|
|
2576
|
-
const cacheControl =
|
|
2927
|
+
const cacheControl = validator.getCacheControl(part.providerOptions, {
|
|
2577
2928
|
type: "user message part",
|
|
2578
2929
|
canCache: true
|
|
2579
|
-
})
|
|
2930
|
+
}) ?? (isLastPart ? validator.getCacheControl(message.providerOptions, {
|
|
2580
2931
|
type: "user message",
|
|
2581
2932
|
canCache: true
|
|
2582
|
-
}) : void 0;
|
|
2933
|
+
}) : void 0);
|
|
2583
2934
|
switch (part.type) {
|
|
2584
2935
|
case "text": {
|
|
2585
2936
|
anthropicContent.push({
|
|
@@ -2631,7 +2982,7 @@ async function convertToAnthropicPrompt({
|
|
|
2631
2982
|
media_type: "text/plain",
|
|
2632
2983
|
data: part.data.text
|
|
2633
2984
|
},
|
|
2634
|
-
title:
|
|
2985
|
+
title: metadata.title ?? part.filename,
|
|
2635
2986
|
...metadata.context && {
|
|
2636
2987
|
context: metadata.context
|
|
2637
2988
|
},
|
|
@@ -2676,7 +3027,7 @@ async function convertToAnthropicPrompt({
|
|
|
2676
3027
|
media_type: "application/pdf",
|
|
2677
3028
|
data: convertToBase64(part.data.data)
|
|
2678
3029
|
},
|
|
2679
|
-
title:
|
|
3030
|
+
title: metadata.title ?? part.filename,
|
|
2680
3031
|
...metadata.context && {
|
|
2681
3032
|
context: metadata.context
|
|
2682
3033
|
},
|
|
@@ -2704,7 +3055,7 @@ async function convertToAnthropicPrompt({
|
|
|
2704
3055
|
part.data.data
|
|
2705
3056
|
)
|
|
2706
3057
|
},
|
|
2707
|
-
title:
|
|
3058
|
+
title: metadata.title ?? part.filename,
|
|
2708
3059
|
...metadata.context && {
|
|
2709
3060
|
context: metadata.context
|
|
2710
3061
|
},
|
|
@@ -2734,25 +3085,24 @@ async function convertToAnthropicPrompt({
|
|
|
2734
3085
|
continue;
|
|
2735
3086
|
}
|
|
2736
3087
|
const output = part.output;
|
|
2737
|
-
const outputProviderOptions = "providerOptions" in output ? output.providerOptions : output.type === "content" ?
|
|
3088
|
+
const outputProviderOptions = "providerOptions" in output ? output.providerOptions : output.type === "content" ? output.value.find(
|
|
2738
3089
|
(contentPart) => contentPart.providerOptions != null
|
|
2739
|
-
)
|
|
3090
|
+
)?.providerOptions : void 0;
|
|
2740
3091
|
const isLastPart = i2 === content.length - 1;
|
|
2741
|
-
const cacheControl =
|
|
3092
|
+
const cacheControl = validator.getCacheControl(part.providerOptions, {
|
|
2742
3093
|
type: "tool result part",
|
|
2743
3094
|
canCache: true
|
|
2744
|
-
})
|
|
3095
|
+
}) ?? validator.getCacheControl(outputProviderOptions, {
|
|
2745
3096
|
type: "tool result output",
|
|
2746
3097
|
canCache: true
|
|
2747
|
-
})
|
|
3098
|
+
}) ?? (isLastPart ? validator.getCacheControl(message.providerOptions, {
|
|
2748
3099
|
type: "tool result message",
|
|
2749
3100
|
canCache: true
|
|
2750
|
-
}) : void 0;
|
|
3101
|
+
}) : void 0);
|
|
2751
3102
|
let contentValue;
|
|
2752
3103
|
switch (output.type) {
|
|
2753
3104
|
case "content":
|
|
2754
3105
|
contentValue = output.value.map((contentPart) => {
|
|
2755
|
-
var _a2;
|
|
2756
3106
|
switch (contentPart.type) {
|
|
2757
3107
|
case "text":
|
|
2758
3108
|
return {
|
|
@@ -2822,8 +3172,8 @@ async function convertToAnthropicPrompt({
|
|
|
2822
3172
|
return void 0;
|
|
2823
3173
|
}
|
|
2824
3174
|
case "custom": {
|
|
2825
|
-
const anthropicOptions =
|
|
2826
|
-
if (
|
|
3175
|
+
const anthropicOptions = contentPart.providerOptions?.anthropic;
|
|
3176
|
+
if (anthropicOptions?.type === "tool-reference") {
|
|
2827
3177
|
return {
|
|
2828
3178
|
type: "tool_reference",
|
|
2829
3179
|
tool_name: anthropicOptions.toolName
|
|
@@ -2850,7 +3200,7 @@ async function convertToAnthropicPrompt({
|
|
|
2850
3200
|
contentValue = output.value;
|
|
2851
3201
|
break;
|
|
2852
3202
|
case "execution-denied":
|
|
2853
|
-
contentValue =
|
|
3203
|
+
contentValue = output.reason ?? "Tool call execution denied.";
|
|
2854
3204
|
break;
|
|
2855
3205
|
case "json":
|
|
2856
3206
|
case "error-json":
|
|
@@ -2858,9 +3208,15 @@ async function convertToAnthropicPrompt({
|
|
|
2858
3208
|
contentValue = JSON.stringify(output.value);
|
|
2859
3209
|
break;
|
|
2860
3210
|
}
|
|
3211
|
+
const toolsetName = getAnthropicToolsetName({
|
|
3212
|
+
toolName: part.toolName,
|
|
3213
|
+
providerOptions: part.providerOptions,
|
|
3214
|
+
toolsetNames
|
|
3215
|
+
});
|
|
2861
3216
|
anthropicContent.push({
|
|
2862
3217
|
type: "tool_result",
|
|
2863
3218
|
tool_use_id: part.toolCallId,
|
|
3219
|
+
...toolsetName != null && { toolset_name: toolsetName },
|
|
2864
3220
|
content: contentValue,
|
|
2865
3221
|
is_error: output.type === "error-text" || output.type === "error-json" ? true : void 0,
|
|
2866
3222
|
cache_control: cacheControl
|
|
@@ -2887,20 +3243,29 @@ async function convertToAnthropicPrompt({
|
|
|
2887
3243
|
for (let k = 0; k < content.length; k++) {
|
|
2888
3244
|
const part = content[k];
|
|
2889
3245
|
const isLastContentPart = k === content.length - 1;
|
|
2890
|
-
const cacheControl =
|
|
3246
|
+
const cacheControl = validator.getCacheControl(part.providerOptions, {
|
|
2891
3247
|
type: "assistant message part",
|
|
2892
3248
|
canCache: true
|
|
2893
|
-
})
|
|
3249
|
+
}) ?? (isLastContentPart ? validator.getCacheControl(message.providerOptions, {
|
|
2894
3250
|
type: "assistant message",
|
|
2895
3251
|
canCache: true
|
|
2896
|
-
}) : void 0;
|
|
3252
|
+
}) : void 0);
|
|
2897
3253
|
switch (part.type) {
|
|
2898
3254
|
case "text": {
|
|
2899
|
-
const textMetadata =
|
|
2900
|
-
if (
|
|
3255
|
+
const textMetadata = part.providerOptions?.anthropic;
|
|
3256
|
+
if (textMetadata?.type === "compaction") {
|
|
3257
|
+
if (part.text === "") {
|
|
3258
|
+
break;
|
|
3259
|
+
}
|
|
3260
|
+
if (typeof textMetadata.signature === "string") {
|
|
3261
|
+
betas.add("compact-2026-09-04");
|
|
3262
|
+
}
|
|
2901
3263
|
anthropicContent.push({
|
|
2902
3264
|
type: "compaction",
|
|
2903
3265
|
content: part.text,
|
|
3266
|
+
...typeof textMetadata.signature === "string" && {
|
|
3267
|
+
signature: textMetadata.signature
|
|
3268
|
+
},
|
|
2904
3269
|
cache_control: cacheControl
|
|
2905
3270
|
});
|
|
2906
3271
|
} else {
|
|
@@ -2912,7 +3277,7 @@ async function convertToAnthropicPrompt({
|
|
|
2912
3277
|
// in pre-filled assistant responses
|
|
2913
3278
|
isLastBlock && isLastMessage && isLastContentPart ? part.text.trim() : part.text
|
|
2914
3279
|
),
|
|
2915
|
-
...
|
|
3280
|
+
...textMetadata?.citations != null && {
|
|
2916
3281
|
citations: textMetadata.citations
|
|
2917
3282
|
},
|
|
2918
3283
|
cache_control: cacheControl
|
|
@@ -2973,10 +3338,10 @@ async function convertToAnthropicPrompt({
|
|
|
2973
3338
|
const providerToolName = toolNameMapping.toProviderToolName(
|
|
2974
3339
|
part.toolName
|
|
2975
3340
|
);
|
|
2976
|
-
const isMcpToolUse =
|
|
3341
|
+
const isMcpToolUse = part.providerOptions?.anthropic?.type === "mcp-tool-use";
|
|
2977
3342
|
if (isMcpToolUse) {
|
|
2978
3343
|
mcpToolUseIds.add(part.toolCallId);
|
|
2979
|
-
const serverName =
|
|
3344
|
+
const serverName = part.providerOptions?.anthropic?.serverName;
|
|
2980
3345
|
if (serverName == null || typeof serverName !== "string") {
|
|
2981
3346
|
warnings.push({
|
|
2982
3347
|
type: "other",
|
|
@@ -3058,6 +3423,33 @@ async function convertToAnthropicPrompt({
|
|
|
3058
3423
|
}
|
|
3059
3424
|
break;
|
|
3060
3425
|
}
|
|
3426
|
+
const toolsetName = getAnthropicToolsetName({
|
|
3427
|
+
toolName: part.toolName,
|
|
3428
|
+
providerOptions: part.providerOptions,
|
|
3429
|
+
toolsetNames
|
|
3430
|
+
});
|
|
3431
|
+
if (toolsetName != null) {
|
|
3432
|
+
const { action, ...memberInput } = toAnthropicToolInput(
|
|
3433
|
+
part.input
|
|
3434
|
+
);
|
|
3435
|
+
if (typeof action !== "string") {
|
|
3436
|
+
warnings.push({
|
|
3437
|
+
type: "other",
|
|
3438
|
+
message: `toolset tool call for tool ${part.toolName} is missing the action`
|
|
3439
|
+
});
|
|
3440
|
+
break;
|
|
3441
|
+
}
|
|
3442
|
+
anthropicContent.push({
|
|
3443
|
+
type: "tool_use",
|
|
3444
|
+
id: part.toolCallId,
|
|
3445
|
+
name: action,
|
|
3446
|
+
toolset_name: toolsetName,
|
|
3447
|
+
input: memberInput,
|
|
3448
|
+
...caller && { caller },
|
|
3449
|
+
cache_control: cacheControl
|
|
3450
|
+
});
|
|
3451
|
+
break;
|
|
3452
|
+
}
|
|
3061
3453
|
anthropicContent.push({
|
|
3062
3454
|
type: "tool_use",
|
|
3063
3455
|
id: part.toolCallId,
|
|
@@ -3099,7 +3491,7 @@ async function convertToAnthropicPrompt({
|
|
|
3099
3491
|
} else if (typeof output.value === "object" && output.value !== null) {
|
|
3100
3492
|
errorInfo = output.value;
|
|
3101
3493
|
}
|
|
3102
|
-
} catch
|
|
3494
|
+
} catch {
|
|
3103
3495
|
}
|
|
3104
3496
|
if (errorInfo.type === "code_execution_tool_result_error") {
|
|
3105
3497
|
anthropicContent.push({
|
|
@@ -3107,7 +3499,7 @@ async function convertToAnthropicPrompt({
|
|
|
3107
3499
|
tool_use_id: part.toolCallId,
|
|
3108
3500
|
content: {
|
|
3109
3501
|
type: "code_execution_tool_result_error",
|
|
3110
|
-
error_code:
|
|
3502
|
+
error_code: errorInfo.errorCode ?? "unknown"
|
|
3111
3503
|
},
|
|
3112
3504
|
cache_control: cacheControl
|
|
3113
3505
|
});
|
|
@@ -3118,7 +3510,7 @@ async function convertToAnthropicPrompt({
|
|
|
3118
3510
|
cache_control: cacheControl,
|
|
3119
3511
|
content: {
|
|
3120
3512
|
type: "bash_code_execution_tool_result_error",
|
|
3121
|
-
error_code:
|
|
3513
|
+
error_code: errorInfo.errorCode ?? "unknown"
|
|
3122
3514
|
}
|
|
3123
3515
|
});
|
|
3124
3516
|
}
|
|
@@ -3151,7 +3543,7 @@ async function convertToAnthropicPrompt({
|
|
|
3151
3543
|
stdout: codeExecutionOutput.stdout,
|
|
3152
3544
|
stderr: codeExecutionOutput.stderr,
|
|
3153
3545
|
return_code: codeExecutionOutput.return_code,
|
|
3154
|
-
content:
|
|
3546
|
+
content: codeExecutionOutput.content ?? []
|
|
3155
3547
|
},
|
|
3156
3548
|
cache_control: cacheControl
|
|
3157
3549
|
});
|
|
@@ -3169,7 +3561,7 @@ async function convertToAnthropicPrompt({
|
|
|
3169
3561
|
encrypted_stdout: codeExecutionOutput.encrypted_stdout,
|
|
3170
3562
|
stderr: codeExecutionOutput.stderr,
|
|
3171
3563
|
return_code: codeExecutionOutput.return_code,
|
|
3172
|
-
content:
|
|
3564
|
+
content: codeExecutionOutput.content ?? []
|
|
3173
3565
|
},
|
|
3174
3566
|
cache_control: cacheControl
|
|
3175
3567
|
});
|
|
@@ -3188,7 +3580,7 @@ async function convertToAnthropicPrompt({
|
|
|
3188
3580
|
stdout: codeExecutionOutput.stdout,
|
|
3189
3581
|
stderr: codeExecutionOutput.stderr,
|
|
3190
3582
|
return_code: codeExecutionOutput.return_code,
|
|
3191
|
-
content:
|
|
3583
|
+
content: codeExecutionOutput.content ?? []
|
|
3192
3584
|
},
|
|
3193
3585
|
cache_control: cacheControl
|
|
3194
3586
|
});
|
|
@@ -3226,7 +3618,7 @@ async function convertToAnthropicPrompt({
|
|
|
3226
3618
|
tool_use_id: part.toolCallId,
|
|
3227
3619
|
content: {
|
|
3228
3620
|
type: "web_fetch_tool_result_error",
|
|
3229
|
-
error_code:
|
|
3621
|
+
error_code: extractErrorValue(output.value).errorCode ?? "unavailable"
|
|
3230
3622
|
},
|
|
3231
3623
|
...caller && { caller },
|
|
3232
3624
|
cache_control: cacheControl
|
|
@@ -3275,7 +3667,7 @@ async function convertToAnthropicPrompt({
|
|
|
3275
3667
|
tool_use_id: part.toolCallId,
|
|
3276
3668
|
content: {
|
|
3277
3669
|
type: "web_search_tool_result_error",
|
|
3278
|
-
error_code:
|
|
3670
|
+
error_code: extractErrorValue(output.value).errorCode ?? "unavailable"
|
|
3279
3671
|
},
|
|
3280
3672
|
...caller && { caller },
|
|
3281
3673
|
cache_control: cacheControl
|
|
@@ -3397,10 +3789,12 @@ async function convertToAnthropicPrompt({
|
|
|
3397
3789
|
}
|
|
3398
3790
|
}
|
|
3399
3791
|
}
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3792
|
+
if (anthropicContent.length > 0) {
|
|
3793
|
+
messages.push({
|
|
3794
|
+
role: "assistant",
|
|
3795
|
+
content: moveToolUseBlocksToEnd(anthropicContent)
|
|
3796
|
+
});
|
|
3797
|
+
}
|
|
3404
3798
|
break;
|
|
3405
3799
|
}
|
|
3406
3800
|
default: {
|
|
@@ -3409,6 +3803,42 @@ async function convertToAnthropicPrompt({
|
|
|
3409
3803
|
}
|
|
3410
3804
|
}
|
|
3411
3805
|
}
|
|
3806
|
+
const codeExecutionToolCallIds = /* @__PURE__ */ new Set();
|
|
3807
|
+
for (const message of messages) {
|
|
3808
|
+
if (message.role !== "assistant") {
|
|
3809
|
+
continue;
|
|
3810
|
+
}
|
|
3811
|
+
for (const part of message.content) {
|
|
3812
|
+
if (part.type === "server_tool_use" && part.name === "code_execution") {
|
|
3813
|
+
codeExecutionToolCallIds.add(part.id);
|
|
3814
|
+
}
|
|
3815
|
+
}
|
|
3816
|
+
}
|
|
3817
|
+
const warnedToolCallIds = /* @__PURE__ */ new Set();
|
|
3818
|
+
for (let i = 0; i < lastUserMessageIndex; i++) {
|
|
3819
|
+
const message = messages[i];
|
|
3820
|
+
if (message.role !== "assistant") {
|
|
3821
|
+
continue;
|
|
3822
|
+
}
|
|
3823
|
+
for (const part of message.content) {
|
|
3824
|
+
if (!("caller" in part)) {
|
|
3825
|
+
continue;
|
|
3826
|
+
}
|
|
3827
|
+
const caller = part.caller;
|
|
3828
|
+
if (caller == null || caller.type === "direct" || codeExecutionToolCallIds.has(caller.tool_id)) {
|
|
3829
|
+
continue;
|
|
3830
|
+
}
|
|
3831
|
+
const toolCallId = "id" in part ? part.id : part.tool_use_id;
|
|
3832
|
+
delete part.caller;
|
|
3833
|
+
if (!warnedToolCallIds.has(toolCallId)) {
|
|
3834
|
+
warnedToolCallIds.add(toolCallId);
|
|
3835
|
+
warnings.push({
|
|
3836
|
+
type: "other",
|
|
3837
|
+
message: `Omitted caller metadata for tool ${toolCallId} because source code execution tool ${caller.tool_id} is missing from the conversation history.`
|
|
3838
|
+
});
|
|
3839
|
+
}
|
|
3840
|
+
}
|
|
3841
|
+
}
|
|
3412
3842
|
return {
|
|
3413
3843
|
prompt: { system, messages },
|
|
3414
3844
|
betas
|
|
@@ -3421,7 +3851,7 @@ function groupIntoBlocks(prompt) {
|
|
|
3421
3851
|
const { role } = message;
|
|
3422
3852
|
switch (role) {
|
|
3423
3853
|
case "system": {
|
|
3424
|
-
if (
|
|
3854
|
+
if (currentBlock?.type !== "system") {
|
|
3425
3855
|
currentBlock = { type: "system", messages: [] };
|
|
3426
3856
|
blocks.push(currentBlock);
|
|
3427
3857
|
}
|
|
@@ -3429,7 +3859,7 @@ function groupIntoBlocks(prompt) {
|
|
|
3429
3859
|
break;
|
|
3430
3860
|
}
|
|
3431
3861
|
case "assistant": {
|
|
3432
|
-
if (
|
|
3862
|
+
if (currentBlock?.type !== "assistant") {
|
|
3433
3863
|
currentBlock = { type: "assistant", messages: [] };
|
|
3434
3864
|
blocks.push(currentBlock);
|
|
3435
3865
|
}
|
|
@@ -3437,7 +3867,7 @@ function groupIntoBlocks(prompt) {
|
|
|
3437
3867
|
break;
|
|
3438
3868
|
}
|
|
3439
3869
|
case "user": {
|
|
3440
|
-
if (
|
|
3870
|
+
if (currentBlock?.type !== "user") {
|
|
3441
3871
|
currentBlock = { type: "user", messages: [] };
|
|
3442
3872
|
blocks.push(currentBlock);
|
|
3443
3873
|
}
|
|
@@ -3445,7 +3875,7 @@ function groupIntoBlocks(prompt) {
|
|
|
3445
3875
|
break;
|
|
3446
3876
|
}
|
|
3447
3877
|
case "tool": {
|
|
3448
|
-
if (
|
|
3878
|
+
if (currentBlock?.type !== "user") {
|
|
3449
3879
|
currentBlock = { type: "user", messages: [] };
|
|
3450
3880
|
blocks.push(currentBlock);
|
|
3451
3881
|
}
|
|
@@ -3481,16 +3911,27 @@ function moveToolUseBlocksToEnd(content) {
|
|
|
3481
3911
|
flushSegment();
|
|
3482
3912
|
return result;
|
|
3483
3913
|
}
|
|
3914
|
+
function getAnthropicToolsetName({
|
|
3915
|
+
toolName,
|
|
3916
|
+
providerOptions,
|
|
3917
|
+
toolsetNames
|
|
3918
|
+
}) {
|
|
3919
|
+
const fromTools = toolsetNames[toolName];
|
|
3920
|
+
if (fromTools != null) {
|
|
3921
|
+
return fromTools;
|
|
3922
|
+
}
|
|
3923
|
+
const fromMetadata = providerOptions?.anthropic?.toolsetName;
|
|
3924
|
+
return typeof fromMetadata === "string" ? fromMetadata : void 0;
|
|
3925
|
+
}
|
|
3484
3926
|
function getAnthropicCaller(providerOptions) {
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
if (((caller == null ? void 0 : caller.type) === "code_execution_20250825" || (caller == null ? void 0 : caller.type) === "code_execution_20260120") && caller.toolId) {
|
|
3927
|
+
const caller = providerOptions?.anthropic?.caller;
|
|
3928
|
+
if ((caller?.type === "code_execution_20250825" || caller?.type === "code_execution_20260120") && caller.toolId) {
|
|
3488
3929
|
return {
|
|
3489
3930
|
type: caller.type,
|
|
3490
3931
|
tool_id: caller.toolId
|
|
3491
3932
|
};
|
|
3492
3933
|
}
|
|
3493
|
-
return
|
|
3934
|
+
return caller?.type === "direct" ? { type: "direct" } : void 0;
|
|
3494
3935
|
}
|
|
3495
3936
|
function toAnthropicToolInput(input) {
|
|
3496
3937
|
return typeof input === "object" && input !== null && !Array.isArray(input) ? input : { rawInvalidInput: input };
|
|
@@ -3666,14 +4107,13 @@ function formatConstraintValue(value) {
|
|
|
3666
4107
|
|
|
3667
4108
|
// src/anthropic-language-model.ts
|
|
3668
4109
|
function createAnthropicStreamError(error) {
|
|
3669
|
-
var _a, _b, _c;
|
|
3670
4110
|
const inferredMetadata = getAnthropicStreamErrorMetadata(error.type);
|
|
3671
4111
|
return createProviderStreamError({
|
|
3672
4112
|
message: error.message,
|
|
3673
4113
|
type: error.type,
|
|
3674
|
-
code:
|
|
3675
|
-
statusCode:
|
|
3676
|
-
isRetryable:
|
|
4114
|
+
code: error.code ?? void 0,
|
|
4115
|
+
statusCode: error.statusCode ?? inferredMetadata.statusCode,
|
|
4116
|
+
isRetryable: error.isRetryable ?? inferredMetadata.isRetryable,
|
|
3677
4117
|
data: "data" in error ? error.data : error
|
|
3678
4118
|
});
|
|
3679
4119
|
}
|
|
@@ -3701,14 +4141,13 @@ function getAnthropicStreamErrorMetadata(type) {
|
|
|
3701
4141
|
}
|
|
3702
4142
|
}
|
|
3703
4143
|
function createCitationSource(citation, citationDocuments, generateId2) {
|
|
3704
|
-
var _a, _b;
|
|
3705
4144
|
if (citation.type === "web_search_result_location") {
|
|
3706
4145
|
return {
|
|
3707
4146
|
type: "source",
|
|
3708
4147
|
sourceType: "url",
|
|
3709
4148
|
id: generateId2(),
|
|
3710
4149
|
url: citation.url,
|
|
3711
|
-
title:
|
|
4150
|
+
title: citation.title ?? void 0,
|
|
3712
4151
|
providerMetadata: {
|
|
3713
4152
|
anthropic: {
|
|
3714
4153
|
citedText: citation.cited_text,
|
|
@@ -3729,7 +4168,7 @@ function createCitationSource(citation, citationDocuments, generateId2) {
|
|
|
3729
4168
|
sourceType: "document",
|
|
3730
4169
|
id: generateId2(),
|
|
3731
4170
|
mediaType: documentInfo.mediaType,
|
|
3732
|
-
title:
|
|
4171
|
+
title: citation.document_title ?? documentInfo.title,
|
|
3733
4172
|
filename: documentInfo.filename,
|
|
3734
4173
|
providerMetadata: {
|
|
3735
4174
|
anthropic: citation.type === "page_location" ? {
|
|
@@ -3754,6 +4193,24 @@ function getAnthropicCallerMetadata(caller) {
|
|
|
3754
4193
|
const callerInfo = getAnthropicCallerInfo(caller);
|
|
3755
4194
|
return callerInfo == null ? {} : { providerMetadata: { anthropic: { caller: callerInfo } } };
|
|
3756
4195
|
}
|
|
4196
|
+
function getAnthropicToolsetNames(tools) {
|
|
4197
|
+
const toolsetNames = {};
|
|
4198
|
+
for (const tool of tools ?? []) {
|
|
4199
|
+
if (tool.type === "provider" && tool.id === "anthropic.computer_toolset_20260801") {
|
|
4200
|
+
toolsetNames[tool.name] = "computer";
|
|
4201
|
+
}
|
|
4202
|
+
}
|
|
4203
|
+
return toolsetNames;
|
|
4204
|
+
}
|
|
4205
|
+
function toToolsetMemberInput({
|
|
4206
|
+
memberName,
|
|
4207
|
+
input
|
|
4208
|
+
}) {
|
|
4209
|
+
return {
|
|
4210
|
+
action: memberName,
|
|
4211
|
+
...typeof input === "object" && input !== null && !Array.isArray(input) ? input : {}
|
|
4212
|
+
};
|
|
4213
|
+
}
|
|
3757
4214
|
function getProviderOptionsName(provider) {
|
|
3758
4215
|
const dotIndex = provider.indexOf(".");
|
|
3759
4216
|
return dotIndex === -1 ? provider : provider.substring(0, dotIndex);
|
|
@@ -3761,10 +4218,9 @@ function getProviderOptionsName(provider) {
|
|
|
3761
4218
|
var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
3762
4219
|
constructor(modelId, config) {
|
|
3763
4220
|
this.specificationVersion = "v4";
|
|
3764
|
-
var _a;
|
|
3765
4221
|
this.modelId = modelId;
|
|
3766
4222
|
this.config = config;
|
|
3767
|
-
this.generateId =
|
|
4223
|
+
this.generateId = config.generateId ?? generateId;
|
|
3768
4224
|
}
|
|
3769
4225
|
static [WORKFLOW_SERIALIZE](model) {
|
|
3770
4226
|
return serializeModelOptions({
|
|
@@ -3782,8 +4238,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
3782
4238
|
return this.config.provider;
|
|
3783
4239
|
}
|
|
3784
4240
|
get supportedUrls() {
|
|
3785
|
-
|
|
3786
|
-
return (_c = (_b = (_a = this.config).supportedUrls) == null ? void 0 : _b.call(_a)) != null ? _c : {};
|
|
4241
|
+
return this.config.supportedUrls?.() ?? {};
|
|
3787
4242
|
}
|
|
3788
4243
|
static async prepareRequest({
|
|
3789
4244
|
modelId,
|
|
@@ -3807,7 +4262,6 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
3807
4262
|
stream
|
|
3808
4263
|
}
|
|
3809
4264
|
}) {
|
|
3810
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
3811
4265
|
const warnings = [];
|
|
3812
4266
|
if (frequencyPenalty != null) {
|
|
3813
4267
|
warnings.push({ type: "unsupported", feature: "frequencyPenalty" });
|
|
@@ -3833,7 +4287,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
3833
4287
|
});
|
|
3834
4288
|
temperature = 0;
|
|
3835
4289
|
}
|
|
3836
|
-
if (
|
|
4290
|
+
if (responseFormat?.type === "json") {
|
|
3837
4291
|
if (responseFormat.schema == null) {
|
|
3838
4292
|
warnings.push({
|
|
3839
4293
|
type: "unsupported",
|
|
@@ -3856,8 +4310,8 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
3856
4310
|
const usedCustomProviderKey = customProviderOptions != null;
|
|
3857
4311
|
const anthropicOptions = Object.assign(
|
|
3858
4312
|
{},
|
|
3859
|
-
canonicalOptions
|
|
3860
|
-
customProviderOptions
|
|
4313
|
+
canonicalOptions ?? {},
|
|
4314
|
+
customProviderOptions ?? {}
|
|
3861
4315
|
);
|
|
3862
4316
|
const {
|
|
3863
4317
|
maxOutputTokens: maxOutputTokensForModel,
|
|
@@ -3866,6 +4320,9 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
3866
4320
|
rejectsSamplingParameters,
|
|
3867
4321
|
supportsXhighEffort,
|
|
3868
4322
|
rejectsThinkingDisabledAboveHighEffort,
|
|
4323
|
+
rejectsThinkingDisabled,
|
|
4324
|
+
rejectsForcedToolUse,
|
|
4325
|
+
supportsBetweenToolsThinking,
|
|
3869
4326
|
isKnownModel
|
|
3870
4327
|
} = getModelCapabilities(modelId);
|
|
3871
4328
|
if (!isKnownModel && maxOutputTokens == null) {
|
|
@@ -3901,25 +4358,40 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
3901
4358
|
topP = void 0;
|
|
3902
4359
|
}
|
|
3903
4360
|
}
|
|
3904
|
-
const isAnthropicModel = isKnownModel || modelId.includes("claude-");
|
|
3905
|
-
const supportsStructuredOutput = (
|
|
3906
|
-
const supportsStrictTools = (
|
|
3907
|
-
const structureOutputMode =
|
|
3908
|
-
|
|
3909
|
-
|
|
4361
|
+
const isAnthropicModel = isKnownModel || modelId.includes("claude-");
|
|
4362
|
+
const supportsStructuredOutput = (config.supportsNativeStructuredOutput ?? true) && modelSupportsStructuredOutput;
|
|
4363
|
+
const supportsStrictTools = (config.supportsStrictTools ?? true) && modelSupportsStructuredOutput;
|
|
4364
|
+
const structureOutputMode = anthropicOptions?.structuredOutputMode ?? "auto";
|
|
4365
|
+
let useStructuredOutput = structureOutputMode === "outputFormat" || structureOutputMode === "auto" && supportsStructuredOutput;
|
|
4366
|
+
if (!useStructuredOutput && rejectsForcedToolUse && supportsStructuredOutput && responseFormat?.type === "json" && responseFormat.schema != null) {
|
|
4367
|
+
warnings.push({
|
|
4368
|
+
type: "unsupported",
|
|
4369
|
+
feature: "providerOptions.anthropic.structuredOutputMode",
|
|
4370
|
+
details: `structuredOutputMode 'jsonTool' is not supported by ${modelId} because it rejects forced tool use. Using 'outputFormat' instead.`
|
|
4371
|
+
});
|
|
4372
|
+
useStructuredOutput = true;
|
|
4373
|
+
}
|
|
4374
|
+
const jsonResponseTool = responseFormat?.type === "json" && responseFormat.schema != null && !useStructuredOutput ? {
|
|
3910
4375
|
type: "function",
|
|
3911
4376
|
name: "json",
|
|
3912
4377
|
description: "Respond with a JSON object.",
|
|
3913
4378
|
inputSchema: responseFormat.schema
|
|
3914
4379
|
} : void 0;
|
|
3915
|
-
if (jsonResponseTool != null &&
|
|
4380
|
+
if (jsonResponseTool != null && anthropicOptions?.disableParallelToolUse === false) {
|
|
3916
4381
|
warnings.push({
|
|
3917
4382
|
type: "unsupported",
|
|
3918
4383
|
feature: "providerOptions.anthropic.disableParallelToolUse",
|
|
3919
4384
|
details: "`disableParallelToolUse: false` is ignored when using the JSON response tool. Parallel tool use is disabled to ensure a single coherent JSON tool call."
|
|
3920
4385
|
});
|
|
3921
4386
|
}
|
|
3922
|
-
const contextManagement = anthropicOptions
|
|
4387
|
+
const contextManagement = anthropicOptions?.contextManagement;
|
|
4388
|
+
const compaction = anthropicOptions?.compaction;
|
|
4389
|
+
if (contextManagement != null && compaction != null) {
|
|
4390
|
+
throw new InvalidArgumentError({
|
|
4391
|
+
argument: "providerOptions",
|
|
4392
|
+
message: "Anthropic provider options `compaction` and `contextManagement` cannot be used together."
|
|
4393
|
+
});
|
|
4394
|
+
}
|
|
3923
4395
|
const cacheControlValidator = new CacheControlValidator();
|
|
3924
4396
|
const toolNameMapping = createToolNameMapping({
|
|
3925
4397
|
tools,
|
|
@@ -3929,6 +4401,8 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
3929
4401
|
"anthropic.code_execution_20260120": "code_execution",
|
|
3930
4402
|
"anthropic.computer_20241022": "computer",
|
|
3931
4403
|
"anthropic.computer_20250124": "computer",
|
|
4404
|
+
"anthropic.computer_20251124": "computer",
|
|
4405
|
+
"anthropic.computer_toolset_20260801": "computer",
|
|
3932
4406
|
"anthropic.text_editor_20241022": "str_replace_editor",
|
|
3933
4407
|
"anthropic.text_editor_20250124": "str_replace_editor",
|
|
3934
4408
|
"anthropic.text_editor_20250429": "str_replace_based_edit_tool",
|
|
@@ -3938,25 +4412,32 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
3938
4412
|
"anthropic.memory_20250818": "memory",
|
|
3939
4413
|
"anthropic.web_search_20250305": "web_search",
|
|
3940
4414
|
"anthropic.web_search_20260209": "web_search",
|
|
4415
|
+
"anthropic.web_search_20260318": "web_search",
|
|
3941
4416
|
"anthropic.web_fetch_20250910": "web_fetch",
|
|
3942
4417
|
"anthropic.web_fetch_20260209": "web_fetch",
|
|
4418
|
+
"anthropic.web_fetch_20260318": "web_fetch",
|
|
3943
4419
|
"anthropic.tool_search_regex_20251119": "tool_search_tool_regex",
|
|
3944
4420
|
"anthropic.tool_search_bm25_20251119": "tool_search_tool_bm25",
|
|
3945
4421
|
"anthropic.advisor_20260301": "advisor"
|
|
3946
4422
|
}
|
|
3947
4423
|
});
|
|
4424
|
+
const toolsetNames = getAnthropicToolsetNames(tools);
|
|
3948
4425
|
const { prompt: messagesPrompt, betas } = await convertToAnthropicPrompt({
|
|
3949
4426
|
prompt,
|
|
3950
|
-
sendReasoning:
|
|
4427
|
+
sendReasoning: anthropicOptions?.sendReasoning ?? true,
|
|
3951
4428
|
warnings,
|
|
3952
4429
|
cacheControlValidator,
|
|
3953
|
-
toolNameMapping
|
|
4430
|
+
toolNameMapping,
|
|
4431
|
+
toolsetNames
|
|
3954
4432
|
});
|
|
3955
|
-
if (isCustomReasoning(reasoning) &&
|
|
4433
|
+
if (isCustomReasoning(reasoning) && anthropicOptions?.effort == null) {
|
|
3956
4434
|
const reasoningConfig = resolveAnthropicReasoningConfig({
|
|
3957
4435
|
reasoning,
|
|
4436
|
+
modelId,
|
|
3958
4437
|
supportsAdaptiveThinking,
|
|
3959
4438
|
supportsXhighEffort,
|
|
4439
|
+
rejectsThinkingDisabled,
|
|
4440
|
+
supportsBetweenToolsThinking,
|
|
3960
4441
|
maxOutputTokensForModel,
|
|
3961
4442
|
warnings
|
|
3962
4443
|
});
|
|
@@ -3964,12 +4445,37 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
3964
4445
|
if (anthropicOptions.thinking == null) {
|
|
3965
4446
|
anthropicOptions.thinking = reasoningConfig.thinking;
|
|
3966
4447
|
}
|
|
3967
|
-
if (reasoningConfig.effort != null &&
|
|
4448
|
+
if (reasoningConfig.effort != null && anthropicOptions.thinking?.type !== "disabled") {
|
|
3968
4449
|
anthropicOptions.effort = reasoningConfig.effort;
|
|
3969
4450
|
}
|
|
3970
4451
|
}
|
|
3971
4452
|
}
|
|
3972
|
-
if (
|
|
4453
|
+
if (rejectsThinkingDisabled && anthropicOptions?.thinking != null) {
|
|
4454
|
+
const thinking = anthropicOptions.thinking;
|
|
4455
|
+
if (thinking.type === "disabled" && supportsBetweenToolsThinking) {
|
|
4456
|
+
warnings.push({
|
|
4457
|
+
type: "unsupported",
|
|
4458
|
+
feature: "providerOptions.anthropic.thinking",
|
|
4459
|
+
details: `thinking cannot be disabled for ${modelId}. Using 'between_tools' thinking, the lowest thinking setting, instead.`
|
|
4460
|
+
});
|
|
4461
|
+
anthropicOptions.thinking = { type: "between_tools" };
|
|
4462
|
+
} else if (thinking.type === "disabled") {
|
|
4463
|
+
warnings.push({
|
|
4464
|
+
type: "unsupported",
|
|
4465
|
+
feature: "providerOptions.anthropic.thinking",
|
|
4466
|
+
details: `thinking cannot be disabled for ${modelId}; it always uses adaptive thinking. The thinking setting has been removed. Lower 'effort' to reduce thinking.`
|
|
4467
|
+
});
|
|
4468
|
+
anthropicOptions.thinking = void 0;
|
|
4469
|
+
} else if (thinking.type === "enabled") {
|
|
4470
|
+
warnings.push({
|
|
4471
|
+
type: "unsupported",
|
|
4472
|
+
feature: "providerOptions.anthropic.thinking",
|
|
4473
|
+
details: `budget-based thinking is not supported by ${modelId}; it always uses adaptive thinking. Using adaptive thinking instead. Use 'effort' to control how much the model thinks.`
|
|
4474
|
+
});
|
|
4475
|
+
anthropicOptions.thinking = { type: "adaptive" };
|
|
4476
|
+
}
|
|
4477
|
+
}
|
|
4478
|
+
if (rejectsThinkingDisabledAboveHighEffort && anthropicOptions?.thinking?.type === "disabled" && (anthropicOptions.effort === "xhigh" || anthropicOptions.effort === "max")) {
|
|
3973
4479
|
warnings.push({
|
|
3974
4480
|
type: "unsupported",
|
|
3975
4481
|
feature: "providerOptions.anthropic.effort",
|
|
@@ -3977,13 +4483,21 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
3977
4483
|
});
|
|
3978
4484
|
anthropicOptions.effort = "high";
|
|
3979
4485
|
}
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
4486
|
+
if (anthropicOptions?.thinking?.type === "between_tools" && (anthropicOptions.effort === "xhigh" || anthropicOptions.effort === "max")) {
|
|
4487
|
+
warnings.push({
|
|
4488
|
+
type: "unsupported",
|
|
4489
|
+
feature: "providerOptions.anthropic.effort",
|
|
4490
|
+
details: `effort '${anthropicOptions.effort}' is not supported with 'between_tools' thinking. The effort has been lowered to 'high'.`
|
|
4491
|
+
});
|
|
4492
|
+
anthropicOptions.effort = "high";
|
|
4493
|
+
}
|
|
4494
|
+
const thinkingType = anthropicOptions?.thinking?.type;
|
|
4495
|
+
const isThinking = thinkingType === "enabled" || thinkingType === "adaptive" || thinkingType === "between_tools";
|
|
4496
|
+
const thinkingBlockBinding = anthropicOptions?.thinking != null && "blockBinding" in anthropicOptions.thinking ? anthropicOptions.thinking.blockBinding : void 0;
|
|
3983
4497
|
const sendThinking = isThinking || thinkingType === "disabled" || thinkingBlockBinding != null;
|
|
3984
|
-
let thinkingBudget = thinkingType === "enabled" ?
|
|
3985
|
-
const thinkingDisplay = thinkingType === "adaptive" ?
|
|
3986
|
-
const maxTokens = maxOutputTokens
|
|
4498
|
+
let thinkingBudget = thinkingType === "enabled" ? anthropicOptions?.thinking?.budgetTokens : void 0;
|
|
4499
|
+
const thinkingDisplay = thinkingType === "adaptive" ? anthropicOptions?.thinking?.display : void 0;
|
|
4500
|
+
const maxTokens = maxOutputTokens ?? maxOutputTokensForModel;
|
|
3987
4501
|
const baseArgs = {
|
|
3988
4502
|
// model id:
|
|
3989
4503
|
model: modelId,
|
|
@@ -4006,12 +4520,12 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4006
4520
|
}
|
|
4007
4521
|
}
|
|
4008
4522
|
},
|
|
4009
|
-
...(
|
|
4523
|
+
...(anthropicOptions?.effort || anthropicOptions?.taskBudget || useStructuredOutput && responseFormat?.type === "json" && responseFormat.schema != null) && {
|
|
4010
4524
|
output_config: {
|
|
4011
|
-
...
|
|
4525
|
+
...anthropicOptions?.effort && {
|
|
4012
4526
|
effort: anthropicOptions.effort
|
|
4013
4527
|
},
|
|
4014
|
-
...
|
|
4528
|
+
...anthropicOptions?.taskBudget && {
|
|
4015
4529
|
task_budget: {
|
|
4016
4530
|
type: anthropicOptions.taskBudget.type,
|
|
4017
4531
|
total: anthropicOptions.taskBudget.total,
|
|
@@ -4020,7 +4534,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4020
4534
|
}
|
|
4021
4535
|
}
|
|
4022
4536
|
},
|
|
4023
|
-
...useStructuredOutput &&
|
|
4537
|
+
...useStructuredOutput && responseFormat?.type === "json" && responseFormat.schema != null && {
|
|
4024
4538
|
format: {
|
|
4025
4539
|
type: "json_schema",
|
|
4026
4540
|
schema: sanitizeJsonSchema(responseFormat.schema)
|
|
@@ -4028,26 +4542,26 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4028
4542
|
}
|
|
4029
4543
|
}
|
|
4030
4544
|
},
|
|
4031
|
-
...
|
|
4545
|
+
...anthropicOptions?.speed && {
|
|
4032
4546
|
speed: anthropicOptions.speed
|
|
4033
4547
|
},
|
|
4034
|
-
...
|
|
4548
|
+
...anthropicOptions?.serviceTier && {
|
|
4035
4549
|
service_tier: anthropicOptions.serviceTier
|
|
4036
4550
|
},
|
|
4037
|
-
...
|
|
4551
|
+
...anthropicOptions?.inferenceGeo && {
|
|
4038
4552
|
inference_geo: anthropicOptions.inferenceGeo
|
|
4039
4553
|
},
|
|
4040
|
-
...
|
|
4554
|
+
...anthropicOptions?.fallbacks != null && (anthropicOptions.fallbacks === "default" || anthropicOptions.fallbacks.length > 0) && {
|
|
4041
4555
|
fallbacks: anthropicOptions.fallbacks
|
|
4042
4556
|
},
|
|
4043
|
-
...
|
|
4557
|
+
...anthropicOptions?.cacheControl && {
|
|
4044
4558
|
cache_control: anthropicOptions.cacheControl
|
|
4045
4559
|
},
|
|
4046
|
-
...
|
|
4560
|
+
...anthropicOptions?.metadata?.userId != null && {
|
|
4047
4561
|
metadata: { user_id: anthropicOptions.metadata.userId }
|
|
4048
4562
|
},
|
|
4049
4563
|
// mcp servers:
|
|
4050
|
-
...
|
|
4564
|
+
...anthropicOptions?.mcpServers && anthropicOptions.mcpServers.length > 0 && {
|
|
4051
4565
|
mcp_servers: anthropicOptions.mcpServers.map((server) => ({
|
|
4052
4566
|
type: server.type,
|
|
4053
4567
|
name: server.name,
|
|
@@ -4060,7 +4574,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4060
4574
|
}))
|
|
4061
4575
|
},
|
|
4062
4576
|
// container: For programmatic tool calling (just an ID string) or agent skills (object with id and skills)
|
|
4063
|
-
...
|
|
4577
|
+
...anthropicOptions?.container && {
|
|
4064
4578
|
container: anthropicOptions.container.skills && anthropicOptions.container.skills.length > 0 ? (
|
|
4065
4579
|
// Object format when skills are provided (agent skills feature)
|
|
4066
4580
|
{
|
|
@@ -4082,6 +4596,22 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4082
4596
|
// prompt:
|
|
4083
4597
|
system: messagesPrompt.system,
|
|
4084
4598
|
messages: messagesPrompt.messages,
|
|
4599
|
+
...anthropicOptions?.safeguards && anthropicOptions.safeguards.length > 0 && {
|
|
4600
|
+
safeguards: anthropicOptions.safeguards.map((safeguard) => ({
|
|
4601
|
+
type: safeguard.type,
|
|
4602
|
+
...safeguard.classifierContext !== void 0 && {
|
|
4603
|
+
classifier_context: safeguard.classifierContext
|
|
4604
|
+
}
|
|
4605
|
+
}))
|
|
4606
|
+
},
|
|
4607
|
+
...compaction && {
|
|
4608
|
+
compaction: {
|
|
4609
|
+
type: compaction.type,
|
|
4610
|
+
...compaction.instructions !== void 0 && {
|
|
4611
|
+
instructions: compaction.instructions
|
|
4612
|
+
}
|
|
4613
|
+
}
|
|
4614
|
+
},
|
|
4085
4615
|
...contextManagement && {
|
|
4086
4616
|
context_management: {
|
|
4087
4617
|
edits: contextManagement.edits.map((edit) => {
|
|
@@ -4170,7 +4700,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4170
4700
|
details: "topP is not supported when thinking is enabled"
|
|
4171
4701
|
});
|
|
4172
4702
|
}
|
|
4173
|
-
baseArgs.max_tokens = maxTokens + (thinkingBudget
|
|
4703
|
+
baseArgs.max_tokens = maxTokens + (thinkingBudget ?? 0);
|
|
4174
4704
|
} else {
|
|
4175
4705
|
if (isAnthropicModel && topP != null && temperature != null) {
|
|
4176
4706
|
warnings.push({
|
|
@@ -4191,32 +4721,38 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4191
4721
|
}
|
|
4192
4722
|
baseArgs.max_tokens = maxOutputTokensForModel;
|
|
4193
4723
|
}
|
|
4194
|
-
if (
|
|
4724
|
+
if (anthropicOptions?.mcpServers && anthropicOptions.mcpServers.length > 0) {
|
|
4195
4725
|
betas.add("mcp-client-2025-04-04");
|
|
4196
4726
|
}
|
|
4727
|
+
if (anthropicOptions?.safeguards && anthropicOptions.safeguards.length > 0) {
|
|
4728
|
+
betas.add("dangerous-tool-use-2026-09-03");
|
|
4729
|
+
}
|
|
4730
|
+
if (compaction) {
|
|
4731
|
+
betas.add("compact-2026-09-04");
|
|
4732
|
+
}
|
|
4197
4733
|
if (contextManagement) {
|
|
4198
4734
|
betas.add("context-management-2025-06-27");
|
|
4199
4735
|
if (contextManagement.edits.some((e) => e.type === "compact_20260112")) {
|
|
4200
4736
|
betas.add("compact-2026-01-12");
|
|
4201
4737
|
}
|
|
4202
4738
|
}
|
|
4203
|
-
if (
|
|
4739
|
+
if (anthropicOptions?.container && anthropicOptions.container.skills && anthropicOptions.container.skills.length > 0) {
|
|
4204
4740
|
betas.add("code-execution-2025-08-25");
|
|
4205
4741
|
betas.add("skills-2025-10-02");
|
|
4206
4742
|
betas.add("files-api-2025-04-14");
|
|
4207
|
-
if (!
|
|
4743
|
+
if (!tools?.some(
|
|
4208
4744
|
(tool) => tool.type === "provider" && (tool.id === "anthropic.code_execution_20250825" || tool.id === "anthropic.code_execution_20260120")
|
|
4209
|
-
))
|
|
4745
|
+
)) {
|
|
4210
4746
|
warnings.push({
|
|
4211
4747
|
type: "other",
|
|
4212
4748
|
message: "code execution tool is required when using skills"
|
|
4213
4749
|
});
|
|
4214
4750
|
}
|
|
4215
4751
|
}
|
|
4216
|
-
if (anthropicOptions
|
|
4752
|
+
if (anthropicOptions?.taskBudget) {
|
|
4217
4753
|
betas.add("task-budgets-2026-03-13");
|
|
4218
4754
|
}
|
|
4219
|
-
if (
|
|
4755
|
+
if (anthropicOptions?.speed === "fast") {
|
|
4220
4756
|
betas.add("fast-mode-2026-02-01");
|
|
4221
4757
|
}
|
|
4222
4758
|
if (thinkingDisplay === "updates") {
|
|
@@ -4225,12 +4761,12 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4225
4761
|
if (thinkingBlockBinding != null) {
|
|
4226
4762
|
betas.add("thinking-binding-controls-2026-08-01");
|
|
4227
4763
|
}
|
|
4228
|
-
if (
|
|
4764
|
+
if (anthropicOptions?.fallbacks === "default") {
|
|
4229
4765
|
betas.add("server-side-fallback-2026-07-01");
|
|
4230
|
-
} else if (
|
|
4766
|
+
} else if (anthropicOptions?.fallbacks && anthropicOptions.fallbacks.length > 0) {
|
|
4231
4767
|
betas.add("server-side-fallback-2026-06-01");
|
|
4232
4768
|
}
|
|
4233
|
-
const defaultEagerInputStreaming = stream && (
|
|
4769
|
+
const defaultEagerInputStreaming = stream && (anthropicOptions?.toolStreaming ?? true);
|
|
4234
4770
|
const {
|
|
4235
4771
|
tools: anthropicTools2,
|
|
4236
4772
|
toolChoice: anthropicToolChoice,
|
|
@@ -4238,21 +4774,23 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4238
4774
|
betas: toolsBetas
|
|
4239
4775
|
} = await prepareTools(
|
|
4240
4776
|
jsonResponseTool != null ? {
|
|
4241
|
-
tools: [...tools
|
|
4777
|
+
tools: [...tools ?? [], jsonResponseTool],
|
|
4242
4778
|
toolChoice: { type: "required" },
|
|
4243
4779
|
disableParallelToolUse: true,
|
|
4244
4780
|
cacheControlValidator,
|
|
4245
4781
|
supportsStructuredOutput: false,
|
|
4246
4782
|
supportsStrictTools,
|
|
4247
|
-
defaultEagerInputStreaming
|
|
4783
|
+
defaultEagerInputStreaming,
|
|
4784
|
+
rejectsForcedToolUse
|
|
4248
4785
|
} : {
|
|
4249
|
-
tools: tools
|
|
4786
|
+
tools: tools ?? [],
|
|
4250
4787
|
toolChoice,
|
|
4251
|
-
disableParallelToolUse: anthropicOptions
|
|
4788
|
+
disableParallelToolUse: anthropicOptions?.disableParallelToolUse,
|
|
4252
4789
|
cacheControlValidator,
|
|
4253
4790
|
supportsStructuredOutput,
|
|
4254
4791
|
supportsStrictTools,
|
|
4255
|
-
defaultEagerInputStreaming
|
|
4792
|
+
defaultEagerInputStreaming,
|
|
4793
|
+
rejectsForcedToolUse
|
|
4256
4794
|
}
|
|
4257
4795
|
);
|
|
4258
4796
|
const cacheWarnings = cacheControlValidator.getWarnings();
|
|
@@ -4269,7 +4807,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4269
4807
|
...betas,
|
|
4270
4808
|
...toolsBetas,
|
|
4271
4809
|
...userSuppliedBetas,
|
|
4272
|
-
...
|
|
4810
|
+
...anthropicOptions?.anthropicBeta ?? []
|
|
4273
4811
|
]),
|
|
4274
4812
|
usesJsonResponseTool: jsonResponseTool != null,
|
|
4275
4813
|
toolNameMapping,
|
|
@@ -4295,10 +4833,9 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4295
4833
|
);
|
|
4296
4834
|
}
|
|
4297
4835
|
async getBetasFromHeaders(requestHeaders) {
|
|
4298
|
-
var _a, _b;
|
|
4299
4836
|
const configHeaders = this.config.headers ? await resolve(this.config.headers) : void 0;
|
|
4300
|
-
const configBetaHeader =
|
|
4301
|
-
const requestBetaHeader =
|
|
4837
|
+
const configBetaHeader = configHeaders?.["anthropic-beta"] ?? "";
|
|
4838
|
+
const requestBetaHeader = requestHeaders?.["anthropic-beta"] ?? "";
|
|
4302
4839
|
return new Set(
|
|
4303
4840
|
[
|
|
4304
4841
|
...configBetaHeader.toLowerCase().split(","),
|
|
@@ -4307,38 +4844,33 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4307
4844
|
);
|
|
4308
4845
|
}
|
|
4309
4846
|
buildRequestUrl(isStreaming) {
|
|
4310
|
-
|
|
4311
|
-
return (_c = (_b = (_a = this.config).buildRequestUrl) == null ? void 0 : _b.call(_a, this.config.baseURL, isStreaming)) != null ? _c : `${this.config.baseURL}/messages`;
|
|
4847
|
+
return this.config.buildRequestUrl?.(this.config.baseURL, isStreaming) ?? `${this.config.baseURL}/messages`;
|
|
4312
4848
|
}
|
|
4313
4849
|
transformRequestBody(args, betas) {
|
|
4314
|
-
|
|
4315
|
-
return (_c = (_b = (_a = this.config).transformRequestBody) == null ? void 0 : _b.call(_a, args, betas)) != null ? _c : args;
|
|
4850
|
+
return this.config.transformRequestBody?.(args, betas) ?? args;
|
|
4316
4851
|
}
|
|
4317
4852
|
extractCitationDocuments(prompt) {
|
|
4318
4853
|
const isCitationPart = (part) => {
|
|
4319
|
-
var _a, _b;
|
|
4320
4854
|
if (part.type !== "file") {
|
|
4321
4855
|
return false;
|
|
4322
4856
|
}
|
|
4323
4857
|
if (part.mediaType !== "application/pdf" && part.mediaType !== "text/plain") {
|
|
4324
4858
|
return false;
|
|
4325
4859
|
}
|
|
4326
|
-
const anthropic =
|
|
4327
|
-
const citationsConfig = anthropic
|
|
4328
|
-
return
|
|
4860
|
+
const anthropic = part.providerOptions?.anthropic;
|
|
4861
|
+
const citationsConfig = anthropic?.citations;
|
|
4862
|
+
return citationsConfig?.enabled ?? false;
|
|
4329
4863
|
};
|
|
4330
4864
|
return prompt.filter((message) => message.role === "user").flatMap((message) => message.content).filter(isCitationPart).map((part) => {
|
|
4331
|
-
var _a;
|
|
4332
4865
|
const filePart = part;
|
|
4333
4866
|
return {
|
|
4334
|
-
title:
|
|
4867
|
+
title: filePart.filename ?? "Untitled Document",
|
|
4335
4868
|
filename: filePart.filename,
|
|
4336
4869
|
mediaType: filePart.mediaType
|
|
4337
4870
|
};
|
|
4338
4871
|
});
|
|
4339
4872
|
}
|
|
4340
4873
|
async doGenerate(options) {
|
|
4341
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4342
4874
|
const {
|
|
4343
4875
|
args,
|
|
4344
4876
|
warnings,
|
|
@@ -4355,9 +4887,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4355
4887
|
const citationDocuments = [
|
|
4356
4888
|
...this.extractCitationDocuments(options.prompt)
|
|
4357
4889
|
];
|
|
4358
|
-
const markCodeExecutionDynamic =
|
|
4359
|
-
args.tools
|
|
4360
|
-
);
|
|
4890
|
+
const markCodeExecutionDynamic = hasDynamicFilteringWebToolWithoutCodeExecution(args.tools);
|
|
4361
4891
|
const {
|
|
4362
4892
|
responseHeaders,
|
|
4363
4893
|
value: response,
|
|
@@ -4381,7 +4911,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4381
4911
|
switch (part.type) {
|
|
4382
4912
|
case "text": {
|
|
4383
4913
|
if (!usesJsonResponseTool) {
|
|
4384
|
-
const webSearchCitations =
|
|
4914
|
+
const webSearchCitations = part.citations?.filter(
|
|
4385
4915
|
(citation) => citation.type === "web_search_result_location"
|
|
4386
4916
|
);
|
|
4387
4917
|
content.push({
|
|
@@ -4443,12 +4973,18 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4443
4973
|
break;
|
|
4444
4974
|
}
|
|
4445
4975
|
case "compaction": {
|
|
4976
|
+
if (!part.content) {
|
|
4977
|
+
break;
|
|
4978
|
+
}
|
|
4446
4979
|
content.push({
|
|
4447
4980
|
type: "text",
|
|
4448
4981
|
text: part.content,
|
|
4449
4982
|
providerMetadata: {
|
|
4450
4983
|
anthropic: {
|
|
4451
|
-
type: "compaction"
|
|
4984
|
+
type: "compaction",
|
|
4985
|
+
...part.signature != null && {
|
|
4986
|
+
signature: part.signature
|
|
4987
|
+
}
|
|
4452
4988
|
}
|
|
4453
4989
|
}
|
|
4454
4990
|
});
|
|
@@ -4462,6 +4998,24 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4462
4998
|
type: "text",
|
|
4463
4999
|
text: JSON.stringify(part.input)
|
|
4464
5000
|
});
|
|
5001
|
+
} else if (part.toolset_name != null) {
|
|
5002
|
+
content.push({
|
|
5003
|
+
type: "tool-call",
|
|
5004
|
+
toolCallId: part.id,
|
|
5005
|
+
toolName: toolNameMapping.toCustomToolName(part.toolset_name),
|
|
5006
|
+
input: JSON.stringify(
|
|
5007
|
+
toToolsetMemberInput({
|
|
5008
|
+
memberName: part.name,
|
|
5009
|
+
input: part.input
|
|
5010
|
+
})
|
|
5011
|
+
),
|
|
5012
|
+
providerMetadata: {
|
|
5013
|
+
anthropic: {
|
|
5014
|
+
toolsetName: part.toolset_name,
|
|
5015
|
+
...getAnthropicCallerMetadata(part.caller).providerMetadata?.anthropic
|
|
5016
|
+
}
|
|
5017
|
+
}
|
|
5018
|
+
});
|
|
4465
5019
|
} else {
|
|
4466
5020
|
content.push({
|
|
4467
5021
|
type: "tool-call",
|
|
@@ -4559,7 +5113,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4559
5113
|
case "web_fetch_tool_result": {
|
|
4560
5114
|
if (part.content.type === "web_fetch_result") {
|
|
4561
5115
|
citationDocuments.push({
|
|
4562
|
-
title:
|
|
5116
|
+
title: part.content.content.title ?? part.content.url,
|
|
4563
5117
|
mediaType: part.content.content.source.media_type
|
|
4564
5118
|
});
|
|
4565
5119
|
content.push({
|
|
@@ -4604,16 +5158,13 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4604
5158
|
type: "tool-result",
|
|
4605
5159
|
toolCallId: part.tool_use_id,
|
|
4606
5160
|
toolName: toolNameMapping.toCustomToolName("web_search"),
|
|
4607
|
-
result: part.content.map((result) => {
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
type: result.type
|
|
4615
|
-
};
|
|
4616
|
-
}),
|
|
5161
|
+
result: part.content.map((result) => ({
|
|
5162
|
+
url: result.url,
|
|
5163
|
+
...result.title != null ? { title: result.title } : {},
|
|
5164
|
+
pageAge: result.page_age ?? null,
|
|
5165
|
+
encryptedContent: result.encrypted_content,
|
|
5166
|
+
type: result.type
|
|
5167
|
+
})),
|
|
4617
5168
|
...getAnthropicCallerMetadata(part.caller)
|
|
4618
5169
|
});
|
|
4619
5170
|
for (const result of part.content) {
|
|
@@ -4625,7 +5176,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4625
5176
|
...result.title != null ? { title: result.title } : {},
|
|
4626
5177
|
providerMetadata: {
|
|
4627
5178
|
anthropic: {
|
|
4628
|
-
pageAge:
|
|
5179
|
+
pageAge: result.page_age ?? null
|
|
4629
5180
|
}
|
|
4630
5181
|
}
|
|
4631
5182
|
});
|
|
@@ -4657,7 +5208,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4657
5208
|
stdout: part.content.stdout,
|
|
4658
5209
|
stderr: part.content.stderr,
|
|
4659
5210
|
return_code: part.content.return_code,
|
|
4660
|
-
content:
|
|
5211
|
+
content: part.content.content ?? []
|
|
4661
5212
|
}
|
|
4662
5213
|
});
|
|
4663
5214
|
} else if (part.content.type === "encrypted_code_execution_result") {
|
|
@@ -4670,7 +5221,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4670
5221
|
encrypted_stdout: part.content.encrypted_stdout,
|
|
4671
5222
|
stderr: part.content.stderr,
|
|
4672
5223
|
return_code: part.content.return_code,
|
|
4673
|
-
content:
|
|
5224
|
+
content: part.content.content ?? []
|
|
4674
5225
|
}
|
|
4675
5226
|
});
|
|
4676
5227
|
} else if (part.content.type === "code_execution_tool_result_error") {
|
|
@@ -4798,25 +5349,25 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4798
5349
|
finishReason: response.stop_reason,
|
|
4799
5350
|
isJsonResponseFromTool
|
|
4800
5351
|
}),
|
|
4801
|
-
raw:
|
|
5352
|
+
raw: response.stop_reason ?? void 0
|
|
4802
5353
|
},
|
|
4803
5354
|
usage: convertAnthropicUsage({ usage: response.usage }),
|
|
4804
5355
|
request: { body: args },
|
|
4805
5356
|
response: {
|
|
4806
|
-
id:
|
|
4807
|
-
modelId:
|
|
5357
|
+
id: response.id ?? void 0,
|
|
5358
|
+
modelId: response.model ?? void 0,
|
|
4808
5359
|
headers: responseHeaders,
|
|
4809
5360
|
body: rawResponse
|
|
4810
5361
|
},
|
|
4811
5362
|
warnings,
|
|
4812
5363
|
providerMetadata: (() => {
|
|
4813
|
-
var _a2, _b2, _c2, _d2;
|
|
4814
5364
|
const stopDetails = mapAnthropicStopDetails(response.stop_details);
|
|
4815
5365
|
const anthropicMetadata = {
|
|
4816
5366
|
usage: response.usage,
|
|
4817
|
-
stopSequence:
|
|
5367
|
+
stopSequence: response.stop_sequence ?? null,
|
|
4818
5368
|
...stopDetails != null ? { stopDetails } : {},
|
|
4819
5369
|
...response.input_transformations != null ? { inputTransformations: response.input_transformations } : {},
|
|
5370
|
+
...response.safeguard_results != null ? { safeguardResults: response.safeguard_results } : {},
|
|
4820
5371
|
iterations: response.usage.iterations ? response.usage.iterations.map(
|
|
4821
5372
|
(iter) => ({
|
|
4822
5373
|
type: iter.type,
|
|
@@ -4834,15 +5385,15 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4834
5385
|
container: response.container ? {
|
|
4835
5386
|
expiresAt: response.container.expires_at,
|
|
4836
5387
|
id: response.container.id,
|
|
4837
|
-
skills:
|
|
5388
|
+
skills: response.container.skills?.map((skill) => ({
|
|
4838
5389
|
type: skill.type,
|
|
4839
5390
|
skillId: skill.skill_id,
|
|
4840
5391
|
version: skill.version
|
|
4841
|
-
}))
|
|
5392
|
+
})) ?? null
|
|
4842
5393
|
} : null,
|
|
4843
|
-
contextManagement:
|
|
5394
|
+
contextManagement: mapAnthropicResponseContextManagement(
|
|
4844
5395
|
response.context_management
|
|
4845
|
-
)
|
|
5396
|
+
) ?? null
|
|
4846
5397
|
};
|
|
4847
5398
|
const providerMetadata = {
|
|
4848
5399
|
anthropic: anthropicMetadata
|
|
@@ -4856,7 +5407,6 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4856
5407
|
}
|
|
4857
5408
|
async doStream(options) {
|
|
4858
5409
|
"use step";
|
|
4859
|
-
var _a, _b, _c, _d;
|
|
4860
5410
|
const {
|
|
4861
5411
|
args: body,
|
|
4862
5412
|
warnings,
|
|
@@ -4873,9 +5423,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4873
5423
|
const citationDocuments = [
|
|
4874
5424
|
...this.extractCitationDocuments(options.prompt)
|
|
4875
5425
|
];
|
|
4876
|
-
const markCodeExecutionDynamic =
|
|
4877
|
-
body.tools
|
|
4878
|
-
);
|
|
5426
|
+
const markCodeExecutionDynamic = hasDynamicFilteringWebToolWithoutCodeExecution(body.tools);
|
|
4879
5427
|
const url = this.buildRequestUrl(true);
|
|
4880
5428
|
const { responseHeaders, value: response } = await postJsonToApi({
|
|
4881
5429
|
url,
|
|
@@ -4905,6 +5453,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4905
5453
|
let stopSequence = null;
|
|
4906
5454
|
let stopDetails = void 0;
|
|
4907
5455
|
let inputTransformations;
|
|
5456
|
+
let safeguardResults;
|
|
4908
5457
|
let container = null;
|
|
4909
5458
|
let isJsonResponseFromTool = false;
|
|
4910
5459
|
let isMessageOpen = false;
|
|
@@ -4918,7 +5467,6 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4918
5467
|
controller.enqueue({ type: "stream-start", warnings });
|
|
4919
5468
|
},
|
|
4920
5469
|
transform(chunk, controller) {
|
|
4921
|
-
var _a2, _b2, _c2, _d2, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
4922
5470
|
if (hasInvalidMessageSequence) {
|
|
4923
5471
|
return;
|
|
4924
5472
|
}
|
|
@@ -4987,10 +5535,20 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4987
5535
|
id: String(value.index),
|
|
4988
5536
|
providerMetadata: {
|
|
4989
5537
|
anthropic: {
|
|
4990
|
-
type: "compaction"
|
|
5538
|
+
type: "compaction",
|
|
5539
|
+
...part.signature != null && {
|
|
5540
|
+
signature: part.signature
|
|
5541
|
+
}
|
|
4991
5542
|
}
|
|
4992
5543
|
}
|
|
4993
5544
|
});
|
|
5545
|
+
if (part.signature != null && part.content != null && part.content !== "") {
|
|
5546
|
+
controller.enqueue({
|
|
5547
|
+
type: "text-delta",
|
|
5548
|
+
id: String(value.index),
|
|
5549
|
+
delta: part.content
|
|
5550
|
+
});
|
|
5551
|
+
}
|
|
4994
5552
|
return;
|
|
4995
5553
|
}
|
|
4996
5554
|
case "tool_use": {
|
|
@@ -5005,6 +5563,29 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5005
5563
|
type: "text-start",
|
|
5006
5564
|
id: String(value.index)
|
|
5007
5565
|
});
|
|
5566
|
+
} else if (part.toolset_name != null) {
|
|
5567
|
+
const callerInfo = getAnthropicCallerInfo(part.caller);
|
|
5568
|
+
const customToolName = toolNameMapping.toCustomToolName(
|
|
5569
|
+
part.toolset_name
|
|
5570
|
+
);
|
|
5571
|
+
const hasNonEmptyInput = part.input && Object.keys(part.input).length > 0;
|
|
5572
|
+
contentBlocks[value.index] = {
|
|
5573
|
+
type: "tool-call",
|
|
5574
|
+
toolCallId: part.id,
|
|
5575
|
+
toolName: customToolName,
|
|
5576
|
+
input: hasNonEmptyInput ? JSON.stringify(part.input) : "",
|
|
5577
|
+
firstDelta: true,
|
|
5578
|
+
toolset: {
|
|
5579
|
+
name: part.toolset_name,
|
|
5580
|
+
memberName: part.name
|
|
5581
|
+
},
|
|
5582
|
+
...callerInfo && { caller: callerInfo }
|
|
5583
|
+
};
|
|
5584
|
+
controller.enqueue({
|
|
5585
|
+
type: "tool-input-start",
|
|
5586
|
+
id: part.id,
|
|
5587
|
+
toolName: customToolName
|
|
5588
|
+
});
|
|
5008
5589
|
} else {
|
|
5009
5590
|
const callerInfo = getAnthropicCallerInfo(part.caller);
|
|
5010
5591
|
const hasNonEmptyInput = part.input && Object.keys(part.input).length > 0;
|
|
@@ -5113,7 +5694,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5113
5694
|
case "web_fetch_tool_result": {
|
|
5114
5695
|
if (part.content.type === "web_fetch_result") {
|
|
5115
5696
|
citationDocuments.push({
|
|
5116
|
-
title:
|
|
5697
|
+
title: part.content.content.title ?? part.content.url,
|
|
5117
5698
|
mediaType: part.content.content.source.media_type
|
|
5118
5699
|
});
|
|
5119
5700
|
controller.enqueue({
|
|
@@ -5158,16 +5739,13 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5158
5739
|
type: "tool-result",
|
|
5159
5740
|
toolCallId: part.tool_use_id,
|
|
5160
5741
|
toolName: toolNameMapping.toCustomToolName("web_search"),
|
|
5161
|
-
result: part.content.map((result) => {
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
type: result.type
|
|
5169
|
-
};
|
|
5170
|
-
}),
|
|
5742
|
+
result: part.content.map((result) => ({
|
|
5743
|
+
url: result.url,
|
|
5744
|
+
...result.title != null ? { title: result.title } : {},
|
|
5745
|
+
pageAge: result.page_age ?? null,
|
|
5746
|
+
encryptedContent: result.encrypted_content,
|
|
5747
|
+
type: result.type
|
|
5748
|
+
})),
|
|
5171
5749
|
...getAnthropicCallerMetadata(part.caller)
|
|
5172
5750
|
});
|
|
5173
5751
|
for (const result of part.content) {
|
|
@@ -5179,7 +5757,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5179
5757
|
...result.title != null ? { title: result.title } : {},
|
|
5180
5758
|
providerMetadata: {
|
|
5181
5759
|
anthropic: {
|
|
5182
|
-
pageAge:
|
|
5760
|
+
pageAge: result.page_age ?? null
|
|
5183
5761
|
}
|
|
5184
5762
|
}
|
|
5185
5763
|
});
|
|
@@ -5211,7 +5789,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5211
5789
|
stdout: part.content.stdout,
|
|
5212
5790
|
stderr: part.content.stderr,
|
|
5213
5791
|
return_code: part.content.return_code,
|
|
5214
|
-
content:
|
|
5792
|
+
content: part.content.content ?? []
|
|
5215
5793
|
}
|
|
5216
5794
|
});
|
|
5217
5795
|
} else if (part.content.type === "encrypted_code_execution_result") {
|
|
@@ -5224,7 +5802,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5224
5802
|
encrypted_stdout: part.content.encrypted_stdout,
|
|
5225
5803
|
stderr: part.content.stderr,
|
|
5226
5804
|
return_code: part.content.return_code,
|
|
5227
|
-
content:
|
|
5805
|
+
content: part.content.content ?? []
|
|
5228
5806
|
}
|
|
5229
5807
|
});
|
|
5230
5808
|
} else if (part.content.type === "code_execution_tool_result_error") {
|
|
@@ -5404,6 +5982,25 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5404
5982
|
case "tool-call":
|
|
5405
5983
|
const isJsonResponseTool = usesJsonResponseTool && contentBlock.toolName === "json";
|
|
5406
5984
|
if (!isJsonResponseTool) {
|
|
5985
|
+
if (contentBlock.toolset != null) {
|
|
5986
|
+
let memberInput = {};
|
|
5987
|
+
try {
|
|
5988
|
+
memberInput = contentBlock.input === "" ? {} : secureJsonParse2(contentBlock.input);
|
|
5989
|
+
} catch {
|
|
5990
|
+
memberInput = void 0;
|
|
5991
|
+
}
|
|
5992
|
+
contentBlock.input = memberInput === void 0 ? contentBlock.input : JSON.stringify(
|
|
5993
|
+
toToolsetMemberInput({
|
|
5994
|
+
memberName: contentBlock.toolset.memberName,
|
|
5995
|
+
input: memberInput
|
|
5996
|
+
})
|
|
5997
|
+
);
|
|
5998
|
+
controller.enqueue({
|
|
5999
|
+
type: "tool-input-delta",
|
|
6000
|
+
id: contentBlock.toolCallId,
|
|
6001
|
+
delta: contentBlock.input
|
|
6002
|
+
});
|
|
6003
|
+
}
|
|
5407
6004
|
controller.enqueue({
|
|
5408
6005
|
type: "tool-input-end",
|
|
5409
6006
|
id: contentBlock.toolCallId
|
|
@@ -5418,7 +6015,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5418
6015
|
...parsed
|
|
5419
6016
|
});
|
|
5420
6017
|
}
|
|
5421
|
-
} catch
|
|
6018
|
+
} catch {
|
|
5422
6019
|
}
|
|
5423
6020
|
}
|
|
5424
6021
|
controller.enqueue({
|
|
@@ -5432,10 +6029,15 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5432
6029
|
// tool was not explicitly provided. We therefore bypass the general validation by marking the
|
|
5433
6030
|
// tool as dynamic.
|
|
5434
6031
|
...markCodeExecutionDynamic && contentBlock.providerToolName === "code_execution" ? { dynamic: true } : {},
|
|
5435
|
-
...contentBlock.caller && {
|
|
6032
|
+
...(contentBlock.caller || contentBlock.toolset) && {
|
|
5436
6033
|
providerMetadata: {
|
|
5437
6034
|
anthropic: {
|
|
5438
|
-
|
|
6035
|
+
...contentBlock.toolset && {
|
|
6036
|
+
toolsetName: contentBlock.toolset.name
|
|
6037
|
+
},
|
|
6038
|
+
...contentBlock.caller && {
|
|
6039
|
+
caller: contentBlock.caller
|
|
6040
|
+
}
|
|
5439
6041
|
}
|
|
5440
6042
|
}
|
|
5441
6043
|
}
|
|
@@ -5502,7 +6104,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5502
6104
|
return;
|
|
5503
6105
|
}
|
|
5504
6106
|
if (isJsonResponseFromTool) {
|
|
5505
|
-
if (
|
|
6107
|
+
if (contentBlock?.type !== "text") {
|
|
5506
6108
|
return;
|
|
5507
6109
|
}
|
|
5508
6110
|
controller.enqueue({
|
|
@@ -5511,7 +6113,11 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5511
6113
|
delta
|
|
5512
6114
|
});
|
|
5513
6115
|
} else {
|
|
5514
|
-
if (
|
|
6116
|
+
if (contentBlock?.type !== "tool-call") {
|
|
6117
|
+
return;
|
|
6118
|
+
}
|
|
6119
|
+
if (contentBlock.toolset != null) {
|
|
6120
|
+
contentBlock.input += delta;
|
|
5515
6121
|
return;
|
|
5516
6122
|
}
|
|
5517
6123
|
if (contentBlock.firstDelta && contentBlock.providerToolInputType != null) {
|
|
@@ -5530,7 +6136,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5530
6136
|
case "citations_delta": {
|
|
5531
6137
|
const citation = value.delta.citation;
|
|
5532
6138
|
const contentBlock = contentBlocks[value.index];
|
|
5533
|
-
if (
|
|
6139
|
+
if (contentBlock?.type === "text" && citation.type === "web_search_result_location") {
|
|
5534
6140
|
contentBlock.citations.push(citation);
|
|
5535
6141
|
}
|
|
5536
6142
|
const source = createCitationSource(
|
|
@@ -5569,8 +6175,8 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5569
6175
|
isMessageOpen = true;
|
|
5570
6176
|
activeMessageId = value.message.id;
|
|
5571
6177
|
usage.input_tokens = value.message.usage.input_tokens;
|
|
5572
|
-
usage.cache_read_input_tokens =
|
|
5573
|
-
usage.cache_creation_input_tokens =
|
|
6178
|
+
usage.cache_read_input_tokens = value.message.usage.cache_read_input_tokens ?? 0;
|
|
6179
|
+
usage.cache_creation_input_tokens = value.message.usage.cache_creation_input_tokens ?? 0;
|
|
5574
6180
|
rawUsage = {
|
|
5575
6181
|
...value.message.usage
|
|
5576
6182
|
};
|
|
@@ -5595,8 +6201,8 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5595
6201
|
}
|
|
5596
6202
|
controller.enqueue({
|
|
5597
6203
|
type: "response-metadata",
|
|
5598
|
-
id:
|
|
5599
|
-
modelId:
|
|
6204
|
+
id: value.message.id ?? void 0,
|
|
6205
|
+
modelId: value.message.model ?? void 0
|
|
5600
6206
|
});
|
|
5601
6207
|
if (value.message.content != null) {
|
|
5602
6208
|
for (let contentIndex = 0; contentIndex < value.message.content.length; contentIndex++) {
|
|
@@ -5608,7 +6214,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5608
6214
|
id: part.id,
|
|
5609
6215
|
toolName: part.name
|
|
5610
6216
|
});
|
|
5611
|
-
const inputStr = JSON.stringify(
|
|
6217
|
+
const inputStr = JSON.stringify(part.input ?? {});
|
|
5612
6218
|
controller.enqueue({
|
|
5613
6219
|
type: "tool-input-delta",
|
|
5614
6220
|
id: part.id,
|
|
@@ -5658,18 +6264,18 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5658
6264
|
finishReason: value.delta.stop_reason,
|
|
5659
6265
|
isJsonResponseFromTool
|
|
5660
6266
|
}),
|
|
5661
|
-
raw:
|
|
6267
|
+
raw: value.delta.stop_reason ?? void 0
|
|
5662
6268
|
};
|
|
5663
|
-
stopSequence =
|
|
6269
|
+
stopSequence = value.delta.stop_sequence ?? null;
|
|
5664
6270
|
stopDetails = mapAnthropicStopDetails(value.delta.stop_details);
|
|
5665
6271
|
container = value.delta.container != null ? {
|
|
5666
6272
|
expiresAt: value.delta.container.expires_at,
|
|
5667
6273
|
id: value.delta.container.id,
|
|
5668
|
-
skills:
|
|
6274
|
+
skills: value.delta.container.skills?.map((skill) => ({
|
|
5669
6275
|
type: skill.type,
|
|
5670
6276
|
skillId: skill.skill_id,
|
|
5671
6277
|
version: skill.version
|
|
5672
|
-
}))
|
|
6278
|
+
})) ?? null
|
|
5673
6279
|
} : null;
|
|
5674
6280
|
if (value.context_management) {
|
|
5675
6281
|
contextManagement = mapAnthropicResponseContextManagement(
|
|
@@ -5679,6 +6285,9 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5679
6285
|
if (value.input_transformations != null) {
|
|
5680
6286
|
inputTransformations = value.input_transformations;
|
|
5681
6287
|
}
|
|
6288
|
+
if (value.delta.safeguard_results != null) {
|
|
6289
|
+
safeguardResults = value.delta.safeguard_results;
|
|
6290
|
+
}
|
|
5682
6291
|
rawUsage = {
|
|
5683
6292
|
...rawUsage,
|
|
5684
6293
|
...value.usage
|
|
@@ -5689,10 +6298,11 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5689
6298
|
isMessageOpen = false;
|
|
5690
6299
|
activeMessageId = void 0;
|
|
5691
6300
|
const anthropicMetadata = {
|
|
5692
|
-
usage: rawUsage
|
|
6301
|
+
usage: rawUsage ?? null,
|
|
5693
6302
|
stopSequence,
|
|
5694
6303
|
...stopDetails != null ? { stopDetails } : {},
|
|
5695
6304
|
...inputTransformations != null ? { inputTransformations } : {},
|
|
6305
|
+
...safeguardResults != null ? { safeguardResults } : {},
|
|
5696
6306
|
iterations: usage.iterations ? usage.iterations.map(
|
|
5697
6307
|
(iter) => ({
|
|
5698
6308
|
type: iter.type,
|
|
@@ -5744,10 +6354,10 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5744
6354
|
try {
|
|
5745
6355
|
await firstChunkReader.read();
|
|
5746
6356
|
let result = await firstChunkReader.read();
|
|
5747
|
-
if (
|
|
6357
|
+
if (result.value?.type === "raw") {
|
|
5748
6358
|
result = await firstChunkReader.read();
|
|
5749
6359
|
}
|
|
5750
|
-
if (
|
|
6360
|
+
if (result.value?.type === "error") {
|
|
5751
6361
|
const error = result.value.error;
|
|
5752
6362
|
if (!isProviderStreamError(error)) {
|
|
5753
6363
|
throw new Error("Expected a normalized Anthropic stream error");
|
|
@@ -5756,10 +6366,10 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5756
6366
|
message: error.message,
|
|
5757
6367
|
url,
|
|
5758
6368
|
requestBodyValues: body,
|
|
5759
|
-
statusCode:
|
|
6369
|
+
statusCode: error.statusCode ?? 500,
|
|
5760
6370
|
responseHeaders,
|
|
5761
6371
|
responseBody: JSON.stringify(error.data),
|
|
5762
|
-
isRetryable:
|
|
6372
|
+
isRetryable: error.isRetryable ?? false
|
|
5763
6373
|
});
|
|
5764
6374
|
}
|
|
5765
6375
|
} finally {
|
|
@@ -5775,7 +6385,33 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5775
6385
|
}
|
|
5776
6386
|
};
|
|
5777
6387
|
function getModelCapabilities(modelId) {
|
|
5778
|
-
if (modelId.includes("claude-
|
|
6388
|
+
if (modelId.includes("claude-sonnet-5-5")) {
|
|
6389
|
+
return {
|
|
6390
|
+
maxOutputTokens: 128e3,
|
|
6391
|
+
supportsStructuredOutput: true,
|
|
6392
|
+
supportsAdaptiveThinking: true,
|
|
6393
|
+
rejectsSamplingParameters: true,
|
|
6394
|
+
supportsXhighEffort: true,
|
|
6395
|
+
rejectsThinkingDisabledAboveHighEffort: true,
|
|
6396
|
+
rejectsThinkingDisabled: true,
|
|
6397
|
+
rejectsForcedToolUse: true,
|
|
6398
|
+
supportsBetweenToolsThinking: true,
|
|
6399
|
+
isKnownModel: true
|
|
6400
|
+
};
|
|
6401
|
+
} else if (modelId.includes("claude-opus-5-5")) {
|
|
6402
|
+
return {
|
|
6403
|
+
maxOutputTokens: 128e3,
|
|
6404
|
+
supportsStructuredOutput: true,
|
|
6405
|
+
supportsAdaptiveThinking: true,
|
|
6406
|
+
rejectsSamplingParameters: true,
|
|
6407
|
+
supportsXhighEffort: true,
|
|
6408
|
+
rejectsThinkingDisabledAboveHighEffort: true,
|
|
6409
|
+
rejectsThinkingDisabled: true,
|
|
6410
|
+
rejectsForcedToolUse: true,
|
|
6411
|
+
supportsBetweenToolsThinking: false,
|
|
6412
|
+
isKnownModel: true
|
|
6413
|
+
};
|
|
6414
|
+
} else if (modelId.includes("claude-opus-5")) {
|
|
5779
6415
|
return {
|
|
5780
6416
|
maxOutputTokens: 128e3,
|
|
5781
6417
|
supportsStructuredOutput: true,
|
|
@@ -5783,9 +6419,38 @@ function getModelCapabilities(modelId) {
|
|
|
5783
6419
|
rejectsSamplingParameters: true,
|
|
5784
6420
|
supportsXhighEffort: true,
|
|
5785
6421
|
rejectsThinkingDisabledAboveHighEffort: true,
|
|
6422
|
+
rejectsThinkingDisabled: false,
|
|
6423
|
+
rejectsForcedToolUse: false,
|
|
6424
|
+
supportsBetweenToolsThinking: false,
|
|
6425
|
+
isKnownModel: true
|
|
6426
|
+
};
|
|
6427
|
+
} else if (modelId.includes("claude-fable-5-1")) {
|
|
6428
|
+
return {
|
|
6429
|
+
maxOutputTokens: 128e3,
|
|
6430
|
+
supportsStructuredOutput: true,
|
|
6431
|
+
supportsAdaptiveThinking: true,
|
|
6432
|
+
rejectsSamplingParameters: true,
|
|
6433
|
+
supportsXhighEffort: true,
|
|
6434
|
+
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6435
|
+
rejectsThinkingDisabled: true,
|
|
6436
|
+
rejectsForcedToolUse: true,
|
|
6437
|
+
supportsBetweenToolsThinking: false,
|
|
6438
|
+
isKnownModel: true
|
|
6439
|
+
};
|
|
6440
|
+
} else if (modelId.includes("claude-fable-5")) {
|
|
6441
|
+
return {
|
|
6442
|
+
maxOutputTokens: 128e3,
|
|
6443
|
+
supportsStructuredOutput: true,
|
|
6444
|
+
supportsAdaptiveThinking: true,
|
|
6445
|
+
rejectsSamplingParameters: true,
|
|
6446
|
+
supportsXhighEffort: true,
|
|
6447
|
+
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6448
|
+
rejectsThinkingDisabled: true,
|
|
6449
|
+
rejectsForcedToolUse: false,
|
|
6450
|
+
supportsBetweenToolsThinking: false,
|
|
5786
6451
|
isKnownModel: true
|
|
5787
6452
|
};
|
|
5788
|
-
} else if (modelId.includes("claude-opus-4-8") || modelId.includes("claude-opus-4-7") || modelId.includes("claude-
|
|
6453
|
+
} else if (modelId.includes("claude-opus-4-8") || modelId.includes("claude-opus-4-7") || modelId.includes("claude-sonnet-5")) {
|
|
5789
6454
|
return {
|
|
5790
6455
|
maxOutputTokens: 128e3,
|
|
5791
6456
|
supportsStructuredOutput: true,
|
|
@@ -5793,6 +6458,9 @@ function getModelCapabilities(modelId) {
|
|
|
5793
6458
|
rejectsSamplingParameters: true,
|
|
5794
6459
|
supportsXhighEffort: true,
|
|
5795
6460
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6461
|
+
rejectsThinkingDisabled: false,
|
|
6462
|
+
rejectsForcedToolUse: false,
|
|
6463
|
+
supportsBetweenToolsThinking: false,
|
|
5796
6464
|
isKnownModel: true
|
|
5797
6465
|
};
|
|
5798
6466
|
} else if (modelId.includes("claude-sonnet-4-6") || modelId.includes("claude-opus-4-6")) {
|
|
@@ -5803,6 +6471,9 @@ function getModelCapabilities(modelId) {
|
|
|
5803
6471
|
rejectsSamplingParameters: false,
|
|
5804
6472
|
supportsXhighEffort: false,
|
|
5805
6473
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6474
|
+
rejectsThinkingDisabled: false,
|
|
6475
|
+
rejectsForcedToolUse: false,
|
|
6476
|
+
supportsBetweenToolsThinking: false,
|
|
5806
6477
|
isKnownModel: true
|
|
5807
6478
|
};
|
|
5808
6479
|
} else if (modelId.includes("claude-sonnet-4-5") || modelId.includes("claude-opus-4-5") || modelId.includes("claude-haiku-4-5")) {
|
|
@@ -5813,6 +6484,9 @@ function getModelCapabilities(modelId) {
|
|
|
5813
6484
|
rejectsSamplingParameters: false,
|
|
5814
6485
|
supportsXhighEffort: false,
|
|
5815
6486
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6487
|
+
rejectsThinkingDisabled: false,
|
|
6488
|
+
rejectsForcedToolUse: false,
|
|
6489
|
+
supportsBetweenToolsThinking: false,
|
|
5816
6490
|
isKnownModel: true
|
|
5817
6491
|
};
|
|
5818
6492
|
} else if (modelId.includes("claude-opus-4-1")) {
|
|
@@ -5823,6 +6497,9 @@ function getModelCapabilities(modelId) {
|
|
|
5823
6497
|
rejectsSamplingParameters: false,
|
|
5824
6498
|
supportsXhighEffort: false,
|
|
5825
6499
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6500
|
+
rejectsThinkingDisabled: false,
|
|
6501
|
+
rejectsForcedToolUse: false,
|
|
6502
|
+
supportsBetweenToolsThinking: false,
|
|
5826
6503
|
isKnownModel: true
|
|
5827
6504
|
};
|
|
5828
6505
|
} else if (/claude-sonnet-4(?:-|@)/.test(modelId)) {
|
|
@@ -5833,6 +6510,9 @@ function getModelCapabilities(modelId) {
|
|
|
5833
6510
|
rejectsSamplingParameters: false,
|
|
5834
6511
|
supportsXhighEffort: false,
|
|
5835
6512
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6513
|
+
rejectsThinkingDisabled: false,
|
|
6514
|
+
rejectsForcedToolUse: false,
|
|
6515
|
+
supportsBetweenToolsThinking: false,
|
|
5836
6516
|
isKnownModel: true
|
|
5837
6517
|
};
|
|
5838
6518
|
} else if (/claude-opus-4(?:-|@)/.test(modelId)) {
|
|
@@ -5843,6 +6523,9 @@ function getModelCapabilities(modelId) {
|
|
|
5843
6523
|
rejectsSamplingParameters: false,
|
|
5844
6524
|
supportsXhighEffort: false,
|
|
5845
6525
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6526
|
+
rejectsThinkingDisabled: false,
|
|
6527
|
+
rejectsForcedToolUse: false,
|
|
6528
|
+
supportsBetweenToolsThinking: false,
|
|
5846
6529
|
isKnownModel: true
|
|
5847
6530
|
};
|
|
5848
6531
|
} else if (modelId.includes("claude-3-haiku")) {
|
|
@@ -5853,6 +6536,9 @@ function getModelCapabilities(modelId) {
|
|
|
5853
6536
|
rejectsSamplingParameters: false,
|
|
5854
6537
|
supportsXhighEffort: false,
|
|
5855
6538
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6539
|
+
rejectsThinkingDisabled: false,
|
|
6540
|
+
rejectsForcedToolUse: false,
|
|
6541
|
+
supportsBetweenToolsThinking: false,
|
|
5856
6542
|
isKnownModel: true
|
|
5857
6543
|
};
|
|
5858
6544
|
} else if (/claude-(?:instant(?:-|$)|v?2(?=$|[-.:])|3(?=$|[-.]))/.test(modelId)) {
|
|
@@ -5863,6 +6549,9 @@ function getModelCapabilities(modelId) {
|
|
|
5863
6549
|
rejectsSamplingParameters: false,
|
|
5864
6550
|
supportsXhighEffort: false,
|
|
5865
6551
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6552
|
+
rejectsThinkingDisabled: false,
|
|
6553
|
+
rejectsForcedToolUse: false,
|
|
6554
|
+
supportsBetweenToolsThinking: false,
|
|
5866
6555
|
isKnownModel: false
|
|
5867
6556
|
};
|
|
5868
6557
|
} else if (modelId.includes("claude-")) {
|
|
@@ -5873,6 +6562,9 @@ function getModelCapabilities(modelId) {
|
|
|
5873
6562
|
rejectsSamplingParameters: true,
|
|
5874
6563
|
supportsXhighEffort: true,
|
|
5875
6564
|
rejectsThinkingDisabledAboveHighEffort: true,
|
|
6565
|
+
rejectsThinkingDisabled: false,
|
|
6566
|
+
rejectsForcedToolUse: false,
|
|
6567
|
+
supportsBetweenToolsThinking: false,
|
|
5876
6568
|
isKnownModel: false
|
|
5877
6569
|
};
|
|
5878
6570
|
} else {
|
|
@@ -5883,19 +6575,22 @@ function getModelCapabilities(modelId) {
|
|
|
5883
6575
|
rejectsSamplingParameters: false,
|
|
5884
6576
|
supportsXhighEffort: false,
|
|
5885
6577
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
6578
|
+
rejectsThinkingDisabled: false,
|
|
6579
|
+
rejectsForcedToolUse: false,
|
|
6580
|
+
supportsBetweenToolsThinking: false,
|
|
5886
6581
|
isKnownModel: false
|
|
5887
6582
|
};
|
|
5888
6583
|
}
|
|
5889
6584
|
}
|
|
5890
|
-
function
|
|
6585
|
+
function hasDynamicFilteringWebToolWithoutCodeExecution(tools) {
|
|
5891
6586
|
if (!tools) {
|
|
5892
6587
|
return false;
|
|
5893
6588
|
}
|
|
5894
|
-
let
|
|
6589
|
+
let hasDynamicFilteringWebTool = false;
|
|
5895
6590
|
let hasCodeExecutionTool = false;
|
|
5896
6591
|
for (const tool of tools) {
|
|
5897
|
-
if ("type" in tool && (tool.type === "web_fetch_20260209" || tool.type === "web_search_20260209")) {
|
|
5898
|
-
|
|
6592
|
+
if ("type" in tool && (tool.type === "web_fetch_20260209" || tool.type === "web_fetch_20260318" || tool.type === "web_search_20260209" || tool.type === "web_search_20260318")) {
|
|
6593
|
+
hasDynamicFilteringWebTool = true;
|
|
5899
6594
|
continue;
|
|
5900
6595
|
}
|
|
5901
6596
|
if ("type" in tool && (tool.type === "code_execution_20250522" || tool.type === "code_execution_20250825" || tool.type === "code_execution_20260120")) {
|
|
@@ -5903,12 +6598,15 @@ function hasWebTool20260209WithoutCodeExecution(tools) {
|
|
|
5903
6598
|
break;
|
|
5904
6599
|
}
|
|
5905
6600
|
}
|
|
5906
|
-
return
|
|
6601
|
+
return hasDynamicFilteringWebTool && !hasCodeExecutionTool;
|
|
5907
6602
|
}
|
|
5908
6603
|
function resolveAnthropicReasoningConfig({
|
|
5909
6604
|
reasoning,
|
|
6605
|
+
modelId,
|
|
5910
6606
|
supportsAdaptiveThinking,
|
|
5911
6607
|
supportsXhighEffort,
|
|
6608
|
+
rejectsThinkingDisabled,
|
|
6609
|
+
supportsBetweenToolsThinking,
|
|
5912
6610
|
maxOutputTokensForModel,
|
|
5913
6611
|
warnings
|
|
5914
6612
|
}) {
|
|
@@ -5916,6 +6614,17 @@ function resolveAnthropicReasoningConfig({
|
|
|
5916
6614
|
return void 0;
|
|
5917
6615
|
}
|
|
5918
6616
|
if (reasoning === "none") {
|
|
6617
|
+
if (supportsBetweenToolsThinking) {
|
|
6618
|
+
return { thinking: { type: "between_tools" } };
|
|
6619
|
+
}
|
|
6620
|
+
if (rejectsThinkingDisabled) {
|
|
6621
|
+
warnings.push({
|
|
6622
|
+
type: "compatibility",
|
|
6623
|
+
feature: "reasoning",
|
|
6624
|
+
details: `reasoning 'none' is not supported by ${modelId}; it always uses adaptive thinking. Using effort 'low' to minimize thinking instead.`
|
|
6625
|
+
});
|
|
6626
|
+
return { effort: "low" };
|
|
6627
|
+
}
|
|
5919
6628
|
return { thinking: { type: "disabled" } };
|
|
5920
6629
|
}
|
|
5921
6630
|
if (supportsAdaptiveThinking) {
|
|
@@ -5985,20 +6694,20 @@ function mapAnthropicStopDetails(stopDetails) {
|
|
|
5985
6694
|
|
|
5986
6695
|
// src/tool/bash_20241022.ts
|
|
5987
6696
|
import {
|
|
5988
|
-
createProviderDefinedToolFactory as
|
|
5989
|
-
lazySchema as
|
|
5990
|
-
zodSchema as
|
|
6697
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory3,
|
|
6698
|
+
lazySchema as lazySchema17,
|
|
6699
|
+
zodSchema as zodSchema17
|
|
5991
6700
|
} from "@ai-sdk/provider-utils";
|
|
5992
|
-
import { z as
|
|
5993
|
-
var bash_20241022InputSchema =
|
|
5994
|
-
() =>
|
|
5995
|
-
|
|
5996
|
-
command:
|
|
5997
|
-
restart:
|
|
6701
|
+
import { z as z18 } from "zod/v4";
|
|
6702
|
+
var bash_20241022InputSchema = lazySchema17(
|
|
6703
|
+
() => zodSchema17(
|
|
6704
|
+
z18.object({
|
|
6705
|
+
command: z18.string(),
|
|
6706
|
+
restart: z18.boolean().optional()
|
|
5998
6707
|
})
|
|
5999
6708
|
)
|
|
6000
6709
|
);
|
|
6001
|
-
var bash_20241022_internal =
|
|
6710
|
+
var bash_20241022_internal = createProviderDefinedToolFactory3({
|
|
6002
6711
|
id: "anthropic.bash_20241022",
|
|
6003
6712
|
inputSchema: bash_20241022InputSchema
|
|
6004
6713
|
});
|
|
@@ -6026,20 +6735,20 @@ function bash_20241022(options = {}) {
|
|
|
6026
6735
|
|
|
6027
6736
|
// src/tool/bash_20250124.ts
|
|
6028
6737
|
import {
|
|
6029
|
-
createProviderDefinedToolFactory as
|
|
6030
|
-
lazySchema as
|
|
6031
|
-
zodSchema as
|
|
6738
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory4,
|
|
6739
|
+
lazySchema as lazySchema18,
|
|
6740
|
+
zodSchema as zodSchema18
|
|
6032
6741
|
} from "@ai-sdk/provider-utils";
|
|
6033
|
-
import { z as
|
|
6034
|
-
var bash_20250124InputSchema =
|
|
6035
|
-
() =>
|
|
6036
|
-
|
|
6037
|
-
command:
|
|
6038
|
-
restart:
|
|
6742
|
+
import { z as z19 } from "zod/v4";
|
|
6743
|
+
var bash_20250124InputSchema = lazySchema18(
|
|
6744
|
+
() => zodSchema18(
|
|
6745
|
+
z19.object({
|
|
6746
|
+
command: z19.string(),
|
|
6747
|
+
restart: z19.boolean().optional()
|
|
6039
6748
|
})
|
|
6040
6749
|
)
|
|
6041
6750
|
);
|
|
6042
|
-
var bash_20250124_internal =
|
|
6751
|
+
var bash_20250124_internal = createProviderDefinedToolFactory4({
|
|
6043
6752
|
id: "anthropic.bash_20250124",
|
|
6044
6753
|
inputSchema: bash_20250124InputSchema
|
|
6045
6754
|
});
|
|
@@ -6067,15 +6776,15 @@ function bash_20250124(options = {}) {
|
|
|
6067
6776
|
|
|
6068
6777
|
// src/tool/computer_20241022.ts
|
|
6069
6778
|
import {
|
|
6070
|
-
createProviderDefinedToolFactory as
|
|
6071
|
-
lazySchema as
|
|
6072
|
-
zodSchema as
|
|
6779
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory5,
|
|
6780
|
+
lazySchema as lazySchema19,
|
|
6781
|
+
zodSchema as zodSchema19
|
|
6073
6782
|
} from "@ai-sdk/provider-utils";
|
|
6074
|
-
import { z as
|
|
6075
|
-
var computer_20241022InputSchema =
|
|
6076
|
-
() =>
|
|
6077
|
-
|
|
6078
|
-
action:
|
|
6783
|
+
import { z as z20 } from "zod/v4";
|
|
6784
|
+
var computer_20241022InputSchema = lazySchema19(
|
|
6785
|
+
() => zodSchema19(
|
|
6786
|
+
z20.object({
|
|
6787
|
+
action: z20.enum([
|
|
6079
6788
|
"key",
|
|
6080
6789
|
"type",
|
|
6081
6790
|
"mouse_move",
|
|
@@ -6087,27 +6796,27 @@ var computer_20241022InputSchema = lazySchema16(
|
|
|
6087
6796
|
"screenshot",
|
|
6088
6797
|
"cursor_position"
|
|
6089
6798
|
]),
|
|
6090
|
-
coordinate:
|
|
6091
|
-
text:
|
|
6799
|
+
coordinate: z20.array(z20.number().int()).optional(),
|
|
6800
|
+
text: z20.string().optional()
|
|
6092
6801
|
})
|
|
6093
6802
|
)
|
|
6094
6803
|
);
|
|
6095
|
-
var computer_20241022 =
|
|
6804
|
+
var computer_20241022 = createProviderDefinedToolFactory5({
|
|
6096
6805
|
id: "anthropic.computer_20241022",
|
|
6097
6806
|
inputSchema: computer_20241022InputSchema
|
|
6098
6807
|
});
|
|
6099
6808
|
|
|
6100
6809
|
// src/tool/computer_20250124.ts
|
|
6101
6810
|
import {
|
|
6102
|
-
createProviderDefinedToolFactory as
|
|
6103
|
-
lazySchema as
|
|
6104
|
-
zodSchema as
|
|
6811
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory6,
|
|
6812
|
+
lazySchema as lazySchema20,
|
|
6813
|
+
zodSchema as zodSchema20
|
|
6105
6814
|
} from "@ai-sdk/provider-utils";
|
|
6106
|
-
import { z as
|
|
6107
|
-
var computer_20250124InputSchema =
|
|
6108
|
-
() =>
|
|
6109
|
-
|
|
6110
|
-
action:
|
|
6815
|
+
import { z as z21 } from "zod/v4";
|
|
6816
|
+
var computer_20250124InputSchema = lazySchema20(
|
|
6817
|
+
() => zodSchema20(
|
|
6818
|
+
z21.object({
|
|
6819
|
+
action: z21.enum([
|
|
6111
6820
|
"key",
|
|
6112
6821
|
"hold_key",
|
|
6113
6822
|
"type",
|
|
@@ -6125,31 +6834,31 @@ var computer_20250124InputSchema = lazySchema17(
|
|
|
6125
6834
|
"wait",
|
|
6126
6835
|
"screenshot"
|
|
6127
6836
|
]),
|
|
6128
|
-
coordinate:
|
|
6129
|
-
duration:
|
|
6130
|
-
scroll_amount:
|
|
6131
|
-
scroll_direction:
|
|
6132
|
-
start_coordinate:
|
|
6133
|
-
text:
|
|
6837
|
+
coordinate: z21.tuple([z21.number().int(), z21.number().int()]).optional(),
|
|
6838
|
+
duration: z21.number().optional(),
|
|
6839
|
+
scroll_amount: z21.number().optional(),
|
|
6840
|
+
scroll_direction: z21.enum(["up", "down", "left", "right"]).optional(),
|
|
6841
|
+
start_coordinate: z21.tuple([z21.number().int(), z21.number().int()]).optional(),
|
|
6842
|
+
text: z21.string().optional()
|
|
6134
6843
|
})
|
|
6135
6844
|
)
|
|
6136
6845
|
);
|
|
6137
|
-
var computer_20250124 =
|
|
6846
|
+
var computer_20250124 = createProviderDefinedToolFactory6({
|
|
6138
6847
|
id: "anthropic.computer_20250124",
|
|
6139
6848
|
inputSchema: computer_20250124InputSchema
|
|
6140
6849
|
});
|
|
6141
6850
|
|
|
6142
6851
|
// src/tool/computer_20251124.ts
|
|
6143
6852
|
import {
|
|
6144
|
-
createProviderDefinedToolFactory as
|
|
6145
|
-
lazySchema as
|
|
6146
|
-
zodSchema as
|
|
6853
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory7,
|
|
6854
|
+
lazySchema as lazySchema21,
|
|
6855
|
+
zodSchema as zodSchema21
|
|
6147
6856
|
} from "@ai-sdk/provider-utils";
|
|
6148
|
-
import { z as
|
|
6149
|
-
var computer_20251124InputSchema =
|
|
6150
|
-
() =>
|
|
6151
|
-
|
|
6152
|
-
action:
|
|
6857
|
+
import { z as z22 } from "zod/v4";
|
|
6858
|
+
var computer_20251124InputSchema = lazySchema21(
|
|
6859
|
+
() => zodSchema21(
|
|
6860
|
+
z22.object({
|
|
6861
|
+
action: z22.enum([
|
|
6153
6862
|
"key",
|
|
6154
6863
|
"hold_key",
|
|
6155
6864
|
"type",
|
|
@@ -6168,193 +6877,193 @@ var computer_20251124InputSchema = lazySchema18(
|
|
|
6168
6877
|
"screenshot",
|
|
6169
6878
|
"zoom"
|
|
6170
6879
|
]),
|
|
6171
|
-
coordinate:
|
|
6172
|
-
duration:
|
|
6173
|
-
region:
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6880
|
+
coordinate: z22.tuple([z22.number().int(), z22.number().int()]).optional(),
|
|
6881
|
+
duration: z22.number().optional(),
|
|
6882
|
+
region: z22.tuple([
|
|
6883
|
+
z22.number().int(),
|
|
6884
|
+
z22.number().int(),
|
|
6885
|
+
z22.number().int(),
|
|
6886
|
+
z22.number().int()
|
|
6178
6887
|
]).optional(),
|
|
6179
|
-
scroll_amount:
|
|
6180
|
-
scroll_direction:
|
|
6181
|
-
start_coordinate:
|
|
6182
|
-
text:
|
|
6888
|
+
scroll_amount: z22.number().optional(),
|
|
6889
|
+
scroll_direction: z22.enum(["up", "down", "left", "right"]).optional(),
|
|
6890
|
+
start_coordinate: z22.tuple([z22.number().int(), z22.number().int()]).optional(),
|
|
6891
|
+
text: z22.string().optional()
|
|
6183
6892
|
})
|
|
6184
6893
|
)
|
|
6185
6894
|
);
|
|
6186
|
-
var computer_20251124 =
|
|
6895
|
+
var computer_20251124 = createProviderDefinedToolFactory7({
|
|
6187
6896
|
id: "anthropic.computer_20251124",
|
|
6188
6897
|
inputSchema: computer_20251124InputSchema
|
|
6189
6898
|
});
|
|
6190
6899
|
|
|
6191
6900
|
// src/tool/memory_20250818.ts
|
|
6192
6901
|
import {
|
|
6193
|
-
createProviderDefinedToolFactory as
|
|
6194
|
-
lazySchema as
|
|
6195
|
-
zodSchema as
|
|
6902
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory8,
|
|
6903
|
+
lazySchema as lazySchema22,
|
|
6904
|
+
zodSchema as zodSchema22
|
|
6196
6905
|
} from "@ai-sdk/provider-utils";
|
|
6197
|
-
import { z as
|
|
6198
|
-
var memory_20250818InputSchema =
|
|
6199
|
-
() =>
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
command:
|
|
6203
|
-
path:
|
|
6204
|
-
view_range:
|
|
6906
|
+
import { z as z23 } from "zod/v4";
|
|
6907
|
+
var memory_20250818InputSchema = lazySchema22(
|
|
6908
|
+
() => zodSchema22(
|
|
6909
|
+
z23.discriminatedUnion("command", [
|
|
6910
|
+
z23.object({
|
|
6911
|
+
command: z23.literal("view"),
|
|
6912
|
+
path: z23.string(),
|
|
6913
|
+
view_range: z23.tuple([z23.number(), z23.number()]).optional()
|
|
6205
6914
|
}),
|
|
6206
|
-
|
|
6207
|
-
command:
|
|
6208
|
-
path:
|
|
6209
|
-
file_text:
|
|
6915
|
+
z23.object({
|
|
6916
|
+
command: z23.literal("create"),
|
|
6917
|
+
path: z23.string(),
|
|
6918
|
+
file_text: z23.string()
|
|
6210
6919
|
}),
|
|
6211
|
-
|
|
6212
|
-
command:
|
|
6213
|
-
path:
|
|
6214
|
-
old_str:
|
|
6215
|
-
new_str:
|
|
6920
|
+
z23.object({
|
|
6921
|
+
command: z23.literal("str_replace"),
|
|
6922
|
+
path: z23.string(),
|
|
6923
|
+
old_str: z23.string(),
|
|
6924
|
+
new_str: z23.string()
|
|
6216
6925
|
}),
|
|
6217
|
-
|
|
6218
|
-
command:
|
|
6219
|
-
path:
|
|
6220
|
-
insert_line:
|
|
6221
|
-
insert_text:
|
|
6926
|
+
z23.object({
|
|
6927
|
+
command: z23.literal("insert"),
|
|
6928
|
+
path: z23.string(),
|
|
6929
|
+
insert_line: z23.number(),
|
|
6930
|
+
insert_text: z23.string()
|
|
6222
6931
|
}),
|
|
6223
|
-
|
|
6224
|
-
command:
|
|
6225
|
-
path:
|
|
6932
|
+
z23.object({
|
|
6933
|
+
command: z23.literal("delete"),
|
|
6934
|
+
path: z23.string()
|
|
6226
6935
|
}),
|
|
6227
|
-
|
|
6228
|
-
command:
|
|
6229
|
-
old_path:
|
|
6230
|
-
new_path:
|
|
6936
|
+
z23.object({
|
|
6937
|
+
command: z23.literal("rename"),
|
|
6938
|
+
old_path: z23.string(),
|
|
6939
|
+
new_path: z23.string()
|
|
6231
6940
|
})
|
|
6232
6941
|
])
|
|
6233
6942
|
)
|
|
6234
6943
|
);
|
|
6235
|
-
var memory_20250818 =
|
|
6944
|
+
var memory_20250818 = createProviderDefinedToolFactory8({
|
|
6236
6945
|
id: "anthropic.memory_20250818",
|
|
6237
6946
|
inputSchema: memory_20250818InputSchema
|
|
6238
6947
|
});
|
|
6239
6948
|
|
|
6240
6949
|
// src/tool/text-editor_20241022.ts
|
|
6241
6950
|
import {
|
|
6242
|
-
createProviderDefinedToolFactory as
|
|
6243
|
-
lazySchema as
|
|
6244
|
-
zodSchema as
|
|
6951
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory9,
|
|
6952
|
+
lazySchema as lazySchema23,
|
|
6953
|
+
zodSchema as zodSchema23
|
|
6245
6954
|
} from "@ai-sdk/provider-utils";
|
|
6246
|
-
import { z as
|
|
6247
|
-
var textEditor_20241022InputSchema =
|
|
6248
|
-
() =>
|
|
6249
|
-
|
|
6250
|
-
command:
|
|
6251
|
-
path:
|
|
6252
|
-
file_text:
|
|
6253
|
-
insert_line:
|
|
6254
|
-
new_str:
|
|
6255
|
-
insert_text:
|
|
6256
|
-
old_str:
|
|
6257
|
-
view_range:
|
|
6955
|
+
import { z as z24 } from "zod/v4";
|
|
6956
|
+
var textEditor_20241022InputSchema = lazySchema23(
|
|
6957
|
+
() => zodSchema23(
|
|
6958
|
+
z24.object({
|
|
6959
|
+
command: z24.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
6960
|
+
path: z24.string(),
|
|
6961
|
+
file_text: z24.string().optional(),
|
|
6962
|
+
insert_line: z24.number().int().optional(),
|
|
6963
|
+
new_str: z24.string().optional(),
|
|
6964
|
+
insert_text: z24.string().optional(),
|
|
6965
|
+
old_str: z24.string().optional(),
|
|
6966
|
+
view_range: z24.array(z24.number().int()).optional()
|
|
6258
6967
|
})
|
|
6259
6968
|
)
|
|
6260
6969
|
);
|
|
6261
|
-
var textEditor_20241022 =
|
|
6970
|
+
var textEditor_20241022 = createProviderDefinedToolFactory9({
|
|
6262
6971
|
id: "anthropic.text_editor_20241022",
|
|
6263
6972
|
inputSchema: textEditor_20241022InputSchema
|
|
6264
6973
|
});
|
|
6265
6974
|
|
|
6266
6975
|
// src/tool/text-editor_20250124.ts
|
|
6267
6976
|
import {
|
|
6268
|
-
createProviderDefinedToolFactory as
|
|
6269
|
-
lazySchema as
|
|
6270
|
-
zodSchema as
|
|
6977
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory10,
|
|
6978
|
+
lazySchema as lazySchema24,
|
|
6979
|
+
zodSchema as zodSchema24
|
|
6271
6980
|
} from "@ai-sdk/provider-utils";
|
|
6272
|
-
import { z as
|
|
6273
|
-
var textEditor_20250124InputSchema =
|
|
6274
|
-
() =>
|
|
6275
|
-
|
|
6276
|
-
command:
|
|
6277
|
-
path:
|
|
6278
|
-
file_text:
|
|
6279
|
-
insert_line:
|
|
6280
|
-
new_str:
|
|
6281
|
-
insert_text:
|
|
6282
|
-
old_str:
|
|
6283
|
-
view_range:
|
|
6981
|
+
import { z as z25 } from "zod/v4";
|
|
6982
|
+
var textEditor_20250124InputSchema = lazySchema24(
|
|
6983
|
+
() => zodSchema24(
|
|
6984
|
+
z25.object({
|
|
6985
|
+
command: z25.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
6986
|
+
path: z25.string(),
|
|
6987
|
+
file_text: z25.string().optional(),
|
|
6988
|
+
insert_line: z25.number().int().optional(),
|
|
6989
|
+
new_str: z25.string().optional(),
|
|
6990
|
+
insert_text: z25.string().optional(),
|
|
6991
|
+
old_str: z25.string().optional(),
|
|
6992
|
+
view_range: z25.array(z25.number().int()).optional()
|
|
6284
6993
|
})
|
|
6285
6994
|
)
|
|
6286
6995
|
);
|
|
6287
|
-
var textEditor_20250124 =
|
|
6996
|
+
var textEditor_20250124 = createProviderDefinedToolFactory10({
|
|
6288
6997
|
id: "anthropic.text_editor_20250124",
|
|
6289
6998
|
inputSchema: textEditor_20250124InputSchema
|
|
6290
6999
|
});
|
|
6291
7000
|
|
|
6292
7001
|
// src/tool/text-editor_20250429.ts
|
|
6293
7002
|
import {
|
|
6294
|
-
createProviderDefinedToolFactory as
|
|
6295
|
-
lazySchema as
|
|
6296
|
-
zodSchema as
|
|
7003
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory11,
|
|
7004
|
+
lazySchema as lazySchema25,
|
|
7005
|
+
zodSchema as zodSchema25
|
|
6297
7006
|
} from "@ai-sdk/provider-utils";
|
|
6298
|
-
import { z as
|
|
6299
|
-
var textEditor_20250429InputSchema =
|
|
6300
|
-
() =>
|
|
6301
|
-
|
|
6302
|
-
command:
|
|
6303
|
-
path:
|
|
6304
|
-
file_text:
|
|
6305
|
-
insert_line:
|
|
6306
|
-
new_str:
|
|
6307
|
-
insert_text:
|
|
6308
|
-
old_str:
|
|
6309
|
-
view_range:
|
|
7007
|
+
import { z as z26 } from "zod/v4";
|
|
7008
|
+
var textEditor_20250429InputSchema = lazySchema25(
|
|
7009
|
+
() => zodSchema25(
|
|
7010
|
+
z26.object({
|
|
7011
|
+
command: z26.enum(["view", "create", "str_replace", "insert"]),
|
|
7012
|
+
path: z26.string(),
|
|
7013
|
+
file_text: z26.string().optional(),
|
|
7014
|
+
insert_line: z26.number().int().optional(),
|
|
7015
|
+
new_str: z26.string().optional(),
|
|
7016
|
+
insert_text: z26.string().optional(),
|
|
7017
|
+
old_str: z26.string().optional(),
|
|
7018
|
+
view_range: z26.array(z26.number().int()).optional()
|
|
6310
7019
|
})
|
|
6311
7020
|
)
|
|
6312
7021
|
);
|
|
6313
|
-
var textEditor_20250429 =
|
|
7022
|
+
var textEditor_20250429 = createProviderDefinedToolFactory11({
|
|
6314
7023
|
id: "anthropic.text_editor_20250429",
|
|
6315
7024
|
inputSchema: textEditor_20250429InputSchema
|
|
6316
7025
|
});
|
|
6317
7026
|
|
|
6318
7027
|
// src/tool/tool-search-bm25_20251119.ts
|
|
6319
7028
|
import {
|
|
6320
|
-
createProviderExecutedToolFactory as
|
|
6321
|
-
lazySchema as
|
|
6322
|
-
zodSchema as
|
|
7029
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory12,
|
|
7030
|
+
lazySchema as lazySchema26,
|
|
7031
|
+
zodSchema as zodSchema26
|
|
6323
7032
|
} from "@ai-sdk/provider-utils";
|
|
6324
|
-
import { z as
|
|
6325
|
-
var toolSearchBm25_20251119OutputSchema =
|
|
6326
|
-
() =>
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
type:
|
|
6330
|
-
toolName:
|
|
7033
|
+
import { z as z27 } from "zod/v4";
|
|
7034
|
+
var toolSearchBm25_20251119OutputSchema = lazySchema26(
|
|
7035
|
+
() => zodSchema26(
|
|
7036
|
+
z27.array(
|
|
7037
|
+
z27.object({
|
|
7038
|
+
type: z27.literal("tool_reference"),
|
|
7039
|
+
toolName: z27.string()
|
|
6331
7040
|
})
|
|
6332
7041
|
)
|
|
6333
7042
|
)
|
|
6334
7043
|
);
|
|
6335
|
-
var toolSearchBm25_20251119InputSchema =
|
|
6336
|
-
() =>
|
|
6337
|
-
|
|
7044
|
+
var toolSearchBm25_20251119InputSchema = lazySchema26(
|
|
7045
|
+
() => zodSchema26(
|
|
7046
|
+
z27.object({
|
|
6338
7047
|
/**
|
|
6339
7048
|
* A natural language query to search for tools.
|
|
6340
7049
|
* Claude will use BM25 text search to find relevant tools.
|
|
6341
7050
|
*/
|
|
6342
|
-
query:
|
|
7051
|
+
query: z27.string(),
|
|
6343
7052
|
/**
|
|
6344
7053
|
* Maximum number of tools to return. Optional.
|
|
6345
7054
|
*/
|
|
6346
|
-
limit:
|
|
7055
|
+
limit: z27.number().optional()
|
|
6347
7056
|
})
|
|
6348
7057
|
)
|
|
6349
7058
|
);
|
|
6350
|
-
var
|
|
7059
|
+
var factory13 = createProviderExecutedToolFactory12({
|
|
6351
7060
|
id: "anthropic.tool_search_bm25_20251119",
|
|
6352
7061
|
inputSchema: toolSearchBm25_20251119InputSchema,
|
|
6353
7062
|
outputSchema: toolSearchBm25_20251119OutputSchema,
|
|
6354
7063
|
supportsDeferredResults: true
|
|
6355
7064
|
});
|
|
6356
7065
|
var toolSearchBm25_20251119 = (args = {}) => {
|
|
6357
|
-
return
|
|
7066
|
+
return factory13(args);
|
|
6358
7067
|
};
|
|
6359
7068
|
|
|
6360
7069
|
// src/anthropic-tools.ts
|
|
@@ -6475,6 +7184,29 @@ var anthropicTools = {
|
|
|
6475
7184
|
* @param enableZoom - Enable zoom action. Set to true to allow Claude to zoom into specific screen regions. Default: false.
|
|
6476
7185
|
*/
|
|
6477
7186
|
computer_20251124,
|
|
7187
|
+
/**
|
|
7188
|
+
* The computer toolset lets Claude control a computer through screenshots,
|
|
7189
|
+
* mouse, and keyboard. It replaces the versioned computer tools
|
|
7190
|
+
* (`computer_20251124` and earlier) on newer models.
|
|
7191
|
+
*
|
|
7192
|
+
* The API returns each computer action as its own `tool_use` block with
|
|
7193
|
+
* `toolset_name: 'computer'`. The AI SDK maps every member call to this tool
|
|
7194
|
+
* and exposes the member name as `action`, so `execute` receives the same
|
|
7195
|
+
* input shape as the older computer tools. Claude may return several actions
|
|
7196
|
+
* in one turn.
|
|
7197
|
+
*
|
|
7198
|
+
* Coordinates are always in the pixel space of the screenshots you return;
|
|
7199
|
+
* there are no display size parameters. Zoom is enabled by default.
|
|
7200
|
+
*
|
|
7201
|
+
* Does not require a beta header.
|
|
7202
|
+
*
|
|
7203
|
+
* Supported models: Claude Opus 5.5 (required; older computer tool types
|
|
7204
|
+
* are rejected), Opus 5, Sonnet 5, Fable 5, Fable 5.1, Opus 4.8.
|
|
7205
|
+
*
|
|
7206
|
+
* @param configs - Per-member settings keyed by member name, e.g.
|
|
7207
|
+
* `{ zoom: { enabled: false } }`. Omitted members keep their defaults.
|
|
7208
|
+
*/
|
|
7209
|
+
computerToolset_20260801,
|
|
6478
7210
|
/**
|
|
6479
7211
|
* The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.
|
|
6480
7212
|
* Claude can create, read, update, and delete files that persist between sessions,
|
|
@@ -6542,6 +7274,18 @@ var anthropicTools = {
|
|
|
6542
7274
|
* @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
|
|
6543
7275
|
*/
|
|
6544
7276
|
webFetch_20260209,
|
|
7277
|
+
/**
|
|
7278
|
+
* Creates a web fetch tool that gives Claude direct access to real-time web content.
|
|
7279
|
+
*
|
|
7280
|
+
* @param maxUses - The max_uses parameter limits the number of web fetches performed
|
|
7281
|
+
* @param allowedDomains - Only fetch from these domains
|
|
7282
|
+
* @param blockedDomains - Never fetch from these domains
|
|
7283
|
+
* @param citations - Unlike web search where citations are always enabled, citations are optional for web fetch. Set "citations": {"enabled": true} to enable Claude to cite specific passages from fetched documents.
|
|
7284
|
+
* @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
|
|
7285
|
+
* @param useCache - Whether cached content may be returned. Set to false to fetch fresh content.
|
|
7286
|
+
* @param responseInclusion - Whether result blocks consumed by completed code execution calls are returned. Defaults to "full".
|
|
7287
|
+
*/
|
|
7288
|
+
webFetch_20260318,
|
|
6545
7289
|
/**
|
|
6546
7290
|
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
6547
7291
|
*
|
|
@@ -6560,6 +7304,16 @@ var anthropicTools = {
|
|
|
6560
7304
|
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
6561
7305
|
*/
|
|
6562
7306
|
webSearch_20260209,
|
|
7307
|
+
/**
|
|
7308
|
+
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
7309
|
+
*
|
|
7310
|
+
* @param maxUses - Maximum number of web searches Claude can perform during the conversation.
|
|
7311
|
+
* @param allowedDomains - Optional list of domains that Claude is allowed to search.
|
|
7312
|
+
* @param blockedDomains - Optional list of domains that Claude should avoid when searching.
|
|
7313
|
+
* @param userLocation - Optional user location information to provide geographically relevant search results.
|
|
7314
|
+
* @param responseInclusion - Whether result blocks consumed by completed code execution calls are returned. Defaults to "full".
|
|
7315
|
+
*/
|
|
7316
|
+
webSearch_20260318,
|
|
6563
7317
|
/**
|
|
6564
7318
|
* Creates a tool search tool that uses regex patterns to find tools.
|
|
6565
7319
|
*
|
|
@@ -6601,40 +7355,40 @@ import {
|
|
|
6601
7355
|
} from "@ai-sdk/provider-utils";
|
|
6602
7356
|
|
|
6603
7357
|
// src/skills/anthropic-skills-api.ts
|
|
6604
|
-
import { lazySchema as
|
|
6605
|
-
import { z as
|
|
6606
|
-
var anthropicSkillResponseSchema =
|
|
6607
|
-
() =>
|
|
6608
|
-
|
|
6609
|
-
id:
|
|
6610
|
-
display_title:
|
|
6611
|
-
name:
|
|
6612
|
-
description:
|
|
6613
|
-
latest_version:
|
|
6614
|
-
source:
|
|
6615
|
-
created_at:
|
|
6616
|
-
updated_at:
|
|
7358
|
+
import { lazySchema as lazySchema27, zodSchema as zodSchema27 } from "@ai-sdk/provider-utils";
|
|
7359
|
+
import { z as z28 } from "zod/v4";
|
|
7360
|
+
var anthropicSkillResponseSchema = lazySchema27(
|
|
7361
|
+
() => zodSchema27(
|
|
7362
|
+
z28.object({
|
|
7363
|
+
id: z28.string(),
|
|
7364
|
+
display_title: z28.string().nullish(),
|
|
7365
|
+
name: z28.string().nullish(),
|
|
7366
|
+
description: z28.string().nullish(),
|
|
7367
|
+
latest_version: z28.string().nullish(),
|
|
7368
|
+
source: z28.string(),
|
|
7369
|
+
created_at: z28.string(),
|
|
7370
|
+
updated_at: z28.string()
|
|
6617
7371
|
})
|
|
6618
7372
|
)
|
|
6619
7373
|
);
|
|
6620
|
-
var anthropicSkillVersionListResponseSchema =
|
|
6621
|
-
() =>
|
|
6622
|
-
|
|
6623
|
-
data:
|
|
6624
|
-
|
|
6625
|
-
version:
|
|
7374
|
+
var anthropicSkillVersionListResponseSchema = lazySchema27(
|
|
7375
|
+
() => zodSchema27(
|
|
7376
|
+
z28.object({
|
|
7377
|
+
data: z28.array(
|
|
7378
|
+
z28.object({
|
|
7379
|
+
version: z28.string()
|
|
6626
7380
|
})
|
|
6627
7381
|
)
|
|
6628
7382
|
})
|
|
6629
7383
|
)
|
|
6630
7384
|
);
|
|
6631
|
-
var anthropicSkillVersionResponseSchema =
|
|
6632
|
-
() =>
|
|
6633
|
-
|
|
6634
|
-
type:
|
|
6635
|
-
skill_id:
|
|
6636
|
-
name:
|
|
6637
|
-
description:
|
|
7385
|
+
var anthropicSkillVersionResponseSchema = lazySchema27(
|
|
7386
|
+
() => zodSchema27(
|
|
7387
|
+
z28.object({
|
|
7388
|
+
type: z28.string(),
|
|
7389
|
+
skill_id: z28.string(),
|
|
7390
|
+
name: z28.string().nullish(),
|
|
7391
|
+
description: z28.string().nullish()
|
|
6638
7392
|
})
|
|
6639
7393
|
)
|
|
6640
7394
|
);
|
|
@@ -6678,7 +7432,6 @@ var AnthropicSkills = class {
|
|
|
6678
7432
|
};
|
|
6679
7433
|
}
|
|
6680
7434
|
async uploadSkill(params) {
|
|
6681
|
-
var _a, _b;
|
|
6682
7435
|
const warnings = [];
|
|
6683
7436
|
const formData = new FormData();
|
|
6684
7437
|
if (params.displayTitle != null) {
|
|
@@ -6704,8 +7457,8 @@ var AnthropicSkills = class {
|
|
|
6704
7457
|
version: response.latest_version,
|
|
6705
7458
|
headers
|
|
6706
7459
|
}) : {};
|
|
6707
|
-
const name =
|
|
6708
|
-
const description =
|
|
7460
|
+
const name = versionMetadata.name ?? response.name;
|
|
7461
|
+
const description = versionMetadata.description ?? response.description;
|
|
6709
7462
|
return {
|
|
6710
7463
|
providerReference: { anthropic: response.id },
|
|
6711
7464
|
...response.display_title != null ? { displayTitle: response.display_title } : {},
|