ai 6.0.201 → 6.0.202

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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # ai
2
2
 
3
+ ## 6.0.202
4
+
5
+ ### Patch Changes
6
+
7
+ - 942f2f8: fix(security): re-validate tool approvals from client message history before execution
8
+
9
+ The approval-replay path in `generateText`/`streamText` reconstructed approved tool calls from the client-supplied messages array and executed them without re-validating input against the tool's schema or re-checking that the tool actually requires approval. A client could forge an assistant message with a pre-approved tool-call part and have the server execute a tool with attacker-chosen arguments.
10
+
11
+ The replay path now verifies the HMAC signature (when `experimental_toolApprovalSecret` is configured), re-validates tool-call input against the tool's input schema, and re-resolves whether the tool requires approval before execution.
12
+
13
+ - Updated dependencies [942f2f8]
14
+ - @ai-sdk/provider-utils@4.0.28
15
+ - @ai-sdk/gateway@3.0.128
16
+
3
17
  ## 6.0.201
4
18
 
5
19
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -732,6 +732,10 @@ type ToolApprovalRequestOutput<TOOLS extends ToolSet> = {
732
732
  * Tool call that the approval request is for.
733
733
  */
734
734
  toolCall: TypedToolCall<TOOLS>;
735
+ /**
736
+ * HMAC-SHA256 signature binding this approval request to its tool call.
737
+ */
738
+ signature?: string;
735
739
  };
736
740
 
737
741
  type StaticToolError<TOOLS extends ToolSet> = ValueOf<{
@@ -1165,9 +1169,9 @@ interface GenerateTextResult<TOOLS extends ToolSet, OUTPUT extends Output> {
1165
1169
  readonly output: InferCompleteOutput<OUTPUT>;
1166
1170
  }
1167
1171
 
1168
- declare const symbol$j: unique symbol;
1172
+ declare const symbol$k: unique symbol;
1169
1173
  declare class InvalidToolInputError extends AISDKError {
1170
- private readonly [symbol$j];
1174
+ private readonly [symbol$k];
1171
1175
  readonly toolName: string;
1172
1176
  readonly toolInput: string;
1173
1177
  constructor({ toolInput, toolName, cause, message, }: {
@@ -1179,9 +1183,9 @@ declare class InvalidToolInputError extends AISDKError {
1179
1183
  static isInstance(error: unknown): error is InvalidToolInputError;
1180
1184
  }
1181
1185
 
1182
- declare const symbol$i: unique symbol;
1186
+ declare const symbol$j: unique symbol;
1183
1187
  declare class NoSuchToolError extends AISDKError {
1184
- private readonly [symbol$i];
1188
+ private readonly [symbol$j];
1185
1189
  readonly toolName: string;
1186
1190
  readonly availableTools: string[] | undefined;
1187
1191
  constructor({ toolName, availableTools, message, }: {
@@ -1345,7 +1349,7 @@ type GenerateTextOnFinishCallback<TOOLS extends ToolSet> = (event: OnFinishEvent
1345
1349
  * @returns
1346
1350
  * A result object that contains the generated text, the results of the tool calls, and additional information.
1347
1351
  */
1348
- declare function generateText<TOOLS extends ToolSet, OUTPUT extends Output = Output<string, string>>({ model: modelArg, tools, toolChoice, system, prompt, messages, allowSystemInMessages, maxRetries: maxRetriesArg, abortSignal, timeout, headers, stopWhen, experimental_output, output, experimental_telemetry: telemetry, providerOptions, experimental_activeTools, activeTools, experimental_prepareStep, prepareStep, experimental_repairToolCall: repairToolCall, experimental_download: download, experimental_context, experimental_include: include, _internal: { generateId }, experimental_onStart: onStart, experimental_onStepStart: onStepStart, experimental_onToolCallStart: onToolCallStart, experimental_onToolCallFinish: onToolCallFinish, onStepFinish, onFinish, ...settings }: CallSettings & Prompt & {
1352
+ declare function generateText<TOOLS extends ToolSet, OUTPUT extends Output = Output<string, string>>({ model: modelArg, tools, toolChoice, system, prompt, messages, allowSystemInMessages, maxRetries: maxRetriesArg, abortSignal, timeout, headers, stopWhen, experimental_output, output, experimental_telemetry: telemetry, providerOptions, experimental_activeTools, activeTools, experimental_prepareStep, prepareStep, experimental_repairToolCall: repairToolCall, experimental_download: download, experimental_context, experimental_toolApprovalSecret, experimental_include: include, _internal: { generateId }, experimental_onStart: onStart, experimental_onStepStart: onStepStart, experimental_onToolCallStart: onToolCallStart, experimental_onToolCallFinish: onToolCallFinish, onStepFinish, onFinish, ...settings }: CallSettings & Prompt & {
1349
1353
  /**
1350
1354
  * The language model to use.
1351
1355
  */
@@ -1446,6 +1450,14 @@ declare function generateText<TOOLS extends ToolSet, OUTPUT extends Output = Out
1446
1450
  * @default undefined
1447
1451
  */
1448
1452
  experimental_context?: unknown;
1453
+ /**
1454
+ * Secret for HMAC-signing tool approval requests. When set, the server
1455
+ * signs each approval request at issuance and verifies the signature when
1456
+ * the approval is replayed, preventing client-forged approvals.
1457
+ *
1458
+ * Experimental (can break in patch releases).
1459
+ */
1460
+ experimental_toolApprovalSecret?: string | Uint8Array;
1449
1461
  /**
1450
1462
  * Settings for controlling what data is included in step results.
1451
1463
  * Disabling inclusion can help reduce memory usage when processing
@@ -1731,6 +1743,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
1731
1743
  id: string;
1732
1744
  approved?: never;
1733
1745
  reason?: never;
1746
+ signature?: string;
1734
1747
  };
1735
1748
  } | {
1736
1749
  state: 'approval-responded';
@@ -1742,6 +1755,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
1742
1755
  id: string;
1743
1756
  approved: boolean;
1744
1757
  reason?: string;
1758
+ signature?: string;
1745
1759
  };
1746
1760
  } | {
1747
1761
  state: 'output-available';
@@ -1755,6 +1769,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
1755
1769
  id: string;
1756
1770
  approved: true;
1757
1771
  reason?: string;
1772
+ signature?: string;
1758
1773
  };
1759
1774
  } | {
1760
1775
  state: 'output-error';
@@ -1768,6 +1783,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
1768
1783
  id: string;
1769
1784
  approved: true;
1770
1785
  reason?: string;
1786
+ signature?: string;
1771
1787
  };
1772
1788
  } | {
1773
1789
  state: 'output-denied';
@@ -1779,6 +1795,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
1779
1795
  id: string;
1780
1796
  approved: false;
1781
1797
  reason?: string;
1798
+ signature?: string;
1782
1799
  };
1783
1800
  });
1784
1801
  type ToolUIPart<TOOLS extends UITools = UITools> = ValueOf<{
@@ -1826,6 +1843,7 @@ type DynamicToolUIPart = {
1826
1843
  id: string;
1827
1844
  approved?: never;
1828
1845
  reason?: never;
1846
+ signature?: string;
1829
1847
  };
1830
1848
  } | {
1831
1849
  state: 'approval-responded';
@@ -1837,6 +1855,7 @@ type DynamicToolUIPart = {
1837
1855
  id: string;
1838
1856
  approved: boolean;
1839
1857
  reason?: string;
1858
+ signature?: string;
1840
1859
  };
1841
1860
  } | {
1842
1861
  state: 'output-available';
@@ -1850,6 +1869,7 @@ type DynamicToolUIPart = {
1850
1869
  id: string;
1851
1870
  approved: true;
1852
1871
  reason?: string;
1872
+ signature?: string;
1853
1873
  };
1854
1874
  } | {
1855
1875
  state: 'output-error';
@@ -1862,6 +1882,7 @@ type DynamicToolUIPart = {
1862
1882
  id: string;
1863
1883
  approved: true;
1864
1884
  reason?: string;
1885
+ signature?: string;
1865
1886
  };
1866
1887
  } | {
1867
1888
  state: 'output-denied';
@@ -1873,6 +1894,7 @@ type DynamicToolUIPart = {
1873
1894
  id: string;
1874
1895
  approved: false;
1875
1896
  reason?: string;
1897
+ signature?: string;
1876
1898
  };
1877
1899
  });
1878
1900
  /**
@@ -1989,6 +2011,7 @@ declare const uiMessageChunkSchema: _ai_sdk_provider_utils.LazySchema<{
1989
2011
  type: "tool-approval-request";
1990
2012
  approvalId: string;
1991
2013
  toolCallId: string;
2014
+ signature?: string | undefined;
1992
2015
  } | {
1993
2016
  type: "tool-output-available";
1994
2017
  toolCallId: string;
@@ -2126,6 +2149,7 @@ type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIDataTypes = UIDataT
2126
2149
  type: 'tool-approval-request';
2127
2150
  approvalId: string;
2128
2151
  toolCallId: string;
2152
+ signature?: string;
2129
2153
  } | {
2130
2154
  type: 'tool-output-available';
2131
2155
  toolCallId: string;
@@ -2732,7 +2756,7 @@ type StreamTextOnToolCallFinishCallback<TOOLS extends ToolSet = ToolSet> = (even
2732
2756
  * @returns
2733
2757
  * A result object for accessing different stream types and additional information.
2734
2758
  */
2735
- declare function streamText<TOOLS extends ToolSet, OUTPUT extends Output = Output<string, string, never>>({ model, tools, toolChoice, system, prompt, messages, allowSystemInMessages, maxRetries, abortSignal, timeout, headers, stopWhen, experimental_output, output, experimental_telemetry: telemetry, prepareStep, providerOptions, experimental_activeTools, activeTools, experimental_repairToolCall: repairToolCall, experimental_transform: transform, experimental_download: download, includeRawChunks, onChunk, onError, onFinish, onAbort, onStepFinish, experimental_onStart: onStart, experimental_onStepStart: onStepStart, experimental_onToolCallStart: onToolCallStart, experimental_onToolCallFinish: onToolCallFinish, experimental_context, experimental_include: include, _internal: { now, generateId }, ...settings }: CallSettings & Prompt & {
2759
+ declare function streamText<TOOLS extends ToolSet, OUTPUT extends Output = Output<string, string, never>>({ model, tools, toolChoice, system, prompt, messages, allowSystemInMessages, maxRetries, abortSignal, timeout, headers, stopWhen, experimental_output, output, experimental_telemetry: telemetry, prepareStep, providerOptions, experimental_activeTools, activeTools, experimental_repairToolCall: repairToolCall, experimental_transform: transform, experimental_download: download, includeRawChunks, onChunk, onError, onFinish, onAbort, onStepFinish, experimental_onStart: onStart, experimental_onStepStart: onStepStart, experimental_onToolCallStart: onToolCallStart, experimental_onToolCallFinish: onToolCallFinish, experimental_context, experimental_toolApprovalSecret, experimental_include: include, _internal: { now, generateId }, ...settings }: CallSettings & Prompt & {
2736
2760
  /**
2737
2761
  * The language model to use.
2738
2762
  */
@@ -2865,6 +2889,14 @@ declare function streamText<TOOLS extends ToolSet, OUTPUT extends Output = Outpu
2865
2889
  * @default undefined
2866
2890
  */
2867
2891
  experimental_context?: unknown;
2892
+ /**
2893
+ * Secret for HMAC-signing tool approval requests. When set, the server
2894
+ * signs each approval request at issuance and verifies the signature when
2895
+ * the approval is replayed, preventing client-forged approvals.
2896
+ *
2897
+ * Experimental (can break in patch releases).
2898
+ */
2899
+ experimental_toolApprovalSecret?: string | Uint8Array;
2868
2900
  /**
2869
2901
  * Settings for controlling what data is included in step results.
2870
2902
  * Disabling inclusion can help reduce memory usage when processing
@@ -4608,9 +4640,9 @@ declare function embedMany({ model: modelArg, values, maxParallelCalls, maxRetri
4608
4640
  maxParallelCalls?: number;
4609
4641
  }): Promise<EmbedManyResult>;
4610
4642
 
4611
- declare const symbol$h: unique symbol;
4643
+ declare const symbol$i: unique symbol;
4612
4644
  declare class InvalidArgumentError extends AISDKError {
4613
- private readonly [symbol$h];
4645
+ private readonly [symbol$i];
4614
4646
  readonly parameter: string;
4615
4647
  readonly value: unknown;
4616
4648
  constructor({ parameter, value, message, }: {
@@ -4697,9 +4729,9 @@ type SingleRequestTextStreamPart<TOOLS extends ToolSet> = {
4697
4729
  rawValue: unknown;
4698
4730
  };
4699
4731
 
4700
- declare const symbol$g: unique symbol;
4732
+ declare const symbol$h: unique symbol;
4701
4733
  declare class InvalidStreamPartError extends AISDKError {
4702
- private readonly [symbol$g];
4734
+ private readonly [symbol$h];
4703
4735
  readonly chunk: SingleRequestTextStreamPart<any>;
4704
4736
  constructor({ chunk, message, }: {
4705
4737
  chunk: SingleRequestTextStreamPart<any>;
@@ -4708,9 +4740,9 @@ declare class InvalidStreamPartError extends AISDKError {
4708
4740
  static isInstance(error: unknown): error is InvalidStreamPartError;
4709
4741
  }
4710
4742
 
4711
- declare const symbol$f: unique symbol;
4743
+ declare const symbol$g: unique symbol;
4712
4744
  declare class InvalidToolApprovalError extends AISDKError {
4713
- private readonly [symbol$f];
4745
+ private readonly [symbol$g];
4714
4746
  readonly approvalId: string;
4715
4747
  constructor({ approvalId }: {
4716
4748
  approvalId: string;
@@ -4718,6 +4750,19 @@ declare class InvalidToolApprovalError extends AISDKError {
4718
4750
  static isInstance(error: unknown): error is InvalidToolApprovalError;
4719
4751
  }
4720
4752
 
4753
+ declare const symbol$f: unique symbol;
4754
+ declare class InvalidToolApprovalSignatureError extends AISDKError {
4755
+ private readonly [symbol$f];
4756
+ readonly approvalId: string;
4757
+ readonly toolCallId: string;
4758
+ constructor({ approvalId, toolCallId, reason, }: {
4759
+ approvalId: string;
4760
+ toolCallId: string;
4761
+ reason: string;
4762
+ });
4763
+ static isInstance(error: unknown): error is InvalidToolApprovalSignatureError;
4764
+ }
4765
+
4721
4766
  declare const symbol$e: unique symbol;
4722
4767
  declare class ToolCallNotFoundForApprovalError extends AISDKError {
4723
4768
  private readonly [symbol$e];
@@ -6440,4 +6485,4 @@ declare function bindTelemetryIntegration(integration: TelemetryIntegration): Te
6440
6485
  */
6441
6486
  declare function registerTelemetryIntegration(integration: TelemetryIntegration): void;
6442
6487
 
6443
- export { AbstractChat, Agent, AgentCallParameters, AgentStreamParameters, AsyncIterableStream, CallSettings, CallWarning, ChatAddToolApproveResponseFunction, ChatAddToolOutputFunction, ChatInit, ChatOnDataCallback, ChatOnErrorCallback, ChatOnFinishCallback, ChatOnToolCallCallback, ChatRequestOptions, ChatState, ChatStatus, ChatTransport, ChunkDetector, CompletionRequestOptions, ContentPart, CreateUIMessage, DataUIPart, DeepPartial, DefaultChatTransport, DefaultGeneratedFile, DirectChatTransport, DirectChatTransportOptions, DynamicToolCall, DynamicToolError, DynamicToolResult, DynamicToolUIPart, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelMiddleware, EmbeddingModelUsage, ErrorHandler, ToolLoopAgent as Experimental_Agent, ToolLoopAgentSettings as Experimental_AgentSettings, DownloadFunction as Experimental_DownloadFunction, Experimental_GenerateImageResult, GeneratedFile as Experimental_GeneratedImage, InferAgentUIMessage as Experimental_InferAgentUIMessage, LogWarningsFunction as Experimental_LogWarningsFunction, SpeechResult as Experimental_SpeechResult, TranscriptionResult as Experimental_TranscriptionResult, FileUIPart, FinishReason, GenerateImageResult, GenerateObjectResult, GenerateTextOnFinishCallback, GenerateTextOnStartCallback, GenerateTextOnStepFinishCallback, GenerateTextOnStepStartCallback, GenerateTextOnToolCallFinishCallback, GenerateTextOnToolCallStartCallback, GenerateTextResult, GenerateVideoPrompt, GenerateVideoResult, GeneratedAudioFile, GeneratedFile, HttpChatTransport, HttpChatTransportInitOptions, ImageModel, ImageModelMiddleware, ImageModelProviderMetadata, ImageModelResponseMetadata, ImageModelUsage, InferAgentUIMessage, InferCompleteOutput as InferGenerateOutput, InferPartialOutput as InferStreamOutput, InferUIDataParts, InferUIMessageChunk, InferUITool, InferUITools, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolApprovalError, InvalidToolInputError, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelMiddleware, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, LogWarningsFunction, MessageConversionError, MissingToolResultsError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoSpeechGeneratedError, NoSuchProviderError, NoSuchToolError, NoTranscriptGeneratedError, NoVideoGeneratedError, ObjectStreamPart, OnFinishEvent, OnStartEvent, OnStepFinishEvent, OnStepStartEvent, OnToolCallFinishEvent, OnToolCallStartEvent, output as Output, PrepareReconnectToStreamRequest, PrepareSendMessagesRequest, PrepareStepFunction, PrepareStepResult, Prompt, Provider, ProviderMetadata, ProviderRegistryProvider, ReasoningOutput, ReasoningUIPart, RepairTextFunction, RerankResult, RerankingModel, RetryError, SafeValidateUIMessagesResult, SerialJobExecutor, SourceDocumentUIPart, SourceUrlUIPart, SpeechModel, SpeechModelResponseMetadata, StaticToolCall, StaticToolError, StaticToolOutputDenied, StaticToolResult, StepResult, StepStartUIPart, StopCondition, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStartCallback, StreamTextOnStepFinishCallback, StreamTextOnStepStartCallback, StreamTextOnToolCallFinishCallback, StreamTextOnToolCallStartCallback, StreamTextResult, StreamTextTransform, TelemetryIntegration, TelemetrySettings, TextStreamChatTransport, TextStreamPart, TextUIPart, TimeoutConfiguration, ToolApprovalRequestOutput, ToolCallNotFoundForApprovalError, ToolCallRepairError, ToolCallRepairFunction, ToolChoice, ToolLoopAgent, ToolLoopAgentOnFinishCallback, ToolLoopAgentOnStepFinishCallback, ToolLoopAgentSettings, ToolSet, ToolUIPart, TranscriptionModel, TranscriptionModelResponseMetadata, TypedToolCall, TypedToolError, TypedToolOutputDenied, TypedToolResult, UIDataPartSchemas, UIDataTypes, UIMessage, UIMessageChunk, UIMessagePart, UIMessageStreamError, UIMessageStreamOnFinishCallback, UIMessageStreamOnStepFinishCallback, UIMessageStreamOptions, UIMessageStreamWriter, UITool, UIToolInvocation, UITools, UI_MESSAGE_STREAM_HEADERS, UnsupportedModelVersionError, UseCompletionOptions, Warning, addToolInputExamplesMiddleware, assistantModelMessageSchema, bindTelemetryIntegration, callCompletionApi, consumeStream, convertFileListToFileUIParts, convertToModelMessages, cosineSimilarity, createAgentUIStream, createAgentUIStreamResponse, createDownload, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultEmbeddingSettingsMiddleware, defaultSettingsMiddleware, embed, embedMany, experimental_createProviderRegistry, experimental_customProvider, experimental_generateImage, generateSpeech as experimental_generateSpeech, experimental_generateVideo, transcribe as experimental_transcribe, extractJsonMiddleware, extractReasoningMiddleware, generateImage, generateObject, generateText, getStaticToolName, getTextFromDataUrl, getToolName, getToolOrDynamicToolName, hasToolCall, isDataUIPart, isDeepEqualData, isFileUIPart, isLoopFinished, isReasoningUIPart, isStaticToolUIPart, isTextUIPart, isToolOrDynamicToolUIPart, isToolUIPart, lastAssistantMessageIsCompleteWithApprovalResponses, lastAssistantMessageIsCompleteWithToolCalls, modelMessageSchema, parsePartialJson, pipeAgentUIStreamToResponse, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, pruneMessages, readUIMessageStream, registerTelemetryIntegration, rerank, safeValidateUIMessages, simulateReadableStream, simulateStreamingMiddleware, smoothStream, stepCountIs, streamObject, streamText, systemModelMessageSchema, toolModelMessageSchema, uiMessageChunkSchema, userModelMessageSchema, validateUIMessages, wrapEmbeddingModel, wrapImageModel, wrapLanguageModel, wrapProvider };
6488
+ export { AbstractChat, Agent, AgentCallParameters, AgentStreamParameters, AsyncIterableStream, CallSettings, CallWarning, ChatAddToolApproveResponseFunction, ChatAddToolOutputFunction, ChatInit, ChatOnDataCallback, ChatOnErrorCallback, ChatOnFinishCallback, ChatOnToolCallCallback, ChatRequestOptions, ChatState, ChatStatus, ChatTransport, ChunkDetector, CompletionRequestOptions, ContentPart, CreateUIMessage, DataUIPart, DeepPartial, DefaultChatTransport, DefaultGeneratedFile, DirectChatTransport, DirectChatTransportOptions, DynamicToolCall, DynamicToolError, DynamicToolResult, DynamicToolUIPart, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelMiddleware, EmbeddingModelUsage, ErrorHandler, ToolLoopAgent as Experimental_Agent, ToolLoopAgentSettings as Experimental_AgentSettings, DownloadFunction as Experimental_DownloadFunction, Experimental_GenerateImageResult, GeneratedFile as Experimental_GeneratedImage, InferAgentUIMessage as Experimental_InferAgentUIMessage, LogWarningsFunction as Experimental_LogWarningsFunction, SpeechResult as Experimental_SpeechResult, TranscriptionResult as Experimental_TranscriptionResult, FileUIPart, FinishReason, GenerateImageResult, GenerateObjectResult, GenerateTextOnFinishCallback, GenerateTextOnStartCallback, GenerateTextOnStepFinishCallback, GenerateTextOnStepStartCallback, GenerateTextOnToolCallFinishCallback, GenerateTextOnToolCallStartCallback, GenerateTextResult, GenerateVideoPrompt, GenerateVideoResult, GeneratedAudioFile, GeneratedFile, HttpChatTransport, HttpChatTransportInitOptions, ImageModel, ImageModelMiddleware, ImageModelProviderMetadata, ImageModelResponseMetadata, ImageModelUsage, InferAgentUIMessage, InferCompleteOutput as InferGenerateOutput, InferPartialOutput as InferStreamOutput, InferUIDataParts, InferUIMessageChunk, InferUITool, InferUITools, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolApprovalError, InvalidToolApprovalSignatureError, InvalidToolInputError, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelMiddleware, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, LogWarningsFunction, MessageConversionError, MissingToolResultsError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoSpeechGeneratedError, NoSuchProviderError, NoSuchToolError, NoTranscriptGeneratedError, NoVideoGeneratedError, ObjectStreamPart, OnFinishEvent, OnStartEvent, OnStepFinishEvent, OnStepStartEvent, OnToolCallFinishEvent, OnToolCallStartEvent, output as Output, PrepareReconnectToStreamRequest, PrepareSendMessagesRequest, PrepareStepFunction, PrepareStepResult, Prompt, Provider, ProviderMetadata, ProviderRegistryProvider, ReasoningOutput, ReasoningUIPart, RepairTextFunction, RerankResult, RerankingModel, RetryError, SafeValidateUIMessagesResult, SerialJobExecutor, SourceDocumentUIPart, SourceUrlUIPart, SpeechModel, SpeechModelResponseMetadata, StaticToolCall, StaticToolError, StaticToolOutputDenied, StaticToolResult, StepResult, StepStartUIPart, StopCondition, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStartCallback, StreamTextOnStepFinishCallback, StreamTextOnStepStartCallback, StreamTextOnToolCallFinishCallback, StreamTextOnToolCallStartCallback, StreamTextResult, StreamTextTransform, TelemetryIntegration, TelemetrySettings, TextStreamChatTransport, TextStreamPart, TextUIPart, TimeoutConfiguration, ToolApprovalRequestOutput, ToolCallNotFoundForApprovalError, ToolCallRepairError, ToolCallRepairFunction, ToolChoice, ToolLoopAgent, ToolLoopAgentOnFinishCallback, ToolLoopAgentOnStepFinishCallback, ToolLoopAgentSettings, ToolSet, ToolUIPart, TranscriptionModel, TranscriptionModelResponseMetadata, TypedToolCall, TypedToolError, TypedToolOutputDenied, TypedToolResult, UIDataPartSchemas, UIDataTypes, UIMessage, UIMessageChunk, UIMessagePart, UIMessageStreamError, UIMessageStreamOnFinishCallback, UIMessageStreamOnStepFinishCallback, UIMessageStreamOptions, UIMessageStreamWriter, UITool, UIToolInvocation, UITools, UI_MESSAGE_STREAM_HEADERS, UnsupportedModelVersionError, UseCompletionOptions, Warning, addToolInputExamplesMiddleware, assistantModelMessageSchema, bindTelemetryIntegration, callCompletionApi, consumeStream, convertFileListToFileUIParts, convertToModelMessages, cosineSimilarity, createAgentUIStream, createAgentUIStreamResponse, createDownload, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultEmbeddingSettingsMiddleware, defaultSettingsMiddleware, embed, embedMany, experimental_createProviderRegistry, experimental_customProvider, experimental_generateImage, generateSpeech as experimental_generateSpeech, experimental_generateVideo, transcribe as experimental_transcribe, extractJsonMiddleware, extractReasoningMiddleware, generateImage, generateObject, generateText, getStaticToolName, getTextFromDataUrl, getToolName, getToolOrDynamicToolName, hasToolCall, isDataUIPart, isDeepEqualData, isFileUIPart, isLoopFinished, isReasoningUIPart, isStaticToolUIPart, isTextUIPart, isToolOrDynamicToolUIPart, isToolUIPart, lastAssistantMessageIsCompleteWithApprovalResponses, lastAssistantMessageIsCompleteWithToolCalls, modelMessageSchema, parsePartialJson, pipeAgentUIStreamToResponse, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, pruneMessages, readUIMessageStream, registerTelemetryIntegration, rerank, safeValidateUIMessages, simulateReadableStream, simulateStreamingMiddleware, smoothStream, stepCountIs, streamObject, streamText, systemModelMessageSchema, toolModelMessageSchema, uiMessageChunkSchema, userModelMessageSchema, validateUIMessages, wrapEmbeddingModel, wrapImageModel, wrapLanguageModel, wrapProvider };
package/dist/index.d.ts CHANGED
@@ -732,6 +732,10 @@ type ToolApprovalRequestOutput<TOOLS extends ToolSet> = {
732
732
  * Tool call that the approval request is for.
733
733
  */
734
734
  toolCall: TypedToolCall<TOOLS>;
735
+ /**
736
+ * HMAC-SHA256 signature binding this approval request to its tool call.
737
+ */
738
+ signature?: string;
735
739
  };
736
740
 
737
741
  type StaticToolError<TOOLS extends ToolSet> = ValueOf<{
@@ -1165,9 +1169,9 @@ interface GenerateTextResult<TOOLS extends ToolSet, OUTPUT extends Output> {
1165
1169
  readonly output: InferCompleteOutput<OUTPUT>;
1166
1170
  }
1167
1171
 
1168
- declare const symbol$j: unique symbol;
1172
+ declare const symbol$k: unique symbol;
1169
1173
  declare class InvalidToolInputError extends AISDKError {
1170
- private readonly [symbol$j];
1174
+ private readonly [symbol$k];
1171
1175
  readonly toolName: string;
1172
1176
  readonly toolInput: string;
1173
1177
  constructor({ toolInput, toolName, cause, message, }: {
@@ -1179,9 +1183,9 @@ declare class InvalidToolInputError extends AISDKError {
1179
1183
  static isInstance(error: unknown): error is InvalidToolInputError;
1180
1184
  }
1181
1185
 
1182
- declare const symbol$i: unique symbol;
1186
+ declare const symbol$j: unique symbol;
1183
1187
  declare class NoSuchToolError extends AISDKError {
1184
- private readonly [symbol$i];
1188
+ private readonly [symbol$j];
1185
1189
  readonly toolName: string;
1186
1190
  readonly availableTools: string[] | undefined;
1187
1191
  constructor({ toolName, availableTools, message, }: {
@@ -1345,7 +1349,7 @@ type GenerateTextOnFinishCallback<TOOLS extends ToolSet> = (event: OnFinishEvent
1345
1349
  * @returns
1346
1350
  * A result object that contains the generated text, the results of the tool calls, and additional information.
1347
1351
  */
1348
- declare function generateText<TOOLS extends ToolSet, OUTPUT extends Output = Output<string, string>>({ model: modelArg, tools, toolChoice, system, prompt, messages, allowSystemInMessages, maxRetries: maxRetriesArg, abortSignal, timeout, headers, stopWhen, experimental_output, output, experimental_telemetry: telemetry, providerOptions, experimental_activeTools, activeTools, experimental_prepareStep, prepareStep, experimental_repairToolCall: repairToolCall, experimental_download: download, experimental_context, experimental_include: include, _internal: { generateId }, experimental_onStart: onStart, experimental_onStepStart: onStepStart, experimental_onToolCallStart: onToolCallStart, experimental_onToolCallFinish: onToolCallFinish, onStepFinish, onFinish, ...settings }: CallSettings & Prompt & {
1352
+ declare function generateText<TOOLS extends ToolSet, OUTPUT extends Output = Output<string, string>>({ model: modelArg, tools, toolChoice, system, prompt, messages, allowSystemInMessages, maxRetries: maxRetriesArg, abortSignal, timeout, headers, stopWhen, experimental_output, output, experimental_telemetry: telemetry, providerOptions, experimental_activeTools, activeTools, experimental_prepareStep, prepareStep, experimental_repairToolCall: repairToolCall, experimental_download: download, experimental_context, experimental_toolApprovalSecret, experimental_include: include, _internal: { generateId }, experimental_onStart: onStart, experimental_onStepStart: onStepStart, experimental_onToolCallStart: onToolCallStart, experimental_onToolCallFinish: onToolCallFinish, onStepFinish, onFinish, ...settings }: CallSettings & Prompt & {
1349
1353
  /**
1350
1354
  * The language model to use.
1351
1355
  */
@@ -1446,6 +1450,14 @@ declare function generateText<TOOLS extends ToolSet, OUTPUT extends Output = Out
1446
1450
  * @default undefined
1447
1451
  */
1448
1452
  experimental_context?: unknown;
1453
+ /**
1454
+ * Secret for HMAC-signing tool approval requests. When set, the server
1455
+ * signs each approval request at issuance and verifies the signature when
1456
+ * the approval is replayed, preventing client-forged approvals.
1457
+ *
1458
+ * Experimental (can break in patch releases).
1459
+ */
1460
+ experimental_toolApprovalSecret?: string | Uint8Array;
1449
1461
  /**
1450
1462
  * Settings for controlling what data is included in step results.
1451
1463
  * Disabling inclusion can help reduce memory usage when processing
@@ -1731,6 +1743,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
1731
1743
  id: string;
1732
1744
  approved?: never;
1733
1745
  reason?: never;
1746
+ signature?: string;
1734
1747
  };
1735
1748
  } | {
1736
1749
  state: 'approval-responded';
@@ -1742,6 +1755,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
1742
1755
  id: string;
1743
1756
  approved: boolean;
1744
1757
  reason?: string;
1758
+ signature?: string;
1745
1759
  };
1746
1760
  } | {
1747
1761
  state: 'output-available';
@@ -1755,6 +1769,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
1755
1769
  id: string;
1756
1770
  approved: true;
1757
1771
  reason?: string;
1772
+ signature?: string;
1758
1773
  };
1759
1774
  } | {
1760
1775
  state: 'output-error';
@@ -1768,6 +1783,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
1768
1783
  id: string;
1769
1784
  approved: true;
1770
1785
  reason?: string;
1786
+ signature?: string;
1771
1787
  };
1772
1788
  } | {
1773
1789
  state: 'output-denied';
@@ -1779,6 +1795,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
1779
1795
  id: string;
1780
1796
  approved: false;
1781
1797
  reason?: string;
1798
+ signature?: string;
1782
1799
  };
1783
1800
  });
1784
1801
  type ToolUIPart<TOOLS extends UITools = UITools> = ValueOf<{
@@ -1826,6 +1843,7 @@ type DynamicToolUIPart = {
1826
1843
  id: string;
1827
1844
  approved?: never;
1828
1845
  reason?: never;
1846
+ signature?: string;
1829
1847
  };
1830
1848
  } | {
1831
1849
  state: 'approval-responded';
@@ -1837,6 +1855,7 @@ type DynamicToolUIPart = {
1837
1855
  id: string;
1838
1856
  approved: boolean;
1839
1857
  reason?: string;
1858
+ signature?: string;
1840
1859
  };
1841
1860
  } | {
1842
1861
  state: 'output-available';
@@ -1850,6 +1869,7 @@ type DynamicToolUIPart = {
1850
1869
  id: string;
1851
1870
  approved: true;
1852
1871
  reason?: string;
1872
+ signature?: string;
1853
1873
  };
1854
1874
  } | {
1855
1875
  state: 'output-error';
@@ -1862,6 +1882,7 @@ type DynamicToolUIPart = {
1862
1882
  id: string;
1863
1883
  approved: true;
1864
1884
  reason?: string;
1885
+ signature?: string;
1865
1886
  };
1866
1887
  } | {
1867
1888
  state: 'output-denied';
@@ -1873,6 +1894,7 @@ type DynamicToolUIPart = {
1873
1894
  id: string;
1874
1895
  approved: false;
1875
1896
  reason?: string;
1897
+ signature?: string;
1876
1898
  };
1877
1899
  });
1878
1900
  /**
@@ -1989,6 +2011,7 @@ declare const uiMessageChunkSchema: _ai_sdk_provider_utils.LazySchema<{
1989
2011
  type: "tool-approval-request";
1990
2012
  approvalId: string;
1991
2013
  toolCallId: string;
2014
+ signature?: string | undefined;
1992
2015
  } | {
1993
2016
  type: "tool-output-available";
1994
2017
  toolCallId: string;
@@ -2126,6 +2149,7 @@ type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIDataTypes = UIDataT
2126
2149
  type: 'tool-approval-request';
2127
2150
  approvalId: string;
2128
2151
  toolCallId: string;
2152
+ signature?: string;
2129
2153
  } | {
2130
2154
  type: 'tool-output-available';
2131
2155
  toolCallId: string;
@@ -2732,7 +2756,7 @@ type StreamTextOnToolCallFinishCallback<TOOLS extends ToolSet = ToolSet> = (even
2732
2756
  * @returns
2733
2757
  * A result object for accessing different stream types and additional information.
2734
2758
  */
2735
- declare function streamText<TOOLS extends ToolSet, OUTPUT extends Output = Output<string, string, never>>({ model, tools, toolChoice, system, prompt, messages, allowSystemInMessages, maxRetries, abortSignal, timeout, headers, stopWhen, experimental_output, output, experimental_telemetry: telemetry, prepareStep, providerOptions, experimental_activeTools, activeTools, experimental_repairToolCall: repairToolCall, experimental_transform: transform, experimental_download: download, includeRawChunks, onChunk, onError, onFinish, onAbort, onStepFinish, experimental_onStart: onStart, experimental_onStepStart: onStepStart, experimental_onToolCallStart: onToolCallStart, experimental_onToolCallFinish: onToolCallFinish, experimental_context, experimental_include: include, _internal: { now, generateId }, ...settings }: CallSettings & Prompt & {
2759
+ declare function streamText<TOOLS extends ToolSet, OUTPUT extends Output = Output<string, string, never>>({ model, tools, toolChoice, system, prompt, messages, allowSystemInMessages, maxRetries, abortSignal, timeout, headers, stopWhen, experimental_output, output, experimental_telemetry: telemetry, prepareStep, providerOptions, experimental_activeTools, activeTools, experimental_repairToolCall: repairToolCall, experimental_transform: transform, experimental_download: download, includeRawChunks, onChunk, onError, onFinish, onAbort, onStepFinish, experimental_onStart: onStart, experimental_onStepStart: onStepStart, experimental_onToolCallStart: onToolCallStart, experimental_onToolCallFinish: onToolCallFinish, experimental_context, experimental_toolApprovalSecret, experimental_include: include, _internal: { now, generateId }, ...settings }: CallSettings & Prompt & {
2736
2760
  /**
2737
2761
  * The language model to use.
2738
2762
  */
@@ -2865,6 +2889,14 @@ declare function streamText<TOOLS extends ToolSet, OUTPUT extends Output = Outpu
2865
2889
  * @default undefined
2866
2890
  */
2867
2891
  experimental_context?: unknown;
2892
+ /**
2893
+ * Secret for HMAC-signing tool approval requests. When set, the server
2894
+ * signs each approval request at issuance and verifies the signature when
2895
+ * the approval is replayed, preventing client-forged approvals.
2896
+ *
2897
+ * Experimental (can break in patch releases).
2898
+ */
2899
+ experimental_toolApprovalSecret?: string | Uint8Array;
2868
2900
  /**
2869
2901
  * Settings for controlling what data is included in step results.
2870
2902
  * Disabling inclusion can help reduce memory usage when processing
@@ -4608,9 +4640,9 @@ declare function embedMany({ model: modelArg, values, maxParallelCalls, maxRetri
4608
4640
  maxParallelCalls?: number;
4609
4641
  }): Promise<EmbedManyResult>;
4610
4642
 
4611
- declare const symbol$h: unique symbol;
4643
+ declare const symbol$i: unique symbol;
4612
4644
  declare class InvalidArgumentError extends AISDKError {
4613
- private readonly [symbol$h];
4645
+ private readonly [symbol$i];
4614
4646
  readonly parameter: string;
4615
4647
  readonly value: unknown;
4616
4648
  constructor({ parameter, value, message, }: {
@@ -4697,9 +4729,9 @@ type SingleRequestTextStreamPart<TOOLS extends ToolSet> = {
4697
4729
  rawValue: unknown;
4698
4730
  };
4699
4731
 
4700
- declare const symbol$g: unique symbol;
4732
+ declare const symbol$h: unique symbol;
4701
4733
  declare class InvalidStreamPartError extends AISDKError {
4702
- private readonly [symbol$g];
4734
+ private readonly [symbol$h];
4703
4735
  readonly chunk: SingleRequestTextStreamPart<any>;
4704
4736
  constructor({ chunk, message, }: {
4705
4737
  chunk: SingleRequestTextStreamPart<any>;
@@ -4708,9 +4740,9 @@ declare class InvalidStreamPartError extends AISDKError {
4708
4740
  static isInstance(error: unknown): error is InvalidStreamPartError;
4709
4741
  }
4710
4742
 
4711
- declare const symbol$f: unique symbol;
4743
+ declare const symbol$g: unique symbol;
4712
4744
  declare class InvalidToolApprovalError extends AISDKError {
4713
- private readonly [symbol$f];
4745
+ private readonly [symbol$g];
4714
4746
  readonly approvalId: string;
4715
4747
  constructor({ approvalId }: {
4716
4748
  approvalId: string;
@@ -4718,6 +4750,19 @@ declare class InvalidToolApprovalError extends AISDKError {
4718
4750
  static isInstance(error: unknown): error is InvalidToolApprovalError;
4719
4751
  }
4720
4752
 
4753
+ declare const symbol$f: unique symbol;
4754
+ declare class InvalidToolApprovalSignatureError extends AISDKError {
4755
+ private readonly [symbol$f];
4756
+ readonly approvalId: string;
4757
+ readonly toolCallId: string;
4758
+ constructor({ approvalId, toolCallId, reason, }: {
4759
+ approvalId: string;
4760
+ toolCallId: string;
4761
+ reason: string;
4762
+ });
4763
+ static isInstance(error: unknown): error is InvalidToolApprovalSignatureError;
4764
+ }
4765
+
4721
4766
  declare const symbol$e: unique symbol;
4722
4767
  declare class ToolCallNotFoundForApprovalError extends AISDKError {
4723
4768
  private readonly [symbol$e];
@@ -6440,4 +6485,4 @@ declare function bindTelemetryIntegration(integration: TelemetryIntegration): Te
6440
6485
  */
6441
6486
  declare function registerTelemetryIntegration(integration: TelemetryIntegration): void;
6442
6487
 
6443
- export { AbstractChat, Agent, AgentCallParameters, AgentStreamParameters, AsyncIterableStream, CallSettings, CallWarning, ChatAddToolApproveResponseFunction, ChatAddToolOutputFunction, ChatInit, ChatOnDataCallback, ChatOnErrorCallback, ChatOnFinishCallback, ChatOnToolCallCallback, ChatRequestOptions, ChatState, ChatStatus, ChatTransport, ChunkDetector, CompletionRequestOptions, ContentPart, CreateUIMessage, DataUIPart, DeepPartial, DefaultChatTransport, DefaultGeneratedFile, DirectChatTransport, DirectChatTransportOptions, DynamicToolCall, DynamicToolError, DynamicToolResult, DynamicToolUIPart, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelMiddleware, EmbeddingModelUsage, ErrorHandler, ToolLoopAgent as Experimental_Agent, ToolLoopAgentSettings as Experimental_AgentSettings, DownloadFunction as Experimental_DownloadFunction, Experimental_GenerateImageResult, GeneratedFile as Experimental_GeneratedImage, InferAgentUIMessage as Experimental_InferAgentUIMessage, LogWarningsFunction as Experimental_LogWarningsFunction, SpeechResult as Experimental_SpeechResult, TranscriptionResult as Experimental_TranscriptionResult, FileUIPart, FinishReason, GenerateImageResult, GenerateObjectResult, GenerateTextOnFinishCallback, GenerateTextOnStartCallback, GenerateTextOnStepFinishCallback, GenerateTextOnStepStartCallback, GenerateTextOnToolCallFinishCallback, GenerateTextOnToolCallStartCallback, GenerateTextResult, GenerateVideoPrompt, GenerateVideoResult, GeneratedAudioFile, GeneratedFile, HttpChatTransport, HttpChatTransportInitOptions, ImageModel, ImageModelMiddleware, ImageModelProviderMetadata, ImageModelResponseMetadata, ImageModelUsage, InferAgentUIMessage, InferCompleteOutput as InferGenerateOutput, InferPartialOutput as InferStreamOutput, InferUIDataParts, InferUIMessageChunk, InferUITool, InferUITools, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolApprovalError, InvalidToolInputError, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelMiddleware, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, LogWarningsFunction, MessageConversionError, MissingToolResultsError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoSpeechGeneratedError, NoSuchProviderError, NoSuchToolError, NoTranscriptGeneratedError, NoVideoGeneratedError, ObjectStreamPart, OnFinishEvent, OnStartEvent, OnStepFinishEvent, OnStepStartEvent, OnToolCallFinishEvent, OnToolCallStartEvent, output as Output, PrepareReconnectToStreamRequest, PrepareSendMessagesRequest, PrepareStepFunction, PrepareStepResult, Prompt, Provider, ProviderMetadata, ProviderRegistryProvider, ReasoningOutput, ReasoningUIPart, RepairTextFunction, RerankResult, RerankingModel, RetryError, SafeValidateUIMessagesResult, SerialJobExecutor, SourceDocumentUIPart, SourceUrlUIPart, SpeechModel, SpeechModelResponseMetadata, StaticToolCall, StaticToolError, StaticToolOutputDenied, StaticToolResult, StepResult, StepStartUIPart, StopCondition, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStartCallback, StreamTextOnStepFinishCallback, StreamTextOnStepStartCallback, StreamTextOnToolCallFinishCallback, StreamTextOnToolCallStartCallback, StreamTextResult, StreamTextTransform, TelemetryIntegration, TelemetrySettings, TextStreamChatTransport, TextStreamPart, TextUIPart, TimeoutConfiguration, ToolApprovalRequestOutput, ToolCallNotFoundForApprovalError, ToolCallRepairError, ToolCallRepairFunction, ToolChoice, ToolLoopAgent, ToolLoopAgentOnFinishCallback, ToolLoopAgentOnStepFinishCallback, ToolLoopAgentSettings, ToolSet, ToolUIPart, TranscriptionModel, TranscriptionModelResponseMetadata, TypedToolCall, TypedToolError, TypedToolOutputDenied, TypedToolResult, UIDataPartSchemas, UIDataTypes, UIMessage, UIMessageChunk, UIMessagePart, UIMessageStreamError, UIMessageStreamOnFinishCallback, UIMessageStreamOnStepFinishCallback, UIMessageStreamOptions, UIMessageStreamWriter, UITool, UIToolInvocation, UITools, UI_MESSAGE_STREAM_HEADERS, UnsupportedModelVersionError, UseCompletionOptions, Warning, addToolInputExamplesMiddleware, assistantModelMessageSchema, bindTelemetryIntegration, callCompletionApi, consumeStream, convertFileListToFileUIParts, convertToModelMessages, cosineSimilarity, createAgentUIStream, createAgentUIStreamResponse, createDownload, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultEmbeddingSettingsMiddleware, defaultSettingsMiddleware, embed, embedMany, experimental_createProviderRegistry, experimental_customProvider, experimental_generateImage, generateSpeech as experimental_generateSpeech, experimental_generateVideo, transcribe as experimental_transcribe, extractJsonMiddleware, extractReasoningMiddleware, generateImage, generateObject, generateText, getStaticToolName, getTextFromDataUrl, getToolName, getToolOrDynamicToolName, hasToolCall, isDataUIPart, isDeepEqualData, isFileUIPart, isLoopFinished, isReasoningUIPart, isStaticToolUIPart, isTextUIPart, isToolOrDynamicToolUIPart, isToolUIPart, lastAssistantMessageIsCompleteWithApprovalResponses, lastAssistantMessageIsCompleteWithToolCalls, modelMessageSchema, parsePartialJson, pipeAgentUIStreamToResponse, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, pruneMessages, readUIMessageStream, registerTelemetryIntegration, rerank, safeValidateUIMessages, simulateReadableStream, simulateStreamingMiddleware, smoothStream, stepCountIs, streamObject, streamText, systemModelMessageSchema, toolModelMessageSchema, uiMessageChunkSchema, userModelMessageSchema, validateUIMessages, wrapEmbeddingModel, wrapImageModel, wrapLanguageModel, wrapProvider };
6488
+ export { AbstractChat, Agent, AgentCallParameters, AgentStreamParameters, AsyncIterableStream, CallSettings, CallWarning, ChatAddToolApproveResponseFunction, ChatAddToolOutputFunction, ChatInit, ChatOnDataCallback, ChatOnErrorCallback, ChatOnFinishCallback, ChatOnToolCallCallback, ChatRequestOptions, ChatState, ChatStatus, ChatTransport, ChunkDetector, CompletionRequestOptions, ContentPart, CreateUIMessage, DataUIPart, DeepPartial, DefaultChatTransport, DefaultGeneratedFile, DirectChatTransport, DirectChatTransportOptions, DynamicToolCall, DynamicToolError, DynamicToolResult, DynamicToolUIPart, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelMiddleware, EmbeddingModelUsage, ErrorHandler, ToolLoopAgent as Experimental_Agent, ToolLoopAgentSettings as Experimental_AgentSettings, DownloadFunction as Experimental_DownloadFunction, Experimental_GenerateImageResult, GeneratedFile as Experimental_GeneratedImage, InferAgentUIMessage as Experimental_InferAgentUIMessage, LogWarningsFunction as Experimental_LogWarningsFunction, SpeechResult as Experimental_SpeechResult, TranscriptionResult as Experimental_TranscriptionResult, FileUIPart, FinishReason, GenerateImageResult, GenerateObjectResult, GenerateTextOnFinishCallback, GenerateTextOnStartCallback, GenerateTextOnStepFinishCallback, GenerateTextOnStepStartCallback, GenerateTextOnToolCallFinishCallback, GenerateTextOnToolCallStartCallback, GenerateTextResult, GenerateVideoPrompt, GenerateVideoResult, GeneratedAudioFile, GeneratedFile, HttpChatTransport, HttpChatTransportInitOptions, ImageModel, ImageModelMiddleware, ImageModelProviderMetadata, ImageModelResponseMetadata, ImageModelUsage, InferAgentUIMessage, InferCompleteOutput as InferGenerateOutput, InferPartialOutput as InferStreamOutput, InferUIDataParts, InferUIMessageChunk, InferUITool, InferUITools, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolApprovalError, InvalidToolApprovalSignatureError, InvalidToolInputError, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelMiddleware, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, LogWarningsFunction, MessageConversionError, MissingToolResultsError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoSpeechGeneratedError, NoSuchProviderError, NoSuchToolError, NoTranscriptGeneratedError, NoVideoGeneratedError, ObjectStreamPart, OnFinishEvent, OnStartEvent, OnStepFinishEvent, OnStepStartEvent, OnToolCallFinishEvent, OnToolCallStartEvent, output as Output, PrepareReconnectToStreamRequest, PrepareSendMessagesRequest, PrepareStepFunction, PrepareStepResult, Prompt, Provider, ProviderMetadata, ProviderRegistryProvider, ReasoningOutput, ReasoningUIPart, RepairTextFunction, RerankResult, RerankingModel, RetryError, SafeValidateUIMessagesResult, SerialJobExecutor, SourceDocumentUIPart, SourceUrlUIPart, SpeechModel, SpeechModelResponseMetadata, StaticToolCall, StaticToolError, StaticToolOutputDenied, StaticToolResult, StepResult, StepStartUIPart, StopCondition, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStartCallback, StreamTextOnStepFinishCallback, StreamTextOnStepStartCallback, StreamTextOnToolCallFinishCallback, StreamTextOnToolCallStartCallback, StreamTextResult, StreamTextTransform, TelemetryIntegration, TelemetrySettings, TextStreamChatTransport, TextStreamPart, TextUIPart, TimeoutConfiguration, ToolApprovalRequestOutput, ToolCallNotFoundForApprovalError, ToolCallRepairError, ToolCallRepairFunction, ToolChoice, ToolLoopAgent, ToolLoopAgentOnFinishCallback, ToolLoopAgentOnStepFinishCallback, ToolLoopAgentSettings, ToolSet, ToolUIPart, TranscriptionModel, TranscriptionModelResponseMetadata, TypedToolCall, TypedToolError, TypedToolOutputDenied, TypedToolResult, UIDataPartSchemas, UIDataTypes, UIMessage, UIMessageChunk, UIMessagePart, UIMessageStreamError, UIMessageStreamOnFinishCallback, UIMessageStreamOnStepFinishCallback, UIMessageStreamOptions, UIMessageStreamWriter, UITool, UIToolInvocation, UITools, UI_MESSAGE_STREAM_HEADERS, UnsupportedModelVersionError, UseCompletionOptions, Warning, addToolInputExamplesMiddleware, assistantModelMessageSchema, bindTelemetryIntegration, callCompletionApi, consumeStream, convertFileListToFileUIParts, convertToModelMessages, cosineSimilarity, createAgentUIStream, createAgentUIStreamResponse, createDownload, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultEmbeddingSettingsMiddleware, defaultSettingsMiddleware, embed, embedMany, experimental_createProviderRegistry, experimental_customProvider, experimental_generateImage, generateSpeech as experimental_generateSpeech, experimental_generateVideo, transcribe as experimental_transcribe, extractJsonMiddleware, extractReasoningMiddleware, generateImage, generateObject, generateText, getStaticToolName, getTextFromDataUrl, getToolName, getToolOrDynamicToolName, hasToolCall, isDataUIPart, isDeepEqualData, isFileUIPart, isLoopFinished, isReasoningUIPart, isStaticToolUIPart, isTextUIPart, isToolOrDynamicToolUIPart, isToolUIPart, lastAssistantMessageIsCompleteWithApprovalResponses, lastAssistantMessageIsCompleteWithToolCalls, modelMessageSchema, parsePartialJson, pipeAgentUIStreamToResponse, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, pruneMessages, readUIMessageStream, registerTelemetryIntegration, rerank, safeValidateUIMessages, simulateReadableStream, simulateStreamingMiddleware, smoothStream, stepCountIs, streamObject, streamText, systemModelMessageSchema, toolModelMessageSchema, uiMessageChunkSchema, userModelMessageSchema, validateUIMessages, wrapEmbeddingModel, wrapImageModel, wrapLanguageModel, wrapProvider };