@ai-sdk/provider 3.0.17 → 3.0.19

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,17 @@
1
1
  # @ai-sdk/provider
2
2
 
3
+ ## 3.0.19
4
+
5
+ ### Patch Changes
6
+
7
+ - 739e9f6: Restore raw OpenAI custom-tool input deltas for consumers that forward them to Responses API clients. Mark streamed input with `inputEncoding: 'text'` so UI clients can display it progressively without JSON parsing. Preserve the encoding when partial UI messages are saved and resumed. Final provider tool-call inputs remain JSON-encoded.
8
+
9
+ ## 3.0.18
10
+
11
+ ### Patch Changes
12
+
13
+ - 3983fea: fix(provider): preserve media types on tool result file URLs and match full MIME types exactly when checking native URL support.
14
+
3
15
  ## 3.0.17
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1336,6 +1336,11 @@ type LanguageModelV3ToolResultOutput = {
1336
1336
  * URL of the file.
1337
1337
  */
1338
1338
  url: string;
1339
+ /**
1340
+ * IANA media type.
1341
+ * @see https://www.iana.org/assignments/media-types/media-types.xhtml
1342
+ */
1343
+ mediaType?: string;
1339
1344
  /**
1340
1345
  * Provider-specific options.
1341
1346
  */
@@ -1697,8 +1702,9 @@ type LanguageModelV3ToolCall = {
1697
1702
  */
1698
1703
  toolName: string;
1699
1704
  /**
1700
- * Stringified JSON object with the tool call arguments. Must match the
1701
- * parameters schema of the tool.
1705
+ * JSON-encoded tool input. Must match the input schema of the tool.
1706
+ * String inputs must also be JSON-encoded, even when input deltas use text
1707
+ * encoding.
1702
1708
  */
1703
1709
  input: string;
1704
1710
  /**
@@ -1934,6 +1940,12 @@ type LanguageModelV3StreamPart = {
1934
1940
  type: 'tool-input-start';
1935
1941
  id: string;
1936
1942
  toolName: string;
1943
+ /**
1944
+ * Encoding of the input deltas. Defaults to JSON when omitted.
1945
+ * Text deltas concatenate to a raw string. The final tool-call input
1946
+ * must still be JSON-encoded, regardless of the delta encoding.
1947
+ */
1948
+ inputEncoding?: 'json' | 'text';
1937
1949
  providerMetadata?: SharedV3ProviderMetadata;
1938
1950
  providerExecuted?: boolean;
1939
1951
  dynamic?: boolean;
package/dist/index.d.ts CHANGED
@@ -1336,6 +1336,11 @@ type LanguageModelV3ToolResultOutput = {
1336
1336
  * URL of the file.
1337
1337
  */
1338
1338
  url: string;
1339
+ /**
1340
+ * IANA media type.
1341
+ * @see https://www.iana.org/assignments/media-types/media-types.xhtml
1342
+ */
1343
+ mediaType?: string;
1339
1344
  /**
1340
1345
  * Provider-specific options.
1341
1346
  */
@@ -1697,8 +1702,9 @@ type LanguageModelV3ToolCall = {
1697
1702
  */
1698
1703
  toolName: string;
1699
1704
  /**
1700
- * Stringified JSON object with the tool call arguments. Must match the
1701
- * parameters schema of the tool.
1705
+ * JSON-encoded tool input. Must match the input schema of the tool.
1706
+ * String inputs must also be JSON-encoded, even when input deltas use text
1707
+ * encoding.
1702
1708
  */
1703
1709
  input: string;
1704
1710
  /**
@@ -1934,6 +1940,12 @@ type LanguageModelV3StreamPart = {
1934
1940
  type: 'tool-input-start';
1935
1941
  id: string;
1936
1942
  toolName: string;
1943
+ /**
1944
+ * Encoding of the input deltas. Defaults to JSON when omitted.
1945
+ * Text deltas concatenate to a raw string. The final tool-call input
1946
+ * must still be JSON-encoded, regardless of the delta encoding.
1947
+ */
1948
+ inputEncoding?: 'json' | 'text';
1937
1949
  providerMetadata?: SharedV3ProviderMetadata;
1938
1950
  providerExecuted?: boolean;
1939
1951
  dynamic?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/provider",
3
- "version": "3.0.17",
3
+ "version": "3.0.19",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -332,6 +332,12 @@ export type LanguageModelV3ToolResultOutput =
332
332
  */
333
333
  url: string;
334
334
 
335
+ /**
336
+ * IANA media type.
337
+ * @see https://www.iana.org/assignments/media-types/media-types.xhtml
338
+ */
339
+ mediaType?: string;
340
+
335
341
  /**
336
342
  * Provider-specific options.
337
343
  */
@@ -51,6 +51,12 @@ export type LanguageModelV3StreamPart =
51
51
  type: 'tool-input-start';
52
52
  id: string;
53
53
  toolName: string;
54
+ /**
55
+ * Encoding of the input deltas. Defaults to JSON when omitted.
56
+ * Text deltas concatenate to a raw string. The final tool-call input
57
+ * must still be JSON-encoded, regardless of the delta encoding.
58
+ */
59
+ inputEncoding?: 'json' | 'text';
54
60
  providerMetadata?: SharedV3ProviderMetadata;
55
61
  providerExecuted?: boolean;
56
62
  dynamic?: boolean;
@@ -17,8 +17,9 @@ export type LanguageModelV3ToolCall = {
17
17
  toolName: string;
18
18
 
19
19
  /**
20
- * Stringified JSON object with the tool call arguments. Must match the
21
- * parameters schema of the tool.
20
+ * JSON-encoded tool input. Must match the input schema of the tool.
21
+ * String inputs must also be JSON-encoded, even when input deltas use text
22
+ * encoding.
22
23
  */
23
24
  input: string;
24
25