@anthropic-ai/sdk 0.67.1 → 0.68.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 (35) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +1 -1
  3. package/resources/beta/beta.d.mts +2 -2
  4. package/resources/beta/beta.d.mts.map +1 -1
  5. package/resources/beta/beta.d.ts +2 -2
  6. package/resources/beta/beta.d.ts.map +1 -1
  7. package/resources/beta/beta.js.map +1 -1
  8. package/resources/beta/beta.mjs.map +1 -1
  9. package/resources/beta/index.d.mts +1 -1
  10. package/resources/beta/index.d.mts.map +1 -1
  11. package/resources/beta/index.d.ts +1 -1
  12. package/resources/beta/index.d.ts.map +1 -1
  13. package/resources/beta/index.js.map +1 -1
  14. package/resources/beta/index.mjs.map +1 -1
  15. package/resources/beta/messages/index.d.mts +1 -1
  16. package/resources/beta/messages/index.d.mts.map +1 -1
  17. package/resources/beta/messages/index.d.ts +1 -1
  18. package/resources/beta/messages/index.d.ts.map +1 -1
  19. package/resources/beta/messages/index.js.map +1 -1
  20. package/resources/beta/messages/index.mjs.map +1 -1
  21. package/resources/beta/messages/messages.d.mts +32 -3
  22. package/resources/beta/messages/messages.d.mts.map +1 -1
  23. package/resources/beta/messages/messages.d.ts +32 -3
  24. package/resources/beta/messages/messages.d.ts.map +1 -1
  25. package/resources/beta/messages/messages.js.map +1 -1
  26. package/resources/beta/messages/messages.mjs.map +1 -1
  27. package/src/resources/beta/beta.ts +8 -0
  28. package/src/resources/beta/index.ts +4 -0
  29. package/src/resources/beta/messages/index.ts +4 -0
  30. package/src/resources/beta/messages/messages.ts +43 -2
  31. package/src/version.ts +1 -1
  32. package/version.d.mts +1 -1
  33. package/version.d.ts +1 -1
  34. package/version.js +1 -1
  35. package/version.mjs +1 -1
@@ -17,6 +17,7 @@ import * as ModelsAPI from './models';
17
17
  import { BetaModelInfo, BetaModelInfosPage, ModelListParams, ModelRetrieveParams, Models } from './models';
18
18
  import * as MessagesAPI from './messages/messages';
19
19
  import {
20
+ BetaAllThinkingTurns,
20
21
  BetaBase64ImageSource,
21
22
  BetaBase64PDFBlock,
22
23
  BetaBase64PDFSource,
@@ -43,6 +44,8 @@ import {
43
44
  BetaCitationsConfigParam,
44
45
  BetaCitationsDelta,
45
46
  BetaCitationsWebSearchResultLocation,
47
+ BetaClearThinking20251015Edit,
48
+ BetaClearThinking20251015EditResponse,
46
49
  BetaClearToolUses20250919Edit,
47
50
  BetaClearToolUses20250919EditResponse,
48
51
  BetaCodeExecutionOutputBlock,
@@ -136,6 +139,7 @@ import {
136
139
  BetaThinkingConfigEnabled,
137
140
  BetaThinkingConfigParam,
138
141
  BetaThinkingDelta,
142
+ BetaThinkingTurns,
139
143
  BetaTool,
140
144
  BetaToolBash20241022,
141
145
  BetaToolBash20250124,
@@ -330,6 +334,7 @@ export declare namespace Beta {
330
334
 
331
335
  export {
332
336
  Messages as Messages,
337
+ type BetaAllThinkingTurns as BetaAllThinkingTurns,
333
338
  type BetaBase64ImageSource as BetaBase64ImageSource,
334
339
  type BetaBase64PDFSource as BetaBase64PDFSource,
335
340
  type BetaBashCodeExecutionOutputBlock as BetaBashCodeExecutionOutputBlock,
@@ -355,6 +360,8 @@ export declare namespace Beta {
355
360
  type BetaCitationsConfigParam as BetaCitationsConfigParam,
356
361
  type BetaCitationsDelta as BetaCitationsDelta,
357
362
  type BetaCitationsWebSearchResultLocation as BetaCitationsWebSearchResultLocation,
363
+ type BetaClearThinking20251015Edit as BetaClearThinking20251015Edit,
364
+ type BetaClearThinking20251015EditResponse as BetaClearThinking20251015EditResponse,
358
365
  type BetaClearToolUses20250919Edit as BetaClearToolUses20250919Edit,
359
366
  type BetaClearToolUses20250919EditResponse as BetaClearToolUses20250919EditResponse,
360
367
  type BetaCodeExecutionOutputBlock as BetaCodeExecutionOutputBlock,
@@ -448,6 +455,7 @@ export declare namespace Beta {
448
455
  type BetaThinkingConfigEnabled as BetaThinkingConfigEnabled,
449
456
  type BetaThinkingConfigParam as BetaThinkingConfigParam,
450
457
  type BetaThinkingDelta as BetaThinkingDelta,
458
+ type BetaThinkingTurns as BetaThinkingTurns,
451
459
  type BetaTool as BetaTool,
452
460
  type BetaToolBash20241022 as BetaToolBash20241022,
453
461
  type BetaToolBash20250124 as BetaToolBash20250124,
@@ -28,6 +28,7 @@ export {
28
28
  } from './files';
29
29
  export {
30
30
  Messages,
31
+ type BetaAllThinkingTurns,
31
32
  type BetaBase64ImageSource,
32
33
  type BetaBase64PDFSource,
33
34
  type BetaBashCodeExecutionOutputBlock,
@@ -53,6 +54,8 @@ export {
53
54
  type BetaCitationsConfigParam,
54
55
  type BetaCitationsDelta,
55
56
  type BetaCitationsWebSearchResultLocation,
57
+ type BetaClearThinking20251015Edit,
58
+ type BetaClearThinking20251015EditResponse,
56
59
  type BetaClearToolUses20250919Edit,
57
60
  type BetaClearToolUses20250919EditResponse,
58
61
  type BetaCodeExecutionOutputBlock,
@@ -146,6 +149,7 @@ export {
146
149
  type BetaThinkingConfigEnabled,
147
150
  type BetaThinkingConfigParam,
148
151
  type BetaThinkingDelta,
152
+ type BetaThinkingTurns,
149
153
  type BetaTool,
150
154
  type BetaToolBash20241022,
151
155
  type BetaToolBash20250124,
@@ -21,6 +21,7 @@ export {
21
21
  } from './batches';
22
22
  export {
23
23
  Messages,
24
+ type BetaAllThinkingTurns,
24
25
  type BetaBase64ImageSource,
25
26
  type BetaBase64PDFSource,
26
27
  type BetaBashCodeExecutionOutputBlock,
@@ -46,6 +47,8 @@ export {
46
47
  type BetaCitationsConfigParam,
47
48
  type BetaCitationsDelta,
48
49
  type BetaCitationsWebSearchResultLocation,
50
+ type BetaClearThinking20251015Edit,
51
+ type BetaClearThinking20251015EditResponse,
49
52
  type BetaClearToolUses20250919Edit,
50
53
  type BetaClearToolUses20250919EditResponse,
51
54
  type BetaCodeExecutionOutputBlock,
@@ -139,6 +142,7 @@ export {
139
142
  type BetaThinkingConfigEnabled,
140
143
  type BetaThinkingConfigParam,
141
144
  type BetaThinkingDelta,
145
+ type BetaThinkingTurns,
142
146
  type BetaTool,
143
147
  type BetaToolBash20241022,
144
148
  type BetaToolBash20250124,
@@ -169,6 +169,10 @@ export class Messages extends APIResource {
169
169
  }
170
170
  }
171
171
 
172
+ export interface BetaAllThinkingTurns {
173
+ type: 'all';
174
+ }
175
+
172
176
  export type BetaMessageStreamParams = MessageCreateParamsBase;
173
177
 
174
178
  export interface BetaBase64ImageSource {
@@ -459,6 +463,33 @@ export interface BetaCitationsWebSearchResultLocation {
459
463
  url: string;
460
464
  }
461
465
 
466
+ export interface BetaClearThinking20251015Edit {
467
+ type: 'clear_thinking_20251015';
468
+
469
+ /**
470
+ * Number of most recent assistant turns to keep thinking blocks for. Older turns
471
+ * will have their thinking blocks removed.
472
+ */
473
+ keep?: BetaThinkingTurns | BetaAllThinkingTurns | 'all';
474
+ }
475
+
476
+ export interface BetaClearThinking20251015EditResponse {
477
+ /**
478
+ * Number of input tokens cleared by this edit.
479
+ */
480
+ cleared_input_tokens: number;
481
+
482
+ /**
483
+ * Number of thinking turns that were cleared.
484
+ */
485
+ cleared_thinking_turns: number;
486
+
487
+ /**
488
+ * The type of context management edit applied.
489
+ */
490
+ type: 'clear_thinking_20251015';
491
+ }
492
+
462
493
  export interface BetaClearToolUses20250919Edit {
463
494
  type: 'clear_tool_uses_20250919';
464
495
 
@@ -733,14 +764,14 @@ export interface BetaContextManagementConfig {
733
764
  /**
734
765
  * List of context management edits to apply
735
766
  */
736
- edits?: Array<BetaClearToolUses20250919Edit>;
767
+ edits?: Array<BetaClearToolUses20250919Edit | BetaClearThinking20251015Edit>;
737
768
  }
738
769
 
739
770
  export interface BetaContextManagementResponse {
740
771
  /**
741
772
  * List of context management edits that were applied.
742
773
  */
743
- applied_edits: Array<BetaClearToolUses20250919EditResponse>;
774
+ applied_edits: Array<BetaClearToolUses20250919EditResponse | BetaClearThinking20251015EditResponse>;
744
775
  }
745
776
 
746
777
  export interface BetaCountTokensContextManagementResponse {
@@ -1686,6 +1717,12 @@ export interface BetaThinkingDelta {
1686
1717
  type: 'thinking_delta';
1687
1718
  }
1688
1719
 
1720
+ export interface BetaThinkingTurns {
1721
+ type: 'thinking_turns';
1722
+
1723
+ value: number;
1724
+ }
1725
+
1689
1726
  export interface BetaTool {
1690
1727
  /**
1691
1728
  * [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
@@ -2895,6 +2932,7 @@ Messages.BetaToolRunner = BetaToolRunner;
2895
2932
 
2896
2933
  export declare namespace Messages {
2897
2934
  export {
2935
+ type BetaAllThinkingTurns as BetaAllThinkingTurns,
2898
2936
  type BetaBase64ImageSource as BetaBase64ImageSource,
2899
2937
  type BetaBase64PDFSource as BetaBase64PDFSource,
2900
2938
  type BetaBashCodeExecutionOutputBlock as BetaBashCodeExecutionOutputBlock,
@@ -2920,6 +2958,8 @@ export declare namespace Messages {
2920
2958
  type BetaCitationsConfigParam as BetaCitationsConfigParam,
2921
2959
  type BetaCitationsDelta as BetaCitationsDelta,
2922
2960
  type BetaCitationsWebSearchResultLocation as BetaCitationsWebSearchResultLocation,
2961
+ type BetaClearThinking20251015Edit as BetaClearThinking20251015Edit,
2962
+ type BetaClearThinking20251015EditResponse as BetaClearThinking20251015EditResponse,
2923
2963
  type BetaClearToolUses20250919Edit as BetaClearToolUses20250919Edit,
2924
2964
  type BetaClearToolUses20250919EditResponse as BetaClearToolUses20250919EditResponse,
2925
2965
  type BetaCodeExecutionOutputBlock as BetaCodeExecutionOutputBlock,
@@ -3013,6 +3053,7 @@ export declare namespace Messages {
3013
3053
  type BetaThinkingConfigEnabled as BetaThinkingConfigEnabled,
3014
3054
  type BetaThinkingConfigParam as BetaThinkingConfigParam,
3015
3055
  type BetaThinkingDelta as BetaThinkingDelta,
3056
+ type BetaThinkingTurns as BetaThinkingTurns,
3016
3057
  type BetaTool as BetaTool,
3017
3058
  type BetaToolBash20241022 as BetaToolBash20241022,
3018
3059
  type BetaToolBash20250124 as BetaToolBash20250124,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.67.1'; // x-release-please-version
1
+ export const VERSION = '0.68.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.67.1";
1
+ export declare const VERSION = "0.68.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.67.1";
1
+ export declare const VERSION = "0.68.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.67.1'; // x-release-please-version
4
+ exports.VERSION = '0.68.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.67.1'; // x-release-please-version
1
+ export const VERSION = '0.68.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map