@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
@@ -0,0 +1,106 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../core/resource';
4
+ import { APIPromise } from '../../../core/api-promise';
5
+ import { RequestOptions } from '../../../internal/request-options';
6
+
7
+ export class ComplianceSettings extends APIResource {
8
+ /**
9
+ * Retrieve your organization's Compliance Settings.
10
+ *
11
+ * Compliance Settings is a singleton resource: there is exactly one per
12
+ * organization, addressed without an identifier. The `state` field reflects
13
+ * whether the Compliance API is enabled. An organization with a parent
14
+ * organization reads the state inherited from the parent's configuration.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const betaComplianceSettings =
19
+ * await client.beta.organization.complianceSettings.retrieve();
20
+ * ```
21
+ */
22
+ retrieve(options?: RequestOptions): APIPromise<BetaComplianceSettings> {
23
+ return this._client.get('/v1/organizations/compliance_settings?beta=true', options);
24
+ }
25
+
26
+ /**
27
+ * Update your organization's Compliance Settings.
28
+ *
29
+ * Setting `state` to `enabled` turns on the Compliance API and begins capturing
30
+ * organization activity events. Setting it to `disabled` turns both off. `state`
31
+ * reflects whether the Compliance API is enabled.
32
+ *
33
+ * A request that sets `state` to its current value succeeds and leaves the
34
+ * resource unchanged. A `disabled` request stays in effect until a later `enabled`
35
+ * request or the organization's next provisioning action that enables Access
36
+ * Transparency: enabling Access Transparency also enables the Compliance API,
37
+ * which serves its activity events, so such provisioning (including re-runs)
38
+ * re-enables the Compliance API even after a `disabled` request. Automated
39
+ * provisioning never disables compliance settings.
40
+ *
41
+ * @example
42
+ * ```ts
43
+ * const betaComplianceSettings =
44
+ * await client.beta.organization.complianceSettings.update({
45
+ * state: { type: 'enabled' },
46
+ * });
47
+ * ```
48
+ */
49
+ update(body: ComplianceSettingUpdateParams, options?: RequestOptions): APIPromise<BetaComplianceSettings> {
50
+ return this._client.post('/v1/organizations/compliance_settings?beta=true', { body, ...options });
51
+ }
52
+ }
53
+
54
+ export interface BetaComplianceSettings {
55
+ /**
56
+ * Whether the Compliance API is enabled for this organization.
57
+ */
58
+ state: BetaComplianceSettingsState;
59
+
60
+ type: 'compliance_settings';
61
+ }
62
+
63
+ export type BetaComplianceSettingsState =
64
+ | BetaComplianceSettingsStateEnabled
65
+ | BetaComplianceSettingsStateDisabled;
66
+
67
+ export interface BetaComplianceSettingsStateDisabled {
68
+ type: 'disabled';
69
+ }
70
+
71
+ export interface BetaComplianceSettingsStateDisabledParam {
72
+ type: 'disabled';
73
+ }
74
+
75
+ export interface BetaComplianceSettingsStateEnabled {
76
+ type: 'enabled';
77
+ }
78
+
79
+ export interface BetaComplianceSettingsStateEnabledParam {
80
+ type: 'enabled';
81
+ }
82
+
83
+ export type BetaComplianceSettingsStateParam =
84
+ | BetaComplianceSettingsStateEnabledParam
85
+ | BetaComplianceSettingsStateDisabledParam;
86
+
87
+ export interface ComplianceSettingUpdateParams {
88
+ /**
89
+ * Desired state. Accepts the string shorthand "enabled" or "disabled" in place of
90
+ * the object form; the response always returns the canonical object form.
91
+ */
92
+ state: BetaComplianceSettingsStateParam;
93
+ }
94
+
95
+ export declare namespace ComplianceSettings {
96
+ export {
97
+ type BetaComplianceSettings as BetaComplianceSettings,
98
+ type BetaComplianceSettingsState as BetaComplianceSettingsState,
99
+ type BetaComplianceSettingsStateDisabled as BetaComplianceSettingsStateDisabled,
100
+ type BetaComplianceSettingsStateDisabledParam as BetaComplianceSettingsStateDisabledParam,
101
+ type BetaComplianceSettingsStateEnabled as BetaComplianceSettingsStateEnabled,
102
+ type BetaComplianceSettingsStateEnabledParam as BetaComplianceSettingsStateEnabledParam,
103
+ type BetaComplianceSettingsStateParam as BetaComplianceSettingsStateParam,
104
+ type ComplianceSettingUpdateParams as ComplianceSettingUpdateParams,
105
+ };
106
+ }
@@ -136,7 +136,9 @@ export type BetaExternalKeysPageCursor = PageCursor<BetaExternalKey>;
136
136
 
137
137
  export interface BetaAWSExternalKeyConfig {
138
138
  /**
139
- * Full ARN of the AWS KMS key.
139
+ * Full ARN of the AWS KMS key. On Claude Platform on AWS the key must be a
140
+ * single-Region key in your organization's own AWS account; cross-account keys,
141
+ * multi-Region keys, and alias ARNs are rejected.
140
142
  */
141
143
  kms_arn: string;
142
144
 
@@ -148,8 +150,9 @@ export interface BetaAWSExternalKeyConfig {
148
150
  region?: string | null;
149
151
 
150
152
  /**
151
- * @deprecated IAM role ARN. Deprecated — Anthropic reaches the KMS key via a
152
- * managed intermediate role; this field is ignored.
153
+ * @deprecated IAM role ARN. Deprecated — Anthropic reaches the KMS key through its
154
+ * own intermediate role (or, on Claude Platform on AWS, with credentials AWS
155
+ * issues for the Workspace); this field is ignored.
153
156
  */
154
157
  role_arn?: string | null;
155
158
  }
@@ -12,6 +12,17 @@ export {
12
12
  type APIKeyListParams,
13
13
  type BetaAPIKeysPage,
14
14
  } from './api-keys';
15
+ export {
16
+ ComplianceSettings,
17
+ type BetaComplianceSettings,
18
+ type BetaComplianceSettingsState,
19
+ type BetaComplianceSettingsStateDisabled,
20
+ type BetaComplianceSettingsStateDisabledParam,
21
+ type BetaComplianceSettingsStateEnabled,
22
+ type BetaComplianceSettingsStateEnabledParam,
23
+ type BetaComplianceSettingsStateParam,
24
+ type ComplianceSettingUpdateParams,
25
+ } from './compliance-settings';
15
26
  export {
16
27
  ExternalKeys,
17
28
  type BetaAWSExternalKeyConfig,
@@ -14,6 +14,18 @@ import {
14
14
  BetaAPIKeyWorkspaceScope,
15
15
  BetaAPIKeysPage,
16
16
  } from './api-keys';
17
+ import * as ComplianceSettingsAPI from './compliance-settings';
18
+ import {
19
+ BetaComplianceSettings,
20
+ BetaComplianceSettingsState,
21
+ BetaComplianceSettingsStateDisabled,
22
+ BetaComplianceSettingsStateDisabledParam,
23
+ BetaComplianceSettingsStateEnabled,
24
+ BetaComplianceSettingsStateEnabledParam,
25
+ BetaComplianceSettingsStateParam,
26
+ ComplianceSettingUpdateParams,
27
+ ComplianceSettings,
28
+ } from './compliance-settings';
17
29
  import * as ExternalKeysAPI from './external-keys';
18
30
  import {
19
31
  BetaAWSExternalKeyConfig,
@@ -99,6 +111,9 @@ export class Organization extends APIResource {
99
111
  users: UsersAPI.Users = new UsersAPI.Users(this._client);
100
112
  workspaces: WorkspacesAPI.Workspaces = new WorkspacesAPI.Workspaces(this._client);
101
113
  rateLimits: RateLimitsAPI.RateLimits = new RateLimitsAPI.RateLimits(this._client);
114
+ complianceSettings: ComplianceSettingsAPI.ComplianceSettings = new ComplianceSettingsAPI.ComplianceSettings(
115
+ this._client,
116
+ );
102
117
 
103
118
  /**
104
119
  * Retrieve information about the organization associated with the authenticated
@@ -153,6 +168,7 @@ Organization.ServiceAccounts = ServiceAccounts;
153
168
  Organization.Users = Users;
154
169
  Organization.Workspaces = Workspaces;
155
170
  Organization.RateLimits = RateLimits;
171
+ Organization.ComplianceSettings = ComplianceSettings;
156
172
 
157
173
  export declare namespace Organization {
158
174
  export { type BetaOrganization as BetaOrganization, type BetaOrganizationRole as BetaOrganizationRole };
@@ -242,4 +258,16 @@ export declare namespace Organization {
242
258
  type BetaOrganizationRateLimitsPageCursor as BetaOrganizationRateLimitsPageCursor,
243
259
  type RateLimitListParams as RateLimitListParams,
244
260
  };
261
+
262
+ export {
263
+ ComplianceSettings as ComplianceSettings,
264
+ type BetaComplianceSettings as BetaComplianceSettings,
265
+ type BetaComplianceSettingsState as BetaComplianceSettingsState,
266
+ type BetaComplianceSettingsStateDisabled as BetaComplianceSettingsStateDisabled,
267
+ type BetaComplianceSettingsStateDisabledParam as BetaComplianceSettingsStateDisabledParam,
268
+ type BetaComplianceSettingsStateEnabled as BetaComplianceSettingsStateEnabled,
269
+ type BetaComplianceSettingsStateEnabledParam as BetaComplianceSettingsStateEnabledParam,
270
+ type BetaComplianceSettingsStateParam as BetaComplianceSettingsStateParam,
271
+ type ComplianceSettingUpdateParams as ComplianceSettingUpdateParams,
272
+ };
245
273
  }
@@ -221,8 +221,12 @@ export interface BetaWorkspace {
221
221
  * key-policy condition so the key is scoped to this compartment. On GCP and Azure,
222
222
  * Anthropic enforces the compartment binding automatically; you do not need to
223
223
  * reference this value in your key configuration. See the CMEK integration guide
224
- * for the required key configuration, including the value used during key
225
- * validation.
224
+ * for the required key configuration; unless your organization is on Claude
225
+ * Platform on AWS, it includes a separate value used during key validation. On
226
+ * Claude Platform on AWS there is no separate validation value: the key is
227
+ * validated against this Workspace's own value when it is attached, so if your key
228
+ * policy uses the compartment condition, add this value to it before attaching the
229
+ * key.
226
230
  */
227
231
  compartment_id: string;
228
232
 
@@ -245,10 +249,14 @@ export interface BetaWorkspace {
245
249
  * ID of the customer-managed encryption key (CMEK) configuration to use for this
246
250
  * Workspace. Setting this field requires CMEK to be enabled for your organization.
247
251
  * When set, data stored for this Workspace is encrypted with the referenced key.
248
- * Create key configurations with the External Keys API. This field is write-once:
249
- * once a key is attached to a Workspace it cannot be detached or replaced. To
250
- * rotate key material, rotate the underlying key on your cloud KMS; the
251
- * `external_key_id` stays the same.
252
+ * Create key configurations with the External Keys API. On Claude Platform on AWS
253
+ * the value is the AWS KMS key ARN, and the key must be a single-Region key in the
254
+ * same AWS account and Region as the Workspace. On that platform the key is
255
+ * validated against this Workspace when it is attached, so a key-policy problem is
256
+ * reported as an error on this request. This field is write-once: once a key is
257
+ * attached to a Workspace it cannot be detached or replaced. To rotate key
258
+ * material, rotate the underlying key on your cloud KMS; the `external_key_id`
259
+ * stays the same.
252
260
  */
253
261
  external_key_id: string | null;
254
262
 
@@ -324,8 +332,12 @@ export interface WorkspaceCreateParams {
324
332
  * Body param: ID of the customer-managed encryption key (CMEK) configuration to
325
333
  * use for this Workspace. Setting this field requires CMEK to be enabled for your
326
334
  * organization. When set, data stored for this Workspace is encrypted with the
327
- * referenced key. Create key configurations with the External Keys API. This field
328
- * is write-once: once a key is attached to a Workspace it cannot be detached or
335
+ * referenced key. Create key configurations with the External Keys API. On Claude
336
+ * Platform on AWS the value is the AWS KMS key ARN, and the key must be a
337
+ * single-Region key in the same AWS account and Region as the Workspace. On that
338
+ * platform the key is validated against this Workspace when it is attached, so a
339
+ * key-policy problem is reported as an error on this request. This field is
340
+ * write-once: once a key is attached to a Workspace it cannot be detached or
329
341
  * replaced. To rotate key material, rotate the underlying key on your cloud KMS;
330
342
  * the `external_key_id` stays the same.
331
343
  */
@@ -358,10 +370,14 @@ export interface WorkspaceUpdateParams {
358
370
  * ID of the customer-managed encryption key (CMEK) configuration to use for this
359
371
  * Workspace. Setting this field requires CMEK to be enabled for your organization.
360
372
  * When set, data stored for this Workspace is encrypted with the referenced key.
361
- * Create key configurations with the External Keys API. This field is write-once:
362
- * once a key is attached to a Workspace it cannot be detached or replaced. To
363
- * rotate key material, rotate the underlying key on your cloud KMS; the
364
- * `external_key_id` stays the same.
373
+ * Create key configurations with the External Keys API. On Claude Platform on AWS
374
+ * the value is the AWS KMS key ARN, and the key must be a single-Region key in the
375
+ * same AWS account and Region as the Workspace. On that platform the key is
376
+ * validated against this Workspace when it is attached, so a key-policy problem is
377
+ * reported as an error on this request. This field is write-once: once a key is
378
+ * attached to a Workspace it cannot be detached or replaced. To rotate key
379
+ * material, rotate the underlying key on your cloud KMS; the `external_key_id`
380
+ * stays the same.
365
381
  */
366
382
  external_key_id?: string;
367
383
 
@@ -34,7 +34,7 @@ export class Events extends APIResource {
34
34
  params: EventListParams | null | undefined = {},
35
35
  options?: RequestOptions,
36
36
  ): PagePromise<BetaManagedAgentsSessionEventsPageCursor, BetaManagedAgentsSessionEvent> {
37
- const { betas, ...query } = params ?? {};
37
+ const { betas, workspace_id, ...query } = params ?? {};
38
38
  return this._client.getAPIList(
39
39
  path`/v1/sessions/${sessionID}/events?beta=true`,
40
40
  PageCursor<BetaManagedAgentsSessionEvent>,
@@ -42,7 +42,10 @@ export class Events extends APIResource {
42
42
  query,
43
43
  ...options,
44
44
  headers: buildHeaders([
45
- { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
45
+ {
46
+ 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
47
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
48
+ },
46
49
  options?.headers,
47
50
  ]),
48
51
  },
@@ -78,12 +81,15 @@ export class Events extends APIResource {
78
81
  params: EventSendParams,
79
82
  options?: RequestOptions,
80
83
  ): APIPromise<BetaManagedAgentsSendSessionEvents> {
81
- const { betas, ...body } = params;
84
+ const { betas, workspace_id, ...body } = params;
82
85
  return this._client.post(path`/v1/sessions/${sessionID}/events?beta=true`, {
83
86
  body,
84
87
  ...options,
85
88
  headers: buildHeaders([
86
- { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
89
+ {
90
+ 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
91
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
92
+ },
87
93
  options?.headers,
88
94
  ]),
89
95
  });
@@ -105,12 +111,15 @@ export class Events extends APIResource {
105
111
  params: EventStreamParams | undefined = {},
106
112
  options?: RequestOptions,
107
113
  ): APIPromise<Stream<BetaManagedAgentsStreamSessionEvents>> {
108
- const { betas, ...query } = params ?? {};
114
+ const { betas, workspace_id, ...query } = params ?? {};
109
115
  return this._client.get(path`/v1/sessions/${sessionID}/events/stream?beta=true`, {
110
116
  query,
111
117
  ...options,
112
118
  headers: buildHeaders([
113
- { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
119
+ {
120
+ 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
121
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
122
+ },
114
123
  options?.headers,
115
124
  ]),
116
125
  stream: true,
@@ -1977,7 +1986,7 @@ export interface EventListParams extends PageCursorParams {
1977
1986
 
1978
1987
  /**
1979
1988
  * Query param: Sort direction for results, ordered by the event's `processed_at`.
1980
- * Defaults to asc (chronological).
1989
+ * Defaults to `asc` (chronological).
1981
1990
  */
1982
1991
  order?: 'asc' | 'desc';
1983
1992
 
@@ -1992,6 +2001,16 @@ export interface EventListParams extends PageCursorParams {
1992
2001
  * Header param: Optional header to specify the beta version(s) you want to use.
1993
2002
  */
1994
2003
  betas?: Array<BetaAPI.AnthropicBeta>;
2004
+
2005
+ /**
2006
+ * Header param: Optional header to select the Workspace for this request. The
2007
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
2008
+ *
2009
+ * Only needed for credentials that can act on more than one Workspace. A
2010
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
2011
+ * match that Workspace.
2012
+ */
2013
+ workspace_id?: string;
1995
2014
  }
1996
2015
 
1997
2016
  export interface EventSendParams {
@@ -2004,6 +2023,16 @@ export interface EventSendParams {
2004
2023
  * Header param: Optional header to specify the beta version(s) you want to use.
2005
2024
  */
2006
2025
  betas?: Array<BetaAPI.AnthropicBeta>;
2026
+
2027
+ /**
2028
+ * Header param: Optional header to select the Workspace for this request. The
2029
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
2030
+ *
2031
+ * Only needed for credentials that can act on more than one Workspace. A
2032
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
2033
+ * match that Workspace.
2034
+ */
2035
+ workspace_id?: string;
2007
2036
  }
2008
2037
 
2009
2038
  export interface EventStreamParams {
@@ -2025,6 +2054,16 @@ export interface EventStreamParams {
2025
2054
  * Header param: Optional header to specify the beta version(s) you want to use.
2026
2055
  */
2027
2056
  betas?: Array<BetaAPI.AnthropicBeta>;
2057
+
2058
+ /**
2059
+ * Header param: Optional header to select the Workspace for this request. The
2060
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
2061
+ *
2062
+ * Only needed for credentials that can act on more than one Workspace. A
2063
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
2064
+ * match that Workspace.
2065
+ */
2066
+ workspace_id?: string;
2028
2067
  }
2029
2068
 
2030
2069
  export { SessionToolRunner, type SessionToolRunnerOptions } from '../../../lib/tools/SessionToolRunner';
@@ -27,11 +27,14 @@ export class Resources extends APIResource {
27
27
  params: ResourceRetrieveParams,
28
28
  options?: RequestOptions,
29
29
  ): APIPromise<ResourceRetrieveResponse> {
30
- const { session_id, betas } = params;
30
+ const { session_id, betas, workspace_id } = params;
31
31
  return this._client.get(path`/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, {
32
32
  ...options,
33
33
  headers: buildHeaders([
34
- { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
34
+ {
35
+ 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
36
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
37
+ },
35
38
  options?.headers,
36
39
  ]),
37
40
  });
@@ -57,12 +60,15 @@ export class Resources extends APIResource {
57
60
  params: ResourceUpdateParams,
58
61
  options?: RequestOptions,
59
62
  ): APIPromise<ResourceUpdateResponse> {
60
- const { session_id, betas, ...body } = params;
63
+ const { session_id, betas, workspace_id, ...body } = params;
61
64
  return this._client.post(path`/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, {
62
65
  body,
63
66
  ...options,
64
67
  headers: buildHeaders([
65
- { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
68
+ {
69
+ 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
70
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
71
+ },
66
72
  options?.headers,
67
73
  ]),
68
74
  });
@@ -86,7 +92,7 @@ export class Resources extends APIResource {
86
92
  params: ResourceListParams | null | undefined = {},
87
93
  options?: RequestOptions,
88
94
  ): PagePromise<BetaManagedAgentsSessionResourcesPageCursor, BetaManagedAgentsSessionResource> {
89
- const { betas, ...query } = params ?? {};
95
+ const { betas, workspace_id, ...query } = params ?? {};
90
96
  return this._client.getAPIList(
91
97
  path`/v1/sessions/${sessionID}/resources?beta=true`,
92
98
  PageCursor<BetaManagedAgentsSessionResource>,
@@ -94,7 +100,10 @@ export class Resources extends APIResource {
94
100
  query,
95
101
  ...options,
96
102
  headers: buildHeaders([
97
- { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
103
+ {
104
+ 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
105
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
106
+ },
98
107
  options?.headers,
99
108
  ]),
100
109
  },
@@ -118,11 +127,14 @@ export class Resources extends APIResource {
118
127
  params: ResourceDeleteParams,
119
128
  options?: RequestOptions,
120
129
  ): APIPromise<BetaManagedAgentsDeleteSessionResource> {
121
- const { session_id, betas } = params;
130
+ const { session_id, betas, workspace_id } = params;
122
131
  return this._client.delete(path`/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, {
123
132
  ...options,
124
133
  headers: buildHeaders([
125
- { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
134
+ {
135
+ 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
136
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
137
+ },
126
138
  options?.headers,
127
139
  ]),
128
140
  });
@@ -148,12 +160,15 @@ export class Resources extends APIResource {
148
160
  params: ResourceAddParams,
149
161
  options?: RequestOptions,
150
162
  ): APIPromise<BetaManagedAgentsFileResource> {
151
- const { betas, ...body } = params;
163
+ const { betas, workspace_id, ...body } = params;
152
164
  return this._client.post(path`/v1/sessions/${sessionID}/resources?beta=true`, {
153
165
  body,
154
166
  ...options,
155
167
  headers: buildHeaders([
156
- { 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
168
+ {
169
+ 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
170
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
171
+ },
157
172
  options?.headers,
158
173
  ]),
159
174
  });
@@ -289,6 +304,16 @@ export interface ResourceRetrieveParams {
289
304
  * Header param: Optional header to specify the beta version(s) you want to use.
290
305
  */
291
306
  betas?: Array<BetaAPI.AnthropicBeta>;
307
+
308
+ /**
309
+ * Header param: Optional header to select the Workspace for this request. The
310
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
311
+ *
312
+ * Only needed for credentials that can act on more than one Workspace. A
313
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
314
+ * match that Workspace.
315
+ */
316
+ workspace_id?: string;
292
317
  }
293
318
 
294
319
  export interface ResourceUpdateParams {
@@ -307,6 +332,16 @@ export interface ResourceUpdateParams {
307
332
  * Header param: Optional header to specify the beta version(s) you want to use.
308
333
  */
309
334
  betas?: Array<BetaAPI.AnthropicBeta>;
335
+
336
+ /**
337
+ * Header param: Optional header to select the Workspace for this request. The
338
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
339
+ *
340
+ * Only needed for credentials that can act on more than one Workspace. A
341
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
342
+ * match that Workspace.
343
+ */
344
+ workspace_id?: string;
310
345
  }
311
346
 
312
347
  export interface ResourceListParams extends PageCursorParams {
@@ -314,6 +349,16 @@ export interface ResourceListParams extends PageCursorParams {
314
349
  * Header param: Optional header to specify the beta version(s) you want to use.
315
350
  */
316
351
  betas?: Array<BetaAPI.AnthropicBeta>;
352
+
353
+ /**
354
+ * Header param: Optional header to select the Workspace for this request. The
355
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
356
+ *
357
+ * Only needed for credentials that can act on more than one Workspace. A
358
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
359
+ * match that Workspace.
360
+ */
361
+ workspace_id?: string;
317
362
  }
318
363
 
319
364
  export interface ResourceDeleteParams {
@@ -326,6 +371,16 @@ export interface ResourceDeleteParams {
326
371
  * Header param: Optional header to specify the beta version(s) you want to use.
327
372
  */
328
373
  betas?: Array<BetaAPI.AnthropicBeta>;
374
+
375
+ /**
376
+ * Header param: Optional header to select the Workspace for this request. The
377
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
378
+ *
379
+ * Only needed for credentials that can act on more than one Workspace. A
380
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
381
+ * match that Workspace.
382
+ */
383
+ workspace_id?: string;
329
384
  }
330
385
 
331
386
  export interface ResourceAddParams {
@@ -349,6 +404,16 @@ export interface ResourceAddParams {
349
404
  * Header param: Optional header to specify the beta version(s) you want to use.
350
405
  */
351
406
  betas?: Array<BetaAPI.AnthropicBeta>;
407
+
408
+ /**
409
+ * Header param: Optional header to select the Workspace for this request. The
410
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
411
+ *
412
+ * Only needed for credentials that can act on more than one Workspace. A
413
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
414
+ * match that Workspace.
415
+ */
416
+ workspace_id?: string;
352
417
  }
353
418
 
354
419
  export declare namespace Resources {