@anthropic-ai/sdk 0.115.0 → 0.117.1

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 (191) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/client.d.mts +3 -3
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +3 -3
  5. package/client.d.ts.map +1 -1
  6. package/client.js +1 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +1 -1
  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 +0 -5
  13. package/internal/constants.js.map +1 -1
  14. package/internal/constants.mjs +0 -5
  15. package/internal/constants.mjs.map +1 -1
  16. package/lib/BetaMessageStream.d.mts.map +1 -1
  17. package/lib/BetaMessageStream.d.ts.map +1 -1
  18. package/lib/BetaMessageStream.js +12 -5
  19. package/lib/BetaMessageStream.js.map +1 -1
  20. package/lib/BetaMessageStream.mjs +12 -5
  21. package/lib/BetaMessageStream.mjs.map +1 -1
  22. package/lib/MessageStream.d.mts.map +1 -1
  23. package/lib/MessageStream.d.ts.map +1 -1
  24. package/lib/MessageStream.js +9 -4
  25. package/lib/MessageStream.js.map +1 -1
  26. package/lib/MessageStream.mjs +9 -4
  27. package/lib/MessageStream.mjs.map +1 -1
  28. package/lib/environments/worker.d.mts.map +1 -1
  29. package/lib/environments/worker.d.ts.map +1 -1
  30. package/lib/environments/worker.js +29 -3
  31. package/lib/environments/worker.js.map +1 -1
  32. package/lib/environments/worker.mjs +29 -3
  33. package/lib/environments/worker.mjs.map +1 -1
  34. package/lib/sessions/accumulate.js +1 -0
  35. package/lib/sessions/accumulate.js.map +1 -1
  36. package/lib/sessions/accumulate.mjs +1 -0
  37. package/lib/sessions/accumulate.mjs.map +1 -1
  38. package/lib/tools/BetaToolRunner.d.mts.map +1 -1
  39. package/lib/tools/BetaToolRunner.d.ts.map +1 -1
  40. package/lib/tools/BetaToolRunner.js +11 -0
  41. package/lib/tools/BetaToolRunner.js.map +1 -1
  42. package/lib/tools/BetaToolRunner.mjs +11 -0
  43. package/lib/tools/BetaToolRunner.mjs.map +1 -1
  44. package/package.json +9 -15
  45. package/resources/beta/agents/agents.d.mts +25 -3
  46. package/resources/beta/agents/agents.d.mts.map +1 -1
  47. package/resources/beta/agents/agents.d.ts +25 -3
  48. package/resources/beta/agents/agents.d.ts.map +1 -1
  49. package/resources/beta/agents/agents.js.map +1 -1
  50. package/resources/beta/agents/agents.mjs.map +1 -1
  51. package/resources/beta/agents/index.d.mts +1 -1
  52. package/resources/beta/agents/index.d.mts.map +1 -1
  53. package/resources/beta/agents/index.d.ts +1 -1
  54. package/resources/beta/agents/index.d.ts.map +1 -1
  55. package/resources/beta/agents/index.js.map +1 -1
  56. package/resources/beta/agents/index.mjs.map +1 -1
  57. package/resources/beta/beta.d.mts +28 -10
  58. package/resources/beta/beta.d.mts.map +1 -1
  59. package/resources/beta/beta.d.ts +28 -10
  60. package/resources/beta/beta.d.ts.map +1 -1
  61. package/resources/beta/beta.js.map +1 -1
  62. package/resources/beta/beta.mjs.map +1 -1
  63. package/resources/beta/deployments.d.mts +16 -1
  64. package/resources/beta/deployments.d.mts.map +1 -1
  65. package/resources/beta/deployments.d.ts +16 -1
  66. package/resources/beta/deployments.d.ts.map +1 -1
  67. package/resources/beta/dreams.d.mts +46 -6
  68. package/resources/beta/dreams.d.mts.map +1 -1
  69. package/resources/beta/dreams.d.ts +46 -6
  70. package/resources/beta/dreams.d.ts.map +1 -1
  71. package/resources/beta/index.d.mts +5 -5
  72. package/resources/beta/index.d.mts.map +1 -1
  73. package/resources/beta/index.d.ts +5 -5
  74. package/resources/beta/index.d.ts.map +1 -1
  75. package/resources/beta/index.js.map +1 -1
  76. package/resources/beta/index.mjs.map +1 -1
  77. package/resources/beta/messages/messages.d.mts +51 -0
  78. package/resources/beta/messages/messages.d.mts.map +1 -1
  79. package/resources/beta/messages/messages.d.ts +51 -0
  80. package/resources/beta/messages/messages.d.ts.map +1 -1
  81. package/resources/beta/messages/messages.js +2 -23
  82. package/resources/beta/messages/messages.js.map +1 -1
  83. package/resources/beta/messages/messages.mjs +2 -23
  84. package/resources/beta/messages/messages.mjs.map +1 -1
  85. package/resources/beta/sessions/events.d.mts +60 -10
  86. package/resources/beta/sessions/events.d.mts.map +1 -1
  87. package/resources/beta/sessions/events.d.ts +60 -10
  88. package/resources/beta/sessions/events.d.ts.map +1 -1
  89. package/resources/beta/sessions/events.js.map +1 -1
  90. package/resources/beta/sessions/events.mjs.map +1 -1
  91. package/resources/beta/sessions/index.d.mts +2 -2
  92. package/resources/beta/sessions/index.d.mts.map +1 -1
  93. package/resources/beta/sessions/index.d.ts +2 -2
  94. package/resources/beta/sessions/index.d.ts.map +1 -1
  95. package/resources/beta/sessions/index.js.map +1 -1
  96. package/resources/beta/sessions/index.mjs.map +1 -1
  97. package/resources/beta/sessions/sessions.d.mts +101 -6
  98. package/resources/beta/sessions/sessions.d.mts.map +1 -1
  99. package/resources/beta/sessions/sessions.d.ts +101 -6
  100. package/resources/beta/sessions/sessions.d.ts.map +1 -1
  101. package/resources/beta/sessions/sessions.js.map +1 -1
  102. package/resources/beta/sessions/sessions.mjs.map +1 -1
  103. package/resources/beta/sessions/threads/threads.d.mts +17 -5
  104. package/resources/beta/sessions/threads/threads.d.mts.map +1 -1
  105. package/resources/beta/sessions/threads/threads.d.ts +17 -5
  106. package/resources/beta/sessions/threads/threads.d.ts.map +1 -1
  107. package/resources/beta/sessions/threads/threads.js.map +1 -1
  108. package/resources/beta/sessions/threads/threads.mjs.map +1 -1
  109. package/resources/beta/user-profiles.d.mts +5 -5
  110. package/resources/beta/user-profiles.d.ts +5 -5
  111. package/resources/beta/webhooks.d.mts +11 -2
  112. package/resources/beta/webhooks.d.mts.map +1 -1
  113. package/resources/beta/webhooks.d.ts +11 -2
  114. package/resources/beta/webhooks.d.ts.map +1 -1
  115. package/resources/index.d.mts +1 -1
  116. package/resources/index.d.mts.map +1 -1
  117. package/resources/index.d.ts +1 -1
  118. package/resources/index.d.ts.map +1 -1
  119. package/resources/index.js.map +1 -1
  120. package/resources/index.mjs.map +1 -1
  121. package/resources/messages/messages.d.mts +52 -1
  122. package/resources/messages/messages.d.mts.map +1 -1
  123. package/resources/messages/messages.d.ts +52 -1
  124. package/resources/messages/messages.d.ts.map +1 -1
  125. package/resources/messages/messages.js +2 -23
  126. package/resources/messages/messages.js.map +1 -1
  127. package/resources/messages/messages.mjs +2 -23
  128. package/resources/messages/messages.mjs.map +1 -1
  129. package/src/client.ts +6 -2
  130. package/src/internal/constants.ts +0 -5
  131. package/src/lib/BetaMessageStream.ts +15 -5
  132. package/src/lib/MessageStream.ts +11 -4
  133. package/src/lib/environments/worker.ts +28 -3
  134. package/src/lib/sessions/accumulate.ts +1 -0
  135. package/src/lib/tools/BetaToolRunner.ts +11 -0
  136. package/src/resources/beta/agents/agents.ts +29 -2
  137. package/src/resources/beta/agents/index.ts +1 -0
  138. package/src/resources/beta/beta.ts +43 -1
  139. package/src/resources/beta/deployments.ts +19 -0
  140. package/src/resources/beta/dreams.ts +54 -5
  141. package/src/resources/beta/index.ts +11 -0
  142. package/src/resources/beta/messages/messages.ts +53 -23
  143. package/src/resources/beta/sessions/events.ts +95 -9
  144. package/src/resources/beta/sessions/index.ts +7 -0
  145. package/src/resources/beta/sessions/sessions.ts +127 -3
  146. package/src/resources/beta/sessions/threads/threads.ts +21 -5
  147. package/src/resources/beta/user-profiles.ts +5 -5
  148. package/src/resources/beta/webhooks.ts +16 -1
  149. package/src/resources/index.ts +2 -0
  150. package/src/resources/messages/messages.ts +53 -25
  151. package/src/tools/agent-toolset/fs-util.ts +43 -23
  152. package/src/tools/agent-toolset/node.browser.ts +14 -0
  153. package/src/tools/agent-toolset/node.ts +20 -9
  154. package/src/tools/agent-toolset/skills.ts +127 -31
  155. package/src/version.ts +1 -1
  156. package/tools/agent-toolset/fs-util.d.mts +14 -2
  157. package/tools/agent-toolset/fs-util.d.mts.map +1 -1
  158. package/tools/agent-toolset/fs-util.d.ts +14 -2
  159. package/tools/agent-toolset/fs-util.d.ts.map +1 -1
  160. package/tools/agent-toolset/fs-util.js +46 -24
  161. package/tools/agent-toolset/fs-util.js.map +1 -1
  162. package/tools/agent-toolset/fs-util.mjs +45 -24
  163. package/tools/agent-toolset/fs-util.mjs.map +1 -1
  164. package/tools/agent-toolset/node.browser.d.mts +9 -0
  165. package/tools/agent-toolset/node.browser.d.mts.map +1 -1
  166. package/tools/agent-toolset/node.browser.d.ts +9 -0
  167. package/tools/agent-toolset/node.browser.d.ts.map +1 -1
  168. package/tools/agent-toolset/node.browser.js +13 -1
  169. package/tools/agent-toolset/node.browser.js.map +1 -1
  170. package/tools/agent-toolset/node.browser.mjs +11 -0
  171. package/tools/agent-toolset/node.browser.mjs.map +1 -1
  172. package/tools/agent-toolset/node.d.mts +9 -0
  173. package/tools/agent-toolset/node.d.mts.map +1 -1
  174. package/tools/agent-toolset/node.d.ts +9 -0
  175. package/tools/agent-toolset/node.d.ts.map +1 -1
  176. package/tools/agent-toolset/node.js +19 -7
  177. package/tools/agent-toolset/node.js.map +1 -1
  178. package/tools/agent-toolset/node.mjs +17 -6
  179. package/tools/agent-toolset/node.mjs.map +1 -1
  180. package/tools/agent-toolset/skills.d.mts +26 -3
  181. package/tools/agent-toolset/skills.d.mts.map +1 -1
  182. package/tools/agent-toolset/skills.d.ts +26 -3
  183. package/tools/agent-toolset/skills.d.ts.map +1 -1
  184. package/tools/agent-toolset/skills.js +114 -29
  185. package/tools/agent-toolset/skills.js.map +1 -1
  186. package/tools/agent-toolset/skills.mjs +113 -30
  187. package/tools/agent-toolset/skills.mjs.map +1 -1
  188. package/version.d.mts +1 -1
  189. package/version.d.ts +1 -1
  190. package/version.js +1 -1
  191. package/version.mjs +1 -1
@@ -89,6 +89,9 @@ import {
89
89
  BetaDreamStatus,
90
90
  BetaDreamUsage,
91
91
  BetaDreamsPageCursor,
92
+ BetaOutputBehavior,
93
+ BetaOutputBehaviorCreateNew,
94
+ BetaOutputBehaviorUpdateExisting,
92
95
  DreamArchiveParams,
93
96
  DreamCancelParams,
94
97
  DreamCreateParams,
@@ -161,6 +164,7 @@ import {
161
164
  BetaWebhookMemoryStoreCreatedEventData,
162
165
  BetaWebhookMemoryStoreDeletedEventData,
163
166
  BetaWebhookSessionArchivedEventData,
167
+ BetaWebhookSessionBudgetReachedEventData,
164
168
  BetaWebhookSessionCreatedEventData,
165
169
  BetaWebhookSessionDeletedEventData,
166
170
  BetaWebhookSessionIdledEventData,
@@ -194,6 +198,7 @@ import {
194
198
  AgentRetrieveParams,
195
199
  AgentUpdateParams,
196
200
  Agents,
201
+ BetaManagedAgentsAdvisor,
197
202
  BetaManagedAgentsAgent,
198
203
  BetaManagedAgentsAgentReference,
199
204
  BetaManagedAgentsAgentToolConfig,
@@ -516,11 +521,13 @@ import {
516
521
  } from './messages/messages';
517
522
  import * as SessionsAPI from './sessions/sessions';
518
523
  import {
524
+ BetaManagedAgentsAdvisorParams,
519
525
  BetaManagedAgentsAgentMessagePreview,
520
526
  BetaManagedAgentsAgentParams,
521
527
  BetaManagedAgentsAgentThinkingPreview,
522
528
  BetaManagedAgentsAgentWithOverridesParams,
523
529
  BetaManagedAgentsBranchCheckout,
530
+ BetaManagedAgentsBudgetLimit,
524
531
  BetaManagedAgentsCacheCreationUsage,
525
532
  BetaManagedAgentsCommitCheckout,
526
533
  BetaManagedAgentsDeletedSession,
@@ -534,6 +541,7 @@ import {
534
541
  BetaManagedAgentsMultiagentParams,
535
542
  BetaManagedAgentsMultiagentRosterEntryParams,
536
543
  BetaManagedAgentsOutcomeEvaluationResource,
544
+ BetaManagedAgentsServerToolUsage,
537
545
  BetaManagedAgentsSession,
538
546
  BetaManagedAgentsSessionAgent,
539
547
  BetaManagedAgentsSessionAgentUpdate,
@@ -541,6 +549,7 @@ import {
541
549
  BetaManagedAgentsSessionStats,
542
550
  BetaManagedAgentsSessionUpdatedEvent,
543
551
  BetaManagedAgentsSessionUsage,
552
+ BetaManagedAgentsSessionUsageEvent,
544
553
  BetaManagedAgentsSessionsBidirectionalPageCursor,
545
554
  BetaManagedAgentsStartEvent,
546
555
  BetaManagedAgentsStartEventPreview,
@@ -646,7 +655,8 @@ export type AnthropicBeta =
646
655
  | 'server-side-fallback-2026-07-01'
647
656
  | 'fallback-credit-2026-06-01'
648
657
  | 'fallback-credit-2026-07-01'
649
- | 'agent-memory-2026-07-22';
658
+ | 'agent-memory-2026-07-22'
659
+ | 'mid-conversation-tool-changes-2026-07-01';
650
660
 
651
661
  export interface BetaAPIError {
652
662
  message: string;
@@ -666,6 +676,8 @@ export interface BetaBillingError {
666
676
  type: 'billing_error';
667
677
  }
668
678
 
679
+ export type BetaCurrency = 'USD';
680
+
669
681
  export type BetaError =
670
682
  | BetaInvalidRequestError
671
683
  | BetaAuthenticationError
@@ -697,6 +709,25 @@ export interface BetaInvalidRequestError {
697
709
  type: 'invalid_request_error';
698
710
  }
699
711
 
712
+ /**
713
+ * A monetary amount in a specific currency.
714
+ */
715
+ export interface BetaMonetaryAmount {
716
+ /**
717
+ * Amount in minor units of the currency, as an integer decimal string with no
718
+ * leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a
719
+ * number so no float rounding is ever applied.
720
+ */
721
+ amount: string;
722
+
723
+ /**
724
+ * Uppercase ISO-4217 currency code. `USD` is the only currency currently
725
+ * supported; the accepted set is closed and grows only when a new currency is
726
+ * priced.
727
+ */
728
+ currency: BetaCurrency;
729
+ }
730
+
700
731
  export interface BetaNotFoundError {
701
732
  message: string;
702
733
 
@@ -743,10 +774,12 @@ export declare namespace Beta {
743
774
  type BetaAPIError as BetaAPIError,
744
775
  type BetaAuthenticationError as BetaAuthenticationError,
745
776
  type BetaBillingError as BetaBillingError,
777
+ type BetaCurrency as BetaCurrency,
746
778
  type BetaError as BetaError,
747
779
  type BetaErrorResponse as BetaErrorResponse,
748
780
  type BetaGatewayTimeoutError as BetaGatewayTimeoutError,
749
781
  type BetaInvalidRequestError as BetaInvalidRequestError,
782
+ type BetaMonetaryAmount as BetaMonetaryAmount,
750
783
  type BetaNotFoundError as BetaNotFoundError,
751
784
  type BetaOverloadedError as BetaOverloadedError,
752
785
  type BetaPermissionError as BetaPermissionError,
@@ -1008,6 +1041,7 @@ export declare namespace Beta {
1008
1041
 
1009
1042
  export {
1010
1043
  Agents as Agents,
1044
+ type BetaManagedAgentsAdvisor as BetaManagedAgentsAdvisor,
1011
1045
  type BetaManagedAgentsAgent as BetaManagedAgentsAgent,
1012
1046
  type BetaManagedAgentsAgentReference as BetaManagedAgentsAgentReference,
1013
1047
  type BetaManagedAgentsAgentToolConfig as BetaManagedAgentsAgentToolConfig,
@@ -1084,11 +1118,13 @@ export declare namespace Beta {
1084
1118
 
1085
1119
  export {
1086
1120
  Sessions as Sessions,
1121
+ type BetaManagedAgentsAdvisorParams as BetaManagedAgentsAdvisorParams,
1087
1122
  type BetaManagedAgentsAgentMessagePreview as BetaManagedAgentsAgentMessagePreview,
1088
1123
  type BetaManagedAgentsAgentParams as BetaManagedAgentsAgentParams,
1089
1124
  type BetaManagedAgentsAgentThinkingPreview as BetaManagedAgentsAgentThinkingPreview,
1090
1125
  type BetaManagedAgentsAgentWithOverridesParams as BetaManagedAgentsAgentWithOverridesParams,
1091
1126
  type BetaManagedAgentsBranchCheckout as BetaManagedAgentsBranchCheckout,
1127
+ type BetaManagedAgentsBudgetLimit as BetaManagedAgentsBudgetLimit,
1092
1128
  type BetaManagedAgentsCacheCreationUsage as BetaManagedAgentsCacheCreationUsage,
1093
1129
  type BetaManagedAgentsCommitCheckout as BetaManagedAgentsCommitCheckout,
1094
1130
  type BetaManagedAgentsDeletedSession as BetaManagedAgentsDeletedSession,
@@ -1102,6 +1138,7 @@ export declare namespace Beta {
1102
1138
  type BetaManagedAgentsMultiagentParams as BetaManagedAgentsMultiagentParams,
1103
1139
  type BetaManagedAgentsMultiagentRosterEntryParams as BetaManagedAgentsMultiagentRosterEntryParams,
1104
1140
  type BetaManagedAgentsOutcomeEvaluationResource as BetaManagedAgentsOutcomeEvaluationResource,
1141
+ type BetaManagedAgentsServerToolUsage as BetaManagedAgentsServerToolUsage,
1105
1142
  type BetaManagedAgentsSession as BetaManagedAgentsSession,
1106
1143
  type BetaManagedAgentsSessionAgent as BetaManagedAgentsSessionAgent,
1107
1144
  type BetaManagedAgentsSessionAgentUpdate as BetaManagedAgentsSessionAgentUpdate,
@@ -1109,6 +1146,7 @@ export declare namespace Beta {
1109
1146
  type BetaManagedAgentsSessionStats as BetaManagedAgentsSessionStats,
1110
1147
  type BetaManagedAgentsSessionUpdatedEvent as BetaManagedAgentsSessionUpdatedEvent,
1111
1148
  type BetaManagedAgentsSessionUsage as BetaManagedAgentsSessionUsage,
1149
+ type BetaManagedAgentsSessionUsageEvent as BetaManagedAgentsSessionUsageEvent,
1112
1150
  type BetaManagedAgentsStartEvent as BetaManagedAgentsStartEvent,
1113
1151
  type BetaManagedAgentsStartEventPreview as BetaManagedAgentsStartEventPreview,
1114
1152
  type BetaManagedAgentsSystemContentBlock as BetaManagedAgentsSystemContentBlock,
@@ -1274,6 +1312,7 @@ export declare namespace Beta {
1274
1312
  type BetaWebhookMemoryStoreCreatedEventData as BetaWebhookMemoryStoreCreatedEventData,
1275
1313
  type BetaWebhookMemoryStoreDeletedEventData as BetaWebhookMemoryStoreDeletedEventData,
1276
1314
  type BetaWebhookSessionArchivedEventData as BetaWebhookSessionArchivedEventData,
1315
+ type BetaWebhookSessionBudgetReachedEventData as BetaWebhookSessionBudgetReachedEventData,
1277
1316
  type BetaWebhookSessionCreatedEventData as BetaWebhookSessionCreatedEventData,
1278
1317
  type BetaWebhookSessionDeletedEventData as BetaWebhookSessionDeletedEventData,
1279
1318
  type BetaWebhookSessionIdledEventData as BetaWebhookSessionIdledEventData,
@@ -1325,6 +1364,9 @@ export declare namespace Beta {
1325
1364
  type BetaDreamSessionsInput as BetaDreamSessionsInput,
1326
1365
  type BetaDreamStatus as BetaDreamStatus,
1327
1366
  type BetaDreamUsage as BetaDreamUsage,
1367
+ type BetaOutputBehavior as BetaOutputBehavior,
1368
+ type BetaOutputBehaviorCreateNew as BetaOutputBehaviorCreateNew,
1369
+ type BetaOutputBehaviorUpdateExisting as BetaOutputBehaviorUpdateExisting,
1328
1370
  type BetaDreamsPageCursor as BetaDreamsPageCursor,
1329
1371
  type DreamCreateParams as DreamCreateParams,
1330
1372
  type DreamRetrieveParams as DreamRetrieveParams,
@@ -384,6 +384,12 @@ export interface BetaManagedAgentsDeployment {
384
384
  * deployment.
385
385
  */
386
386
  vault_ids: Array<string>;
387
+
388
+ /**
389
+ * A hard spend ceiling. The session stops issuing new model requests once the
390
+ * tracked list cost reaches `max_list_cost`.
391
+ */
392
+ budget?: SessionsAPI.BetaManagedAgentsBudgetLimit | null;
387
393
  }
388
394
 
389
395
  /**
@@ -482,6 +488,7 @@ export interface BetaManagedAgentsDeploymentUserMessageEvent {
482
488
  | EventsAPI.BetaManagedAgentsTextBlock
483
489
  | EventsAPI.BetaManagedAgentsImageBlock
484
490
  | EventsAPI.BetaManagedAgentsDocumentBlock
491
+ | EventsAPI.BetaManagedAgentsRedactedBlock
485
492
  >;
486
493
 
487
494
  type: 'user.message';
@@ -755,6 +762,12 @@ export interface DeploymentCreateParams {
755
762
  */
756
763
  name: string;
757
764
 
765
+ /**
766
+ * Body param: A hard spend ceiling. The session stops issuing new model requests
767
+ * once the tracked list cost reaches `max_list_cost`.
768
+ */
769
+ budget?: SessionsAPI.BetaManagedAgentsBudgetLimit | null;
770
+
758
771
  /**
759
772
  * Body param: Description of what the deployment does.
760
773
  */
@@ -809,6 +822,12 @@ export interface DeploymentUpdateParams {
809
822
  */
810
823
  agent?: string | SessionsAPI.BetaManagedAgentsAgentParams;
811
824
 
825
+ /**
826
+ * Body param: A hard spend ceiling. The session stops issuing new model requests
827
+ * once the tracked list cost reaches `max_list_cost`.
828
+ */
829
+ budget?: SessionsAPI.BetaManagedAgentsBudgetLimit | null;
830
+
812
831
  /**
813
832
  * Body param: Description. Omit to preserve; send empty string or null to clear.
814
833
  */
@@ -138,9 +138,10 @@ export type BetaDreamsPageCursor = PageCursor<BetaDream>;
138
138
 
139
139
  /**
140
140
  * An asynchronous memory-consolidation job that reads a memory store plus a set of
141
- * session transcripts and writes consolidated memories into a new output memory
142
- * store. The Dreams API is in research preview: the request and response shapes
143
- * are volatile and may change without the deprecation period that applies to
141
+ * session transcripts and writes consolidated memories into an output memory store
142
+ * a new store by default, or an existing store chosen via output_behavior. The
143
+ * Dreams API is in research preview: the request and response shapes are volatile
144
+ * and may change without the deprecation period that applies to
144
145
  * generally-available endpoints.
145
146
  */
146
147
  export interface BetaDream {
@@ -176,6 +177,13 @@ export interface BetaDream {
176
177
  */
177
178
  model: BetaDreamModelConfig;
178
179
 
180
+ /**
181
+ * The default destination: the job creates a new output memory store as a clone of
182
+ * the memory_store input and writes the consolidated memories into it. The input
183
+ * store is never mutated.
184
+ */
185
+ output_behavior: BetaOutputBehavior;
186
+
179
187
  outputs: Array<BetaDreamOutput>;
180
188
 
181
189
  session_id: string | null;
@@ -203,12 +211,16 @@ export interface BetaDreamError {
203
211
  }
204
212
 
205
213
  /**
206
- * An input memory store the dream reads from. The dream never mutates this store.
214
+ * An input memory store the dream reads from. The dream never mutates this store
215
+ * unless it is also the destination: with output_behavior {type:
216
+ * "update_existing"} the job consolidates this store in place.
207
217
  */
208
218
  export type BetaDreamInput = BetaDreamMemoryStoreInput | BetaDreamSessionsInput;
209
219
 
210
220
  /**
211
- * An input memory store the dream reads from. The dream never mutates this store.
221
+ * An input memory store the dream reads from. The dream never mutates this store
222
+ * unless it is also the destination: with output_behavior {type:
223
+ * "update_existing"} the job consolidates this store in place.
212
224
  */
213
225
  export interface BetaDreamMemoryStoreInput {
214
226
  memory_store_id: string;
@@ -308,6 +320,33 @@ export interface BetaDreamUsage {
308
320
  output_tokens: number;
309
321
  }
310
322
 
323
+ /**
324
+ * The default destination: the job creates a new output memory store as a clone of
325
+ * the memory_store input and writes the consolidated memories into it. The input
326
+ * store is never mutated.
327
+ */
328
+ export type BetaOutputBehavior = BetaOutputBehaviorCreateNew | BetaOutputBehaviorUpdateExisting;
329
+
330
+ /**
331
+ * The default destination: the job creates a new output memory store as a clone of
332
+ * the memory_store input and writes the consolidated memories into it. The input
333
+ * store is never mutated.
334
+ */
335
+ export interface BetaOutputBehaviorCreateNew {
336
+ type: 'create_new';
337
+ }
338
+
339
+ /**
340
+ * The job writes the consolidated memories into this existing memory store instead
341
+ * of creating one. In EAP the store must be the job's own memory_store input, so
342
+ * the job consolidates the store in place.
343
+ */
344
+ export interface BetaOutputBehaviorUpdateExisting {
345
+ memory_store_id: string;
346
+
347
+ type: 'update_existing';
348
+ }
349
+
311
350
  export interface DreamCreateParams {
312
351
  /**
313
352
  * Body param
@@ -324,6 +363,13 @@ export interface DreamCreateParams {
324
363
  */
325
364
  instructions?: string | null;
326
365
 
366
+ /**
367
+ * Body param: The default destination: the job creates a new output memory store
368
+ * as a clone of the memory_store input and writes the consolidated memories into
369
+ * it. The input store is never mutated.
370
+ */
371
+ output_behavior?: BetaOutputBehavior;
372
+
327
373
  /**
328
374
  * Header param: Optional header to specify the beta version(s) you want to use.
329
375
  */
@@ -394,6 +440,9 @@ export declare namespace Dreams {
394
440
  type BetaDreamSessionsInput as BetaDreamSessionsInput,
395
441
  type BetaDreamStatus as BetaDreamStatus,
396
442
  type BetaDreamUsage as BetaDreamUsage,
443
+ type BetaOutputBehavior as BetaOutputBehavior,
444
+ type BetaOutputBehaviorCreateNew as BetaOutputBehaviorCreateNew,
445
+ type BetaOutputBehaviorUpdateExisting as BetaOutputBehaviorUpdateExisting,
397
446
  type BetaDreamsPageCursor as BetaDreamsPageCursor,
398
447
  type DreamCreateParams as DreamCreateParams,
399
448
  type DreamRetrieveParams as DreamRetrieveParams,
@@ -2,6 +2,7 @@
2
2
 
3
3
  export {
4
4
  Agents,
5
+ type BetaManagedAgentsAdvisor,
5
6
  type BetaManagedAgentsAgent,
6
7
  type BetaManagedAgentsAgentReference,
7
8
  type BetaManagedAgentsAgentToolConfig,
@@ -59,10 +60,12 @@ export {
59
60
  type BetaAPIError,
60
61
  type BetaAuthenticationError,
61
62
  type BetaBillingError,
63
+ type BetaCurrency,
62
64
  type BetaError,
63
65
  type BetaErrorResponse,
64
66
  type BetaGatewayTimeoutError,
65
67
  type BetaInvalidRequestError,
68
+ type BetaMonetaryAmount,
66
69
  type BetaNotFoundError,
67
70
  type BetaOverloadedError,
68
71
  type BetaPermissionError,
@@ -153,6 +156,9 @@ export {
153
156
  type BetaDreamSessionsInput,
154
157
  type BetaDreamStatus,
155
158
  type BetaDreamUsage,
159
+ type BetaOutputBehavior,
160
+ type BetaOutputBehaviorCreateNew,
161
+ type BetaOutputBehaviorUpdateExisting,
156
162
  type DreamCreateParams,
157
163
  type DreamRetrieveParams,
158
164
  type DreamListParams,
@@ -468,11 +474,13 @@ export {
468
474
  } from './models';
469
475
  export {
470
476
  Sessions,
477
+ type BetaManagedAgentsAdvisorParams,
471
478
  type BetaManagedAgentsAgentMessagePreview,
472
479
  type BetaManagedAgentsAgentParams,
473
480
  type BetaManagedAgentsAgentThinkingPreview,
474
481
  type BetaManagedAgentsAgentWithOverridesParams,
475
482
  type BetaManagedAgentsBranchCheckout,
483
+ type BetaManagedAgentsBudgetLimit,
476
484
  type BetaManagedAgentsCacheCreationUsage,
477
485
  type BetaManagedAgentsCommitCheckout,
478
486
  type BetaManagedAgentsDeletedSession,
@@ -486,6 +494,7 @@ export {
486
494
  type BetaManagedAgentsMultiagentParams,
487
495
  type BetaManagedAgentsMultiagentRosterEntryParams,
488
496
  type BetaManagedAgentsOutcomeEvaluationResource,
497
+ type BetaManagedAgentsServerToolUsage,
489
498
  type BetaManagedAgentsSession,
490
499
  type BetaManagedAgentsSessionAgent,
491
500
  type BetaManagedAgentsSessionAgentUpdate,
@@ -493,6 +502,7 @@ export {
493
502
  type BetaManagedAgentsSessionStats,
494
503
  type BetaManagedAgentsSessionUpdatedEvent,
495
504
  type BetaManagedAgentsSessionUsage,
505
+ type BetaManagedAgentsSessionUsageEvent,
496
506
  type BetaManagedAgentsStartEvent,
497
507
  type BetaManagedAgentsStartEventPreview,
498
508
  type BetaManagedAgentsSystemContentBlock,
@@ -579,6 +589,7 @@ export {
579
589
  type BetaWebhookMemoryStoreCreatedEventData,
580
590
  type BetaWebhookMemoryStoreDeletedEventData,
581
591
  type BetaWebhookSessionArchivedEventData,
592
+ type BetaWebhookSessionBudgetReachedEventData,
582
593
  type BetaWebhookSessionCreatedEventData,
583
594
  type BetaWebhookSessionDeletedEventData,
584
595
  type BetaWebhookSessionIdledEventData,
@@ -48,28 +48,7 @@ import {
48
48
 
49
49
  const DEPRECATED_MODELS: {
50
50
  [K in Model]?: string;
51
- } = {
52
- 'claude-1.3': 'November 6th, 2024',
53
- 'claude-1.3-100k': 'November 6th, 2024',
54
- 'claude-instant-1.1': 'November 6th, 2024',
55
- 'claude-instant-1.1-100k': 'November 6th, 2024',
56
- 'claude-instant-1.2': 'November 6th, 2024',
57
- 'claude-3-sonnet-20240229': 'July 21st, 2025',
58
- 'claude-3-opus-20240229': 'January 5th, 2026',
59
- 'claude-2.1': 'July 21st, 2025',
60
- 'claude-2.0': 'July 21st, 2025',
61
- 'claude-3-7-sonnet-latest': 'February 19th, 2026',
62
- 'claude-3-7-sonnet-20250219': 'February 19th, 2026',
63
- 'claude-3-5-haiku-latest': 'February 19th, 2026',
64
- 'claude-3-5-haiku-20241022': 'February 19th, 2026',
65
- 'claude-opus-4-0': 'June 15th, 2026',
66
- 'claude-opus-4-20250514': 'June 15th, 2026',
67
- 'claude-sonnet-4-0': 'June 15th, 2026',
68
- 'claude-sonnet-4-20250514': 'June 15th, 2026',
69
- 'claude-opus-4-1': 'August 5th, 2026',
70
- 'claude-opus-4-1-20250805': 'August 5th, 2026',
71
- 'claude-mythos-preview': 'June 30th, 2026',
72
- };
51
+ } = {};
73
52
 
74
53
  const MODELS_TO_WARN_WITH_THINKING_ENABLED: Model[] = ['claude-mythos-preview', 'claude-opus-4-6'];
75
54
 
@@ -131,7 +110,7 @@ export class Messages extends APIResource {
131
110
  );
132
111
  }
133
112
 
134
- let timeout = (this._client as any)._options.timeout as number | null;
113
+ let timeout = options?.timeout ?? ((this._client as any)._options.timeout as number | null);
135
114
  if (!body.stream && timeout == null) {
136
115
  const maxNonstreamingTokens = MODEL_NONSTREAMING_TOKENS[body.model] ?? undefined;
137
116
  timeout = this._client.calculateNonstreamingTimeout(body.max_tokens, maxNonstreamingTokens);
@@ -2618,12 +2597,28 @@ export type BetaRawMessageStreamEvent =
2618
2597
  | BetaRawContentBlockStopEvent;
2619
2598
 
2620
2599
  export interface BetaRedactedThinkingBlock {
2600
+ /**
2601
+ * The contents of this redacted thinking block, returned when portions of the
2602
+ * model's thinking were safety-redacted. This field is opaque and encrypted, with
2603
+ * no readable content.
2604
+ *
2605
+ * Pass `redacted_thinking` blocks back to the API unchanged when continuing a
2606
+ * multi-turn conversation.
2607
+ *
2608
+ * See
2609
+ * [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#redacted-thinking-blocks)
2610
+ * for details.
2611
+ */
2621
2612
  data: string;
2622
2613
 
2623
2614
  type: 'redacted_thinking';
2624
2615
  }
2625
2616
 
2626
2617
  export interface BetaRedactedThinkingBlockParam {
2618
+ /**
2619
+ * The `data` value of this redacted thinking block, exactly as returned by the API
2620
+ * in a previous response. Opaque and encrypted; pass it back unchanged.
2621
+ */
2627
2622
  data: string;
2628
2623
 
2629
2624
  type: 'redacted_thinking';
@@ -2912,6 +2907,11 @@ export interface BetaServerToolUseBlockParam {
2912
2907
  }
2913
2908
 
2914
2909
  export interface BetaSignatureDelta {
2910
+ /**
2911
+ * The `signature` for this thinking block: an opaque value used to verify that the
2912
+ * block was generated by Claude when it is passed back to the API. Delivered in a
2913
+ * `signature_delta` event just before the block's `content_block_stop` event.
2914
+ */
2915
2915
  signature: string;
2916
2916
 
2917
2917
  type: 'signature_delta';
@@ -3139,16 +3139,41 @@ export interface BetaTextEditorCodeExecutionViewResultBlockParam {
3139
3139
  }
3140
3140
 
3141
3141
  export interface BetaThinkingBlock {
3142
+ /**
3143
+ * A value used to verify that this thinking block was generated by Claude when it
3144
+ * is passed back to the API.
3145
+ *
3146
+ * This is an opaque field and should not be interpreted or parsed. When passing
3147
+ * thinking blocks back to the API (required when using tools with extended
3148
+ * thinking), pass them back exactly as received, with this field intact.
3149
+ *
3150
+ * See
3151
+ * [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking)
3152
+ * for details.
3153
+ */
3142
3154
  signature: string;
3143
3155
 
3156
+ /**
3157
+ * The text of Claude's thinking process for this block.
3158
+ */
3144
3159
  thinking: string;
3145
3160
 
3146
3161
  type: 'thinking';
3147
3162
  }
3148
3163
 
3149
3164
  export interface BetaThinkingBlockParam {
3165
+ /**
3166
+ * The `signature` value of this thinking block, exactly as returned by the API in
3167
+ * a previous response. Used to verify that the block was generated by Claude.
3168
+ *
3169
+ * Thinking blocks must be passed back unmodified and in their original order; a
3170
+ * modified block results in a 400 `invalid_request_error`.
3171
+ */
3150
3172
  signature: string;
3151
3173
 
3174
+ /**
3175
+ * The `thinking` text of this block as returned by the API.
3176
+ */
3152
3177
  thinking: string;
3153
3178
 
3154
3179
  type: 'thinking';
@@ -3224,6 +3249,11 @@ export interface BetaThinkingDelta {
3224
3249
  */
3225
3250
  estimated_tokens: number | null;
3226
3251
 
3252
+ /**
3253
+ * The incremental `thinking` text for this content block. Concatenate the
3254
+ * `thinking` values of successive `thinking_delta` events to assemble the block's
3255
+ * full `thinking` value.
3256
+ */
3227
3257
  thinking: string;
3228
3258
 
3229
3259
  type: 'thinking_delta';