@ai-sdk/provider-utils 4.0.0-beta.54 → 4.0.0-beta.55

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,11 @@
1
1
  # @ai-sdk/provider-utils
2
2
 
3
+ ## 4.0.0-beta.55
4
+
5
+ ### Patch Changes
6
+
7
+ - 50b70d6: feat(anthropic): add programmatic tool calling
8
+
3
9
  ## 4.0.0-beta.54
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1112,6 +1112,20 @@ The ID of the tool. Must follow the format `<provider-name>.<unique-tool-name>`.
1112
1112
  The arguments for configuring the tool. Must match the expected arguments defined by the provider for this tool.
1113
1113
  */
1114
1114
  args: Record<string, unknown>;
1115
+ /**
1116
+ * Whether this provider-executed tool supports deferred results.
1117
+ *
1118
+ * When true, the tool result may not be returned in the same turn as the
1119
+ * tool call (e.g., when using programmatic tool calling where a server tool
1120
+ * triggers a client-executed tool, and the server tool's result is deferred
1121
+ * until the client tool is resolved).
1122
+ *
1123
+ * This flag allows the AI SDK to handle tool results that arrive without
1124
+ * a matching tool call in the current response.
1125
+ *
1126
+ * @default false
1127
+ */
1128
+ supportsDeferredResults?: boolean;
1115
1129
  });
1116
1130
  /**
1117
1131
  * Infer the input type of a tool.
@@ -1184,10 +1198,21 @@ type ProviderToolFactoryWithOutputSchema<INPUT, OUTPUT, ARGS extends object> = (
1184
1198
  onInputDelta?: Tool<INPUT, OUTPUT>['onInputDelta'];
1185
1199
  onInputAvailable?: Tool<INPUT, OUTPUT>['onInputAvailable'];
1186
1200
  }) => Tool<INPUT, OUTPUT>;
1187
- declare function createProviderToolFactoryWithOutputSchema<INPUT, OUTPUT, ARGS extends object>({ id, inputSchema, outputSchema, }: {
1201
+ declare function createProviderToolFactoryWithOutputSchema<INPUT, OUTPUT, ARGS extends object>({ id, inputSchema, outputSchema, supportsDeferredResults, }: {
1188
1202
  id: `${string}.${string}`;
1189
1203
  inputSchema: FlexibleSchema<INPUT>;
1190
1204
  outputSchema: FlexibleSchema<OUTPUT>;
1205
+ /**
1206
+ * Whether this provider-executed tool supports deferred results.
1207
+ *
1208
+ * When true, the tool result may not be returned in the same turn as the
1209
+ * tool call (e.g., when using programmatic tool calling where a server tool
1210
+ * triggers a client-executed tool, and the server tool's result is deferred
1211
+ * until the client tool is resolved).
1212
+ *
1213
+ * @default false
1214
+ */
1215
+ supportsDeferredResults?: boolean;
1191
1216
  }): ProviderToolFactoryWithOutputSchema<INPUT, OUTPUT, ARGS>;
1192
1217
 
1193
1218
  /**
package/dist/index.d.ts CHANGED
@@ -1112,6 +1112,20 @@ The ID of the tool. Must follow the format `<provider-name>.<unique-tool-name>`.
1112
1112
  The arguments for configuring the tool. Must match the expected arguments defined by the provider for this tool.
1113
1113
  */
1114
1114
  args: Record<string, unknown>;
1115
+ /**
1116
+ * Whether this provider-executed tool supports deferred results.
1117
+ *
1118
+ * When true, the tool result may not be returned in the same turn as the
1119
+ * tool call (e.g., when using programmatic tool calling where a server tool
1120
+ * triggers a client-executed tool, and the server tool's result is deferred
1121
+ * until the client tool is resolved).
1122
+ *
1123
+ * This flag allows the AI SDK to handle tool results that arrive without
1124
+ * a matching tool call in the current response.
1125
+ *
1126
+ * @default false
1127
+ */
1128
+ supportsDeferredResults?: boolean;
1115
1129
  });
1116
1130
  /**
1117
1131
  * Infer the input type of a tool.
@@ -1184,10 +1198,21 @@ type ProviderToolFactoryWithOutputSchema<INPUT, OUTPUT, ARGS extends object> = (
1184
1198
  onInputDelta?: Tool<INPUT, OUTPUT>['onInputDelta'];
1185
1199
  onInputAvailable?: Tool<INPUT, OUTPUT>['onInputAvailable'];
1186
1200
  }) => Tool<INPUT, OUTPUT>;
1187
- declare function createProviderToolFactoryWithOutputSchema<INPUT, OUTPUT, ARGS extends object>({ id, inputSchema, outputSchema, }: {
1201
+ declare function createProviderToolFactoryWithOutputSchema<INPUT, OUTPUT, ARGS extends object>({ id, inputSchema, outputSchema, supportsDeferredResults, }: {
1188
1202
  id: `${string}.${string}`;
1189
1203
  inputSchema: FlexibleSchema<INPUT>;
1190
1204
  outputSchema: FlexibleSchema<OUTPUT>;
1205
+ /**
1206
+ * Whether this provider-executed tool supports deferred results.
1207
+ *
1208
+ * When true, the tool result may not be returned in the same turn as the
1209
+ * tool call (e.g., when using programmatic tool calling where a server tool
1210
+ * triggers a client-executed tool, and the server tool's result is deferred
1211
+ * until the client tool is resolved).
1212
+ *
1213
+ * @default false
1214
+ */
1215
+ supportsDeferredResults?: boolean;
1191
1216
  }): ProviderToolFactoryWithOutputSchema<INPUT, OUTPUT, ARGS>;
1192
1217
 
1193
1218
  /**
package/dist/index.js CHANGED
@@ -475,7 +475,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
475
475
  }
476
476
 
477
477
  // src/version.ts
478
- var VERSION = true ? "4.0.0-beta.54" : "0.0.0-test";
478
+ var VERSION = true ? "4.0.0-beta.55" : "0.0.0-test";
479
479
 
480
480
  // src/get-from-api.ts
481
481
  var getOriginalFetch = () => globalThis.fetch;
@@ -2349,7 +2349,8 @@ function createProviderToolFactory({
2349
2349
  function createProviderToolFactoryWithOutputSchema({
2350
2350
  id,
2351
2351
  inputSchema,
2352
- outputSchema
2352
+ outputSchema,
2353
+ supportsDeferredResults
2353
2354
  }) {
2354
2355
  return ({
2355
2356
  execute,
@@ -2370,7 +2371,8 @@ function createProviderToolFactoryWithOutputSchema({
2370
2371
  toModelOutput,
2371
2372
  onInputStart,
2372
2373
  onInputDelta,
2373
- onInputAvailable
2374
+ onInputAvailable,
2375
+ supportsDeferredResults
2374
2376
  });
2375
2377
  }
2376
2378