@ai-sdk/anthropic 4.0.0-beta.4 → 4.0.0-beta.40

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.
Files changed (50) hide show
  1. package/CHANGELOG.md +293 -4
  2. package/README.md +2 -0
  3. package/dist/index.d.ts +83 -58
  4. package/dist/index.js +1918 -1259
  5. package/dist/index.js.map +1 -1
  6. package/dist/internal/index.d.ts +85 -58
  7. package/dist/internal/index.js +1679 -1245
  8. package/dist/internal/index.js.map +1 -1
  9. package/docs/05-anthropic.mdx +115 -12
  10. package/package.json +14 -15
  11. package/src/{anthropic-messages-api.ts → anthropic-api.ts} +8 -4
  12. package/src/anthropic-files.ts +96 -0
  13. package/src/{anthropic-messages-language-model.ts → anthropic-language-model.ts} +239 -54
  14. package/src/anthropic-message-metadata.ts +0 -3
  15. package/src/{anthropic-messages-options.ts → anthropic-options.ts} +68 -11
  16. package/src/anthropic-prepare-tools.ts +12 -5
  17. package/src/anthropic-provider.ts +39 -10
  18. package/src/{convert-anthropic-messages-usage.ts → convert-anthropic-usage.ts} +3 -3
  19. package/src/{convert-to-anthropic-messages-prompt.ts → convert-to-anthropic-prompt.ts} +51 -28
  20. package/src/get-cache-control.ts +1 -1
  21. package/src/index.ts +1 -1
  22. package/src/internal/index.ts +11 -2
  23. package/src/sanitize-json-schema.ts +203 -0
  24. package/src/skills/anthropic-skills-api.ts +44 -0
  25. package/src/skills/anthropic-skills.ts +136 -0
  26. package/src/tool/bash_20241022.ts +2 -2
  27. package/src/tool/bash_20250124.ts +2 -2
  28. package/src/tool/code-execution_20250522.ts +2 -2
  29. package/src/tool/code-execution_20250825.ts +2 -2
  30. package/src/tool/code-execution_20260120.ts +2 -2
  31. package/src/tool/computer_20241022.ts +2 -2
  32. package/src/tool/computer_20250124.ts +2 -2
  33. package/src/tool/computer_20251124.ts +2 -2
  34. package/src/tool/memory_20250818.ts +2 -2
  35. package/src/tool/text-editor_20241022.ts +2 -2
  36. package/src/tool/text-editor_20250124.ts +2 -2
  37. package/src/tool/text-editor_20250429.ts +2 -2
  38. package/src/tool/text-editor_20250728.ts +2 -2
  39. package/src/tool/tool-search-bm25_20251119.ts +2 -2
  40. package/src/tool/tool-search-regex_20251119.ts +2 -2
  41. package/src/tool/web-fetch-20250910.ts +2 -2
  42. package/src/tool/web-fetch-20260209.ts +2 -2
  43. package/src/tool/web-search_20250305.ts +2 -2
  44. package/src/tool/web-search_20260209.ts +2 -2
  45. package/dist/index.d.mts +0 -1090
  46. package/dist/index.mjs +0 -5244
  47. package/dist/index.mjs.map +0 -1
  48. package/dist/internal/index.d.mts +0 -969
  49. package/dist/internal/index.mjs +0 -5136
  50. package/dist/internal/index.mjs.map +0 -1
@@ -0,0 +1,203 @@
1
+ import type { JSONSchema7, JSONSchema7Definition } from '@ai-sdk/provider';
2
+
3
+ const SUPPORTED_STRING_FORMATS = new Set([
4
+ 'date-time',
5
+ 'time',
6
+ 'date',
7
+ 'duration',
8
+ 'email',
9
+ 'hostname',
10
+ 'uri',
11
+ 'ipv4',
12
+ 'ipv6',
13
+ 'uuid',
14
+ ]);
15
+
16
+ const DESCRIPTION_CONSTRAINT_KEYS = [
17
+ 'minimum',
18
+ 'maximum',
19
+ 'exclusiveMinimum',
20
+ 'exclusiveMaximum',
21
+ 'multipleOf',
22
+ 'minLength',
23
+ 'maxLength',
24
+ 'pattern',
25
+ 'minItems',
26
+ 'maxItems',
27
+ 'uniqueItems',
28
+ 'minProperties',
29
+ 'maxProperties',
30
+ 'not',
31
+ ] satisfies Array<keyof JSONSchema7>;
32
+
33
+ /**
34
+ * Removes JSON Schema keywords that Anthropic rejects in
35
+ * `output_config.format.schema`.
36
+ *
37
+ * The full original schema is still used by AI SDK result validation. This
38
+ * only relaxes the schema sent to Anthropic's constrained decoder.
39
+ */
40
+ export function sanitizeJsonSchema(schema: JSONSchema7): JSONSchema7 {
41
+ return sanitizeSchema(schema) as JSONSchema7;
42
+ }
43
+
44
+ function sanitizeDefinition(
45
+ definition: JSONSchema7Definition,
46
+ ): JSONSchema7Definition {
47
+ if (typeof definition === 'boolean' || !isPlainObject(definition)) {
48
+ return definition;
49
+ }
50
+
51
+ return sanitizeSchema(definition as JSONSchema7);
52
+ }
53
+
54
+ function sanitizeSchema(schema: JSONSchema7): JSONSchema7 {
55
+ const result: JSONSchema7 = {};
56
+ const schemaWithDefs = schema as JSONSchema7 & {
57
+ $defs?: Record<string, JSONSchema7Definition>;
58
+ };
59
+
60
+ if (schema.$ref != null) {
61
+ return { $ref: schema.$ref };
62
+ }
63
+
64
+ if (schema.$schema != null) {
65
+ result.$schema = schema.$schema;
66
+ }
67
+
68
+ if (schema.$id != null) {
69
+ result.$id = schema.$id;
70
+ }
71
+
72
+ if (schema.title != null) {
73
+ result.title = schema.title;
74
+ }
75
+
76
+ if (schema.description != null) {
77
+ result.description = schema.description;
78
+ }
79
+
80
+ if (schema.default !== undefined) {
81
+ result.default = schema.default;
82
+ }
83
+
84
+ if (schema.const !== undefined) {
85
+ result.const = schema.const;
86
+ }
87
+
88
+ if (schema.enum != null) {
89
+ result.enum = schema.enum;
90
+ }
91
+
92
+ if (schema.type != null) {
93
+ result.type = schema.type;
94
+ }
95
+
96
+ if (schema.anyOf != null) {
97
+ result.anyOf = schema.anyOf.map(sanitizeDefinition);
98
+ } else if (schema.oneOf != null) {
99
+ result.anyOf = schema.oneOf.map(sanitizeDefinition);
100
+ }
101
+
102
+ if (schema.allOf != null) {
103
+ result.allOf = schema.allOf.map(sanitizeDefinition);
104
+ }
105
+
106
+ if (schema.definitions != null) {
107
+ result.definitions = Object.fromEntries(
108
+ Object.entries(schema.definitions).map(([name, definition]) => [
109
+ name,
110
+ sanitizeDefinition(definition),
111
+ ]),
112
+ );
113
+ }
114
+
115
+ if (schemaWithDefs.$defs != null) {
116
+ const resultWithDefs = result as JSONSchema7 & {
117
+ $defs?: Record<string, JSONSchema7Definition>;
118
+ };
119
+ resultWithDefs.$defs = Object.fromEntries(
120
+ Object.entries(schemaWithDefs.$defs).map(([name, definition]) => [
121
+ name,
122
+ sanitizeDefinition(definition),
123
+ ]),
124
+ );
125
+ }
126
+
127
+ if (schema.type === 'object' || schema.properties != null) {
128
+ if (schema.properties != null) {
129
+ result.properties = Object.fromEntries(
130
+ Object.entries(schema.properties).map(([name, definition]) => [
131
+ name,
132
+ sanitizeDefinition(definition),
133
+ ]),
134
+ );
135
+ }
136
+
137
+ result.additionalProperties = false;
138
+
139
+ if (schema.required != null) {
140
+ result.required = schema.required;
141
+ }
142
+ }
143
+
144
+ if (schema.items != null) {
145
+ result.items = Array.isArray(schema.items)
146
+ ? schema.items.map(sanitizeDefinition)
147
+ : sanitizeDefinition(schema.items);
148
+ }
149
+
150
+ if (
151
+ typeof schema.format === 'string' &&
152
+ SUPPORTED_STRING_FORMATS.has(schema.format)
153
+ ) {
154
+ result.format = schema.format;
155
+ }
156
+
157
+ const constraintDescription = getConstraintDescription(schema);
158
+ if (constraintDescription != null) {
159
+ result.description =
160
+ result.description == null
161
+ ? constraintDescription
162
+ : `${result.description}\n${constraintDescription}`;
163
+ }
164
+
165
+ return result;
166
+ }
167
+
168
+ function getConstraintDescription(schema: JSONSchema7): string | undefined {
169
+ const descriptions = DESCRIPTION_CONSTRAINT_KEYS.flatMap(key => {
170
+ const value = schema[key];
171
+
172
+ if (value == null || value === false) {
173
+ return [];
174
+ }
175
+
176
+ return `${formatConstraintName(key)}: ${formatConstraintValue(value)}`;
177
+ });
178
+
179
+ if (
180
+ typeof schema.format === 'string' &&
181
+ !SUPPORTED_STRING_FORMATS.has(schema.format)
182
+ ) {
183
+ descriptions.push(`format: ${schema.format}`);
184
+ }
185
+
186
+ return descriptions.length === 0 ? undefined : `${descriptions.join('; ')}.`;
187
+ }
188
+
189
+ function formatConstraintName(key: string): string {
190
+ return key.replace(/[A-Z]/g, match => ` ${match.toLowerCase()}`);
191
+ }
192
+
193
+ function formatConstraintValue(value: unknown): string {
194
+ if (typeof value === 'string') {
195
+ return value;
196
+ }
197
+
198
+ return JSON.stringify(value);
199
+ }
200
+
201
+ function isPlainObject(value: unknown): value is Record<string, unknown> {
202
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
203
+ }
@@ -0,0 +1,44 @@
1
+ import { lazySchema, zodSchema } from '@ai-sdk/provider-utils';
2
+ import { z } from 'zod/v4';
3
+
4
+ export const anthropicSkillResponseSchema = lazySchema(() =>
5
+ zodSchema(
6
+ z.object({
7
+ id: z.string(),
8
+ display_title: z.string().nullish(),
9
+ name: z.string().nullish(),
10
+ description: z.string().nullish(),
11
+ latest_version: z.string().nullish(),
12
+ source: z.string(),
13
+ created_at: z.string(),
14
+ updated_at: z.string(),
15
+ }),
16
+ ),
17
+ );
18
+
19
+ export type AnthropicSkillResponse = ReturnType<
20
+ typeof anthropicSkillResponseSchema
21
+ >['_type'];
22
+
23
+ export const anthropicSkillVersionListResponseSchema = lazySchema(() =>
24
+ zodSchema(
25
+ z.object({
26
+ data: z.array(
27
+ z.object({
28
+ version: z.string(),
29
+ }),
30
+ ),
31
+ }),
32
+ ),
33
+ );
34
+
35
+ export const anthropicSkillVersionResponseSchema = lazySchema(() =>
36
+ zodSchema(
37
+ z.object({
38
+ type: z.string(),
39
+ skill_id: z.string(),
40
+ name: z.string().nullish(),
41
+ description: z.string().nullish(),
42
+ }),
43
+ ),
44
+ );
@@ -0,0 +1,136 @@
1
+ import { SkillsV4, SharedV4Warning } from '@ai-sdk/provider';
2
+ import {
3
+ combineHeaders,
4
+ convertBase64ToUint8Array,
5
+ createJsonResponseHandler,
6
+ FetchFunction,
7
+ getFromApi,
8
+ postFormDataToApi,
9
+ Resolvable,
10
+ resolve,
11
+ } from '@ai-sdk/provider-utils';
12
+ import { anthropicFailedResponseHandler } from '../anthropic-error';
13
+ import {
14
+ anthropicSkillResponseSchema,
15
+ anthropicSkillVersionResponseSchema,
16
+ } from './anthropic-skills-api';
17
+
18
+ interface AnthropicSkillsConfig {
19
+ provider: string;
20
+ baseURL: string;
21
+ headers: Resolvable<Record<string, string | undefined>>;
22
+ fetch?: FetchFunction;
23
+ }
24
+
25
+ export class AnthropicSkills implements SkillsV4 {
26
+ readonly specificationVersion = 'v4';
27
+
28
+ get provider(): string {
29
+ return this.config.provider;
30
+ }
31
+
32
+ constructor(private readonly config: AnthropicSkillsConfig) {}
33
+
34
+ private async getHeaders(): Promise<Record<string, string | undefined>> {
35
+ return combineHeaders(await resolve(this.config.headers), {
36
+ 'anthropic-beta': 'skills-2025-10-02',
37
+ });
38
+ }
39
+
40
+ private async fetchVersionMetadata({
41
+ skillId,
42
+ version,
43
+ headers,
44
+ }: {
45
+ skillId: string;
46
+ version: string;
47
+ headers: Record<string, string | undefined>;
48
+ }): Promise<{ name?: string; description?: string }> {
49
+ const { value: versionResponse } = await getFromApi({
50
+ url: `${this.config.baseURL}/skills/${skillId}/versions/${version}`,
51
+ headers,
52
+ failedResponseHandler: anthropicFailedResponseHandler,
53
+ successfulResponseHandler: createJsonResponseHandler(
54
+ anthropicSkillVersionResponseSchema,
55
+ ),
56
+ fetch: this.config.fetch,
57
+ });
58
+
59
+ return {
60
+ ...(versionResponse.name != null ? { name: versionResponse.name } : {}),
61
+ ...(versionResponse.description != null
62
+ ? { description: versionResponse.description }
63
+ : {}),
64
+ };
65
+ }
66
+
67
+ async uploadSkill(
68
+ params: Parameters<SkillsV4['uploadSkill']>[0],
69
+ ): Promise<Awaited<ReturnType<SkillsV4['uploadSkill']>>> {
70
+ const warnings: SharedV4Warning[] = [];
71
+
72
+ const formData = new FormData();
73
+
74
+ if (params.displayTitle != null) {
75
+ formData.append('display_title', params.displayTitle);
76
+ }
77
+
78
+ for (const file of params.files) {
79
+ const content =
80
+ typeof file.content === 'string'
81
+ ? convertBase64ToUint8Array(file.content)
82
+ : file.content;
83
+
84
+ formData.append('files[]', new Blob([content]), file.path);
85
+ }
86
+
87
+ const headers = await this.getHeaders();
88
+
89
+ const { value: response } = await postFormDataToApi({
90
+ url: `${this.config.baseURL}/skills`,
91
+ headers,
92
+ formData,
93
+ failedResponseHandler: anthropicFailedResponseHandler,
94
+ successfulResponseHandler: createJsonResponseHandler(
95
+ anthropicSkillResponseSchema,
96
+ ),
97
+ fetch: this.config.fetch,
98
+ });
99
+
100
+ const versionMetadata =
101
+ response.latest_version != null
102
+ ? await this.fetchVersionMetadata({
103
+ skillId: response.id,
104
+ version: response.latest_version,
105
+ headers,
106
+ })
107
+ : {};
108
+
109
+ const name = versionMetadata.name ?? response.name;
110
+ const description = versionMetadata.description ?? response.description;
111
+
112
+ return {
113
+ providerReference: { anthropic: response.id },
114
+ ...(response.display_title != null
115
+ ? { displayTitle: response.display_title }
116
+ : {}),
117
+ ...(name != null ? { name } : {}),
118
+ ...(description != null ? { description } : {}),
119
+ ...(response.latest_version != null
120
+ ? { latestVersion: response.latest_version }
121
+ : {}),
122
+ providerMetadata: {
123
+ anthropic: {
124
+ ...(response.source != null ? { source: response.source } : {}),
125
+ ...(response.created_at != null
126
+ ? { createdAt: response.created_at }
127
+ : {}),
128
+ ...(response.updated_at != null
129
+ ? { updatedAt: response.updated_at }
130
+ : {}),
131
+ },
132
+ },
133
+ warnings,
134
+ };
135
+ }
136
+ }
@@ -1,5 +1,5 @@
1
1
  import {
2
- createProviderToolFactory,
2
+ createProviderDefinedToolFactory,
3
3
  lazySchema,
4
4
  zodSchema,
5
5
  } from '@ai-sdk/provider-utils';
@@ -14,7 +14,7 @@ const bash_20241022InputSchema = lazySchema(() =>
14
14
  ),
15
15
  );
16
16
 
17
- export const bash_20241022 = createProviderToolFactory<
17
+ export const bash_20241022 = createProviderDefinedToolFactory<
18
18
  {
19
19
  /**
20
20
  * The bash command to run. Required unless the tool is being restarted.
@@ -1,5 +1,5 @@
1
1
  import {
2
- createProviderToolFactory,
2
+ createProviderDefinedToolFactory,
3
3
  lazySchema,
4
4
  zodSchema,
5
5
  } from '@ai-sdk/provider-utils';
@@ -14,7 +14,7 @@ const bash_20250124InputSchema = lazySchema(() =>
14
14
  ),
15
15
  );
16
16
 
17
- export const bash_20250124 = createProviderToolFactory<
17
+ export const bash_20250124 = createProviderDefinedToolFactory<
18
18
  {
19
19
  /**
20
20
  * The bash command to run. Required unless the tool is being restarted.
@@ -1,5 +1,5 @@
1
1
  import {
2
- createProviderToolFactoryWithOutputSchema,
2
+ createProviderExecutedToolFactory,
3
3
  lazySchema,
4
4
  zodSchema,
5
5
  } from '@ai-sdk/provider-utils';
@@ -33,7 +33,7 @@ const codeExecution_20250522InputSchema = lazySchema(() =>
33
33
  ),
34
34
  );
35
35
 
36
- const factory = createProviderToolFactoryWithOutputSchema<
36
+ const factory = createProviderExecutedToolFactory<
37
37
  {
38
38
  /**
39
39
  * The Python code to execute.
@@ -1,5 +1,5 @@
1
1
  import {
2
- createProviderToolFactoryWithOutputSchema,
2
+ createProviderExecutedToolFactory,
3
3
  lazySchema,
4
4
  zodSchema,
5
5
  } from '@ai-sdk/provider-utils';
@@ -103,7 +103,7 @@ export const codeExecution_20250825InputSchema = lazySchema(() =>
103
103
  ),
104
104
  );
105
105
 
106
- const factory = createProviderToolFactoryWithOutputSchema<
106
+ const factory = createProviderExecutedToolFactory<
107
107
  | {
108
108
  type: 'programmatic-tool-call';
109
109
  /**
@@ -1,5 +1,5 @@
1
1
  import {
2
- createProviderToolFactoryWithOutputSchema,
2
+ createProviderExecutedToolFactory,
3
3
  lazySchema,
4
4
  zodSchema,
5
5
  } from '@ai-sdk/provider-utils';
@@ -117,7 +117,7 @@ export const codeExecution_20260120InputSchema = lazySchema(() =>
117
117
  ),
118
118
  );
119
119
 
120
- const factory = createProviderToolFactoryWithOutputSchema<
120
+ const factory = createProviderExecutedToolFactory<
121
121
  | {
122
122
  type: 'programmatic-tool-call';
123
123
  /**
@@ -1,5 +1,5 @@
1
1
  import {
2
- createProviderToolFactory,
2
+ createProviderDefinedToolFactory,
3
3
  lazySchema,
4
4
  zodSchema,
5
5
  } from '@ai-sdk/provider-utils';
@@ -26,7 +26,7 @@ const computer_20241022InputSchema = lazySchema(() =>
26
26
  ),
27
27
  );
28
28
 
29
- export const computer_20241022 = createProviderToolFactory<
29
+ export const computer_20241022 = createProviderDefinedToolFactory<
30
30
  {
31
31
  /**
32
32
  * The action to perform. The available actions are:
@@ -1,5 +1,5 @@
1
1
  import {
2
- createProviderToolFactory,
2
+ createProviderDefinedToolFactory,
3
3
  lazySchema,
4
4
  zodSchema,
5
5
  } from '@ai-sdk/provider-utils';
@@ -38,7 +38,7 @@ const computer_20250124InputSchema = lazySchema(() =>
38
38
  ),
39
39
  );
40
40
 
41
- export const computer_20250124 = createProviderToolFactory<
41
+ export const computer_20250124 = createProviderDefinedToolFactory<
42
42
  {
43
43
  /**
44
44
  * - `key`: Press a key or key-combination on the keyboard.
@@ -1,5 +1,5 @@
1
1
  import {
2
- createProviderToolFactory,
2
+ createProviderDefinedToolFactory,
3
3
  lazySchema,
4
4
  zodSchema,
5
5
  } from '@ai-sdk/provider-utils';
@@ -47,7 +47,7 @@ const computer_20251124InputSchema = lazySchema(() =>
47
47
  ),
48
48
  );
49
49
 
50
- export const computer_20251124 = createProviderToolFactory<
50
+ export const computer_20251124 = createProviderDefinedToolFactory<
51
51
  {
52
52
  /**
53
53
  * - `key`: Press a key or key-combination on the keyboard.
@@ -1,5 +1,5 @@
1
1
  import {
2
- createProviderToolFactory,
2
+ createProviderDefinedToolFactory,
3
3
  lazySchema,
4
4
  zodSchema,
5
5
  } from '@ai-sdk/provider-utils';
@@ -43,7 +43,7 @@ const memory_20250818InputSchema = lazySchema(() =>
43
43
  ),
44
44
  );
45
45
 
46
- export const memory_20250818 = createProviderToolFactory<
46
+ export const memory_20250818 = createProviderDefinedToolFactory<
47
47
  | { command: 'view'; path: string; view_range?: [number, number] }
48
48
  | { command: 'create'; path: string; file_text: string }
49
49
  | { command: 'str_replace'; path: string; old_str: string; new_str: string }
@@ -1,5 +1,5 @@
1
1
  import {
2
- createProviderToolFactory,
2
+ createProviderDefinedToolFactory,
3
3
  lazySchema,
4
4
  zodSchema,
5
5
  } from '@ai-sdk/provider-utils';
@@ -20,7 +20,7 @@ const textEditor_20241022InputSchema = lazySchema(() =>
20
20
  ),
21
21
  );
22
22
 
23
- export const textEditor_20241022 = createProviderToolFactory<
23
+ export const textEditor_20241022 = createProviderDefinedToolFactory<
24
24
  {
25
25
  /**
26
26
  * The commands to run. Allowed options are: `view`, `create`, `str_replace`, `insert`, `undo_edit`.
@@ -1,5 +1,5 @@
1
1
  import {
2
- createProviderToolFactory,
2
+ createProviderDefinedToolFactory,
3
3
  lazySchema,
4
4
  zodSchema,
5
5
  } from '@ai-sdk/provider-utils';
@@ -20,7 +20,7 @@ const textEditor_20250124InputSchema = lazySchema(() =>
20
20
  ),
21
21
  );
22
22
 
23
- export const textEditor_20250124 = createProviderToolFactory<
23
+ export const textEditor_20250124 = createProviderDefinedToolFactory<
24
24
  {
25
25
  /**
26
26
  * The commands to run. Allowed options are: `view`, `create`, `str_replace`, `insert`, `undo_edit`.
@@ -1,5 +1,5 @@
1
1
  import {
2
- createProviderToolFactory,
2
+ createProviderDefinedToolFactory,
3
3
  lazySchema,
4
4
  zodSchema,
5
5
  } from '@ai-sdk/provider-utils';
@@ -20,7 +20,7 @@ const textEditor_20250429InputSchema = lazySchema(() =>
20
20
  ),
21
21
  );
22
22
 
23
- export const textEditor_20250429 = createProviderToolFactory<
23
+ export const textEditor_20250429 = createProviderDefinedToolFactory<
24
24
  {
25
25
  /**
26
26
  * The commands to run. Allowed options are: `view`, `create`, `str_replace`, `insert`.
@@ -1,4 +1,4 @@
1
- import { createProviderToolFactory } from '@ai-sdk/provider-utils';
1
+ import { createProviderDefinedToolFactory } from '@ai-sdk/provider-utils';
2
2
  import { z } from 'zod/v4';
3
3
  import { lazySchema, zodSchema } from '@ai-sdk/provider-utils';
4
4
 
@@ -25,7 +25,7 @@ const textEditor_20250728InputSchema = lazySchema(() =>
25
25
  ),
26
26
  );
27
27
 
28
- const factory = createProviderToolFactory<
28
+ const factory = createProviderDefinedToolFactory<
29
29
  {
30
30
  /**
31
31
  * The commands to run. Allowed options are: `view`, `create`, `str_replace`, `insert`.
@@ -1,5 +1,5 @@
1
1
  import {
2
- createProviderToolFactoryWithOutputSchema,
2
+ createProviderExecutedToolFactory,
3
3
  lazySchema,
4
4
  zodSchema,
5
5
  } from '@ai-sdk/provider-utils';
@@ -40,7 +40,7 @@ const toolSearchBm25_20251119InputSchema = lazySchema(() =>
40
40
  ),
41
41
  );
42
42
 
43
- const factory = createProviderToolFactoryWithOutputSchema<
43
+ const factory = createProviderExecutedToolFactory<
44
44
  {
45
45
  /**
46
46
  * A natural language query to search for tools.
@@ -1,5 +1,5 @@
1
1
  import {
2
- createProviderToolFactoryWithOutputSchema,
2
+ createProviderExecutedToolFactory,
3
3
  lazySchema,
4
4
  zodSchema,
5
5
  } from '@ai-sdk/provider-utils';
@@ -46,7 +46,7 @@ const toolSearchRegex_20251119InputSchema = lazySchema(() =>
46
46
  ),
47
47
  );
48
48
 
49
- const factory = createProviderToolFactoryWithOutputSchema<
49
+ const factory = createProviderExecutedToolFactory<
50
50
  {
51
51
  /**
52
52
  * A regex pattern to search for tools.
@@ -1,5 +1,5 @@
1
1
  import {
2
- createProviderToolFactoryWithOutputSchema,
2
+ createProviderExecutedToolFactory,
3
3
  lazySchema,
4
4
  zodSchema,
5
5
  } from '@ai-sdk/provider-utils';
@@ -52,7 +52,7 @@ const webFetch_20250910InputSchema = lazySchema(() =>
52
52
  ),
53
53
  );
54
54
 
55
- const factory = createProviderToolFactoryWithOutputSchema<
55
+ const factory = createProviderExecutedToolFactory<
56
56
  {
57
57
  /**
58
58
  * The URL to fetch.
@@ -1,5 +1,5 @@
1
1
  import {
2
- createProviderToolFactoryWithOutputSchema,
2
+ createProviderExecutedToolFactory,
3
3
  lazySchema,
4
4
  zodSchema,
5
5
  } from '@ai-sdk/provider-utils';
@@ -52,7 +52,7 @@ const webFetch_20260209InputSchema = lazySchema(() =>
52
52
  ),
53
53
  );
54
54
 
55
- const factory = createProviderToolFactoryWithOutputSchema<
55
+ const factory = createProviderExecutedToolFactory<
56
56
  {
57
57
  /**
58
58
  * The URL to fetch.
@@ -1,5 +1,5 @@
1
1
  import {
2
- createProviderToolFactoryWithOutputSchema,
2
+ createProviderExecutedToolFactory,
3
3
  lazySchema,
4
4
  zodSchema,
5
5
  } from '@ai-sdk/provider-utils';
@@ -46,7 +46,7 @@ const webSearch_20250305InputSchema = lazySchema(() =>
46
46
  ),
47
47
  );
48
48
 
49
- const factory = createProviderToolFactoryWithOutputSchema<
49
+ const factory = createProviderExecutedToolFactory<
50
50
  {
51
51
  /**
52
52
  * The search query to execute.