@anthropic-ai/sdk 0.59.0 → 0.61.0

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 (75) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +34 -0
  3. package/client.d.mts +4 -3
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +4 -3
  6. package/client.d.ts.map +1 -1
  7. package/client.js +8 -7
  8. package/client.js.map +1 -1
  9. package/client.mjs +7 -6
  10. package/client.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/beta/beta.d.mts +4 -3
  13. package/resources/beta/beta.d.mts.map +1 -1
  14. package/resources/beta/beta.d.ts +4 -3
  15. package/resources/beta/beta.d.ts.map +1 -1
  16. package/resources/beta/beta.js.map +1 -1
  17. package/resources/beta/beta.mjs.map +1 -1
  18. package/resources/beta/index.d.mts +1 -1
  19. package/resources/beta/index.d.mts.map +1 -1
  20. package/resources/beta/index.d.ts +1 -1
  21. package/resources/beta/index.d.ts.map +1 -1
  22. package/resources/beta/index.js.map +1 -1
  23. package/resources/beta/index.mjs.map +1 -1
  24. package/resources/beta/messages/index.d.mts +1 -1
  25. package/resources/beta/messages/index.d.mts.map +1 -1
  26. package/resources/beta/messages/index.d.ts +1 -1
  27. package/resources/beta/messages/index.d.ts.map +1 -1
  28. package/resources/beta/messages/index.js.map +1 -1
  29. package/resources/beta/messages/index.mjs.map +1 -1
  30. package/resources/beta/messages/messages.d.mts +131 -56
  31. package/resources/beta/messages/messages.d.mts.map +1 -1
  32. package/resources/beta/messages/messages.d.ts +131 -56
  33. package/resources/beta/messages/messages.d.ts.map +1 -1
  34. package/resources/beta/messages/messages.js +2 -0
  35. package/resources/beta/messages/messages.js.map +1 -1
  36. package/resources/beta/messages/messages.mjs +2 -0
  37. package/resources/beta/messages/messages.mjs.map +1 -1
  38. package/resources/index.d.mts +1 -1
  39. package/resources/index.d.mts.map +1 -1
  40. package/resources/index.d.ts +1 -1
  41. package/resources/index.d.ts.map +1 -1
  42. package/resources/index.js.map +1 -1
  43. package/resources/index.mjs.map +1 -1
  44. package/resources/messages/index.d.mts +1 -1
  45. package/resources/messages/index.d.mts.map +1 -1
  46. package/resources/messages/index.d.ts +1 -1
  47. package/resources/messages/index.d.ts.map +1 -1
  48. package/resources/messages/index.js.map +1 -1
  49. package/resources/messages/index.mjs.map +1 -1
  50. package/resources/messages/messages.d.mts +28 -49
  51. package/resources/messages/messages.d.mts.map +1 -1
  52. package/resources/messages/messages.d.ts +28 -49
  53. package/resources/messages/messages.d.ts.map +1 -1
  54. package/resources/messages/messages.js +2 -0
  55. package/resources/messages/messages.js.map +1 -1
  56. package/resources/messages/messages.mjs +2 -0
  57. package/resources/messages/messages.mjs.map +1 -1
  58. package/resources/shared.d.mts +1 -0
  59. package/resources/shared.d.mts.map +1 -1
  60. package/resources/shared.d.ts +1 -0
  61. package/resources/shared.d.ts.map +1 -1
  62. package/src/client.ts +12 -6
  63. package/src/resources/beta/beta.ts +42 -1
  64. package/src/resources/beta/index.ts +19 -0
  65. package/src/resources/beta/messages/index.ts +19 -0
  66. package/src/resources/beta/messages/messages.ts +251 -50
  67. package/src/resources/index.ts +1 -0
  68. package/src/resources/messages/index.ts +1 -0
  69. package/src/resources/messages/messages.ts +34 -48
  70. package/src/resources/shared.ts +2 -0
  71. package/src/version.ts +1 -1
  72. package/version.d.mts +1 -1
  73. package/version.d.ts +1 -1
  74. package/version.js +1 -1
  75. package/version.mjs +1 -1
@@ -20,6 +20,14 @@ import {
20
20
  BetaBase64ImageSource,
21
21
  BetaBase64PDFBlock,
22
22
  BetaBase64PDFSource,
23
+ BetaBashCodeExecutionOutputBlock,
24
+ BetaBashCodeExecutionOutputBlockParam,
25
+ BetaBashCodeExecutionResultBlock,
26
+ BetaBashCodeExecutionResultBlockParam,
27
+ BetaBashCodeExecutionToolResultBlock,
28
+ BetaBashCodeExecutionToolResultBlockParam,
29
+ BetaBashCodeExecutionToolResultError,
30
+ BetaBashCodeExecutionToolResultErrorParam,
23
31
  BetaCacheControlEphemeral,
24
32
  BetaCacheCreation,
25
33
  BetaCitationCharLocation,
@@ -39,6 +47,7 @@ import {
39
47
  BetaCodeExecutionResultBlock,
40
48
  BetaCodeExecutionResultBlockParam,
41
49
  BetaCodeExecutionTool20250522,
50
+ BetaCodeExecutionTool20250825,
42
51
  BetaCodeExecutionToolResultBlock,
43
52
  BetaCodeExecutionToolResultBlockContent,
44
53
  BetaCodeExecutionToolResultBlockParam,
@@ -91,6 +100,16 @@ import {
91
100
  BetaTextCitation,
92
101
  BetaTextCitationParam,
93
102
  BetaTextDelta,
103
+ BetaTextEditorCodeExecutionCreateResultBlock,
104
+ BetaTextEditorCodeExecutionCreateResultBlockParam,
105
+ BetaTextEditorCodeExecutionStrReplaceResultBlock,
106
+ BetaTextEditorCodeExecutionStrReplaceResultBlockParam,
107
+ BetaTextEditorCodeExecutionToolResultBlock,
108
+ BetaTextEditorCodeExecutionToolResultBlockParam,
109
+ BetaTextEditorCodeExecutionToolResultError,
110
+ BetaTextEditorCodeExecutionToolResultErrorParam,
111
+ BetaTextEditorCodeExecutionViewResultBlock,
112
+ BetaTextEditorCodeExecutionViewResultBlockParam,
94
113
  BetaThinkingBlock,
95
114
  BetaThinkingBlockParam,
96
115
  BetaThinkingConfigDisabled,
@@ -156,7 +175,8 @@ export type AnthropicBeta =
156
175
  | 'dev-full-thinking-2025-05-14'
157
176
  | 'interleaved-thinking-2025-05-14'
158
177
  | 'code-execution-2025-05-22'
159
- | 'extended-cache-ttl-2025-04-11';
178
+ | 'extended-cache-ttl-2025-04-11'
179
+ | 'context-1m-2025-08-07';
160
180
 
161
181
  export interface BetaAPIError {
162
182
  message: string;
@@ -190,6 +210,8 @@ export type BetaError =
190
210
  export interface BetaErrorResponse {
191
211
  error: BetaError;
192
212
 
213
+ request_id: string | null;
214
+
193
215
  type: 'error';
194
216
  }
195
217
 
@@ -261,6 +283,14 @@ export declare namespace Beta {
261
283
  Messages as Messages,
262
284
  type BetaBase64ImageSource as BetaBase64ImageSource,
263
285
  type BetaBase64PDFSource as BetaBase64PDFSource,
286
+ type BetaBashCodeExecutionOutputBlock as BetaBashCodeExecutionOutputBlock,
287
+ type BetaBashCodeExecutionOutputBlockParam as BetaBashCodeExecutionOutputBlockParam,
288
+ type BetaBashCodeExecutionResultBlock as BetaBashCodeExecutionResultBlock,
289
+ type BetaBashCodeExecutionResultBlockParam as BetaBashCodeExecutionResultBlockParam,
290
+ type BetaBashCodeExecutionToolResultBlock as BetaBashCodeExecutionToolResultBlock,
291
+ type BetaBashCodeExecutionToolResultBlockParam as BetaBashCodeExecutionToolResultBlockParam,
292
+ type BetaBashCodeExecutionToolResultError as BetaBashCodeExecutionToolResultError,
293
+ type BetaBashCodeExecutionToolResultErrorParam as BetaBashCodeExecutionToolResultErrorParam,
264
294
  type BetaCacheControlEphemeral as BetaCacheControlEphemeral,
265
295
  type BetaCacheCreation as BetaCacheCreation,
266
296
  type BetaCitationCharLocation as BetaCitationCharLocation,
@@ -280,6 +310,7 @@ export declare namespace Beta {
280
310
  type BetaCodeExecutionResultBlock as BetaCodeExecutionResultBlock,
281
311
  type BetaCodeExecutionResultBlockParam as BetaCodeExecutionResultBlockParam,
282
312
  type BetaCodeExecutionTool20250522 as BetaCodeExecutionTool20250522,
313
+ type BetaCodeExecutionTool20250825 as BetaCodeExecutionTool20250825,
283
314
  type BetaCodeExecutionToolResultBlock as BetaCodeExecutionToolResultBlock,
284
315
  type BetaCodeExecutionToolResultBlockContent as BetaCodeExecutionToolResultBlockContent,
285
316
  type BetaCodeExecutionToolResultBlockParam as BetaCodeExecutionToolResultBlockParam,
@@ -332,6 +363,16 @@ export declare namespace Beta {
332
363
  type BetaTextCitation as BetaTextCitation,
333
364
  type BetaTextCitationParam as BetaTextCitationParam,
334
365
  type BetaTextDelta as BetaTextDelta,
366
+ type BetaTextEditorCodeExecutionCreateResultBlock as BetaTextEditorCodeExecutionCreateResultBlock,
367
+ type BetaTextEditorCodeExecutionCreateResultBlockParam as BetaTextEditorCodeExecutionCreateResultBlockParam,
368
+ type BetaTextEditorCodeExecutionStrReplaceResultBlock as BetaTextEditorCodeExecutionStrReplaceResultBlock,
369
+ type BetaTextEditorCodeExecutionStrReplaceResultBlockParam as BetaTextEditorCodeExecutionStrReplaceResultBlockParam,
370
+ type BetaTextEditorCodeExecutionToolResultBlock as BetaTextEditorCodeExecutionToolResultBlock,
371
+ type BetaTextEditorCodeExecutionToolResultBlockParam as BetaTextEditorCodeExecutionToolResultBlockParam,
372
+ type BetaTextEditorCodeExecutionToolResultError as BetaTextEditorCodeExecutionToolResultError,
373
+ type BetaTextEditorCodeExecutionToolResultErrorParam as BetaTextEditorCodeExecutionToolResultErrorParam,
374
+ type BetaTextEditorCodeExecutionViewResultBlock as BetaTextEditorCodeExecutionViewResultBlock,
375
+ type BetaTextEditorCodeExecutionViewResultBlockParam as BetaTextEditorCodeExecutionViewResultBlockParam,
335
376
  type BetaThinkingBlock as BetaThinkingBlock,
336
377
  type BetaThinkingBlockParam as BetaThinkingBlockParam,
337
378
  type BetaThinkingConfigDisabled as BetaThinkingConfigDisabled,
@@ -30,6 +30,14 @@ export {
30
30
  Messages,
31
31
  type BetaBase64ImageSource,
32
32
  type BetaBase64PDFSource,
33
+ type BetaBashCodeExecutionOutputBlock,
34
+ type BetaBashCodeExecutionOutputBlockParam,
35
+ type BetaBashCodeExecutionResultBlock,
36
+ type BetaBashCodeExecutionResultBlockParam,
37
+ type BetaBashCodeExecutionToolResultBlock,
38
+ type BetaBashCodeExecutionToolResultBlockParam,
39
+ type BetaBashCodeExecutionToolResultError,
40
+ type BetaBashCodeExecutionToolResultErrorParam,
33
41
  type BetaCacheControlEphemeral,
34
42
  type BetaCacheCreation,
35
43
  type BetaCitationCharLocation,
@@ -49,6 +57,7 @@ export {
49
57
  type BetaCodeExecutionResultBlock,
50
58
  type BetaCodeExecutionResultBlockParam,
51
59
  type BetaCodeExecutionTool20250522,
60
+ type BetaCodeExecutionTool20250825,
52
61
  type BetaCodeExecutionToolResultBlock,
53
62
  type BetaCodeExecutionToolResultBlockContent,
54
63
  type BetaCodeExecutionToolResultBlockParam,
@@ -101,6 +110,16 @@ export {
101
110
  type BetaTextCitation,
102
111
  type BetaTextCitationParam,
103
112
  type BetaTextDelta,
113
+ type BetaTextEditorCodeExecutionCreateResultBlock,
114
+ type BetaTextEditorCodeExecutionCreateResultBlockParam,
115
+ type BetaTextEditorCodeExecutionStrReplaceResultBlock,
116
+ type BetaTextEditorCodeExecutionStrReplaceResultBlockParam,
117
+ type BetaTextEditorCodeExecutionToolResultBlock,
118
+ type BetaTextEditorCodeExecutionToolResultBlockParam,
119
+ type BetaTextEditorCodeExecutionToolResultError,
120
+ type BetaTextEditorCodeExecutionToolResultErrorParam,
121
+ type BetaTextEditorCodeExecutionViewResultBlock,
122
+ type BetaTextEditorCodeExecutionViewResultBlockParam,
104
123
  type BetaThinkingBlock,
105
124
  type BetaThinkingBlockParam,
106
125
  type BetaThinkingConfigDisabled,
@@ -23,6 +23,14 @@ export {
23
23
  Messages,
24
24
  type BetaBase64ImageSource,
25
25
  type BetaBase64PDFSource,
26
+ type BetaBashCodeExecutionOutputBlock,
27
+ type BetaBashCodeExecutionOutputBlockParam,
28
+ type BetaBashCodeExecutionResultBlock,
29
+ type BetaBashCodeExecutionResultBlockParam,
30
+ type BetaBashCodeExecutionToolResultBlock,
31
+ type BetaBashCodeExecutionToolResultBlockParam,
32
+ type BetaBashCodeExecutionToolResultError,
33
+ type BetaBashCodeExecutionToolResultErrorParam,
26
34
  type BetaCacheControlEphemeral,
27
35
  type BetaCacheCreation,
28
36
  type BetaCitationCharLocation,
@@ -42,6 +50,7 @@ export {
42
50
  type BetaCodeExecutionResultBlock,
43
51
  type BetaCodeExecutionResultBlockParam,
44
52
  type BetaCodeExecutionTool20250522,
53
+ type BetaCodeExecutionTool20250825,
45
54
  type BetaCodeExecutionToolResultBlock,
46
55
  type BetaCodeExecutionToolResultBlockContent,
47
56
  type BetaCodeExecutionToolResultBlockParam,
@@ -94,6 +103,16 @@ export {
94
103
  type BetaTextCitation,
95
104
  type BetaTextCitationParam,
96
105
  type BetaTextDelta,
106
+ type BetaTextEditorCodeExecutionCreateResultBlock,
107
+ type BetaTextEditorCodeExecutionCreateResultBlockParam,
108
+ type BetaTextEditorCodeExecutionStrReplaceResultBlock,
109
+ type BetaTextEditorCodeExecutionStrReplaceResultBlockParam,
110
+ type BetaTextEditorCodeExecutionToolResultBlock,
111
+ type BetaTextEditorCodeExecutionToolResultBlockParam,
112
+ type BetaTextEditorCodeExecutionToolResultError,
113
+ type BetaTextEditorCodeExecutionToolResultErrorParam,
114
+ type BetaTextEditorCodeExecutionViewResultBlock,
115
+ type BetaTextEditorCodeExecutionViewResultBlockParam,
97
116
  type BetaThinkingBlock,
98
117
  type BetaThinkingBlockParam,
99
118
  type BetaThinkingConfigDisabled,
@@ -43,6 +43,8 @@ const DEPRECATED_MODELS: {
43
43
  'claude-3-opus-20240229': 'January 5th, 2026',
44
44
  'claude-2.1': 'July 21st, 2025',
45
45
  'claude-2.0': 'July 21st, 2025',
46
+ 'claude-3-5-sonnet-20241022': 'October 22, 2025',
47
+ 'claude-3-5-sonnet-20240620': 'October 22, 2025',
46
48
  };
47
49
  import { MODEL_NONSTREAMING_TOKENS } from '../../../internal/constants';
48
50
 
@@ -166,6 +168,85 @@ export interface BetaBase64PDFSource {
166
168
  type: 'base64';
167
169
  }
168
170
 
171
+ export interface BetaBashCodeExecutionOutputBlock {
172
+ file_id: string;
173
+
174
+ type: 'bash_code_execution_output';
175
+ }
176
+
177
+ export interface BetaBashCodeExecutionOutputBlockParam {
178
+ file_id: string;
179
+
180
+ type: 'bash_code_execution_output';
181
+ }
182
+
183
+ export interface BetaBashCodeExecutionResultBlock {
184
+ content: Array<BetaBashCodeExecutionOutputBlock>;
185
+
186
+ return_code: number;
187
+
188
+ stderr: string;
189
+
190
+ stdout: string;
191
+
192
+ type: 'bash_code_execution_result';
193
+ }
194
+
195
+ export interface BetaBashCodeExecutionResultBlockParam {
196
+ content: Array<BetaBashCodeExecutionOutputBlockParam>;
197
+
198
+ return_code: number;
199
+
200
+ stderr: string;
201
+
202
+ stdout: string;
203
+
204
+ type: 'bash_code_execution_result';
205
+ }
206
+
207
+ export interface BetaBashCodeExecutionToolResultBlock {
208
+ content: BetaBashCodeExecutionToolResultError | BetaBashCodeExecutionResultBlock;
209
+
210
+ tool_use_id: string;
211
+
212
+ type: 'bash_code_execution_tool_result';
213
+ }
214
+
215
+ export interface BetaBashCodeExecutionToolResultBlockParam {
216
+ content: BetaBashCodeExecutionToolResultErrorParam | BetaBashCodeExecutionResultBlockParam;
217
+
218
+ tool_use_id: string;
219
+
220
+ type: 'bash_code_execution_tool_result';
221
+
222
+ /**
223
+ * Create a cache control breakpoint at this content block.
224
+ */
225
+ cache_control?: BetaCacheControlEphemeral | null;
226
+ }
227
+
228
+ export interface BetaBashCodeExecutionToolResultError {
229
+ error_code:
230
+ | 'invalid_tool_input'
231
+ | 'unavailable'
232
+ | 'too_many_requests'
233
+ | 'execution_time_exceeded'
234
+ | 'output_file_too_large';
235
+
236
+ type: 'bash_code_execution_tool_result_error';
237
+ }
238
+
239
+ export interface BetaBashCodeExecutionToolResultErrorParam {
240
+ error_code:
241
+ | 'invalid_tool_input'
242
+ | 'unavailable'
243
+ | 'too_many_requests'
244
+ | 'execution_time_exceeded'
245
+ | 'output_file_too_large';
246
+
247
+ type: 'bash_code_execution_tool_result_error';
248
+ }
249
+
169
250
  export interface BetaCacheControlEphemeral {
170
251
  type: 'ephemeral';
171
252
 
@@ -407,6 +488,22 @@ export interface BetaCodeExecutionTool20250522 {
407
488
  cache_control?: BetaCacheControlEphemeral | null;
408
489
  }
409
490
 
491
+ export interface BetaCodeExecutionTool20250825 {
492
+ /**
493
+ * Name of the tool.
494
+ *
495
+ * This is how the tool will be called by the model and in `tool_use` blocks.
496
+ */
497
+ name: 'code_execution';
498
+
499
+ type: 'code_execution_20250825';
500
+
501
+ /**
502
+ * Create a cache control breakpoint at this content block.
503
+ */
504
+ cache_control?: BetaCacheControlEphemeral | null;
505
+ }
506
+
410
507
  export interface BetaCodeExecutionToolResultBlock {
411
508
  content: BetaCodeExecutionToolResultBlockContent;
412
509
 
@@ -505,6 +602,8 @@ export type BetaContentBlock =
505
602
  | BetaServerToolUseBlock
506
603
  | BetaWebSearchToolResultBlock
507
604
  | BetaCodeExecutionToolResultBlock
605
+ | BetaBashCodeExecutionToolResultBlock
606
+ | BetaTextEditorCodeExecutionToolResultBlock
508
607
  | BetaMCPToolUseBlock
509
608
  | BetaMCPToolResultBlock
510
609
  | BetaContainerUploadBlock;
@@ -524,6 +623,8 @@ export type BetaContentBlockParam =
524
623
  | BetaServerToolUseBlockParam
525
624
  | BetaWebSearchToolResultBlockParam
526
625
  | BetaCodeExecutionToolResultBlockParam
626
+ | BetaBashCodeExecutionToolResultBlockParam
627
+ | BetaTextEditorCodeExecutionToolResultBlockParam
527
628
  | BetaMCPToolUseBlockParam
528
629
  | BetaRequestMCPToolResultBlockParam
529
630
  | BetaContainerUploadBlockParam;
@@ -818,6 +919,8 @@ export interface BetaRawContentBlockStartEvent {
818
919
  | BetaServerToolUseBlock
819
920
  | BetaWebSearchToolResultBlock
820
921
  | BetaCodeExecutionToolResultBlock
922
+ | BetaBashCodeExecutionToolResultBlock
923
+ | BetaTextEditorCodeExecutionToolResultBlock
821
924
  | BetaMCPToolUseBlock
822
925
  | BetaMCPToolResultBlock
823
926
  | BetaContainerUploadBlock;
@@ -986,7 +1089,7 @@ export interface BetaServerToolUseBlock {
986
1089
 
987
1090
  input: unknown;
988
1091
 
989
- name: 'web_search' | 'code_execution';
1092
+ name: 'web_search' | 'code_execution' | 'bash_code_execution' | 'text_editor_code_execution';
990
1093
 
991
1094
  type: 'server_tool_use';
992
1095
  }
@@ -996,7 +1099,7 @@ export interface BetaServerToolUseBlockParam {
996
1099
 
997
1100
  input: unknown;
998
1101
 
999
- name: 'web_search' | 'code_execution';
1102
+ name: 'web_search' | 'code_execution' | 'bash_code_execution' | 'text_editor_code_execution';
1000
1103
 
1001
1104
  type: 'server_tool_use';
1002
1105
 
@@ -1068,6 +1171,129 @@ export interface BetaTextDelta {
1068
1171
  type: 'text_delta';
1069
1172
  }
1070
1173
 
1174
+ export interface BetaTextEditorCodeExecutionCreateResultBlock {
1175
+ is_file_update: boolean;
1176
+
1177
+ type: 'text_editor_code_execution_create_result';
1178
+ }
1179
+
1180
+ export interface BetaTextEditorCodeExecutionCreateResultBlockParam {
1181
+ is_file_update: boolean;
1182
+
1183
+ type: 'text_editor_code_execution_create_result';
1184
+ }
1185
+
1186
+ export interface BetaTextEditorCodeExecutionStrReplaceResultBlock {
1187
+ lines: Array<string> | null;
1188
+
1189
+ new_lines: number | null;
1190
+
1191
+ new_start: number | null;
1192
+
1193
+ old_lines: number | null;
1194
+
1195
+ old_start: number | null;
1196
+
1197
+ type: 'text_editor_code_execution_str_replace_result';
1198
+ }
1199
+
1200
+ export interface BetaTextEditorCodeExecutionStrReplaceResultBlockParam {
1201
+ type: 'text_editor_code_execution_str_replace_result';
1202
+
1203
+ lines?: Array<string> | null;
1204
+
1205
+ new_lines?: number | null;
1206
+
1207
+ new_start?: number | null;
1208
+
1209
+ old_lines?: number | null;
1210
+
1211
+ old_start?: number | null;
1212
+ }
1213
+
1214
+ export interface BetaTextEditorCodeExecutionToolResultBlock {
1215
+ content:
1216
+ | BetaTextEditorCodeExecutionToolResultError
1217
+ | BetaTextEditorCodeExecutionViewResultBlock
1218
+ | BetaTextEditorCodeExecutionCreateResultBlock
1219
+ | BetaTextEditorCodeExecutionStrReplaceResultBlock;
1220
+
1221
+ tool_use_id: string;
1222
+
1223
+ type: 'text_editor_code_execution_tool_result';
1224
+ }
1225
+
1226
+ export interface BetaTextEditorCodeExecutionToolResultBlockParam {
1227
+ content:
1228
+ | BetaTextEditorCodeExecutionToolResultErrorParam
1229
+ | BetaTextEditorCodeExecutionViewResultBlockParam
1230
+ | BetaTextEditorCodeExecutionCreateResultBlockParam
1231
+ | BetaTextEditorCodeExecutionStrReplaceResultBlockParam;
1232
+
1233
+ tool_use_id: string;
1234
+
1235
+ type: 'text_editor_code_execution_tool_result';
1236
+
1237
+ /**
1238
+ * Create a cache control breakpoint at this content block.
1239
+ */
1240
+ cache_control?: BetaCacheControlEphemeral | null;
1241
+ }
1242
+
1243
+ export interface BetaTextEditorCodeExecutionToolResultError {
1244
+ error_code:
1245
+ | 'invalid_tool_input'
1246
+ | 'unavailable'
1247
+ | 'too_many_requests'
1248
+ | 'execution_time_exceeded'
1249
+ | 'file_not_found';
1250
+
1251
+ error_message: string | null;
1252
+
1253
+ type: 'text_editor_code_execution_tool_result_error';
1254
+ }
1255
+
1256
+ export interface BetaTextEditorCodeExecutionToolResultErrorParam {
1257
+ error_code:
1258
+ | 'invalid_tool_input'
1259
+ | 'unavailable'
1260
+ | 'too_many_requests'
1261
+ | 'execution_time_exceeded'
1262
+ | 'file_not_found';
1263
+
1264
+ type: 'text_editor_code_execution_tool_result_error';
1265
+
1266
+ error_message?: string | null;
1267
+ }
1268
+
1269
+ export interface BetaTextEditorCodeExecutionViewResultBlock {
1270
+ content: string;
1271
+
1272
+ file_type: 'text' | 'image' | 'pdf';
1273
+
1274
+ num_lines: number | null;
1275
+
1276
+ start_line: number | null;
1277
+
1278
+ total_lines: number | null;
1279
+
1280
+ type: 'text_editor_code_execution_view_result';
1281
+ }
1282
+
1283
+ export interface BetaTextEditorCodeExecutionViewResultBlockParam {
1284
+ content: string;
1285
+
1286
+ file_type: 'text' | 'image' | 'pdf';
1287
+
1288
+ type: 'text_editor_code_execution_view_result';
1289
+
1290
+ num_lines?: number | null;
1291
+
1292
+ start_line?: number | null;
1293
+
1294
+ total_lines?: number | null;
1295
+ }
1296
+
1071
1297
  export interface BetaThinkingBlock {
1072
1298
  signature: string;
1073
1299
 
@@ -1423,6 +1649,7 @@ export type BetaToolUnion =
1423
1649
  | BetaToolBash20241022
1424
1650
  | BetaToolBash20250124
1425
1651
  | BetaCodeExecutionTool20250522
1652
+ | BetaCodeExecutionTool20250825
1426
1653
  | BetaToolComputerUse20241022
1427
1654
  | BetaToolComputerUse20250124
1428
1655
  | BetaToolTextEditor20241022
@@ -1725,30 +1952,7 @@ export interface MessageCreateParamsBase {
1725
1952
  * { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
1726
1953
  * ```
1727
1954
  *
1728
- * Starting with Claude 3 models, you can also send image content blocks:
1729
- *
1730
- * ```json
1731
- * {
1732
- * "role": "user",
1733
- * "content": [
1734
- * {
1735
- * "type": "image",
1736
- * "source": {
1737
- * "type": "base64",
1738
- * "media_type": "image/jpeg",
1739
- * "data": "/9j/4AAQSkZJRg..."
1740
- * }
1741
- * },
1742
- * { "type": "text", "text": "What is in this image?" }
1743
- * ]
1744
- * }
1745
- * ```
1746
- *
1747
- * We currently support the `base64` source type for images, and the `image/jpeg`,
1748
- * `image/png`, `image/gif`, and `image/webp` media types.
1749
- *
1750
- * See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
1751
- * more input examples.
1955
+ * See [input examples](https://docs.anthropic.com/en/api/messages-examples).
1752
1956
  *
1753
1957
  * Note that if you want to include a
1754
1958
  * [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
@@ -2047,30 +2251,7 @@ export interface MessageCountTokensParams {
2047
2251
  * { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
2048
2252
  * ```
2049
2253
  *
2050
- * Starting with Claude 3 models, you can also send image content blocks:
2051
- *
2052
- * ```json
2053
- * {
2054
- * "role": "user",
2055
- * "content": [
2056
- * {
2057
- * "type": "image",
2058
- * "source": {
2059
- * "type": "base64",
2060
- * "media_type": "image/jpeg",
2061
- * "data": "/9j/4AAQSkZJRg..."
2062
- * }
2063
- * },
2064
- * { "type": "text", "text": "What is in this image?" }
2065
- * ]
2066
- * }
2067
- * ```
2068
- *
2069
- * We currently support the `base64` source type for images, and the `image/jpeg`,
2070
- * `image/png`, `image/gif`, and `image/webp` media types.
2071
- *
2072
- * See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
2073
- * more input examples.
2254
+ * See [input examples](https://docs.anthropic.com/en/api/messages-examples).
2074
2255
  *
2075
2256
  * Note that if you want to include a
2076
2257
  * [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
@@ -2203,6 +2384,7 @@ export interface MessageCountTokensParams {
2203
2384
  | BetaToolBash20241022
2204
2385
  | BetaToolBash20250124
2205
2386
  | BetaCodeExecutionTool20250522
2387
+ | BetaCodeExecutionTool20250825
2206
2388
  | BetaToolComputerUse20241022
2207
2389
  | BetaToolComputerUse20250124
2208
2390
  | BetaToolTextEditor20241022
@@ -2224,6 +2406,14 @@ export declare namespace Messages {
2224
2406
  export {
2225
2407
  type BetaBase64ImageSource as BetaBase64ImageSource,
2226
2408
  type BetaBase64PDFSource as BetaBase64PDFSource,
2409
+ type BetaBashCodeExecutionOutputBlock as BetaBashCodeExecutionOutputBlock,
2410
+ type BetaBashCodeExecutionOutputBlockParam as BetaBashCodeExecutionOutputBlockParam,
2411
+ type BetaBashCodeExecutionResultBlock as BetaBashCodeExecutionResultBlock,
2412
+ type BetaBashCodeExecutionResultBlockParam as BetaBashCodeExecutionResultBlockParam,
2413
+ type BetaBashCodeExecutionToolResultBlock as BetaBashCodeExecutionToolResultBlock,
2414
+ type BetaBashCodeExecutionToolResultBlockParam as BetaBashCodeExecutionToolResultBlockParam,
2415
+ type BetaBashCodeExecutionToolResultError as BetaBashCodeExecutionToolResultError,
2416
+ type BetaBashCodeExecutionToolResultErrorParam as BetaBashCodeExecutionToolResultErrorParam,
2227
2417
  type BetaCacheControlEphemeral as BetaCacheControlEphemeral,
2228
2418
  type BetaCacheCreation as BetaCacheCreation,
2229
2419
  type BetaCitationCharLocation as BetaCitationCharLocation,
@@ -2243,6 +2433,7 @@ export declare namespace Messages {
2243
2433
  type BetaCodeExecutionResultBlock as BetaCodeExecutionResultBlock,
2244
2434
  type BetaCodeExecutionResultBlockParam as BetaCodeExecutionResultBlockParam,
2245
2435
  type BetaCodeExecutionTool20250522 as BetaCodeExecutionTool20250522,
2436
+ type BetaCodeExecutionTool20250825 as BetaCodeExecutionTool20250825,
2246
2437
  type BetaCodeExecutionToolResultBlock as BetaCodeExecutionToolResultBlock,
2247
2438
  type BetaCodeExecutionToolResultBlockContent as BetaCodeExecutionToolResultBlockContent,
2248
2439
  type BetaCodeExecutionToolResultBlockParam as BetaCodeExecutionToolResultBlockParam,
@@ -2295,6 +2486,16 @@ export declare namespace Messages {
2295
2486
  type BetaTextCitation as BetaTextCitation,
2296
2487
  type BetaTextCitationParam as BetaTextCitationParam,
2297
2488
  type BetaTextDelta as BetaTextDelta,
2489
+ type BetaTextEditorCodeExecutionCreateResultBlock as BetaTextEditorCodeExecutionCreateResultBlock,
2490
+ type BetaTextEditorCodeExecutionCreateResultBlockParam as BetaTextEditorCodeExecutionCreateResultBlockParam,
2491
+ type BetaTextEditorCodeExecutionStrReplaceResultBlock as BetaTextEditorCodeExecutionStrReplaceResultBlock,
2492
+ type BetaTextEditorCodeExecutionStrReplaceResultBlockParam as BetaTextEditorCodeExecutionStrReplaceResultBlockParam,
2493
+ type BetaTextEditorCodeExecutionToolResultBlock as BetaTextEditorCodeExecutionToolResultBlock,
2494
+ type BetaTextEditorCodeExecutionToolResultBlockParam as BetaTextEditorCodeExecutionToolResultBlockParam,
2495
+ type BetaTextEditorCodeExecutionToolResultError as BetaTextEditorCodeExecutionToolResultError,
2496
+ type BetaTextEditorCodeExecutionToolResultErrorParam as BetaTextEditorCodeExecutionToolResultErrorParam,
2497
+ type BetaTextEditorCodeExecutionViewResultBlock as BetaTextEditorCodeExecutionViewResultBlock,
2498
+ type BetaTextEditorCodeExecutionViewResultBlockParam as BetaTextEditorCodeExecutionViewResultBlockParam,
2298
2499
  type BetaThinkingBlock as BetaThinkingBlock,
2299
2500
  type BetaThinkingBlockParam as BetaThinkingBlockParam,
2300
2501
  type BetaThinkingConfigDisabled as BetaThinkingConfigDisabled,
@@ -28,6 +28,7 @@ export {
28
28
  type Base64ImageSource,
29
29
  type Base64PDFSource,
30
30
  type CacheControlEphemeral,
31
+ type CacheCreation,
31
32
  type CitationCharLocation,
32
33
  type CitationCharLocationParam,
33
34
  type CitationContentBlockLocation,
@@ -20,6 +20,7 @@ export {
20
20
  type Base64ImageSource,
21
21
  type Base64PDFSource,
22
22
  type CacheControlEphemeral,
23
+ type CacheCreation,
23
24
  type CitationCharLocation,
24
25
  type CitationCharLocationParam,
25
26
  type CitationContentBlockLocation,