@anthropic-ai/sdk 0.122.0 → 0.124.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 (486) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/client.d.mts +6 -5
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +6 -5
  5. package/client.d.ts.map +1 -1
  6. package/client.js +2 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +2 -1
  9. package/client.mjs.map +1 -1
  10. package/core/credentials.d.mts.map +1 -1
  11. package/core/credentials.d.ts.map +1 -1
  12. package/core/credentials.js +5 -7
  13. package/core/credentials.js.map +1 -1
  14. package/core/credentials.mjs +5 -7
  15. package/core/credentials.mjs.map +1 -1
  16. package/core/streaming.js +4 -2
  17. package/core/streaming.js.map +1 -1
  18. package/core/streaming.mjs +4 -2
  19. package/core/streaming.mjs.map +1 -1
  20. package/internal/file-store.d.mts.map +1 -1
  21. package/internal/file-store.d.ts.map +1 -1
  22. package/internal/file-store.js +23 -25
  23. package/internal/file-store.js.map +1 -1
  24. package/internal/file-store.mjs +5 -6
  25. package/internal/file-store.mjs.map +1 -1
  26. package/internal/node.browser.d.mts +9 -0
  27. package/internal/node.browser.d.mts.map +1 -0
  28. package/internal/node.browser.d.ts +9 -0
  29. package/internal/node.browser.d.ts.map +1 -0
  30. package/internal/node.browser.js +22 -0
  31. package/internal/node.browser.js.map +1 -0
  32. package/internal/node.browser.mjs +19 -0
  33. package/internal/node.browser.mjs.map +1 -0
  34. package/internal/node.d.mts +14 -0
  35. package/internal/node.d.mts.map +1 -0
  36. package/internal/node.d.ts +14 -0
  37. package/internal/node.d.ts.map +1 -0
  38. package/internal/node.js +24 -0
  39. package/internal/node.js.map +1 -0
  40. package/internal/node.mjs +14 -0
  41. package/internal/node.mjs.map +1 -0
  42. package/lib/BetaMessageStream.d.mts.map +1 -1
  43. package/lib/BetaMessageStream.d.ts.map +1 -1
  44. package/lib/BetaMessageStream.js +3 -0
  45. package/lib/BetaMessageStream.js.map +1 -1
  46. package/lib/BetaMessageStream.mjs +3 -0
  47. package/lib/BetaMessageStream.mjs.map +1 -1
  48. package/lib/credentials/credential-chain.js +1 -1
  49. package/lib/credentials/credential-chain.js.map +1 -1
  50. package/lib/credentials/credential-chain.mjs +1 -1
  51. package/lib/credentials/credential-chain.mjs.map +1 -1
  52. package/lib/credentials/identity-token.js +1 -1
  53. package/lib/credentials/identity-token.js.map +1 -1
  54. package/lib/credentials/identity-token.mjs +1 -1
  55. package/lib/credentials/identity-token.mjs.map +1 -1
  56. package/lib/credentials/types.d.mts.map +1 -1
  57. package/lib/credentials/types.d.ts.map +1 -1
  58. package/lib/credentials/types.js +2 -3
  59. package/lib/credentials/types.js.map +1 -1
  60. package/lib/credentials/types.mjs +2 -3
  61. package/lib/credentials/types.mjs.map +1 -1
  62. package/lib/credentials/user-oauth.js +1 -1
  63. package/lib/credentials/user-oauth.js.map +1 -1
  64. package/lib/credentials/user-oauth.mjs +1 -1
  65. package/lib/credentials/user-oauth.mjs.map +1 -1
  66. package/lib/middleware.d.mts.map +1 -1
  67. package/lib/middleware.d.ts.map +1 -1
  68. package/lib/middleware.js +30 -7
  69. package/lib/middleware.js.map +1 -1
  70. package/lib/middleware.mjs +30 -7
  71. package/lib/middleware.mjs.map +1 -1
  72. package/package.json +3 -1
  73. package/resources/beta/agents/agents.d.mts +46 -1
  74. package/resources/beta/agents/agents.d.mts.map +1 -1
  75. package/resources/beta/agents/agents.d.ts +46 -1
  76. package/resources/beta/agents/agents.d.ts.map +1 -1
  77. package/resources/beta/agents/agents.js +25 -10
  78. package/resources/beta/agents/agents.js.map +1 -1
  79. package/resources/beta/agents/agents.mjs +25 -10
  80. package/resources/beta/agents/agents.mjs.map +1 -1
  81. package/resources/beta/agents/versions.d.mts +9 -0
  82. package/resources/beta/agents/versions.d.mts.map +1 -1
  83. package/resources/beta/agents/versions.d.ts +9 -0
  84. package/resources/beta/agents/versions.d.ts.map +1 -1
  85. package/resources/beta/agents/versions.js +5 -2
  86. package/resources/beta/agents/versions.js.map +1 -1
  87. package/resources/beta/agents/versions.mjs +5 -2
  88. package/resources/beta/agents/versions.mjs.map +1 -1
  89. package/resources/beta/beta.d.mts +5 -5
  90. package/resources/beta/beta.d.mts.map +1 -1
  91. package/resources/beta/beta.d.ts +5 -5
  92. package/resources/beta/beta.d.ts.map +1 -1
  93. package/resources/beta/beta.js.map +1 -1
  94. package/resources/beta/beta.mjs.map +1 -1
  95. package/resources/beta/deployment-runs.d.mts +24 -6
  96. package/resources/beta/deployment-runs.d.mts.map +1 -1
  97. package/resources/beta/deployment-runs.d.ts +24 -6
  98. package/resources/beta/deployment-runs.d.ts.map +1 -1
  99. package/resources/beta/deployment-runs.js +10 -4
  100. package/resources/beta/deployment-runs.js.map +1 -1
  101. package/resources/beta/deployment-runs.mjs +10 -4
  102. package/resources/beta/deployment-runs.mjs.map +1 -1
  103. package/resources/beta/deployments.d.mts +75 -2
  104. package/resources/beta/deployments.d.mts.map +1 -1
  105. package/resources/beta/deployments.d.ts +75 -2
  106. package/resources/beta/deployments.d.ts.map +1 -1
  107. package/resources/beta/deployments.js +40 -16
  108. package/resources/beta/deployments.js.map +1 -1
  109. package/resources/beta/deployments.mjs +40 -16
  110. package/resources/beta/deployments.mjs.map +1 -1
  111. package/resources/beta/dreams.d.mts +73 -1
  112. package/resources/beta/dreams.d.mts.map +1 -1
  113. package/resources/beta/dreams.d.ts +73 -1
  114. package/resources/beta/dreams.d.ts.map +1 -1
  115. package/resources/beta/dreams.js +25 -10
  116. package/resources/beta/dreams.js.map +1 -1
  117. package/resources/beta/dreams.mjs +25 -10
  118. package/resources/beta/dreams.mjs.map +1 -1
  119. package/resources/beta/environments/environments.d.mts +54 -0
  120. package/resources/beta/environments/environments.d.mts.map +1 -1
  121. package/resources/beta/environments/environments.d.ts +54 -0
  122. package/resources/beta/environments/environments.d.ts.map +1 -1
  123. package/resources/beta/environments/environments.js +30 -12
  124. package/resources/beta/environments/environments.js.map +1 -1
  125. package/resources/beta/environments/environments.mjs +30 -12
  126. package/resources/beta/environments/environments.mjs.map +1 -1
  127. package/resources/beta/environments/work.d.mts +36 -0
  128. package/resources/beta/environments/work.d.mts.map +1 -1
  129. package/resources/beta/environments/work.d.ts +36 -0
  130. package/resources/beta/environments/work.d.ts.map +1 -1
  131. package/resources/beta/environments/work.js +20 -8
  132. package/resources/beta/environments/work.js.map +1 -1
  133. package/resources/beta/environments/work.mjs +20 -8
  134. package/resources/beta/environments/work.mjs.map +1 -1
  135. package/resources/beta/files.d.mts +48 -1
  136. package/resources/beta/files.d.mts.map +1 -1
  137. package/resources/beta/files.d.ts +48 -1
  138. package/resources/beta/files.d.ts.map +1 -1
  139. package/resources/beta/files.js +22 -9
  140. package/resources/beta/files.js.map +1 -1
  141. package/resources/beta/files.mjs +22 -9
  142. package/resources/beta/files.mjs.map +1 -1
  143. package/resources/beta/index.d.mts +2 -2
  144. package/resources/beta/index.d.mts.map +1 -1
  145. package/resources/beta/index.d.ts +2 -2
  146. package/resources/beta/index.d.ts.map +1 -1
  147. package/resources/beta/index.js.map +1 -1
  148. package/resources/beta/index.mjs.map +1 -1
  149. package/resources/beta/memory-stores/memories.d.mts +51 -4
  150. package/resources/beta/memory-stores/memories.d.mts.map +1 -1
  151. package/resources/beta/memory-stores/memories.d.ts +51 -4
  152. package/resources/beta/memory-stores/memories.d.ts.map +1 -1
  153. package/resources/beta/memory-stores/memories.js +25 -10
  154. package/resources/beta/memory-stores/memories.js.map +1 -1
  155. package/resources/beta/memory-stores/memories.mjs +25 -10
  156. package/resources/beta/memory-stores/memories.mjs.map +1 -1
  157. package/resources/beta/memory-stores/memory-stores.d.mts +54 -0
  158. package/resources/beta/memory-stores/memory-stores.d.mts.map +1 -1
  159. package/resources/beta/memory-stores/memory-stores.d.ts +54 -0
  160. package/resources/beta/memory-stores/memory-stores.d.ts.map +1 -1
  161. package/resources/beta/memory-stores/memory-stores.js +30 -12
  162. package/resources/beta/memory-stores/memory-stores.js.map +1 -1
  163. package/resources/beta/memory-stores/memory-stores.mjs +30 -12
  164. package/resources/beta/memory-stores/memory-stores.mjs.map +1 -1
  165. package/resources/beta/memory-stores/memory-versions.d.mts +31 -4
  166. package/resources/beta/memory-stores/memory-versions.d.mts.map +1 -1
  167. package/resources/beta/memory-stores/memory-versions.d.ts +31 -4
  168. package/resources/beta/memory-stores/memory-versions.d.ts.map +1 -1
  169. package/resources/beta/memory-stores/memory-versions.js +15 -6
  170. package/resources/beta/memory-stores/memory-versions.js.map +1 -1
  171. package/resources/beta/memory-stores/memory-versions.mjs +15 -6
  172. package/resources/beta/memory-stores/memory-versions.mjs.map +1 -1
  173. package/resources/beta/messages/batches.d.mts +54 -0
  174. package/resources/beta/messages/batches.d.mts.map +1 -1
  175. package/resources/beta/messages/batches.d.ts +54 -0
  176. package/resources/beta/messages/batches.d.ts.map +1 -1
  177. package/resources/beta/messages/batches.js +25 -11
  178. package/resources/beta/messages/batches.js.map +1 -1
  179. package/resources/beta/messages/batches.mjs +25 -11
  180. package/resources/beta/messages/batches.mjs.map +1 -1
  181. package/resources/beta/messages/index.d.mts +1 -1
  182. package/resources/beta/messages/index.d.mts.map +1 -1
  183. package/resources/beta/messages/index.d.ts +1 -1
  184. package/resources/beta/messages/index.d.ts.map +1 -1
  185. package/resources/beta/messages/index.js.map +1 -1
  186. package/resources/beta/messages/index.mjs.map +1 -1
  187. package/resources/beta/messages/messages.d.mts +148 -3
  188. package/resources/beta/messages/messages.d.mts.map +1 -1
  189. package/resources/beta/messages/messages.d.ts +148 -3
  190. package/resources/beta/messages/messages.d.ts.map +1 -1
  191. package/resources/beta/messages/messages.js +4 -2
  192. package/resources/beta/messages/messages.js.map +1 -1
  193. package/resources/beta/messages/messages.mjs +4 -2
  194. package/resources/beta/messages/messages.mjs.map +1 -1
  195. package/resources/beta/models.d.mts +18 -0
  196. package/resources/beta/models.d.mts.map +1 -1
  197. package/resources/beta/models.d.ts +18 -0
  198. package/resources/beta/models.d.ts.map +1 -1
  199. package/resources/beta/models.js +10 -4
  200. package/resources/beta/models.js.map +1 -1
  201. package/resources/beta/models.mjs +10 -4
  202. package/resources/beta/models.mjs.map +1 -1
  203. package/resources/beta/organization/compliance-settings.d.mts +76 -0
  204. package/resources/beta/organization/compliance-settings.d.mts.map +1 -0
  205. package/resources/beta/organization/compliance-settings.d.ts +76 -0
  206. package/resources/beta/organization/compliance-settings.d.ts.map +1 -0
  207. package/resources/beta/organization/compliance-settings.js +52 -0
  208. package/resources/beta/organization/compliance-settings.js.map +1 -0
  209. package/resources/beta/organization/compliance-settings.mjs +48 -0
  210. package/resources/beta/organization/compliance-settings.mjs.map +1 -0
  211. package/resources/beta/organization/external-keys.d.mts +6 -3
  212. package/resources/beta/organization/external-keys.d.mts.map +1 -1
  213. package/resources/beta/organization/external-keys.d.ts +6 -3
  214. package/resources/beta/organization/external-keys.d.ts.map +1 -1
  215. package/resources/beta/organization/index.d.mts +1 -0
  216. package/resources/beta/organization/index.d.mts.map +1 -1
  217. package/resources/beta/organization/index.d.ts +1 -0
  218. package/resources/beta/organization/index.d.ts.map +1 -1
  219. package/resources/beta/organization/index.js +3 -1
  220. package/resources/beta/organization/index.js.map +1 -1
  221. package/resources/beta/organization/index.mjs +1 -0
  222. package/resources/beta/organization/index.mjs.map +1 -1
  223. package/resources/beta/organization/organization.d.mts +4 -0
  224. package/resources/beta/organization/organization.d.mts.map +1 -1
  225. package/resources/beta/organization/organization.d.ts +4 -0
  226. package/resources/beta/organization/organization.d.ts.map +1 -1
  227. package/resources/beta/organization/organization.js +4 -0
  228. package/resources/beta/organization/organization.js.map +1 -1
  229. package/resources/beta/organization/organization.mjs +4 -0
  230. package/resources/beta/organization/organization.mjs.map +1 -1
  231. package/resources/beta/organization/workspaces/workspaces.d.mts +28 -12
  232. package/resources/beta/organization/workspaces/workspaces.d.mts.map +1 -1
  233. package/resources/beta/organization/workspaces/workspaces.d.ts +28 -12
  234. package/resources/beta/organization/workspaces/workspaces.d.ts.map +1 -1
  235. package/resources/beta/organization/workspaces/workspaces.js.map +1 -1
  236. package/resources/beta/organization/workspaces/workspaces.mjs.map +1 -1
  237. package/resources/beta/sessions/events.d.mts +28 -1
  238. package/resources/beta/sessions/events.d.mts.map +1 -1
  239. package/resources/beta/sessions/events.d.ts +28 -1
  240. package/resources/beta/sessions/events.d.ts.map +1 -1
  241. package/resources/beta/sessions/events.js +15 -6
  242. package/resources/beta/sessions/events.js.map +1 -1
  243. package/resources/beta/sessions/events.mjs +15 -6
  244. package/resources/beta/sessions/events.mjs.map +1 -1
  245. package/resources/beta/sessions/resources.d.mts +45 -0
  246. package/resources/beta/sessions/resources.d.mts.map +1 -1
  247. package/resources/beta/sessions/resources.d.ts +45 -0
  248. package/resources/beta/sessions/resources.d.ts.map +1 -1
  249. package/resources/beta/sessions/resources.js +25 -10
  250. package/resources/beta/sessions/resources.js.map +1 -1
  251. package/resources/beta/sessions/resources.mjs +25 -10
  252. package/resources/beta/sessions/resources.mjs.map +1 -1
  253. package/resources/beta/sessions/sessions.d.mts +64 -10
  254. package/resources/beta/sessions/sessions.d.mts.map +1 -1
  255. package/resources/beta/sessions/sessions.d.ts +64 -10
  256. package/resources/beta/sessions/sessions.d.ts.map +1 -1
  257. package/resources/beta/sessions/sessions.js +30 -12
  258. package/resources/beta/sessions/sessions.js.map +1 -1
  259. package/resources/beta/sessions/sessions.mjs +30 -12
  260. package/resources/beta/sessions/sessions.mjs.map +1 -1
  261. package/resources/beta/sessions/threads/events.d.mts +18 -0
  262. package/resources/beta/sessions/threads/events.d.mts.map +1 -1
  263. package/resources/beta/sessions/threads/events.d.ts +18 -0
  264. package/resources/beta/sessions/threads/events.d.ts.map +1 -1
  265. package/resources/beta/sessions/threads/events.js +10 -4
  266. package/resources/beta/sessions/threads/events.js.map +1 -1
  267. package/resources/beta/sessions/threads/events.mjs +10 -4
  268. package/resources/beta/sessions/threads/events.mjs.map +1 -1
  269. package/resources/beta/sessions/threads/threads.d.mts +27 -0
  270. package/resources/beta/sessions/threads/threads.d.mts.map +1 -1
  271. package/resources/beta/sessions/threads/threads.d.ts +27 -0
  272. package/resources/beta/sessions/threads/threads.d.ts.map +1 -1
  273. package/resources/beta/sessions/threads/threads.js +15 -6
  274. package/resources/beta/sessions/threads/threads.js.map +1 -1
  275. package/resources/beta/sessions/threads/threads.mjs +15 -6
  276. package/resources/beta/sessions/threads/threads.mjs.map +1 -1
  277. package/resources/beta/skills/skills.d.mts +36 -0
  278. package/resources/beta/skills/skills.d.mts.map +1 -1
  279. package/resources/beta/skills/skills.d.ts +36 -0
  280. package/resources/beta/skills/skills.d.ts.map +1 -1
  281. package/resources/beta/skills/skills.js +20 -8
  282. package/resources/beta/skills/skills.js.map +1 -1
  283. package/resources/beta/skills/skills.mjs +20 -8
  284. package/resources/beta/skills/skills.mjs.map +1 -1
  285. package/resources/beta/skills/versions.d.mts +45 -0
  286. package/resources/beta/skills/versions.d.mts.map +1 -1
  287. package/resources/beta/skills/versions.d.ts +45 -0
  288. package/resources/beta/skills/versions.d.ts.map +1 -1
  289. package/resources/beta/skills/versions.js +22 -9
  290. package/resources/beta/skills/versions.js.map +1 -1
  291. package/resources/beta/skills/versions.mjs +22 -9
  292. package/resources/beta/skills/versions.mjs.map +1 -1
  293. package/resources/beta/tunnels/certificates.d.mts +36 -0
  294. package/resources/beta/tunnels/certificates.d.mts.map +1 -1
  295. package/resources/beta/tunnels/certificates.d.ts +36 -0
  296. package/resources/beta/tunnels/certificates.d.ts.map +1 -1
  297. package/resources/beta/tunnels/certificates.js +20 -8
  298. package/resources/beta/tunnels/certificates.js.map +1 -1
  299. package/resources/beta/tunnels/certificates.mjs +20 -8
  300. package/resources/beta/tunnels/certificates.mjs.map +1 -1
  301. package/resources/beta/tunnels/tunnels.d.mts +54 -0
  302. package/resources/beta/tunnels/tunnels.d.mts.map +1 -1
  303. package/resources/beta/tunnels/tunnels.d.ts +54 -0
  304. package/resources/beta/tunnels/tunnels.d.ts.map +1 -1
  305. package/resources/beta/tunnels/tunnels.js +30 -12
  306. package/resources/beta/tunnels/tunnels.js.map +1 -1
  307. package/resources/beta/tunnels/tunnels.mjs +30 -12
  308. package/resources/beta/tunnels/tunnels.mjs.map +1 -1
  309. package/resources/beta/user-profiles.d.mts +21 -25
  310. package/resources/beta/user-profiles.d.mts.map +1 -1
  311. package/resources/beta/user-profiles.d.ts +21 -25
  312. package/resources/beta/user-profiles.d.ts.map +1 -1
  313. package/resources/beta/vaults/credentials.d.mts +63 -0
  314. package/resources/beta/vaults/credentials.d.mts.map +1 -1
  315. package/resources/beta/vaults/credentials.d.ts +63 -0
  316. package/resources/beta/vaults/credentials.d.ts.map +1 -1
  317. package/resources/beta/vaults/credentials.js +35 -14
  318. package/resources/beta/vaults/credentials.js.map +1 -1
  319. package/resources/beta/vaults/credentials.mjs +35 -14
  320. package/resources/beta/vaults/credentials.mjs.map +1 -1
  321. package/resources/beta/vaults/vaults.d.mts +54 -0
  322. package/resources/beta/vaults/vaults.d.mts.map +1 -1
  323. package/resources/beta/vaults/vaults.d.ts +54 -0
  324. package/resources/beta/vaults/vaults.d.ts.map +1 -1
  325. package/resources/beta/vaults/vaults.js +30 -12
  326. package/resources/beta/vaults/vaults.js.map +1 -1
  327. package/resources/beta/vaults/vaults.mjs +30 -12
  328. package/resources/beta/vaults/vaults.mjs.map +1 -1
  329. package/resources/completions.d.mts +9 -0
  330. package/resources/completions.d.mts.map +1 -1
  331. package/resources/completions.d.ts +9 -0
  332. package/resources/completions.d.ts.map +1 -1
  333. package/resources/completions.js +5 -2
  334. package/resources/completions.js.map +1 -1
  335. package/resources/completions.mjs +5 -2
  336. package/resources/completions.mjs.map +1 -1
  337. package/resources/files.d.mts +104 -15
  338. package/resources/files.d.mts.map +1 -1
  339. package/resources/files.d.ts +104 -15
  340. package/resources/files.d.ts.map +1 -1
  341. package/resources/files.js +79 -10
  342. package/resources/files.js.map +1 -1
  343. package/resources/files.mjs +79 -10
  344. package/resources/files.mjs.map +1 -1
  345. package/resources/index.d.mts +2 -2
  346. package/resources/index.d.mts.map +1 -1
  347. package/resources/index.d.ts +2 -2
  348. package/resources/index.d.ts.map +1 -1
  349. package/resources/index.js.map +1 -1
  350. package/resources/index.mjs.map +1 -1
  351. package/resources/messages/batches.d.mts +68 -6
  352. package/resources/messages/batches.d.mts.map +1 -1
  353. package/resources/messages/batches.d.ts +68 -6
  354. package/resources/messages/batches.d.ts.map +1 -1
  355. package/resources/messages/batches.js +52 -13
  356. package/resources/messages/batches.js.map +1 -1
  357. package/resources/messages/batches.mjs +52 -13
  358. package/resources/messages/batches.mjs.map +1 -1
  359. package/resources/messages/index.d.mts +1 -1
  360. package/resources/messages/index.d.mts.map +1 -1
  361. package/resources/messages/index.d.ts +1 -1
  362. package/resources/messages/index.d.ts.map +1 -1
  363. package/resources/messages/index.js.map +1 -1
  364. package/resources/messages/index.mjs.map +1 -1
  365. package/resources/messages/messages.d.mts +21 -5
  366. package/resources/messages/messages.d.mts.map +1 -1
  367. package/resources/messages/messages.d.ts +21 -5
  368. package/resources/messages/messages.d.ts.map +1 -1
  369. package/resources/messages/messages.js +10 -4
  370. package/resources/messages/messages.js.map +1 -1
  371. package/resources/messages/messages.mjs +10 -4
  372. package/resources/messages/messages.mjs.map +1 -1
  373. package/resources/models.d.mts +31 -0
  374. package/resources/models.d.mts.map +1 -1
  375. package/resources/models.d.ts +31 -0
  376. package/resources/models.d.ts.map +1 -1
  377. package/resources/models.js +23 -4
  378. package/resources/models.js.map +1 -1
  379. package/resources/models.mjs +23 -4
  380. package/resources/models.mjs.map +1 -1
  381. package/resources/skills/index.d.mts +1 -1
  382. package/resources/skills/index.d.mts.map +1 -1
  383. package/resources/skills/index.d.ts +1 -1
  384. package/resources/skills/index.d.ts.map +1 -1
  385. package/resources/skills/index.js.map +1 -1
  386. package/resources/skills/index.mjs.map +1 -1
  387. package/resources/skills/skills.d.mts +75 -10
  388. package/resources/skills/skills.d.mts.map +1 -1
  389. package/resources/skills/skills.d.ts +75 -10
  390. package/resources/skills/skills.d.ts.map +1 -1
  391. package/resources/skills/skills.js +64 -8
  392. package/resources/skills/skills.js.map +1 -1
  393. package/resources/skills/skills.mjs +64 -8
  394. package/resources/skills/skills.mjs.map +1 -1
  395. package/resources/skills/versions.d.mts +75 -5
  396. package/resources/skills/versions.d.mts.map +1 -1
  397. package/resources/skills/versions.d.ts +75 -5
  398. package/resources/skills/versions.d.ts.map +1 -1
  399. package/resources/skills/versions.js +67 -7
  400. package/resources/skills/versions.js.map +1 -1
  401. package/resources/skills/versions.mjs +67 -7
  402. package/resources/skills/versions.mjs.map +1 -1
  403. package/src/client.ts +12 -1
  404. package/src/core/credentials.ts +5 -7
  405. package/src/core/streaming.ts +4 -2
  406. package/src/internal/file-store.ts +11 -10
  407. package/src/internal/node.browser.ts +22 -0
  408. package/src/internal/node.ts +14 -0
  409. package/src/lib/BetaMessageStream.ts +4 -0
  410. package/src/lib/credentials/credential-chain.ts +1 -1
  411. package/src/lib/credentials/identity-token.ts +1 -1
  412. package/src/lib/credentials/types.ts +2 -3
  413. package/src/lib/credentials/user-oauth.ts +1 -1
  414. package/src/lib/middleware.ts +33 -9
  415. package/src/resources/beta/agents/agents.ts +76 -10
  416. package/src/resources/beta/agents/versions.ts +15 -2
  417. package/src/resources/beta/beta.ts +16 -1
  418. package/src/resources/beta/deployment-runs.ts +36 -10
  419. package/src/resources/beta/deployments.ts +123 -18
  420. package/src/resources/beta/dreams.ts +117 -10
  421. package/src/resources/beta/environments/environments.ts +90 -12
  422. package/src/resources/beta/environments/work.ts +60 -8
  423. package/src/resources/beta/files.ts +75 -11
  424. package/src/resources/beta/index.ts +6 -0
  425. package/src/resources/beta/memory-stores/memories.ts +81 -14
  426. package/src/resources/beta/memory-stores/memory-stores.ts +90 -12
  427. package/src/resources/beta/memory-stores/memory-versions.ts +49 -10
  428. package/src/resources/beta/messages/batches.ts +85 -11
  429. package/src/resources/beta/messages/index.ts +4 -0
  430. package/src/resources/beta/messages/messages.ts +173 -10
  431. package/src/resources/beta/models.ts +30 -4
  432. package/src/resources/beta/organization/compliance-settings.ts +106 -0
  433. package/src/resources/beta/organization/external-keys.ts +6 -3
  434. package/src/resources/beta/organization/index.ts +11 -0
  435. package/src/resources/beta/organization/organization.ts +28 -0
  436. package/src/resources/beta/organization/workspaces/workspaces.ts +28 -12
  437. package/src/resources/beta/sessions/events.ts +46 -7
  438. package/src/resources/beta/sessions/resources.ts +75 -10
  439. package/src/resources/beta/sessions/sessions.ts +100 -22
  440. package/src/resources/beta/sessions/threads/events.ts +30 -4
  441. package/src/resources/beta/sessions/threads/threads.ts +45 -6
  442. package/src/resources/beta/skills/skills.ts +60 -8
  443. package/src/resources/beta/skills/versions.ts +72 -9
  444. package/src/resources/beta/tunnels/certificates.ts +60 -8
  445. package/src/resources/beta/tunnels/tunnels.ts +90 -12
  446. package/src/resources/beta/user-profiles.ts +24 -27
  447. package/src/resources/beta/vaults/credentials.ts +105 -14
  448. package/src/resources/beta/vaults/vaults.ts +90 -12
  449. package/src/resources/completions.ts +15 -2
  450. package/src/resources/files.ts +161 -18
  451. package/src/resources/index.ts +5 -0
  452. package/src/resources/messages/batches.ts +137 -13
  453. package/src/resources/messages/index.ts +4 -0
  454. package/src/resources/messages/messages.ts +40 -12
  455. package/src/resources/models.ts +43 -4
  456. package/src/resources/skills/index.ts +2 -0
  457. package/src/resources/skills/skills.ts +127 -13
  458. package/src/resources/skills/versions.ts +115 -11
  459. package/src/tools/agent-toolset/fs-util.ts +22 -9
  460. package/src/tools/agent-toolset/memories.ts +5 -3
  461. package/src/tools/agent-toolset/skills.ts +5 -10
  462. package/src/version.ts +1 -1
  463. package/tools/agent-toolset/fs-util.d.mts +11 -4
  464. package/tools/agent-toolset/fs-util.d.mts.map +1 -1
  465. package/tools/agent-toolset/fs-util.d.ts +11 -4
  466. package/tools/agent-toolset/fs-util.d.ts.map +1 -1
  467. package/tools/agent-toolset/fs-util.js +27 -19
  468. package/tools/agent-toolset/fs-util.js.map +1 -1
  469. package/tools/agent-toolset/fs-util.mjs +17 -8
  470. package/tools/agent-toolset/fs-util.mjs.map +1 -1
  471. package/tools/agent-toolset/memories.d.mts.map +1 -1
  472. package/tools/agent-toolset/memories.d.ts.map +1 -1
  473. package/tools/agent-toolset/memories.js +6 -4
  474. package/tools/agent-toolset/memories.js.map +1 -1
  475. package/tools/agent-toolset/memories.mjs +5 -3
  476. package/tools/agent-toolset/memories.mjs.map +1 -1
  477. package/tools/agent-toolset/skills.d.mts.map +1 -1
  478. package/tools/agent-toolset/skills.d.ts.map +1 -1
  479. package/tools/agent-toolset/skills.js +15 -21
  480. package/tools/agent-toolset/skills.js.map +1 -1
  481. package/tools/agent-toolset/skills.mjs +4 -9
  482. package/tools/agent-toolset/skills.mjs.map +1 -1
  483. package/version.d.mts +1 -1
  484. package/version.d.ts +1 -1
  485. package/version.js +1 -1
  486. package/version.mjs +1 -1
@@ -7,14 +7,15 @@
7
7
  * scope.
8
8
  */
9
9
 
10
- import * as fsp from 'node:fs/promises';
11
- import * as path from 'node:path';
12
- import { constants as C } from 'node:fs';
13
10
  import type { BigIntStats, Dirent } from 'node:fs';
11
+ import type { FileHandle } from 'node:fs/promises';
14
12
  import type * as util from 'node:util';
15
- import { createHash, randomBytes } from 'node:crypto';
13
+ import { crypto, fs, path } from './node';
16
14
  import { encodeUTF8 } from './utils/bytes';
17
15
 
16
+ const fsp = fs.promises;
17
+ const C = fs.constants;
18
+
18
19
  // Owner-only regardless of umask: the store holds downloaded user/model content.
19
20
  const OWNER_ONLY_DIR_MODE = 0o700;
20
21
  const OWNER_ONLY_FILE_MODE = 0o600;
@@ -182,7 +183,7 @@ export class FileStore {
182
183
  /** The file's bytes; `null` when absent. */
183
184
  async get(relPath: string): Promise<Uint8Array | null> {
184
185
  const dest = this.resolveUnderRoot(relPath);
185
- let handle: fsp.FileHandle;
186
+ let handle: FileHandle;
186
187
  try {
187
188
  handle = await openRegularFile(relPath, dest);
188
189
  } catch (e) {
@@ -388,8 +389,8 @@ async function makeDirsBelowRoot(root: string, dir: string): Promise<void> {
388
389
 
389
390
  async function replaceViaTemp(dest: string, data: Uint8Array, isExecutable: boolean): Promise<void> {
390
391
  const mode = isExecutable ? OWNER_ONLY_EXEC_MODE : OWNER_ONLY_FILE_MODE;
391
- const tmp = path.join(path.dirname(dest), `.fs-${randomBytes(8).toString('hex')}.tmp`);
392
- let handle: fsp.FileHandle | undefined;
392
+ const tmp = path.join(path.dirname(dest), `.fs-${crypto.randomBytes(8).toString('hex')}.tmp`);
393
+ let handle: FileHandle | undefined;
393
394
  try {
394
395
  handle = await fsp.open(tmp, C.O_WRONLY | C.O_CREAT | C.O_EXCL | O_NOFOLLOW, mode);
395
396
  await handle.writeFile(data);
@@ -404,9 +405,9 @@ async function replaceViaTemp(dest: string, data: Uint8Array, isExecutable: bool
404
405
  }
405
406
  }
406
407
 
407
- async function openRegularFile(relPath: string, dest: string): Promise<fsp.FileHandle> {
408
+ async function openRegularFile(relPath: string, dest: string): Promise<FileHandle> {
408
409
  // O_NONBLOCK: a FIFO fails the fstat check below instead of blocking the open.
409
- let handle: fsp.FileHandle;
410
+ let handle: FileHandle;
410
411
  try {
411
412
  handle = await fsp.open(dest, C.O_RDONLY | O_NOFOLLOW | O_NONBLOCK);
412
413
  } catch (e) {
@@ -429,7 +430,7 @@ async function openRegularFile(relPath: string, dest: string): Promise<fsp.FileH
429
430
 
430
431
  /** sha256 of a file's contents, streamed — constant memory on any file size. */
431
432
  async function hashFile(full: string): Promise<string> {
432
- const digest = createHash('sha256');
433
+ const digest = crypto.createHash('sha256');
433
434
  const handle = await openRegularFile(path.basename(full), full);
434
435
  const buf = new Uint8Array(1024 * 1024);
435
436
  try {
@@ -0,0 +1,22 @@
1
+ import { AnthropicError } from '../core/error';
2
+ import type * as node from './node';
3
+
4
+ /** Substituted for `./node` by the package.json `browser` field; every property access throws. */
5
+ function unavailable<T extends object>(module: string): T {
6
+ return new Proxy({} as T, {
7
+ get(_target, property) {
8
+ if (typeof property === 'symbol') return undefined;
9
+ throw new AnthropicError(
10
+ `\`${module}.${property}\` is not available in this environment; it needs a Node.js-compatible runtime`,
11
+ );
12
+ },
13
+ });
14
+ }
15
+
16
+ export const child_process: typeof node.child_process = unavailable('child_process');
17
+ export const crypto: typeof node.crypto = unavailable('crypto');
18
+ export const fs: typeof node.fs = unavailable('fs');
19
+ export const os: typeof node.os = unavailable('os');
20
+ export const path: typeof node.path = unavailable('path');
21
+ export const stream: typeof node.stream = unavailable('stream');
22
+ export const util: typeof node.util = unavailable('util');
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The one module under `src/` that may import Node built-ins (eslint enforces this).
3
+ * The package.json `browser` field swaps it for `./node.browser`, so only touch its
4
+ * exports on code paths that run on Node-compatible runtimes.
5
+ */
6
+ import * as child_process from 'node:child_process';
7
+ import * as crypto from 'node:crypto';
8
+ import * as fs from 'node:fs';
9
+ import * as os from 'node:os';
10
+ import * as path from 'node:path';
11
+ import * as stream from 'node:stream';
12
+ import * as util from 'node:util';
13
+
14
+ export { child_process, crypto, fs, os, path, stream, util };
@@ -603,6 +603,10 @@ export class BetaMessageStream<ParsedT = null> implements AsyncIterable<BetaMess
603
603
  snapshot.context_management = event.context_management;
604
604
  }
605
605
 
606
+ if (event.input_transformations != null) {
607
+ snapshot.input_transformations = event.input_transformations;
608
+ }
609
+
606
610
  // The remaining usage counters are cumulative whole-message totals that are
607
611
  // omitted when they don't apply, so overwrite when present and never add.
608
612
  if (event.usage.input_tokens != null) {
@@ -240,7 +240,7 @@ function cachedExchangeProvider(
240
240
  onSafetyWarning: ((msg: string) => void) | undefined,
241
241
  ): AccessTokenProvider {
242
242
  return async (opts) => {
243
- const fs = await import('node:fs');
243
+ const { fs } = await import('../../internal/node');
244
244
 
245
245
  await checkCredentialsFileSafety(credentialsPath, onSafetyWarning);
246
246
 
@@ -11,7 +11,7 @@ export function identityTokenFromFile(path: string): IdentityTokenProvider {
11
11
  }
12
12
 
13
13
  return async () => {
14
- const fs = await import('node:fs');
14
+ const { fs } = await import('../../internal/node');
15
15
  let content: string;
16
16
  try {
17
17
  content = await fs.promises.readFile(path, 'utf-8');
@@ -170,7 +170,7 @@ export async function checkCredentialsFileSafety(
170
170
  onWarn: (msg: string) => void = (m) => console.warn(`anthropic-sdk: ${m}`),
171
171
  ): Promise<void> {
172
172
  if (typeof process === 'undefined' || process.platform === 'win32') return;
173
- const fs = await import('node:fs');
173
+ const { fs } = await import('../../internal/node');
174
174
  let resolved = path;
175
175
  let st;
176
176
  try {
@@ -208,8 +208,7 @@ export async function checkCredentialsFileSafety(
208
208
  * Creates the parent directory with mode 0700 and the file with mode 0600.
209
209
  */
210
210
  export async function writeCredentialsFileAtomic(targetPath: string, data: unknown): Promise<void> {
211
- const fs = await import('node:fs');
212
- const path = await import('node:path');
211
+ const { fs, path } = await import('../../internal/node');
213
212
  const dir = path.dirname(targetPath);
214
213
  await fs.promises.mkdir(dir, { recursive: true, mode: 0o700 });
215
214
  // Unique temp name avoids two concurrent writers (different processes or
@@ -36,7 +36,7 @@ export type UserOAuthConfig = {
36
36
  */
37
37
  export function userOAuthProvider(config: UserOAuthConfig): AccessTokenProvider {
38
38
  return async (opts) => {
39
- const fs = await import('node:fs');
39
+ const { fs } = await import('../../internal/node');
40
40
 
41
41
  await checkCredentialsFileSafety(config.credentialsPath, config.onSafetyWarning);
42
42
 
@@ -38,16 +38,17 @@ const DEFAULT_BETAS: readonly AnthropicBeta[] = ['fallback-credit-2026-07-01'];
38
38
  * Remove `fallback` blocks replayed in history. They only parse under the
39
39
  * server-side fallback beta, which belongs to the caller-owned server-side
40
40
  * `fallbacks` feature — this middleware never sends it, so a request
41
- * replaying them would 400. An assistant turn left empty is dropped whole.
41
+ * replaying them would 400. A turn the strip leaves empty is dropped whole;
42
+ * a turn that was already empty is kept — it may carry other payload (e.g. a
43
+ * directive-only system message's `output_config`).
42
44
  */
43
45
  function stripFallbackBlocks(body: MessageCreateParams): MessageCreateParams {
44
- const messages = body.messages
45
- .map((message) =>
46
- Array.isArray(message.content) ?
47
- { ...message, content: message.content.filter((block) => block.type !== 'fallback') }
48
- : message,
49
- )
50
- .filter((message) => !Array.isArray(message.content) || message.content.length > 0);
46
+ const messages = body.messages.flatMap((message) => {
47
+ if (!Array.isArray(message.content)) return [message];
48
+ const content = message.content.filter((block) => block.type !== 'fallback');
49
+ if (content.length === message.content.length) return [message];
50
+ return content.length > 0 ? [{ ...message, content }] : [];
51
+ });
51
52
  return { ...body, messages };
52
53
  }
53
54
 
@@ -453,6 +454,9 @@ async function* splicedEvents(
453
454
  // The refusal whose token is currently in flight — surfaced verbatim (with a
454
455
  // recommended_model added) if every fallback request fails and we degrade.
455
456
  let refusalDetails = a.refused.stopDetails;
457
+ // That refused hop's suppressed message_start `input_transformations`, which
458
+ // ride on the surfaced refusal delta (none for A: its start reached the client).
459
+ let refusalInputTransformations = a.refused.inputTransformations;
456
460
 
457
461
  // One `message` entry per refused hop, in order — A first. Failed hops are
458
462
  // skipped (no usage came back); the serving hop is appended as
@@ -559,6 +563,9 @@ async function* splicedEvents(
559
563
  stop_details: stopDetails,
560
564
  },
561
565
  usage: (lastUsage ?? {}) as BetaMessageDeltaUsage,
566
+ ...(refusalInputTransformations !== undefined && {
567
+ input_transformations: refusalInputTransformations,
568
+ }),
562
569
  });
563
570
  yield emit<BetaRawMessageStopEvent>('message_stop', { type: 'message_stop' });
564
571
  return;
@@ -580,6 +587,7 @@ async function* splicedEvents(
580
587
  // continues.
581
588
  token = b.refused.token;
582
589
  refusalDetails = b.refused.stopDetails;
590
+ refusalInputTransformations = b.refused.inputTransformations;
583
591
  base = continuation;
584
592
  partial = b.refused.hasPrefillClaim ? toPrefillBlocks(b.blocks) : [];
585
593
  iterations.push(toIterationUsage('message', model, b.refused.usage));
@@ -598,6 +606,12 @@ interface HopOutcome {
598
606
  usage: BetaMessageDeltaUsage;
599
607
  /** The refusal's stop_details verbatim, surfaced if the whole chain degrades. */
600
608
  stopDetails: BetaRefusalStopDetails;
609
+ /**
610
+ * A spliced hop's suppressed message_start `input_transformations`, forwarded
611
+ * on the surfaced refusal delta if the whole chain degrades; `undefined` for
612
+ * stream A (its start reached the client) or when the start had none.
613
+ */
614
+ inputTransformations: BetaMessage['input_transformations'] | undefined;
601
615
  } | null;
602
616
  /** The hop's serving model, from its message_start. */
603
617
  model: string | undefined;
@@ -615,7 +629,8 @@ interface HopOutcome {
615
629
  * spliced hop (`splice` set) has its message_start suppressed (the client
616
630
  * already saw A's), its block indices shifted by `indexBase`, and its
617
631
  * terminal message_delta's usage rewritten to the `usage.iterations`
618
- * chain shape.
632
+ * chain shape, with the suppressed message_start's `input_transformations`
633
+ * forwarded onto it.
619
634
  *
620
635
  * A refusal that can be chained — it carries a `fallback_credit_token` and a
621
636
  * fallback entry remains — ends the hop early: open blocks are closed, the
@@ -638,6 +653,10 @@ async function* consumeHop(args: {
638
653
  const tracker = new BlockTracker(indexBase);
639
654
  let model: string | undefined;
640
655
  let startUsage: BetaUsage | null = null;
656
+ // A spliced hop's message_start is suppressed, so its `input_transformations`
657
+ // must ride on the re-emitted terminal message_delta — the way a server-side
658
+ // fallback reports the serving model's list.
659
+ let startInputTransformations: BetaMessage['input_transformations'];
641
660
 
642
661
  for await (const sse of Stream.rawEvents(response, controller)) {
643
662
  const p = safeJSON(sse.data) as BetaRawMessageStreamEvent | undefined;
@@ -645,6 +664,7 @@ async function* consumeHop(args: {
645
664
  case 'message_start': {
646
665
  model = p.message.model;
647
666
  startUsage = p.message.usage;
667
+ if ('input_transformations' in p.message) startInputTransformations = p.message.input_transformations;
648
668
  if (splice) continue;
649
669
  break;
650
670
  }
@@ -687,6 +707,7 @@ async function* consumeHop(args: {
687
707
  hasPrefillClaim: details.fallback_has_prefill_claim === true,
688
708
  usage,
689
709
  stopDetails: details,
710
+ inputTransformations: splice ? startInputTransformations : undefined,
690
711
  },
691
712
  model,
692
713
  blocks: tracker.contentBlocks(),
@@ -721,6 +742,9 @@ async function* consumeHop(args: {
721
742
  toIterationUsage('fallback_message', splice.model, usage),
722
743
  ];
723
744
  p.usage = usage;
745
+ if (!('input_transformations' in p) && startInputTransformations !== undefined) {
746
+ p.input_transformations = startInputTransformations;
747
+ }
724
748
  yield emit('message_delta', p);
725
749
  continue;
726
750
  }
@@ -27,12 +27,15 @@ export class Agents extends APIResource {
27
27
  * ```
28
28
  */
29
29
  create(params: AgentCreateParams, options?: RequestOptions): APIPromise<BetaManagedAgentsAgent> {
30
- const { betas, ...body } = params;
30
+ const { betas, workspace_id, ...body } = params;
31
31
  return this._client.post('/v1/agents?beta=true', {
32
32
  body,
33
33
  ...options,
34
34
  headers: buildHeaders([
35
- { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
35
+ {
36
+ 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
37
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
38
+ },
36
39
  options?.headers,
37
40
  ]),
38
41
  });
@@ -54,12 +57,15 @@ export class Agents extends APIResource {
54
57
  params: AgentRetrieveParams | null | undefined = {},
55
58
  options?: RequestOptions,
56
59
  ): APIPromise<BetaManagedAgentsAgent> {
57
- const { betas, ...query } = params ?? {};
60
+ const { betas, workspace_id, ...query } = params ?? {};
58
61
  return this._client.get(path`/v1/agents/${agentID}?beta=true`, {
59
62
  query,
60
63
  ...options,
61
64
  headers: buildHeaders([
62
- { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
65
+ {
66
+ 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
67
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
68
+ },
63
69
  options?.headers,
64
70
  ]),
65
71
  });
@@ -82,12 +88,15 @@ export class Agents extends APIResource {
82
88
  params: AgentUpdateParams,
83
89
  options?: RequestOptions,
84
90
  ): APIPromise<BetaManagedAgentsAgent> {
85
- const { betas, ...body } = params;
91
+ const { betas, workspace_id, ...body } = params;
86
92
  return this._client.post(path`/v1/agents/${agentID}?beta=true`, {
87
93
  body,
88
94
  ...options,
89
95
  headers: buildHeaders([
90
- { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
96
+ {
97
+ 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
98
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
99
+ },
91
100
  options?.headers,
92
101
  ]),
93
102
  });
@@ -108,12 +117,15 @@ export class Agents extends APIResource {
108
117
  params: AgentListParams | null | undefined = {},
109
118
  options?: RequestOptions,
110
119
  ): PagePromise<BetaManagedAgentsAgentsPageCursor, BetaManagedAgentsAgent> {
111
- const { betas, ...query } = params ?? {};
120
+ const { betas, workspace_id, ...query } = params ?? {};
112
121
  return this._client.getAPIList('/v1/agents?beta=true', PageCursor<BetaManagedAgentsAgent>, {
113
122
  query,
114
123
  ...options,
115
124
  headers: buildHeaders([
116
- { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
125
+ {
126
+ 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
127
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
128
+ },
117
129
  options?.headers,
118
130
  ]),
119
131
  });
@@ -135,11 +147,14 @@ export class Agents extends APIResource {
135
147
  params: AgentArchiveParams | null | undefined = {},
136
148
  options?: RequestOptions,
137
149
  ): APIPromise<BetaManagedAgentsAgent> {
138
- const { betas } = params ?? {};
150
+ const { betas, workspace_id } = params ?? {};
139
151
  return this._client.post(path`/v1/agents/${agentID}/archive?beta=true`, {
140
152
  ...options,
141
153
  headers: buildHeaders([
142
- { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
154
+ {
155
+ 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
156
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
157
+ },
143
158
  options?.headers,
144
159
  ]),
145
160
  });
@@ -862,6 +877,7 @@ export interface BetaManagedAgentsMCPToolsetParams {
862
877
  * details and options.
863
878
  */
864
879
  export type BetaManagedAgentsModel =
880
+ | 'claude-fable-5-1'
865
881
  | 'claude-sonnet-5'
866
882
  | 'claude-fable-5'
867
883
  | 'claude-opus-5'
@@ -1363,6 +1379,16 @@ export interface AgentCreateParams {
1363
1379
  * Header param: Optional header to specify the beta version(s) you want to use.
1364
1380
  */
1365
1381
  betas?: Array<BetaAPI.AnthropicBeta>;
1382
+
1383
+ /**
1384
+ * Header param: Optional header to select the Workspace for this request. The
1385
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
1386
+ *
1387
+ * Only needed for credentials that can act on more than one Workspace. A
1388
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
1389
+ * match that Workspace.
1390
+ */
1391
+ workspace_id?: string;
1366
1392
  }
1367
1393
 
1368
1394
  export interface AgentRetrieveParams {
@@ -1376,6 +1402,16 @@ export interface AgentRetrieveParams {
1376
1402
  * Header param: Optional header to specify the beta version(s) you want to use.
1377
1403
  */
1378
1404
  betas?: Array<BetaAPI.AnthropicBeta>;
1405
+
1406
+ /**
1407
+ * Header param: Optional header to select the Workspace for this request. The
1408
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
1409
+ *
1410
+ * Only needed for credentials that can act on more than one Workspace. A
1411
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
1412
+ * match that Workspace.
1413
+ */
1414
+ workspace_id?: string;
1379
1415
  }
1380
1416
 
1381
1417
  export interface AgentUpdateParams {
@@ -1455,6 +1491,16 @@ export interface AgentUpdateParams {
1455
1491
  * Header param: Optional header to specify the beta version(s) you want to use.
1456
1492
  */
1457
1493
  betas?: Array<BetaAPI.AnthropicBeta>;
1494
+
1495
+ /**
1496
+ * Header param: Optional header to select the Workspace for this request. The
1497
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
1498
+ *
1499
+ * Only needed for credentials that can act on more than one Workspace. A
1500
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
1501
+ * match that Workspace.
1502
+ */
1503
+ workspace_id?: string;
1458
1504
  }
1459
1505
 
1460
1506
  export interface AgentListParams extends PageCursorParams {
@@ -1477,6 +1523,16 @@ export interface AgentListParams extends PageCursorParams {
1477
1523
  * Header param: Optional header to specify the beta version(s) you want to use.
1478
1524
  */
1479
1525
  betas?: Array<BetaAPI.AnthropicBeta>;
1526
+
1527
+ /**
1528
+ * Header param: Optional header to select the Workspace for this request. The
1529
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
1530
+ *
1531
+ * Only needed for credentials that can act on more than one Workspace. A
1532
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
1533
+ * match that Workspace.
1534
+ */
1535
+ workspace_id?: string;
1480
1536
  }
1481
1537
 
1482
1538
  export interface AgentArchiveParams {
@@ -1484,6 +1540,16 @@ export interface AgentArchiveParams {
1484
1540
  * Optional header to specify the beta version(s) you want to use.
1485
1541
  */
1486
1542
  betas?: Array<BetaAPI.AnthropicBeta>;
1543
+
1544
+ /**
1545
+ * Optional header to select the Workspace for this request. The value is a
1546
+ * Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
1547
+ *
1548
+ * Only needed for credentials that can act on more than one Workspace. A
1549
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
1550
+ * match that Workspace.
1551
+ */
1552
+ workspace_id?: string;
1487
1553
  }
1488
1554
 
1489
1555
  Agents.Versions = Versions;
@@ -28,7 +28,7 @@ export class Versions extends APIResource {
28
28
  params: VersionListParams | null | undefined = {},
29
29
  options?: RequestOptions,
30
30
  ): PagePromise<BetaManagedAgentsAgentsPageCursor, AgentsAPI.BetaManagedAgentsAgent> {
31
- const { betas, ...query } = params ?? {};
31
+ const { betas, workspace_id, ...query } = params ?? {};
32
32
  return this._client.getAPIList(
33
33
  path`/v1/agents/${agentID}/versions?beta=true`,
34
34
  PageCursor<AgentsAPI.BetaManagedAgentsAgent>,
@@ -36,7 +36,10 @@ export class Versions extends APIResource {
36
36
  query,
37
37
  ...options,
38
38
  headers: buildHeaders([
39
- { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
39
+ {
40
+ 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
41
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
42
+ },
40
43
  options?.headers,
41
44
  ]),
42
45
  },
@@ -49,6 +52,16 @@ export interface VersionListParams extends PageCursorParams {
49
52
  * Header param: Optional header to specify the beta version(s) you want to use.
50
53
  */
51
54
  betas?: Array<BetaAPI.AnthropicBeta>;
55
+
56
+ /**
57
+ * Header param: Optional header to select the Workspace for this request. The
58
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
59
+ *
60
+ * Only needed for credentials that can act on more than one Workspace. A
61
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
62
+ * match that Workspace.
63
+ */
64
+ workspace_id?: string;
52
65
  }
53
66
 
54
67
  export declare namespace Versions {
@@ -88,10 +88,12 @@ import {
88
88
  BetaDreamSessionsInput,
89
89
  BetaDreamStatus,
90
90
  BetaDreamUsage,
91
+ BetaDreamingError,
91
92
  BetaDreamsPageCursor,
92
93
  BetaOutputBehavior,
93
94
  BetaOutputBehaviorCreateNew,
94
95
  BetaOutputBehaviorUpdateExisting,
96
+ BetaTargetStoreHeldError,
95
97
  DreamArchiveParams,
96
98
  DreamCancelParams,
97
99
  DreamCreateParams,
@@ -510,6 +512,7 @@ import {
510
512
  BetaSignatureDelta,
511
513
  BetaSkillParams,
512
514
  BetaStopReason,
515
+ BetaSystemMessageOutputConfig,
513
516
  BetaTextBlock,
514
517
  BetaTextBlockParam,
515
518
  BetaTextCitation,
@@ -526,12 +529,15 @@ import {
526
529
  BetaTextEditorCodeExecutionViewResultBlock,
527
530
  BetaTextEditorCodeExecutionViewResultBlockParam,
528
531
  BetaThinkingBlock,
532
+ BetaThinkingBlockBinding,
529
533
  BetaThinkingBlockParam,
530
534
  BetaThinkingConfigAdaptive,
531
535
  BetaThinkingConfigDisabled,
532
536
  BetaThinkingConfigEnabled,
533
537
  BetaThinkingConfigParam,
534
538
  BetaThinkingDelta,
539
+ BetaThinkingDroppedInputTransformation,
540
+ BetaThinkingPrefixMismatchBehavior,
535
541
  BetaThinkingTurns,
536
542
  BetaTokenTaskBudget,
537
543
  BetaTool,
@@ -742,7 +748,10 @@ export type AnthropicBeta =
742
748
  | 'structured-outputs-2025-11-13'
743
749
  | 'task-budgets-2026-03-13'
744
750
  | 'thinking-display-updates-2026-08-18'
745
- | 'ce-user-management-2026-07-13';
751
+ | 'ce-user-management-2026-07-13'
752
+ | 'mid-conversation-output-config-2026-07-01'
753
+ | 'thinking-binding-controls-2026-08-01'
754
+ | 'mid-conversation-system-clear-at-2026-08-21';
746
755
 
747
756
  export interface BetaAPIError {
748
757
  message: string;
@@ -1101,6 +1110,7 @@ export declare namespace Beta {
1101
1110
  type BetaSignatureDelta as BetaSignatureDelta,
1102
1111
  type BetaSkillParams as BetaSkillParams,
1103
1112
  type BetaStopReason as BetaStopReason,
1113
+ type BetaSystemMessageOutputConfig as BetaSystemMessageOutputConfig,
1104
1114
  type BetaTextBlock as BetaTextBlock,
1105
1115
  type BetaTextBlockParam as BetaTextBlockParam,
1106
1116
  type BetaTextCitation as BetaTextCitation,
@@ -1117,12 +1127,15 @@ export declare namespace Beta {
1117
1127
  type BetaTextEditorCodeExecutionViewResultBlock as BetaTextEditorCodeExecutionViewResultBlock,
1118
1128
  type BetaTextEditorCodeExecutionViewResultBlockParam as BetaTextEditorCodeExecutionViewResultBlockParam,
1119
1129
  type BetaThinkingBlock as BetaThinkingBlock,
1130
+ type BetaThinkingBlockBinding as BetaThinkingBlockBinding,
1120
1131
  type BetaThinkingBlockParam as BetaThinkingBlockParam,
1121
1132
  type BetaThinkingConfigAdaptive as BetaThinkingConfigAdaptive,
1122
1133
  type BetaThinkingConfigDisabled as BetaThinkingConfigDisabled,
1123
1134
  type BetaThinkingConfigEnabled as BetaThinkingConfigEnabled,
1124
1135
  type BetaThinkingConfigParam as BetaThinkingConfigParam,
1125
1136
  type BetaThinkingDelta as BetaThinkingDelta,
1137
+ type BetaThinkingDroppedInputTransformation as BetaThinkingDroppedInputTransformation,
1138
+ type BetaThinkingPrefixMismatchBehavior as BetaThinkingPrefixMismatchBehavior,
1126
1139
  type BetaThinkingTurns as BetaThinkingTurns,
1127
1140
  type BetaTokenTaskBudget as BetaTokenTaskBudget,
1128
1141
  type BetaTool as BetaTool,
@@ -1526,9 +1539,11 @@ export declare namespace Beta {
1526
1539
  type BetaDreamSessionsInput as BetaDreamSessionsInput,
1527
1540
  type BetaDreamStatus as BetaDreamStatus,
1528
1541
  type BetaDreamUsage as BetaDreamUsage,
1542
+ type BetaDreamingError as BetaDreamingError,
1529
1543
  type BetaOutputBehavior as BetaOutputBehavior,
1530
1544
  type BetaOutputBehaviorCreateNew as BetaOutputBehaviorCreateNew,
1531
1545
  type BetaOutputBehaviorUpdateExisting as BetaOutputBehaviorUpdateExisting,
1546
+ type BetaTargetStoreHeldError as BetaTargetStoreHeldError,
1532
1547
  type BetaDreamsPageCursor as BetaDreamsPageCursor,
1533
1548
  type DreamCreateParams as DreamCreateParams,
1534
1549
  type DreamRetrieveParams as DreamRetrieveParams,
@@ -26,11 +26,14 @@ export class DeploymentRuns extends APIResource {
26
26
  params: DeploymentRunRetrieveParams | null | undefined = {},
27
27
  options?: RequestOptions,
28
28
  ): APIPromise<BetaManagedAgentsDeploymentRun> {
29
- const { betas } = params ?? {};
29
+ const { betas, workspace_id } = params ?? {};
30
30
  return this._client.get(path`/v1/deployment_runs/${deploymentRunID}?beta=true`, {
31
31
  ...options,
32
32
  headers: buildHeaders([
33
- { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
33
+ {
34
+ 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
35
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
36
+ },
34
37
  options?.headers,
35
38
  ]),
36
39
  });
@@ -51,7 +54,7 @@ export class DeploymentRuns extends APIResource {
51
54
  params: DeploymentRunListParams | null | undefined = {},
52
55
  options?: RequestOptions,
53
56
  ): PagePromise<BetaManagedAgentsDeploymentRunsPageCursor, BetaManagedAgentsDeploymentRun> {
54
- const { betas, ...query } = params ?? {};
57
+ const { betas, workspace_id, ...query } = params ?? {};
55
58
  return this._client.getAPIList(
56
59
  '/v1/deployment_runs?beta=true',
57
60
  PageCursor<BetaManagedAgentsDeploymentRun>,
@@ -59,7 +62,10 @@ export class DeploymentRuns extends APIResource {
59
62
  query,
60
63
  ...options,
61
64
  headers: buildHeaders([
62
- { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
65
+ {
66
+ 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
67
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
68
+ },
63
69
  options?.headers,
64
70
  ]),
65
71
  },
@@ -130,8 +136,8 @@ export interface BetaManagedAgentsDeploymentRun {
130
136
  | null;
131
137
 
132
138
  /**
133
- * Populated on success. Null on creation failure. Exactly one of session_id or
134
- * error is non-null.
139
+ * Populated on success. Null on creation failure. Exactly one of `session_id` or
140
+ * `error` is non-null.
135
141
  */
136
142
  session_id: string | null;
137
143
 
@@ -364,6 +370,16 @@ export interface DeploymentRunRetrieveParams {
364
370
  * Optional header to specify the beta version(s) you want to use.
365
371
  */
366
372
  betas?: Array<BetaAPI.AnthropicBeta>;
373
+
374
+ /**
375
+ * Optional header to select the Workspace for this request. The value is a
376
+ * Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
377
+ *
378
+ * Only needed for credentials that can act on more than one Workspace. A
379
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
380
+ * match that Workspace.
381
+ */
382
+ workspace_id?: string;
367
383
  }
368
384
 
369
385
  export interface DeploymentRunListParams extends PageCursorParams {
@@ -389,14 +405,14 @@ export interface DeploymentRunListParams extends PageCursorParams {
389
405
 
390
406
  /**
391
407
  * Query param: Filter to a specific deployment. Omit to list across all
392
- * deployments in the workspace. Filtering by a non-existent deployment_id returns
393
- * 200 with empty data.
408
+ * deployments in the workspace. Filtering by a non-existent `deployment_id`
409
+ * returns 200 with empty data.
394
410
  */
395
411
  deployment_id?: string;
396
412
 
397
413
  /**
398
- * Query param: Filter: true for runs with non-null error, false for runs with
399
- * non-null session_id. Omit for all.
414
+ * Query param: Filter: true for runs with non-null `error`, false for runs with
415
+ * non-null `session_id`. Omit for all.
400
416
  */
401
417
  has_error?: boolean;
402
418
 
@@ -409,6 +425,16 @@ export interface DeploymentRunListParams extends PageCursorParams {
409
425
  * Header param: Optional header to specify the beta version(s) you want to use.
410
426
  */
411
427
  betas?: Array<BetaAPI.AnthropicBeta>;
428
+
429
+ /**
430
+ * Header param: Optional header to select the Workspace for this request. The
431
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
432
+ *
433
+ * Only needed for credentials that can act on more than one Workspace. A
434
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
435
+ * match that Workspace.
436
+ */
437
+ workspace_id?: string;
412
438
  }
413
439
 
414
440
  export declare namespace DeploymentRuns {