maka-agent 0.2.0-dev.62.20260928 → 0.2.0-dev.67.20261002
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 +16 -16
- package/THIRD_PARTY_NOTICES.txt +29 -29
- package/dist/pi-tui-runner.js +26 -29
- package/dist/tui-copy-catalog.js +9 -9
- package/native/runtime-host-peer/prebuilds/darwin-arm64/maka_runtime_host_peer.node +0 -0
- package/native/runtime-host-peer/prebuilds/linux-arm64/maka_runtime_host_peer.node +0 -0
- package/native/runtime-host-peer/prebuilds/linux-x64/maka_runtime_host_peer.node +0 -0
- package/native/runtime-host-peer/prebuilds/win32-x64/maka_runtime_host_peer.node +0 -0
- 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/core/dist/settings.js +2 -2
- package/node_modules/@maka/core/dist/tool-ledger-scanner.js +53 -150
- 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 +23 -4
- package/node_modules/@maka/runtime/dist/ai-sdk-message-projection.js +33 -3
- package/node_modules/@maka/runtime/dist/conversation-copy.js +6 -0
- 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/runtime-event-read-model.js +17 -0
- package/node_modules/@maka/runtime/dist/session-manager.js +25 -40
- package/node_modules/@maka/runtime/dist/stream-graph-coordinator.js +82 -16
- package/node_modules/@maka/runtime/dist/stream-graph-projection.js +64 -0
- package/node_modules/@maka/runtime/dist/stream-graph-read-model.js +138 -20
- package/node_modules/@maka/runtime/dist/tool-availability.js +10 -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/candidate-entry.js +15 -0
- package/node_modules/@maka/runtime-host/dist/candidate-startup-failure.js +5 -0
- package/node_modules/@maka/runtime-host/dist/client/session-catalog-summary.js +1 -0
- package/node_modules/@maka/runtime-host/dist/client/startup-error.js +5 -0
- package/node_modules/@maka/runtime-host/dist/protocol/agent-graph.js +46 -1
- package/node_modules/@maka/runtime-host/dist/protocol/index.js +14 -1
- package/node_modules/@maka/runtime-host/dist/protocol/operations.js +5 -1
- package/node_modules/@maka/runtime-host/dist/protocol/session-catalog.js +12 -0
- package/node_modules/@maka/runtime-host/dist/protocol/session-retirement.js +46 -10
- package/node_modules/@maka/runtime-host/dist/protocol/storage-usage.js +155 -0
- package/node_modules/@maka/runtime-host/dist/protocol/turn.js +20 -8
- package/node_modules/@maka/runtime-host/dist/server/agent-graph-coordinator.js +23 -0
- package/node_modules/@maka/runtime-host/dist/server/canonical-turn-snapshot.js +5 -0
- package/node_modules/@maka/runtime-host/dist/server/execution-composition.js +27 -6
- package/node_modules/@maka/runtime-host/dist/server/hosted-execution-tool-profile.js +2 -0
- 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-catalog-coordinator.js +6 -0
- package/node_modules/@maka/runtime-host/dist/server/session-continuity-coordinator.js +51 -16
- package/node_modules/@maka/runtime-host/dist/server/session-retirement-coordinator.js +112 -36
- package/node_modules/@maka/runtime-host/dist/server/session-revision-coordinator.js +27 -1
- package/node_modules/@maka/runtime-host/dist/server/storage-usage-coordinator.js +67 -0
- package/node_modules/@maka/runtime-host/dist/server/workhub-inspection-tool.js +208 -0
- package/node_modules/@maka/runtime-host/package.json +2 -2
- package/node_modules/@maka/storage/dist/git-worktree-child-executor.js +3 -1
- package/node_modules/@maka/storage/dist/operational-state-store.js +0 -13
- package/node_modules/@maka/storage/dist/project-catalog.js +13 -20
- package/node_modules/@maka/storage/dist/session-store.js +9 -6
- package/node_modules/@maka/storage/dist/sqlite-file-set.js +22 -0
- package/node_modules/@maka/storage/dist/sqlite-long-term-memory-store.js +1 -3
- package/node_modules/@maka/storage/dist/sqlite-runtime-store.js +10 -260
- package/node_modules/@maka/storage/dist/sqlite-session-catalog-query.js +1 -0
- package/node_modules/@maka/storage/dist/sqlite-session-metadata-schema.js +18 -6
- package/node_modules/@maka/storage/dist/sqlite-session-metadata-store.js +28 -6
- package/node_modules/@maka/storage/dist/storage-footprint.js +239 -0
- package/node_modules/@maka/storage/dist/storage-writer-composition.js +10 -1
- 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/axios/CHANGELOG.md +62 -0
- package/node_modules/axios/README.md +297 -5
- package/node_modules/axios/dist/axios.js +728 -170
- package/node_modules/axios/dist/axios.min.js +3 -3
- package/node_modules/axios/dist/browser/axios.cjs +871 -188
- package/node_modules/axios/dist/esm/axios.js +871 -188
- package/node_modules/axios/dist/esm/axios.min.js +2 -2
- package/node_modules/axios/dist/node/axios.cjs +1037 -225
- package/node_modules/axios/lib/adapters/fetch.js +64 -11
- package/node_modules/axios/lib/adapters/http.js +140 -67
- package/node_modules/axios/lib/adapters/xhr.js +52 -3
- package/node_modules/axios/lib/core/Axios.js +43 -20
- package/node_modules/axios/lib/core/AxiosError.js +33 -2
- package/node_modules/axios/lib/core/AxiosHeaders.js +124 -1
- package/node_modules/axios/lib/core/InterceptorManager.js +107 -8
- package/node_modules/axios/lib/core/buildFullPath.js +41 -15
- package/node_modules/axios/lib/core/dispatchRequest.js +8 -2
- package/node_modules/axios/lib/core/mergeConfig.js +19 -4
- package/node_modules/axios/lib/core/methodList.js +17 -0
- package/node_modules/axios/lib/core/setFormDataHeaders.js +27 -0
- package/node_modules/axios/lib/defaults/index.js +2 -1
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/Http2Sessions.js +2 -0
- package/node_modules/axios/lib/helpers/HttpStatusCode.js +12 -1
- package/node_modules/axios/lib/helpers/combineURLs.js +11 -3
- package/node_modules/axios/lib/helpers/composeSignals.js +12 -1
- package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +115 -54
- package/node_modules/axios/lib/helpers/formDataToJSON.js +11 -5
- package/node_modules/axios/lib/helpers/fromDataURI.js +5 -4
- package/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +24 -0
- package/node_modules/axios/lib/helpers/parseHeaders.js +5 -3
- package/node_modules/axios/lib/helpers/progressEventReducer.js +4 -4
- package/node_modules/axios/lib/helpers/resolveConfig.js +5 -17
- package/node_modules/axios/lib/helpers/shouldBypassProxy.js +300 -5
- package/node_modules/axios/lib/helpers/throttle.js +3 -2
- package/node_modules/axios/lib/helpers/toFormData.js +17 -23
- package/node_modules/axios/lib/platform/node/classes/Buffer.js +11 -0
- package/node_modules/axios/lib/utils.js +151 -18
- package/node_modules/axios/package.json +21 -19
- package/node_modules/brace-expansion/dist/commonjs/index.js +69 -25
- package/node_modules/brace-expansion/dist/esm/index.js +68 -24
- package/node_modules/brace-expansion/package.json +2 -1
- package/node_modules/fast-uri/index.js +10 -6
- package/node_modules/fast-uri/package.json +1 -1
- 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
|
@@ -8,7 +8,7 @@ function combineHeaders(...headers) {
|
|
|
8
8
|
return headers.reduce(
|
|
9
9
|
(combinedHeaders, currentHeaders) => ({
|
|
10
10
|
...combinedHeaders,
|
|
11
|
-
...currentHeaders
|
|
11
|
+
...currentHeaders
|
|
12
12
|
}),
|
|
13
13
|
{}
|
|
14
14
|
);
|
|
@@ -24,11 +24,11 @@ function removeUndefinedEntries(record) {
|
|
|
24
24
|
// src/delay.ts
|
|
25
25
|
async function delay(delayInMs, options) {
|
|
26
26
|
if (delayInMs == null) {
|
|
27
|
-
return
|
|
27
|
+
return;
|
|
28
28
|
}
|
|
29
|
-
const signal = options
|
|
29
|
+
const signal = options?.abortSignal;
|
|
30
30
|
return new Promise((resolve2, reject) => {
|
|
31
|
-
if (signal
|
|
31
|
+
if (signal?.aborted) {
|
|
32
32
|
reject(createAbortError());
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
@@ -38,13 +38,13 @@ async function delay(delayInMs, options) {
|
|
|
38
38
|
}, delayInMs);
|
|
39
39
|
const cleanup = () => {
|
|
40
40
|
clearTimeout(timeoutId);
|
|
41
|
-
signal
|
|
41
|
+
signal?.removeEventListener("abort", onAbort);
|
|
42
42
|
};
|
|
43
43
|
const onAbort = () => {
|
|
44
44
|
cleanup();
|
|
45
45
|
reject(createAbortError());
|
|
46
46
|
};
|
|
47
|
-
signal
|
|
47
|
+
signal?.addEventListener("abort", onAbort);
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
function createAbortError() {
|
|
@@ -53,7 +53,7 @@ function createAbortError() {
|
|
|
53
53
|
|
|
54
54
|
// src/websocket.ts
|
|
55
55
|
function getWebSocketConstructor(webSocket) {
|
|
56
|
-
const WebSocketConstructor = webSocket
|
|
56
|
+
const WebSocketConstructor = webSocket ?? globalThis.WebSocket;
|
|
57
57
|
if (WebSocketConstructor == null) {
|
|
58
58
|
throw new Error("No WebSocket implementation available.");
|
|
59
59
|
}
|
|
@@ -86,9 +86,8 @@ async function waitForWebSocketBufferDrain(socket, {
|
|
|
86
86
|
pollIntervalMs = 20,
|
|
87
87
|
abortSignal
|
|
88
88
|
} = {}) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
if ((abortSignal == null ? void 0 : abortSignal.aborted) === true) {
|
|
89
|
+
while (socket.readyState === WEBSOCKET_OPEN_STATE && (socket.bufferedAmount ?? 0) > highWaterMark) {
|
|
90
|
+
if (abortSignal?.aborted === true) {
|
|
92
91
|
return;
|
|
93
92
|
}
|
|
94
93
|
await delay(pollIntervalMs);
|
|
@@ -109,43 +108,39 @@ function connectToWebSocket({
|
|
|
109
108
|
onClose,
|
|
110
109
|
onAbort
|
|
111
110
|
}) {
|
|
112
|
-
var _a3;
|
|
113
111
|
let socket;
|
|
114
112
|
let abortListener;
|
|
115
113
|
const close = (code) => {
|
|
116
114
|
if (abortListener != null) {
|
|
117
|
-
abortSignal
|
|
115
|
+
abortSignal?.removeEventListener("abort", abortListener);
|
|
118
116
|
abortListener = void 0;
|
|
119
117
|
}
|
|
120
118
|
try {
|
|
121
|
-
socket
|
|
122
|
-
} catch
|
|
119
|
+
socket?.close(code);
|
|
120
|
+
} catch {
|
|
123
121
|
}
|
|
124
122
|
};
|
|
125
|
-
if (abortSignal
|
|
126
|
-
onAbort
|
|
123
|
+
if (abortSignal?.aborted) {
|
|
124
|
+
onAbort?.(abortSignal.reason ?? new Error("Aborted"));
|
|
127
125
|
return { socket: void 0, close };
|
|
128
126
|
}
|
|
129
127
|
try {
|
|
130
128
|
const WebSocketConstructor = getWebSocketConstructor(webSocket);
|
|
131
129
|
socket = new WebSocketConstructor(url, protocols, {
|
|
132
|
-
headers: removeUndefinedEntries(headers
|
|
130
|
+
headers: removeUndefinedEntries(headers ?? {})
|
|
133
131
|
});
|
|
134
132
|
} catch (error) {
|
|
135
133
|
onProcessingError(error);
|
|
136
134
|
return { socket: void 0, close };
|
|
137
135
|
}
|
|
138
136
|
if (abortSignal != null && onAbort != null) {
|
|
139
|
-
abortListener = () =>
|
|
140
|
-
var _a4;
|
|
141
|
-
return onAbort((_a4 = abortSignal.reason) != null ? _a4 : new Error("Aborted"));
|
|
142
|
-
};
|
|
137
|
+
abortListener = () => onAbort(abortSignal.reason ?? new Error("Aborted"));
|
|
143
138
|
abortSignal.addEventListener("abort", abortListener, { once: true });
|
|
144
139
|
}
|
|
145
140
|
const openedSocket = socket;
|
|
146
141
|
socket.onopen = () => {
|
|
147
142
|
try {
|
|
148
|
-
onOpen
|
|
143
|
+
onOpen?.(openedSocket);
|
|
149
144
|
} catch (error) {
|
|
150
145
|
onProcessingError(error);
|
|
151
146
|
}
|
|
@@ -155,13 +150,13 @@ function connectToWebSocket({
|
|
|
155
150
|
tail = tail.then(() => readWebSocketMessageText(event.data)).then((text) => onMessageText(text)).catch(onProcessingError);
|
|
156
151
|
};
|
|
157
152
|
socket.onerror = () => {
|
|
158
|
-
tail = tail.then(() => onSocketError
|
|
153
|
+
tail = tail.then(() => onSocketError?.()).catch(onProcessingError);
|
|
159
154
|
};
|
|
160
155
|
socket.onclose = (event) => {
|
|
161
156
|
const closeEvent = event;
|
|
162
|
-
const code = typeof
|
|
163
|
-
const reason = typeof
|
|
164
|
-
tail = tail.then(() => onClose
|
|
157
|
+
const code = typeof closeEvent?.code === "number" ? closeEvent.code : void 0;
|
|
158
|
+
const reason = typeof closeEvent?.reason === "string" ? closeEvent.reason : void 0;
|
|
159
|
+
tail = tail.then(() => onClose?.({ code, reason })).catch(onProcessingError);
|
|
165
160
|
};
|
|
166
161
|
return { socket, close };
|
|
167
162
|
}
|
|
@@ -197,7 +192,7 @@ function convertAsyncIteratorToReadableStream(iterator) {
|
|
|
197
192
|
if (iterator.return) {
|
|
198
193
|
try {
|
|
199
194
|
await iterator.return(reason);
|
|
200
|
-
} catch
|
|
195
|
+
} catch {
|
|
201
196
|
}
|
|
202
197
|
}
|
|
203
198
|
}
|
|
@@ -285,8 +280,8 @@ function createLanguageModelResponseMetadata({
|
|
|
285
280
|
created
|
|
286
281
|
}) {
|
|
287
282
|
return {
|
|
288
|
-
id: id
|
|
289
|
-
modelId: model
|
|
283
|
+
id: id ?? void 0,
|
|
284
|
+
modelId: model ?? void 0,
|
|
290
285
|
timestamp: created != null ? new Date(created * 1e3) : void 0
|
|
291
286
|
};
|
|
292
287
|
}
|
|
@@ -324,14 +319,8 @@ function createToolNameMapping({
|
|
|
324
319
|
}
|
|
325
320
|
}
|
|
326
321
|
return {
|
|
327
|
-
toProviderToolName: (customToolName) =>
|
|
328
|
-
|
|
329
|
-
return (_a3 = customToolNameToProviderToolName[customToolName]) != null ? _a3 : customToolName;
|
|
330
|
-
},
|
|
331
|
-
toCustomToolName: (providerToolName) => {
|
|
332
|
-
var _a3;
|
|
333
|
-
return (_a3 = providerToolNameToCustomToolName[providerToolName]) != null ? _a3 : providerToolName;
|
|
334
|
-
}
|
|
322
|
+
toProviderToolName: (customToolName) => customToolNameToProviderToolName[customToolName] ?? customToolName,
|
|
323
|
+
toCustomToolName: (providerToolName) => providerToolNameToCustomToolName[providerToolName] ?? providerToolName
|
|
335
324
|
};
|
|
336
325
|
}
|
|
337
326
|
|
|
@@ -383,17 +372,15 @@ var DelayedPromise = class {
|
|
|
383
372
|
return this._promise;
|
|
384
373
|
}
|
|
385
374
|
resolve(value) {
|
|
386
|
-
var _a3;
|
|
387
375
|
this.status = { type: "resolved", value };
|
|
388
376
|
if (this._promise) {
|
|
389
|
-
|
|
377
|
+
this._resolve?.(value);
|
|
390
378
|
}
|
|
391
379
|
}
|
|
392
380
|
reject(error) {
|
|
393
|
-
var _a3;
|
|
394
381
|
this.status = { type: "rejected", error };
|
|
395
382
|
if (this._promise) {
|
|
396
|
-
|
|
383
|
+
this._reject?.(error);
|
|
397
384
|
}
|
|
398
385
|
}
|
|
399
386
|
isResolved() {
|
|
@@ -417,20 +404,16 @@ function extractResponseHeaders(response) {
|
|
|
417
404
|
|
|
418
405
|
// src/get-runtime-environment-user-agent.ts
|
|
419
406
|
function getRuntimeEnvironmentUserAgent(globalThisAny = globalThis) {
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
return `runtime/browser`;
|
|
423
|
-
}
|
|
424
|
-
if ((_a3 = globalThisAny.navigator) == null ? void 0 : _a3.userAgent) {
|
|
425
|
-
return `runtime/${globalThisAny.navigator.userAgent.toLowerCase()}`;
|
|
407
|
+
if (globalThisAny.navigator?.userAgent) {
|
|
408
|
+
return globalThisAny.navigator.userAgent.toLowerCase();
|
|
426
409
|
}
|
|
427
|
-
if (
|
|
428
|
-
return `
|
|
410
|
+
if (globalThisAny.process?.versions?.node) {
|
|
411
|
+
return `node.js/${globalThisAny.process.version}`;
|
|
429
412
|
}
|
|
430
413
|
if (globalThisAny.EdgeRuntime) {
|
|
431
|
-
return
|
|
414
|
+
return "vercel-edge";
|
|
432
415
|
}
|
|
433
|
-
return "
|
|
416
|
+
return "";
|
|
434
417
|
}
|
|
435
418
|
|
|
436
419
|
// src/handle-fetch-error.ts
|
|
@@ -438,7 +421,7 @@ import { APICallError } from "@ai-sdk/provider";
|
|
|
438
421
|
|
|
439
422
|
// src/is-abort-error.ts
|
|
440
423
|
function isAbortError(error) {
|
|
441
|
-
return (error instanceof Error || error instanceof DOMException) && (error.name === "AbortError" || error.name === "ResponseAborted" || // Next.js
|
|
424
|
+
return (error instanceof Error || typeof DOMException === "function" && error instanceof DOMException) && (error.name === "AbortError" || error.name === "ResponseAborted" || // Next.js
|
|
442
425
|
error.name === "TimeoutError");
|
|
443
426
|
}
|
|
444
427
|
|
|
@@ -468,7 +451,6 @@ function findNetworkError(error) {
|
|
|
468
451
|
}
|
|
469
452
|
current = current.cause;
|
|
470
453
|
}
|
|
471
|
-
return void 0;
|
|
472
454
|
}
|
|
473
455
|
function handleFetchError({
|
|
474
456
|
error,
|
|
@@ -518,7 +500,7 @@ function handleFetchError({
|
|
|
518
500
|
}
|
|
519
501
|
|
|
520
502
|
// src/version.ts
|
|
521
|
-
var VERSION = true ? "5.0.
|
|
503
|
+
var VERSION = true ? "5.0.51" : "0.0.0-test";
|
|
522
504
|
|
|
523
505
|
// src/normalize-headers.ts
|
|
524
506
|
function normalizeHeaders(headers) {
|
|
@@ -569,7 +551,7 @@ var deleteFromApi = async ({
|
|
|
569
551
|
method: "DELETE",
|
|
570
552
|
headers: withUserAgentSuffix(
|
|
571
553
|
headers,
|
|
572
|
-
`ai-sdk
|
|
554
|
+
`ai-sdk-provider-utils/${VERSION}`,
|
|
573
555
|
getRuntimeEnvironmentUserAgent()
|
|
574
556
|
),
|
|
575
557
|
signal: abortSignal
|
|
@@ -684,7 +666,8 @@ var imageMediaTypeSignatures = [
|
|
|
684
666
|
0,
|
|
685
667
|
0,
|
|
686
668
|
0,
|
|
687
|
-
|
|
669
|
+
null,
|
|
670
|
+
// box size (variable)
|
|
688
671
|
102,
|
|
689
672
|
116,
|
|
690
673
|
121,
|
|
@@ -701,7 +684,8 @@ var imageMediaTypeSignatures = [
|
|
|
701
684
|
0,
|
|
702
685
|
0,
|
|
703
686
|
0,
|
|
704
|
-
|
|
687
|
+
null,
|
|
688
|
+
// box size (variable)
|
|
705
689
|
102,
|
|
706
690
|
116,
|
|
707
691
|
121,
|
|
@@ -721,6 +705,26 @@ var documentMediaTypeSignatures = [
|
|
|
721
705
|
}
|
|
722
706
|
];
|
|
723
707
|
var audioMediaTypeSignaturesWithoutMp4 = [
|
|
708
|
+
{
|
|
709
|
+
mediaType: "audio/aac",
|
|
710
|
+
bytesPrefix: [255, 240]
|
|
711
|
+
// MPEG-4 ADTS with CRC
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
mediaType: "audio/aac",
|
|
715
|
+
bytesPrefix: [255, 241]
|
|
716
|
+
// MPEG-4 ADTS without CRC
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
mediaType: "audio/aac",
|
|
720
|
+
bytesPrefix: [255, 248]
|
|
721
|
+
// MPEG-2 ADTS with CRC
|
|
722
|
+
},
|
|
723
|
+
{
|
|
724
|
+
mediaType: "audio/aac",
|
|
725
|
+
bytesPrefix: [255, 249]
|
|
726
|
+
// MPEG-2 ADTS without CRC
|
|
727
|
+
},
|
|
724
728
|
{
|
|
725
729
|
mediaType: "audio/mpeg",
|
|
726
730
|
bytesPrefix: [255, 251]
|
|
@@ -884,7 +888,6 @@ function detectMediaTypeBySignatures({
|
|
|
884
888
|
return signature.mediaType;
|
|
885
889
|
}
|
|
886
890
|
}
|
|
887
|
-
return void 0;
|
|
888
891
|
}
|
|
889
892
|
var topLevelSignatureTables = {
|
|
890
893
|
image: imageMediaTypeSignatures,
|
|
@@ -930,10 +933,9 @@ function isFullMediaType(mediaType) {
|
|
|
930
933
|
|
|
931
934
|
// src/cancel-response-body.ts
|
|
932
935
|
async function cancelResponseBody(response) {
|
|
933
|
-
var _a3;
|
|
934
936
|
try {
|
|
935
|
-
await
|
|
936
|
-
} catch
|
|
937
|
+
await response.body?.cancel();
|
|
938
|
+
} catch {
|
|
937
939
|
}
|
|
938
940
|
}
|
|
939
941
|
|
|
@@ -971,7 +973,7 @@ function isBrowserRuntime(globalThisAny = globalThis) {
|
|
|
971
973
|
function isSameOrigin(url, baseUrl) {
|
|
972
974
|
try {
|
|
973
975
|
return new URL(url).origin === new URL(baseUrl).origin;
|
|
974
|
-
} catch
|
|
976
|
+
} catch {
|
|
975
977
|
return false;
|
|
976
978
|
}
|
|
977
979
|
}
|
|
@@ -981,7 +983,7 @@ function validateDownloadUrl(url) {
|
|
|
981
983
|
let parsed;
|
|
982
984
|
try {
|
|
983
985
|
parsed = new URL(url);
|
|
984
|
-
} catch
|
|
986
|
+
} catch {
|
|
985
987
|
throw new DownloadError({
|
|
986
988
|
url,
|
|
987
989
|
message: `Invalid URL: ${url}`
|
|
@@ -1026,7 +1028,6 @@ function validateDownloadUrl(url) {
|
|
|
1026
1028
|
message: `URL with IP address ${hostname} is not allowed`
|
|
1027
1029
|
});
|
|
1028
1030
|
}
|
|
1029
|
-
return;
|
|
1030
1031
|
}
|
|
1031
1032
|
}
|
|
1032
1033
|
function validateDownloadAddress({
|
|
@@ -1167,32 +1168,21 @@ function createSafeLookup(lookup) {
|
|
|
1167
1168
|
});
|
|
1168
1169
|
}
|
|
1169
1170
|
var safeNodeFetchPromise;
|
|
1170
|
-
var initialGlobalFetch = globalThis.fetch;
|
|
1171
|
-
var initialGlobalFetchIsNodeDefault = isNodeDefaultFetch(initialGlobalFetch);
|
|
1172
1171
|
function isNodeRuntime() {
|
|
1173
|
-
var _a3, _b3;
|
|
1174
1172
|
const runtimeProcess = globalThis.process;
|
|
1175
|
-
return
|
|
1173
|
+
return runtimeProcess?.release?.name === "node" && runtimeProcess.versions?.bun == null && runtimeProcess.versions?.deno == null && runtimeProcess.title !== "workerd" && globalThis.EdgeRuntime == null;
|
|
1176
1174
|
}
|
|
1177
1175
|
async function getDefaultDownloadFetch() {
|
|
1178
|
-
if (!isNodeRuntime()
|
|
1176
|
+
if (!isNodeRuntime()) {
|
|
1179
1177
|
return globalThis.fetch;
|
|
1180
1178
|
}
|
|
1181
|
-
return safeNodeFetchPromise
|
|
1182
|
-
}
|
|
1183
|
-
function isNodeDefaultFetch(fetch) {
|
|
1184
|
-
if (typeof fetch !== "function") {
|
|
1185
|
-
return false;
|
|
1186
|
-
}
|
|
1187
|
-
const source = Function.prototype.toString.call(fetch);
|
|
1188
|
-
return source.includes("internal/deps/undici") || source.includes("lazy loading of undici");
|
|
1179
|
+
return safeNodeFetchPromise ??= Promise.resolve().then(createSafeNodeFetch);
|
|
1189
1180
|
}
|
|
1190
1181
|
function createSafeNodeFetch() {
|
|
1191
|
-
const
|
|
1182
|
+
const module = loadBuiltinModule("node:module");
|
|
1192
1183
|
const { lookup } = loadBuiltinModule("node:dns");
|
|
1193
|
-
const
|
|
1194
|
-
|
|
1195
|
-
);
|
|
1184
|
+
const nodeRequire = module.createRequire(getCurrentModulePath());
|
|
1185
|
+
const { Agent, fetch } = nodeRequire("undici");
|
|
1196
1186
|
const dispatcher = new Agent({
|
|
1197
1187
|
connect: {
|
|
1198
1188
|
lookup: createSafeLookup(lookup)
|
|
@@ -1207,9 +1197,8 @@ function createSafeNodeFetch() {
|
|
|
1207
1197
|
));
|
|
1208
1198
|
}
|
|
1209
1199
|
function loadBuiltinModule(id) {
|
|
1210
|
-
var _a3;
|
|
1211
1200
|
const processWithBuiltins = globalThis.process;
|
|
1212
|
-
const builtinModule =
|
|
1201
|
+
const builtinModule = processWithBuiltins?.getBuiltinModule?.(id);
|
|
1213
1202
|
if (builtinModule == null) {
|
|
1214
1203
|
throw new Error(`Node.js built-in module ${id} is unavailable`);
|
|
1215
1204
|
}
|
|
@@ -1222,7 +1211,7 @@ function getCurrentModulePath() {
|
|
|
1222
1211
|
const error = new Error("Capture current module path");
|
|
1223
1212
|
Error.captureStackTrace(error, getCurrentModulePath);
|
|
1224
1213
|
const [caller] = error.stack;
|
|
1225
|
-
const fileName = caller
|
|
1214
|
+
const fileName = caller?.getFileName();
|
|
1226
1215
|
if (fileName == null) {
|
|
1227
1216
|
throw new Error("Unable to determine the current module path");
|
|
1228
1217
|
}
|
|
@@ -1300,7 +1289,6 @@ async function fetchWithValidatedRedirects({
|
|
|
1300
1289
|
fetch: customFetch,
|
|
1301
1290
|
trustedOrigin
|
|
1302
1291
|
}) {
|
|
1303
|
-
var _a3;
|
|
1304
1292
|
let currentHeaders = headers === void 0 ? void 0 : sanitizeRequestHeaders(headers);
|
|
1305
1293
|
const perHopInit = (redirect) => {
|
|
1306
1294
|
const init = { signal: abortSignal, redirect };
|
|
@@ -1326,9 +1314,9 @@ async function fetchWithValidatedRedirects({
|
|
|
1326
1314
|
}
|
|
1327
1315
|
return await fetch(currentUrl, perHopInit("follow"));
|
|
1328
1316
|
}
|
|
1329
|
-
const location =
|
|
1317
|
+
const location = response.headers?.get("location");
|
|
1330
1318
|
if (REDIRECT_STATUS_CODES.has(response.status) && location) {
|
|
1331
|
-
|
|
1319
|
+
void cancelResponseBody(response);
|
|
1332
1320
|
const nextUrl = new URL(location, currentUrl).toString();
|
|
1333
1321
|
if (currentHeaders !== void 0 && !isSameOrigin(nextUrl, currentUrl)) {
|
|
1334
1322
|
const userAgent = currentHeaders.get("user-agent");
|
|
@@ -1347,6 +1335,52 @@ async function fetchWithValidatedRedirects({
|
|
|
1347
1335
|
});
|
|
1348
1336
|
}
|
|
1349
1337
|
|
|
1338
|
+
// src/fetch-untrusted-url.ts
|
|
1339
|
+
var SAFE_UNTRUSTED_FIRST_HOP_HEADERS = /* @__PURE__ */ new Set([
|
|
1340
|
+
"accept",
|
|
1341
|
+
"accept-language",
|
|
1342
|
+
"baggage",
|
|
1343
|
+
"cache-control",
|
|
1344
|
+
"idempotency-key",
|
|
1345
|
+
"if-match",
|
|
1346
|
+
"if-modified-since",
|
|
1347
|
+
"if-none-match",
|
|
1348
|
+
"if-range",
|
|
1349
|
+
"if-unmodified-since",
|
|
1350
|
+
"pragma",
|
|
1351
|
+
"range",
|
|
1352
|
+
"traceparent",
|
|
1353
|
+
"tracestate",
|
|
1354
|
+
"user-agent",
|
|
1355
|
+
"x-correlation-id",
|
|
1356
|
+
"x-request-id"
|
|
1357
|
+
]);
|
|
1358
|
+
async function fetchUntrustedUrl({
|
|
1359
|
+
headers,
|
|
1360
|
+
credentialedOrigin,
|
|
1361
|
+
untrustedFirstHopHeaders,
|
|
1362
|
+
...options
|
|
1363
|
+
}) {
|
|
1364
|
+
let firstHopHeaders;
|
|
1365
|
+
if (headers !== void 0) {
|
|
1366
|
+
firstHopHeaders = sanitizeRequestHeaders(headers);
|
|
1367
|
+
const origin = credentialedOrigin ?? options.trustedOrigin;
|
|
1368
|
+
if (origin === void 0 || !isSameOrigin(options.url, origin)) {
|
|
1369
|
+
const allowedHeaders = /* @__PURE__ */ new Set([
|
|
1370
|
+
...SAFE_UNTRUSTED_FIRST_HOP_HEADERS,
|
|
1371
|
+
...(untrustedFirstHopHeaders ?? []).map((name3) => name3.toLowerCase())
|
|
1372
|
+
]);
|
|
1373
|
+
firstHopHeaders = new Headers(
|
|
1374
|
+
[...firstHopHeaders].filter(([name3]) => allowedHeaders.has(name3))
|
|
1375
|
+
);
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
return fetchWithValidatedRedirects({
|
|
1379
|
+
...options,
|
|
1380
|
+
headers: firstHopHeaders
|
|
1381
|
+
});
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1350
1384
|
// src/read-response-with-size-limit.ts
|
|
1351
1385
|
var DEFAULT_MAX_DOWNLOAD_SIZE = 2 * 1024 * 1024 * 1024;
|
|
1352
1386
|
async function readResponseWithSizeLimit({
|
|
@@ -1390,7 +1424,7 @@ async function readResponseWithSizeLimit({
|
|
|
1390
1424
|
} finally {
|
|
1391
1425
|
try {
|
|
1392
1426
|
await reader.cancel();
|
|
1393
|
-
} catch
|
|
1427
|
+
} catch {
|
|
1394
1428
|
} finally {
|
|
1395
1429
|
reader.releaseLock();
|
|
1396
1430
|
}
|
|
@@ -1406,11 +1440,10 @@ async function readResponseWithSizeLimit({
|
|
|
1406
1440
|
|
|
1407
1441
|
// src/download-blob.ts
|
|
1408
1442
|
async function downloadBlob(url, options) {
|
|
1409
|
-
var _a3, _b3;
|
|
1410
1443
|
try {
|
|
1411
|
-
const response = await
|
|
1444
|
+
const response = await fetchUntrustedUrl({
|
|
1412
1445
|
url,
|
|
1413
|
-
abortSignal: options
|
|
1446
|
+
abortSignal: options?.abortSignal
|
|
1414
1447
|
});
|
|
1415
1448
|
if (!response.ok) {
|
|
1416
1449
|
await cancelResponseBody(response);
|
|
@@ -1423,9 +1456,9 @@ async function downloadBlob(url, options) {
|
|
|
1423
1456
|
const data = await readResponseWithSizeLimit({
|
|
1424
1457
|
response,
|
|
1425
1458
|
url,
|
|
1426
|
-
maxBytes:
|
|
1459
|
+
maxBytes: options?.maxBytes ?? DEFAULT_MAX_DOWNLOAD_SIZE
|
|
1427
1460
|
});
|
|
1428
|
-
const contentType =
|
|
1461
|
+
const contentType = response.headers.get("content-type") ?? void 0;
|
|
1429
1462
|
return new Blob([data], contentType ? { type: contentType } : void 0);
|
|
1430
1463
|
} catch (error) {
|
|
1431
1464
|
if (DownloadError.isInstance(error)) {
|
|
@@ -1439,6 +1472,9 @@ async function downloadBlob(url, options) {
|
|
|
1439
1472
|
var EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL = /* @__PURE__ */ Symbol.for(
|
|
1440
1473
|
"vercel.ai.embeddingModel.maxInputBytesPerCall"
|
|
1441
1474
|
);
|
|
1475
|
+
var EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER = /* @__PURE__ */ Symbol.for(
|
|
1476
|
+
"vercel.ai.embeddingModel.providerOptionsTransformer"
|
|
1477
|
+
);
|
|
1442
1478
|
|
|
1443
1479
|
// src/extract-lines.ts
|
|
1444
1480
|
function extractLines({
|
|
@@ -1449,8 +1485,8 @@ function extractLines({
|
|
|
1449
1485
|
if (startLine == null && endLine == null) return text;
|
|
1450
1486
|
const lineEnding = text.includes("\r\n") ? "\r\n" : text.includes("\n") ? "\n" : text.includes("\r") ? "\r" : "\n";
|
|
1451
1487
|
const lines = text.split(lineEnding);
|
|
1452
|
-
const start = Math.max(1, startLine
|
|
1453
|
-
const end = Math.min(lines.length, endLine
|
|
1488
|
+
const start = Math.max(1, startLine ?? 1) - 1;
|
|
1489
|
+
const end = Math.min(lines.length, endLine ?? lines.length);
|
|
1454
1490
|
return lines.slice(start, end).join(lineEnding);
|
|
1455
1491
|
}
|
|
1456
1492
|
|
|
@@ -1506,11 +1542,11 @@ var getFromApi = async ({
|
|
|
1506
1542
|
trustedOrigin
|
|
1507
1543
|
}) => {
|
|
1508
1544
|
try {
|
|
1509
|
-
const requestFetch = fetch
|
|
1545
|
+
const requestFetch = fetch ?? getOriginalFetch2();
|
|
1510
1546
|
const outgoingHeaders = credentialedOrigin !== void 0 && !isSameOrigin(url, credentialedOrigin) ? {} : headers;
|
|
1511
1547
|
const requestHeaders = withUserAgentSuffix(
|
|
1512
1548
|
outgoingHeaders,
|
|
1513
|
-
`ai-sdk
|
|
1549
|
+
`ai-sdk-provider-utils/${VERSION}`,
|
|
1514
1550
|
getRuntimeEnvironmentUserAgent()
|
|
1515
1551
|
);
|
|
1516
1552
|
const response = validateUrl ? await fetchWithValidatedRedirects({
|
|
@@ -1599,8 +1635,7 @@ function injectJsonInstructionIntoMessages({
|
|
|
1599
1635
|
schemaPrefix,
|
|
1600
1636
|
schemaSuffix
|
|
1601
1637
|
}) {
|
|
1602
|
-
|
|
1603
|
-
const systemMessage = ((_a3 = messages[0]) == null ? void 0 : _a3.role) === "system" ? { ...messages[0] } : { role: "system", content: "" };
|
|
1638
|
+
const systemMessage = messages[0]?.role === "system" ? { ...messages[0] } : { role: "system", content: "" };
|
|
1604
1639
|
systemMessage.content = injectJsonInstruction({
|
|
1605
1640
|
prompt: systemMessage.content,
|
|
1606
1641
|
schema,
|
|
@@ -1609,14 +1644,13 @@ function injectJsonInstructionIntoMessages({
|
|
|
1609
1644
|
});
|
|
1610
1645
|
return [
|
|
1611
1646
|
systemMessage,
|
|
1612
|
-
...
|
|
1647
|
+
...messages[0]?.role === "system" ? messages.slice(1) : messages
|
|
1613
1648
|
];
|
|
1614
1649
|
}
|
|
1615
1650
|
|
|
1616
1651
|
// src/is-buffer.ts
|
|
1617
1652
|
function isBuffer(value) {
|
|
1618
|
-
|
|
1619
|
-
return (_b3 = (_a3 = globalThis.Buffer) == null ? void 0 : _a3.isBuffer(value)) != null ? _b3 : false;
|
|
1653
|
+
return globalThis.Buffer?.isBuffer(value) ?? false;
|
|
1620
1654
|
}
|
|
1621
1655
|
|
|
1622
1656
|
// src/is-non-nullable.ts
|
|
@@ -1653,7 +1687,7 @@ function isUrlSupported({
|
|
|
1653
1687
|
if (isTopLevelOnly) {
|
|
1654
1688
|
return `${mediaType}/` === mediaTypePrefix;
|
|
1655
1689
|
}
|
|
1656
|
-
return mediaType.startsWith(mediaTypePrefix);
|
|
1690
|
+
return mediaTypePrefix.endsWith("/") ? mediaType.startsWith(mediaTypePrefix) : mediaType === mediaTypePrefix;
|
|
1657
1691
|
}).flatMap(({ regexes }) => regexes).some((pattern) => testRegExpFromStart(pattern, url));
|
|
1658
1692
|
}
|
|
1659
1693
|
function testRegExpFromStart(pattern, value) {
|
|
@@ -1816,15 +1850,14 @@ function mapReasoningToProviderBudget({
|
|
|
1816
1850
|
|
|
1817
1851
|
// src/media-type-to-extension.ts
|
|
1818
1852
|
function mediaTypeToExtension(mediaType) {
|
|
1819
|
-
var _a3;
|
|
1820
1853
|
const [_type, subtype = ""] = mediaType.toLowerCase().split("/");
|
|
1821
|
-
return
|
|
1854
|
+
return {
|
|
1822
1855
|
mpeg: "mp3",
|
|
1823
1856
|
"x-wav": "wav",
|
|
1824
1857
|
opus: "ogg",
|
|
1825
1858
|
mp4: "m4a",
|
|
1826
1859
|
"x-m4a": "m4a"
|
|
1827
|
-
}[subtype]
|
|
1860
|
+
}[subtype] ?? subtype;
|
|
1828
1861
|
}
|
|
1829
1862
|
|
|
1830
1863
|
// src/normalize-batch-request-counts.ts
|
|
@@ -1842,7 +1875,6 @@ function normalizeBatchRequestCounts({
|
|
|
1842
1875
|
failed
|
|
1843
1876
|
};
|
|
1844
1877
|
}
|
|
1845
|
-
return void 0;
|
|
1846
1878
|
}
|
|
1847
1879
|
function isNonNegativeSafeInteger(value) {
|
|
1848
1880
|
return value != null && Number.isSafeInteger(value) && value >= 0;
|
|
@@ -1893,7 +1925,7 @@ function secureJsonParse(text) {
|
|
|
1893
1925
|
const { stackTraceLimit } = Error;
|
|
1894
1926
|
try {
|
|
1895
1927
|
Error.stackTraceLimit = 0;
|
|
1896
|
-
} catch
|
|
1928
|
+
} catch {
|
|
1897
1929
|
return _parse(text);
|
|
1898
1930
|
}
|
|
1899
1931
|
try {
|
|
@@ -1990,11 +2022,10 @@ function parseAnyDef() {
|
|
|
1990
2022
|
|
|
1991
2023
|
// src/to-json-schema/zod3-to-json-schema/parsers/array.ts
|
|
1992
2024
|
function parseArrayDef(def, refs) {
|
|
1993
|
-
var _a3, _b3, _c;
|
|
1994
2025
|
const res = {
|
|
1995
2026
|
type: "array"
|
|
1996
2027
|
};
|
|
1997
|
-
if (
|
|
2028
|
+
if (def.type?._def && def.type?._def?.typeName !== "ZodAny") {
|
|
1998
2029
|
res.items = parseDef(def.type._def, {
|
|
1999
2030
|
...refs,
|
|
2000
2031
|
currentPath: [...refs.currentPath, "items"]
|
|
@@ -2061,7 +2092,7 @@ var parseCatchDef = (def, refs) => {
|
|
|
2061
2092
|
|
|
2062
2093
|
// src/to-json-schema/zod3-to-json-schema/parsers/date.ts
|
|
2063
2094
|
function parseDateDef(def, refs, overrideDateStrategy) {
|
|
2064
|
-
const strategy = overrideDateStrategy
|
|
2095
|
+
const strategy = overrideDateStrategy ?? refs.dateStrategy;
|
|
2065
2096
|
if (Array.isArray(strategy)) {
|
|
2066
2097
|
return {
|
|
2067
2098
|
anyOf: strategy.map((item) => parseDateDef(def, refs, item))
|
|
@@ -2180,7 +2211,7 @@ var zodPatterns = {
|
|
|
2180
2211
|
/**
|
|
2181
2212
|
* `a-z` was added to replicate /i flag
|
|
2182
2213
|
*/
|
|
2183
|
-
email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'
|
|
2214
|
+
email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}$/,
|
|
2184
2215
|
/**
|
|
2185
2216
|
* Constructed a valid Unicode RegExp
|
|
2186
2217
|
*
|
|
@@ -2382,8 +2413,7 @@ function escapeNonAlphaNumeric(source) {
|
|
|
2382
2413
|
return result;
|
|
2383
2414
|
}
|
|
2384
2415
|
function addFormat(schema, value, message, refs) {
|
|
2385
|
-
|
|
2386
|
-
if (schema.format || ((_a3 = schema.anyOf) == null ? void 0 : _a3.some((x) => x.format))) {
|
|
2416
|
+
if (schema.format || schema.anyOf?.some((x) => x.format)) {
|
|
2387
2417
|
if (!schema.anyOf) {
|
|
2388
2418
|
schema.anyOf = [];
|
|
2389
2419
|
}
|
|
@@ -2402,8 +2432,7 @@ function addFormat(schema, value, message, refs) {
|
|
|
2402
2432
|
}
|
|
2403
2433
|
}
|
|
2404
2434
|
function addPattern(schema, regex, message, refs) {
|
|
2405
|
-
|
|
2406
|
-
if (schema.pattern || ((_a3 = schema.allOf) == null ? void 0 : _a3.some((x) => x.pattern))) {
|
|
2435
|
+
if (schema.pattern || schema.allOf?.some((x) => x.pattern)) {
|
|
2407
2436
|
if (!schema.allOf) {
|
|
2408
2437
|
schema.allOf = [];
|
|
2409
2438
|
}
|
|
@@ -2422,7 +2451,6 @@ function addPattern(schema, regex, message, refs) {
|
|
|
2422
2451
|
}
|
|
2423
2452
|
}
|
|
2424
2453
|
function stringifyRegExpWithFlags(regex, refs) {
|
|
2425
|
-
var _a3;
|
|
2426
2454
|
if (!refs.applyRegexFlags || !regex.flags) {
|
|
2427
2455
|
return regex.source;
|
|
2428
2456
|
}
|
|
@@ -2452,7 +2480,7 @@ function stringifyRegExpWithFlags(regex, refs) {
|
|
|
2452
2480
|
pattern += source[i];
|
|
2453
2481
|
pattern += `${source[i - 2]}-${source[i]}`.toUpperCase();
|
|
2454
2482
|
inCharRange = false;
|
|
2455
|
-
} else if (source[i + 1] === "-" &&
|
|
2483
|
+
} else if (source[i + 1] === "-" && source[i + 2]?.match(/[a-z]/)) {
|
|
2456
2484
|
pattern += source[i];
|
|
2457
2485
|
inCharRange = true;
|
|
2458
2486
|
} else {
|
|
@@ -2493,7 +2521,7 @@ function stringifyRegExpWithFlags(regex, refs) {
|
|
|
2493
2521
|
}
|
|
2494
2522
|
try {
|
|
2495
2523
|
new RegExp(pattern);
|
|
2496
|
-
} catch
|
|
2524
|
+
} catch {
|
|
2497
2525
|
console.warn(
|
|
2498
2526
|
`Could not convert regex pattern at ${refs.currentPath.join(
|
|
2499
2527
|
"/"
|
|
@@ -2506,28 +2534,27 @@ function stringifyRegExpWithFlags(regex, refs) {
|
|
|
2506
2534
|
|
|
2507
2535
|
// src/to-json-schema/zod3-to-json-schema/parsers/record.ts
|
|
2508
2536
|
function parseRecordDef(def, refs) {
|
|
2509
|
-
var _a3, _b3, _c, _d, _e, _f;
|
|
2510
2537
|
const schema = {
|
|
2511
2538
|
type: "object",
|
|
2512
|
-
additionalProperties:
|
|
2539
|
+
additionalProperties: parseDef(def.valueType._def, {
|
|
2513
2540
|
...refs,
|
|
2514
2541
|
currentPath: [...refs.currentPath, "additionalProperties"]
|
|
2515
|
-
})
|
|
2542
|
+
}) ?? refs.allowedAdditionalProperties
|
|
2516
2543
|
};
|
|
2517
|
-
if (
|
|
2544
|
+
if (def.keyType?._def.typeName === "ZodString" && def.keyType._def.checks?.length) {
|
|
2518
2545
|
const { type: _type, ...keyType } = parseStringDef(def.keyType._def, refs);
|
|
2519
2546
|
return {
|
|
2520
2547
|
...schema,
|
|
2521
2548
|
propertyNames: keyType
|
|
2522
2549
|
};
|
|
2523
|
-
} else if (
|
|
2550
|
+
} else if (def.keyType?._def.typeName === "ZodEnum") {
|
|
2524
2551
|
return {
|
|
2525
2552
|
...schema,
|
|
2526
2553
|
propertyNames: {
|
|
2527
2554
|
enum: def.keyType._def.values
|
|
2528
2555
|
}
|
|
2529
2556
|
};
|
|
2530
|
-
} else if (
|
|
2557
|
+
} else if (def.keyType?._def.typeName === "ZodBranded" && def.keyType._def.type._def.typeName === "ZodString" && def.keyType._def.type._def.checks?.length) {
|
|
2531
2558
|
const { type: _type, ...keyType } = parseBrandedDef(
|
|
2532
2559
|
def.keyType._def,
|
|
2533
2560
|
refs
|
|
@@ -2780,15 +2807,14 @@ function decideAdditionalProperties(def, refs) {
|
|
|
2780
2807
|
function safeIsOptional(schema) {
|
|
2781
2808
|
try {
|
|
2782
2809
|
return schema.isOptional();
|
|
2783
|
-
} catch
|
|
2810
|
+
} catch {
|
|
2784
2811
|
return true;
|
|
2785
2812
|
}
|
|
2786
2813
|
}
|
|
2787
2814
|
|
|
2788
2815
|
// src/to-json-schema/zod3-to-json-schema/parsers/optional.ts
|
|
2789
2816
|
var parseOptionalDef = (def, refs) => {
|
|
2790
|
-
|
|
2791
|
-
if (refs.currentPath.toString() === ((_a3 = refs.propertyPath) == null ? void 0 : _a3.toString())) {
|
|
2817
|
+
if (refs.currentPath.toString() === refs.propertyPath?.toString()) {
|
|
2792
2818
|
return parseDef(def.innerType._def, refs);
|
|
2793
2819
|
}
|
|
2794
2820
|
const innerSchema = parseDef(def.innerType._def, {
|
|
@@ -2987,11 +3013,9 @@ var getRelativePath = (pathA, pathB) => {
|
|
|
2987
3013
|
|
|
2988
3014
|
// src/to-json-schema/zod3-to-json-schema/parse-def.ts
|
|
2989
3015
|
function parseDef(def, refs, forceResolution = false) {
|
|
2990
|
-
var _a3;
|
|
2991
3016
|
const seenItem = refs.seen.get(def);
|
|
2992
3017
|
if (refs.override) {
|
|
2993
|
-
const overrideResult =
|
|
2994
|
-
refs,
|
|
3018
|
+
const overrideResult = refs.override?.(
|
|
2995
3019
|
def,
|
|
2996
3020
|
refs,
|
|
2997
3021
|
seenItem,
|
|
@@ -3073,34 +3097,30 @@ var getRefs = (options) => {
|
|
|
3073
3097
|
|
|
3074
3098
|
// src/to-json-schema/zod3-to-json-schema/zod3-to-json-schema.ts
|
|
3075
3099
|
var zod3ToJsonSchema = (schema, options) => {
|
|
3076
|
-
var _a3;
|
|
3077
3100
|
const refs = getRefs(options);
|
|
3078
3101
|
let definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce(
|
|
3079
|
-
(acc, [name4, schema2]) => {
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
)) != null ? _a4 : parseAnyDef()
|
|
3091
|
-
};
|
|
3092
|
-
},
|
|
3102
|
+
(acc, [name4, schema2]) => ({
|
|
3103
|
+
...acc,
|
|
3104
|
+
[name4]: parseDef(
|
|
3105
|
+
schema2._def,
|
|
3106
|
+
{
|
|
3107
|
+
...refs,
|
|
3108
|
+
currentPath: [...refs.basePath, refs.definitionPath, name4]
|
|
3109
|
+
},
|
|
3110
|
+
true
|
|
3111
|
+
) ?? parseAnyDef()
|
|
3112
|
+
}),
|
|
3093
3113
|
{}
|
|
3094
3114
|
) : void 0;
|
|
3095
|
-
const name3 = typeof options === "string" ? options :
|
|
3096
|
-
const main =
|
|
3115
|
+
const name3 = typeof options === "string" ? options : options?.nameStrategy === "title" ? void 0 : options?.name;
|
|
3116
|
+
const main = parseDef(
|
|
3097
3117
|
schema._def,
|
|
3098
3118
|
name3 === void 0 ? refs : {
|
|
3099
3119
|
...refs,
|
|
3100
3120
|
currentPath: [...refs.basePath, refs.definitionPath, name3]
|
|
3101
3121
|
},
|
|
3102
3122
|
false
|
|
3103
|
-
)
|
|
3123
|
+
) ?? parseAnyDef();
|
|
3104
3124
|
const title = typeof options === "object" && options.name !== void 0 && options.nameStrategy === "title" ? options.name : void 0;
|
|
3105
3125
|
if (title !== void 0) {
|
|
3106
3126
|
main.title = title;
|
|
@@ -3192,8 +3212,7 @@ function hasStandardJsonSchema(schema) {
|
|
|
3192
3212
|
return schema["~standard"].jsonSchema != null;
|
|
3193
3213
|
}
|
|
3194
3214
|
function zod3Schema(zodSchema2, options) {
|
|
3195
|
-
|
|
3196
|
-
const useReferences = (_a3 = options == null ? void 0 : options.useReferences) != null ? _a3 : false;
|
|
3215
|
+
const useReferences = options?.useReferences ?? false;
|
|
3197
3216
|
return jsonSchema(
|
|
3198
3217
|
// defer json schema creation to avoid unnecessary computation when only validation is needed
|
|
3199
3218
|
() => zod3ToJsonSchema(zodSchema2, {
|
|
@@ -3208,8 +3227,7 @@ function zod3Schema(zodSchema2, options) {
|
|
|
3208
3227
|
);
|
|
3209
3228
|
}
|
|
3210
3229
|
function zod4Schema(zodSchema2, options) {
|
|
3211
|
-
|
|
3212
|
-
const useReferences = (_a3 = options == null ? void 0 : options.useReferences) != null ? _a3 : false;
|
|
3230
|
+
const useReferences = options?.useReferences ?? false;
|
|
3213
3231
|
return jsonSchema(
|
|
3214
3232
|
// defer json schema creation to avoid unnecessary computation when only validation is needed
|
|
3215
3233
|
() => addAdditionalPropertiesToJsonSchema(
|
|
@@ -3318,7 +3336,7 @@ function isParsableJson(input) {
|
|
|
3318
3336
|
try {
|
|
3319
3337
|
secureJsonParse(input);
|
|
3320
3338
|
return true;
|
|
3321
|
-
} catch
|
|
3339
|
+
} catch {
|
|
3322
3340
|
return false;
|
|
3323
3341
|
}
|
|
3324
3342
|
}
|
|
@@ -3350,7 +3368,7 @@ async function parseProviderOptions({
|
|
|
3350
3368
|
providerOptions,
|
|
3351
3369
|
schema
|
|
3352
3370
|
}) {
|
|
3353
|
-
if (
|
|
3371
|
+
if (providerOptions?.[provider] == null) {
|
|
3354
3372
|
return void 0;
|
|
3355
3373
|
}
|
|
3356
3374
|
const parsedProviderOptions = await safeValidateTypes({
|
|
@@ -3379,7 +3397,6 @@ function createMultipartBody(parts, boundary) {
|
|
|
3379
3397
|
let activeReader;
|
|
3380
3398
|
const enteredStreams = /* @__PURE__ */ new Set();
|
|
3381
3399
|
async function* emitParts() {
|
|
3382
|
-
var _a3, _b3;
|
|
3383
3400
|
for (const part of parts) {
|
|
3384
3401
|
if (disposed) return;
|
|
3385
3402
|
const disposition = `--${boundary}\r
|
|
@@ -3392,9 +3409,9 @@ ${part.value}\r
|
|
|
3392
3409
|
continue;
|
|
3393
3410
|
}
|
|
3394
3411
|
const filenameParameter = `; filename="${escapeMultipartHeaderValue(
|
|
3395
|
-
|
|
3412
|
+
part.filename ?? "blob"
|
|
3396
3413
|
)}"`;
|
|
3397
|
-
const mediaType = (
|
|
3414
|
+
const mediaType = (part.mediaType ?? "application/octet-stream").replace(
|
|
3398
3415
|
/[\r\n]/g,
|
|
3399
3416
|
""
|
|
3400
3417
|
);
|
|
@@ -3465,13 +3482,10 @@ var postMultipartStreamToApi = async ({
|
|
|
3465
3482
|
}) => {
|
|
3466
3483
|
const boundary = `ai-sdk-multipart-${generateId()}`;
|
|
3467
3484
|
const requestBodyValues = Object.fromEntries(
|
|
3468
|
-
parts.map((part) =>
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
part.type === "field" ? part.value : `<file:${(_a3 = part.filename) != null ? _a3 : part.name}>`
|
|
3473
|
-
];
|
|
3474
|
-
})
|
|
3485
|
+
parts.map((part) => [
|
|
3486
|
+
part.name,
|
|
3487
|
+
part.type === "field" ? part.value : `<file:${part.filename ?? part.name}>`
|
|
3488
|
+
])
|
|
3475
3489
|
);
|
|
3476
3490
|
const body = createMultipartBody(parts, boundary);
|
|
3477
3491
|
try {
|
|
@@ -3482,7 +3496,7 @@ var postMultipartStreamToApi = async ({
|
|
|
3482
3496
|
...headers,
|
|
3483
3497
|
"Content-Type": `multipart/form-data; boundary=${boundary}`
|
|
3484
3498
|
},
|
|
3485
|
-
`ai-sdk
|
|
3499
|
+
`ai-sdk-provider-utils/${VERSION}`,
|
|
3486
3500
|
getRuntimeEnvironmentUserAgent()
|
|
3487
3501
|
),
|
|
3488
3502
|
body: body.stream,
|
|
@@ -3601,7 +3615,7 @@ var postToApi = async ({
|
|
|
3601
3615
|
method: "POST",
|
|
3602
3616
|
headers: withUserAgentSuffix(
|
|
3603
3617
|
headers,
|
|
3604
|
-
`ai-sdk
|
|
3618
|
+
`ai-sdk-provider-utils/${VERSION}`,
|
|
3605
3619
|
getRuntimeEnvironmentUserAgent()
|
|
3606
3620
|
),
|
|
3607
3621
|
body: body.content,
|
|
@@ -3754,7 +3768,7 @@ async function resolve(value) {
|
|
|
3754
3768
|
if (typeof value === "function") {
|
|
3755
3769
|
value = value();
|
|
3756
3770
|
}
|
|
3757
|
-
return
|
|
3771
|
+
return value;
|
|
3758
3772
|
}
|
|
3759
3773
|
|
|
3760
3774
|
// src/resolve-full-media-type.ts
|
|
@@ -3968,7 +3982,7 @@ var createJsonErrorResponseHandler = ({
|
|
|
3968
3982
|
statusCode: response.status,
|
|
3969
3983
|
responseHeaders,
|
|
3970
3984
|
responseBody,
|
|
3971
|
-
isRetryable: isRetryable
|
|
3985
|
+
isRetryable: isRetryable?.(response)
|
|
3972
3986
|
})
|
|
3973
3987
|
};
|
|
3974
3988
|
}
|
|
@@ -3987,10 +4001,10 @@ var createJsonErrorResponseHandler = ({
|
|
|
3987
4001
|
responseHeaders,
|
|
3988
4002
|
responseBody,
|
|
3989
4003
|
data: parsedError,
|
|
3990
|
-
isRetryable: isRetryable
|
|
4004
|
+
isRetryable: isRetryable?.(response, parsedError)
|
|
3991
4005
|
})
|
|
3992
4006
|
};
|
|
3993
|
-
} catch
|
|
4007
|
+
} catch {
|
|
3994
4008
|
return {
|
|
3995
4009
|
responseHeaders,
|
|
3996
4010
|
value: new APICallError6({
|
|
@@ -4000,7 +4014,7 @@ var createJsonErrorResponseHandler = ({
|
|
|
4000
4014
|
statusCode: response.status,
|
|
4001
4015
|
responseHeaders,
|
|
4002
4016
|
responseBody,
|
|
4003
|
-
isRetryable: isRetryable
|
|
4017
|
+
isRetryable: isRetryable?.(response)
|
|
4004
4018
|
})
|
|
4005
4019
|
};
|
|
4006
4020
|
}
|
|
@@ -4232,16 +4246,87 @@ function resolveSync(value) {
|
|
|
4232
4246
|
import {
|
|
4233
4247
|
InvalidResponseDataError
|
|
4234
4248
|
} from "@ai-sdk/provider";
|
|
4235
|
-
|
|
4236
|
-
|
|
4249
|
+
|
|
4250
|
+
// src/streaming-tool-call-argument-state.ts
|
|
4251
|
+
function startsWithStructuredValue(value) {
|
|
4252
|
+
if (typeof value !== "string") {
|
|
4253
|
+
return false;
|
|
4254
|
+
}
|
|
4255
|
+
const firstCharacter = value.trimStart()[0];
|
|
4256
|
+
return firstCharacter === "{" || firstCharacter === "[";
|
|
4237
4257
|
}
|
|
4258
|
+
var StreamingToolCallArgumentState = class {
|
|
4259
|
+
constructor(initialValue = "") {
|
|
4260
|
+
this.structure = { kind: "undetermined" };
|
|
4261
|
+
this.append(initialValue);
|
|
4262
|
+
}
|
|
4263
|
+
get hasCompleteStructuredValue() {
|
|
4264
|
+
return this.structure.kind === "structured" && this.structure.complete === true;
|
|
4265
|
+
}
|
|
4266
|
+
append(delta) {
|
|
4267
|
+
let nextStructure = this.structure;
|
|
4268
|
+
for (const character of delta) {
|
|
4269
|
+
if (nextStructure.kind === "undetermined") {
|
|
4270
|
+
if (/\s/.test(character)) {
|
|
4271
|
+
continue;
|
|
4272
|
+
}
|
|
4273
|
+
if (character !== "{" && character !== "[") {
|
|
4274
|
+
nextStructure = { kind: "other" };
|
|
4275
|
+
continue;
|
|
4276
|
+
}
|
|
4277
|
+
nextStructure = {
|
|
4278
|
+
kind: "structured",
|
|
4279
|
+
stack: [character],
|
|
4280
|
+
inString: false,
|
|
4281
|
+
escaped: false,
|
|
4282
|
+
complete: false
|
|
4283
|
+
};
|
|
4284
|
+
continue;
|
|
4285
|
+
}
|
|
4286
|
+
if (nextStructure.kind !== "structured" || nextStructure.complete) {
|
|
4287
|
+
continue;
|
|
4288
|
+
}
|
|
4289
|
+
if (nextStructure.inString) {
|
|
4290
|
+
if (nextStructure.escaped) {
|
|
4291
|
+
nextStructure.escaped = false;
|
|
4292
|
+
} else if (character === "\\") {
|
|
4293
|
+
nextStructure.escaped = true;
|
|
4294
|
+
} else if (character === '"') {
|
|
4295
|
+
nextStructure.inString = false;
|
|
4296
|
+
}
|
|
4297
|
+
continue;
|
|
4298
|
+
}
|
|
4299
|
+
if (character === '"') {
|
|
4300
|
+
nextStructure.inString = true;
|
|
4301
|
+
} else if (character === "{" || character === "[") {
|
|
4302
|
+
nextStructure.stack.push(character);
|
|
4303
|
+
} else if (character === "}" || character === "]") {
|
|
4304
|
+
const expectedOpening = character === "}" ? "{" : "[";
|
|
4305
|
+
if (nextStructure.stack.at(-1) !== expectedOpening) {
|
|
4306
|
+
nextStructure = { kind: "other" };
|
|
4307
|
+
continue;
|
|
4308
|
+
}
|
|
4309
|
+
nextStructure.stack.pop();
|
|
4310
|
+
if (nextStructure.stack.length === 0) {
|
|
4311
|
+
nextStructure.complete = true;
|
|
4312
|
+
}
|
|
4313
|
+
}
|
|
4314
|
+
}
|
|
4315
|
+
this.structure = nextStructure;
|
|
4316
|
+
}
|
|
4317
|
+
};
|
|
4318
|
+
|
|
4319
|
+
// src/streaming-tool-call-tracker.ts
|
|
4238
4320
|
var StreamingToolCallTracker = class {
|
|
4239
4321
|
constructor(controller, options = {}) {
|
|
4240
4322
|
this.toolCalls = [];
|
|
4241
|
-
|
|
4323
|
+
this.toolCallsById = /* @__PURE__ */ new Map();
|
|
4324
|
+
this.toolCallsByIndex = /* @__PURE__ */ new Map();
|
|
4325
|
+
this.usedToolCallIds = /* @__PURE__ */ new Set();
|
|
4326
|
+
this.nextGeneratedIdSuffixes = /* @__PURE__ */ new Map();
|
|
4242
4327
|
this.controller = controller;
|
|
4243
|
-
this._generateId =
|
|
4244
|
-
this.typeValidation =
|
|
4328
|
+
this._generateId = options.generateId ?? generateId;
|
|
4329
|
+
this.typeValidation = options.typeValidation ?? "none";
|
|
4245
4330
|
this.extractMetadata = options.extractMetadata;
|
|
4246
4331
|
this.buildToolCallProviderMetadata = options.buildToolCallProviderMetadata;
|
|
4247
4332
|
}
|
|
@@ -4251,90 +4336,161 @@ var StreamingToolCallTracker = class {
|
|
|
4251
4336
|
* events as appropriate.
|
|
4252
4337
|
*/
|
|
4253
4338
|
processDelta(toolCallDelta) {
|
|
4254
|
-
|
|
4255
|
-
const wireId =
|
|
4256
|
-
const
|
|
4257
|
-
const
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4339
|
+
const wireName = toolCallDelta.function?.name;
|
|
4340
|
+
const wireId = this.getNonBlankString(toolCallDelta.id);
|
|
4341
|
+
const name3 = this.getNonBlankString(wireName);
|
|
4342
|
+
const { index } = toolCallDelta;
|
|
4343
|
+
const resolution = this.resolveToolCall({
|
|
4344
|
+
wireId,
|
|
4345
|
+
index,
|
|
4346
|
+
name: name3,
|
|
4347
|
+
hasExplicitCallStart: name3 != null && startsWithStructuredValue(toolCallDelta.function?.arguments)
|
|
4348
|
+
});
|
|
4349
|
+
if (resolution.kind === "ambiguous") {
|
|
4350
|
+
throw new InvalidResponseDataError({
|
|
4351
|
+
data: toolCallDelta,
|
|
4352
|
+
message: "Ambiguous streamed tool call delta."
|
|
4353
|
+
});
|
|
4268
4354
|
}
|
|
4269
|
-
|
|
4270
|
-
|
|
4355
|
+
let toolCall;
|
|
4356
|
+
if (resolution.kind === "new") {
|
|
4357
|
+
toolCall = this.processNewToolCall(toolCallDelta, {
|
|
4358
|
+
wireId,
|
|
4359
|
+
index,
|
|
4360
|
+
name: name3
|
|
4361
|
+
});
|
|
4362
|
+
} else {
|
|
4363
|
+
toolCall = resolution.toolCall;
|
|
4364
|
+
if (wireId != null) {
|
|
4365
|
+
this.associateWireId(toolCall, wireId);
|
|
4366
|
+
}
|
|
4367
|
+
this.processExistingToolCall(toolCall, toolCallDelta);
|
|
4271
4368
|
}
|
|
4272
|
-
if (
|
|
4273
|
-
toolCall
|
|
4369
|
+
if (index != null) {
|
|
4370
|
+
this.associateIndex(toolCall, index);
|
|
4274
4371
|
}
|
|
4275
|
-
this.processExistingToolCall(toolCall, toolCallDelta);
|
|
4276
4372
|
}
|
|
4277
4373
|
/**
|
|
4278
|
-
*
|
|
4279
|
-
*
|
|
4280
|
-
* actually match, which is why a delta carrying only arguments never resolves here.
|
|
4281
|
-
*
|
|
4282
|
-
* Scanning stops at the first call an alias claims, and a `function.name` that disagrees
|
|
4283
|
-
* with that call rejects the delta rather than letting the scan continue. Continuing past
|
|
4284
|
-
* it reaches a call whose claim on the alias a later call has already superseded, which
|
|
4285
|
-
* files a whole new call as a continuation of one two positions back.
|
|
4374
|
+
* Finalize any unfinished tool calls. Should be called during the stream's
|
|
4375
|
+
* flush handler to ensure all tool calls are properly completed.
|
|
4286
4376
|
*/
|
|
4377
|
+
flush() {
|
|
4378
|
+
const toolCalls = this.toolCalls.every((toolCall) => toolCall.index != null) ? [...this.toolCalls].sort(
|
|
4379
|
+
(a, b) => a.index - b.index || a.sequence - b.sequence
|
|
4380
|
+
) : this.toolCalls;
|
|
4381
|
+
for (const toolCall of toolCalls) {
|
|
4382
|
+
if (!toolCall.hasFinished) {
|
|
4383
|
+
this.finishToolCall(toolCall);
|
|
4384
|
+
}
|
|
4385
|
+
}
|
|
4386
|
+
}
|
|
4287
4387
|
/**
|
|
4288
|
-
*
|
|
4289
|
-
*
|
|
4290
|
-
*
|
|
4291
|
-
*
|
|
4292
|
-
*
|
|
4293
|
-
*
|
|
4388
|
+
* Correlation precedence for streamed deltas:
|
|
4389
|
+
*
|
|
4390
|
+
* | ID evidence | index/name evidence | start evidence | resolution |
|
|
4391
|
+
* | --- | --- | --- | --- |
|
|
4392
|
+
* | known | matching | any | matching call, new call, or ambiguity |
|
|
4393
|
+
* | known | conflicting | named | new call |
|
|
4394
|
+
* | unseen | matching | structured start | new call |
|
|
4395
|
+
* | unseen | matching | continuation | matching call or ambiguity |
|
|
4396
|
+
* | absent | matching | any | matching call, new call, or ambiguity |
|
|
4397
|
+
* | absent | absent | named | new call |
|
|
4398
|
+
* | absent | absent | unnamed | sole unfinished call, new call, or ambiguity |
|
|
4294
4399
|
*/
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4400
|
+
resolveToolCall({
|
|
4401
|
+
wireId,
|
|
4402
|
+
index,
|
|
4403
|
+
name: name3,
|
|
4404
|
+
hasExplicitCallStart
|
|
4405
|
+
}) {
|
|
4406
|
+
const indexedToolCalls = index != null ? this.toolCallsByIndex.get(index) : void 0;
|
|
4407
|
+
const matchingIndexedToolCalls = this.filterToolCallsByName(
|
|
4408
|
+
indexedToolCalls,
|
|
4409
|
+
name3
|
|
4410
|
+
);
|
|
4411
|
+
if (wireId != null) {
|
|
4412
|
+
const toolCallsWithId = this.toolCallsById.get(wireId);
|
|
4413
|
+
if (toolCallsWithId != null) {
|
|
4414
|
+
if (index != null) {
|
|
4415
|
+
const matchingToolCalls = matchingIndexedToolCalls.filter(
|
|
4416
|
+
(toolCall) => toolCallsWithId.has(toolCall)
|
|
4417
|
+
);
|
|
4418
|
+
const matchingToolCall = this.resolveMatchingToolCall(
|
|
4419
|
+
matchingToolCalls,
|
|
4420
|
+
hasExplicitCallStart
|
|
4421
|
+
);
|
|
4422
|
+
if (matchingToolCall.kind !== "new") {
|
|
4423
|
+
return matchingToolCall;
|
|
4424
|
+
}
|
|
4425
|
+
if (name3 != null) {
|
|
4426
|
+
return { kind: "new" };
|
|
4427
|
+
}
|
|
4428
|
+
if (indexedToolCalls != null) {
|
|
4429
|
+
return { kind: "ambiguous" };
|
|
4430
|
+
}
|
|
4431
|
+
return this.resolveMatchingToolCall([...toolCallsWithId], false);
|
|
4305
4432
|
}
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4433
|
+
if (name3 != null) {
|
|
4434
|
+
const matchingToolCalls = [...toolCallsWithId].filter(
|
|
4435
|
+
(toolCall) => toolCall.function.name === name3
|
|
4436
|
+
);
|
|
4437
|
+
return this.resolveMatchingToolCall(
|
|
4438
|
+
matchingToolCalls,
|
|
4439
|
+
hasExplicitCallStart
|
|
4440
|
+
);
|
|
4311
4441
|
}
|
|
4312
|
-
|
|
4442
|
+
return this.resolveMatchingToolCall([...toolCallsWithId], false);
|
|
4313
4443
|
}
|
|
4314
|
-
if (
|
|
4315
|
-
|
|
4316
|
-
return void 0;
|
|
4317
|
-
}
|
|
4318
|
-
return wireName !== void 0 && candidate.function.name !== wireName ? void 0 : candidate;
|
|
4444
|
+
if (matchingIndexedToolCalls.length > 0) {
|
|
4445
|
+
return hasExplicitCallStart ? { kind: "new" } : this.resolveMatchingToolCall(matchingIndexedToolCalls, false);
|
|
4319
4446
|
}
|
|
4447
|
+
return { kind: "new" };
|
|
4320
4448
|
}
|
|
4321
|
-
|
|
4449
|
+
if (indexedToolCalls != null) {
|
|
4450
|
+
return this.resolveMatchingToolCall(
|
|
4451
|
+
matchingIndexedToolCalls,
|
|
4452
|
+
hasExplicitCallStart
|
|
4453
|
+
);
|
|
4454
|
+
}
|
|
4455
|
+
if (name3 != null) {
|
|
4456
|
+
return { kind: "new" };
|
|
4457
|
+
}
|
|
4458
|
+
const unfinishedToolCalls = this.toolCalls.filter(
|
|
4459
|
+
(toolCall) => !toolCall.hasFinished
|
|
4460
|
+
);
|
|
4461
|
+
if (unfinishedToolCalls.length === 1) {
|
|
4462
|
+
return { kind: "existing", toolCall: unfinishedToolCalls[0] };
|
|
4463
|
+
}
|
|
4464
|
+
return unfinishedToolCalls.length > 1 ? { kind: "ambiguous" } : { kind: "new" };
|
|
4322
4465
|
}
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
*/
|
|
4327
|
-
flush() {
|
|
4328
|
-
const indices = this.toolCalls.map((toolCall) => toolCall.index);
|
|
4329
|
-
const ordered = indices.every((index) => index !== void 0) && new Set(indices).size === indices.length ? [...this.toolCalls].sort((a, b) => a.index - b.index) : this.toolCalls;
|
|
4330
|
-
for (const toolCall of ordered) {
|
|
4331
|
-
if (!toolCall.hasFinished) {
|
|
4332
|
-
this.finishToolCall(toolCall);
|
|
4333
|
-
}
|
|
4466
|
+
filterToolCallsByName(toolCalls, name3) {
|
|
4467
|
+
if (toolCalls == null) {
|
|
4468
|
+
return [];
|
|
4334
4469
|
}
|
|
4470
|
+
return [...toolCalls].filter(
|
|
4471
|
+
(toolCall) => name3 == null || toolCall.function.name === name3
|
|
4472
|
+
);
|
|
4335
4473
|
}
|
|
4336
|
-
|
|
4337
|
-
|
|
4474
|
+
resolveMatchingToolCall(toolCalls, hasExplicitCallStart) {
|
|
4475
|
+
if (toolCalls.length === 0) {
|
|
4476
|
+
return { kind: "new" };
|
|
4477
|
+
}
|
|
4478
|
+
if (!hasExplicitCallStart) {
|
|
4479
|
+
return toolCalls.length === 1 ? { kind: "existing", toolCall: toolCalls[0] } : { kind: "ambiguous" };
|
|
4480
|
+
}
|
|
4481
|
+
const continuableToolCalls = toolCalls.filter(
|
|
4482
|
+
(toolCall) => !toolCall.argumentState.hasCompleteStructuredValue
|
|
4483
|
+
);
|
|
4484
|
+
if (continuableToolCalls.length === 1) {
|
|
4485
|
+
return { kind: "existing", toolCall: continuableToolCalls[0] };
|
|
4486
|
+
}
|
|
4487
|
+
return continuableToolCalls.length > 1 ? { kind: "ambiguous" } : { kind: "new" };
|
|
4488
|
+
}
|
|
4489
|
+
processNewToolCall(toolCallDelta, {
|
|
4490
|
+
wireId,
|
|
4491
|
+
index,
|
|
4492
|
+
name: name3
|
|
4493
|
+
}) {
|
|
4338
4494
|
if (this.typeValidation === "required") {
|
|
4339
4495
|
if (toolCallDelta.type !== "function") {
|
|
4340
4496
|
throw new InvalidResponseDataError({
|
|
@@ -4350,32 +4506,37 @@ var StreamingToolCallTracker = class {
|
|
|
4350
4506
|
});
|
|
4351
4507
|
}
|
|
4352
4508
|
}
|
|
4353
|
-
if (
|
|
4509
|
+
if (name3 == null) {
|
|
4354
4510
|
throw new InvalidResponseDataError({
|
|
4355
4511
|
data: toolCallDelta,
|
|
4356
4512
|
message: `Expected 'function.name' to be a string.`
|
|
4357
4513
|
});
|
|
4358
4514
|
}
|
|
4359
|
-
const
|
|
4515
|
+
const id = this.createToolCallId(wireId);
|
|
4360
4516
|
this.controller.enqueue({
|
|
4361
4517
|
type: "tool-input-start",
|
|
4362
|
-
id
|
|
4363
|
-
toolName:
|
|
4518
|
+
id,
|
|
4519
|
+
toolName: name3
|
|
4364
4520
|
});
|
|
4365
|
-
const metadata =
|
|
4521
|
+
const metadata = this.extractMetadata?.(toolCallDelta);
|
|
4522
|
+
const initialArguments = toolCallDelta.function?.arguments ?? "";
|
|
4366
4523
|
const toolCall = {
|
|
4367
|
-
id
|
|
4524
|
+
id,
|
|
4525
|
+
index: index ?? void 0,
|
|
4526
|
+
sequence: this.toolCalls.length,
|
|
4368
4527
|
type: "function",
|
|
4369
4528
|
function: {
|
|
4370
|
-
name:
|
|
4371
|
-
arguments:
|
|
4529
|
+
name: name3,
|
|
4530
|
+
arguments: initialArguments
|
|
4372
4531
|
},
|
|
4532
|
+
argumentState: new StreamingToolCallArgumentState(initialArguments),
|
|
4373
4533
|
hasFinished: false,
|
|
4374
|
-
metadata
|
|
4375
|
-
wireId,
|
|
4376
|
-
index: wireIndex
|
|
4534
|
+
metadata
|
|
4377
4535
|
};
|
|
4378
4536
|
this.toolCalls.push(toolCall);
|
|
4537
|
+
if (wireId != null) {
|
|
4538
|
+
this.associateWireId(toolCall, wireId);
|
|
4539
|
+
}
|
|
4379
4540
|
if (toolCall.function.arguments.length > 0) {
|
|
4380
4541
|
this.controller.enqueue({
|
|
4381
4542
|
type: "tool-input-delta",
|
|
@@ -4385,12 +4546,53 @@ var StreamingToolCallTracker = class {
|
|
|
4385
4546
|
}
|
|
4386
4547
|
return toolCall;
|
|
4387
4548
|
}
|
|
4549
|
+
associateWireId(toolCall, wireId) {
|
|
4550
|
+
let toolCallsWithId = this.toolCallsById.get(wireId);
|
|
4551
|
+
if (toolCallsWithId == null) {
|
|
4552
|
+
toolCallsWithId = /* @__PURE__ */ new Set();
|
|
4553
|
+
this.toolCallsById.set(wireId, toolCallsWithId);
|
|
4554
|
+
}
|
|
4555
|
+
toolCallsWithId.add(toolCall);
|
|
4556
|
+
}
|
|
4557
|
+
associateIndex(toolCall, index) {
|
|
4558
|
+
let toolCallsWithIndex = this.toolCallsByIndex.get(index);
|
|
4559
|
+
if (toolCallsWithIndex == null) {
|
|
4560
|
+
toolCallsWithIndex = /* @__PURE__ */ new Set();
|
|
4561
|
+
this.toolCallsByIndex.set(index, toolCallsWithIndex);
|
|
4562
|
+
}
|
|
4563
|
+
toolCallsWithIndex.add(toolCall);
|
|
4564
|
+
}
|
|
4565
|
+
createToolCallId(wireId) {
|
|
4566
|
+
if (wireId != null && !this.usedToolCallIds.has(wireId)) {
|
|
4567
|
+
this.usedToolCallIds.add(wireId);
|
|
4568
|
+
return wireId;
|
|
4569
|
+
}
|
|
4570
|
+
const generatedId = this.getNonBlankString(this._generateId()) ?? "tool-call";
|
|
4571
|
+
if (!this.usedToolCallIds.has(generatedId)) {
|
|
4572
|
+
this.usedToolCallIds.add(generatedId);
|
|
4573
|
+
return generatedId;
|
|
4574
|
+
}
|
|
4575
|
+
const initialSuffix = this.nextGeneratedIdSuffixes.get(generatedId) ?? 1;
|
|
4576
|
+
const maximumSuffix = initialSuffix + this.usedToolCallIds.size;
|
|
4577
|
+
for (let suffix = initialSuffix; suffix <= maximumSuffix; suffix++) {
|
|
4578
|
+
const suffixedId = `${generatedId}-${suffix}`;
|
|
4579
|
+
if (!this.usedToolCallIds.has(suffixedId)) {
|
|
4580
|
+
this.usedToolCallIds.add(suffixedId);
|
|
4581
|
+
this.nextGeneratedIdSuffixes.set(generatedId, suffix + 1);
|
|
4582
|
+
return suffixedId;
|
|
4583
|
+
}
|
|
4584
|
+
}
|
|
4585
|
+
throw new Error("Failed to create a unique tool call ID.");
|
|
4586
|
+
}
|
|
4587
|
+
getNonBlankString(value) {
|
|
4588
|
+
return value != null && value.trim().length > 0 ? value : void 0;
|
|
4589
|
+
}
|
|
4388
4590
|
processExistingToolCall(toolCall, toolCallDelta) {
|
|
4389
|
-
var _a3;
|
|
4390
4591
|
if (toolCall.hasFinished) {
|
|
4391
4592
|
return;
|
|
4392
4593
|
}
|
|
4393
|
-
if (
|
|
4594
|
+
if (toolCallDelta.function?.arguments != null) {
|
|
4595
|
+
toolCall.argumentState.append(toolCallDelta.function.arguments);
|
|
4394
4596
|
toolCall.function.arguments += toolCallDelta.function.arguments;
|
|
4395
4597
|
this.controller.enqueue({
|
|
4396
4598
|
type: "tool-input-delta",
|
|
@@ -4400,18 +4602,16 @@ var StreamingToolCallTracker = class {
|
|
|
4400
4602
|
}
|
|
4401
4603
|
}
|
|
4402
4604
|
finishToolCall(toolCall) {
|
|
4403
|
-
var _a3, _b3;
|
|
4404
4605
|
this.controller.enqueue({
|
|
4405
4606
|
type: "tool-input-end",
|
|
4406
4607
|
id: toolCall.id
|
|
4407
4608
|
});
|
|
4408
|
-
const providerMetadata =
|
|
4409
|
-
this,
|
|
4609
|
+
const providerMetadata = this.buildToolCallProviderMetadata?.(
|
|
4410
4610
|
toolCall.metadata
|
|
4411
4611
|
);
|
|
4412
4612
|
this.controller.enqueue({
|
|
4413
4613
|
type: "tool-call",
|
|
4414
|
-
toolCallId:
|
|
4614
|
+
toolCallId: toolCall.id,
|
|
4415
4615
|
toolName: toolCall.function.name,
|
|
4416
4616
|
input: toolCall.function.arguments,
|
|
4417
4617
|
...providerMetadata ? { providerMetadata } : {}
|
|
@@ -4433,7 +4633,7 @@ function parseTranscriptionStreamClientFrame(text) {
|
|
|
4433
4633
|
let value;
|
|
4434
4634
|
try {
|
|
4435
4635
|
value = secureJsonParse(text);
|
|
4436
|
-
} catch
|
|
4636
|
+
} catch {
|
|
4437
4637
|
return { type: "invalid", message: "malformed JSON" };
|
|
4438
4638
|
}
|
|
4439
4639
|
if (value == null || typeof value !== "object" || Array.isArray(value)) {
|
|
@@ -4490,7 +4690,7 @@ function serializeTranscriptionStreamPart(part) {
|
|
|
4490
4690
|
});
|
|
4491
4691
|
}
|
|
4492
4692
|
return JSON.stringify(part);
|
|
4493
|
-
} catch
|
|
4693
|
+
} catch {
|
|
4494
4694
|
return void 0;
|
|
4495
4695
|
}
|
|
4496
4696
|
}
|
|
@@ -4501,7 +4701,7 @@ function parseTranscriptionStreamPart(text) {
|
|
|
4501
4701
|
let value;
|
|
4502
4702
|
try {
|
|
4503
4703
|
value = secureJsonParse(text);
|
|
4504
|
-
} catch
|
|
4704
|
+
} catch {
|
|
4505
4705
|
return void 0;
|
|
4506
4706
|
}
|
|
4507
4707
|
if (value == null || typeof value !== "object" || Array.isArray(value)) {
|
|
@@ -4560,7 +4760,7 @@ function isSegment(value) {
|
|
|
4560
4760
|
// src/validate-base-url.ts
|
|
4561
4761
|
import { InvalidArgumentError as InvalidArgumentError3 } from "@ai-sdk/provider";
|
|
4562
4762
|
function validateBaseURL(baseURL) {
|
|
4563
|
-
if (
|
|
4763
|
+
if (baseURL?.trim() === "") {
|
|
4564
4764
|
throw new InvalidArgumentError3({
|
|
4565
4765
|
argument: "baseURL",
|
|
4566
4766
|
message: "baseURL must be a non-empty string."
|
|
@@ -4571,7 +4771,7 @@ function validateBaseURL(baseURL) {
|
|
|
4571
4771
|
|
|
4572
4772
|
// src/without-trailing-slash.ts
|
|
4573
4773
|
function withoutTrailingSlash(url) {
|
|
4574
|
-
return url
|
|
4774
|
+
return url?.replace(/\/$/, "");
|
|
4575
4775
|
}
|
|
4576
4776
|
|
|
4577
4777
|
// src/types/executable-tool.ts
|
|
@@ -4610,7 +4810,7 @@ function toolCaller(tool2, definition) {
|
|
|
4610
4810
|
});
|
|
4611
4811
|
}
|
|
4612
4812
|
function getToolCaller(tool2) {
|
|
4613
|
-
return tool2
|
|
4813
|
+
return tool2?.experimental_toolCaller;
|
|
4614
4814
|
}
|
|
4615
4815
|
|
|
4616
4816
|
// src/index.ts
|
|
@@ -4623,6 +4823,7 @@ export {
|
|
|
4623
4823
|
DelayedPromise,
|
|
4624
4824
|
DownloadError,
|
|
4625
4825
|
EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL as EXPERIMENTAL_EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL,
|
|
4826
|
+
EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER as EXPERIMENTAL_EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER,
|
|
4626
4827
|
TRANSCRIPTION_STREAM_AUDIO_DONE_FRAME_TYPE as EXPERIMENTAL_TRANSCRIPTION_STREAM_AUDIO_DONE_FRAME_TYPE,
|
|
4627
4828
|
TRANSCRIPTION_STREAM_START_FRAME_TYPE as EXPERIMENTAL_TRANSCRIPTION_STREAM_START_FRAME_TYPE,
|
|
4628
4829
|
EventSourceParserStream2 as EventSourceParserStream,
|
|
@@ -4671,6 +4872,7 @@ export {
|
|
|
4671
4872
|
toolCaller as experimental_toolCaller,
|
|
4672
4873
|
extractLines,
|
|
4673
4874
|
extractResponseHeaders,
|
|
4875
|
+
fetchUntrustedUrl,
|
|
4674
4876
|
fetchWithValidatedEndpoint,
|
|
4675
4877
|
fetchWithValidatedRedirects,
|
|
4676
4878
|
filterNullable,
|