maka-agent 0.2.0-dev.27.20260910 → 0.2.0-dev.29.20260912
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 +160 -3
- package/THIRD_PARTY_NOTICES.txt +14 -14
- package/dist/cli-core.js +7 -0
- package/dist/onboarding-catalog.js +1 -0
- package/dist/pi-tui-pickers.js +183 -21
- package/dist/pi-tui-runner.js +150 -18
- package/dist/runtime-host-onboarding.js +345 -5
- package/dist/runtime-host-run-command.js +15 -7
- package/dist/runtime-host-session-driver.js +18 -0
- package/dist/runtime-host-tui-command.js +21 -5
- package/dist/runtime-host-tui-context.js +19 -5
- package/dist/session-import-command.js +69 -0
- package/dist/tui-copy-catalog.js +93 -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/@ai-sdk/anthropic/CHANGELOG.md +66 -0
- package/node_modules/@ai-sdk/anthropic/dist/index.js +375 -197
- package/node_modules/@ai-sdk/anthropic/dist/internal/index.js +181 -74
- package/node_modules/@ai-sdk/anthropic/docs/05-anthropic.mdx +123 -43
- package/node_modules/@ai-sdk/{provider → anthropic/node_modules/@ai-sdk/provider}/CHANGELOG.md +32 -0
- package/node_modules/@ai-sdk/{provider → anthropic/node_modules/@ai-sdk/provider}/package.json +1 -1
- package/node_modules/@ai-sdk/anthropic/package.json +3 -3
- package/node_modules/@ai-sdk/cohere/CHANGELOG.md +53 -0
- package/node_modules/@ai-sdk/cohere/dist/index.js +1 -1
- package/node_modules/@ai-sdk/cohere/node_modules/@ai-sdk/provider/CHANGELOG.md +1262 -0
- package/node_modules/@ai-sdk/cohere/node_modules/@ai-sdk/provider/README.md +1 -0
- package/node_modules/@ai-sdk/cohere/node_modules/@ai-sdk/provider/dist/index.js +426 -0
- package/node_modules/@ai-sdk/cohere/node_modules/@ai-sdk/provider/package.json +63 -0
- package/node_modules/@ai-sdk/cohere/package.json +3 -3
- package/node_modules/@ai-sdk/google/CHANGELOG.md +92 -0
- package/node_modules/@ai-sdk/google/dist/index.js +941 -420
- package/node_modules/@ai-sdk/google/dist/internal/index.js +394 -103
- package/node_modules/@ai-sdk/google/docs/15-google.mdx +195 -85
- package/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider/CHANGELOG.md +1262 -0
- package/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider/README.md +1 -0
- package/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider/dist/index.js +426 -0
- package/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider/package.json +63 -0
- package/node_modules/@ai-sdk/google/package.json +3 -3
- package/node_modules/@ai-sdk/open-responses/CHANGELOG.md +65 -0
- package/node_modules/@ai-sdk/open-responses/dist/index.js +51 -13
- package/node_modules/@ai-sdk/open-responses/docs/06-open-responses.mdx +7 -0
- package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider/CHANGELOG.md +1262 -0
- package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider/README.md +1 -0
- package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider/dist/index.js +426 -0
- package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider/package.json +63 -0
- package/node_modules/@ai-sdk/open-responses/package.json +3 -3
- package/node_modules/@ai-sdk/openai/CHANGELOG.md +118 -0
- package/node_modules/@ai-sdk/openai/dist/index.js +1080 -316
- package/node_modules/@ai-sdk/openai/dist/internal/index.js +549 -157
- package/node_modules/@ai-sdk/openai/docs/03-openai.mdx +202 -66
- package/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider/CHANGELOG.md +1262 -0
- package/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider/LICENSE +13 -0
- package/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider/README.md +1 -0
- package/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider/dist/index.js +426 -0
- package/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider/package.json +63 -0
- package/node_modules/@ai-sdk/openai/package.json +3 -3
- package/node_modules/@ai-sdk/openai-compatible/CHANGELOG.md +60 -0
- package/node_modules/@ai-sdk/openai-compatible/dist/index.js +8 -2
- package/node_modules/@ai-sdk/openai-compatible/docs/index.mdx +0 -1
- package/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider/CHANGELOG.md +1262 -0
- package/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider/LICENSE +13 -0
- package/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider/README.md +1 -0
- package/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider/dist/index.js +426 -0
- package/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider/package.json +63 -0
- package/node_modules/@ai-sdk/openai-compatible/package.json +3 -3
- package/node_modules/@ai-sdk/provider-utils/CHANGELOG.md +48 -0
- package/node_modules/@ai-sdk/provider-utils/dist/index.js +485 -181
- package/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/CHANGELOG.md +1262 -0
- package/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/LICENSE +13 -0
- package/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/README.md +1 -0
- package/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/dist/index.js +426 -0
- package/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/package.json +63 -0
- package/node_modules/@ai-sdk/provider-utils/package.json +3 -3
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +9 -4
- package/node_modules/@maka/core/dist/chat-model-choice.js +1 -2
- package/node_modules/@maka/core/dist/collaboration.js +12 -0
- package/node_modules/@maka/core/dist/diagnostic-log.js +18 -7
- package/node_modules/@maka/core/dist/llm-connections.js +1 -1
- package/node_modules/@maka/core/dist/model-catalog.js +26 -103
- package/node_modules/@maka/core/dist/model-facts.js +0 -74
- package/node_modules/@maka/core/dist/model-thinking.js +70 -38
- package/node_modules/@maka/core/dist/permission-profile.js +17 -0
- package/node_modules/@maka/core/dist/provider-registry.js +1 -3
- package/node_modules/@maka/core/dist/runtime-policy/connection-catalog-codec.js +68 -46
- package/node_modules/@maka/core/dist/runtime-policy/model-catalog-entry-codec.js +21 -12
- package/node_modules/@maka/core/dist/runtime-policy/policy-codec.js +43 -4
- package/node_modules/@maka/core/dist/runtime-policy.js +3 -2
- package/node_modules/@maka/core/dist/scheduled-task.js +8 -2
- package/node_modules/@maka/core/dist/settings.js +12 -0
- package/node_modules/@maka/core/dist/text-sanitize.js +8 -2
- package/node_modules/@maka/runtime/dist/agent-run.js +8 -1
- package/node_modules/@maka/runtime/dist/agent-swarm-status-tool.js +0 -1
- package/node_modules/@maka/runtime/dist/ai-sdk-backend.js +1 -0
- package/node_modules/@maka/runtime/dist/ai-sdk-turn.js +50 -58
- package/node_modules/@maka/runtime/dist/archive-read-tool.js +3 -1
- package/node_modules/@maka/runtime/dist/ask-user-question-tool.js +0 -1
- package/node_modules/@maka/runtime/dist/bots/bot-test.js +2 -1
- package/node_modules/@maka/runtime/dist/bots/dingtalk-bridge.js +86 -19
- package/node_modules/@maka/runtime/dist/bots/feishu-bridge.js +24 -20
- package/node_modules/@maka/runtime/dist/bots/slack-bridge.js +5 -3
- package/node_modules/@maka/runtime/dist/bots/wechat-bridge.js +87 -29
- package/node_modules/@maka/runtime/dist/bots/wecom-bridge.js +40 -36
- package/node_modules/@maka/runtime/dist/code-mode.js +7 -4
- package/node_modules/@maka/runtime/dist/computer-use-tools.js +4 -1
- package/node_modules/@maka/runtime/dist/context-budget-policy.js +6 -24
- package/node_modules/@maka/runtime/dist/deep-research-tools.js +11 -5
- package/node_modules/@maka/runtime/dist/edit-replace.js +2 -2
- package/node_modules/@maka/runtime/dist/filesystem-worker/operations.js +5 -6
- package/node_modules/@maka/runtime/dist/memory-extraction-evidence.js +7 -1
- package/node_modules/@maka/runtime/dist/memory-extraction.js +12 -7
- package/node_modules/@maka/runtime/dist/model-adapter.js +13 -3
- package/node_modules/@maka/runtime/dist/model-factory.js +1 -1
- package/node_modules/@maka/runtime/dist/openai-responses-websocket.js +2 -5
- package/node_modules/@maka/runtime/dist/plan-tools.js +0 -3
- package/node_modules/@maka/runtime/dist/plugin-composition-loader.js +11 -2
- package/node_modules/@maka/runtime/dist/request-customization-fetch.js +14 -7
- package/node_modules/@maka/runtime/dist/runtime-kernel.js +70 -14
- package/node_modules/@maka/runtime/dist/session-export.js +1 -0
- package/node_modules/@maka/runtime/dist/session-import.js +100 -0
- package/node_modules/@maka/runtime/dist/session-manager.js +143 -24
- package/node_modules/@maka/runtime/dist/session-trace-projection.js +22 -0
- package/node_modules/@maka/runtime/dist/shell-run-manager.js +9 -6
- package/node_modules/@maka/runtime/dist/shell-run-tool-result.js +13 -6
- package/node_modules/@maka/runtime/dist/stream-graph-coordinator.js +43 -10
- package/node_modules/@maka/runtime/dist/stream-graph-handoff.js +6 -1
- package/node_modules/@maka/runtime/dist/stream-graph-supervisor-tools.js +0 -3
- package/node_modules/@maka/runtime/dist/subagent-tools.js +0 -3
- package/node_modules/@maka/runtime/dist/subscription-model-fetch.js +1 -4
- package/node_modules/@maka/runtime/dist/system-prompt/workspace-instructions.js +11 -6
- package/node_modules/@maka/runtime/dist/tavily-search.js +8 -2
- package/node_modules/@maka/runtime/dist/text-line-window.js +49 -0
- package/node_modules/@maka/runtime/dist/tool-availability.js +0 -1
- package/node_modules/@maka/runtime/dist/tool-output.js +35 -12
- package/node_modules/@maka/runtime/dist/tool-runtime.js +27 -3
- package/node_modules/@maka/runtime/dist/unified-diff.js +40 -10
- package/node_modules/@maka/runtime/dist/web-fetch-tool.js +4 -2
- package/node_modules/@maka/runtime/dist/workers/filesystem-worker.js +82 -33
- package/node_modules/@maka/runtime/dist/workspace-executor.js +2 -6
- package/node_modules/@maka/runtime/node_modules/@ai-sdk/code-mode/LICENSE +13 -0
- package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/run-code-mode.js +2 -0
- package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/package.json +3 -3
- package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/gateway/CHANGELOG.md +101 -0
- package/node_modules/@maka/runtime/node_modules/@ai-sdk/gateway/LICENSE +13 -0
- package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/gateway/dist/index.js +309 -244
- package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/gateway/docs/00-ai-gateway.mdx +29 -16
- package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/gateway/package.json +3 -3
- package/node_modules/@maka/runtime/node_modules/@ai-sdk/provider/CHANGELOG.md +1262 -0
- package/node_modules/@maka/runtime/node_modules/@ai-sdk/provider/LICENSE +13 -0
- package/node_modules/@maka/runtime/node_modules/@ai-sdk/provider/README.md +1 -0
- package/node_modules/@maka/runtime/node_modules/@ai-sdk/provider/dist/index.js +426 -0
- package/node_modules/@maka/runtime/node_modules/@ai-sdk/provider/package.json +63 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/CHANGELOG.md +152 -0
- package/node_modules/@maka/runtime/node_modules/ai/LICENSE +13 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/dist/index.js +2505 -1548
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/dist/internal/index.js +129 -107
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-foundations/02-providers-and-models.mdx +8 -1
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-agents/04-loop-control.mdx +5 -3
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-agents/06-policy-tool-approvals.mdx +2 -1
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-agents/06-tool-approvals.mdx +13 -7
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-agents/07-workflow-agent.mdx +94 -10
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/10-generating-structured-data.mdx +15 -3
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/15-tools-and-tool-calling.mdx +2 -1
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/16-mcp-tools.mdx +64 -1
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/35-image-generation.mdx +11 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/36-transcription.mdx +36 -35
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/37-speech.mdx +0 -17
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/39-file-uploads.mdx +25 -0
- package/node_modules/@maka/runtime/node_modules/ai/docs/03-ai-sdk-core/42-batch.mdx +372 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/50-error-handling.mdx +83 -6
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/60-telemetry.mdx +28 -5
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/index.mdx +5 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-harnesses/02-harness-agent.mdx +40 -0
- package/node_modules/@maka/runtime/node_modules/ai/docs/03-ai-sdk-harnesses/05-harness-adapters.mdx +47 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/03-chatbot-tool-usage.mdx +23 -1
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/20-streaming-data.mdx +11 -6
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/50-stream-protocol.mdx +6 -2
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/06-advanced/04-caching.mdx +7 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/06-advanced/11-secure-url-fetching.mdx +7 -1
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/01-generate-text.mdx +14 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/02-stream-text.mdx +39 -5
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/05-embed.mdx +31 -5
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/06-embed-many.mdx +32 -6
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/06-rerank.mdx +19 -5
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/10-generate-image.mdx +2 -1
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/14-upload-file.mdx +37 -4
- package/node_modules/@maka/runtime/node_modules/ai/docs/07-reference/01-ai-sdk-core/20-start-batch.mdx +154 -0
- package/node_modules/@maka/runtime/node_modules/ai/docs/07-reference/01-ai-sdk-core/21-get-batch-status.mdx +133 -0
- package/node_modules/@maka/runtime/node_modules/ai/docs/07-reference/01-ai-sdk-core/22-get-batch-results.mdx +109 -0
- package/node_modules/@maka/runtime/node_modules/ai/docs/07-reference/01-ai-sdk-core/23-cancel-batch.mdx +96 -0
- package/node_modules/@maka/runtime/node_modules/ai/docs/07-reference/01-ai-sdk-core/24-list-batches.mdx +121 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/28-output.mdx +27 -1
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/31-ui-message.mdx +63 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/80-smooth-stream.mdx +1 -1
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/index.mdx +25 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/01-use-chat.mdx +1 -1
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/40-create-ui-message-stream.mdx +4 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/41-create-ui-message-stream-response.mdx +6 -1
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/04-ai-sdk-workflow/01-workflow-agent.mdx +101 -34
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-argument-error.mdx +6 -1
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-no-image-generated-error.mdx +7 -0
- package/node_modules/@maka/runtime/node_modules/ai/docs/07-reference/05-ai-sdk-errors/ai-tool-choice-violation-error.mdx +38 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/index.mdx +1 -0
- package/node_modules/{ai → @maka/runtime/node_modules/ai}/package.json +12 -12
- package/node_modules/@maka/runtime/package.json +11 -10
- package/node_modules/@maka/runtime-host/dist/adapter/session-projector.js +17 -36
- package/node_modules/@maka/runtime-host/dist/client/catalog-reader.js +5 -7
- package/node_modules/@maka/runtime-host/dist/client/host-handoff-copy.js +6 -6
- package/node_modules/@maka/runtime-host/dist/peer-mesh/node.js +7 -4
- package/node_modules/@maka/runtime-host/dist/protocol/artifact.js +2 -2
- package/node_modules/@maka/runtime-host/dist/protocol/external-agent-setup.js +149 -0
- package/node_modules/@maka/runtime-host/dist/protocol/index.js +14 -1
- package/node_modules/@maka/runtime-host/dist/protocol/oauth.js +23 -4
- package/node_modules/@maka/runtime-host/dist/protocol/operations.js +4 -1
- package/node_modules/@maka/runtime-host/dist/protocol/runtime-policy.js +16 -20
- package/node_modules/@maka/runtime-host/dist/protocol/session-bundle.js +100 -0
- package/node_modules/@maka/runtime-host/dist/protocol/session-transcript.js +3 -2
- package/node_modules/@maka/runtime-host/dist/protocol/skill-catalog.js +2 -1
- package/node_modules/@maka/runtime-host/dist/server/acp/antigravity-install.js +242 -0
- package/node_modules/@maka/runtime-host/dist/server/acp/antigravity.js +154 -0
- package/node_modules/@maka/runtime-host/dist/server/acp/connection.js +116 -0
- package/node_modules/@maka/runtime-host/dist/server/artifact-coordinator.js +12 -10
- package/node_modules/@maka/runtime-host/dist/server/execution-composition.js +85 -7
- package/node_modules/@maka/runtime-host/dist/server/execution-model-authority.js +2 -2
- package/node_modules/@maka/runtime-host/dist/server/execution-model-composition.js +4 -7
- package/node_modules/@maka/runtime-host/dist/server/external-agent-setup-coordinator.js +190 -0
- package/node_modules/@maka/runtime-host/dist/server/external-session-coordinator.js +7 -7
- package/node_modules/@maka/runtime-host/dist/server/goal-coordinator.js +6 -1
- package/node_modules/@maka/runtime-host/dist/server/interactive-run-composer.js +35 -4
- package/node_modules/@maka/runtime-host/dist/server/json-array-page-budget.js +48 -0
- package/node_modules/@maka/runtime-host/dist/server/memory-projection.js +14 -15
- package/node_modules/@maka/runtime-host/dist/server/message-coordinator.js +24 -8
- package/node_modules/@maka/runtime-host/dist/server/oauth-coordinator.js +13 -1
- package/node_modules/@maka/runtime-host/dist/server/plan-coordinator.js +11 -5
- package/node_modules/@maka/runtime-host/dist/server/plugin-platform-coordinator.js +8 -6
- package/node_modules/@maka/runtime-host/dist/server/project-catalog-coordinator.js +10 -12
- package/node_modules/@maka/runtime-host/dist/server/project-directory-authority.js +4 -3
- package/node_modules/@maka/runtime-host/dist/server/root-admission-owner.js +17 -8
- package/node_modules/@maka/runtime-host/dist/server/runtime-policy-coordinator.js +23 -25
- package/node_modules/@maka/runtime-host/dist/server/runtime-resource-projection.js +12 -18
- package/node_modules/@maka/runtime-host/dist/server/scheduled-task-coordinator.js +15 -11
- package/node_modules/@maka/runtime-host/dist/server/session-bundle-coordinator.js +163 -0
- package/node_modules/@maka/runtime-host/dist/server/session-catalog-coordinator.js +24 -12
- package/node_modules/@maka/runtime-host/dist/server/session-continuity-coordinator.js +20 -21
- package/node_modules/@maka/runtime-host/dist/server/session-revision-coordinator.js +1 -0
- package/node_modules/@maka/runtime-host/dist/server/session-transcript-pager.js +24 -2
- package/node_modules/@maka/runtime-host/dist/server/skill-catalog-coordinator.js +18 -2
- package/node_modules/@maka/runtime-host/dist/server/skill-catalog-repository.js +16 -17
- package/node_modules/@maka/runtime-host/dist/server/usage-pricing-coordinator.js +16 -19
- package/node_modules/@maka/runtime-host/dist/server/workhub-coordination-coordinator.js +1 -0
- package/node_modules/@maka/runtime-host/dist/transport/framed-byte-stream-transport.js +4 -1
- package/node_modules/@maka/runtime-host/dist/transport/local-ipc-framing.js +4 -2
- package/node_modules/@maka/runtime-host/dist/transport/peer-native.js +9 -8
- package/node_modules/@maka/runtime-host/dist/transport/resumable-peer-stream.js +14 -9
- package/node_modules/@maka/runtime-host/package.json +1 -0
- package/node_modules/@maka/storage/dist/context-offload-snapshot.js +70 -5
- package/node_modules/@maka/storage/dist/context-value-mutation-gate.js +59 -0
- package/node_modules/@maka/storage/dist/model-facts-store.js +5 -28
- package/node_modules/@maka/storage/dist/project-catalog.js +6 -0
- package/node_modules/@maka/storage/dist/runtime-policy/connection-catalog-document.js +111 -38
- package/node_modules/@maka/storage/dist/runtime-policy/coordinator.js +46 -61
- package/node_modules/@maka/storage/dist/runtime-policy/oauth-login-receipt-document.js +25 -6
- package/node_modules/@maka/storage/dist/runtime-policy/onboarding-transaction.js +30 -14
- package/node_modules/@maka/storage/dist/runtime-policy/policy-document.js +10 -4
- package/node_modules/@maka/storage/dist/scheduled-task-store.js +8 -1
- package/node_modules/@maka/storage/dist/session-bundle-policy.js +680 -7
- package/node_modules/@maka/storage/dist/session-message-projection.js +8 -4
- package/node_modules/@maka/storage/dist/session-store.js +3 -0
- package/node_modules/@maka/storage/dist/sqlite-context-offload-store.js +18 -4
- package/node_modules/@maka/storage/dist/sqlite-session-metadata-store.js +3 -7
- package/node_modules/@maka/storage/dist/stable-storage.js +2 -1
- package/node_modules/@modelcontextprotocol/client/dist/src-D_zzAWoS.mjs +22 -5
- package/node_modules/@modelcontextprotocol/client/dist/src-NAgB4Mp8.cjs +22 -5
- package/node_modules/run/README.md +109 -18
- package/node_modules/run/THIRD_PARTY_NOTICES.md +11 -11
- package/node_modules/run/dist/continuation-validation.js +116 -1
- package/node_modules/run/dist/errors.js +12 -2
- package/node_modules/run/dist/host-function-invocation.js +2 -1
- package/node_modules/run/dist/run.js +30 -4
- package/node_modules/run/dist/runtime/guest-serde-source.js +1 -1
- package/node_modules/run/dist/runtime/guest-sources.js +214 -56
- package/node_modules/run/dist/runtime/manager.js +575 -116
- package/node_modules/run/dist/runtime/max-workers.js +8 -4
- package/node_modules/run/dist/runtime/protocol-validation.js +20 -7
- package/node_modules/run/dist/runtime/sync-bridge-protocol.js +135 -0
- package/node_modules/run/dist/runtime/worker-source.js +1 -1
- package/node_modules/run/dist/utils/options.js +7 -0
- package/node_modules/run/dist/utils/promise-with-resolvers.js +13 -1
- package/node_modules/run/dist/utils/serde.js +1 -7
- package/node_modules/run/dist/utils/source-cache.js +83 -13
- package/node_modules/run/package.json +6 -4
- package/node_modules/zod/v4/core/memoizer.cjs +12 -16
- package/node_modules/zod/v4/core/memoizer.js +12 -16
- package/package.json +1 -1
- package/node_modules/ai/docs/03-ai-sdk-harnesses/05-harness-adapters.mdx +0 -45
- /package/node_modules/@ai-sdk/{code-mode → anthropic/node_modules/@ai-sdk/provider}/LICENSE +0 -0
- /package/node_modules/@ai-sdk/{provider → anthropic/node_modules/@ai-sdk/provider}/README.md +0 -0
- /package/node_modules/@ai-sdk/{provider → anthropic/node_modules/@ai-sdk/provider}/dist/index.js +0 -0
- /package/node_modules/@ai-sdk/{gateway → cohere/node_modules/@ai-sdk/provider}/LICENSE +0 -0
- /package/node_modules/@ai-sdk/{provider → google/node_modules/@ai-sdk/provider}/LICENSE +0 -0
- /package/node_modules/{ai → @ai-sdk/open-responses/node_modules/@ai-sdk/provider}/LICENSE +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/README.md +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/approval-continuation.js +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/approval.js +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/code-mode-tool.js +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/continuation-capability.js +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/direct-tool-call.js +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/errors.js +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/host-interrupt.js +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/index.js +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/interrupt-continuation.js +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/tool-invocation.js +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/tool-prompt.js +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/types.js +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/dist/utils/serialization.js +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/code-mode/src/tsconfig.json +0 -0
- /package/node_modules/{@ai-sdk → @maka/runtime/node_modules/@ai-sdk}/gateway/README.md +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/README.md +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/00-introduction/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-foundations/01-overview.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-foundations/03-prompts.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-foundations/04-tools.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-foundations/05-streaming.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-foundations/06-provider-options.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-foundations/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-getting-started/00-choosing-a-provider.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-getting-started/01-navigating-the-library.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-getting-started/02-nextjs-app-router.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-getting-started/03-nextjs-pages-router.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-getting-started/04-svelte.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-getting-started/05-nuxt.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-getting-started/06-nodejs.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-getting-started/07-expo.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-getting-started/08-tanstack-start.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-getting-started/09-coding-agents.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/02-getting-started/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-agents/01-overview.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-agents/02-building-agents.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-agents/03-workflows.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-agents/05-configuring-call-options.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-agents/06-memory.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-agents/06-subagents.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-agents/08-terminal-ui.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-agents/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/01-overview.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/05-generating-text.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/17-mcp-apps.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/17-runtime-and-tool-context.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/18-code-mode.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/20-prompt-engineering.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/25-settings.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/26-reasoning.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/30-embeddings.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/31-reranking.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/36-realtime.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/36-translation.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/38-video-generation.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/40-middleware.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/41-skill-uploads.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/45-provider-management.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/55-testing.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/65-devtools.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-core/65-lifecycle-callbacks.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-harnesses/01-overview.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-harnesses/03-tools.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-harnesses/04-skills.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-harnesses/06-workflow-utilities.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-harnesses/07-ui.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-harnesses/08-terminal-ui.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/03-ai-sdk-harnesses/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/01-overview.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/02-chatbot.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/03-chatbot-message-persistence.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/03-chatbot-resume-streams.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/04-generative-user-interfaces.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/05-completion.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/08-object-generation.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/21-error-handling.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/21-transport.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/24-reading-ui-message-streams.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/25-message-metadata.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/04-ai-sdk-ui/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/05-ai-sdk-rsc/01-overview.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/05-ai-sdk-rsc/02-streaming-react-components.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/05-ai-sdk-rsc/03-generative-ui-state.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/05-ai-sdk-rsc/03-saving-and-restoring-states.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/05-ai-sdk-rsc/04-multistep-interfaces.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/05-ai-sdk-rsc/05-streaming-values.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/05-ai-sdk-rsc/06-loading-state.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/05-ai-sdk-rsc/08-error-handling.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/05-ai-sdk-rsc/09-authentication.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/05-ai-sdk-rsc/10-migrating-to-ui.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/05-ai-sdk-rsc/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/06-advanced/01-prompt-engineering.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/06-advanced/02-stopping-streams.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/06-advanced/03-backpressure.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/06-advanced/05-multiple-streamables.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/06-advanced/06-rate-limiting.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/06-advanced/07-rendering-ui-with-language-models.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/06-advanced/08-model-as-router.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/06-advanced/09-multistep-interfaces.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/06-advanced/09-sequential-generations.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/06-advanced/10-vercel-deployment-guide.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/06-advanced/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/11-stream-transcribe.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/11-stream-translate.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/11-transcribe.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/12-generate-speech.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/13-generate-video.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/14-upload-skill.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/15-agent.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/16-tool-loop-agent.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/17-create-agent-ui-stream.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/18-create-agent-ui-stream-response.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/18-pipe-agent-ui-stream-to-response.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/20-tool.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/22-dynamic-tool.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/23-create-mcp-client.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/23-get-realtime-tool-definitions.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/24-mcp-apps.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/24-mcp-stdio-transport.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/25-json-schema.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/26-zod-schema.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/27-valibot-schema.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/29-filter-active-tools.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/30-model-message.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/32-validate-ui-messages.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/33-safe-validate-ui-messages.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/34-sandbox.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/40-provider-registry.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/42-custom-provider.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/50-cosine-similarity.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/60-wrap-language-model.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/61-wrap-image-model.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/65-language-model-v2-middleware.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/66-extract-reasoning-middleware.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/67-simulate-streaming-middleware.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/68-default-instructions-middleware.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/68-default-settings-middleware.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/69-add-tool-input-examples-middleware.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/70-extract-json-middleware.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/70-is-step-count.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/71-has-tool-call.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/72-loop-finished.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/75-simulate-readable-stream.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/90-generate-id.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/91-create-id-generator.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/01-ai-sdk-core/92-default-generated-file.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/02-use-completion.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/03-use-object.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/05-use-realtime.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/31-convert-to-model-messages.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/32-prune-messages.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/42-pipe-ui-message-stream-to-response.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/43-read-ui-message-stream.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/46-infer-ui-tools.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/47-infer-ui-tool.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/48-mcp-app-renderer.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/50-direct-chat-transport.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/02-ai-sdk-ui/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/03-ai-sdk-rsc/01-stream-ui.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/03-ai-sdk-rsc/02-create-ai.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/03-ai-sdk-rsc/03-create-streamable-ui.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/03-ai-sdk-rsc/04-create-streamable-value.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/03-ai-sdk-rsc/05-read-streamable-value.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/03-ai-sdk-rsc/06-get-ai-state.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/03-ai-sdk-rsc/07-get-mutable-ai-state.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/03-ai-sdk-rsc/08-use-ai-state.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/03-ai-sdk-rsc/09-use-actions.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/03-ai-sdk-rsc/10-use-ui-state.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/03-ai-sdk-rsc/11-use-streamable-value.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/03-ai-sdk-rsc/20-render.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/03-ai-sdk-rsc/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/04-ai-sdk-workflow/02-workflow-chat-transport.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/04-ai-sdk-workflow/03-generate-video.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/04-ai-sdk-workflow/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-api-call-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-download-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-empty-response-body-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-data-content-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-message-role-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-prompt-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-response-data-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-tool-approval-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-tool-approval-signature-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-tool-input-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-json-parse-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-load-api-key-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-load-setting-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-message-conversion-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-no-content-generated-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-no-object-generated-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-no-output-generated-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-no-speech-generated-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-no-such-model-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-no-such-provider-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-no-such-provider-reference-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-no-such-tool-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-no-transcript-generated-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-no-translation-generated-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-no-video-generated-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-retry-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-stream-provider-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-too-many-embedding-values-for-call-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-tool-call-not-found-for-approval-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-tool-call-repair-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-type-validation-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-ui-message-stream-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/05-ai-sdk-errors/ai-unsupported-functionality-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/06-ai-sdk-tui/01-run-agent-tui.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/06-ai-sdk-tui/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/07-reference/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/08-migration-guides/00-versioning.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/08-migration-guides/23-migration-guide-7-0.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/08-migration-guides/24-migration-guide-6-0.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/08-migration-guides/25-migration-guide-5-0-data.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/08-migration-guides/26-migration-guide-5-0.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/08-migration-guides/27-migration-guide-4-2.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/08-migration-guides/28-migration-guide-4-1.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/08-migration-guides/29-migration-guide-4-0.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/08-migration-guides/36-migration-guide-3-4.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/08-migration-guides/37-migration-guide-3-3.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/08-migration-guides/38-migration-guide-3-2.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/08-migration-guides/39-migration-guide-3-1.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/08-migration-guides/index.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/01-azure-stream-slow.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/03-server-actions-in-client-components.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/04-strange-stream-output.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/05-streamable-ui-errors.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/05-tool-invocation-missing-result.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/06-streaming-not-working-when-deployed.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/06-streaming-not-working-when-proxied.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/06-timeout-on-vercel.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/07-unclosed-streams.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/08-use-chat-failed-to-parse-stream.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/09-client-stream-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/10-use-chat-tools-no-response.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/11-use-chat-custom-request-options.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/12-typescript-performance-zod.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/12-use-chat-an-error-occurred.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/13-repeated-assistant-messages.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/14-stream-abort-handling.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/14-tool-calling-with-structured-outputs.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/15-abort-breaks-resumable-streams.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/15-stream-text-not-working.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/16-streaming-status-delay.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/17-use-chat-stale-body-data.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/18-ontoolcall-type-narrowing.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/19-unsupported-model-version.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/20-no-object-generated-content-filter.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/21-missing-tool-results-error.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/30-model-is-not-assignable-to-type.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/40-typescript-cannot-find-namespace-jsx.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/50-react-maximum-update-depth-exceeded.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/60-jest-cannot-find-module-ai-rsc.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/70-high-memory-usage-with-images.mdx +0 -0
- /package/node_modules/{ai → @maka/runtime/node_modules/ai}/docs/09-troubleshooting/index.mdx +0 -0
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
NoSuchModelError
|
|
5
5
|
} from "@ai-sdk/provider";
|
|
6
6
|
import {
|
|
7
|
-
generateId as
|
|
7
|
+
generateId as generateId3,
|
|
8
8
|
loadApiKey,
|
|
9
9
|
loadOptionalSetting,
|
|
10
10
|
validateBaseURL,
|
|
@@ -71,7 +71,9 @@ var AnthropicFiles = class {
|
|
|
71
71
|
async uploadFile({
|
|
72
72
|
data,
|
|
73
73
|
mediaType,
|
|
74
|
-
filename
|
|
74
|
+
filename,
|
|
75
|
+
abortSignal,
|
|
76
|
+
headers
|
|
75
77
|
}) {
|
|
76
78
|
var _a, _b;
|
|
77
79
|
const fileBytes = convertInlineFileDataToUint8Array(data);
|
|
@@ -84,14 +86,17 @@ var AnthropicFiles = class {
|
|
|
84
86
|
}
|
|
85
87
|
const { value: response } = await postFormDataToApi({
|
|
86
88
|
url: `${this.config.baseURL}/files`,
|
|
87
|
-
headers: combineHeaders(
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
headers: combineHeaders(
|
|
90
|
+
this.config.headers(),
|
|
91
|
+
{ "anthropic-beta": "files-api-2025-04-14" },
|
|
92
|
+
headers
|
|
93
|
+
),
|
|
90
94
|
formData,
|
|
91
95
|
failedResponseHandler: anthropicFailedResponseHandler,
|
|
92
96
|
successfulResponseHandler: createJsonResponseHandler(
|
|
93
97
|
anthropicUploadFileResponseSchema
|
|
94
98
|
),
|
|
99
|
+
abortSignal,
|
|
95
100
|
fetch: this.config.fetch
|
|
96
101
|
});
|
|
97
102
|
return {
|
|
@@ -112,31 +117,31 @@ var AnthropicFiles = class {
|
|
|
112
117
|
}
|
|
113
118
|
};
|
|
114
119
|
|
|
115
|
-
// src/anthropic-
|
|
120
|
+
// src/anthropic-language-model.ts
|
|
116
121
|
import {
|
|
117
|
-
|
|
118
|
-
InvalidResponseDataError
|
|
119
|
-
UnsupportedFunctionalityError as UnsupportedFunctionalityError3
|
|
122
|
+
APICallError,
|
|
123
|
+
InvalidResponseDataError
|
|
120
124
|
} from "@ai-sdk/provider";
|
|
121
125
|
import {
|
|
122
|
-
combineHeaders as
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
126
|
+
combineHeaders as combineHeaders2,
|
|
127
|
+
createEventSourceResponseHandler,
|
|
128
|
+
createJsonResponseHandler as createJsonResponseHandler2,
|
|
129
|
+
createProviderStreamError,
|
|
130
|
+
createToolNameMapping,
|
|
131
|
+
generateId,
|
|
132
|
+
isCustomReasoning,
|
|
133
|
+
isProviderStreamError,
|
|
134
|
+
mapReasoningToProviderBudget,
|
|
135
|
+
mapReasoningToProviderEffort,
|
|
136
|
+
parseProviderOptions as parseProviderOptions2,
|
|
137
|
+
postJsonToApi,
|
|
138
|
+
resolve,
|
|
139
|
+
resolveProviderReference as resolveProviderReference2,
|
|
140
|
+
secureJsonParse as secureJsonParse2,
|
|
141
|
+
serializeModelOptions,
|
|
142
|
+
WORKFLOW_SERIALIZE,
|
|
143
|
+
WORKFLOW_DESERIALIZE
|
|
138
144
|
} from "@ai-sdk/provider-utils";
|
|
139
|
-
import { z as z15 } from "zod/v4";
|
|
140
145
|
|
|
141
146
|
// src/anthropic-api.ts
|
|
142
147
|
import {
|
|
@@ -223,6 +228,11 @@ var anthropicMcpToolResultContentSchema = z3.union([
|
|
|
223
228
|
])
|
|
224
229
|
)
|
|
225
230
|
]);
|
|
231
|
+
var anthropicInputTransformationSchema = z3.object({
|
|
232
|
+
type: z3.string(),
|
|
233
|
+
path: z3.string(),
|
|
234
|
+
reason: z3.string()
|
|
235
|
+
});
|
|
226
236
|
var anthropicResponseSchema = lazySchema3(
|
|
227
237
|
() => zodSchema3(
|
|
228
238
|
z3.object({
|
|
@@ -477,6 +487,7 @@ var anthropicResponseSchema = lazySchema3(
|
|
|
477
487
|
stop_reason: z3.string().nullish(),
|
|
478
488
|
stop_sequence: z3.string().nullish(),
|
|
479
489
|
stop_details: anthropicStopDetailsSchema.nullish(),
|
|
490
|
+
input_transformations: z3.array(anthropicInputTransformationSchema).nullish(),
|
|
480
491
|
usage: z3.looseObject({
|
|
481
492
|
input_tokens: z3.number(),
|
|
482
493
|
output_tokens: z3.number(),
|
|
@@ -561,6 +572,7 @@ var anthropicChunkSchema = lazySchema3(
|
|
|
561
572
|
])
|
|
562
573
|
).nullish(),
|
|
563
574
|
stop_reason: z3.string().nullish(),
|
|
575
|
+
input_transformations: z3.array(anthropicInputTransformationSchema).nullish(),
|
|
564
576
|
container: z3.object({
|
|
565
577
|
expires_at: z3.string(),
|
|
566
578
|
id: z3.string()
|
|
@@ -898,6 +910,7 @@ var anthropicChunkSchema = lazySchema3(
|
|
|
898
910
|
})
|
|
899
911
|
).nullish()
|
|
900
912
|
}),
|
|
913
|
+
input_transformations: z3.array(anthropicInputTransformationSchema).nullish(),
|
|
901
914
|
context_management: z3.object({
|
|
902
915
|
applied_edits: z3.array(
|
|
903
916
|
z3.union([
|
|
@@ -936,32 +949,6 @@ var anthropicReasoningMetadataSchema = lazySchema3(
|
|
|
936
949
|
)
|
|
937
950
|
);
|
|
938
951
|
|
|
939
|
-
// src/anthropic-language-model.ts
|
|
940
|
-
import {
|
|
941
|
-
APICallError,
|
|
942
|
-
InvalidResponseDataError
|
|
943
|
-
} from "@ai-sdk/provider";
|
|
944
|
-
import {
|
|
945
|
-
combineHeaders as combineHeaders2,
|
|
946
|
-
createEventSourceResponseHandler,
|
|
947
|
-
createJsonResponseHandler as createJsonResponseHandler2,
|
|
948
|
-
createProviderStreamError,
|
|
949
|
-
createToolNameMapping,
|
|
950
|
-
generateId,
|
|
951
|
-
isCustomReasoning,
|
|
952
|
-
isProviderStreamError,
|
|
953
|
-
mapReasoningToProviderBudget,
|
|
954
|
-
mapReasoningToProviderEffort,
|
|
955
|
-
parseProviderOptions as parseProviderOptions2,
|
|
956
|
-
postJsonToApi,
|
|
957
|
-
resolve,
|
|
958
|
-
resolveProviderReference as resolveProviderReference2,
|
|
959
|
-
secureJsonParse as secureJsonParse2,
|
|
960
|
-
serializeModelOptions,
|
|
961
|
-
WORKFLOW_SERIALIZE,
|
|
962
|
-
WORKFLOW_DESERIALIZE
|
|
963
|
-
} from "@ai-sdk/provider-utils";
|
|
964
|
-
|
|
965
952
|
// src/anthropic-language-model-options.ts
|
|
966
953
|
import { z as z4 } from "zod/v4";
|
|
967
954
|
var anthropicFilePartProviderOptions = z4.object({
|
|
@@ -993,6 +980,20 @@ var anthropicFilePartProviderOptions = z4.object({
|
|
|
993
980
|
context: z4.string().optional()
|
|
994
981
|
});
|
|
995
982
|
var anthropicSystemMessageProviderOptions = z4.object({
|
|
983
|
+
/**
|
|
984
|
+
* Controls when an ephemeral mid-conversation system message is cleared.
|
|
985
|
+
*
|
|
986
|
+
* Only supported on system messages that appear mid-conversation.
|
|
987
|
+
* The required `mid-conversation-system-clear-at-2026-08-21` beta is
|
|
988
|
+
* added automatically.
|
|
989
|
+
*/
|
|
990
|
+
clearAt: z4.literal("next_user_message").optional(),
|
|
991
|
+
/**
|
|
992
|
+
* Sets the model effort for the turn that follows this mid-conversation
|
|
993
|
+
* system message. The required `mid-conversation-effort-2026-08-01` beta
|
|
994
|
+
* is added automatically.
|
|
995
|
+
*/
|
|
996
|
+
effort: z4.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
996
997
|
/**
|
|
997
998
|
* Mid-conversation tool changes. Adds or removes tools from the
|
|
998
999
|
* conversation's tool set between turns without invalidating the prompt
|
|
@@ -1041,24 +1042,40 @@ var anthropicLanguageModelOptions = z4.object({
|
|
|
1041
1042
|
* When enabled, responses include thinking content blocks showing Claude's thinking process before the final answer.
|
|
1042
1043
|
* Requires a minimum budget of 1,024 tokens and counts towards the `max_tokens` limit.
|
|
1043
1044
|
*/
|
|
1044
|
-
thinking: z4.
|
|
1045
|
-
z4.
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1045
|
+
thinking: z4.union([
|
|
1046
|
+
z4.discriminatedUnion("type", [
|
|
1047
|
+
z4.object({
|
|
1048
|
+
/** for Sonnet 4.6, Opus 4.6, and newer models */
|
|
1049
|
+
type: z4.literal("adaptive"),
|
|
1050
|
+
/**
|
|
1051
|
+
* Controls whether thinking content is included in the response.
|
|
1052
|
+
* - `"omitted"`: Thinking blocks are present but text is empty (default for Opus 4.7+).
|
|
1053
|
+
* - `"summarized"`: Thinking content is returned.
|
|
1054
|
+
* - `"updates"`: Thinking updates are returned between tool calls.
|
|
1055
|
+
*/
|
|
1056
|
+
display: z4.enum(["omitted", "summarized", "updates"]).optional(),
|
|
1057
|
+
/**
|
|
1058
|
+
* Controls how thinking blocks are bound to an existing thinking
|
|
1059
|
+
* prefix. Requires the `thinking-binding-controls-2026-08-01` beta.
|
|
1060
|
+
*/
|
|
1061
|
+
blockBinding: z4.object({
|
|
1062
|
+
prefixMismatchBehavior: z4.enum(["error", "drop_block"])
|
|
1063
|
+
}).optional()
|
|
1064
|
+
}),
|
|
1065
|
+
z4.object({
|
|
1066
|
+
/** for models before Opus 4.6, except Sonnet 4.6 still supports it */
|
|
1067
|
+
type: z4.literal("enabled"),
|
|
1068
|
+
budgetTokens: z4.number().optional()
|
|
1069
|
+
}),
|
|
1070
|
+
z4.object({
|
|
1071
|
+
type: z4.literal("disabled")
|
|
1072
|
+
})
|
|
1073
|
+
]),
|
|
1060
1074
|
z4.object({
|
|
1061
|
-
type: z4.
|
|
1075
|
+
type: z4.never().optional(),
|
|
1076
|
+
blockBinding: z4.object({
|
|
1077
|
+
prefixMismatchBehavior: z4.enum(["error", "drop_block"])
|
|
1078
|
+
})
|
|
1062
1079
|
})
|
|
1063
1080
|
]).optional(),
|
|
1064
1081
|
/**
|
|
@@ -2475,8 +2492,7 @@ async function convertToAnthropicPrompt({
|
|
|
2475
2492
|
const type = block.type;
|
|
2476
2493
|
switch (type) {
|
|
2477
2494
|
case "system": {
|
|
2478
|
-
const
|
|
2479
|
-
let toolChangeCount = 0;
|
|
2495
|
+
const convertedMessages = [];
|
|
2480
2496
|
for (const { content: text, providerOptions } of block.messages) {
|
|
2481
2497
|
const systemMessageOptions = await parseProviderOptions({
|
|
2482
2498
|
provider: "anthropic",
|
|
@@ -2484,7 +2500,8 @@ async function convertToAnthropicPrompt({
|
|
|
2484
2500
|
schema: anthropicSystemMessageProviderOptions
|
|
2485
2501
|
});
|
|
2486
2502
|
const toolChanges = (_a = systemMessageOptions == null ? void 0 : systemMessageOptions.toolChanges) != null ? _a : [];
|
|
2487
|
-
|
|
2503
|
+
const content = [];
|
|
2504
|
+
if (text !== "" || toolChanges.length === 0 && (systemMessageOptions == null ? void 0 : systemMessageOptions.clearAt) == null && (systemMessageOptions == null ? void 0 : systemMessageOptions.effort) == null) {
|
|
2488
2505
|
content.push({
|
|
2489
2506
|
type: "text",
|
|
2490
2507
|
text,
|
|
@@ -2495,7 +2512,6 @@ async function convertToAnthropicPrompt({
|
|
|
2495
2512
|
});
|
|
2496
2513
|
}
|
|
2497
2514
|
for (const toolChange of toolChanges) {
|
|
2498
|
-
toolChangeCount++;
|
|
2499
2515
|
content.push({
|
|
2500
2516
|
type: toolChange.type,
|
|
2501
2517
|
tool: {
|
|
@@ -2504,22 +2520,60 @@ async function convertToAnthropicPrompt({
|
|
|
2504
2520
|
}
|
|
2505
2521
|
});
|
|
2506
2522
|
}
|
|
2523
|
+
convertedMessages.push({
|
|
2524
|
+
content,
|
|
2525
|
+
clearAt: systemMessageOptions == null ? void 0 : systemMessageOptions.clearAt,
|
|
2526
|
+
effort: systemMessageOptions == null ? void 0 : systemMessageOptions.effort,
|
|
2527
|
+
toolChangeCount: toolChanges.length
|
|
2528
|
+
});
|
|
2507
2529
|
}
|
|
2508
|
-
|
|
2530
|
+
const toolChangeCount = convertedMessages.reduce(
|
|
2531
|
+
(count, message) => count + message.toolChangeCount,
|
|
2532
|
+
0
|
|
2533
|
+
);
|
|
2534
|
+
const hasInlineSystemOptions = convertedMessages.some(
|
|
2535
|
+
(message) => message.clearAt != null || message.effort != null
|
|
2536
|
+
);
|
|
2537
|
+
if (i === 0 || system == null && toolChangeCount === 0 && !hasInlineSystemOptions) {
|
|
2509
2538
|
if (toolChangeCount > 0) {
|
|
2510
2539
|
warnings.push({
|
|
2511
2540
|
type: "other",
|
|
2512
2541
|
message: "tool changes on the initial system message are not supported by Anthropic. Configure the initial tool set via the tools option instead. The tool changes have been ignored."
|
|
2513
2542
|
});
|
|
2514
2543
|
}
|
|
2515
|
-
|
|
2516
|
-
(
|
|
2544
|
+
for (const message of convertedMessages) {
|
|
2545
|
+
if (message.clearAt != null || message.effort != null) {
|
|
2546
|
+
warnings.push({
|
|
2547
|
+
type: "other",
|
|
2548
|
+
message: "clearAt and effort on the initial system message are not supported by Anthropic. These options have been ignored."
|
|
2549
|
+
});
|
|
2550
|
+
}
|
|
2551
|
+
}
|
|
2552
|
+
system = convertedMessages.flatMap(
|
|
2553
|
+
(message) => message.content.filter(
|
|
2554
|
+
(part) => part.type === "text"
|
|
2555
|
+
)
|
|
2517
2556
|
);
|
|
2518
2557
|
} else {
|
|
2519
|
-
messages.push({ role: "system", content });
|
|
2520
2558
|
betas.add("mid-conversation-system-2026-04-07");
|
|
2521
|
-
|
|
2522
|
-
|
|
2559
|
+
for (const message of convertedMessages) {
|
|
2560
|
+
messages.push({
|
|
2561
|
+
role: "system",
|
|
2562
|
+
content: message.content,
|
|
2563
|
+
...message.clearAt != null && { clear_at: message.clearAt },
|
|
2564
|
+
...message.effort != null && {
|
|
2565
|
+
output_config: { effort: message.effort }
|
|
2566
|
+
}
|
|
2567
|
+
});
|
|
2568
|
+
if (message.toolChangeCount > 0) {
|
|
2569
|
+
betas.add("mid-conversation-tool-changes-2026-07-01");
|
|
2570
|
+
}
|
|
2571
|
+
if (message.clearAt != null) {
|
|
2572
|
+
betas.add("mid-conversation-system-clear-at-2026-08-21");
|
|
2573
|
+
}
|
|
2574
|
+
if (message.effort != null) {
|
|
2575
|
+
betas.add("mid-conversation-effort-2026-08-01");
|
|
2576
|
+
}
|
|
2523
2577
|
}
|
|
2524
2578
|
}
|
|
2525
2579
|
break;
|
|
@@ -3660,13 +3714,13 @@ function getAnthropicStreamErrorMetadata(type) {
|
|
|
3660
3714
|
return {};
|
|
3661
3715
|
}
|
|
3662
3716
|
}
|
|
3663
|
-
function createCitationSource(citation, citationDocuments,
|
|
3717
|
+
function createCitationSource(citation, citationDocuments, generateId4) {
|
|
3664
3718
|
var _a, _b;
|
|
3665
3719
|
if (citation.type === "web_search_result_location") {
|
|
3666
3720
|
return {
|
|
3667
3721
|
type: "source",
|
|
3668
3722
|
sourceType: "url",
|
|
3669
|
-
id:
|
|
3723
|
+
id: generateId4(),
|
|
3670
3724
|
url: citation.url,
|
|
3671
3725
|
title: (_a = citation.title) != null ? _a : void 0,
|
|
3672
3726
|
providerMetadata: {
|
|
@@ -3687,7 +3741,7 @@ function createCitationSource(citation, citationDocuments, generateId3) {
|
|
|
3687
3741
|
return {
|
|
3688
3742
|
type: "source",
|
|
3689
3743
|
sourceType: "document",
|
|
3690
|
-
id:
|
|
3744
|
+
id: generateId4(),
|
|
3691
3745
|
mediaType: documentInfo.mediaType,
|
|
3692
3746
|
title: (_b = citation.document_title) != null ? _b : documentInfo.title,
|
|
3693
3747
|
filename: documentInfo.filename,
|
|
@@ -3714,6 +3768,10 @@ function getAnthropicCallerMetadata(caller) {
|
|
|
3714
3768
|
const callerInfo = getAnthropicCallerInfo(caller);
|
|
3715
3769
|
return callerInfo == null ? {} : { providerMetadata: { anthropic: { caller: callerInfo } } };
|
|
3716
3770
|
}
|
|
3771
|
+
function getProviderOptionsName(provider) {
|
|
3772
|
+
const dotIndex = provider.indexOf(".");
|
|
3773
|
+
return dotIndex === -1 ? provider : provider.substring(0, dotIndex);
|
|
3774
|
+
}
|
|
3717
3775
|
var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
3718
3776
|
constructor(modelId, config) {
|
|
3719
3777
|
this.specificationVersion = "v4";
|
|
@@ -3737,36 +3795,31 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
3737
3795
|
get provider() {
|
|
3738
3796
|
return this.config.provider;
|
|
3739
3797
|
}
|
|
3740
|
-
/**
|
|
3741
|
-
* Extracts the dynamic provider name from the config.provider string.
|
|
3742
|
-
* e.g., 'my-custom-anthropic.messages' -> 'my-custom-anthropic'
|
|
3743
|
-
*/
|
|
3744
|
-
get providerOptionsName() {
|
|
3745
|
-
const provider = this.config.provider;
|
|
3746
|
-
const dotIndex = provider.indexOf(".");
|
|
3747
|
-
return dotIndex === -1 ? provider : provider.substring(0, dotIndex);
|
|
3748
|
-
}
|
|
3749
3798
|
get supportedUrls() {
|
|
3750
3799
|
var _a, _b, _c;
|
|
3751
3800
|
return (_c = (_b = (_a = this.config).supportedUrls) == null ? void 0 : _b.call(_a)) != null ? _c : {};
|
|
3752
3801
|
}
|
|
3753
|
-
async
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3802
|
+
static async prepareRequest({
|
|
3803
|
+
modelId,
|
|
3804
|
+
config,
|
|
3805
|
+
options: {
|
|
3806
|
+
userSuppliedBetas,
|
|
3807
|
+
prompt,
|
|
3808
|
+
maxOutputTokens,
|
|
3809
|
+
temperature,
|
|
3810
|
+
topP,
|
|
3811
|
+
topK,
|
|
3812
|
+
frequencyPenalty,
|
|
3813
|
+
presencePenalty,
|
|
3814
|
+
stopSequences,
|
|
3815
|
+
responseFormat,
|
|
3816
|
+
seed,
|
|
3817
|
+
tools,
|
|
3818
|
+
toolChoice,
|
|
3819
|
+
reasoning,
|
|
3820
|
+
providerOptions,
|
|
3821
|
+
stream
|
|
3822
|
+
}
|
|
3770
3823
|
}) {
|
|
3771
3824
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
3772
3825
|
const warnings = [];
|
|
@@ -3803,7 +3856,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
3803
3856
|
});
|
|
3804
3857
|
}
|
|
3805
3858
|
}
|
|
3806
|
-
const providerOptionsName =
|
|
3859
|
+
const providerOptionsName = getProviderOptionsName(config.provider);
|
|
3807
3860
|
const canonicalOptions = await parseProviderOptions2({
|
|
3808
3861
|
provider: "anthropic",
|
|
3809
3862
|
providerOptions,
|
|
@@ -3828,12 +3881,12 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
3828
3881
|
supportsXhighEffort,
|
|
3829
3882
|
rejectsThinkingDisabledAboveHighEffort,
|
|
3830
3883
|
isKnownModel
|
|
3831
|
-
} = getModelCapabilities(
|
|
3884
|
+
} = getModelCapabilities(modelId);
|
|
3832
3885
|
if (!isKnownModel && maxOutputTokens == null) {
|
|
3833
3886
|
warnings.push({
|
|
3834
3887
|
type: "compatibility",
|
|
3835
3888
|
feature: "maxOutputTokens",
|
|
3836
|
-
details: `The model "${
|
|
3889
|
+
details: `The model "${modelId}" is unknown. The max output tokens have been limited to ${maxOutputTokensForModel}. Set maxOutputTokens explicitly to override this limit.`
|
|
3837
3890
|
});
|
|
3838
3891
|
}
|
|
3839
3892
|
if (rejectsSamplingParameters) {
|
|
@@ -3841,7 +3894,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
3841
3894
|
warnings.push({
|
|
3842
3895
|
type: "unsupported",
|
|
3843
3896
|
feature: "temperature",
|
|
3844
|
-
details: `temperature is not supported by ${
|
|
3897
|
+
details: `temperature is not supported by ${modelId} and will be ignored`
|
|
3845
3898
|
});
|
|
3846
3899
|
temperature = void 0;
|
|
3847
3900
|
}
|
|
@@ -3849,7 +3902,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
3849
3902
|
warnings.push({
|
|
3850
3903
|
type: "unsupported",
|
|
3851
3904
|
feature: "topK",
|
|
3852
|
-
details: `topK is not supported by ${
|
|
3905
|
+
details: `topK is not supported by ${modelId} and will be ignored`
|
|
3853
3906
|
});
|
|
3854
3907
|
topK = void 0;
|
|
3855
3908
|
}
|
|
@@ -3857,14 +3910,14 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
3857
3910
|
warnings.push({
|
|
3858
3911
|
type: "unsupported",
|
|
3859
3912
|
feature: "topP",
|
|
3860
|
-
details: `topP is not supported by ${
|
|
3913
|
+
details: `topP is not supported by ${modelId} and will be ignored`
|
|
3861
3914
|
});
|
|
3862
3915
|
topP = void 0;
|
|
3863
3916
|
}
|
|
3864
3917
|
}
|
|
3865
|
-
const isAnthropicModel = isKnownModel ||
|
|
3866
|
-
const supportsStructuredOutput = ((_a =
|
|
3867
|
-
const supportsStrictTools = ((_b =
|
|
3918
|
+
const isAnthropicModel = isKnownModel || modelId.includes("claude-");
|
|
3919
|
+
const supportsStructuredOutput = ((_a = config.supportsNativeStructuredOutput) != null ? _a : true) && modelSupportsStructuredOutput;
|
|
3920
|
+
const supportsStrictTools = ((_b = config.supportsStrictTools) != null ? _b : true) && modelSupportsStructuredOutput;
|
|
3868
3921
|
const structureOutputMode = (_c = anthropicOptions == null ? void 0 : anthropicOptions.structuredOutputMode) != null ? _c : "auto";
|
|
3869
3922
|
const useStructuredOutput = structureOutputMode === "outputFormat" || structureOutputMode === "auto" && supportsStructuredOutput;
|
|
3870
3923
|
const jsonResponseTool = (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && !useStructuredOutput ? {
|
|
@@ -3934,19 +3987,20 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
3934
3987
|
warnings.push({
|
|
3935
3988
|
type: "unsupported",
|
|
3936
3989
|
feature: "providerOptions.anthropic.effort",
|
|
3937
|
-
details: `effort '${anthropicOptions.effort}' is not supported by ${
|
|
3990
|
+
details: `effort '${anthropicOptions.effort}' is not supported by ${modelId} when thinking is disabled. The effort has been lowered to 'high'.`
|
|
3938
3991
|
});
|
|
3939
3992
|
anthropicOptions.effort = "high";
|
|
3940
3993
|
}
|
|
3941
3994
|
const thinkingType = (_g = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _g.type;
|
|
3942
3995
|
const isThinking = thinkingType === "enabled" || thinkingType === "adaptive";
|
|
3943
|
-
const
|
|
3996
|
+
const thinkingBlockBinding = (anthropicOptions == null ? void 0 : anthropicOptions.thinking) != null && "blockBinding" in anthropicOptions.thinking ? anthropicOptions.thinking.blockBinding : void 0;
|
|
3997
|
+
const sendThinking = isThinking || thinkingType === "disabled" || thinkingBlockBinding != null;
|
|
3944
3998
|
let thinkingBudget = thinkingType === "enabled" ? (_h = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _h.budgetTokens : void 0;
|
|
3945
3999
|
const thinkingDisplay = thinkingType === "adaptive" ? (_i = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _i.display : void 0;
|
|
3946
4000
|
const maxTokens = maxOutputTokens != null ? maxOutputTokens : maxOutputTokensForModel;
|
|
3947
4001
|
const baseArgs = {
|
|
3948
4002
|
// model id:
|
|
3949
|
-
model:
|
|
4003
|
+
model: modelId,
|
|
3950
4004
|
// standardized settings:
|
|
3951
4005
|
max_tokens: maxTokens,
|
|
3952
4006
|
temperature,
|
|
@@ -3956,9 +4010,14 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
3956
4010
|
// provider specific settings:
|
|
3957
4011
|
...sendThinking && {
|
|
3958
4012
|
thinking: {
|
|
3959
|
-
type: thinkingType,
|
|
4013
|
+
...thinkingType != null && { type: thinkingType },
|
|
3960
4014
|
...thinkingBudget != null && { budget_tokens: thinkingBudget },
|
|
3961
|
-
...thinkingDisplay != null && { display: thinkingDisplay }
|
|
4015
|
+
...thinkingDisplay != null && { display: thinkingDisplay },
|
|
4016
|
+
...thinkingBlockBinding != null && {
|
|
4017
|
+
block_binding: {
|
|
4018
|
+
prefix_mismatch_behavior: thinkingBlockBinding.prefixMismatchBehavior
|
|
4019
|
+
}
|
|
4020
|
+
}
|
|
3962
4021
|
}
|
|
3963
4022
|
},
|
|
3964
4023
|
...((anthropicOptions == null ? void 0 : anthropicOptions.effort) || (anthropicOptions == null ? void 0 : anthropicOptions.taskBudget) || useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null) && {
|
|
@@ -4141,7 +4200,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4141
4200
|
warnings.push({
|
|
4142
4201
|
type: "unsupported",
|
|
4143
4202
|
feature: "maxOutputTokens",
|
|
4144
|
-
details: `${baseArgs.max_tokens} (maxOutputTokens + thinkingBudget) is greater than ${
|
|
4203
|
+
details: `${baseArgs.max_tokens} (maxOutputTokens + thinkingBudget) is greater than ${modelId} ${maxOutputTokensForModel} max output tokens. The max output tokens have been limited to ${maxOutputTokensForModel}.`
|
|
4145
4204
|
});
|
|
4146
4205
|
}
|
|
4147
4206
|
baseArgs.max_tokens = maxOutputTokensForModel;
|
|
@@ -4174,6 +4233,12 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4174
4233
|
if ((anthropicOptions == null ? void 0 : anthropicOptions.speed) === "fast") {
|
|
4175
4234
|
betas.add("fast-mode-2026-02-01");
|
|
4176
4235
|
}
|
|
4236
|
+
if (thinkingDisplay === "updates") {
|
|
4237
|
+
betas.add("thinking-display-updates-2026-08-18");
|
|
4238
|
+
}
|
|
4239
|
+
if (thinkingBlockBinding != null) {
|
|
4240
|
+
betas.add("thinking-binding-controls-2026-08-01");
|
|
4241
|
+
}
|
|
4177
4242
|
if ((anthropicOptions == null ? void 0 : anthropicOptions.fallbacks) === "default") {
|
|
4178
4243
|
betas.add("server-side-fallback-2026-07-01");
|
|
4179
4244
|
} else if ((anthropicOptions == null ? void 0 : anthropicOptions.fallbacks) && anthropicOptions.fallbacks.length > 0) {
|
|
@@ -4226,6 +4291,13 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4226
4291
|
usedCustomProviderKey
|
|
4227
4292
|
};
|
|
4228
4293
|
}
|
|
4294
|
+
getArgs(options) {
|
|
4295
|
+
return _AnthropicLanguageModel.prepareRequest({
|
|
4296
|
+
modelId: this.modelId,
|
|
4297
|
+
config: this.config,
|
|
4298
|
+
options
|
|
4299
|
+
});
|
|
4300
|
+
}
|
|
4229
4301
|
async getHeaders({
|
|
4230
4302
|
betas,
|
|
4231
4303
|
headers
|
|
@@ -4758,6 +4830,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4758
4830
|
usage: response.usage,
|
|
4759
4831
|
stopSequence: (_a2 = response.stop_sequence) != null ? _a2 : null,
|
|
4760
4832
|
...stopDetails != null ? { stopDetails } : {},
|
|
4833
|
+
...response.input_transformations != null ? { inputTransformations: response.input_transformations } : {},
|
|
4761
4834
|
iterations: response.usage.iterations ? response.usage.iterations.map(
|
|
4762
4835
|
(iter) => ({
|
|
4763
4836
|
type: iter.type,
|
|
@@ -4845,13 +4918,14 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
4845
4918
|
let rawUsage = void 0;
|
|
4846
4919
|
let stopSequence = null;
|
|
4847
4920
|
let stopDetails = void 0;
|
|
4921
|
+
let inputTransformations;
|
|
4848
4922
|
let container = null;
|
|
4849
4923
|
let isJsonResponseFromTool = false;
|
|
4850
4924
|
let isMessageOpen = false;
|
|
4851
4925
|
let activeMessageId;
|
|
4852
4926
|
let hasInvalidMessageSequence = false;
|
|
4853
4927
|
let blockType = void 0;
|
|
4854
|
-
const
|
|
4928
|
+
const generateId4 = this.generateId;
|
|
4855
4929
|
const transformedStream = response.pipeThrough(
|
|
4856
4930
|
new TransformStream({
|
|
4857
4931
|
start(controller) {
|
|
@@ -5114,7 +5188,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5114
5188
|
controller.enqueue({
|
|
5115
5189
|
type: "source",
|
|
5116
5190
|
sourceType: "url",
|
|
5117
|
-
id:
|
|
5191
|
+
id: generateId4(),
|
|
5118
5192
|
url: result.url,
|
|
5119
5193
|
...result.title != null ? { title: result.title } : {},
|
|
5120
5194
|
providerMetadata: {
|
|
@@ -5476,7 +5550,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5476
5550
|
const source = createCitationSource(
|
|
5477
5551
|
citation,
|
|
5478
5552
|
citationDocuments,
|
|
5479
|
-
|
|
5553
|
+
generateId4
|
|
5480
5554
|
);
|
|
5481
5555
|
if (source) {
|
|
5482
5556
|
controller.enqueue(source);
|
|
@@ -5514,6 +5588,9 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5514
5588
|
rawUsage = {
|
|
5515
5589
|
...value.message.usage
|
|
5516
5590
|
};
|
|
5591
|
+
if (value.message.input_transformations != null) {
|
|
5592
|
+
inputTransformations = value.message.input_transformations;
|
|
5593
|
+
}
|
|
5517
5594
|
if (value.message.container != null) {
|
|
5518
5595
|
container = {
|
|
5519
5596
|
expiresAt: value.message.container.expires_at,
|
|
@@ -5613,6 +5690,9 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5613
5690
|
value.context_management
|
|
5614
5691
|
);
|
|
5615
5692
|
}
|
|
5693
|
+
if (value.input_transformations != null) {
|
|
5694
|
+
inputTransformations = value.input_transformations;
|
|
5695
|
+
}
|
|
5616
5696
|
rawUsage = {
|
|
5617
5697
|
...rawUsage,
|
|
5618
5698
|
...value.usage
|
|
@@ -5626,6 +5706,7 @@ var AnthropicLanguageModel = class _AnthropicLanguageModel {
|
|
|
5626
5706
|
usage: rawUsage != null ? rawUsage : null,
|
|
5627
5707
|
stopSequence,
|
|
5628
5708
|
...stopDetails != null ? { stopDetails } : {},
|
|
5709
|
+
...inputTransformations != null ? { inputTransformations } : {},
|
|
5629
5710
|
iterations: usage.iterations ? usage.iterations.map(
|
|
5630
5711
|
(iter) => ({
|
|
5631
5712
|
type: iter.type,
|
|
@@ -5758,7 +5839,7 @@ function getModelCapabilities(modelId) {
|
|
|
5758
5839
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
5759
5840
|
isKnownModel: true
|
|
5760
5841
|
};
|
|
5761
|
-
} else if (
|
|
5842
|
+
} else if (/claude-sonnet-4(?:-|@)/.test(modelId)) {
|
|
5762
5843
|
return {
|
|
5763
5844
|
maxOutputTokens: 64e3,
|
|
5764
5845
|
supportsStructuredOutput: false,
|
|
@@ -5768,7 +5849,7 @@ function getModelCapabilities(modelId) {
|
|
|
5768
5849
|
rejectsThinkingDisabledAboveHighEffort: false,
|
|
5769
5850
|
isKnownModel: true
|
|
5770
5851
|
};
|
|
5771
|
-
} else if (
|
|
5852
|
+
} else if (/claude-opus-4(?:-|@)/.test(modelId)) {
|
|
5772
5853
|
return {
|
|
5773
5854
|
maxOutputTokens: 32e3,
|
|
5774
5855
|
supportsStructuredOutput: false,
|
|
@@ -5916,30 +5997,61 @@ function mapAnthropicStopDetails(stopDetails) {
|
|
|
5916
5997
|
};
|
|
5917
5998
|
}
|
|
5918
5999
|
|
|
5919
|
-
// src/anthropic-
|
|
6000
|
+
// src/anthropic-batch.ts
|
|
6001
|
+
import {
|
|
6002
|
+
InvalidArgumentError,
|
|
6003
|
+
InvalidResponseDataError as InvalidResponseDataError2,
|
|
6004
|
+
UnsupportedFunctionalityError as UnsupportedFunctionalityError3
|
|
6005
|
+
} from "@ai-sdk/provider";
|
|
6006
|
+
import {
|
|
6007
|
+
combineHeaders as combineHeaders3,
|
|
6008
|
+
convertAsyncIteratorToReadableStream,
|
|
6009
|
+
createJsonLinesResponseHandler,
|
|
6010
|
+
createJsonResponseHandler as createJsonResponseHandler3,
|
|
6011
|
+
generateId as generateId2,
|
|
6012
|
+
getFromApi,
|
|
6013
|
+
isRecord as isRecord2,
|
|
6014
|
+
lazySchema as lazySchema14,
|
|
6015
|
+
normalizeBatchRequestCounts,
|
|
6016
|
+
normalizeHeaders,
|
|
6017
|
+
parseProviderOptions as parseProviderOptions3,
|
|
6018
|
+
postJsonToApi as postJsonToApi2,
|
|
6019
|
+
resolve as resolve2,
|
|
6020
|
+
safeValidateTypes,
|
|
6021
|
+
zodSchema as zodSchema14
|
|
6022
|
+
} from "@ai-sdk/provider-utils";
|
|
6023
|
+
import { z as z15 } from "zod/v4";
|
|
5920
6024
|
var anthropicBatchRequestIdPattern = /^[A-Za-z0-9_-]{1,64}$/;
|
|
5921
6025
|
var anthropicBatchProviderOptionsSchema = anthropicLanguageModelOptions.pick({
|
|
5922
6026
|
anthropicBeta: true
|
|
5923
6027
|
});
|
|
6028
|
+
var anthropicBatchResponseZodSchema = () => z15.object({
|
|
6029
|
+
id: z15.string(),
|
|
6030
|
+
type: z15.literal("message_batch"),
|
|
6031
|
+
processing_status: z15.string(),
|
|
6032
|
+
request_counts: z15.object({
|
|
6033
|
+
processing: z15.number(),
|
|
6034
|
+
succeeded: z15.number(),
|
|
6035
|
+
errored: z15.number(),
|
|
6036
|
+
canceled: z15.number(),
|
|
6037
|
+
expired: z15.number()
|
|
6038
|
+
}),
|
|
6039
|
+
created_at: z15.string(),
|
|
6040
|
+
expires_at: z15.string(),
|
|
6041
|
+
archived_at: z15.string().nullish(),
|
|
6042
|
+
cancel_initiated_at: z15.string().nullish(),
|
|
6043
|
+
ended_at: z15.string().nullish(),
|
|
6044
|
+
results_url: z15.string().nullish()
|
|
6045
|
+
});
|
|
5924
6046
|
var anthropicBatchResponseSchema = lazySchema14(
|
|
6047
|
+
() => zodSchema14(anthropicBatchResponseZodSchema())
|
|
6048
|
+
);
|
|
6049
|
+
var anthropicBatchListResponseSchema = lazySchema14(
|
|
5925
6050
|
() => zodSchema14(
|
|
5926
6051
|
z15.object({
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
request_counts: z15.object({
|
|
5931
|
-
processing: z15.number(),
|
|
5932
|
-
succeeded: z15.number(),
|
|
5933
|
-
errored: z15.number(),
|
|
5934
|
-
canceled: z15.number(),
|
|
5935
|
-
expired: z15.number()
|
|
5936
|
-
}),
|
|
5937
|
-
created_at: z15.string(),
|
|
5938
|
-
expires_at: z15.string(),
|
|
5939
|
-
archived_at: z15.string().nullish(),
|
|
5940
|
-
cancel_initiated_at: z15.string().nullish(),
|
|
5941
|
-
ended_at: z15.string().nullish(),
|
|
5942
|
-
results_url: z15.string().nullish()
|
|
6052
|
+
data: z15.array(anthropicBatchResponseZodSchema()),
|
|
6053
|
+
has_more: z15.boolean(),
|
|
6054
|
+
last_id: z15.string().nullish()
|
|
5943
6055
|
})
|
|
5944
6056
|
)
|
|
5945
6057
|
);
|
|
@@ -5993,31 +6105,39 @@ var anthropicBatchResultLineSchema = lazySchema14(
|
|
|
5993
6105
|
})
|
|
5994
6106
|
)
|
|
5995
6107
|
);
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6108
|
+
function assertTextBatchRequests(requests) {
|
|
6109
|
+
for (const request of requests) {
|
|
6110
|
+
const requestType = request.type;
|
|
6111
|
+
if (requestType !== "text") {
|
|
6112
|
+
throw new UnsupportedFunctionalityError3({
|
|
6113
|
+
functionality: `batch request type: ${requestType}`,
|
|
6114
|
+
message: `The Anthropic Message Batches API does not support batch requests with type "${requestType}".`
|
|
6115
|
+
});
|
|
6116
|
+
}
|
|
6005
6117
|
}
|
|
6006
|
-
|
|
6007
|
-
|
|
6118
|
+
}
|
|
6119
|
+
var AnthropicBatch = class {
|
|
6120
|
+
constructor(options) {
|
|
6121
|
+
this.options = options;
|
|
6122
|
+
this.specificationVersion = "v4";
|
|
6123
|
+
var _a;
|
|
6124
|
+
this.provider = options.provider;
|
|
6125
|
+
this.supportedUrls = options.supportedUrls;
|
|
6126
|
+
this.generateId = (_a = options.config.generateId) != null ? _a : generateId2;
|
|
6008
6127
|
}
|
|
6009
|
-
async
|
|
6128
|
+
async doStartBatch({
|
|
6010
6129
|
requests,
|
|
6011
6130
|
providerOptions,
|
|
6012
6131
|
headers,
|
|
6013
6132
|
abortSignal,
|
|
6014
6133
|
webhookUrl
|
|
6015
6134
|
}) {
|
|
6016
|
-
var _a;
|
|
6135
|
+
var _a, _b, _c, _d;
|
|
6136
|
+
assertTextBatchRequests(requests);
|
|
6017
6137
|
validateRequestIds(requests);
|
|
6018
6138
|
const explicitBatchBetas = new Set(
|
|
6019
6139
|
await getAnthropicBatchProviderBetas({
|
|
6020
|
-
provider: this.config.provider,
|
|
6140
|
+
provider: this.options.config.provider,
|
|
6021
6141
|
providerOptions
|
|
6022
6142
|
})
|
|
6023
6143
|
);
|
|
@@ -6034,19 +6154,23 @@ var AnthropicMessagesBatchLanguageModel = class _AnthropicMessagesBatchLanguageM
|
|
|
6034
6154
|
];
|
|
6035
6155
|
for (const request of requests) {
|
|
6036
6156
|
const requestBetas = await getAnthropicBatchProviderBetas({
|
|
6037
|
-
provider: this.config.provider,
|
|
6157
|
+
provider: this.options.config.provider,
|
|
6038
6158
|
providerOptions: request.options.providerOptions
|
|
6039
6159
|
});
|
|
6040
6160
|
if (requestBetas.length > 0) {
|
|
6041
6161
|
throw new UnsupportedFunctionalityError3({
|
|
6042
6162
|
functionality: "per-request providerOptions.anthropic.anthropicBeta",
|
|
6043
|
-
message: `Anthropic Message Batches do not support per-request betas (request "${request.id}"). Set providerOptions.anthropic.anthropicBeta on
|
|
6163
|
+
message: `Anthropic Message Batches do not support per-request betas (request "${request.id}"). Set providerOptions.anthropic.anthropicBeta on startBatch instead.`
|
|
6044
6164
|
});
|
|
6045
6165
|
}
|
|
6046
|
-
const prepared = await
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6166
|
+
const prepared = await AnthropicLanguageModel.prepareRequest({
|
|
6167
|
+
modelId: request.modelId,
|
|
6168
|
+
config: this.options.config,
|
|
6169
|
+
options: {
|
|
6170
|
+
...request.options,
|
|
6171
|
+
stream: false,
|
|
6172
|
+
userSuppliedBetas: new Set(explicitBatchBetas)
|
|
6173
|
+
}
|
|
6050
6174
|
});
|
|
6051
6175
|
if (prepared.usesJsonResponseTool) {
|
|
6052
6176
|
throw new UnsupportedFunctionalityError3({
|
|
@@ -6063,7 +6187,11 @@ var AnthropicMessagesBatchLanguageModel = class _AnthropicMessagesBatchLanguageM
|
|
|
6063
6187
|
message: `Anthropic Message Batches cannot restore the custom provider-tool name "${aliasedProviderTool.name}" when results are retrieved independently of the start call (request "${request.id}"). Use the provider's canonical tool name.`
|
|
6064
6188
|
});
|
|
6065
6189
|
}
|
|
6066
|
-
const body = this.transformRequestBody
|
|
6190
|
+
const body = (_d = (_c = (_b = this.options.config).transformRequestBody) == null ? void 0 : _c.call(
|
|
6191
|
+
_b,
|
|
6192
|
+
prepared.args,
|
|
6193
|
+
prepared.betas
|
|
6194
|
+
)) != null ? _d : prepared.args;
|
|
6067
6195
|
validateAnthropicBatchBody({
|
|
6068
6196
|
body,
|
|
6069
6197
|
requestId: request.id
|
|
@@ -6085,7 +6213,7 @@ var AnthropicMessagesBatchLanguageModel = class _AnthropicMessagesBatchLanguageM
|
|
|
6085
6213
|
anthropicBatchResponseSchema
|
|
6086
6214
|
),
|
|
6087
6215
|
abortSignal,
|
|
6088
|
-
fetch: this.config.fetch
|
|
6216
|
+
fetch: this.options.config.fetch
|
|
6089
6217
|
});
|
|
6090
6218
|
return {
|
|
6091
6219
|
batchId: batch.id,
|
|
@@ -6093,10 +6221,51 @@ var AnthropicMessagesBatchLanguageModel = class _AnthropicMessagesBatchLanguageM
|
|
|
6093
6221
|
warnings: batchWarnings
|
|
6094
6222
|
};
|
|
6095
6223
|
}
|
|
6096
|
-
async
|
|
6224
|
+
async doGetBatchStatus(options) {
|
|
6097
6225
|
return convertAnthropicBatchStatus(await this.retrieveBatch(options));
|
|
6098
6226
|
}
|
|
6099
|
-
async
|
|
6227
|
+
async doCancelBatch(options) {
|
|
6228
|
+
await postJsonToApi2({
|
|
6229
|
+
url: this.getBatchUrl(`/${encodeURIComponent(options.batchId)}/cancel`),
|
|
6230
|
+
headers: await this.getBatchHeaders(options.headers),
|
|
6231
|
+
body: {},
|
|
6232
|
+
failedResponseHandler: anthropicFailedResponseHandler,
|
|
6233
|
+
successfulResponseHandler: createJsonResponseHandler3(
|
|
6234
|
+
anthropicBatchResponseSchema
|
|
6235
|
+
),
|
|
6236
|
+
abortSignal: options.abortSignal,
|
|
6237
|
+
fetch: this.options.config.fetch
|
|
6238
|
+
});
|
|
6239
|
+
return {};
|
|
6240
|
+
}
|
|
6241
|
+
async doListBatches(options) {
|
|
6242
|
+
const url = new URL(this.getBatchUrl(""));
|
|
6243
|
+
if (options.limit != null) {
|
|
6244
|
+
url.searchParams.set("limit", String(options.limit));
|
|
6245
|
+
}
|
|
6246
|
+
if (options.cursor != null) {
|
|
6247
|
+
url.searchParams.set("after_id", options.cursor);
|
|
6248
|
+
}
|
|
6249
|
+
const { value: page } = await getFromApi({
|
|
6250
|
+
url: url.toString(),
|
|
6251
|
+
validateUrl: false,
|
|
6252
|
+
headers: await this.getBatchHeaders(options.headers),
|
|
6253
|
+
failedResponseHandler: anthropicFailedResponseHandler,
|
|
6254
|
+
successfulResponseHandler: createJsonResponseHandler3(
|
|
6255
|
+
anthropicBatchListResponseSchema
|
|
6256
|
+
),
|
|
6257
|
+
abortSignal: options.abortSignal,
|
|
6258
|
+
fetch: this.options.config.fetch
|
|
6259
|
+
});
|
|
6260
|
+
return {
|
|
6261
|
+
batches: page.data.map((batch) => ({
|
|
6262
|
+
batchId: batch.id,
|
|
6263
|
+
...convertAnthropicBatchStatus(batch)
|
|
6264
|
+
})),
|
|
6265
|
+
...page.has_more && page.last_id != null ? { nextCursor: page.last_id } : {}
|
|
6266
|
+
};
|
|
6267
|
+
}
|
|
6268
|
+
async doGetBatchResults(options) {
|
|
6100
6269
|
const batch = await this.retrieveBatch(options);
|
|
6101
6270
|
if (convertAnthropicBatchStatus(batch).status === "pending") {
|
|
6102
6271
|
throw new InvalidArgumentError({
|
|
@@ -6119,15 +6288,15 @@ var AnthropicMessagesBatchLanguageModel = class _AnthropicMessagesBatchLanguageM
|
|
|
6119
6288
|
const { value: lines } = await getFromApi({
|
|
6120
6289
|
url: batch.results_url,
|
|
6121
6290
|
validateUrl: true,
|
|
6122
|
-
credentialedOrigin: this.config.baseURL,
|
|
6123
|
-
trustedOrigin: this.config.baseURL,
|
|
6291
|
+
credentialedOrigin: this.options.config.baseURL,
|
|
6292
|
+
trustedOrigin: this.options.config.baseURL,
|
|
6124
6293
|
headers: await this.getBatchHeaders(options.headers),
|
|
6125
6294
|
failedResponseHandler: anthropicFailedResponseHandler,
|
|
6126
6295
|
successfulResponseHandler: createJsonLinesResponseHandler(
|
|
6127
6296
|
anthropicBatchResultLineSchema
|
|
6128
6297
|
),
|
|
6129
6298
|
abortSignal: options.abortSignal,
|
|
6130
|
-
fetch: this.config.fetch
|
|
6299
|
+
fetch: this.options.config.fetch
|
|
6131
6300
|
});
|
|
6132
6301
|
return convertAsyncIteratorToReadableStream(
|
|
6133
6302
|
this.iterateBatchResults(lines)
|
|
@@ -6143,7 +6312,7 @@ var AnthropicMessagesBatchLanguageModel = class _AnthropicMessagesBatchLanguageM
|
|
|
6143
6312
|
anthropicBatchResponseSchema
|
|
6144
6313
|
),
|
|
6145
6314
|
abortSignal: options.abortSignal,
|
|
6146
|
-
fetch: this.config.fetch
|
|
6315
|
+
fetch: this.options.config.fetch
|
|
6147
6316
|
});
|
|
6148
6317
|
return batch;
|
|
6149
6318
|
}
|
|
@@ -6153,7 +6322,7 @@ var AnthropicMessagesBatchLanguageModel = class _AnthropicMessagesBatchLanguageM
|
|
|
6153
6322
|
}
|
|
6154
6323
|
}
|
|
6155
6324
|
getBatchUrl(path) {
|
|
6156
|
-
return `${this.config.baseURL}/messages/batches${path}`;
|
|
6325
|
+
return `${this.options.config.baseURL}/messages/batches${path}`;
|
|
6157
6326
|
}
|
|
6158
6327
|
async getStartBatchHeaders({
|
|
6159
6328
|
betas,
|
|
@@ -6168,7 +6337,7 @@ var AnthropicMessagesBatchLanguageModel = class _AnthropicMessagesBatchLanguageM
|
|
|
6168
6337
|
}
|
|
6169
6338
|
async getBatchHeaders(headers) {
|
|
6170
6339
|
return combineHeaders3(
|
|
6171
|
-
this.config.headers ? await resolve2(this.config.headers) : void 0,
|
|
6340
|
+
this.options.config.headers ? await resolve2(this.options.config.headers) : void 0,
|
|
6172
6341
|
headers
|
|
6173
6342
|
);
|
|
6174
6343
|
}
|
|
@@ -6271,7 +6440,7 @@ function convertAnthropicRequestCounts(counts) {
|
|
|
6271
6440
|
failed: counts.errored + counts.canceled + counts.expired
|
|
6272
6441
|
});
|
|
6273
6442
|
}
|
|
6274
|
-
async function convertAnthropicBatchResult(line,
|
|
6443
|
+
async function convertAnthropicBatchResult(line, generateId4) {
|
|
6275
6444
|
const resultValidation = await safeValidateTypes({
|
|
6276
6445
|
value: line.result,
|
|
6277
6446
|
schema: anthropicBatchResultSchema
|
|
@@ -6282,12 +6451,13 @@ async function convertAnthropicBatchResult(line, generateId3) {
|
|
|
6282
6451
|
const result = resultValidation.value;
|
|
6283
6452
|
switch (result.type) {
|
|
6284
6453
|
case "canceled":
|
|
6285
|
-
return { id: line.custom_id, status: "cancelled" };
|
|
6454
|
+
return { type: "text", id: line.custom_id, status: "cancelled" };
|
|
6286
6455
|
case "expired":
|
|
6287
|
-
return { id: line.custom_id, status: "expired" };
|
|
6456
|
+
return { type: "text", id: line.custom_id, status: "expired" };
|
|
6288
6457
|
case "errored": {
|
|
6289
6458
|
const requestId = result.error.request_id;
|
|
6290
6459
|
return {
|
|
6460
|
+
type: "text",
|
|
6291
6461
|
id: line.custom_id,
|
|
6292
6462
|
status: "failed",
|
|
6293
6463
|
error: {
|
|
@@ -6307,15 +6477,17 @@ async function convertAnthropicBatchResult(line, generateId3) {
|
|
|
6307
6477
|
return invalidAnthropicBatchResult(line.custom_id);
|
|
6308
6478
|
}
|
|
6309
6479
|
return {
|
|
6480
|
+
type: "text",
|
|
6310
6481
|
id: line.custom_id,
|
|
6311
6482
|
status: "succeeded",
|
|
6312
|
-
result: convertAnthropicBatchResponse(response,
|
|
6483
|
+
result: convertAnthropicBatchResponse(response, generateId4)
|
|
6313
6484
|
};
|
|
6314
6485
|
}
|
|
6315
6486
|
}
|
|
6316
6487
|
}
|
|
6317
6488
|
function invalidAnthropicBatchResult(id) {
|
|
6318
6489
|
return {
|
|
6490
|
+
type: "text",
|
|
6319
6491
|
id,
|
|
6320
6492
|
status: "failed",
|
|
6321
6493
|
error: {
|
|
@@ -6356,7 +6528,7 @@ async function parseAnthropicBatchResponse(message) {
|
|
|
6356
6528
|
});
|
|
6357
6529
|
return recovered.success ? recovered.value : void 0;
|
|
6358
6530
|
}
|
|
6359
|
-
function convertAnthropicBatchResponse(response,
|
|
6531
|
+
function convertAnthropicBatchResponse(response, generateId4) {
|
|
6360
6532
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
6361
6533
|
const content = [];
|
|
6362
6534
|
const mcpToolCalls = {};
|
|
@@ -6375,7 +6547,7 @@ function convertAnthropicBatchResponse(response, generateId3) {
|
|
|
6375
6547
|
}
|
|
6376
6548
|
});
|
|
6377
6549
|
for (const citation of (_a = part.citations) != null ? _a : []) {
|
|
6378
|
-
const source = createCitationSource(citation, [],
|
|
6550
|
+
const source = createCitationSource(citation, [], generateId4);
|
|
6379
6551
|
if (source != null) {
|
|
6380
6552
|
content.push(source);
|
|
6381
6553
|
}
|
|
@@ -6543,7 +6715,7 @@ function convertAnthropicBatchResponse(response, generateId3) {
|
|
|
6543
6715
|
content.push({
|
|
6544
6716
|
type: "source",
|
|
6545
6717
|
sourceType: "url",
|
|
6546
|
-
id:
|
|
6718
|
+
id: generateId4(),
|
|
6547
6719
|
url: result.url,
|
|
6548
6720
|
...result.title != null ? { title: result.title } : {},
|
|
6549
6721
|
providerMetadata: {
|
|
@@ -6677,6 +6849,7 @@ function convertAnthropicMessageMetadata(response) {
|
|
|
6677
6849
|
usage: response.usage,
|
|
6678
6850
|
stopSequence: (_a = response.stop_sequence) != null ? _a : null,
|
|
6679
6851
|
...stopDetails != null ? { stopDetails } : {},
|
|
6852
|
+
...response.input_transformations != null ? { inputTransformations: response.input_transformations } : {},
|
|
6680
6853
|
iterations: response.usage.iterations ? response.usage.iterations.map(
|
|
6681
6854
|
(iteration) => ({
|
|
6682
6855
|
type: iteration.type,
|
|
@@ -7479,7 +7652,7 @@ var AnthropicSkills = class {
|
|
|
7479
7652
|
};
|
|
7480
7653
|
|
|
7481
7654
|
// src/version.ts
|
|
7482
|
-
var VERSION = true ? "4.0.
|
|
7655
|
+
var VERSION = true ? "4.0.53" : "0.0.0-test";
|
|
7483
7656
|
|
|
7484
7657
|
// src/anthropic-provider.ts
|
|
7485
7658
|
var ANTHROPIC_API_URL = "https://api.anthropic.com";
|
|
@@ -7491,7 +7664,7 @@ function normalizeBaseURL(baseURL) {
|
|
|
7491
7664
|
return baseURLWithoutTrailingSlash === ANTHROPIC_API_URL ? ANTHROPIC_API_VERSIONED_URL : baseURLWithoutTrailingSlash;
|
|
7492
7665
|
}
|
|
7493
7666
|
function createAnthropic(options = {}) {
|
|
7494
|
-
var _a, _b;
|
|
7667
|
+
var _a, _b, _c;
|
|
7495
7668
|
const baseURL = (_a = normalizeBaseURL(
|
|
7496
7669
|
loadOptionalSetting({
|
|
7497
7670
|
settingValue: options.baseURL,
|
|
@@ -7499,6 +7672,10 @@ function createAnthropic(options = {}) {
|
|
|
7499
7672
|
})
|
|
7500
7673
|
)) != null ? _a : ANTHROPIC_API_VERSIONED_URL;
|
|
7501
7674
|
const providerName = (_b = options.name) != null ? _b : "anthropic.messages";
|
|
7675
|
+
const supportedUrls = {
|
|
7676
|
+
"image/*": [/^https?:\/\/.*$/],
|
|
7677
|
+
"application/pdf": [/^https?:\/\/.*$/]
|
|
7678
|
+
};
|
|
7502
7679
|
if (options.apiKey && options.authToken) {
|
|
7503
7680
|
throw new InvalidArgumentError2({
|
|
7504
7681
|
argument: "apiKey/authToken",
|
|
@@ -7522,20 +7699,20 @@ function createAnthropic(options = {}) {
|
|
|
7522
7699
|
`ai-sdk/anthropic/${VERSION}`
|
|
7523
7700
|
);
|
|
7524
7701
|
};
|
|
7525
|
-
const
|
|
7526
|
-
|
|
7527
|
-
|
|
7528
|
-
|
|
7529
|
-
|
|
7530
|
-
|
|
7531
|
-
|
|
7532
|
-
generateId: (_a2 = options.generateId) != null ? _a2 : generateId2,
|
|
7533
|
-
supportedUrls: () => ({
|
|
7534
|
-
"image/*": [/^https?:\/\/.*$/],
|
|
7535
|
-
"application/pdf": [/^https?:\/\/.*$/]
|
|
7536
|
-
})
|
|
7537
|
-
});
|
|
7702
|
+
const languageModelConfig = {
|
|
7703
|
+
provider: providerName,
|
|
7704
|
+
baseURL,
|
|
7705
|
+
headers: getHeaders,
|
|
7706
|
+
fetch: options.fetch,
|
|
7707
|
+
generateId: (_c = options.generateId) != null ? _c : generateId3,
|
|
7708
|
+
supportedUrls: () => supportedUrls
|
|
7538
7709
|
};
|
|
7710
|
+
const createChatModel = (modelId) => new AnthropicLanguageModel(modelId, languageModelConfig);
|
|
7711
|
+
const createBatch = () => new AnthropicBatch({
|
|
7712
|
+
provider: `${providerName.replace(/\.messages$/, "")}.batch`,
|
|
7713
|
+
config: languageModelConfig,
|
|
7714
|
+
supportedUrls
|
|
7715
|
+
});
|
|
7539
7716
|
const createSkills = () => new AnthropicSkills({
|
|
7540
7717
|
provider: `${providerName.replace(".messages", "")}.skills`,
|
|
7541
7718
|
baseURL,
|
|
@@ -7554,6 +7731,7 @@ function createAnthropic(options = {}) {
|
|
|
7554
7731
|
provider.languageModel = createChatModel;
|
|
7555
7732
|
provider.chat = createChatModel;
|
|
7556
7733
|
provider.messages = createChatModel;
|
|
7734
|
+
provider.experimental_batch = createBatch;
|
|
7557
7735
|
provider.embeddingModel = (modelId) => {
|
|
7558
7736
|
throw new NoSuchModelError({ modelId, modelType: "embeddingModel" });
|
|
7559
7737
|
};
|