agents 0.30.1 → 0.32.0
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/README.md +2 -1
- package/dist/{agent-routing-CDbpVjYq.d.ts → agent-routing-vVMA7m8Y.d.ts} +69 -608
- package/dist/agent-routing.d.ts +1 -1
- package/dist/agent-tool-types.d.ts +1 -1
- package/dist/{agent-tools-C8DH8Yii.d.ts → agent-tools-gGXXkf1z.d.ts} +2 -2
- package/dist/agent-tools.d.ts +1 -1
- package/dist/agent-tools.js +0 -1
- package/dist/agent-tools.js.map +1 -1
- package/dist/{ai-iXw0uOGj.d.ts → ai-CDn3Abax.d.ts} +30 -4
- package/dist/{ai-sdk-DRPh2rRa.js → ai-sdk-Kon40i0q.js} +2 -36
- package/dist/ai-sdk-Kon40i0q.js.map +1 -0
- package/dist/browser/ai.d.ts +1 -1
- package/dist/browser/ai.js +16 -3
- package/dist/browser/ai.js.map +1 -1
- package/dist/browser/index.d.ts +64 -16
- package/dist/browser/index.js +4 -4
- package/dist/browser/tools/ai-sdk.d.ts +7 -5
- package/dist/browser/tools/ai-sdk.js +4 -4
- package/dist/browser/tools/ai-sdk.js.map +1 -1
- package/dist/browser/tools/pi.d.ts +9 -15
- package/dist/browser/tools/pi.js +6 -14
- package/dist/browser/tools/pi.js.map +1 -1
- package/dist/browser/tools/tanstack-ai.d.ts +48 -25
- package/dist/browser/tools/tanstack-ai.js +8 -4
- package/dist/browser/tools/tanstack-ai.js.map +1 -1
- package/dist/{browser-DccPw_wW.js → browser-1eUbPvC2.js} +413 -14
- package/dist/browser-1eUbPvC2.js.map +1 -0
- package/dist/{browser-DlXhSAdf.d.ts → browser-D9RNpJuT.d.ts} +254 -20
- package/dist/browser-tool-BhjCcNVE.d.ts +71 -0
- package/dist/browser-tool-DRan7Lk6.js +497 -0
- package/dist/browser-tool-DRan7Lk6.js.map +1 -0
- package/dist/capability-id-B3J8Nok_.js +13 -0
- package/dist/capability-id-B3J8Nok_.js.map +1 -0
- package/dist/catalog-BpOejOsE.js +239 -0
- package/dist/catalog-BpOejOsE.js.map +1 -0
- package/dist/catalog-BpiVV1OF.d.ts +173 -0
- package/dist/chat/index.d.ts +2 -2
- package/dist/chat-sdk/index.d.ts +3 -3
- package/dist/chat-sdk/index.js +1 -1
- package/dist/client-4OlMIJx-.js.map +1 -1
- package/dist/{client-BnYbNT3z.js → client-DMWujQJ1.js} +68 -244
- package/dist/client-DMWujQJ1.js.map +1 -0
- package/dist/{client-C27CtRZr.d.ts → client-eSfgYvd3.d.ts} +9 -7
- package/dist/client.d.ts +1 -1
- package/dist/{cloudflare-Dzvc7V2N.js → cloudflare-CUUm_9q9.js} +26 -4
- package/dist/cloudflare-CUUm_9q9.js.map +1 -0
- package/dist/{connector-DAXBOIIi.js → connector-CM-uuxKM.js} +96 -8
- package/dist/connector-CM-uuxKM.js.map +1 -0
- package/dist/{connector-20DJ6p4k.d.ts → connector-DZ71EjE-.d.ts} +109 -9
- package/dist/{do-oauth-client-provider-DfsUcpc3.d.ts → do-oauth-client-provider-DtNqv7oj.d.ts} +26 -2
- package/dist/{index-YSKgfgg9.d.ts → emitter-BJZtCVjQ.d.ts} +6 -140
- package/dist/emitter-DPOVcCln.js +15 -0
- package/dist/emitter-DPOVcCln.js.map +1 -0
- package/dist/experimental/channels/web/index.js +1 -1
- package/dist/experimental/webmcp.js +1 -1
- package/dist/{handler-stateless-Bly_nSH3.js → handler-stateless-B5hU3dxK.js} +35 -2
- package/dist/handler-stateless-B5hU3dxK.js.map +1 -0
- package/dist/{handler-stateless-DxYpJ_XF.d.ts → handler-stateless-C90kD5_R.d.ts} +3 -47
- package/dist/harness/container/index.d.ts +15 -15
- package/dist/harness/container/index.js +0 -1
- package/dist/harness/container/index.js.map +1 -1
- package/dist/harness/container/runtime/index.js +2 -2
- package/dist/harness/opencode/index.js +0 -1
- package/dist/harness/opencode/index.js.map +1 -1
- package/dist/harness/pi/index.d.ts +15 -7
- package/dist/harness/pi/index.js +74 -151
- package/dist/harness/pi/index.js.map +1 -1
- package/dist/harness/think/index.d.ts +2 -1
- package/dist/{images-xaDv2Fqe.js → images-CfuRCjwq.js} +1 -5
- package/dist/images-CfuRCjwq.js.map +1 -0
- package/dist/{index-DCxk3OSJ.d.ts → index-8k4qsX1T.d.ts} +2 -28
- package/dist/index.d.ts +15 -16
- package/dist/index.js +3 -3
- package/dist/internal-hosts-Kfp5A392.d.ts +230 -0
- package/dist/internal-kmw70xwR.js.map +1 -1
- package/dist/invoker-BC1SZ3q1.js +26 -0
- package/dist/invoker-BC1SZ3q1.js.map +1 -0
- package/dist/invoker-DoLFPJZV.d.ts +21 -0
- package/dist/markdown-BZ-VLtA1.js +86 -0
- package/dist/markdown-BZ-VLtA1.js.map +1 -0
- package/dist/mcp/client/do-oauth-client-provider.d.ts +4 -2
- package/dist/mcp/client/do-oauth-client-provider.js +15 -1
- package/dist/mcp/client/do-oauth-client-provider.js.map +1 -1
- package/dist/mcp/client/index.d.ts +15 -1
- package/dist/mcp/client/index.js +2 -2
- package/dist/mcp/client/x402.d.ts +7 -5
- package/dist/mcp/client/x402.js +34 -1
- package/dist/mcp/client/x402.js.map +1 -1
- package/dist/mcp/index.d.ts +561 -27
- package/dist/mcp/index.js +180 -3
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/server/index.d.ts +1 -1
- package/dist/mcp/server/index.js +1 -1
- package/dist/models/ai-sdk/index.d.ts +2 -2
- package/dist/models/ai-sdk/index.js +1 -1
- package/dist/models/opencode/index.d.ts +2 -2
- package/dist/models/opencode/index.js +1 -1
- package/dist/models/pi-ai/index.d.ts +3 -28
- package/dist/models/pi-ai/index.js +160 -18
- package/dist/models/pi-ai/index.js.map +1 -1
- package/dist/observability/ai/index.js +1 -2
- package/dist/observability/ai/index.js.map +1 -1
- package/dist/observability/index.d.ts +170 -9
- package/dist/observability/index.js +386 -11
- package/dist/observability/index.js.map +1 -1
- package/dist/protocol-BEgrJYC5.d.ts +29 -29
- package/dist/react.d.ts +2 -2
- package/dist/resource-B59OV2a2.js +325 -0
- package/dist/resource-B59OV2a2.js.map +1 -0
- package/dist/routing/index.d.ts +1 -1
- package/dist/script-CFDLTk5b.d.ts +91 -0
- package/dist/script-workspace-BpdAYq1R.d.ts +41 -0
- package/dist/serializable.d.ts +1 -1
- package/dist/{session-store-yvwq1f9x.js → session-7CDgVE0z.js} +455 -33
- package/dist/session-7CDgVE0z.js.map +1 -0
- package/dist/{session-store-_IK6dV-w.d.ts → session-store-B7Ca-u1t.d.ts} +8 -1
- package/dist/settings-Dk2il2Hf.js.map +1 -1
- package/dist/skill-DRBcIBjC.d.ts +221 -0
- package/dist/skills/index.d.ts +275 -36
- package/dist/skills/index.js +265 -1534
- package/dist/skills/index.js.map +1 -1
- package/dist/skills/runner.d.ts +37 -0
- package/dist/skills/runner.js +912 -0
- package/dist/skills/runner.js.map +1 -0
- package/dist/skills/tools/ai-sdk.d.ts +36 -0
- package/dist/skills/tools/ai-sdk.js +94 -0
- package/dist/skills/tools/ai-sdk.js.map +1 -0
- package/dist/source-9RQzlEhM.d.ts +112 -0
- package/dist/{src-DfLzdwlK.js → src-DoGNJ4Ud.js} +21 -6
- package/dist/src-DoGNJ4Ud.js.map +1 -0
- package/dist/sub-routing.d.ts +12 -12
- package/dist/tool-CTp72Jb_.d.ts +10 -10
- package/dist/tool-CxKsvxjm.js.map +1 -1
- package/dist/tool-DkT_DJBm.js.map +1 -1
- package/dist/tool-DoVberpN.d.ts +22 -22
- package/dist/tool-helpers-BI7ifO2S.js +255 -0
- package/dist/tool-helpers-BI7ifO2S.js.map +1 -0
- package/dist/{transport-CPh7YGiw.d.ts → transport-5moD2pW5.d.ts} +1 -43
- package/dist/types-D2naO3rA.d.ts +49 -0
- package/dist/vite.d.ts +2 -2
- package/dist/vite.js +10 -258
- package/dist/vite.js.map +1 -1
- package/dist/voice/index.d.ts +1 -1
- package/dist/websockets/index.js +1 -1
- package/dist/{websockets-CyoeosdO.js → websockets-C6SJtWCJ.js} +1 -2
- package/dist/{websockets-CyoeosdO.js.map → websockets-C6SJtWCJ.js.map} +1 -1
- package/dist/workflow-types.d.ts +1 -1
- package/dist/workflows.d.ts +1 -1
- package/dist/workflows.js +0 -1
- package/dist/workflows.js.map +1 -1
- package/docs/browse-the-web.md +247 -413
- package/docs/harnesses/pi.md +36 -30
- package/docs/index.md +4 -4
- package/docs/mcp-client.md +25 -1
- package/docs/mcp-servers.md +26 -7
- package/docs/models-pi-ai.md +9 -11
- package/docs/models.md +1 -8
- package/docs/observability.md +5 -3
- package/docs/securing-mcp-servers.md +113 -302
- package/package.json +31 -17
- package/dist/ai-sdk-DRPh2rRa.js.map +0 -1
- package/dist/browser-DccPw_wW.js.map +0 -1
- package/dist/browser-tool-B1mhifin.js +0 -616
- package/dist/browser-tool-B1mhifin.js.map +0 -1
- package/dist/browser-tool-Cxjk5sgG.d.ts +0 -92
- package/dist/client-BnYbNT3z.js.map +0 -1
- package/dist/cloudflare-Dzvc7V2N.js.map +0 -1
- package/dist/connector-DAXBOIIi.js.map +0 -1
- package/dist/handler-stateless-Bly_nSH3.js.map +0 -1
- package/dist/images-xaDv2Fqe.js.map +0 -1
- package/dist/index-iv9FTXX9.d.ts +0 -311
- package/dist/invoker-CG0_p_Wq.d.ts +0 -20
- package/dist/invoker-CHMnoxIA.js +0 -57
- package/dist/invoker-CHMnoxIA.js.map +0 -1
- package/dist/session-store-yvwq1f9x.js.map +0 -1
- package/dist/skills/compile.d.ts +0 -40
- package/dist/skills/compile.js +0 -65
- package/dist/skills/compile.js.map +0 -1
- package/dist/src-DfLzdwlK.js.map +0 -1
- package/dist/tool-helpers-O5BDVEAY.js +0 -58
- package/dist/tool-helpers-O5BDVEAY.js.map +0 -1
- package/skills-module.d.ts +0 -22
package/dist/agent-routing.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
W as AgentToolProgress,
|
|
5
5
|
Z as AgentToolStoredChunk,
|
|
6
6
|
z as AgentToolEventState
|
|
7
|
-
} from "./agent-routing-
|
|
7
|
+
} from "./agent-routing-vVMA7m8Y.js";
|
|
8
8
|
|
|
9
9
|
//#region src/chat/agent-tools.d.ts
|
|
10
10
|
type AgentToolProgressEmitResult = "emitted" | "coalesced" | "inactive";
|
|
@@ -144,4 +144,4 @@ export {
|
|
|
144
144
|
interceptAgentToolBroadcast as s,
|
|
145
145
|
AgentToolBroadcastHooks as t
|
|
146
146
|
};
|
|
147
|
-
//# sourceMappingURL=agent-tools-
|
|
147
|
+
//# sourceMappingURL=agent-tools-gGXXkf1z.d.ts.map
|
package/dist/agent-tools.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
rt as RunAgentToolResult,
|
|
21
21
|
tt as DetachedRunAgentToolResult,
|
|
22
22
|
z as AgentToolEventState
|
|
23
|
-
} from "./agent-routing-
|
|
23
|
+
} from "./agent-routing-vVMA7m8Y.js";
|
|
24
24
|
import { FlexibleSchema, InferSchema, Tool } from "ai";
|
|
25
25
|
|
|
26
26
|
//#region src/agent-tools.d.ts
|
package/dist/agent-tools.js
CHANGED
package/dist/agent-tools.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-tools.js","names":["agentContext","createTool"],"sources":["../src/agent-tools.ts"],"sourcesContent":["import {\n asSchema,\n tool,\n type FlexibleSchema,\n type InferSchema,\n type Tool\n} from \"ai\";\nimport { __DO_NOT_USE_WILL_BREAK__agentContext as agentContext } from \"./internal_context\";\nimport type {\n ChatCapableAgentClass,\n RunAgentToolOptions,\n RunAgentToolResult,\n AgentToolDisplayMetadata,\n AgentToolFailure\n} from \"./agent-tool-types\";\n\ntype ParseSchema<Output = unknown> = {\n parse(value: unknown): Output;\n};\n\ntype AgentToolOutputSchema<Output> =\n | FlexibleSchema<Output>\n | ParseSchema<Output>;\n\ntype AgentToolFactoryOptions<Output = unknown, Input = unknown> = {\n description: string;\n inputSchema: FlexibleSchema<Input>;\n outputSchema?: AgentToolOutputSchema<Output>;\n displayName?: string;\n icon?: string;\n display?: AgentToolDisplayMetadata;\n};\n\n// Capture the concrete schema type so the overload below can derive its input\n// with InferSchema. AgentToolFactoryOptions remains available for callers that\n// explicitly supply agentTool<Input, Output>() type arguments.\ntype InferredAgentToolFactoryOptions<\n InputSchema extends FlexibleSchema,\n Output\n> = Omit<AgentToolFactoryOptions<Output>, \"inputSchema\"> & {\n inputSchema: InputSchema;\n};\n\ntype ToolExecutionOptions = {\n toolCallId?: string;\n abortSignal?: AbortSignal;\n};\n\ntype AgentToolRunner = {\n runAgentTool<Input, Output>(\n cls: ChatCapableAgentClass,\n options: RunAgentToolOptions<Input>\n ): Promise<RunAgentToolResult<Output>>;\n};\n\n/**\n * Preserve the existing Zod-style `.parse()` output-schema contract while\n * extending validation to the other formats supported by AI SDK FlexibleSchema.\n */\nasync function validateOutput<Output>(\n schema: AgentToolOutputSchema<Output>,\n value: unknown\n): Promise<Output> {\n if (\n typeof schema === \"object\" &&\n schema !== null &&\n \"parse\" in schema &&\n typeof schema.parse === \"function\"\n ) {\n return schema.parse(value);\n }\n\n const validate = asSchema(schema as FlexibleSchema<Output>).validate;\n if (!validate) {\n throw new Error(\"agentTool outputSchema must provide runtime validation\");\n }\n\n const result = await validate(value);\n if (!result.success) throw result.error;\n return result.value;\n}\n\nfunction currentAgentToolRunner(): AgentToolRunner {\n const agent = agentContext.getStore()?.agent;\n if (\n agent === null ||\n typeof agent !== \"object\" ||\n typeof (agent as { runAgentTool?: unknown }).runAgentTool !== \"function\"\n ) {\n throw new Error(\n \"agentTool() can only run inside an Agent turn. Use it from getTools() on an Agent subclass.\"\n );\n }\n return agent as AgentToolRunner;\n}\n\nfunction failure(\n status: AgentToolFailure[\"status\"],\n error: string,\n retryable: boolean,\n extra?: Pick<AgentToolFailure, \"reason\" | \"childStillRunning\">\n): AgentToolFailure {\n return {\n ok: false,\n status,\n error,\n retryable,\n ...(extra?.reason !== undefined ? { reason: extra.reason } : {}),\n ...(extra?.childStillRunning !== undefined\n ? { childStillRunning: extra.childStillRunning }\n : {})\n };\n}\n\n/**\n * Create an AI SDK tool that dispatches a chat-capable sub-agent through\n * `Agent.runAgentTool`.\n */\nexport function agentTool<InputSchema extends FlexibleSchema, Output = unknown>(\n cls: ChatCapableAgentClass,\n options: InferredAgentToolFactoryOptions<InputSchema, Output>\n): Tool<InferSchema<InputSchema>, string | Output | AgentToolFailure>;\n// Preserve existing callers that explicitly provide agentTool<Input, Output>().\nexport function agentTool<Input = unknown, Output = unknown>(\n cls: ChatCapableAgentClass,\n options: AgentToolFactoryOptions<Output, Input>\n): Tool<Input, string | Output | AgentToolFailure>;\nexport function agentTool<Input = unknown, Output = unknown>(\n cls: ChatCapableAgentClass,\n options: AgentToolFactoryOptions<Output, Input>\n): Tool<Input, string | Output | AgentToolFailure> {\n const createTool = tool as unknown as <I, O>(config: {\n description: string;\n inputSchema: unknown;\n execute: (input: I, options?: ToolExecutionOptions) => Promise<O>;\n }) => Tool<I, O>;\n\n return createTool<Input, string | Output | AgentToolFailure>({\n description: options.description,\n inputSchema: options.inputSchema,\n execute: async (input: Input, executeOptions?: ToolExecutionOptions) => {\n const display: AgentToolDisplayMetadata | undefined =\n options.displayName || options.icon || options.display\n ? {\n ...options.display,\n ...(options.displayName ? { name: options.displayName } : {}),\n ...(options.icon ? { icon: options.icon } : {})\n }\n : undefined;\n\n // Derive a STABLE runId from the tool call id (#1630). A tool call's id is\n // preserved in the transcript, so when a parent turn is re-run by chat\n // recovery after a deploy / eviction, the same `agentTool()` call resolves\n // to the same runId — turning the re-issue into a duplicate that\n // `runAgentTool` re-attaches to the still-running child, instead of a\n // fresh `nanoid` that spawns a brand-new child and re-runs already-\n // completed work (\"the agent went all the way back\"). Falls back to a\n // fresh id only when there is no tool call id (rare; preserves prior\n // behavior).\n const runId = executeOptions?.toolCallId\n ? `agent-tool:${executeOptions.toolCallId}`\n : undefined;\n\n const result = await currentAgentToolRunner().runAgentTool<Input, Output>(\n cls,\n {\n input,\n runId,\n parentToolCallId: executeOptions?.toolCallId,\n signal: executeOptions?.abortSignal,\n display\n }\n );\n\n if (result.status === \"completed\") {\n if (options.outputSchema) {\n if (result.output === undefined) {\n return failure(\n \"error\",\n \"agent tool completed without structured output required by outputSchema\",\n false\n );\n }\n return validateOutput(options.outputSchema, result.output);\n }\n return result.summary ?? \"\";\n }\n\n if (result.status === \"aborted\") {\n // Intentional cancellation (parent/user stopped the run) — not retryable.\n return failure(\n \"aborted\",\n result.error ?? \"agent tool run was cancelled\",\n false\n );\n }\n if (result.status === \"interrupted\") {\n // The child was reset/superseded by a deploy or parent recovery before\n // it reached a logical outcome. Re-dispatching the run can succeed, so\n // surface it as retryable rather than a terminal failure the parent\n // would report to the user as final. `retryable` is intentionally COARSE\n // (always true for `interrupted`); callers that want to distinguish a\n // self-healing child from an exhausted one branch on `reason` /\n // `childStillRunning` instead.\n return failure(\n \"interrupted\",\n result.error ??\n \"agent tool run was interrupted before it finished; it can be retried\",\n true,\n { reason: result.reason, childStillRunning: result.childStillRunning }\n );\n }\n return failure(\"error\", result.error ?? \"agent tool run failed\", false);\n }\n });\n}\n\nexport type { AgentToolFactoryOptions };\nexport type {\n AgentToolChildAdapter,\n AgentToolDisplayMetadata,\n AgentToolEvent,\n AgentToolEventDelivery,\n AgentToolEventMessage,\n AgentToolEventState,\n AgentToolFailure,\n AgentToolInterruptedReason,\n AgentToolLifecycleResult,\n AgentToolRunInfo,\n AgentToolRunInspection,\n AgentToolRunPart,\n AgentToolRunState,\n AgentToolRunStatus,\n AgentToolStoredChunk,\n AgentToolTerminalStatus,\n ChatCapableAgentClass,\n DetachedAgentToolConfig,\n DetachedRunAgentToolResult,\n RunAgentToolOptions,\n RunAgentToolResult\n} from \"./agent-tool-types\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent-tools.js","names":["agentContext","createTool"],"sources":["../src/agent-tools.ts"],"sourcesContent":["import {\n asSchema,\n tool,\n type FlexibleSchema,\n type InferSchema,\n type Tool\n} from \"ai\";\nimport { __DO_NOT_USE_WILL_BREAK__agentContext as agentContext } from \"./internal_context\";\nimport type {\n ChatCapableAgentClass,\n RunAgentToolOptions,\n RunAgentToolResult,\n AgentToolDisplayMetadata,\n AgentToolFailure\n} from \"./agent-tool-types\";\n\ntype ParseSchema<Output = unknown> = {\n parse(value: unknown): Output;\n};\n\ntype AgentToolOutputSchema<Output> =\n | FlexibleSchema<Output>\n | ParseSchema<Output>;\n\ntype AgentToolFactoryOptions<Output = unknown, Input = unknown> = {\n description: string;\n inputSchema: FlexibleSchema<Input>;\n outputSchema?: AgentToolOutputSchema<Output>;\n displayName?: string;\n icon?: string;\n display?: AgentToolDisplayMetadata;\n};\n\n// Capture the concrete schema type so the overload below can derive its input\n// with InferSchema. AgentToolFactoryOptions remains available for callers that\n// explicitly supply agentTool<Input, Output>() type arguments.\ntype InferredAgentToolFactoryOptions<\n InputSchema extends FlexibleSchema,\n Output\n> = Omit<AgentToolFactoryOptions<Output>, \"inputSchema\"> & {\n inputSchema: InputSchema;\n};\n\ntype ToolExecutionOptions = {\n toolCallId?: string;\n abortSignal?: AbortSignal;\n};\n\ntype AgentToolRunner = {\n runAgentTool<Input, Output>(\n cls: ChatCapableAgentClass,\n options: RunAgentToolOptions<Input>\n ): Promise<RunAgentToolResult<Output>>;\n};\n\n/**\n * Preserve the existing Zod-style `.parse()` output-schema contract while\n * extending validation to the other formats supported by AI SDK FlexibleSchema.\n */\nasync function validateOutput<Output>(\n schema: AgentToolOutputSchema<Output>,\n value: unknown\n): Promise<Output> {\n if (\n typeof schema === \"object\" &&\n schema !== null &&\n \"parse\" in schema &&\n typeof schema.parse === \"function\"\n ) {\n return schema.parse(value);\n }\n\n const validate = asSchema(schema as FlexibleSchema<Output>).validate;\n if (!validate) {\n throw new Error(\"agentTool outputSchema must provide runtime validation\");\n }\n\n const result = await validate(value);\n if (!result.success) throw result.error;\n return result.value;\n}\n\nfunction currentAgentToolRunner(): AgentToolRunner {\n const agent = agentContext.getStore()?.agent;\n if (\n agent === null ||\n typeof agent !== \"object\" ||\n typeof (agent as { runAgentTool?: unknown }).runAgentTool !== \"function\"\n ) {\n throw new Error(\n \"agentTool() can only run inside an Agent turn. Use it from getTools() on an Agent subclass.\"\n );\n }\n return agent as AgentToolRunner;\n}\n\nfunction failure(\n status: AgentToolFailure[\"status\"],\n error: string,\n retryable: boolean,\n extra?: Pick<AgentToolFailure, \"reason\" | \"childStillRunning\">\n): AgentToolFailure {\n return {\n ok: false,\n status,\n error,\n retryable,\n ...(extra?.reason !== undefined ? { reason: extra.reason } : {}),\n ...(extra?.childStillRunning !== undefined\n ? { childStillRunning: extra.childStillRunning }\n : {})\n };\n}\n\n/**\n * Create an AI SDK tool that dispatches a chat-capable sub-agent through\n * `Agent.runAgentTool`.\n */\nexport function agentTool<InputSchema extends FlexibleSchema, Output = unknown>(\n cls: ChatCapableAgentClass,\n options: InferredAgentToolFactoryOptions<InputSchema, Output>\n): Tool<InferSchema<InputSchema>, string | Output | AgentToolFailure>;\n// Preserve existing callers that explicitly provide agentTool<Input, Output>().\nexport function agentTool<Input = unknown, Output = unknown>(\n cls: ChatCapableAgentClass,\n options: AgentToolFactoryOptions<Output, Input>\n): Tool<Input, string | Output | AgentToolFailure>;\nexport function agentTool<Input = unknown, Output = unknown>(\n cls: ChatCapableAgentClass,\n options: AgentToolFactoryOptions<Output, Input>\n): Tool<Input, string | Output | AgentToolFailure> {\n const createTool = tool as unknown as <I, O>(config: {\n description: string;\n inputSchema: unknown;\n execute: (input: I, options?: ToolExecutionOptions) => Promise<O>;\n }) => Tool<I, O>;\n\n return createTool<Input, string | Output | AgentToolFailure>({\n description: options.description,\n inputSchema: options.inputSchema,\n execute: async (input: Input, executeOptions?: ToolExecutionOptions) => {\n const display: AgentToolDisplayMetadata | undefined =\n options.displayName || options.icon || options.display\n ? {\n ...options.display,\n ...(options.displayName ? { name: options.displayName } : {}),\n ...(options.icon ? { icon: options.icon } : {})\n }\n : undefined;\n\n // Derive a STABLE runId from the tool call id (#1630). A tool call's id is\n // preserved in the transcript, so when a parent turn is re-run by chat\n // recovery after a deploy / eviction, the same `agentTool()` call resolves\n // to the same runId — turning the re-issue into a duplicate that\n // `runAgentTool` re-attaches to the still-running child, instead of a\n // fresh `nanoid` that spawns a brand-new child and re-runs already-\n // completed work (\"the agent went all the way back\"). Falls back to a\n // fresh id only when there is no tool call id (rare; preserves prior\n // behavior).\n const runId = executeOptions?.toolCallId\n ? `agent-tool:${executeOptions.toolCallId}`\n : undefined;\n\n const result = await currentAgentToolRunner().runAgentTool<Input, Output>(\n cls,\n {\n input,\n runId,\n parentToolCallId: executeOptions?.toolCallId,\n signal: executeOptions?.abortSignal,\n display\n }\n );\n\n if (result.status === \"completed\") {\n if (options.outputSchema) {\n if (result.output === undefined) {\n return failure(\n \"error\",\n \"agent tool completed without structured output required by outputSchema\",\n false\n );\n }\n return validateOutput(options.outputSchema, result.output);\n }\n return result.summary ?? \"\";\n }\n\n if (result.status === \"aborted\") {\n // Intentional cancellation (parent/user stopped the run) — not retryable.\n return failure(\n \"aborted\",\n result.error ?? \"agent tool run was cancelled\",\n false\n );\n }\n if (result.status === \"interrupted\") {\n // The child was reset/superseded by a deploy or parent recovery before\n // it reached a logical outcome. Re-dispatching the run can succeed, so\n // surface it as retryable rather than a terminal failure the parent\n // would report to the user as final. `retryable` is intentionally COARSE\n // (always true for `interrupted`); callers that want to distinguish a\n // self-healing child from an exhausted one branch on `reason` /\n // `childStillRunning` instead.\n return failure(\n \"interrupted\",\n result.error ??\n \"agent tool run was interrupted before it finished; it can be retried\",\n true,\n { reason: result.reason, childStillRunning: result.childStillRunning }\n );\n }\n return failure(\"error\", result.error ?? \"agent tool run failed\", false);\n }\n });\n}\n\nexport type { AgentToolFactoryOptions };\nexport type {\n AgentToolChildAdapter,\n AgentToolDisplayMetadata,\n AgentToolEvent,\n AgentToolEventDelivery,\n AgentToolEventMessage,\n AgentToolEventState,\n AgentToolFailure,\n AgentToolInterruptedReason,\n AgentToolLifecycleResult,\n AgentToolRunInfo,\n AgentToolRunInspection,\n AgentToolRunPart,\n AgentToolRunState,\n AgentToolRunStatus,\n AgentToolStoredChunk,\n AgentToolTerminalStatus,\n ChatCapableAgentClass,\n DetachedAgentToolConfig,\n DetachedRunAgentToolResult,\n RunAgentToolOptions,\n RunAgentToolResult\n} from \"./agent-tool-types\";\n"],"mappings":";;;;;;;AA2DA,eAAe,eACb,QACA,OACiB;CACjB,IACE,OAAO,WAAW,YAClB,WAAW,QACX,WAAW,UACX,OAAO,OAAO,UAAU,YAExB,OAAO,OAAO,MAAM,KAAK;CAG3B,MAAM,WAAW,SAAS,MAAgC,CAAC,CAAC;CAC5D,IAAI,CAAC,UACH,MAAM,IAAI,MAAM,wDAAwD;CAG1E,MAAM,SAAS,MAAM,SAAS,KAAK;CACnC,IAAI,CAAC,OAAO,SAAS,MAAM,OAAO;CAClC,OAAO,OAAO;AAChB;AAEA,SAAS,yBAA0C;CACjD,MAAM,QAAQA,sCAAa,SAAS,CAAC,EAAE;CACvC,IACE,UAAU,QACV,OAAO,UAAU,YACjB,OAAQ,MAAqC,iBAAiB,YAE9D,MAAM,IAAI,MACR,6FACF;CAEF,OAAO;AACT;AAEA,SAAS,QACP,QACA,OACA,WACA,OACkB;CAClB,OAAO;EACL,IAAI;EACJ;EACA;EACA;EACA,GAAI,OAAO,WAAW,KAAA,IAAY,EAAE,QAAQ,MAAM,OAAO,IAAI,CAAC;EAC9D,GAAI,OAAO,sBAAsB,KAAA,IAC7B,EAAE,mBAAmB,MAAM,kBAAkB,IAC7C,CAAC;CACP;AACF;AAeA,SAAgB,UACd,KACA,SACiD;CAOjD,OAAOC,KAAsD;EAC3D,aAAa,QAAQ;EACrB,aAAa,QAAQ;EACrB,SAAS,OAAO,OAAc,mBAA0C;GACtE,MAAM,UACJ,QAAQ,eAAe,QAAQ,QAAQ,QAAQ,UAC3C;IACE,GAAG,QAAQ;IACX,GAAI,QAAQ,cAAc,EAAE,MAAM,QAAQ,YAAY,IAAI,CAAC;IAC3D,GAAI,QAAQ,OAAO,EAAE,MAAM,QAAQ,KAAK,IAAI,CAAC;GAC/C,IACA,KAAA;GAWN,MAAM,QAAQ,gBAAgB,aAC1B,cAAc,eAAe,eAC7B,KAAA;GAEJ,MAAM,SAAS,MAAM,uBAAuB,CAAC,CAAC,aAC5C,KACA;IACE;IACA;IACA,kBAAkB,gBAAgB;IAClC,QAAQ,gBAAgB;IACxB;GACF,CACF;GAEA,IAAI,OAAO,WAAW,aAAa;IACjC,IAAI,QAAQ,cAAc;KACxB,IAAI,OAAO,WAAW,KAAA,GACpB,OAAO,QACL,SACA,2EACA,KACF;KAEF,OAAO,eAAe,QAAQ,cAAc,OAAO,MAAM;IAC3D;IACA,OAAO,OAAO,WAAW;GAC3B;GAEA,IAAI,OAAO,WAAW,WAEpB,OAAO,QACL,WACA,OAAO,SAAS,gCAChB,KACF;GAEF,IAAI,OAAO,WAAW,eAQpB,OAAO,QACL,eACA,OAAO,SACL,wEACF,MACA;IAAE,QAAQ,OAAO;IAAQ,mBAAmB,OAAO;GAAkB,CACvE;GAEF,OAAO,QAAQ,SAAS,OAAO,SAAS,yBAAyB,KAAK;EACxE;CACF,CAAC;AACH"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
d as BrowserBinding,
|
|
3
3
|
n as BrowserSessionStore
|
|
4
|
-
} from "./session-store-
|
|
4
|
+
} from "./session-store-B7Ca-u1t.js";
|
|
5
5
|
import {
|
|
6
6
|
l as QuickActionBinding,
|
|
7
7
|
r as BrowserConnectorSessionOptions,
|
|
8
8
|
t as BrowserConnector,
|
|
9
9
|
u as QuickActionCommonOptions
|
|
10
|
-
} from "./connector-
|
|
10
|
+
} from "./connector-DZ71EjE-.js";
|
|
11
11
|
import { ToolSet } from "ai";
|
|
12
12
|
import { CodemodeRuntimeHandle } from "@cloudflare/codemode";
|
|
13
13
|
|
|
@@ -136,6 +136,10 @@ interface BrowserRuntime {
|
|
|
136
136
|
* }
|
|
137
137
|
* }
|
|
138
138
|
* ```
|
|
139
|
+
*
|
|
140
|
+
* @deprecated Use `browserTool` from `agents/browser/ai-sdk`,
|
|
141
|
+
* `agents/browser/tanstack-ai` or `agents/browser/pi`. See
|
|
142
|
+
* https://github.com/cloudflare/agents/blob/main/docs/agents/browse-the-web.md#persistent-browser
|
|
139
143
|
*/
|
|
140
144
|
declare function createBrowserRuntime(
|
|
141
145
|
options: CreateBrowserToolsOptions
|
|
@@ -166,17 +170,34 @@ declare function createBrowserRuntime(
|
|
|
166
170
|
* messages,
|
|
167
171
|
* });
|
|
168
172
|
* ```
|
|
173
|
+
*
|
|
174
|
+
* @deprecated Use `browserTool` from `agents/browser/ai-sdk`,
|
|
175
|
+
* `agents/browser/tanstack-ai` or `agents/browser/pi`. See
|
|
176
|
+
* https://github.com/cloudflare/agents/blob/main/docs/agents/browse-the-web.md#persistent-browser
|
|
169
177
|
*/
|
|
170
178
|
declare function createBrowserTools(
|
|
171
179
|
options: CreateBrowserToolsOptions
|
|
172
180
|
): ToolSet;
|
|
173
|
-
/**
|
|
181
|
+
/**
|
|
182
|
+
* A Quick Action exposed as an AI SDK tool.
|
|
183
|
+
*
|
|
184
|
+
* @deprecated Quick Actions are deprecated and won't change. Use
|
|
185
|
+
* `browserTool` to drive a browser, the `web_fetch` tool from
|
|
186
|
+
* `agents/webfetch` to read a page, or call the binding's
|
|
187
|
+
* `quickAction()` directly.
|
|
188
|
+
*/
|
|
174
189
|
type QuickActionToolName =
|
|
175
190
|
| "markdown"
|
|
176
191
|
| "extract"
|
|
177
192
|
| "links"
|
|
178
193
|
| "scrape"
|
|
179
194
|
| "content";
|
|
195
|
+
/**
|
|
196
|
+
* @deprecated Quick Actions are deprecated and won't change. Use
|
|
197
|
+
* `browserTool` to drive a browser, the `web_fetch` tool from
|
|
198
|
+
* `agents/webfetch` to read a page, or call the binding's
|
|
199
|
+
* `quickAction()` directly.
|
|
200
|
+
*/
|
|
180
201
|
interface CreateQuickActionToolsOptions {
|
|
181
202
|
/**
|
|
182
203
|
* Browser Run binding with Quick Actions support (`env.BROWSER`). Requires a
|
|
@@ -222,6 +243,11 @@ interface CreateQuickActionToolsOptions {
|
|
|
222
243
|
* const tools = createQuickActionTools({ browser: this.env.BROWSER });
|
|
223
244
|
* const result = await generateText({ model, tools, messages });
|
|
224
245
|
* ```
|
|
246
|
+
*
|
|
247
|
+
* @deprecated Quick Actions are deprecated and won't change. Use
|
|
248
|
+
* `browserTool` to drive a browser, the `web_fetch` tool from
|
|
249
|
+
* `agents/webfetch` to read a page, or call the binding's
|
|
250
|
+
* `quickAction()` directly.
|
|
225
251
|
*/
|
|
226
252
|
declare function createQuickActionTools(
|
|
227
253
|
options: CreateQuickActionToolsOptions
|
|
@@ -236,4 +262,4 @@ export {
|
|
|
236
262
|
createQuickActionTools as s,
|
|
237
263
|
BrowserRuntime as t
|
|
238
264
|
};
|
|
239
|
-
//# sourceMappingURL=ai-
|
|
265
|
+
//# sourceMappingURL=ai-CDn3Abax.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as _classPrivateFieldInitSpec, n as _classPrivateFieldSet2, r as _assertClassBrand, t as _classPrivateFieldGet2 } from "./classPrivateFieldGet2-DZBYAB34.js";
|
|
2
2
|
import { t as _classPrivateMethodInitSpec } from "./classPrivateMethodInitSpec-qMjJ6sHQ.js";
|
|
3
|
-
import { C as isCatalogModelId, S as isRetryableStatus, T as isRunPathLanguageModelId, _ as isGatewayErrorEnvelope, a as normalizeChatCompletion, b as classifyStatus, f as createTransport$1, g as headersToObject, h as errorFromResponse$1, i as normalizeChatCompletionsStream, m as errorFromGatewayEnvelope$1, n as imageMediaTypeOf, o as prepareChatCompletionsRequest, p as definedHeaders, r as sseDataStream, t as buildImageInput, u as requireGatewayProvider, v as unwrapEnvelope$1, w as isDynamicRouteId, x as isAbortError, y as CloudflareAIError$1 } from "./images-
|
|
3
|
+
import { C as isCatalogModelId, S as isRetryableStatus, T as isRunPathLanguageModelId, _ as isGatewayErrorEnvelope, a as normalizeChatCompletion, b as classifyStatus, f as createTransport$1, g as headersToObject, h as errorFromResponse$1, i as normalizeChatCompletionsStream, m as errorFromGatewayEnvelope$1, n as imageMediaTypeOf, o as prepareChatCompletionsRequest, p as definedHeaders, r as sseDataStream, t as buildImageInput, u as requireGatewayProvider, v as unwrapEnvelope$1, w as isDynamicRouteId, x as isAbortError, y as CloudflareAIError$1 } from "./images-CfuRCjwq.js";
|
|
4
4
|
import { a as parseModelOptions, i as mergeModelOptions, n as PROVIDER_OPTIONS_KEY, o as resolveOptions, r as gatewayLayerOf } from "./settings-Dk2il2Hf.js";
|
|
5
5
|
import { APICallError, TooManyEmbeddingValuesForCallError } from "@ai-sdk/provider";
|
|
6
6
|
//#region src/models/ai-sdk/errors.ts
|
|
@@ -43,8 +43,6 @@ function requireLanguageModelId(modelId) {
|
|
|
43
43
|
*
|
|
44
44
|
* Extends the AI SDK's `APICallError` so `ai`'s built-in retry loop honours
|
|
45
45
|
* {@link CloudflareAIError.isRetryable} without any extra wiring.
|
|
46
|
-
*
|
|
47
|
-
* @experimental This surface is experimental and may change.
|
|
48
46
|
*/
|
|
49
47
|
var CloudflareAIError = class CloudflareAIError extends APICallError {
|
|
50
48
|
constructor(options) {
|
|
@@ -111,8 +109,6 @@ function fallbackLegs(model, call) {
|
|
|
111
109
|
* wrote there: `parseModelOptions` is framework-neutral and drops rather than
|
|
112
110
|
* throws, and no type ever sees that JSON. A vendor id in a leg would
|
|
113
111
|
* otherwise reach `env.AI.run` — the path a vendor model must never take.
|
|
114
|
-
*
|
|
115
|
-
* @experimental This surface is experimental and may change.
|
|
116
112
|
*/
|
|
117
113
|
function parseCallOptions(providerOptions) {
|
|
118
114
|
const options = parseModelOptions(providerOptions?.[PROVIDER_OPTIONS_KEY]);
|
|
@@ -124,8 +120,6 @@ function parseCallOptions(providerOptions) {
|
|
|
124
120
|
* transcription, reranking. The same bag as {@link parseCallOptions}, but a
|
|
125
121
|
* fallback leg must be a Workers AI id: a dynamic route answers in the
|
|
126
122
|
* chat-completions shape, which none of those models can read.
|
|
127
|
-
*
|
|
128
|
-
* @experimental This surface is experimental and may change.
|
|
129
123
|
*/
|
|
130
124
|
function parseModalityCallOptions(providerOptions) {
|
|
131
125
|
const options = parseModelOptions(providerOptions?.[PROVIDER_OPTIONS_KEY]);
|
|
@@ -198,8 +192,6 @@ async function errorFromResponse(response, context) {
|
|
|
198
192
|
/**
|
|
199
193
|
* Builds the transport for a set of provider settings, with every failure
|
|
200
194
|
* lifted into the AI SDK error type.
|
|
201
|
-
*
|
|
202
|
-
* @experimental This surface is experimental and may change.
|
|
203
195
|
*/
|
|
204
196
|
function createTransport(settings) {
|
|
205
197
|
const inner = createTransport$1(settings);
|
|
@@ -475,8 +467,6 @@ var _options$3 = /* @__PURE__ */ new WeakMap();
|
|
|
475
467
|
* An `EmbeddingModelV4` over the Workers AI text-embedding catalog. The run
|
|
476
468
|
* path takes `{ text: string[] }` and answers `{ data, shape, usage }`,
|
|
477
469
|
* sometimes inside the Cloudflare envelope.
|
|
478
|
-
*
|
|
479
|
-
* @experimental This surface is experimental and may change.
|
|
480
470
|
*/
|
|
481
471
|
var CloudflareEmbeddingModel = class {
|
|
482
472
|
constructor(modelId, options, config) {
|
|
@@ -768,8 +758,6 @@ function reasoningEffortField(options, context) {
|
|
|
768
758
|
/**
|
|
769
759
|
* Builds a strict OpenAI chat-completions body from AI SDK call options and
|
|
770
760
|
* runs it through the compat layer for the target model.
|
|
771
|
-
*
|
|
772
|
-
* @experimental This surface is experimental and may change.
|
|
773
761
|
*/
|
|
774
762
|
function buildOpenAIRequest(options, context) {
|
|
775
763
|
const warnings = [];
|
|
@@ -878,8 +866,6 @@ function toolCallsFrom(raw, messageExtra) {
|
|
|
878
866
|
/**
|
|
879
867
|
* Parses a non-streaming response. The body is normalized to the strict
|
|
880
868
|
* `chat.completion` shape first, so only `choices[0].message` is read.
|
|
881
|
-
*
|
|
882
|
-
* @experimental This surface is experimental and may change.
|
|
883
869
|
*/
|
|
884
870
|
function parseOpenAIGeneration(json, modelId) {
|
|
885
871
|
const body = normalizeChatCompletion(json, modelId);
|
|
@@ -914,8 +900,6 @@ function parseOpenAIGeneration(json, modelId) {
|
|
|
914
900
|
* parts. Tool calls arrive either as incremental `arguments` fragments closed
|
|
915
901
|
* by a null-finalization chunk, or as one delta with the complete arguments
|
|
916
902
|
* string; both are handled. Usage is read from whichever chunk carries it.
|
|
917
|
-
*
|
|
918
|
-
* @experimental This surface is experimental and may change.
|
|
919
903
|
*/
|
|
920
904
|
function openAIStreamParser() {
|
|
921
905
|
const toolCalls = /* @__PURE__ */ new Map();
|
|
@@ -1286,8 +1270,6 @@ var _CloudflareLanguageModel_brand = /* @__PURE__ */ new WeakSet();
|
|
|
1286
1270
|
/**
|
|
1287
1271
|
* A `LanguageModelV4` backed by the Cloudflare run path. The model id decides
|
|
1288
1272
|
* the wire format; nothing about transport or wire format reaches user land.
|
|
1289
|
-
*
|
|
1290
|
-
* @experimental This surface is experimental and may change.
|
|
1291
1273
|
*/
|
|
1292
1274
|
var CloudflareLanguageModel = class {
|
|
1293
1275
|
constructor(modelId, options, config) {
|
|
@@ -1650,8 +1632,6 @@ var _GatewayLanguageModel_brand = /* @__PURE__ */ new WeakSet();
|
|
|
1650
1632
|
* A `LanguageModelV4` that is the user's own vendor model, routed through AI
|
|
1651
1633
|
* Gateway. Generation, parsing, tool handling and error shapes stay the
|
|
1652
1634
|
* vendor's; only the transport is Cloudflare's.
|
|
1653
|
-
*
|
|
1654
|
-
* @experimental This surface is experimental and may change.
|
|
1655
1635
|
*/
|
|
1656
1636
|
var GatewayLanguageModel = class {
|
|
1657
1637
|
constructor(model, options, config) {
|
|
@@ -1774,8 +1754,6 @@ function _workersAI(modelId) {
|
|
|
1774
1754
|
* `fetch` is swapped; every `do…` method stays the vendor's, and its result
|
|
1775
1755
|
* gains `providerMetadata.cloudflare` when the result is an object that can
|
|
1776
1756
|
* carry one.
|
|
1777
|
-
*
|
|
1778
|
-
* @experimental This surface is experimental and may change.
|
|
1779
1757
|
*/
|
|
1780
1758
|
function routed(model, options, config) {
|
|
1781
1759
|
requireConfig(model);
|
|
@@ -1834,8 +1812,6 @@ var _CloudflareModalityModel_brand = /* @__PURE__ */ new WeakSet();
|
|
|
1834
1812
|
* A model over the Cloudflare run path that is not a language model. Holds
|
|
1835
1813
|
* the one call path all four modalities share; each subclass only builds a
|
|
1836
1814
|
* body and reads an answer.
|
|
1837
|
-
*
|
|
1838
|
-
* @experimental This surface is experimental and may change.
|
|
1839
1815
|
*/
|
|
1840
1816
|
var CloudflareModalityModel = class {
|
|
1841
1817
|
constructor(modelId, options, config) {
|
|
@@ -2058,8 +2034,6 @@ function imageUsage(json) {
|
|
|
2058
2034
|
* The run path generates one image per call, so `maxImagesPerCall` is 1 and
|
|
2059
2035
|
* `generateImage` fans a larger `n` out itself; a direct `doGenerate` with
|
|
2060
2036
|
* `n > 1` is fanned out here instead.
|
|
2061
|
-
*
|
|
2062
|
-
* @experimental This surface is experimental and may change.
|
|
2063
2037
|
*/
|
|
2064
2038
|
var CloudflareImageModel = class extends CloudflareModalityModel {
|
|
2065
2039
|
constructor(modelId, options, config) {
|
|
@@ -2123,8 +2097,6 @@ function buildRerankingRequest(options) {
|
|
|
2123
2097
|
}
|
|
2124
2098
|
/**
|
|
2125
2099
|
* A `RerankingModelV4` over the Workers AI reranker catalog.
|
|
2126
|
-
*
|
|
2127
|
-
* @experimental This surface is experimental and may change.
|
|
2128
2100
|
*/
|
|
2129
2101
|
var CloudflareRerankingModel = class extends CloudflareModalityModel {
|
|
2130
2102
|
constructor(modelId, options, config) {
|
|
@@ -2231,8 +2203,6 @@ function readAudio(answer) {
|
|
|
2231
2203
|
}
|
|
2232
2204
|
/**
|
|
2233
2205
|
* A `SpeechModelV4` over the Workers AI text-to-speech catalog.
|
|
2234
|
-
*
|
|
2235
|
-
* @experimental This surface is experimental and may change.
|
|
2236
2206
|
*/
|
|
2237
2207
|
var CloudflareSpeechModel = class extends CloudflareModalityModel {
|
|
2238
2208
|
constructor(modelId, options, config) {
|
|
@@ -2395,8 +2365,6 @@ function readSegments(body) {
|
|
|
2395
2365
|
}
|
|
2396
2366
|
/**
|
|
2397
2367
|
* A `TranscriptionModelV4` over the Workers AI speech-recognition catalog.
|
|
2398
|
-
*
|
|
2399
|
-
* @experimental This surface is experimental and may change.
|
|
2400
2368
|
*/
|
|
2401
2369
|
var CloudflareTranscriptionModel = class extends CloudflareModalityModel {
|
|
2402
2370
|
constructor(modelId, options, config) {
|
|
@@ -2463,8 +2431,6 @@ function isModel(value) {
|
|
|
2463
2431
|
* ai("anthropic/claude-opus-4.8", { fallback: ["openai/gpt-5.5"] });
|
|
2464
2432
|
* ai.embedding("@cf/baai/bge-base-en-v1.5");
|
|
2465
2433
|
* ```
|
|
2466
|
-
*
|
|
2467
|
-
* @experimental This surface is experimental and may change.
|
|
2468
2434
|
*/
|
|
2469
2435
|
function createAI(settings) {
|
|
2470
2436
|
const config = {
|
|
@@ -2527,4 +2493,4 @@ function createAI(settings) {
|
|
|
2527
2493
|
//#endregion
|
|
2528
2494
|
export { GatewayLanguageModel as n, CloudflareAIError as r, createAI as t };
|
|
2529
2495
|
|
|
2530
|
-
//# sourceMappingURL=ai-sdk-
|
|
2496
|
+
//# sourceMappingURL=ai-sdk-Kon40i0q.js.map
|