@anthropic-ai/sdk 0.57.0 → 0.58.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 (72) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +2 -2
  7. package/client.js.map +1 -1
  8. package/client.mjs +2 -2
  9. package/client.mjs.map +1 -1
  10. package/internal/constants.d.mts.map +1 -1
  11. package/internal/constants.d.ts.map +1 -1
  12. package/internal/constants.js +3 -0
  13. package/internal/constants.js.map +1 -1
  14. package/internal/constants.mjs +3 -0
  15. package/internal/constants.mjs.map +1 -1
  16. package/package.json +1 -5
  17. package/resources/beta/beta.d.mts +2 -2
  18. package/resources/beta/beta.d.mts.map +1 -1
  19. package/resources/beta/beta.d.ts +2 -2
  20. package/resources/beta/beta.d.ts.map +1 -1
  21. package/resources/beta/beta.js.map +1 -1
  22. package/resources/beta/beta.mjs.map +1 -1
  23. package/resources/beta/index.d.mts +1 -1
  24. package/resources/beta/index.d.mts.map +1 -1
  25. package/resources/beta/index.d.ts +1 -1
  26. package/resources/beta/index.d.ts.map +1 -1
  27. package/resources/beta/index.js.map +1 -1
  28. package/resources/beta/index.mjs.map +1 -1
  29. package/resources/beta/messages/index.d.mts +1 -1
  30. package/resources/beta/messages/index.d.mts.map +1 -1
  31. package/resources/beta/messages/index.d.ts +1 -1
  32. package/resources/beta/messages/index.d.ts.map +1 -1
  33. package/resources/beta/messages/index.js.map +1 -1
  34. package/resources/beta/messages/index.mjs.map +1 -1
  35. package/resources/beta/messages/messages.d.mts +24 -3
  36. package/resources/beta/messages/messages.d.mts.map +1 -1
  37. package/resources/beta/messages/messages.d.ts +24 -3
  38. package/resources/beta/messages/messages.d.ts.map +1 -1
  39. package/resources/beta/messages/messages.js.map +1 -1
  40. package/resources/beta/messages/messages.mjs.map +1 -1
  41. package/resources/index.d.mts +1 -1
  42. package/resources/index.d.mts.map +1 -1
  43. package/resources/index.d.ts +1 -1
  44. package/resources/index.d.ts.map +1 -1
  45. package/resources/index.js.map +1 -1
  46. package/resources/index.mjs.map +1 -1
  47. package/resources/messages/index.d.mts +1 -1
  48. package/resources/messages/index.d.mts.map +1 -1
  49. package/resources/messages/index.d.ts +1 -1
  50. package/resources/messages/index.d.ts.map +1 -1
  51. package/resources/messages/index.js.map +1 -1
  52. package/resources/messages/index.mjs.map +1 -1
  53. package/resources/messages/messages.d.mts +37 -33
  54. package/resources/messages/messages.d.mts.map +1 -1
  55. package/resources/messages/messages.d.ts +37 -33
  56. package/resources/messages/messages.d.ts.map +1 -1
  57. package/resources/messages/messages.js.map +1 -1
  58. package/resources/messages/messages.mjs.map +1 -1
  59. package/src/client.ts +6 -2
  60. package/src/internal/constants.ts +3 -0
  61. package/src/resources/beta/beta.ts +2 -0
  62. package/src/resources/beta/index.ts +1 -0
  63. package/src/resources/beta/messages/index.ts +1 -0
  64. package/src/resources/beta/messages/messages.ts +31 -0
  65. package/src/resources/index.ts +2 -0
  66. package/src/resources/messages/index.ts +2 -0
  67. package/src/resources/messages/messages.ts +51 -41
  68. package/src/version.ts +1 -1
  69. package/version.d.mts +1 -1
  70. package/version.d.ts +1 -1
  71. package/version.js +1 -1
  72. package/version.mjs +1 -1
@@ -138,6 +138,8 @@ export interface CitationCharLocation {
138
138
 
139
139
  end_char_index: number;
140
140
 
141
+ file_id: string | null;
142
+
141
143
  start_char_index: number;
142
144
 
143
145
  type: 'char_location';
@@ -166,6 +168,8 @@ export interface CitationContentBlockLocation {
166
168
 
167
169
  end_block_index: number;
168
170
 
171
+ file_id: string | null;
172
+
169
173
  start_block_index: number;
170
174
 
171
175
  type: 'content_block_location';
@@ -194,6 +198,8 @@ export interface CitationPageLocation {
194
198
 
195
199
  end_page_number: number;
196
200
 
201
+ file_id: string | null;
202
+
197
203
  start_page_number: number;
198
204
 
199
205
  type: 'page_location';
@@ -431,27 +437,10 @@ export type MessageCountTokensTool =
431
437
  | Tool
432
438
  | ToolBash20250124
433
439
  | ToolTextEditor20250124
434
- | MessageCountTokensTool.TextEditor20250429
440
+ | ToolTextEditor20250429
441
+ | ToolTextEditor20250728
435
442
  | WebSearchTool20250305;
436
443
 
437
- export namespace MessageCountTokensTool {
438
- export interface TextEditor20250429 {
439
- /**
440
- * Name of the tool.
441
- *
442
- * This is how the tool will be called by the model and in `tool_use` blocks.
443
- */
444
- name: 'str_replace_based_edit_tool';
445
-
446
- type: 'text_editor_20250429';
447
-
448
- /**
449
- * Create a cache control breakpoint at this content block.
450
- */
451
- cache_control?: MessagesAPI.CacheControlEphemeral | null;
452
- }
453
- }
454
-
455
444
  export interface MessageDeltaUsage {
456
445
  /**
457
446
  * The cumulative number of input tokens used to create the cache entry.
@@ -523,12 +512,10 @@ export type Model =
523
512
  | 'claude-opus-4-0'
524
513
  | 'claude-opus-4-20250514'
525
514
  | 'claude-4-opus-20250514'
515
+ | 'claude-opus-4-1-20250805'
526
516
  | 'claude-3-opus-latest'
527
517
  | 'claude-3-opus-20240229'
528
- | 'claude-3-sonnet-20240229'
529
518
  | 'claude-3-haiku-20240307'
530
- | 'claude-2.1'
531
- | 'claude-2.0'
532
519
  | (string & {});
533
520
 
534
521
  const DEPRECATED_MODELS: {
@@ -955,31 +942,52 @@ export interface ToolTextEditor20250124 {
955
942
  cache_control?: CacheControlEphemeral | null;
956
943
  }
957
944
 
945
+ export interface ToolTextEditor20250429 {
946
+ /**
947
+ * Name of the tool.
948
+ *
949
+ * This is how the tool will be called by the model and in `tool_use` blocks.
950
+ */
951
+ name: 'str_replace_based_edit_tool';
952
+
953
+ type: 'text_editor_20250429';
954
+
955
+ /**
956
+ * Create a cache control breakpoint at this content block.
957
+ */
958
+ cache_control?: CacheControlEphemeral | null;
959
+ }
960
+
961
+ export interface ToolTextEditor20250728 {
962
+ /**
963
+ * Name of the tool.
964
+ *
965
+ * This is how the tool will be called by the model and in `tool_use` blocks.
966
+ */
967
+ name: 'str_replace_based_edit_tool';
968
+
969
+ type: 'text_editor_20250728';
970
+
971
+ /**
972
+ * Create a cache control breakpoint at this content block.
973
+ */
974
+ cache_control?: CacheControlEphemeral | null;
975
+
976
+ /**
977
+ * Maximum number of characters to display when viewing a file. If not specified,
978
+ * defaults to displaying the full file.
979
+ */
980
+ max_characters?: number | null;
981
+ }
982
+
958
983
  export type ToolUnion =
959
984
  | Tool
960
985
  | ToolBash20250124
961
986
  | ToolTextEditor20250124
962
- | ToolUnion.TextEditor20250429
987
+ | ToolTextEditor20250429
988
+ | ToolTextEditor20250728
963
989
  | WebSearchTool20250305;
964
990
 
965
- export namespace ToolUnion {
966
- export interface TextEditor20250429 {
967
- /**
968
- * Name of the tool.
969
- *
970
- * This is how the tool will be called by the model and in `tool_use` blocks.
971
- */
972
- name: 'str_replace_based_edit_tool';
973
-
974
- type: 'text_editor_20250429';
975
-
976
- /**
977
- * Create a cache control breakpoint at this content block.
978
- */
979
- cache_control?: MessagesAPI.CacheControlEphemeral | null;
980
- }
981
- }
982
-
983
991
  export interface ToolUseBlock {
984
992
  id: string;
985
993
 
@@ -1804,6 +1812,8 @@ export declare namespace Messages {
1804
1812
  type ToolChoiceTool as ToolChoiceTool,
1805
1813
  type ToolResultBlockParam as ToolResultBlockParam,
1806
1814
  type ToolTextEditor20250124 as ToolTextEditor20250124,
1815
+ type ToolTextEditor20250429 as ToolTextEditor20250429,
1816
+ type ToolTextEditor20250728 as ToolTextEditor20250728,
1807
1817
  type ToolUnion as ToolUnion,
1808
1818
  type ToolUseBlock as ToolUseBlock,
1809
1819
  type ToolUseBlockParam as ToolUseBlockParam,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.57.0'; // x-release-please-version
1
+ export const VERSION = '0.58.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.57.0";
1
+ export declare const VERSION = "0.58.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.57.0";
1
+ export declare const VERSION = "0.58.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.57.0'; // x-release-please-version
4
+ exports.VERSION = '0.58.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.57.0'; // x-release-please-version
1
+ export const VERSION = '0.58.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map