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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/version.ts
|
|
2
|
-
var VERSION = true ? "2.0.
|
|
2
|
+
var VERSION = true ? "2.0.56" : "0.0.0-test";
|
|
3
3
|
|
|
4
4
|
// src/open-responses-provider.ts
|
|
5
5
|
import {
|
|
@@ -11,6 +11,37 @@ import {
|
|
|
11
11
|
} from "@ai-sdk/provider-utils";
|
|
12
12
|
|
|
13
13
|
// src/open-responses-extension.ts
|
|
14
|
+
var coreToolTypes = /* @__PURE__ */ new Set(["allowed_tools", "function"]);
|
|
15
|
+
var coreItemTypes = /* @__PURE__ */ new Set([
|
|
16
|
+
"function_call",
|
|
17
|
+
"function_call_output",
|
|
18
|
+
"item_reference",
|
|
19
|
+
"message",
|
|
20
|
+
"reasoning"
|
|
21
|
+
]);
|
|
22
|
+
var coreEventTypes = /* @__PURE__ */ new Set([
|
|
23
|
+
"error",
|
|
24
|
+
"response.completed",
|
|
25
|
+
"response.content_part.added",
|
|
26
|
+
"response.content_part.done",
|
|
27
|
+
"response.created",
|
|
28
|
+
"response.failed",
|
|
29
|
+
"response.function_call_arguments.delta",
|
|
30
|
+
"response.function_call_arguments.done",
|
|
31
|
+
"response.in_progress",
|
|
32
|
+
"response.incomplete",
|
|
33
|
+
"response.output_item.added",
|
|
34
|
+
"response.output_item.done",
|
|
35
|
+
"response.output_text.delta",
|
|
36
|
+
"response.output_text.done",
|
|
37
|
+
"response.reasoning_summary_part.added",
|
|
38
|
+
"response.reasoning_summary_part.done",
|
|
39
|
+
"response.reasoning_summary_text.delta",
|
|
40
|
+
"response.reasoning_summary_text.done",
|
|
41
|
+
"response.reasoning_text.delta",
|
|
42
|
+
"response.refusal.delta",
|
|
43
|
+
"response.refusal.done"
|
|
44
|
+
]);
|
|
14
45
|
function createOpenResponsesExtensionRegistry(extensions) {
|
|
15
46
|
const registry = {
|
|
16
47
|
byEventType: /* @__PURE__ */ new Map(),
|
|
@@ -19,7 +50,7 @@ function createOpenResponsesExtensionRegistry(extensions) {
|
|
|
19
50
|
byProviderToolId: /* @__PURE__ */ new Map(),
|
|
20
51
|
byToolType: /* @__PURE__ */ new Map()
|
|
21
52
|
};
|
|
22
|
-
for (const extension of extensions
|
|
53
|
+
for (const extension of extensions ?? []) {
|
|
23
54
|
const namespaceSeparatorIndex = extension.id.indexOf(".");
|
|
24
55
|
if (namespaceSeparatorIndex <= 0) {
|
|
25
56
|
throw new Error(
|
|
@@ -33,26 +64,48 @@ function createOpenResponsesExtensionRegistry(extensions) {
|
|
|
33
64
|
extension,
|
|
34
65
|
field: "id"
|
|
35
66
|
});
|
|
36
|
-
const
|
|
67
|
+
const hasBareTypes = extension.bareToolType != null || extension.bareItemTypes != null || extension.bareEventTypes != null;
|
|
68
|
+
if (hasBareTypes !== (extension.allowBareTypes === true)) {
|
|
69
|
+
throw new Error(
|
|
70
|
+
`Open Responses extension ${extension.id} must set allowBareTypes to true exactly when registering bare types.`
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
if (extension.toolType != null && extension.bareToolType != null) {
|
|
74
|
+
throw new Error(
|
|
75
|
+
`Open Responses extension ${extension.id} cannot provide toolType and bareToolType together.`
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
const toolType = extension.toolType ?? extension.bareToolType;
|
|
79
|
+
const hasToolType = toolType != null;
|
|
37
80
|
const hasToolEncoder = extension.encodeTool != null;
|
|
38
81
|
if (hasToolType !== hasToolEncoder) {
|
|
82
|
+
const typeField = extension.bareToolType != null ? "bareToolType" : "toolType";
|
|
39
83
|
throw new Error(
|
|
40
|
-
`Open Responses extension ${extension.id} must provide
|
|
84
|
+
`Open Responses extension ${extension.id} must provide ${typeField} and encodeTool together.`
|
|
41
85
|
);
|
|
42
86
|
}
|
|
43
87
|
if (extension.encodeToolChoice != null && !hasToolEncoder) {
|
|
44
88
|
throw new Error(
|
|
45
|
-
`Open Responses extension ${extension.id} cannot provide encodeToolChoice without
|
|
89
|
+
`Open Responses extension ${extension.id} cannot provide encodeToolChoice without a tool type and encodeTool.`
|
|
46
90
|
);
|
|
47
91
|
}
|
|
48
92
|
if (hasToolType && hasToolEncoder) {
|
|
49
93
|
const toolExtension = extension;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
94
|
+
if (extension.toolType != null) {
|
|
95
|
+
assertNamespacedType({
|
|
96
|
+
extensionId: extension.id,
|
|
97
|
+
namespace,
|
|
98
|
+
type: extension.toolType,
|
|
99
|
+
field: "toolType"
|
|
100
|
+
});
|
|
101
|
+
} else {
|
|
102
|
+
assertBareType({
|
|
103
|
+
coreTypes: coreToolTypes,
|
|
104
|
+
extensionId: extension.id,
|
|
105
|
+
type: extension.bareToolType,
|
|
106
|
+
field: "bareToolType"
|
|
107
|
+
});
|
|
108
|
+
}
|
|
56
109
|
registerUnique({
|
|
57
110
|
map: registry.byProviderToolId,
|
|
58
111
|
key: extension.id,
|
|
@@ -61,31 +114,35 @@ function createOpenResponsesExtensionRegistry(extensions) {
|
|
|
61
114
|
});
|
|
62
115
|
registerUnique({
|
|
63
116
|
map: registry.byToolType,
|
|
64
|
-
key:
|
|
117
|
+
key: toolType,
|
|
65
118
|
extension: toolExtension,
|
|
66
|
-
field: "
|
|
119
|
+
field: "tool type"
|
|
67
120
|
});
|
|
68
121
|
}
|
|
69
|
-
const
|
|
122
|
+
const itemTypes = [
|
|
123
|
+
...extension.itemTypes ?? [],
|
|
124
|
+
...extension.bareItemTypes ?? []
|
|
125
|
+
];
|
|
126
|
+
const hasItemTypes = extension.itemTypes != null || extension.bareItemTypes != null;
|
|
70
127
|
const hasItemDecoder = extension.decodeItem != null;
|
|
71
128
|
if (hasItemTypes !== hasItemDecoder) {
|
|
72
129
|
throw new Error(
|
|
73
|
-
`Open Responses extension ${extension.id} must provide itemTypes
|
|
130
|
+
`Open Responses extension ${extension.id} must provide itemTypes or bareItemTypes together with decodeItem.`
|
|
74
131
|
);
|
|
75
132
|
}
|
|
76
133
|
if (extension.encodeInputItem != null && !hasItemDecoder) {
|
|
77
134
|
throw new Error(
|
|
78
|
-
`Open Responses extension ${extension.id} cannot provide encodeInputItem without itemTypes and decodeItem.`
|
|
135
|
+
`Open Responses extension ${extension.id} cannot provide encodeInputItem without itemTypes or bareItemTypes and decodeItem.`
|
|
79
136
|
);
|
|
80
137
|
}
|
|
81
138
|
if (hasItemTypes && hasItemDecoder) {
|
|
82
139
|
const itemExtension = extension;
|
|
83
|
-
if (
|
|
140
|
+
if (itemTypes.length === 0) {
|
|
84
141
|
throw new Error(
|
|
85
142
|
`Open Responses extension ${extension.id} must register at least one item type.`
|
|
86
143
|
);
|
|
87
144
|
}
|
|
88
|
-
for (const itemType of
|
|
145
|
+
for (const itemType of extension.itemTypes ?? []) {
|
|
89
146
|
assertNamespacedType({
|
|
90
147
|
extensionId: extension.id,
|
|
91
148
|
namespace,
|
|
@@ -99,22 +156,40 @@ function createOpenResponsesExtensionRegistry(extensions) {
|
|
|
99
156
|
field: "item type"
|
|
100
157
|
});
|
|
101
158
|
}
|
|
159
|
+
for (const itemType of extension.bareItemTypes ?? []) {
|
|
160
|
+
assertBareType({
|
|
161
|
+
coreTypes: coreItemTypes,
|
|
162
|
+
extensionId: extension.id,
|
|
163
|
+
type: itemType,
|
|
164
|
+
field: "bareItemTypes"
|
|
165
|
+
});
|
|
166
|
+
registerUnique({
|
|
167
|
+
map: registry.byItemType,
|
|
168
|
+
key: itemType,
|
|
169
|
+
extension: itemExtension,
|
|
170
|
+
field: "item type"
|
|
171
|
+
});
|
|
172
|
+
}
|
|
102
173
|
}
|
|
103
|
-
const
|
|
174
|
+
const eventTypes = [
|
|
175
|
+
...extension.eventTypes ?? [],
|
|
176
|
+
...extension.bareEventTypes ?? []
|
|
177
|
+
];
|
|
178
|
+
const hasEventTypes = extension.eventTypes != null || extension.bareEventTypes != null;
|
|
104
179
|
const hasEventDecoder = extension.decodeEvent != null;
|
|
105
180
|
if (hasEventTypes !== hasEventDecoder) {
|
|
106
181
|
throw new Error(
|
|
107
|
-
`Open Responses extension ${extension.id} must provide eventTypes
|
|
182
|
+
`Open Responses extension ${extension.id} must provide eventTypes or bareEventTypes together with decodeEvent.`
|
|
108
183
|
);
|
|
109
184
|
}
|
|
110
185
|
if (hasEventTypes && hasEventDecoder) {
|
|
111
186
|
const eventExtension = extension;
|
|
112
|
-
if (
|
|
187
|
+
if (eventTypes.length === 0) {
|
|
113
188
|
throw new Error(
|
|
114
189
|
`Open Responses extension ${extension.id} must register at least one event type.`
|
|
115
190
|
);
|
|
116
191
|
}
|
|
117
|
-
for (const eventType of
|
|
192
|
+
for (const eventType of extension.eventTypes ?? []) {
|
|
118
193
|
assertNamespacedType({
|
|
119
194
|
extensionId: extension.id,
|
|
120
195
|
namespace,
|
|
@@ -128,6 +203,20 @@ function createOpenResponsesExtensionRegistry(extensions) {
|
|
|
128
203
|
field: "event type"
|
|
129
204
|
});
|
|
130
205
|
}
|
|
206
|
+
for (const eventType of extension.bareEventTypes ?? []) {
|
|
207
|
+
assertBareType({
|
|
208
|
+
coreTypes: coreEventTypes,
|
|
209
|
+
extensionId: extension.id,
|
|
210
|
+
type: eventType,
|
|
211
|
+
field: "bareEventTypes"
|
|
212
|
+
});
|
|
213
|
+
registerUnique({
|
|
214
|
+
map: registry.byEventType,
|
|
215
|
+
key: eventType,
|
|
216
|
+
extension: eventExtension,
|
|
217
|
+
field: "event type"
|
|
218
|
+
});
|
|
219
|
+
}
|
|
131
220
|
}
|
|
132
221
|
if (!hasToolEncoder && !hasItemDecoder && !hasEventDecoder) {
|
|
133
222
|
throw new Error(
|
|
@@ -143,12 +232,39 @@ function assertNamespacedType({
|
|
|
143
232
|
type,
|
|
144
233
|
field
|
|
145
234
|
}) {
|
|
146
|
-
|
|
235
|
+
const separatorIndex = type.indexOf(":");
|
|
236
|
+
if (separatorIndex <= 0 || type.slice(0, separatorIndex) !== namespace) {
|
|
147
237
|
throw new Error(
|
|
148
238
|
`Open Responses extension ${extensionId} has invalid ${field} value ${type}. Extension wire types must use the ${namespace}: namespace.`
|
|
149
239
|
);
|
|
150
240
|
}
|
|
151
241
|
}
|
|
242
|
+
function assertBareType({
|
|
243
|
+
coreTypes,
|
|
244
|
+
extensionId,
|
|
245
|
+
type,
|
|
246
|
+
field
|
|
247
|
+
}) {
|
|
248
|
+
if (type.length === 0 || type.includes(":")) {
|
|
249
|
+
throw new Error(
|
|
250
|
+
`Open Responses extension ${extensionId} has invalid ${field} value ${type}. Bare extension wire types must be non-empty and must not contain a colon.`
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
if (coreTypes.has(type)) {
|
|
254
|
+
throw new Error(
|
|
255
|
+
`Open Responses extension ${extensionId} cannot register core ${field} value ${type}.`
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
function getOpenResponsesExtensionItemTypes(extension) {
|
|
260
|
+
return [...extension.itemTypes ?? [], ...extension.bareItemTypes ?? []];
|
|
261
|
+
}
|
|
262
|
+
function getOpenResponsesExtensionToolType(extension) {
|
|
263
|
+
return extension.toolType ?? extension.bareToolType;
|
|
264
|
+
}
|
|
265
|
+
function asOpenResponsesExtensionRecord(value) {
|
|
266
|
+
return value;
|
|
267
|
+
}
|
|
152
268
|
function registerUnique({
|
|
153
269
|
map,
|
|
154
270
|
key,
|
|
@@ -163,11 +279,8 @@ function registerUnique({
|
|
|
163
279
|
}
|
|
164
280
|
map.set(key, extension);
|
|
165
281
|
}
|
|
166
|
-
function isOpenResponsesNamespacedType(value) {
|
|
167
|
-
return typeof value === "string" && value.includes(":");
|
|
168
|
-
}
|
|
169
282
|
function isOpenResponsesExtensionRecord(value) {
|
|
170
|
-
return isOpenResponsesJSONObject(value) &&
|
|
283
|
+
return isOpenResponsesJSONObject(value) && typeof value.type === "string";
|
|
171
284
|
}
|
|
172
285
|
function isOpenResponsesJSONObject(value) {
|
|
173
286
|
return value != null && typeof value === "object" && !Array.isArray(value) && Object.getPrototypeOf(value) === Object.prototype && Object.values(value).every(isOpenResponsesJSONValue);
|
|
@@ -188,6 +301,30 @@ function isOpenResponsesJSONValue(value) {
|
|
|
188
301
|
return isOpenResponsesJSONObject(value);
|
|
189
302
|
}
|
|
190
303
|
|
|
304
|
+
// src/open-responses-tools.ts
|
|
305
|
+
import {
|
|
306
|
+
createProviderDefinedToolFactory,
|
|
307
|
+
lazySchema,
|
|
308
|
+
zodSchema
|
|
309
|
+
} from "@ai-sdk/provider-utils";
|
|
310
|
+
import { z } from "zod/v4";
|
|
311
|
+
var customInputSchema = lazySchema(() => zodSchema(z.string()));
|
|
312
|
+
function createOpenResponsesTools({
|
|
313
|
+
customToolId
|
|
314
|
+
}) {
|
|
315
|
+
const customToolFactory = createProviderDefinedToolFactory({
|
|
316
|
+
id: customToolId,
|
|
317
|
+
inputSchema: customInputSchema
|
|
318
|
+
});
|
|
319
|
+
return {
|
|
320
|
+
/**
|
|
321
|
+
* Creates a caller-executed OpenAI-compatible custom tool. Custom tools accept
|
|
322
|
+
* a raw string, optionally constrained by a grammar. Requires endpoint support.
|
|
323
|
+
*/
|
|
324
|
+
customTool: (options) => customToolFactory(options)
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
|
|
191
328
|
// src/responses/open-responses-language-model.ts
|
|
192
329
|
import {
|
|
193
330
|
APICallError
|
|
@@ -208,7 +345,7 @@ import {
|
|
|
208
345
|
WORKFLOW_SERIALIZE,
|
|
209
346
|
WORKFLOW_DESERIALIZE
|
|
210
347
|
} from "@ai-sdk/provider-utils";
|
|
211
|
-
import { z as
|
|
348
|
+
import { z as z4 } from "zod/v4";
|
|
212
349
|
|
|
213
350
|
// src/responses/convert-to-open-responses-input.ts
|
|
214
351
|
import {
|
|
@@ -224,9 +361,9 @@ async function convertToOpenResponsesInput({
|
|
|
224
361
|
providerOptionsName = "open-responses",
|
|
225
362
|
extensionRegistry,
|
|
226
363
|
providerToolsByName = /* @__PURE__ */ new Map(),
|
|
227
|
-
strictResponseInput = false
|
|
364
|
+
strictResponseInput = false,
|
|
365
|
+
customToolId
|
|
228
366
|
}) {
|
|
229
|
-
var _a, _b, _c, _d;
|
|
230
367
|
const input = [];
|
|
231
368
|
const warnings = [];
|
|
232
369
|
const systemMessages = [];
|
|
@@ -277,7 +414,7 @@ async function convertToOpenResponsesInput({
|
|
|
277
414
|
const fullMediaType = resolveFullMediaType({ part });
|
|
278
415
|
userContent.push({
|
|
279
416
|
type: "input_file",
|
|
280
|
-
filename:
|
|
417
|
+
filename: part.filename ?? "data",
|
|
281
418
|
file_data: `data:${fullMediaType};base64,${convertToBase64(part.data.data)}`
|
|
282
419
|
});
|
|
283
420
|
}
|
|
@@ -313,14 +450,11 @@ async function convertToOpenResponsesInput({
|
|
|
313
450
|
status: "completed",
|
|
314
451
|
role: "assistant",
|
|
315
452
|
content: assistantContent.map(
|
|
316
|
-
(part) => {
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
logprobs: (_b2 = part.logprobs) != null ? _b2 : []
|
|
322
|
-
} : part;
|
|
323
|
-
}
|
|
453
|
+
(part) => part.type === "output_text" ? {
|
|
454
|
+
...part,
|
|
455
|
+
annotations: part.annotations ?? [],
|
|
456
|
+
logprobs: part.logprobs ?? []
|
|
457
|
+
} : part
|
|
324
458
|
)
|
|
325
459
|
});
|
|
326
460
|
} else {
|
|
@@ -346,7 +480,7 @@ async function convertToOpenResponsesInput({
|
|
|
346
480
|
if (replayItem != null) {
|
|
347
481
|
const replayKey = `${replayItem.type}:${replayItem.id}`;
|
|
348
482
|
if (!replayedExtensionItems.has(replayKey)) {
|
|
349
|
-
input.push(replayItem);
|
|
483
|
+
input.push(asOpenResponsesExtensionRecord(replayItem));
|
|
350
484
|
replayedExtensionItems.add(replayKey);
|
|
351
485
|
}
|
|
352
486
|
}
|
|
@@ -354,7 +488,7 @@ async function convertToOpenResponsesInput({
|
|
|
354
488
|
}
|
|
355
489
|
if (part.type === "tool-call" || part.type === "tool-result") {
|
|
356
490
|
const providerTool = providerToolsByName.get(part.toolName);
|
|
357
|
-
const extension = providerTool == null ? void 0 : extensionRegistry
|
|
491
|
+
const extension = providerTool == null ? void 0 : extensionRegistry?.byProviderToolId.get(providerTool.id);
|
|
358
492
|
if (providerTool != null && extension != null) {
|
|
359
493
|
flushAssistantContent();
|
|
360
494
|
const encoded = await encodeExtensionInputPart({
|
|
@@ -368,7 +502,7 @@ async function convertToOpenResponsesInput({
|
|
|
368
502
|
feature: `provider-defined tool ${providerTool.id} ${part.type} history`
|
|
369
503
|
});
|
|
370
504
|
} else {
|
|
371
|
-
input.push(...encoded);
|
|
505
|
+
input.push(...encoded.map(asOpenResponsesExtensionRecord));
|
|
372
506
|
}
|
|
373
507
|
continue;
|
|
374
508
|
}
|
|
@@ -377,18 +511,18 @@ async function convertToOpenResponsesInput({
|
|
|
377
511
|
case "reasoning": {
|
|
378
512
|
flushAssistantContent();
|
|
379
513
|
const providerData = getProviderData(part, providerOptionsName);
|
|
380
|
-
const itemId = typeof
|
|
514
|
+
const itemId = typeof providerData?.itemId === "string" ? providerData.itemId : void 0;
|
|
381
515
|
const summary = parseReasoningSummary(
|
|
382
|
-
providerData
|
|
516
|
+
providerData?.reasoningSummary
|
|
383
517
|
);
|
|
384
518
|
const reasoningContent = parseReasoningContent(
|
|
385
|
-
providerData
|
|
519
|
+
providerData?.reasoningContent
|
|
386
520
|
);
|
|
387
521
|
const hasReasoningContent = providerData != null && "reasoningContent" in providerData;
|
|
388
|
-
const encryptedContent = typeof
|
|
522
|
+
const encryptedContent = typeof providerData?.reasoningEncryptedContent === "string" ? providerData.reasoningEncryptedContent : void 0;
|
|
389
523
|
const reasoningItem = {
|
|
390
524
|
type: "reasoning",
|
|
391
|
-
summary: summary
|
|
525
|
+
summary: summary ?? [],
|
|
392
526
|
...itemId != null && { id: itemId },
|
|
393
527
|
...reasoningContent != null ? { content: reasoningContent } : !hasReasoningContent && part.text.length > 0 ? {
|
|
394
528
|
content: [
|
|
@@ -403,10 +537,10 @@ async function convertToOpenResponsesInput({
|
|
|
403
537
|
}
|
|
404
538
|
};
|
|
405
539
|
const previousItem = input[input.length - 1];
|
|
406
|
-
if (reasoningItem.id != null &&
|
|
540
|
+
if (reasoningItem.id != null && previousItem?.type === "reasoning" && previousItem.id === reasoningItem.id) {
|
|
407
541
|
if (reasoningItem.content != null) {
|
|
408
542
|
previousItem.content = [
|
|
409
|
-
...
|
|
543
|
+
...previousItem.content ?? [],
|
|
410
544
|
...reasoningItem.content
|
|
411
545
|
];
|
|
412
546
|
}
|
|
@@ -417,9 +551,9 @@ async function convertToOpenResponsesInput({
|
|
|
417
551
|
}
|
|
418
552
|
case "text": {
|
|
419
553
|
const providerData = getProviderData(part, providerOptionsName);
|
|
420
|
-
const itemId = typeof
|
|
554
|
+
const itemId = typeof providerData?.itemId === "string" ? providerData.itemId : void 0;
|
|
421
555
|
const annotations = parseOutputTextAnnotations(
|
|
422
|
-
providerData
|
|
556
|
+
providerData?.annotations
|
|
423
557
|
);
|
|
424
558
|
if (assistantContent.length > 0 && assistantMessageId !== itemId) {
|
|
425
559
|
flushAssistantContent();
|
|
@@ -436,14 +570,25 @@ async function convertToOpenResponsesInput({
|
|
|
436
570
|
flushAssistantContent();
|
|
437
571
|
const argumentsValue = typeof part.input === "string" ? part.input : JSON.stringify(part.input);
|
|
438
572
|
const providerData = getProviderData(part, providerOptionsName);
|
|
439
|
-
const itemId = typeof
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
573
|
+
const itemId = typeof providerData?.itemId === "string" ? providerData.itemId : void 0;
|
|
574
|
+
const providerTool = providerToolsByName.get(part.toolName);
|
|
575
|
+
if (customToolId != null && providerTool?.id === customToolId) {
|
|
576
|
+
input.push({
|
|
577
|
+
type: "custom_tool_call",
|
|
578
|
+
...itemId != null && { id: itemId },
|
|
579
|
+
call_id: part.toolCallId,
|
|
580
|
+
name: part.toolName,
|
|
581
|
+
input: argumentsValue
|
|
582
|
+
});
|
|
583
|
+
} else {
|
|
584
|
+
input.push({
|
|
585
|
+
type: "function_call",
|
|
586
|
+
...itemId != null && { id: itemId },
|
|
587
|
+
call_id: part.toolCallId,
|
|
588
|
+
name: part.toolName,
|
|
589
|
+
arguments: argumentsValue
|
|
590
|
+
});
|
|
591
|
+
}
|
|
447
592
|
break;
|
|
448
593
|
}
|
|
449
594
|
}
|
|
@@ -464,14 +609,14 @@ async function convertToOpenResponsesInput({
|
|
|
464
609
|
if (replayItem != null) {
|
|
465
610
|
const replayKey = `${replayItem.type}:${replayItem.id}`;
|
|
466
611
|
if (!replayedExtensionItems.has(replayKey)) {
|
|
467
|
-
input.push(replayItem);
|
|
612
|
+
input.push(asOpenResponsesExtensionRecord(replayItem));
|
|
468
613
|
replayedExtensionItems.add(replayKey);
|
|
469
614
|
}
|
|
470
615
|
}
|
|
471
616
|
continue;
|
|
472
617
|
}
|
|
473
618
|
const providerTool = providerToolsByName.get(part.toolName);
|
|
474
|
-
const extension = providerTool == null ? void 0 : extensionRegistry
|
|
619
|
+
const extension = providerTool == null ? void 0 : extensionRegistry?.byProviderToolId.get(providerTool.id);
|
|
475
620
|
if (providerTool != null && extension != null) {
|
|
476
621
|
const encoded = await encodeExtensionInputPart({
|
|
477
622
|
extensionRegistry,
|
|
@@ -484,7 +629,7 @@ async function convertToOpenResponsesInput({
|
|
|
484
629
|
feature: `provider-defined tool ${providerTool.id} tool-result history`
|
|
485
630
|
});
|
|
486
631
|
} else {
|
|
487
|
-
input.push(...encoded);
|
|
632
|
+
input.push(...encoded.map(asOpenResponsesExtensionRecord));
|
|
488
633
|
}
|
|
489
634
|
continue;
|
|
490
635
|
}
|
|
@@ -496,7 +641,7 @@ async function convertToOpenResponsesInput({
|
|
|
496
641
|
contentValue = output.value;
|
|
497
642
|
break;
|
|
498
643
|
case "execution-denied":
|
|
499
|
-
contentValue =
|
|
644
|
+
contentValue = output.reason ?? "Tool call execution denied.";
|
|
500
645
|
break;
|
|
501
646
|
case "json":
|
|
502
647
|
case "error-json":
|
|
@@ -528,7 +673,7 @@ async function convertToOpenResponsesInput({
|
|
|
528
673
|
} else {
|
|
529
674
|
contentParts.push({
|
|
530
675
|
type: "input_file",
|
|
531
|
-
filename:
|
|
676
|
+
filename: item.filename ?? "data",
|
|
532
677
|
file_data: `data:${fullMediaType};base64,${convertToBase64(item.data.data)}`
|
|
533
678
|
});
|
|
534
679
|
}
|
|
@@ -567,7 +712,7 @@ async function convertToOpenResponsesInput({
|
|
|
567
712
|
}
|
|
568
713
|
}
|
|
569
714
|
input.push({
|
|
570
|
-
type: "function_call_output",
|
|
715
|
+
type: customToolId != null && providerTool?.id === customToolId ? "custom_tool_call_output" : "function_call_output",
|
|
571
716
|
call_id: part.toolCallId,
|
|
572
717
|
output: contentValue
|
|
573
718
|
});
|
|
@@ -588,10 +733,10 @@ async function encodeExtensionInputPart({
|
|
|
588
733
|
part,
|
|
589
734
|
providerTool
|
|
590
735
|
}) {
|
|
591
|
-
const extension = extensionRegistry
|
|
592
|
-
const encodeInputItem = extension
|
|
593
|
-
const itemTypes = extension == null ?
|
|
594
|
-
if (encodeInputItem == null || itemTypes
|
|
736
|
+
const extension = extensionRegistry?.byProviderToolId.get(providerTool.id);
|
|
737
|
+
const encodeInputItem = extension?.encodeInputItem;
|
|
738
|
+
const itemTypes = extension == null ? [] : getOpenResponsesExtensionItemTypes(extension);
|
|
739
|
+
if (encodeInputItem == null || itemTypes.length === 0) {
|
|
595
740
|
return void 0;
|
|
596
741
|
}
|
|
597
742
|
try {
|
|
@@ -606,7 +751,7 @@ async function encodeExtensionInputPart({
|
|
|
606
751
|
return void 0;
|
|
607
752
|
}
|
|
608
753
|
return items;
|
|
609
|
-
} catch
|
|
754
|
+
} catch {
|
|
610
755
|
return void 0;
|
|
611
756
|
}
|
|
612
757
|
}
|
|
@@ -615,11 +760,10 @@ function getExtensionReplay({
|
|
|
615
760
|
providerOptionsName,
|
|
616
761
|
extensionRegistry
|
|
617
762
|
}) {
|
|
618
|
-
|
|
619
|
-
const extensionData = (_a = getProviderData(
|
|
763
|
+
const extensionData = getProviderData(
|
|
620
764
|
part,
|
|
621
765
|
providerOptionsName
|
|
622
|
-
)
|
|
766
|
+
)?.openResponsesExtension;
|
|
623
767
|
if (extensionData == null || typeof extensionData !== "object" || Array.isArray(extensionData)) {
|
|
624
768
|
return void 0;
|
|
625
769
|
}
|
|
@@ -627,25 +771,23 @@ function getExtensionReplay({
|
|
|
627
771
|
if (typeof id !== "string") {
|
|
628
772
|
return void 0;
|
|
629
773
|
}
|
|
630
|
-
const extension = extensionRegistry
|
|
774
|
+
const extension = extensionRegistry?.byExtensionId.get(
|
|
631
775
|
id
|
|
632
776
|
);
|
|
633
777
|
if (extension == null) {
|
|
634
778
|
return void 0;
|
|
635
779
|
}
|
|
636
|
-
if (isOpenResponsesExtensionItem(item) && (
|
|
780
|
+
if (isOpenResponsesExtensionItem(item) && getOpenResponsesExtensionItemTypes(extension).includes(item.type)) {
|
|
637
781
|
return { item };
|
|
638
782
|
}
|
|
639
783
|
return typeof itemId === "string" ? {} : void 0;
|
|
640
784
|
}
|
|
641
785
|
function getProviderData(part, providerOptionsName) {
|
|
642
|
-
|
|
643
|
-
const providerData = (_c = (_a = part.providerOptions) == null ? void 0 : _a[providerOptionsName]) != null ? _c : (_b = part.providerMetadata) == null ? void 0 : _b[providerOptionsName];
|
|
786
|
+
const providerData = part.providerOptions?.[providerOptionsName] ?? part.providerMetadata?.[providerOptionsName];
|
|
644
787
|
return providerData != null && typeof providerData === "object" && !Array.isArray(providerData) ? providerData : void 0;
|
|
645
788
|
}
|
|
646
789
|
function getImageDetail(part, providerOptionsName) {
|
|
647
|
-
|
|
648
|
-
const imageDetail = (_a = getProviderData(part, providerOptionsName)) == null ? void 0 : _a.imageDetail;
|
|
790
|
+
const imageDetail = getProviderData(part, providerOptionsName)?.imageDetail;
|
|
649
791
|
return imageDetail === "low" || imageDetail === "high" || imageDetail === "auto" ? imageDetail : "auto";
|
|
650
792
|
}
|
|
651
793
|
function parseReasoningSummary(value) {
|
|
@@ -686,16 +828,16 @@ function parseOutputTextAnnotations(value) {
|
|
|
686
828
|
}
|
|
687
829
|
|
|
688
830
|
// src/responses/open-responses-api.ts
|
|
689
|
-
import { lazySchema, zodSchema } from "@ai-sdk/provider-utils";
|
|
690
|
-
import { z } from "zod/v4";
|
|
691
|
-
var openResponsesErrorSchema =
|
|
692
|
-
() =>
|
|
693
|
-
|
|
694
|
-
error:
|
|
695
|
-
message:
|
|
696
|
-
type:
|
|
697
|
-
param:
|
|
698
|
-
code:
|
|
831
|
+
import { lazySchema as lazySchema2, zodSchema as zodSchema2 } from "@ai-sdk/provider-utils";
|
|
832
|
+
import { z as z2 } from "zod/v4";
|
|
833
|
+
var openResponsesErrorSchema = lazySchema2(
|
|
834
|
+
() => zodSchema2(
|
|
835
|
+
z2.object({
|
|
836
|
+
error: z2.object({
|
|
837
|
+
message: z2.string(),
|
|
838
|
+
type: z2.string().nullish(),
|
|
839
|
+
param: z2.string().nullish(),
|
|
840
|
+
code: z2.string().nullish()
|
|
699
841
|
})
|
|
700
842
|
})
|
|
701
843
|
)
|
|
@@ -721,38 +863,41 @@ function mapOpenResponsesFinishReason({
|
|
|
721
863
|
|
|
722
864
|
// src/responses/open-responses-language-model-options.ts
|
|
723
865
|
import {
|
|
724
|
-
lazySchema as
|
|
725
|
-
zodSchema as
|
|
866
|
+
lazySchema as lazySchema3,
|
|
867
|
+
zodSchema as zodSchema3
|
|
726
868
|
} from "@ai-sdk/provider-utils";
|
|
727
|
-
import { z as
|
|
728
|
-
var openResponsesLanguageModelOptions =
|
|
729
|
-
() =>
|
|
730
|
-
|
|
869
|
+
import { z as z3 } from "zod/v4";
|
|
870
|
+
var openResponsesLanguageModelOptions = lazySchema3(
|
|
871
|
+
() => zodSchema3(
|
|
872
|
+
z3.object({
|
|
731
873
|
/**
|
|
732
874
|
* Provider-native reasoning effort. The value is passed through to the
|
|
733
875
|
* endpoint and takes precedence over the top-level `reasoning` setting.
|
|
734
876
|
*/
|
|
735
|
-
reasoningEffort:
|
|
877
|
+
reasoningEffort: z3.string().nullish(),
|
|
736
878
|
/**
|
|
737
879
|
* Controls reasoning summary output from the model.
|
|
738
880
|
* Valid values: 'concise', 'detailed', 'auto'.
|
|
739
881
|
*/
|
|
740
|
-
reasoningSummary:
|
|
882
|
+
reasoningSummary: z3.enum(["concise", "detailed", "auto"]).nullish()
|
|
741
883
|
})
|
|
742
884
|
)
|
|
743
885
|
);
|
|
744
886
|
|
|
745
887
|
// src/responses/open-responses-language-model.ts
|
|
888
|
+
var defaultFailedResponseHandler = createJsonErrorResponseHandler({
|
|
889
|
+
errorSchema: openResponsesErrorSchema,
|
|
890
|
+
errorToMessage: (error) => error.error.message
|
|
891
|
+
});
|
|
746
892
|
var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
747
893
|
constructor(modelId, config) {
|
|
748
894
|
this.specificationVersion = "v4";
|
|
749
895
|
this.supportedUrls = {
|
|
750
896
|
"image/*": [/^https?:\/\/.*$/]
|
|
751
897
|
};
|
|
752
|
-
var _a;
|
|
753
898
|
this.modelId = modelId;
|
|
754
899
|
this.config = config;
|
|
755
|
-
this.extensionRegistry =
|
|
900
|
+
this.extensionRegistry = config.extensionRegistry ?? createOpenResponsesExtensionRegistry();
|
|
756
901
|
}
|
|
757
902
|
static [WORKFLOW_SERIALIZE](model) {
|
|
758
903
|
if (model.extensionRegistry.byExtensionId.size > 0) {
|
|
@@ -787,7 +932,6 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
787
932
|
toolChoice,
|
|
788
933
|
responseFormat
|
|
789
934
|
}) {
|
|
790
|
-
var _a, _b;
|
|
791
935
|
const warnings = [];
|
|
792
936
|
if (stopSequences != null) {
|
|
793
937
|
warnings.push({ type: "unsupported", feature: "stopSequences" });
|
|
@@ -799,7 +943,7 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
799
943
|
warnings.push({ type: "unsupported", feature: "seed" });
|
|
800
944
|
}
|
|
801
945
|
const providerToolsByName = new Map(
|
|
802
|
-
(tools
|
|
946
|
+
(tools ?? []).filter((tool) => tool.type === "provider").map((tool) => [tool.name, tool])
|
|
803
947
|
);
|
|
804
948
|
const {
|
|
805
949
|
input,
|
|
@@ -810,16 +954,32 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
810
954
|
providerOptionsName: this.config.providerOptionsName,
|
|
811
955
|
extensionRegistry: this.extensionRegistry,
|
|
812
956
|
providerToolsByName,
|
|
813
|
-
strictResponseInput: this.config.strictResponseInput
|
|
957
|
+
strictResponseInput: this.config.strictResponseInput,
|
|
958
|
+
customToolId: this.config.customToolId
|
|
814
959
|
});
|
|
815
960
|
warnings.push(...inputWarnings);
|
|
816
961
|
const convertedTools = [];
|
|
817
962
|
const encodedProviderToolsByName = /* @__PURE__ */ new Map();
|
|
818
|
-
for (const tool of tools
|
|
963
|
+
for (const tool of tools ?? []) {
|
|
819
964
|
if (tool.type === "provider") {
|
|
965
|
+
if (this.config.customToolId != null && tool.id === this.config.customToolId) {
|
|
966
|
+
const format = tool.args.format != null && typeof tool.args.format === "object" && !Array.isArray(tool.args.format) ? tool.args.format : void 0;
|
|
967
|
+
convertedTools.push({
|
|
968
|
+
type: "custom",
|
|
969
|
+
name: tool.name,
|
|
970
|
+
description: typeof tool.args.description === "string" ? tool.args.description : void 0,
|
|
971
|
+
format: format != null && "type" in format && format.type === "grammar" && "syntax" in format && (format.syntax === "regex" || format.syntax === "lark") && "definition" in format && typeof format.definition === "string" ? {
|
|
972
|
+
type: "grammar",
|
|
973
|
+
syntax: format.syntax,
|
|
974
|
+
definition: format.definition
|
|
975
|
+
} : format != null && "type" in format && format.type === "text" ? { type: "text" } : void 0
|
|
976
|
+
});
|
|
977
|
+
continue;
|
|
978
|
+
}
|
|
820
979
|
const extension = this.extensionRegistry.byProviderToolId.get(tool.id);
|
|
821
980
|
let encoded;
|
|
822
981
|
if (extension != null) {
|
|
982
|
+
const toolType = getOpenResponsesExtensionToolType(extension);
|
|
823
983
|
try {
|
|
824
984
|
const fields = await extension.encodeTool({
|
|
825
985
|
name: tool.name,
|
|
@@ -828,10 +988,10 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
828
988
|
if (isOpenResponsesJSONObject(fields)) {
|
|
829
989
|
encoded = {
|
|
830
990
|
...fields,
|
|
831
|
-
type:
|
|
991
|
+
type: toolType
|
|
832
992
|
};
|
|
833
993
|
}
|
|
834
|
-
} catch
|
|
994
|
+
} catch {
|
|
835
995
|
}
|
|
836
996
|
}
|
|
837
997
|
if (encoded == null) {
|
|
@@ -840,9 +1000,9 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
840
1000
|
feature: `provider-defined tool ${tool.id}`
|
|
841
1001
|
});
|
|
842
1002
|
} else if (extension != null) {
|
|
843
|
-
convertedTools.push(encoded);
|
|
1003
|
+
convertedTools.push(asOpenResponsesExtensionRecord(encoded));
|
|
844
1004
|
encodedProviderToolsByName.set(tool.name, {
|
|
845
|
-
toolType: extension
|
|
1005
|
+
toolType: getOpenResponsesExtensionToolType(extension),
|
|
846
1006
|
encodeToolChoice: extension.encodeToolChoice,
|
|
847
1007
|
tool
|
|
848
1008
|
});
|
|
@@ -858,12 +1018,17 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
858
1018
|
}
|
|
859
1019
|
}
|
|
860
1020
|
let convertedToolChoice;
|
|
861
|
-
if (
|
|
1021
|
+
if (toolChoice?.type === "tool") {
|
|
862
1022
|
const registeredTool = encodedProviderToolsByName.get(
|
|
863
1023
|
toolChoice.toolName
|
|
864
1024
|
);
|
|
865
1025
|
if (registeredTool == null) {
|
|
866
|
-
if (
|
|
1026
|
+
if (this.config.customToolId != null && providerToolsByName.get(toolChoice.toolName)?.id === this.config.customToolId) {
|
|
1027
|
+
convertedToolChoice = {
|
|
1028
|
+
type: "custom",
|
|
1029
|
+
name: toolChoice.toolName
|
|
1030
|
+
};
|
|
1031
|
+
} else if (!providerToolsByName.has(toolChoice.toolName)) {
|
|
867
1032
|
convertedToolChoice = {
|
|
868
1033
|
type: "function",
|
|
869
1034
|
name: toolChoice.toolName
|
|
@@ -873,11 +1038,11 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
873
1038
|
const { encodeToolChoice, tool, toolType } = registeredTool;
|
|
874
1039
|
let fields = {};
|
|
875
1040
|
try {
|
|
876
|
-
fields = await
|
|
1041
|
+
fields = await encodeToolChoice?.({
|
|
877
1042
|
name: tool.name,
|
|
878
1043
|
args: tool.args
|
|
879
|
-
})
|
|
880
|
-
} catch
|
|
1044
|
+
});
|
|
1045
|
+
} catch {
|
|
881
1046
|
fields = void 0;
|
|
882
1047
|
}
|
|
883
1048
|
if (encodeToolChoice != null && !isOpenResponsesJSONObject(fields)) {
|
|
@@ -886,30 +1051,31 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
886
1051
|
feature: `tool choice for provider-defined tool ${tool.id}`
|
|
887
1052
|
});
|
|
888
1053
|
} else {
|
|
889
|
-
convertedToolChoice = {
|
|
1054
|
+
convertedToolChoice = asOpenResponsesExtensionRecord({
|
|
890
1055
|
...isOpenResponsesJSONObject(fields) ? fields : {},
|
|
891
1056
|
type: toolType
|
|
892
|
-
};
|
|
1057
|
+
});
|
|
893
1058
|
}
|
|
894
1059
|
}
|
|
895
1060
|
} else {
|
|
896
|
-
convertedToolChoice = toolChoice
|
|
1061
|
+
convertedToolChoice = toolChoice?.type;
|
|
897
1062
|
}
|
|
898
|
-
const textFormat =
|
|
1063
|
+
const textFormat = responseFormat?.type === "json" && this.config.structuredOutputs !== false ? responseFormat.schema != null ? {
|
|
899
1064
|
type: "json_schema",
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
1065
|
+
name: responseFormat.name ?? "response",
|
|
1066
|
+
description: responseFormat.description,
|
|
1067
|
+
schema: responseFormat.schema,
|
|
1068
|
+
strict: true
|
|
1069
|
+
} : { type: "json_object" } : void 0;
|
|
1070
|
+
if (responseFormat?.type === "json" && this.config.structuredOutputs === false) {
|
|
1071
|
+
warnings.push({ type: "unsupported", feature: "responseFormat" });
|
|
1072
|
+
}
|
|
907
1073
|
const openResponsesOptions = await parseProviderOptions({
|
|
908
1074
|
provider: this.config.providerOptionsName,
|
|
909
1075
|
providerOptions,
|
|
910
1076
|
schema: openResponsesLanguageModelOptions
|
|
911
1077
|
});
|
|
912
|
-
const resolvedReasoningEffort =
|
|
1078
|
+
const resolvedReasoningEffort = openResponsesOptions?.reasoningEffort ?? (isCustomReasoning(reasoning) ? reasoning === "none" ? "none" : mapReasoningToProviderEffort({
|
|
913
1079
|
reasoning,
|
|
914
1080
|
effortMap: {
|
|
915
1081
|
minimal: "low",
|
|
@@ -919,7 +1085,7 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
919
1085
|
xhigh: "xhigh"
|
|
920
1086
|
},
|
|
921
1087
|
warnings
|
|
922
|
-
}) : void 0;
|
|
1088
|
+
}) : void 0);
|
|
923
1089
|
return {
|
|
924
1090
|
body: {
|
|
925
1091
|
model: this.modelId,
|
|
@@ -930,11 +1096,11 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
930
1096
|
top_p: topP,
|
|
931
1097
|
presence_penalty: presencePenalty,
|
|
932
1098
|
frequency_penalty: frequencyPenalty,
|
|
933
|
-
reasoning: resolvedReasoningEffort != null ||
|
|
1099
|
+
reasoning: resolvedReasoningEffort != null || openResponsesOptions?.reasoningSummary != null ? {
|
|
934
1100
|
...resolvedReasoningEffort != null && {
|
|
935
1101
|
effort: resolvedReasoningEffort
|
|
936
1102
|
},
|
|
937
|
-
...
|
|
1103
|
+
...openResponsesOptions?.reasoningSummary != null && {
|
|
938
1104
|
summary: openResponsesOptions.reasoningSummary
|
|
939
1105
|
}
|
|
940
1106
|
} : void 0,
|
|
@@ -946,7 +1112,6 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
946
1112
|
};
|
|
947
1113
|
}
|
|
948
1114
|
async doGenerate(options) {
|
|
949
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
950
1115
|
const { body, warnings } = await this.getArgs(options);
|
|
951
1116
|
const {
|
|
952
1117
|
responseHeaders,
|
|
@@ -954,12 +1119,9 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
954
1119
|
rawValue: rawResponse
|
|
955
1120
|
} = await postJsonToApi({
|
|
956
1121
|
url: this.config.url,
|
|
957
|
-
headers: combineHeaders(
|
|
1122
|
+
headers: combineHeaders(this.config.headers?.(), options.headers),
|
|
958
1123
|
body,
|
|
959
|
-
failedResponseHandler:
|
|
960
|
-
errorSchema: openResponsesErrorSchema,
|
|
961
|
-
errorToMessage: (error) => error.error.message
|
|
962
|
-
}),
|
|
1124
|
+
failedResponseHandler: this.config.failedResponseHandler ?? defaultFailedResponseHandler,
|
|
963
1125
|
successfulResponseHandler: createJsonResponseHandler(
|
|
964
1126
|
// do not validate the response body, only apply types to the response body
|
|
965
1127
|
jsonSchema(() => {
|
|
@@ -970,18 +1132,22 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
970
1132
|
fetch: this.config.fetch
|
|
971
1133
|
});
|
|
972
1134
|
if (response.error) {
|
|
1135
|
+
const errorMetadata = this.config.getResponseErrorMetadata?.(
|
|
1136
|
+
response.error
|
|
1137
|
+
);
|
|
973
1138
|
throw new APICallError({
|
|
974
1139
|
message: response.error.message,
|
|
975
1140
|
url: this.config.url,
|
|
976
1141
|
requestBodyValues: body,
|
|
977
|
-
statusCode: 400,
|
|
1142
|
+
statusCode: errorMetadata?.statusCode ?? 400,
|
|
1143
|
+
isRetryable: errorMetadata?.isRetryable,
|
|
978
1144
|
responseHeaders,
|
|
979
1145
|
responseBody: rawResponse,
|
|
980
|
-
|
|
1146
|
+
data: response.error
|
|
981
1147
|
});
|
|
982
1148
|
}
|
|
983
1149
|
if (response.output == null) {
|
|
984
|
-
const detail =
|
|
1150
|
+
const detail = response.incomplete_details?.reason ?? response.status;
|
|
985
1151
|
throw new APICallError({
|
|
986
1152
|
message: detail ? `Responses API returned no output (${detail})` : "Responses API returned no output",
|
|
987
1153
|
url: this.config.url,
|
|
@@ -998,7 +1164,7 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
998
1164
|
switch (part.type) {
|
|
999
1165
|
// TODO AI SDK 7 adjust reasoning in the specification to better support the reasoning structure from open responses.
|
|
1000
1166
|
case "reasoning": {
|
|
1001
|
-
if ((
|
|
1167
|
+
if ((part.content?.length ?? 0) > 0) {
|
|
1002
1168
|
for (const contentPart of part.content) {
|
|
1003
1169
|
content.push({
|
|
1004
1170
|
type: "reasoning",
|
|
@@ -1051,6 +1217,19 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
1051
1217
|
});
|
|
1052
1218
|
break;
|
|
1053
1219
|
}
|
|
1220
|
+
case "custom_tool_call": {
|
|
1221
|
+
hasToolCalls = true;
|
|
1222
|
+
content.push({
|
|
1223
|
+
type: "tool-call",
|
|
1224
|
+
toolCallId: part.call_id,
|
|
1225
|
+
toolName: part.name,
|
|
1226
|
+
input: JSON.stringify(part.input),
|
|
1227
|
+
providerMetadata: {
|
|
1228
|
+
[this.config.providerOptionsName]: { itemId: part.id }
|
|
1229
|
+
}
|
|
1230
|
+
});
|
|
1231
|
+
break;
|
|
1232
|
+
}
|
|
1054
1233
|
default: {
|
|
1055
1234
|
if (!isOpenResponsesExtensionItem(part)) {
|
|
1056
1235
|
break;
|
|
@@ -1063,36 +1242,37 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
1063
1242
|
});
|
|
1064
1243
|
if (decoded != null) {
|
|
1065
1244
|
content.push(...decoded);
|
|
1066
|
-
hasToolCalls
|
|
1245
|
+
hasToolCalls ||= decoded.some((part2) => part2.type === "tool-call");
|
|
1067
1246
|
}
|
|
1068
1247
|
break;
|
|
1069
1248
|
}
|
|
1070
1249
|
}
|
|
1071
1250
|
}
|
|
1072
1251
|
const usage = response.usage;
|
|
1073
|
-
const inputTokens = usage
|
|
1074
|
-
const cachedInputTokens =
|
|
1075
|
-
const
|
|
1076
|
-
const
|
|
1252
|
+
const inputTokens = usage?.input_tokens;
|
|
1253
|
+
const cachedInputTokens = usage?.input_tokens_details?.cached_tokens;
|
|
1254
|
+
const cacheWriteTokens = usage?.input_tokens_details?.cache_write_tokens;
|
|
1255
|
+
const outputTokens = usage?.output_tokens;
|
|
1256
|
+
const reasoningTokens = usage?.output_tokens_details?.reasoning_tokens;
|
|
1077
1257
|
return {
|
|
1078
1258
|
content,
|
|
1079
1259
|
finishReason: {
|
|
1080
1260
|
unified: mapOpenResponsesFinishReason({
|
|
1081
|
-
finishReason:
|
|
1261
|
+
finishReason: response.incomplete_details?.reason,
|
|
1082
1262
|
hasToolCalls
|
|
1083
1263
|
}),
|
|
1084
|
-
raw:
|
|
1264
|
+
raw: response.incomplete_details?.reason ?? void 0
|
|
1085
1265
|
},
|
|
1086
1266
|
usage: {
|
|
1087
1267
|
inputTokens: {
|
|
1088
1268
|
total: inputTokens,
|
|
1089
|
-
noCache: (inputTokens
|
|
1269
|
+
noCache: (inputTokens ?? 0) - (cachedInputTokens ?? 0) - (cacheWriteTokens ?? 0),
|
|
1090
1270
|
cacheRead: cachedInputTokens,
|
|
1091
|
-
cacheWrite:
|
|
1271
|
+
cacheWrite: cacheWriteTokens
|
|
1092
1272
|
},
|
|
1093
1273
|
outputTokens: {
|
|
1094
1274
|
total: outputTokens,
|
|
1095
|
-
text: (outputTokens
|
|
1275
|
+
text: (outputTokens ?? 0) - (reasoningTokens ?? 0),
|
|
1096
1276
|
reasoning: reasoningTokens
|
|
1097
1277
|
},
|
|
1098
1278
|
raw: response.usage
|
|
@@ -1110,20 +1290,16 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
1110
1290
|
};
|
|
1111
1291
|
}
|
|
1112
1292
|
async doStream(options) {
|
|
1113
|
-
var _a, _b;
|
|
1114
1293
|
const { body, warnings } = await this.getArgs(options);
|
|
1115
1294
|
const { responseHeaders, value: response } = await postJsonToApi({
|
|
1116
1295
|
url: this.config.url,
|
|
1117
|
-
headers: combineHeaders(
|
|
1296
|
+
headers: combineHeaders(this.config.headers?.(), options.headers),
|
|
1118
1297
|
body: {
|
|
1119
1298
|
...body,
|
|
1120
1299
|
stream: true
|
|
1121
1300
|
},
|
|
1122
|
-
failedResponseHandler:
|
|
1123
|
-
|
|
1124
|
-
errorToMessage: (error) => error.error.message
|
|
1125
|
-
}),
|
|
1126
|
-
successfulResponseHandler: createEventSourceResponseHandler(z3.any()),
|
|
1301
|
+
failedResponseHandler: this.config.failedResponseHandler ?? defaultFailedResponseHandler,
|
|
1302
|
+
successfulResponseHandler: createEventSourceResponseHandler(z4.any()),
|
|
1127
1303
|
abortSignal: options.abortSignal,
|
|
1128
1304
|
fetch: this.config.fetch
|
|
1129
1305
|
});
|
|
@@ -1141,23 +1317,23 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
1141
1317
|
}
|
|
1142
1318
|
};
|
|
1143
1319
|
const updateUsage = (responseUsage) => {
|
|
1144
|
-
var _a2, _b2;
|
|
1145
1320
|
if (!responseUsage) {
|
|
1146
1321
|
return;
|
|
1147
1322
|
}
|
|
1148
1323
|
const inputTokens = responseUsage.input_tokens;
|
|
1149
|
-
const cachedInputTokens =
|
|
1324
|
+
const cachedInputTokens = responseUsage.input_tokens_details?.cached_tokens;
|
|
1325
|
+
const cacheWriteTokens = responseUsage.input_tokens_details?.cache_write_tokens;
|
|
1150
1326
|
const outputTokens = responseUsage.output_tokens;
|
|
1151
|
-
const reasoningTokens =
|
|
1327
|
+
const reasoningTokens = responseUsage.output_tokens_details?.reasoning_tokens;
|
|
1152
1328
|
usage.inputTokens = {
|
|
1153
1329
|
total: inputTokens,
|
|
1154
|
-
noCache: (inputTokens
|
|
1330
|
+
noCache: (inputTokens ?? 0) - (cachedInputTokens ?? 0) - (cacheWriteTokens ?? 0),
|
|
1155
1331
|
cacheRead: cachedInputTokens,
|
|
1156
|
-
cacheWrite:
|
|
1332
|
+
cacheWrite: cacheWriteTokens
|
|
1157
1333
|
};
|
|
1158
1334
|
usage.outputTokens = {
|
|
1159
1335
|
total: outputTokens,
|
|
1160
|
-
text: (outputTokens
|
|
1336
|
+
text: (outputTokens ?? 0) - (reasoningTokens ?? 0),
|
|
1161
1337
|
reasoning: reasoningTokens
|
|
1162
1338
|
};
|
|
1163
1339
|
usage.raw = responseUsage;
|
|
@@ -1169,9 +1345,11 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
1169
1345
|
raw: void 0
|
|
1170
1346
|
};
|
|
1171
1347
|
const toolCallsByItemId = /* @__PURE__ */ new Map();
|
|
1348
|
+
const customToolCallsByItemId = /* @__PURE__ */ new Map();
|
|
1172
1349
|
const providerOptionsName = this.config.providerOptionsName;
|
|
1173
1350
|
const extensionRegistry = this.extensionRegistry;
|
|
1174
1351
|
const extensionStreamState = /* @__PURE__ */ new Map();
|
|
1352
|
+
const getResponseErrorMetadata = this.config.getResponseErrorMetadata;
|
|
1175
1353
|
return {
|
|
1176
1354
|
stream: response.pipeThrough(
|
|
1177
1355
|
new TransformStream({
|
|
@@ -1179,7 +1357,6 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
1179
1357
|
controller.enqueue({ type: "stream-start", warnings });
|
|
1180
1358
|
},
|
|
1181
1359
|
async transform(parseResult, controller) {
|
|
1182
|
-
var _a2, _b2, _c, _d, _e, _f, _g, _h;
|
|
1183
1360
|
if (options.includeRawChunks) {
|
|
1184
1361
|
controller.enqueue({
|
|
1185
1362
|
type: "raw",
|
|
@@ -1193,21 +1370,21 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
1193
1370
|
const chunk = parseResult.value;
|
|
1194
1371
|
if (isOpenResponsesExtensionEvent(chunk)) {
|
|
1195
1372
|
const extension = extensionRegistry.byEventType.get(chunk.type);
|
|
1196
|
-
if (
|
|
1373
|
+
if (extension?.decodeEvent != null) {
|
|
1197
1374
|
try {
|
|
1198
1375
|
const decoded = await extension.decodeEvent({
|
|
1199
1376
|
event: chunk,
|
|
1200
1377
|
state: extensionStreamState
|
|
1201
1378
|
});
|
|
1202
|
-
for (const part of decoded
|
|
1379
|
+
for (const part of decoded ?? []) {
|
|
1203
1380
|
controller.enqueue(part);
|
|
1204
|
-
hasToolCalls
|
|
1381
|
+
hasToolCalls ||= part.type === "tool-call" || part.type === "tool-input-start";
|
|
1205
1382
|
}
|
|
1206
1383
|
} catch (error) {
|
|
1207
1384
|
controller.enqueue({ type: "error", error });
|
|
1208
1385
|
}
|
|
1386
|
+
return;
|
|
1209
1387
|
}
|
|
1210
|
-
return;
|
|
1211
1388
|
}
|
|
1212
1389
|
if (chunk.type === "response.output_item.added" && chunk.item.type === "function_call") {
|
|
1213
1390
|
toolCallsByItemId.set(chunk.item.id, {
|
|
@@ -1224,7 +1401,7 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
1224
1401
|
});
|
|
1225
1402
|
return;
|
|
1226
1403
|
}
|
|
1227
|
-
toolCall.arguments = (
|
|
1404
|
+
toolCall.arguments = (toolCall.arguments ?? "") + functionCallChunk.delta;
|
|
1228
1405
|
} else if (chunk.type === "response.function_call_arguments.done") {
|
|
1229
1406
|
const functionCallChunk = chunk;
|
|
1230
1407
|
const toolCall = toolCallsByItemId.get(functionCallChunk.item_id);
|
|
@@ -1237,9 +1414,9 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
1237
1414
|
toolCall.arguments = functionCallChunk.arguments;
|
|
1238
1415
|
} else if (chunk.type === "response.output_item.done" && chunk.item.type === "function_call") {
|
|
1239
1416
|
const toolCall = toolCallsByItemId.get(chunk.item.id);
|
|
1240
|
-
const toolName =
|
|
1241
|
-
const toolCallId =
|
|
1242
|
-
const input =
|
|
1417
|
+
const toolName = toolCall?.toolName ?? chunk.item.name;
|
|
1418
|
+
const toolCallId = toolCall?.toolCallId ?? chunk.item.call_id;
|
|
1419
|
+
const input = chunk.item.arguments !== "" ? chunk.item.arguments : toolCall?.arguments ?? "";
|
|
1243
1420
|
controller.enqueue({
|
|
1244
1421
|
type: "tool-call",
|
|
1245
1422
|
toolCallId,
|
|
@@ -1253,7 +1430,57 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
1253
1430
|
});
|
|
1254
1431
|
hasToolCalls = true;
|
|
1255
1432
|
toolCallsByItemId.delete(chunk.item.id);
|
|
1256
|
-
} else if (chunk.type === "response.output_item.
|
|
1433
|
+
} else if (chunk.type === "response.output_item.added" && chunk.item.type === "custom_tool_call") {
|
|
1434
|
+
customToolCallsByItemId.set(chunk.item.id, {
|
|
1435
|
+
toolName: chunk.item.name,
|
|
1436
|
+
toolCallId: chunk.item.call_id,
|
|
1437
|
+
input: chunk.item.input
|
|
1438
|
+
});
|
|
1439
|
+
controller.enqueue({
|
|
1440
|
+
type: "tool-input-start",
|
|
1441
|
+
id: chunk.item.call_id,
|
|
1442
|
+
toolName: chunk.item.name
|
|
1443
|
+
});
|
|
1444
|
+
} else if (chunk.type === "response.custom_tool_call_input.delta") {
|
|
1445
|
+
const toolCall = customToolCallsByItemId.get(chunk.item_id);
|
|
1446
|
+
if (toolCall == null) {
|
|
1447
|
+
customToolCallsByItemId.set(chunk.item_id, {
|
|
1448
|
+
input: chunk.delta
|
|
1449
|
+
});
|
|
1450
|
+
} else {
|
|
1451
|
+
toolCall.input = (toolCall.input ?? "") + chunk.delta;
|
|
1452
|
+
}
|
|
1453
|
+
controller.enqueue({
|
|
1454
|
+
type: "tool-input-delta",
|
|
1455
|
+
id: customToolCallsByItemId.get(chunk.item_id)?.toolCallId ?? chunk.item_id,
|
|
1456
|
+
delta: chunk.delta
|
|
1457
|
+
});
|
|
1458
|
+
} else if (chunk.type === "response.custom_tool_call_input.done") {
|
|
1459
|
+
const toolCall = customToolCallsByItemId.get(chunk.item_id);
|
|
1460
|
+
if (toolCall == null) {
|
|
1461
|
+
customToolCallsByItemId.set(chunk.item_id, {
|
|
1462
|
+
input: chunk.input
|
|
1463
|
+
});
|
|
1464
|
+
} else {
|
|
1465
|
+
toolCall.input = chunk.input;
|
|
1466
|
+
}
|
|
1467
|
+
} else if (chunk.type === "response.output_item.done" && chunk.item.type === "custom_tool_call") {
|
|
1468
|
+
const toolCall = customToolCallsByItemId.get(chunk.item.id);
|
|
1469
|
+
const toolCallId = toolCall?.toolCallId ?? chunk.item.call_id;
|
|
1470
|
+
const input = chunk.item.input !== "" ? chunk.item.input : toolCall?.input ?? "";
|
|
1471
|
+
controller.enqueue({ type: "tool-input-end", id: toolCallId });
|
|
1472
|
+
controller.enqueue({
|
|
1473
|
+
type: "tool-call",
|
|
1474
|
+
toolCallId,
|
|
1475
|
+
toolName: toolCall?.toolName ?? chunk.item.name,
|
|
1476
|
+
input: JSON.stringify(input),
|
|
1477
|
+
providerMetadata: {
|
|
1478
|
+
[providerOptionsName]: { itemId: chunk.item.id }
|
|
1479
|
+
}
|
|
1480
|
+
});
|
|
1481
|
+
hasToolCalls = true;
|
|
1482
|
+
customToolCallsByItemId.delete(chunk.item.id);
|
|
1483
|
+
} else if (chunk.type === "response.output_item.done" && isOpenResponsesExtensionItem(chunk.item) && extensionRegistry.byItemType.has(chunk.item.type)) {
|
|
1257
1484
|
try {
|
|
1258
1485
|
const decoded = await decodeExtensionItem({
|
|
1259
1486
|
extensionRegistry,
|
|
@@ -1261,9 +1488,9 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
1261
1488
|
mode: "stream",
|
|
1262
1489
|
providerOptionsName
|
|
1263
1490
|
});
|
|
1264
|
-
for (const part of decoded
|
|
1491
|
+
for (const part of decoded ?? []) {
|
|
1265
1492
|
controller.enqueue(part);
|
|
1266
|
-
hasToolCalls
|
|
1493
|
+
hasToolCalls ||= part.type === "tool-call";
|
|
1267
1494
|
}
|
|
1268
1495
|
} catch (error) {
|
|
1269
1496
|
controller.enqueue({ type: "error", error });
|
|
@@ -1316,19 +1543,19 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
1316
1543
|
}
|
|
1317
1544
|
});
|
|
1318
1545
|
} else if (chunk.type === "response.completed" || chunk.type === "response.incomplete") {
|
|
1319
|
-
const reason =
|
|
1546
|
+
const reason = chunk.response.incomplete_details?.reason;
|
|
1320
1547
|
finishReason = {
|
|
1321
1548
|
unified: mapOpenResponsesFinishReason({
|
|
1322
1549
|
finishReason: reason,
|
|
1323
1550
|
hasToolCalls
|
|
1324
1551
|
}),
|
|
1325
|
-
raw: reason
|
|
1552
|
+
raw: reason ?? void 0
|
|
1326
1553
|
};
|
|
1327
1554
|
updateUsage(chunk.response.usage);
|
|
1328
1555
|
} else if (chunk.type === "response.failed") {
|
|
1329
1556
|
finishReason = {
|
|
1330
1557
|
unified: "error",
|
|
1331
|
-
raw:
|
|
1558
|
+
raw: chunk.response.error?.code ?? chunk.response.status
|
|
1332
1559
|
};
|
|
1333
1560
|
updateUsage(chunk.response.usage);
|
|
1334
1561
|
if (chunk.response.error != null) {
|
|
@@ -1337,7 +1564,8 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
1337
1564
|
error: createOpenResponsesStreamError({
|
|
1338
1565
|
type: chunk.type,
|
|
1339
1566
|
error: chunk.response.error,
|
|
1340
|
-
data: chunk
|
|
1567
|
+
data: chunk,
|
|
1568
|
+
getResponseErrorMetadata
|
|
1341
1569
|
})
|
|
1342
1570
|
});
|
|
1343
1571
|
}
|
|
@@ -1351,7 +1579,8 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
1351
1579
|
error: createOpenResponsesStreamError({
|
|
1352
1580
|
type: chunk.type,
|
|
1353
1581
|
error: chunk.error,
|
|
1354
|
-
data: chunk
|
|
1582
|
+
data: chunk,
|
|
1583
|
+
getResponseErrorMetadata
|
|
1355
1584
|
})
|
|
1356
1585
|
});
|
|
1357
1586
|
}
|
|
@@ -1380,12 +1609,14 @@ var OpenResponsesLanguageModel = class _OpenResponsesLanguageModel {
|
|
|
1380
1609
|
function createOpenResponsesStreamError({
|
|
1381
1610
|
type,
|
|
1382
1611
|
error,
|
|
1383
|
-
data
|
|
1612
|
+
data,
|
|
1613
|
+
getResponseErrorMetadata
|
|
1384
1614
|
}) {
|
|
1385
1615
|
return createProviderStreamError({
|
|
1386
1616
|
message: error.message,
|
|
1387
1617
|
type,
|
|
1388
1618
|
code: error.code,
|
|
1619
|
+
...getResponseErrorMetadata?.(error),
|
|
1389
1620
|
data
|
|
1390
1621
|
});
|
|
1391
1622
|
}
|
|
@@ -1465,8 +1696,7 @@ function addExtensionItemReferenceMetadata({
|
|
|
1465
1696
|
part,
|
|
1466
1697
|
providerOptionsName
|
|
1467
1698
|
}) {
|
|
1468
|
-
|
|
1469
|
-
const providerMetadata = (_a = part.providerMetadata) != null ? _a : {};
|
|
1699
|
+
const providerMetadata = part.providerMetadata ?? {};
|
|
1470
1700
|
return {
|
|
1471
1701
|
...part,
|
|
1472
1702
|
providerMetadata: {
|
|
@@ -1499,6 +1729,7 @@ function getOutputTextAnnotations(value) {
|
|
|
1499
1729
|
// src/open-responses-provider.ts
|
|
1500
1730
|
function createOpenResponses(options) {
|
|
1501
1731
|
const providerName = options.name;
|
|
1732
|
+
const customToolId = options.customToolId ?? "open-responses.custom";
|
|
1502
1733
|
const extensionRegistry = createOpenResponsesExtensionRegistry(
|
|
1503
1734
|
options.experimental_extensions
|
|
1504
1735
|
);
|
|
@@ -1507,9 +1738,9 @@ function createOpenResponses(options) {
|
|
|
1507
1738
|
...options.apiKey ? {
|
|
1508
1739
|
Authorization: `Bearer ${options.apiKey}`
|
|
1509
1740
|
} : {},
|
|
1510
|
-
...options.headers
|
|
1741
|
+
...typeof options.headers === "function" ? options.headers() : options.headers
|
|
1511
1742
|
},
|
|
1512
|
-
`ai-sdk
|
|
1743
|
+
options.userAgentSuffix ?? `ai-sdk-open-responses/${VERSION}`
|
|
1513
1744
|
);
|
|
1514
1745
|
const createResponsesModel = (modelId) => {
|
|
1515
1746
|
return new OpenResponsesLanguageModel(modelId, {
|
|
@@ -1518,9 +1749,13 @@ function createOpenResponses(options) {
|
|
|
1518
1749
|
headers: getHeaders,
|
|
1519
1750
|
url: options.url,
|
|
1520
1751
|
fetch: options.fetch,
|
|
1752
|
+
failedResponseHandler: options.failedResponseHandler,
|
|
1753
|
+
getResponseErrorMetadata: options.getResponseErrorMetadata,
|
|
1521
1754
|
generateId: () => generateId(),
|
|
1522
1755
|
extensionRegistry,
|
|
1523
|
-
strictResponseInput: options.strictResponseInput
|
|
1756
|
+
strictResponseInput: options.strictResponseInput,
|
|
1757
|
+
customToolId,
|
|
1758
|
+
structuredOutputs: options.structuredOutputs
|
|
1524
1759
|
});
|
|
1525
1760
|
};
|
|
1526
1761
|
const createLanguageModel = (modelId) => {
|
|
@@ -1536,6 +1771,7 @@ function createOpenResponses(options) {
|
|
|
1536
1771
|
};
|
|
1537
1772
|
provider.specificationVersion = "v4";
|
|
1538
1773
|
provider.languageModel = createLanguageModel;
|
|
1774
|
+
provider.tools = createOpenResponsesTools({ customToolId });
|
|
1539
1775
|
provider.embeddingModel = (modelId) => {
|
|
1540
1776
|
throw new NoSuchModelError({ modelId, modelType: "embeddingModel" });
|
|
1541
1777
|
};
|