@ai-sdk/anthropic 3.0.0-beta.65 → 3.0.0-beta.67
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 +15 -0
- package/dist/index.d.mts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +28 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +41 -43
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +13 -13
- package/dist/internal/index.d.ts +13 -13
- package/dist/internal/index.js +27 -29
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +40 -42
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/internal/index.mjs
CHANGED
|
@@ -698,7 +698,7 @@ var CacheControlValidator = class {
|
|
|
698
698
|
};
|
|
699
699
|
|
|
700
700
|
// src/tool/text-editor_20250728.ts
|
|
701
|
-
import {
|
|
701
|
+
import { createProviderToolFactory } from "@ai-sdk/provider-utils";
|
|
702
702
|
import { z as z4 } from "zod/v4";
|
|
703
703
|
import { lazySchema as lazySchema3, zodSchema as zodSchema3 } from "@ai-sdk/provider-utils";
|
|
704
704
|
var textEditor_20250728ArgsSchema = lazySchema3(
|
|
@@ -721,7 +721,7 @@ var textEditor_20250728InputSchema = lazySchema3(
|
|
|
721
721
|
})
|
|
722
722
|
)
|
|
723
723
|
);
|
|
724
|
-
var factory =
|
|
724
|
+
var factory = createProviderToolFactory({
|
|
725
725
|
id: "anthropic.text_editor_20250728",
|
|
726
726
|
inputSchema: textEditor_20250728InputSchema
|
|
727
727
|
});
|
|
@@ -731,7 +731,7 @@ var textEditor_20250728 = (args = {}) => {
|
|
|
731
731
|
|
|
732
732
|
// src/tool/web-search_20250305.ts
|
|
733
733
|
import {
|
|
734
|
-
|
|
734
|
+
createProviderToolFactoryWithOutputSchema,
|
|
735
735
|
lazySchema as lazySchema4,
|
|
736
736
|
zodSchema as zodSchema4
|
|
737
737
|
} from "@ai-sdk/provider-utils";
|
|
@@ -772,7 +772,7 @@ var webSearch_20250305InputSchema = lazySchema4(
|
|
|
772
772
|
})
|
|
773
773
|
)
|
|
774
774
|
);
|
|
775
|
-
var factory2 =
|
|
775
|
+
var factory2 = createProviderToolFactoryWithOutputSchema({
|
|
776
776
|
id: "anthropic.web_search_20250305",
|
|
777
777
|
inputSchema: webSearch_20250305InputSchema,
|
|
778
778
|
outputSchema: webSearch_20250305OutputSchema
|
|
@@ -783,7 +783,7 @@ var webSearch_20250305 = (args = {}) => {
|
|
|
783
783
|
|
|
784
784
|
// src/tool/web-fetch-20250910.ts
|
|
785
785
|
import {
|
|
786
|
-
|
|
786
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema2,
|
|
787
787
|
lazySchema as lazySchema5,
|
|
788
788
|
zodSchema as zodSchema5
|
|
789
789
|
} from "@ai-sdk/provider-utils";
|
|
@@ -832,7 +832,7 @@ var webFetch_20250910InputSchema = lazySchema5(
|
|
|
832
832
|
})
|
|
833
833
|
)
|
|
834
834
|
);
|
|
835
|
-
var factory3 =
|
|
835
|
+
var factory3 = createProviderToolFactoryWithOutputSchema2({
|
|
836
836
|
id: "anthropic.web_fetch_20250910",
|
|
837
837
|
inputSchema: webFetch_20250910InputSchema,
|
|
838
838
|
outputSchema: webFetch_20250910OutputSchema
|
|
@@ -872,7 +872,7 @@ async function prepareTools({
|
|
|
872
872
|
});
|
|
873
873
|
break;
|
|
874
874
|
}
|
|
875
|
-
case "provider
|
|
875
|
+
case "provider": {
|
|
876
876
|
switch (tool.id) {
|
|
877
877
|
case "anthropic.code_execution_20250522": {
|
|
878
878
|
betas.add("code-execution-2025-05-22");
|
|
@@ -1099,7 +1099,7 @@ import {
|
|
|
1099
1099
|
|
|
1100
1100
|
// src/tool/code-execution_20250522.ts
|
|
1101
1101
|
import {
|
|
1102
|
-
|
|
1102
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema3,
|
|
1103
1103
|
lazySchema as lazySchema6,
|
|
1104
1104
|
zodSchema as zodSchema6
|
|
1105
1105
|
} from "@ai-sdk/provider-utils";
|
|
@@ -1121,7 +1121,7 @@ var codeExecution_20250522InputSchema = lazySchema6(
|
|
|
1121
1121
|
})
|
|
1122
1122
|
)
|
|
1123
1123
|
);
|
|
1124
|
-
var factory4 =
|
|
1124
|
+
var factory4 = createProviderToolFactoryWithOutputSchema3({
|
|
1125
1125
|
id: "anthropic.code_execution_20250522",
|
|
1126
1126
|
inputSchema: codeExecution_20250522InputSchema,
|
|
1127
1127
|
outputSchema: codeExecution_20250522OutputSchema
|
|
@@ -1132,7 +1132,7 @@ var codeExecution_20250522 = (args = {}) => {
|
|
|
1132
1132
|
|
|
1133
1133
|
// src/tool/code-execution_20250825.ts
|
|
1134
1134
|
import {
|
|
1135
|
-
|
|
1135
|
+
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4,
|
|
1136
1136
|
lazySchema as lazySchema7,
|
|
1137
1137
|
zodSchema as zodSchema7
|
|
1138
1138
|
} from "@ai-sdk/provider-utils";
|
|
@@ -1213,7 +1213,7 @@ var codeExecution_20250825InputSchema = lazySchema7(
|
|
|
1213
1213
|
])
|
|
1214
1214
|
)
|
|
1215
1215
|
);
|
|
1216
|
-
var factory5 =
|
|
1216
|
+
var factory5 = createProviderToolFactoryWithOutputSchema4({
|
|
1217
1217
|
id: "anthropic.code_execution_20250825",
|
|
1218
1218
|
inputSchema: codeExecution_20250825InputSchema,
|
|
1219
1219
|
outputSchema: codeExecution_20250825OutputSchema
|
|
@@ -2090,7 +2090,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2090
2090
|
betas.add("skills-2025-10-02");
|
|
2091
2091
|
betas.add("files-api-2025-04-14");
|
|
2092
2092
|
if (!(tools == null ? void 0 : tools.some(
|
|
2093
|
-
(tool) => tool.type === "provider
|
|
2093
|
+
(tool) => tool.type === "provider" && tool.id === "anthropic.code_execution_20250825"
|
|
2094
2094
|
))) {
|
|
2095
2095
|
warnings.push({
|
|
2096
2096
|
type: "other",
|
|
@@ -3029,22 +3029,20 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
3029
3029
|
);
|
|
3030
3030
|
const [streamForFirstChunk, streamForConsumer] = transformedStream.tee();
|
|
3031
3031
|
stream = streamForConsumer;
|
|
3032
|
-
const
|
|
3033
|
-
|
|
3032
|
+
const firstChunkReader = streamForFirstChunk.getReader();
|
|
3033
|
+
try {
|
|
3034
|
+
const { done } = await firstChunkReader.read();
|
|
3035
|
+
if (!done) {
|
|
3036
|
+
firstChunkReader.cancel();
|
|
3037
|
+
}
|
|
3038
|
+
} catch (error) {
|
|
3034
3039
|
try {
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
await reader.cancel();
|
|
3038
|
-
}
|
|
3039
|
-
} catch (error) {
|
|
3040
|
-
try {
|
|
3041
|
-
await reader.cancel();
|
|
3042
|
-
} catch (e) {
|
|
3043
|
-
}
|
|
3044
|
-
} finally {
|
|
3045
|
-
reader.releaseLock();
|
|
3040
|
+
firstChunkReader.cancel();
|
|
3041
|
+
} catch (e) {
|
|
3046
3042
|
}
|
|
3047
|
-
}
|
|
3043
|
+
} finally {
|
|
3044
|
+
firstChunkReader.releaseLock();
|
|
3045
|
+
}
|
|
3048
3046
|
return returnPromise.promise;
|
|
3049
3047
|
}
|
|
3050
3048
|
};
|
|
@@ -3096,7 +3094,7 @@ function getModelCapabilities(modelId) {
|
|
|
3096
3094
|
|
|
3097
3095
|
// src/tool/bash_20241022.ts
|
|
3098
3096
|
import {
|
|
3099
|
-
|
|
3097
|
+
createProviderToolFactory as createProviderToolFactory2,
|
|
3100
3098
|
lazySchema as lazySchema8,
|
|
3101
3099
|
zodSchema as zodSchema8
|
|
3102
3100
|
} from "@ai-sdk/provider-utils";
|
|
@@ -3109,14 +3107,14 @@ var bash_20241022InputSchema = lazySchema8(
|
|
|
3109
3107
|
})
|
|
3110
3108
|
)
|
|
3111
3109
|
);
|
|
3112
|
-
var bash_20241022 =
|
|
3110
|
+
var bash_20241022 = createProviderToolFactory2({
|
|
3113
3111
|
id: "anthropic.bash_20241022",
|
|
3114
3112
|
inputSchema: bash_20241022InputSchema
|
|
3115
3113
|
});
|
|
3116
3114
|
|
|
3117
3115
|
// src/tool/bash_20250124.ts
|
|
3118
3116
|
import {
|
|
3119
|
-
|
|
3117
|
+
createProviderToolFactory as createProviderToolFactory3,
|
|
3120
3118
|
lazySchema as lazySchema9,
|
|
3121
3119
|
zodSchema as zodSchema9
|
|
3122
3120
|
} from "@ai-sdk/provider-utils";
|
|
@@ -3129,14 +3127,14 @@ var bash_20250124InputSchema = lazySchema9(
|
|
|
3129
3127
|
})
|
|
3130
3128
|
)
|
|
3131
3129
|
);
|
|
3132
|
-
var bash_20250124 =
|
|
3130
|
+
var bash_20250124 = createProviderToolFactory3({
|
|
3133
3131
|
id: "anthropic.bash_20250124",
|
|
3134
3132
|
inputSchema: bash_20250124InputSchema
|
|
3135
3133
|
});
|
|
3136
3134
|
|
|
3137
3135
|
// src/tool/computer_20241022.ts
|
|
3138
3136
|
import {
|
|
3139
|
-
|
|
3137
|
+
createProviderToolFactory as createProviderToolFactory4,
|
|
3140
3138
|
lazySchema as lazySchema10,
|
|
3141
3139
|
zodSchema as zodSchema10
|
|
3142
3140
|
} from "@ai-sdk/provider-utils";
|
|
@@ -3161,14 +3159,14 @@ var computer_20241022InputSchema = lazySchema10(
|
|
|
3161
3159
|
})
|
|
3162
3160
|
)
|
|
3163
3161
|
);
|
|
3164
|
-
var computer_20241022 =
|
|
3162
|
+
var computer_20241022 = createProviderToolFactory4({
|
|
3165
3163
|
id: "anthropic.computer_20241022",
|
|
3166
3164
|
inputSchema: computer_20241022InputSchema
|
|
3167
3165
|
});
|
|
3168
3166
|
|
|
3169
3167
|
// src/tool/computer_20250124.ts
|
|
3170
3168
|
import {
|
|
3171
|
-
|
|
3169
|
+
createProviderToolFactory as createProviderToolFactory5,
|
|
3172
3170
|
lazySchema as lazySchema11,
|
|
3173
3171
|
zodSchema as zodSchema11
|
|
3174
3172
|
} from "@ai-sdk/provider-utils";
|
|
@@ -3203,14 +3201,14 @@ var computer_20250124InputSchema = lazySchema11(
|
|
|
3203
3201
|
})
|
|
3204
3202
|
)
|
|
3205
3203
|
);
|
|
3206
|
-
var computer_20250124 =
|
|
3204
|
+
var computer_20250124 = createProviderToolFactory5({
|
|
3207
3205
|
id: "anthropic.computer_20250124",
|
|
3208
3206
|
inputSchema: computer_20250124InputSchema
|
|
3209
3207
|
});
|
|
3210
3208
|
|
|
3211
3209
|
// src/tool/memory_20250818.ts
|
|
3212
3210
|
import {
|
|
3213
|
-
|
|
3211
|
+
createProviderToolFactory as createProviderToolFactory6,
|
|
3214
3212
|
lazySchema as lazySchema12,
|
|
3215
3213
|
zodSchema as zodSchema12
|
|
3216
3214
|
} from "@ai-sdk/provider-utils";
|
|
@@ -3252,14 +3250,14 @@ var memory_20250818InputSchema = lazySchema12(
|
|
|
3252
3250
|
])
|
|
3253
3251
|
)
|
|
3254
3252
|
);
|
|
3255
|
-
var memory_20250818 =
|
|
3253
|
+
var memory_20250818 = createProviderToolFactory6({
|
|
3256
3254
|
id: "anthropic.memory_20250818",
|
|
3257
3255
|
inputSchema: memory_20250818InputSchema
|
|
3258
3256
|
});
|
|
3259
3257
|
|
|
3260
3258
|
// src/tool/text-editor_20241022.ts
|
|
3261
3259
|
import {
|
|
3262
|
-
|
|
3260
|
+
createProviderToolFactory as createProviderToolFactory7,
|
|
3263
3261
|
lazySchema as lazySchema13,
|
|
3264
3262
|
zodSchema as zodSchema13
|
|
3265
3263
|
} from "@ai-sdk/provider-utils";
|
|
@@ -3277,14 +3275,14 @@ var textEditor_20241022InputSchema = lazySchema13(
|
|
|
3277
3275
|
})
|
|
3278
3276
|
)
|
|
3279
3277
|
);
|
|
3280
|
-
var textEditor_20241022 =
|
|
3278
|
+
var textEditor_20241022 = createProviderToolFactory7({
|
|
3281
3279
|
id: "anthropic.text_editor_20241022",
|
|
3282
3280
|
inputSchema: textEditor_20241022InputSchema
|
|
3283
3281
|
});
|
|
3284
3282
|
|
|
3285
3283
|
// src/tool/text-editor_20250124.ts
|
|
3286
3284
|
import {
|
|
3287
|
-
|
|
3285
|
+
createProviderToolFactory as createProviderToolFactory8,
|
|
3288
3286
|
lazySchema as lazySchema14,
|
|
3289
3287
|
zodSchema as zodSchema14
|
|
3290
3288
|
} from "@ai-sdk/provider-utils";
|
|
@@ -3302,14 +3300,14 @@ var textEditor_20250124InputSchema = lazySchema14(
|
|
|
3302
3300
|
})
|
|
3303
3301
|
)
|
|
3304
3302
|
);
|
|
3305
|
-
var textEditor_20250124 =
|
|
3303
|
+
var textEditor_20250124 = createProviderToolFactory8({
|
|
3306
3304
|
id: "anthropic.text_editor_20250124",
|
|
3307
3305
|
inputSchema: textEditor_20250124InputSchema
|
|
3308
3306
|
});
|
|
3309
3307
|
|
|
3310
3308
|
// src/tool/text-editor_20250429.ts
|
|
3311
3309
|
import {
|
|
3312
|
-
|
|
3310
|
+
createProviderToolFactory as createProviderToolFactory9,
|
|
3313
3311
|
lazySchema as lazySchema15,
|
|
3314
3312
|
zodSchema as zodSchema15
|
|
3315
3313
|
} from "@ai-sdk/provider-utils";
|
|
@@ -3327,7 +3325,7 @@ var textEditor_20250429InputSchema = lazySchema15(
|
|
|
3327
3325
|
})
|
|
3328
3326
|
)
|
|
3329
3327
|
);
|
|
3330
|
-
var textEditor_20250429 =
|
|
3328
|
+
var textEditor_20250429 = createProviderToolFactory9({
|
|
3331
3329
|
id: "anthropic.text_editor_20250429",
|
|
3332
3330
|
inputSchema: textEditor_20250429InputSchema
|
|
3333
3331
|
});
|