@anthropic-ai/sdk 0.125.0 → 0.126.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 (297) hide show
  1. package/CHANGELOG.md +50 -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 +846 -840
  7. package/client.js.map +1 -1
  8. package/client.mjs +846 -834
  9. package/client.mjs.map +1 -1
  10. package/core/api-promise.js +71 -68
  11. package/core/api-promise.js.map +1 -1
  12. package/core/api-promise.mjs +71 -64
  13. package/core/api-promise.mjs.map +1 -1
  14. package/core/error.js +5 -2
  15. package/core/error.js.map +1 -1
  16. package/core/error.mjs +5 -2
  17. package/core/error.mjs.map +1 -1
  18. package/core/pagination.js +56 -50
  19. package/core/pagination.js.map +1 -1
  20. package/core/pagination.mjs +56 -41
  21. package/core/pagination.mjs.map +1 -1
  22. package/core/streaming.js +212 -209
  23. package/core/streaming.js.map +1 -1
  24. package/core/streaming.mjs +212 -209
  25. package/core/streaming.mjs.map +1 -1
  26. package/helpers/beta/mcp.js +14 -19
  27. package/helpers/beta/mcp.js.map +1 -1
  28. package/helpers/beta/mcp.mjs +14 -13
  29. package/helpers/beta/mcp.mjs.map +1 -1
  30. package/internal/constants.js +1 -1
  31. package/internal/constants.js.map +1 -1
  32. package/internal/decoders/jsonl.js +27 -24
  33. package/internal/decoders/jsonl.js.map +1 -1
  34. package/internal/decoders/jsonl.mjs +27 -24
  35. package/internal/decoders/jsonl.mjs.map +1 -1
  36. package/internal/decoders/line.js +52 -49
  37. package/internal/decoders/line.js.map +1 -1
  38. package/internal/decoders/line.mjs +52 -43
  39. package/internal/decoders/line.mjs.map +1 -1
  40. package/internal/file-store.js +256 -258
  41. package/internal/file-store.js.map +1 -1
  42. package/internal/file-store.mjs +256 -243
  43. package/internal/file-store.mjs.map +1 -1
  44. package/internal/node.browser.d.mts.map +1 -1
  45. package/internal/node.browser.d.ts.map +1 -1
  46. package/internal/node.browser.js.map +1 -1
  47. package/internal/node.browser.mjs +7 -7
  48. package/internal/node.browser.mjs.map +1 -1
  49. package/internal/shim-types.js +0 -6
  50. package/internal/shim-types.js.map +1 -1
  51. package/internal/shim-types.mjs +0 -6
  52. package/internal/shim-types.mjs.map +1 -1
  53. package/internal/shims.js +0 -6
  54. package/internal/shims.js.map +1 -1
  55. package/internal/shims.mjs +0 -6
  56. package/internal/shims.mjs.map +1 -1
  57. package/internal/stainless-helper-header.js +6 -6
  58. package/internal/stainless-helper-header.js.map +1 -1
  59. package/internal/utils/async-queue.js +66 -63
  60. package/internal/utils/async-queue.js.map +1 -1
  61. package/internal/utils/async-queue.mjs +66 -56
  62. package/internal/utils/async-queue.mjs.map +1 -1
  63. package/internal/utils/bytes.d.mts +1 -1
  64. package/internal/utils/bytes.d.mts.map +1 -1
  65. package/internal/utils/bytes.d.ts +1 -1
  66. package/internal/utils/bytes.d.ts.map +1 -1
  67. package/lib/BetaMessageStream.js +593 -590
  68. package/lib/BetaMessageStream.js.map +1 -1
  69. package/lib/BetaMessageStream.mjs +593 -590
  70. package/lib/BetaMessageStream.mjs.map +1 -1
  71. package/lib/MessageStream.js +544 -541
  72. package/lib/MessageStream.js.map +1 -1
  73. package/lib/MessageStream.mjs +544 -541
  74. package/lib/MessageStream.mjs.map +1 -1
  75. package/lib/environments/poller.js +180 -174
  76. package/lib/environments/poller.js.map +1 -1
  77. package/lib/environments/poller.mjs +180 -153
  78. package/lib/environments/poller.mjs.map +1 -1
  79. package/lib/environments/worker.js +375 -369
  80. package/lib/environments/worker.js.map +1 -1
  81. package/lib/environments/worker.mjs +374 -329
  82. package/lib/environments/worker.mjs.map +1 -1
  83. package/lib/tools/BetaToolRunner.js +316 -313
  84. package/lib/tools/BetaToolRunner.js.map +1 -1
  85. package/lib/tools/BetaToolRunner.mjs +315 -306
  86. package/lib/tools/BetaToolRunner.mjs.map +1 -1
  87. package/lib/tools/SessionToolRunner.js +241 -235
  88. package/lib/tools/SessionToolRunner.js.map +1 -1
  89. package/lib/tools/SessionToolRunner.mjs +241 -192
  90. package/lib/tools/SessionToolRunner.mjs.map +1 -1
  91. package/lib/tools/ToolError.js +39 -36
  92. package/lib/tools/ToolError.js.map +1 -1
  93. package/lib/tools/ToolError.mjs +39 -13
  94. package/lib/tools/ToolError.mjs.map +1 -1
  95. package/package.json +3 -3
  96. package/resources/beta/agents/agents.js +135 -132
  97. package/resources/beta/agents/agents.js.map +1 -1
  98. package/resources/beta/agents/agents.mjs +135 -132
  99. package/resources/beta/agents/agents.mjs.map +1 -1
  100. package/resources/beta/beta.d.mts +5 -5
  101. package/resources/beta/beta.d.mts.map +1 -1
  102. package/resources/beta/beta.d.ts +5 -5
  103. package/resources/beta/beta.d.ts.map +1 -1
  104. package/resources/beta/beta.js +39 -36
  105. package/resources/beta/beta.js.map +1 -1
  106. package/resources/beta/beta.mjs +39 -36
  107. package/resources/beta/beta.mjs.map +1 -1
  108. package/resources/beta/dreams.d.mts +2 -28
  109. package/resources/beta/dreams.d.mts.map +1 -1
  110. package/resources/beta/dreams.d.ts +2 -28
  111. package/resources/beta/dreams.d.ts.map +1 -1
  112. package/resources/beta/environments/environments.js +157 -154
  113. package/resources/beta/environments/environments.js.map +1 -1
  114. package/resources/beta/environments/environments.mjs +157 -154
  115. package/resources/beta/environments/environments.mjs.map +1 -1
  116. package/resources/beta/environments/work.js +255 -252
  117. package/resources/beta/environments/work.js.map +1 -1
  118. package/resources/beta/environments/work.mjs +255 -252
  119. package/resources/beta/environments/work.mjs.map +1 -1
  120. package/resources/beta/index.d.mts +2 -2
  121. package/resources/beta/index.d.mts.map +1 -1
  122. package/resources/beta/index.d.ts +2 -2
  123. package/resources/beta/index.d.ts.map +1 -1
  124. package/resources/beta/index.js.map +1 -1
  125. package/resources/beta/index.mjs.map +1 -1
  126. package/resources/beta/memory-stores/memory-stores.js +150 -147
  127. package/resources/beta/memory-stores/memory-stores.js.map +1 -1
  128. package/resources/beta/memory-stores/memory-stores.mjs +150 -147
  129. package/resources/beta/memory-stores/memory-stores.mjs.map +1 -1
  130. package/resources/beta/messages/batches.d.mts +12 -1
  131. package/resources/beta/messages/batches.d.mts.map +1 -1
  132. package/resources/beta/messages/batches.d.ts +12 -1
  133. package/resources/beta/messages/batches.d.ts.map +1 -1
  134. package/resources/beta/messages/index.d.mts +1 -1
  135. package/resources/beta/messages/index.d.mts.map +1 -1
  136. package/resources/beta/messages/index.d.ts +1 -1
  137. package/resources/beta/messages/index.d.ts.map +1 -1
  138. package/resources/beta/messages/index.js.map +1 -1
  139. package/resources/beta/messages/index.mjs.map +1 -1
  140. package/resources/beta/messages/messages.d.mts +238 -100
  141. package/resources/beta/messages/messages.d.mts.map +1 -1
  142. package/resources/beta/messages/messages.d.ts +238 -100
  143. package/resources/beta/messages/messages.d.ts.map +1 -1
  144. package/resources/beta/messages/messages.js +113 -110
  145. package/resources/beta/messages/messages.js.map +1 -1
  146. package/resources/beta/messages/messages.mjs +113 -110
  147. package/resources/beta/messages/messages.mjs.map +1 -1
  148. package/resources/beta/models.d.mts +22 -1
  149. package/resources/beta/models.d.mts.map +1 -1
  150. package/resources/beta/models.d.ts +22 -1
  151. package/resources/beta/models.d.ts.map +1 -1
  152. package/resources/beta/organization/federation/federation.js +11 -8
  153. package/resources/beta/organization/federation/federation.js.map +1 -1
  154. package/resources/beta/organization/federation/federation.mjs +11 -8
  155. package/resources/beta/organization/federation/federation.mjs.map +1 -1
  156. package/resources/beta/organization/federation/rules/rules.js +187 -184
  157. package/resources/beta/organization/federation/rules/rules.js.map +1 -1
  158. package/resources/beta/organization/federation/rules/rules.mjs +187 -184
  159. package/resources/beta/organization/federation/rules/rules.mjs.map +1 -1
  160. package/resources/beta/organization/organization.js +38 -35
  161. package/resources/beta/organization/organization.js.map +1 -1
  162. package/resources/beta/organization/organization.mjs +38 -35
  163. package/resources/beta/organization/organization.mjs.map +1 -1
  164. package/resources/beta/organization/service-accounts/service-accounts.js +163 -160
  165. package/resources/beta/organization/service-accounts/service-accounts.js.map +1 -1
  166. package/resources/beta/organization/service-accounts/service-accounts.mjs +163 -160
  167. package/resources/beta/organization/service-accounts/service-accounts.mjs.map +1 -1
  168. package/resources/beta/organization/workspaces/workspaces.d.mts +3 -3
  169. package/resources/beta/organization/workspaces/workspaces.d.mts.map +1 -1
  170. package/resources/beta/organization/workspaces/workspaces.d.ts +3 -3
  171. package/resources/beta/organization/workspaces/workspaces.d.ts.map +1 -1
  172. package/resources/beta/organization/workspaces/workspaces.js +97 -94
  173. package/resources/beta/organization/workspaces/workspaces.js.map +1 -1
  174. package/resources/beta/organization/workspaces/workspaces.mjs +97 -94
  175. package/resources/beta/organization/workspaces/workspaces.mjs.map +1 -1
  176. package/resources/beta/sessions/events.d.mts +12 -21
  177. package/resources/beta/sessions/events.d.mts.map +1 -1
  178. package/resources/beta/sessions/events.d.ts +12 -21
  179. package/resources/beta/sessions/events.d.ts.map +1 -1
  180. package/resources/beta/sessions/events.js +118 -115
  181. package/resources/beta/sessions/events.js.map +1 -1
  182. package/resources/beta/sessions/events.mjs +118 -115
  183. package/resources/beta/sessions/events.mjs.map +1 -1
  184. package/resources/beta/sessions/resources.d.mts +0 -3
  185. package/resources/beta/sessions/resources.d.mts.map +1 -1
  186. package/resources/beta/sessions/resources.d.ts +0 -3
  187. package/resources/beta/sessions/resources.d.ts.map +1 -1
  188. package/resources/beta/sessions/sessions.d.mts +2 -2
  189. package/resources/beta/sessions/sessions.d.ts +2 -2
  190. package/resources/beta/sessions/sessions.js +161 -158
  191. package/resources/beta/sessions/sessions.js.map +1 -1
  192. package/resources/beta/sessions/sessions.mjs +161 -158
  193. package/resources/beta/sessions/sessions.mjs.map +1 -1
  194. package/resources/beta/sessions/threads/threads.js +86 -83
  195. package/resources/beta/sessions/threads/threads.js.map +1 -1
  196. package/resources/beta/sessions/threads/threads.mjs +86 -83
  197. package/resources/beta/sessions/threads/threads.mjs.map +1 -1
  198. package/resources/beta/skills/skills.js +104 -101
  199. package/resources/beta/skills/skills.js.map +1 -1
  200. package/resources/beta/skills/skills.mjs +104 -101
  201. package/resources/beta/skills/skills.mjs.map +1 -1
  202. package/resources/beta/tunnels/tunnels.js +188 -185
  203. package/resources/beta/tunnels/tunnels.js.map +1 -1
  204. package/resources/beta/tunnels/tunnels.mjs +188 -185
  205. package/resources/beta/tunnels/tunnels.mjs.map +1 -1
  206. package/resources/beta/user-profiles.d.mts +45 -0
  207. package/resources/beta/user-profiles.d.mts.map +1 -1
  208. package/resources/beta/user-profiles.d.ts +45 -0
  209. package/resources/beta/user-profiles.d.ts.map +1 -1
  210. package/resources/beta/user-profiles.js +25 -10
  211. package/resources/beta/user-profiles.js.map +1 -1
  212. package/resources/beta/user-profiles.mjs +25 -10
  213. package/resources/beta/user-profiles.mjs.map +1 -1
  214. package/resources/beta/vaults/credentials.d.mts +0 -14
  215. package/resources/beta/vaults/credentials.d.mts.map +1 -1
  216. package/resources/beta/vaults/credentials.d.ts +0 -14
  217. package/resources/beta/vaults/credentials.d.ts.map +1 -1
  218. package/resources/beta/vaults/vaults.js +156 -153
  219. package/resources/beta/vaults/vaults.js.map +1 -1
  220. package/resources/beta/vaults/vaults.mjs +156 -153
  221. package/resources/beta/vaults/vaults.mjs.map +1 -1
  222. package/resources/completions.d.mts +1 -1
  223. package/resources/completions.d.ts +1 -1
  224. package/resources/index.d.mts +1 -1
  225. package/resources/index.d.mts.map +1 -1
  226. package/resources/index.d.ts +1 -1
  227. package/resources/index.d.ts.map +1 -1
  228. package/resources/index.js.map +1 -1
  229. package/resources/index.mjs.map +1 -1
  230. package/resources/messages/index.d.mts +1 -1
  231. package/resources/messages/index.d.mts.map +1 -1
  232. package/resources/messages/index.d.ts +1 -1
  233. package/resources/messages/index.d.ts.map +1 -1
  234. package/resources/messages/index.js.map +1 -1
  235. package/resources/messages/index.mjs.map +1 -1
  236. package/resources/messages/messages.d.mts +100 -63
  237. package/resources/messages/messages.d.mts.map +1 -1
  238. package/resources/messages/messages.d.ts +100 -63
  239. package/resources/messages/messages.d.ts.map +1 -1
  240. package/resources/messages/messages.js +115 -112
  241. package/resources/messages/messages.js.map +1 -1
  242. package/resources/messages/messages.mjs +115 -112
  243. package/resources/messages/messages.mjs.map +1 -1
  244. package/resources/skills/skills.js +88 -85
  245. package/resources/skills/skills.js.map +1 -1
  246. package/resources/skills/skills.mjs +88 -85
  247. package/resources/skills/skills.mjs.map +1 -1
  248. package/resources/top-level.js +0 -1
  249. package/resources/top-level.js.map +1 -1
  250. package/resources/top-level.mjs +0 -1
  251. package/resources/top-level.mjs.map +1 -1
  252. package/src/client.ts +13 -1
  253. package/src/internal/node.browser.ts +7 -7
  254. package/src/internal/utils/bytes.ts +1 -1
  255. package/src/resources/beta/beta.ts +24 -1
  256. package/src/resources/beta/dreams.ts +2 -28
  257. package/src/resources/beta/index.ts +11 -0
  258. package/src/resources/beta/messages/batches.ts +13 -1
  259. package/src/resources/beta/messages/index.ts +10 -0
  260. package/src/resources/beta/messages/messages.ts +288 -99
  261. package/src/resources/beta/models.ts +25 -0
  262. package/src/resources/beta/organization/workspaces/workspaces.ts +3 -3
  263. package/src/resources/beta/sessions/events.ts +12 -21
  264. package/src/resources/beta/sessions/resources.ts +0 -3
  265. package/src/resources/beta/sessions/sessions.ts +2 -2
  266. package/src/resources/beta/user-profiles.ts +75 -10
  267. package/src/resources/beta/vaults/credentials.ts +0 -14
  268. package/src/resources/completions.ts +1 -1
  269. package/src/resources/index.ts +6 -0
  270. package/src/resources/messages/index.ts +6 -0
  271. package/src/resources/messages/messages.ts +128 -62
  272. package/src/tsconfig.json +13 -3
  273. package/src/version.ts +1 -1
  274. package/tools/agent-toolset/fs-util.js +0 -6
  275. package/tools/agent-toolset/fs-util.js.map +1 -1
  276. package/tools/agent-toolset/fs-util.mjs +0 -6
  277. package/tools/agent-toolset/fs-util.mjs.map +1 -1
  278. package/tools/agent-toolset/memories.js +4 -4
  279. package/tools/agent-toolset/memories.js.map +1 -1
  280. package/tools/agent-toolset/memories.mjs +2 -2
  281. package/tools/agent-toolset/memories.mjs.map +1 -1
  282. package/tools/agent-toolset/node.browser.js +12 -12
  283. package/tools/agent-toolset/node.browser.js.map +1 -1
  284. package/tools/agent-toolset/node.js +142 -139
  285. package/tools/agent-toolset/node.js.map +1 -1
  286. package/tools/agent-toolset/node.mjs +132 -125
  287. package/tools/agent-toolset/node.mjs.map +1 -1
  288. package/tools/agent-toolset/skills.js +5 -5
  289. package/tools/agent-toolset/skills.js.map +1 -1
  290. package/tools/agent-toolset/sync-interval.js +3 -3
  291. package/tools/agent-toolset/sync-interval.js.map +1 -1
  292. package/tools/memory/node.browser.js +2 -2
  293. package/tools/memory/node.browser.js.map +1 -1
  294. package/version.d.mts +1 -1
  295. package/version.d.ts +1 -1
  296. package/version.js +1 -1
  297. package/version.mjs +1 -1
@@ -83,6 +83,23 @@ export interface BetaCapabilitySupport {
83
83
  supported: boolean;
84
84
  }
85
85
 
86
+ /**
87
+ * Compaction capability details: whether the model accepts the top-level
88
+ * `compaction` request parameter, with one entry per supported `compaction.type`
89
+ * value.
90
+ */
91
+ export interface BetaCompactionCapability {
92
+ /**
93
+ * Whether the summarize compaction type is supported.
94
+ */
95
+ summarize: BetaCapabilitySupport;
96
+
97
+ /**
98
+ * Whether this capability is supported by the model.
99
+ */
100
+ supported: boolean;
101
+ }
102
+
86
103
  /**
87
104
  * Context management capability details.
88
105
  */
@@ -162,6 +179,13 @@ export interface BetaModelCapabilities {
162
179
  */
163
180
  code_execution: BetaCapabilitySupport;
164
181
 
182
+ /**
183
+ * Compaction capability details: whether the model accepts the top-level
184
+ * `compaction` request parameter, with one entry per supported `compaction.type`
185
+ * value.
186
+ */
187
+ compaction: BetaCompactionCapability | null;
188
+
165
189
  /**
166
190
  * Context management support and available strategies.
167
191
  */
@@ -307,6 +331,7 @@ export interface ModelListParams extends PageParams {
307
331
  export declare namespace Models {
308
332
  export {
309
333
  type BetaCapabilitySupport as BetaCapabilitySupport,
334
+ type BetaCompactionCapability as BetaCompactionCapability,
310
335
  type BetaContextManagementCapability as BetaContextManagementCapability,
311
336
  type BetaEffortCapability as BetaEffortCapability,
312
337
  type BetaModelCapabilities as BetaModelCapabilities,
@@ -146,17 +146,17 @@ export interface BetaDataResidency {
146
146
  /**
147
147
  * Permitted inference geo values. 'unrestricted' means all geos are allowed.
148
148
  */
149
- allowed_inference_geos: Array<string> | 'unrestricted';
149
+ allowed_inference_geos: Array<BetaAllowedInferenceGeo> | 'unrestricted';
150
150
 
151
151
  /**
152
152
  * Default inference geo applied when requests omit the parameter.
153
153
  */
154
- default_inference_geo: string;
154
+ default_inference_geo: 'global' | 'us';
155
155
 
156
156
  /**
157
157
  * Geographic region for workspace data storage. Immutable after creation.
158
158
  */
159
- workspace_geo: string;
159
+ workspace_geo: 'us';
160
160
  }
161
161
 
162
162
  export interface BetaDataResidencyCreateConfig {
@@ -226,7 +226,9 @@ export interface BetaManagedAgentsAgentCustomToolUseEvent {
226
226
  /**
227
227
  * When set, this event was cross-posted from a subagent's thread to surface its
228
228
  * custom tool use on the primary thread's stream. Empty on the thread's own
229
- * events. Echo this on a `user.custom_tool_result` event to route the result back.
229
+ * events. Informational only: the server routes the matching
230
+ * `user.custom_tool_result` by `custom_tool_use_id`, so clients do not send it
231
+ * back.
230
232
  */
231
233
  session_thread_id?: string | null;
232
234
  }
@@ -314,8 +316,8 @@ export interface BetaManagedAgentsAgentMCPToolUseEvent {
314
316
  /**
315
317
  * When set, this event was cross-posted from a subagent's thread to surface its
316
318
  * permission request on the primary thread's stream. Empty on the thread's own
317
- * events. Echo this on a `user.tool_confirmation` event to route the approval
318
- * back.
319
+ * events. Informational only: the server routes the matching
320
+ * `user.tool_confirmation` by `tool_use_id`, so clients do not send it back.
319
321
  */
320
322
  session_thread_id?: string | null;
321
323
  }
@@ -574,8 +576,9 @@ export interface BetaManagedAgentsAgentToolUseEvent {
574
576
  /**
575
577
  * When set, this event was cross-posted from a subagent's thread to surface its
576
578
  * permission request on the primary thread's stream. Empty on the thread's own
577
- * events. Echo this on a `user.tool_confirmation` event to route the approval
578
- * back.
579
+ * events. Informational only: the server routes the matching
580
+ * `user.tool_confirmation` or `user.tool_result` by `tool_use_id`, so clients do
581
+ * not send it back.
579
582
  */
580
583
  session_thread_id?: string | null;
581
584
  }
@@ -1041,11 +1044,6 @@ export interface BetaManagedAgentsSessionErrorEvent {
1041
1044
  */
1042
1045
  id: string;
1043
1046
 
1044
- /**
1045
- * An unknown or unexpected error occurred during session execution. A fallback
1046
- * variant; clients that don't recognize a new error code can match on
1047
- * `retry_status` and `message` alone.
1048
- */
1049
1047
  error:
1050
1048
  | BetaManagedAgentsUnknownError
1051
1049
  | BetaManagedAgentsModelOverloadedError
@@ -1141,9 +1139,6 @@ export interface BetaManagedAgentsSessionStatusIdleEvent {
1141
1139
  */
1142
1140
  processed_at: string;
1143
1141
 
1144
- /**
1145
- * The agent completed its turn naturally and is ready for the next user message.
1146
- */
1147
1142
  stop_reason:
1148
1143
  | BetaManagedAgentsSessionEndTurn
1149
1144
  | BetaManagedAgentsSessionRequiresAction
@@ -1258,9 +1253,6 @@ export interface BetaManagedAgentsSessionThreadStatusIdleEvent {
1258
1253
  */
1259
1254
  session_thread_id: string;
1260
1255
 
1261
- /**
1262
- * The agent completed its turn naturally and is ready for the next user message.
1263
- */
1264
1256
  stop_reason:
1265
1257
  | BetaManagedAgentsSessionEndTurn
1266
1258
  | BetaManagedAgentsSessionRequiresAction
@@ -1777,8 +1769,8 @@ export interface BetaManagedAgentsUserCustomToolResultEvent {
1777
1769
  processed_at?: string | null;
1778
1770
 
1779
1771
  /**
1780
- * Routes this result to a subagent thread. Copy from the `agent.custom_tool_use`
1781
- * event's `session_thread_id`.
1772
+ * Set by the server to the subagent thread this result was routed to. Omitted when
1773
+ * it was routed to the primary thread.
1782
1774
  */
1783
1775
  session_thread_id?: string | null;
1784
1776
  }
@@ -1993,9 +1985,8 @@ export interface BetaManagedAgentsUserToolConfirmationEvent {
1993
1985
  processed_at?: string | null;
1994
1986
 
1995
1987
  /**
1996
- * When set, the confirmation routes to this subagent's thread rather than the
1997
- * primary. Echo this from the `session_thread_id` on the `agent.tool_use` or
1998
- * `agent.mcp_tool_use` event that prompted the approval.
1988
+ * Set by the server to the subagent thread this confirmation was routed to.
1989
+ * Omitted when it was routed to the primary thread.
1999
1990
  */
2000
1991
  session_thread_id?: string | null;
2001
1992
  }
@@ -268,9 +268,6 @@ export interface BetaManagedAgentsMemoryStoreResource {
268
268
  name?: string | null;
269
269
  }
270
270
 
271
- /**
272
- * A memory store attached to an agent session.
273
- */
274
271
  export type BetaManagedAgentsSessionResource =
275
272
  | BetaManagedAgentsGitHubRepositoryResource
276
273
  | BetaManagedAgentsFileResource
@@ -1077,8 +1077,8 @@ export interface BetaManagedAgentsUserToolResultEvent {
1077
1077
  processed_at?: string | null;
1078
1078
 
1079
1079
  /**
1080
- * Routes this result to a subagent thread. Copy from the `agent.tool_use` event's
1081
- * `session_thread_id`.
1080
+ * Set by the server to the subagent thread this result was routed to. Omitted when
1081
+ * it was routed to the primary thread.
1082
1082
  */
1083
1083
  session_thread_id?: string | null;
1084
1084
  }
@@ -17,12 +17,15 @@ export class UserProfiles extends APIResource {
17
17
  * ```
18
18
  */
19
19
  create(params: UserProfileCreateParams, options?: RequestOptions): APIPromise<BetaUserProfile> {
20
- const { betas, ...body } = params;
20
+ const { betas, workspace_id, ...body } = params;
21
21
  return this._client.post('/v1/user_profiles?beta=true', {
22
22
  body,
23
23
  ...options,
24
24
  headers: buildHeaders([
25
- { 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-08-18'].toString() },
25
+ {
26
+ 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-08-18'].toString(),
27
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
28
+ },
26
29
  options?.headers,
27
30
  ]),
28
31
  });
@@ -44,11 +47,14 @@ export class UserProfiles extends APIResource {
44
47
  params: UserProfileRetrieveParams | null | undefined = {},
45
48
  options?: RequestOptions,
46
49
  ): APIPromise<BetaUserProfile> {
47
- const { betas } = params ?? {};
50
+ const { betas, workspace_id } = params ?? {};
48
51
  return this._client.get(path`/v1/user_profiles/${userProfileID}?beta=true`, {
49
52
  ...options,
50
53
  headers: buildHeaders([
51
- { 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-08-18'].toString() },
54
+ {
55
+ 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-08-18'].toString(),
56
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
57
+ },
52
58
  options?.headers,
53
59
  ]),
54
60
  });
@@ -70,12 +76,15 @@ export class UserProfiles extends APIResource {
70
76
  params: UserProfileUpdateParams,
71
77
  options?: RequestOptions,
72
78
  ): APIPromise<BetaUserProfile> {
73
- const { betas, ...body } = params;
79
+ const { betas, workspace_id, ...body } = params;
74
80
  return this._client.post(path`/v1/user_profiles/${userProfileID}?beta=true`, {
75
81
  body,
76
82
  ...options,
77
83
  headers: buildHeaders([
78
- { 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-08-18'].toString() },
84
+ {
85
+ 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-08-18'].toString(),
86
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
87
+ },
79
88
  options?.headers,
80
89
  ]),
81
90
  });
@@ -96,12 +105,15 @@ export class UserProfiles extends APIResource {
96
105
  params: UserProfileListParams | null | undefined = {},
97
106
  options?: RequestOptions,
98
107
  ): PagePromise<BetaUserProfilesPageCursor, BetaUserProfile> {
99
- const { betas, ...query } = params ?? {};
108
+ const { betas, workspace_id, ...query } = params ?? {};
100
109
  return this._client.getAPIList('/v1/user_profiles?beta=true', PageCursor<BetaUserProfile>, {
101
110
  query,
102
111
  ...options,
103
112
  headers: buildHeaders([
104
- { 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-08-18'].toString() },
113
+ {
114
+ 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-08-18'].toString(),
115
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
116
+ },
105
117
  options?.headers,
106
118
  ]),
107
119
  });
@@ -123,11 +135,14 @@ export class UserProfiles extends APIResource {
123
135
  params: UserProfileCreateEnrollmentURLParams | null | undefined = {},
124
136
  options?: RequestOptions,
125
137
  ): APIPromise<BetaUserProfileEnrollmentURL> {
126
- const { betas } = params ?? {};
138
+ const { betas, workspace_id } = params ?? {};
127
139
  return this._client.post(path`/v1/user_profiles/${userProfileID}/enrollment_url?beta=true`, {
128
140
  ...options,
129
141
  headers: buildHeaders([
130
- { 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-08-18'].toString() },
142
+ {
143
+ 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-08-18'].toString(),
144
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
145
+ },
131
146
  options?.headers,
132
147
  ]),
133
148
  });
@@ -378,6 +393,16 @@ export interface UserProfileCreateParams {
378
393
  * Header param: Optional header to specify the beta version(s) you want to use.
379
394
  */
380
395
  betas?: Array<BetaAPI.AnthropicBeta>;
396
+
397
+ /**
398
+ * Header param: Optional header to select the Workspace for this request. The
399
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
400
+ *
401
+ * Only needed for credentials that can act on more than one Workspace. A
402
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
403
+ * match that Workspace.
404
+ */
405
+ workspace_id?: string;
381
406
  }
382
407
 
383
408
  export interface UserProfileRetrieveParams {
@@ -385,6 +410,16 @@ export interface UserProfileRetrieveParams {
385
410
  * Optional header to specify the beta version(s) you want to use.
386
411
  */
387
412
  betas?: Array<BetaAPI.AnthropicBeta>;
413
+
414
+ /**
415
+ * Optional header to select the Workspace for this request. The value is a
416
+ * Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
417
+ *
418
+ * Only needed for credentials that can act on more than one Workspace. A
419
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
420
+ * match that Workspace.
421
+ */
422
+ workspace_id?: string;
388
423
  }
389
424
 
390
425
  export interface UserProfileUpdateParams {
@@ -436,6 +471,16 @@ export interface UserProfileUpdateParams {
436
471
  * Header param: Optional header to specify the beta version(s) you want to use.
437
472
  */
438
473
  betas?: Array<BetaAPI.AnthropicBeta>;
474
+
475
+ /**
476
+ * Header param: Optional header to select the Workspace for this request. The
477
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
478
+ *
479
+ * Only needed for credentials that can act on more than one Workspace. A
480
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
481
+ * match that Workspace.
482
+ */
483
+ workspace_id?: string;
439
484
  }
440
485
 
441
486
  export interface UserProfileListParams extends PageCursorParams {
@@ -453,6 +498,16 @@ export interface UserProfileListParams extends PageCursorParams {
453
498
  * Header param: Optional header to specify the beta version(s) you want to use.
454
499
  */
455
500
  betas?: Array<BetaAPI.AnthropicBeta>;
501
+
502
+ /**
503
+ * Header param: Optional header to select the Workspace for this request. The
504
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
505
+ *
506
+ * Only needed for credentials that can act on more than one Workspace. A
507
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
508
+ * match that Workspace.
509
+ */
510
+ workspace_id?: string;
456
511
  }
457
512
 
458
513
  export interface UserProfileCreateEnrollmentURLParams {
@@ -460,6 +515,16 @@ export interface UserProfileCreateEnrollmentURLParams {
460
515
  * Optional header to specify the beta version(s) you want to use.
461
516
  */
462
517
  betas?: Array<BetaAPI.AnthropicBeta>;
518
+
519
+ /**
520
+ * Optional header to select the Workspace for this request. The value is a
521
+ * Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
522
+ *
523
+ * Only needed for credentials that can act on more than one Workspace. A
524
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
525
+ * match that Workspace.
526
+ */
527
+ workspace_id?: string;
463
528
  }
464
529
 
465
530
  export declare namespace UserProfiles {
@@ -289,11 +289,6 @@ export interface BetaManagedAgentsCredential {
289
289
  display_name?: string | null;
290
290
  }
291
291
 
292
- /**
293
- * Substitute the secret on any host the session's Environment network policy
294
- * permits egress to. The Environment's network policy is the only boundary on
295
- * where the secret can reach.
296
- */
297
292
  export type BetaManagedAgentsCredentialNetworkingParams =
298
293
  | BetaManagedAgentsUnrestrictedCredentialNetworkingParams
299
294
  | BetaManagedAgentsLimitedCredentialNetworkingParams;
@@ -573,9 +568,6 @@ export interface BetaManagedAgentsMCPOAuthRefreshParams {
573
568
  */
574
569
  token_endpoint: string;
575
570
 
576
- /**
577
- * Token endpoint requires no client authentication.
578
- */
579
571
  token_endpoint_auth:
580
572
  | BetaManagedAgentsTokenEndpointAuthNoneParam
581
573
  | BetaManagedAgentsTokenEndpointAuthBasicParam
@@ -606,9 +598,6 @@ export interface BetaManagedAgentsMCPOAuthRefreshResponse {
606
598
  */
607
599
  token_endpoint: string;
608
600
 
609
- /**
610
- * Token endpoint requires no client authentication.
611
- */
612
601
  token_endpoint_auth:
613
602
  | BetaManagedAgentsTokenEndpointAuthNoneResponse
614
603
  | BetaManagedAgentsTokenEndpointAuthBasicResponse
@@ -639,9 +628,6 @@ export interface BetaManagedAgentsMCPOAuthRefreshUpdateParams {
639
628
  */
640
629
  scope?: string | null;
641
630
 
642
- /**
643
- * Updated HTTP Basic authentication parameters for the token endpoint.
644
- */
645
631
  token_endpoint_auth?:
646
632
  | BetaManagedAgentsTokenEndpointAuthBasicUpdateParam
647
633
  | BetaManagedAgentsTokenEndpointAuthPostUpdateParam;
@@ -156,7 +156,7 @@ export interface CompletionCreateParamsBase {
156
156
 
157
157
  /**
158
158
  * @deprecated Deprecated. Models released after Claude Opus 4.6 do not support
159
- * setting temperature. A value of 1.0 of will be accepted for backwards
159
+ * setting temperature. A value of 1.0 will be accepted for backwards
160
160
  * compatibility, all other values will be rejected with a 400 error.
161
161
  */
162
162
  temperature?: number;
@@ -255,6 +255,12 @@ export {
255
255
  type WebFetchToolResultErrorBlock,
256
256
  type WebFetchToolResultErrorBlockParam,
257
257
  type WebFetchToolResultErrorCode,
258
+ type WebFetchURLSourceAll,
259
+ type WebFetchURLSourceExcept,
260
+ type WebFetchURLSourceNone,
261
+ type WebFetchURLSourceOnly,
262
+ type WebFetchURLSourceToolReference,
263
+ type WebFetchURLSources,
258
264
  type WebSearchResultBlock,
259
265
  type WebSearchResultBlockParam,
260
266
  type WebSearchTool20250305,
@@ -237,6 +237,12 @@ export {
237
237
  type WebFetchToolResultErrorBlock,
238
238
  type WebFetchToolResultErrorBlockParam,
239
239
  type WebFetchToolResultErrorCode,
240
+ type WebFetchURLSourceAll,
241
+ type WebFetchURLSourceExcept,
242
+ type WebFetchURLSourceNone,
243
+ type WebFetchURLSourceOnly,
244
+ type WebFetchURLSourceToolReference,
245
+ type WebFetchURLSources,
240
246
  type WebSearchResultBlock,
241
247
  type WebSearchResultBlockParam,
242
248
  type WebSearchTool20250305,