@ai-sdk/anthropic 2.0.0-canary.10 → 2.0.0-canary.12
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 +22 -0
- package/dist/index.d.mts +9 -19
- package/dist/index.d.ts +9 -19
- package/dist/index.js +209 -168
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +211 -170
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +2 -20
- package/dist/internal/index.d.ts +2 -20
- package/dist/internal/index.js +206 -165
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +208 -167
- package/dist/internal/index.mjs.map +1 -1
- package/internal.d.ts +1 -0
- package/package.json +5 -4
package/dist/internal/index.js
CHANGED
|
@@ -28,7 +28,7 @@ module.exports = __toCommonJS(internal_exports);
|
|
|
28
28
|
// src/anthropic-messages-language-model.ts
|
|
29
29
|
var import_provider3 = require("@ai-sdk/provider");
|
|
30
30
|
var import_provider_utils3 = require("@ai-sdk/provider-utils");
|
|
31
|
-
var
|
|
31
|
+
var import_zod3 = require("zod");
|
|
32
32
|
|
|
33
33
|
// src/anthropic-error.ts
|
|
34
34
|
var import_provider_utils = require("@ai-sdk/provider-utils");
|
|
@@ -45,6 +45,21 @@ var anthropicFailedResponseHandler = (0, import_provider_utils.createJsonErrorRe
|
|
|
45
45
|
errorToMessage: (data) => data.error.message
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
+
// src/anthropic-messages-options.ts
|
|
49
|
+
var import_zod2 = require("zod");
|
|
50
|
+
var anthropicProviderOptions = import_zod2.z.object({
|
|
51
|
+
/**
|
|
52
|
+
Include reasoning content in requests sent to the model. Defaults to `true`.
|
|
53
|
+
|
|
54
|
+
If you are experiencing issues with the model handling requests involving
|
|
55
|
+
*/
|
|
56
|
+
sendReasoning: import_zod2.z.boolean().optional(),
|
|
57
|
+
thinking: import_zod2.z.object({
|
|
58
|
+
type: import_zod2.z.union([import_zod2.z.literal("enabled"), import_zod2.z.literal("disabled")]),
|
|
59
|
+
budgetTokens: import_zod2.z.number().optional()
|
|
60
|
+
}).optional()
|
|
61
|
+
});
|
|
62
|
+
|
|
48
63
|
// src/anthropic-prepare-tools.ts
|
|
49
64
|
var import_provider = require("@ai-sdk/provider");
|
|
50
65
|
function prepareTools({
|
|
@@ -172,7 +187,7 @@ function prepareTools({
|
|
|
172
187
|
// src/convert-to-anthropic-messages-prompt.ts
|
|
173
188
|
var import_provider2 = require("@ai-sdk/provider");
|
|
174
189
|
var import_provider_utils2 = require("@ai-sdk/provider-utils");
|
|
175
|
-
function convertToAnthropicMessagesPrompt({
|
|
190
|
+
async function convertToAnthropicMessagesPrompt({
|
|
176
191
|
prompt,
|
|
177
192
|
sendReasoning,
|
|
178
193
|
warnings
|
|
@@ -335,12 +350,37 @@ function convertToAnthropicMessagesPrompt({
|
|
|
335
350
|
}
|
|
336
351
|
case "reasoning": {
|
|
337
352
|
if (sendReasoning) {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
cache_control: cacheControl
|
|
353
|
+
const reasoningMetadata = await (0, import_provider_utils2.parseProviderOptions)({
|
|
354
|
+
provider: "anthropic",
|
|
355
|
+
providerOptions: part.providerOptions,
|
|
356
|
+
schema: anthropicReasoningMetadataSchema
|
|
343
357
|
});
|
|
358
|
+
if (reasoningMetadata != null) {
|
|
359
|
+
if (reasoningMetadata.signature != null) {
|
|
360
|
+
anthropicContent.push({
|
|
361
|
+
type: "thinking",
|
|
362
|
+
thinking: part.text,
|
|
363
|
+
signature: reasoningMetadata.signature,
|
|
364
|
+
cache_control: cacheControl
|
|
365
|
+
});
|
|
366
|
+
} else if (reasoningMetadata.redactedData != null) {
|
|
367
|
+
anthropicContent.push({
|
|
368
|
+
type: "redacted_thinking",
|
|
369
|
+
data: reasoningMetadata.redactedData,
|
|
370
|
+
cache_control: cacheControl
|
|
371
|
+
});
|
|
372
|
+
} else {
|
|
373
|
+
warnings.push({
|
|
374
|
+
type: "other",
|
|
375
|
+
message: "unsupported reasoning metadata"
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
} else {
|
|
379
|
+
warnings.push({
|
|
380
|
+
type: "other",
|
|
381
|
+
message: "unsupported reasoning metadata"
|
|
382
|
+
});
|
|
383
|
+
}
|
|
344
384
|
} else {
|
|
345
385
|
warnings.push({
|
|
346
386
|
type: "other",
|
|
@@ -349,14 +389,6 @@ function convertToAnthropicMessagesPrompt({
|
|
|
349
389
|
}
|
|
350
390
|
break;
|
|
351
391
|
}
|
|
352
|
-
case "redacted-reasoning": {
|
|
353
|
-
anthropicContent.push({
|
|
354
|
-
type: "redacted_thinking",
|
|
355
|
-
data: part.data,
|
|
356
|
-
cache_control: cacheControl
|
|
357
|
-
});
|
|
358
|
-
break;
|
|
359
|
-
}
|
|
360
392
|
case "tool-call": {
|
|
361
393
|
anthropicContent.push({
|
|
362
394
|
type: "tool_use",
|
|
@@ -448,10 +480,9 @@ function mapAnthropicStopReason(finishReason) {
|
|
|
448
480
|
|
|
449
481
|
// src/anthropic-messages-language-model.ts
|
|
450
482
|
var AnthropicMessagesLanguageModel = class {
|
|
451
|
-
constructor(modelId,
|
|
483
|
+
constructor(modelId, config) {
|
|
452
484
|
this.specificationVersion = "v2";
|
|
453
485
|
this.modelId = modelId;
|
|
454
|
-
this.settings = settings;
|
|
455
486
|
this.config = config;
|
|
456
487
|
}
|
|
457
488
|
supportsUrl(url) {
|
|
@@ -507,15 +538,15 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
507
538
|
details: "JSON response format is not supported."
|
|
508
539
|
});
|
|
509
540
|
}
|
|
510
|
-
const
|
|
511
|
-
prompt,
|
|
512
|
-
sendReasoning: (_a = this.settings.sendReasoning) != null ? _a : true,
|
|
513
|
-
warnings
|
|
514
|
-
});
|
|
515
|
-
const anthropicOptions = (0, import_provider_utils3.parseProviderOptions)({
|
|
541
|
+
const anthropicOptions = await (0, import_provider_utils3.parseProviderOptions)({
|
|
516
542
|
provider: "anthropic",
|
|
517
543
|
providerOptions,
|
|
518
|
-
schema:
|
|
544
|
+
schema: anthropicProviderOptions
|
|
545
|
+
});
|
|
546
|
+
const { prompt: messagesPrompt, betas: messagesBetas } = await convertToAnthropicMessagesPrompt({
|
|
547
|
+
prompt,
|
|
548
|
+
sendReasoning: (_a = anthropicOptions == null ? void 0 : anthropicOptions.sendReasoning) != null ? _a : true,
|
|
549
|
+
warnings
|
|
519
550
|
});
|
|
520
551
|
const isThinking = ((_b = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _b.type) === "enabled";
|
|
521
552
|
const thinkingBudget = (_c = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _c.budgetTokens;
|
|
@@ -630,21 +661,24 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
630
661
|
case "thinking": {
|
|
631
662
|
content.push({
|
|
632
663
|
type: "reasoning",
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
signature: part.signature
|
|
664
|
+
text: part.thinking,
|
|
665
|
+
providerMetadata: {
|
|
666
|
+
anthropic: {
|
|
667
|
+
signature: part.signature
|
|
668
|
+
}
|
|
669
|
+
}
|
|
640
670
|
});
|
|
641
671
|
break;
|
|
642
672
|
}
|
|
643
673
|
case "redacted_thinking": {
|
|
644
674
|
content.push({
|
|
645
675
|
type: "reasoning",
|
|
646
|
-
|
|
647
|
-
|
|
676
|
+
text: "",
|
|
677
|
+
providerMetadata: {
|
|
678
|
+
anthropic: {
|
|
679
|
+
redactedData: part.data
|
|
680
|
+
}
|
|
681
|
+
}
|
|
648
682
|
});
|
|
649
683
|
break;
|
|
650
684
|
}
|
|
@@ -733,9 +767,14 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
733
767
|
case "redacted_thinking": {
|
|
734
768
|
controller.enqueue({
|
|
735
769
|
type: "reasoning",
|
|
736
|
-
|
|
737
|
-
|
|
770
|
+
text: "",
|
|
771
|
+
providerMetadata: {
|
|
772
|
+
anthropic: {
|
|
773
|
+
redactedData: value.content_block.data
|
|
774
|
+
}
|
|
775
|
+
}
|
|
738
776
|
});
|
|
777
|
+
controller.enqueue({ type: "reasoning-part-finish" });
|
|
739
778
|
return;
|
|
740
779
|
}
|
|
741
780
|
case "tool_use": {
|
|
@@ -782,7 +821,6 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
782
821
|
case "thinking_delta": {
|
|
783
822
|
controller.enqueue({
|
|
784
823
|
type: "reasoning",
|
|
785
|
-
reasoningType: "text",
|
|
786
824
|
text: value.delta.thinking
|
|
787
825
|
});
|
|
788
826
|
return;
|
|
@@ -791,9 +829,14 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
791
829
|
if (blockType === "thinking") {
|
|
792
830
|
controller.enqueue({
|
|
793
831
|
type: "reasoning",
|
|
794
|
-
|
|
795
|
-
|
|
832
|
+
text: "",
|
|
833
|
+
providerMetadata: {
|
|
834
|
+
anthropic: {
|
|
835
|
+
signature: value.delta.signature
|
|
836
|
+
}
|
|
837
|
+
}
|
|
796
838
|
});
|
|
839
|
+
controller.enqueue({ type: "reasoning-part-finish" });
|
|
797
840
|
}
|
|
798
841
|
return;
|
|
799
842
|
}
|
|
@@ -864,135 +907,133 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
864
907
|
};
|
|
865
908
|
}
|
|
866
909
|
};
|
|
867
|
-
var anthropicMessagesResponseSchema =
|
|
868
|
-
type:
|
|
869
|
-
id:
|
|
870
|
-
model:
|
|
871
|
-
content:
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
type:
|
|
875
|
-
text:
|
|
910
|
+
var anthropicMessagesResponseSchema = import_zod3.z.object({
|
|
911
|
+
type: import_zod3.z.literal("message"),
|
|
912
|
+
id: import_zod3.z.string().nullish(),
|
|
913
|
+
model: import_zod3.z.string().nullish(),
|
|
914
|
+
content: import_zod3.z.array(
|
|
915
|
+
import_zod3.z.discriminatedUnion("type", [
|
|
916
|
+
import_zod3.z.object({
|
|
917
|
+
type: import_zod3.z.literal("text"),
|
|
918
|
+
text: import_zod3.z.string()
|
|
876
919
|
}),
|
|
877
|
-
|
|
878
|
-
type:
|
|
879
|
-
thinking:
|
|
880
|
-
signature:
|
|
920
|
+
import_zod3.z.object({
|
|
921
|
+
type: import_zod3.z.literal("thinking"),
|
|
922
|
+
thinking: import_zod3.z.string(),
|
|
923
|
+
signature: import_zod3.z.string()
|
|
881
924
|
}),
|
|
882
|
-
|
|
883
|
-
type:
|
|
884
|
-
data:
|
|
925
|
+
import_zod3.z.object({
|
|
926
|
+
type: import_zod3.z.literal("redacted_thinking"),
|
|
927
|
+
data: import_zod3.z.string()
|
|
885
928
|
}),
|
|
886
|
-
|
|
887
|
-
type:
|
|
888
|
-
id:
|
|
889
|
-
name:
|
|
890
|
-
input:
|
|
929
|
+
import_zod3.z.object({
|
|
930
|
+
type: import_zod3.z.literal("tool_use"),
|
|
931
|
+
id: import_zod3.z.string(),
|
|
932
|
+
name: import_zod3.z.string(),
|
|
933
|
+
input: import_zod3.z.unknown()
|
|
891
934
|
})
|
|
892
935
|
])
|
|
893
936
|
),
|
|
894
|
-
stop_reason:
|
|
895
|
-
usage:
|
|
896
|
-
input_tokens:
|
|
897
|
-
output_tokens:
|
|
898
|
-
cache_creation_input_tokens:
|
|
899
|
-
cache_read_input_tokens:
|
|
937
|
+
stop_reason: import_zod3.z.string().nullish(),
|
|
938
|
+
usage: import_zod3.z.object({
|
|
939
|
+
input_tokens: import_zod3.z.number(),
|
|
940
|
+
output_tokens: import_zod3.z.number(),
|
|
941
|
+
cache_creation_input_tokens: import_zod3.z.number().nullish(),
|
|
942
|
+
cache_read_input_tokens: import_zod3.z.number().nullish()
|
|
900
943
|
})
|
|
901
944
|
});
|
|
902
|
-
var anthropicMessagesChunkSchema =
|
|
903
|
-
|
|
904
|
-
type:
|
|
905
|
-
message:
|
|
906
|
-
id:
|
|
907
|
-
model:
|
|
908
|
-
usage:
|
|
909
|
-
input_tokens:
|
|
910
|
-
output_tokens:
|
|
911
|
-
cache_creation_input_tokens:
|
|
912
|
-
cache_read_input_tokens:
|
|
945
|
+
var anthropicMessagesChunkSchema = import_zod3.z.discriminatedUnion("type", [
|
|
946
|
+
import_zod3.z.object({
|
|
947
|
+
type: import_zod3.z.literal("message_start"),
|
|
948
|
+
message: import_zod3.z.object({
|
|
949
|
+
id: import_zod3.z.string().nullish(),
|
|
950
|
+
model: import_zod3.z.string().nullish(),
|
|
951
|
+
usage: import_zod3.z.object({
|
|
952
|
+
input_tokens: import_zod3.z.number(),
|
|
953
|
+
output_tokens: import_zod3.z.number(),
|
|
954
|
+
cache_creation_input_tokens: import_zod3.z.number().nullish(),
|
|
955
|
+
cache_read_input_tokens: import_zod3.z.number().nullish()
|
|
913
956
|
})
|
|
914
957
|
})
|
|
915
958
|
}),
|
|
916
|
-
|
|
917
|
-
type:
|
|
918
|
-
index:
|
|
919
|
-
content_block:
|
|
920
|
-
|
|
921
|
-
type:
|
|
922
|
-
text:
|
|
959
|
+
import_zod3.z.object({
|
|
960
|
+
type: import_zod3.z.literal("content_block_start"),
|
|
961
|
+
index: import_zod3.z.number(),
|
|
962
|
+
content_block: import_zod3.z.discriminatedUnion("type", [
|
|
963
|
+
import_zod3.z.object({
|
|
964
|
+
type: import_zod3.z.literal("text"),
|
|
965
|
+
text: import_zod3.z.string()
|
|
923
966
|
}),
|
|
924
|
-
|
|
925
|
-
type:
|
|
926
|
-
thinking:
|
|
967
|
+
import_zod3.z.object({
|
|
968
|
+
type: import_zod3.z.literal("thinking"),
|
|
969
|
+
thinking: import_zod3.z.string()
|
|
927
970
|
}),
|
|
928
|
-
|
|
929
|
-
type:
|
|
930
|
-
id:
|
|
931
|
-
name:
|
|
971
|
+
import_zod3.z.object({
|
|
972
|
+
type: import_zod3.z.literal("tool_use"),
|
|
973
|
+
id: import_zod3.z.string(),
|
|
974
|
+
name: import_zod3.z.string()
|
|
932
975
|
}),
|
|
933
|
-
|
|
934
|
-
type:
|
|
935
|
-
data:
|
|
976
|
+
import_zod3.z.object({
|
|
977
|
+
type: import_zod3.z.literal("redacted_thinking"),
|
|
978
|
+
data: import_zod3.z.string()
|
|
936
979
|
})
|
|
937
980
|
])
|
|
938
981
|
}),
|
|
939
|
-
|
|
940
|
-
type:
|
|
941
|
-
index:
|
|
942
|
-
delta:
|
|
943
|
-
|
|
944
|
-
type:
|
|
945
|
-
partial_json:
|
|
982
|
+
import_zod3.z.object({
|
|
983
|
+
type: import_zod3.z.literal("content_block_delta"),
|
|
984
|
+
index: import_zod3.z.number(),
|
|
985
|
+
delta: import_zod3.z.discriminatedUnion("type", [
|
|
986
|
+
import_zod3.z.object({
|
|
987
|
+
type: import_zod3.z.literal("input_json_delta"),
|
|
988
|
+
partial_json: import_zod3.z.string()
|
|
946
989
|
}),
|
|
947
|
-
|
|
948
|
-
type:
|
|
949
|
-
text:
|
|
990
|
+
import_zod3.z.object({
|
|
991
|
+
type: import_zod3.z.literal("text_delta"),
|
|
992
|
+
text: import_zod3.z.string()
|
|
950
993
|
}),
|
|
951
|
-
|
|
952
|
-
type:
|
|
953
|
-
thinking:
|
|
994
|
+
import_zod3.z.object({
|
|
995
|
+
type: import_zod3.z.literal("thinking_delta"),
|
|
996
|
+
thinking: import_zod3.z.string()
|
|
954
997
|
}),
|
|
955
|
-
|
|
956
|
-
type:
|
|
957
|
-
signature:
|
|
998
|
+
import_zod3.z.object({
|
|
999
|
+
type: import_zod3.z.literal("signature_delta"),
|
|
1000
|
+
signature: import_zod3.z.string()
|
|
958
1001
|
})
|
|
959
1002
|
])
|
|
960
1003
|
}),
|
|
961
|
-
|
|
962
|
-
type:
|
|
963
|
-
index:
|
|
1004
|
+
import_zod3.z.object({
|
|
1005
|
+
type: import_zod3.z.literal("content_block_stop"),
|
|
1006
|
+
index: import_zod3.z.number()
|
|
964
1007
|
}),
|
|
965
|
-
|
|
966
|
-
type:
|
|
967
|
-
error:
|
|
968
|
-
type:
|
|
969
|
-
message:
|
|
1008
|
+
import_zod3.z.object({
|
|
1009
|
+
type: import_zod3.z.literal("error"),
|
|
1010
|
+
error: import_zod3.z.object({
|
|
1011
|
+
type: import_zod3.z.string(),
|
|
1012
|
+
message: import_zod3.z.string()
|
|
970
1013
|
})
|
|
971
1014
|
}),
|
|
972
|
-
|
|
973
|
-
type:
|
|
974
|
-
delta:
|
|
975
|
-
usage:
|
|
1015
|
+
import_zod3.z.object({
|
|
1016
|
+
type: import_zod3.z.literal("message_delta"),
|
|
1017
|
+
delta: import_zod3.z.object({ stop_reason: import_zod3.z.string().nullish() }),
|
|
1018
|
+
usage: import_zod3.z.object({ output_tokens: import_zod3.z.number() })
|
|
976
1019
|
}),
|
|
977
|
-
|
|
978
|
-
type:
|
|
1020
|
+
import_zod3.z.object({
|
|
1021
|
+
type: import_zod3.z.literal("message_stop")
|
|
979
1022
|
}),
|
|
980
|
-
|
|
981
|
-
type:
|
|
1023
|
+
import_zod3.z.object({
|
|
1024
|
+
type: import_zod3.z.literal("ping")
|
|
982
1025
|
})
|
|
983
1026
|
]);
|
|
984
|
-
var
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
budgetTokens: import_zod2.z.number().optional()
|
|
988
|
-
}).optional()
|
|
1027
|
+
var anthropicReasoningMetadataSchema = import_zod3.z.object({
|
|
1028
|
+
signature: import_zod3.z.string().optional(),
|
|
1029
|
+
redactedData: import_zod3.z.string().optional()
|
|
989
1030
|
});
|
|
990
1031
|
|
|
991
1032
|
// src/anthropic-tools.ts
|
|
992
|
-
var
|
|
993
|
-
var Bash20241022Parameters =
|
|
994
|
-
command:
|
|
995
|
-
restart:
|
|
1033
|
+
var import_zod4 = require("zod");
|
|
1034
|
+
var Bash20241022Parameters = import_zod4.z.object({
|
|
1035
|
+
command: import_zod4.z.string(),
|
|
1036
|
+
restart: import_zod4.z.boolean().optional()
|
|
996
1037
|
});
|
|
997
1038
|
function bashTool_20241022(options = {}) {
|
|
998
1039
|
return {
|
|
@@ -1004,9 +1045,9 @@ function bashTool_20241022(options = {}) {
|
|
|
1004
1045
|
experimental_toToolResultContent: options.experimental_toToolResultContent
|
|
1005
1046
|
};
|
|
1006
1047
|
}
|
|
1007
|
-
var Bash20250124Parameters =
|
|
1008
|
-
command:
|
|
1009
|
-
restart:
|
|
1048
|
+
var Bash20250124Parameters = import_zod4.z.object({
|
|
1049
|
+
command: import_zod4.z.string(),
|
|
1050
|
+
restart: import_zod4.z.boolean().optional()
|
|
1010
1051
|
});
|
|
1011
1052
|
function bashTool_20250124(options = {}) {
|
|
1012
1053
|
return {
|
|
@@ -1018,14 +1059,14 @@ function bashTool_20250124(options = {}) {
|
|
|
1018
1059
|
experimental_toToolResultContent: options.experimental_toToolResultContent
|
|
1019
1060
|
};
|
|
1020
1061
|
}
|
|
1021
|
-
var TextEditor20241022Parameters =
|
|
1022
|
-
command:
|
|
1023
|
-
path:
|
|
1024
|
-
file_text:
|
|
1025
|
-
insert_line:
|
|
1026
|
-
new_str:
|
|
1027
|
-
old_str:
|
|
1028
|
-
view_range:
|
|
1062
|
+
var TextEditor20241022Parameters = import_zod4.z.object({
|
|
1063
|
+
command: import_zod4.z.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
1064
|
+
path: import_zod4.z.string(),
|
|
1065
|
+
file_text: import_zod4.z.string().optional(),
|
|
1066
|
+
insert_line: import_zod4.z.number().int().optional(),
|
|
1067
|
+
new_str: import_zod4.z.string().optional(),
|
|
1068
|
+
old_str: import_zod4.z.string().optional(),
|
|
1069
|
+
view_range: import_zod4.z.array(import_zod4.z.number().int()).optional()
|
|
1029
1070
|
});
|
|
1030
1071
|
function textEditorTool_20241022(options = {}) {
|
|
1031
1072
|
return {
|
|
@@ -1037,14 +1078,14 @@ function textEditorTool_20241022(options = {}) {
|
|
|
1037
1078
|
experimental_toToolResultContent: options.experimental_toToolResultContent
|
|
1038
1079
|
};
|
|
1039
1080
|
}
|
|
1040
|
-
var TextEditor20250124Parameters =
|
|
1041
|
-
command:
|
|
1042
|
-
path:
|
|
1043
|
-
file_text:
|
|
1044
|
-
insert_line:
|
|
1045
|
-
new_str:
|
|
1046
|
-
old_str:
|
|
1047
|
-
view_range:
|
|
1081
|
+
var TextEditor20250124Parameters = import_zod4.z.object({
|
|
1082
|
+
command: import_zod4.z.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
|
|
1083
|
+
path: import_zod4.z.string(),
|
|
1084
|
+
file_text: import_zod4.z.string().optional(),
|
|
1085
|
+
insert_line: import_zod4.z.number().int().optional(),
|
|
1086
|
+
new_str: import_zod4.z.string().optional(),
|
|
1087
|
+
old_str: import_zod4.z.string().optional(),
|
|
1088
|
+
view_range: import_zod4.z.array(import_zod4.z.number().int()).optional()
|
|
1048
1089
|
});
|
|
1049
1090
|
function textEditorTool_20250124(options = {}) {
|
|
1050
1091
|
return {
|
|
@@ -1056,8 +1097,8 @@ function textEditorTool_20250124(options = {}) {
|
|
|
1056
1097
|
experimental_toToolResultContent: options.experimental_toToolResultContent
|
|
1057
1098
|
};
|
|
1058
1099
|
}
|
|
1059
|
-
var Computer20241022Parameters =
|
|
1060
|
-
action:
|
|
1100
|
+
var Computer20241022Parameters = import_zod4.z.object({
|
|
1101
|
+
action: import_zod4.z.enum([
|
|
1061
1102
|
"key",
|
|
1062
1103
|
"type",
|
|
1063
1104
|
"mouse_move",
|
|
@@ -1069,8 +1110,8 @@ var Computer20241022Parameters = import_zod3.z.object({
|
|
|
1069
1110
|
"screenshot",
|
|
1070
1111
|
"cursor_position"
|
|
1071
1112
|
]),
|
|
1072
|
-
coordinate:
|
|
1073
|
-
text:
|
|
1113
|
+
coordinate: import_zod4.z.array(import_zod4.z.number().int()).optional(),
|
|
1114
|
+
text: import_zod4.z.string().optional()
|
|
1074
1115
|
});
|
|
1075
1116
|
function computerTool_20241022(options) {
|
|
1076
1117
|
return {
|
|
@@ -1086,8 +1127,8 @@ function computerTool_20241022(options) {
|
|
|
1086
1127
|
experimental_toToolResultContent: options.experimental_toToolResultContent
|
|
1087
1128
|
};
|
|
1088
1129
|
}
|
|
1089
|
-
var Computer20250124Parameters =
|
|
1090
|
-
action:
|
|
1130
|
+
var Computer20250124Parameters = import_zod4.z.object({
|
|
1131
|
+
action: import_zod4.z.enum([
|
|
1091
1132
|
"key",
|
|
1092
1133
|
"hold_key",
|
|
1093
1134
|
"type",
|
|
@@ -1105,12 +1146,12 @@ var Computer20250124Parameters = import_zod3.z.object({
|
|
|
1105
1146
|
"wait",
|
|
1106
1147
|
"screenshot"
|
|
1107
1148
|
]),
|
|
1108
|
-
coordinate:
|
|
1109
|
-
duration:
|
|
1110
|
-
scroll_amount:
|
|
1111
|
-
scroll_direction:
|
|
1112
|
-
start_coordinate:
|
|
1113
|
-
text:
|
|
1149
|
+
coordinate: import_zod4.z.tuple([import_zod4.z.number().int(), import_zod4.z.number().int()]).optional(),
|
|
1150
|
+
duration: import_zod4.z.number().optional(),
|
|
1151
|
+
scroll_amount: import_zod4.z.number().optional(),
|
|
1152
|
+
scroll_direction: import_zod4.z.enum(["up", "down", "left", "right"]).optional(),
|
|
1153
|
+
start_coordinate: import_zod4.z.tuple([import_zod4.z.number().int(), import_zod4.z.number().int()]).optional(),
|
|
1154
|
+
text: import_zod4.z.string().optional()
|
|
1114
1155
|
});
|
|
1115
1156
|
function computerTool_20250124(options) {
|
|
1116
1157
|
return {
|