@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
@@ -43,7 +43,7 @@ export class Batches extends APIResource {
43
43
  * ```
44
44
  */
45
45
  create(params: BatchCreateParams, options?: RequestOptions): APIPromise<BetaMessageBatch> {
46
- const { betas, user_profile_id, ...body } = params;
46
+ const { betas, user_profile_id, workspace_id, ...body } = params;
47
47
  return this._client.post('/v1/messages/batches?beta=true', {
48
48
  body,
49
49
  ...options,
@@ -51,6 +51,7 @@ export class Batches extends APIResource {
51
51
  {
52
52
  'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),
53
53
  ...(user_profile_id != null ? { 'anthropic-user-profile-id': user_profile_id } : undefined),
54
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
54
55
  },
55
56
  options?.headers,
56
57
  ]),
@@ -78,11 +79,14 @@ export class Batches extends APIResource {
78
79
  params: BatchRetrieveParams | null | undefined = {},
79
80
  options?: RequestOptions,
80
81
  ): APIPromise<BetaMessageBatch> {
81
- const { betas } = params ?? {};
82
+ const { betas, workspace_id } = params ?? {};
82
83
  return this._client.get(path`/v1/messages/batches/${messageBatchID}?beta=true`, {
83
84
  ...options,
84
85
  headers: buildHeaders([
85
- { 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString() },
86
+ {
87
+ 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),
88
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
89
+ },
86
90
  options?.headers,
87
91
  ]),
88
92
  });
@@ -107,12 +111,15 @@ export class Batches extends APIResource {
107
111
  params: BatchListParams | null | undefined = {},
108
112
  options?: RequestOptions,
109
113
  ): PagePromise<BetaMessageBatchesPage, BetaMessageBatch> {
110
- const { betas, ...query } = params ?? {};
114
+ const { betas, workspace_id, ...query } = params ?? {};
111
115
  return this._client.getAPIList('/v1/messages/batches?beta=true', Page<BetaMessageBatch>, {
112
116
  query,
113
117
  ...options,
114
118
  headers: buildHeaders([
115
- { 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString() },
119
+ {
120
+ 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),
121
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
122
+ },
116
123
  options?.headers,
117
124
  ]),
118
125
  });
@@ -140,11 +147,14 @@ export class Batches extends APIResource {
140
147
  params: BatchDeleteParams | null | undefined = {},
141
148
  options?: RequestOptions,
142
149
  ): APIPromise<BetaDeletedMessageBatch> {
143
- const { betas } = params ?? {};
150
+ const { betas, workspace_id } = params ?? {};
144
151
  return this._client.delete(path`/v1/messages/batches/${messageBatchID}?beta=true`, {
145
152
  ...options,
146
153
  headers: buildHeaders([
147
- { 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString() },
154
+ {
155
+ 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),
156
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
157
+ },
148
158
  options?.headers,
149
159
  ]),
150
160
  });
@@ -177,11 +187,14 @@ export class Batches extends APIResource {
177
187
  params: BatchCancelParams | null | undefined = {},
178
188
  options?: RequestOptions,
179
189
  ): APIPromise<BetaMessageBatch> {
180
- const { betas } = params ?? {};
190
+ const { betas, workspace_id } = params ?? {};
181
191
  return this._client.post(path`/v1/messages/batches/${messageBatchID}/cancel?beta=true`, {
182
192
  ...options,
183
193
  headers: buildHeaders([
184
- { 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString() },
194
+ {
195
+ 'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),
196
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
197
+ },
185
198
  options?.headers,
186
199
  ]),
187
200
  });
@@ -210,14 +223,14 @@ export class Batches extends APIResource {
210
223
  params: BatchResultsParams | undefined = {},
211
224
  options?: RequestOptions,
212
225
  ): Promise<JSONLDecoder<BetaMessageBatchIndividualResponse>> {
213
- const batch = await this.retrieve(messageBatchID);
226
+ const batch = await this.retrieve(messageBatchID, params, options);
214
227
  if (!batch.results_url) {
215
228
  throw new AnthropicError(
216
229
  `No batch \`results_url\`; Has it finished processing? ${batch.processing_status} - ${batch.id}`,
217
230
  );
218
231
  }
219
232
 
220
- const { betas } = params ?? {};
233
+ const { betas, workspace_id } = params ?? {};
221
234
  return this._client
222
235
  .get(batch.results_url, {
223
236
  ...options,
@@ -225,6 +238,7 @@ export class Batches extends APIResource {
225
238
  {
226
239
  'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),
227
240
  Accept: 'application/binary',
241
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
228
242
  },
229
243
  options?.headers,
230
244
  ]),
@@ -436,6 +450,16 @@ export interface BatchCreateParams {
436
450
  * is errored.
437
451
  */
438
452
  user_profile_id?: string;
453
+
454
+ /**
455
+ * Header param: Optional header to select the Workspace for this request. The
456
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
457
+ *
458
+ * Only needed for credentials that can act on more than one Workspace. A
459
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
460
+ * match that Workspace.
461
+ */
462
+ workspace_id?: string;
439
463
  }
440
464
 
441
465
  export namespace BatchCreateParams {
@@ -822,6 +846,16 @@ export interface BatchRetrieveParams {
822
846
  * Optional header to specify the beta version(s) you want to use.
823
847
  */
824
848
  betas?: Array<BetaAPI.AnthropicBeta>;
849
+
850
+ /**
851
+ * Optional header to select the Workspace for this request. The value is a
852
+ * Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
853
+ *
854
+ * Only needed for credentials that can act on more than one Workspace. A
855
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
856
+ * match that Workspace.
857
+ */
858
+ workspace_id?: string;
825
859
  }
826
860
 
827
861
  export interface BatchListParams extends PageParams {
@@ -829,6 +863,16 @@ export interface BatchListParams extends PageParams {
829
863
  * Header param: Optional header to specify the beta version(s) you want to use.
830
864
  */
831
865
  betas?: Array<BetaAPI.AnthropicBeta>;
866
+
867
+ /**
868
+ * Header param: Optional header to select the Workspace for this request. The
869
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
870
+ *
871
+ * Only needed for credentials that can act on more than one Workspace. A
872
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
873
+ * match that Workspace.
874
+ */
875
+ workspace_id?: string;
832
876
  }
833
877
 
834
878
  export interface BatchDeleteParams {
@@ -836,6 +880,16 @@ export interface BatchDeleteParams {
836
880
  * Optional header to specify the beta version(s) you want to use.
837
881
  */
838
882
  betas?: Array<BetaAPI.AnthropicBeta>;
883
+
884
+ /**
885
+ * Optional header to select the Workspace for this request. The value is a
886
+ * Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
887
+ *
888
+ * Only needed for credentials that can act on more than one Workspace. A
889
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
890
+ * match that Workspace.
891
+ */
892
+ workspace_id?: string;
839
893
  }
840
894
 
841
895
  export interface BatchCancelParams {
@@ -843,6 +897,16 @@ export interface BatchCancelParams {
843
897
  * Optional header to specify the beta version(s) you want to use.
844
898
  */
845
899
  betas?: Array<BetaAPI.AnthropicBeta>;
900
+
901
+ /**
902
+ * Optional header to select the Workspace for this request. The value is a
903
+ * Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
904
+ *
905
+ * Only needed for credentials that can act on more than one Workspace. A
906
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
907
+ * match that Workspace.
908
+ */
909
+ workspace_id?: string;
846
910
  }
847
911
 
848
912
  export interface BatchResultsParams {
@@ -850,6 +914,16 @@ export interface BatchResultsParams {
850
914
  * Optional header to specify the beta version(s) you want to use.
851
915
  */
852
916
  betas?: Array<BetaAPI.AnthropicBeta>;
917
+
918
+ /**
919
+ * Optional header to select the Workspace for this request. The value is a
920
+ * Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
921
+ *
922
+ * Only needed for credentials that can act on more than one Workspace. A
923
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
924
+ * match that Workspace.
925
+ */
926
+ workspace_id?: string;
853
927
  }
854
928
 
855
929
  export declare namespace Batches {
@@ -232,6 +232,7 @@ export {
232
232
  type BetaSignatureDelta,
233
233
  type BetaSkillParams,
234
234
  type BetaStopReason,
235
+ type BetaSystemMessageOutputConfig,
235
236
  type BetaTextBlock,
236
237
  type BetaTextBlockParam,
237
238
  type BetaTextCitation,
@@ -248,12 +249,15 @@ export {
248
249
  type BetaTextEditorCodeExecutionViewResultBlock,
249
250
  type BetaTextEditorCodeExecutionViewResultBlockParam,
250
251
  type BetaThinkingBlock,
252
+ type BetaThinkingBlockBinding,
251
253
  type BetaThinkingBlockParam,
252
254
  type BetaThinkingConfigAdaptive,
253
255
  type BetaThinkingConfigDisabled,
254
256
  type BetaThinkingConfigEnabled,
255
257
  type BetaThinkingConfigParam,
256
258
  type BetaThinkingDelta,
259
+ type BetaThinkingDroppedInputTransformation,
260
+ type BetaThinkingPrefixMismatchBehavior,
257
261
  type BetaThinkingTurns,
258
262
  type BetaTokenTaskBudget,
259
263
  type BetaTool,
@@ -90,7 +90,7 @@ export class Messages extends APIResource {
90
90
  // Transform deprecated output_format to output_config.format
91
91
  const modifiedParams = transformOutputFormat(params);
92
92
 
93
- const { betas, user_profile_id, ...body } = modifiedParams;
93
+ const { betas, user_profile_id, workspace_id, ...body } = modifiedParams;
94
94
 
95
95
  if (body.model in DEPRECATED_MODELS) {
96
96
  console.warn(
@@ -127,6 +127,7 @@ export class Messages extends APIResource {
127
127
  {
128
128
  ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined),
129
129
  ...(user_profile_id != null ? { 'anthropic-user-profile-id': user_profile_id } : undefined),
130
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
130
131
  },
131
132
  helperHeader,
132
133
  options?.headers,
@@ -203,7 +204,7 @@ export class Messages extends APIResource {
203
204
  // Transform deprecated output_format to output_config.format
204
205
  const modifiedParams = transformOutputFormat(params);
205
206
 
206
- const { betas, user_profile_id, ...body } = modifiedParams;
207
+ const { betas, user_profile_id, workspace_id, ...body } = modifiedParams;
207
208
  return this._client.post('/v1/messages/count_tokens?beta=true', {
208
209
  body,
209
210
  ...options,
@@ -211,6 +212,7 @@ export class Messages extends APIResource {
211
212
  {
212
213
  'anthropic-beta': [...(betas ?? []), 'token-counting-2024-11-01'].toString(),
213
214
  ...(user_profile_id != null ? { 'anthropic-user-profile-id': user_profile_id } : undefined),
215
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
214
216
  },
215
217
  options?.headers,
216
218
  ]),
@@ -1221,10 +1223,6 @@ export interface BetaBrowserSwitchTabConfig {
1221
1223
  export interface BetaBrowserToolset20260801 {
1222
1224
  type: 'browser_toolset_20260801';
1223
1225
 
1224
- allowed_callers?: Array<
1225
- 'direct' | 'code_execution_20250825' | 'code_execution_20260120' | 'code_execution_20260521'
1226
- >;
1227
-
1228
1226
  /**
1229
1227
  * Create a cache control breakpoint at this content block.
1230
1228
  */
@@ -2472,10 +2470,6 @@ export interface BetaComputerScrollConfig {
2472
2470
  export interface BetaComputerToolset20260801 {
2473
2471
  type: 'computer_toolset_20260801';
2474
2472
 
2475
- allowed_callers?: Array<
2476
- 'direct' | 'code_execution_20250825' | 'code_execution_20260120' | 'code_execution_20260521'
2477
- >;
2478
-
2479
2473
  /**
2480
2474
  * Create a cache control breakpoint at this content block.
2481
2475
  */
@@ -3692,6 +3686,25 @@ export interface BetaMessage {
3692
3686
  * `cache_creation_input_tokens`, and `cache_read_input_tokens`.
3693
3687
  */
3694
3688
  usage: BetaUsage;
3689
+
3690
+ /**
3691
+ * Changes the API made to the request's input before showing it to the model: one
3692
+ * entry per change, in request order. Today the only entry type is
3693
+ * `thinking_dropped` — a `thinking`, `redacted_thinking` or `connector_text` block
3694
+ * from the request's `messages` that was removed from the prompt instead of being
3695
+ * shown to the model because it failed a binding check. More entry types may be
3696
+ * added over time; ignore types you do not recognize.
3697
+ *
3698
+ * Requires `anthropic-beta: thinking-binding-controls-2026-08-01`. Present on
3699
+ * every such response from a model that supports extended thinking, as `[]` when
3700
+ * nothing was changed; without the beta, blocks are removed all the same but
3701
+ * nothing is reported. Removed blocks contribute nothing to `usage.input_tokens`.
3702
+ * When streaming, the array is final in `message_start`; the final `message_delta`
3703
+ * event carries it only when a server-side model fallback happened mid-stream, in
3704
+ * which case it holds the serving model's entries and replaces the one in
3705
+ * `message_start`.
3706
+ */
3707
+ input_transformations?: Array<BetaThinkingDroppedInputTransformation> | null;
3695
3708
  }
3696
3709
 
3697
3710
  export interface BetaMessageDeltaUsage {
@@ -3809,6 +3822,25 @@ export interface BetaMessageParam {
3809
3822
  content: string | Array<BetaContentBlockParam>;
3810
3823
 
3811
3824
  role: 'user' | 'assistant' | 'system';
3825
+
3826
+ /**
3827
+ * How long this system message's text stays in front of the model. `"never"` (the
3828
+ * default) renders it on every request that includes it. `"next_user_message"`
3829
+ * renders it only for the user turn it follows: once a later `role: "user"`
3830
+ * message exists in `messages` the message stays in the array (send it unchanged)
3831
+ * but is no longer shown to the model. Only permitted on `role: "system"`
3832
+ * messages.
3833
+ */
3834
+ clear_at?: 'next_user_message' | 'never' | null;
3835
+
3836
+ /**
3837
+ * Per-message output configuration on a role:"system" input message.
3838
+ *
3839
+ * Fields here apply per-turn; `format` remains top-level only. An empty `{}` is
3840
+ * accepted on a message that carries content; a message with neither content nor
3841
+ * output_config fields is rejected.
3842
+ */
3843
+ output_config?: BetaSystemMessageOutputConfig | null;
3812
3844
  }
3813
3845
 
3814
3846
  export interface BetaMessageTokensCount {
@@ -3953,6 +3985,25 @@ export interface BetaRawMessageDeltaEvent {
3953
3985
  * `cache_creation_input_tokens`, and `cache_read_input_tokens`.
3954
3986
  */
3955
3987
  usage: BetaMessageDeltaUsage;
3988
+
3989
+ /**
3990
+ * Changes the API made to the request's input before showing it to the model: one
3991
+ * entry per change, in request order. Today the only entry type is
3992
+ * `thinking_dropped` — a `thinking`, `redacted_thinking` or `connector_text` block
3993
+ * from the request's `messages` that was removed from the prompt instead of being
3994
+ * shown to the model because it failed a binding check. More entry types may be
3995
+ * added over time; ignore types you do not recognize.
3996
+ *
3997
+ * Requires `anthropic-beta: thinking-binding-controls-2026-08-01`. Present on
3998
+ * every such response from a model that supports extended thinking, as `[]` when
3999
+ * nothing was changed; without the beta, blocks are removed all the same but
4000
+ * nothing is reported. Removed blocks contribute nothing to `usage.input_tokens`.
4001
+ * When streaming, the array is final in `message_start`; the final `message_delta`
4002
+ * event carries it only when a server-side model fallback happened mid-stream, in
4003
+ * which case it holds the serving model's entries and replaces the one in
4004
+ * `message_start`.
4005
+ */
4006
+ input_transformations?: Array<BetaThinkingDroppedInputTransformation> | null;
3956
4007
  }
3957
4008
 
3958
4009
  export namespace BetaRawMessageDeltaEvent {
@@ -4343,6 +4394,20 @@ export type BetaStopReason =
4343
4394
  | 'refusal'
4344
4395
  | 'model_context_window_exceeded';
4345
4396
 
4397
+ /**
4398
+ * Per-message output configuration on a role:"system" input message.
4399
+ *
4400
+ * Fields here apply per-turn; `format` remains top-level only. An empty `{}` is
4401
+ * accepted on a message that carries content; a message with neither content nor
4402
+ * output_config fields is rejected.
4403
+ */
4404
+ export interface BetaSystemMessageOutputConfig {
4405
+ /**
4406
+ * All possible effort levels.
4407
+ */
4408
+ effort?: 'low' | 'medium' | 'high' | 'xhigh' | 'max' | null;
4409
+ }
4410
+
4346
4411
  export interface BetaTextBlock {
4347
4412
  /**
4348
4413
  * Citations supporting the text block.
@@ -4537,6 +4602,22 @@ export interface BetaThinkingBlock {
4537
4602
  type: 'thinking';
4538
4603
  }
4539
4604
 
4605
+ /**
4606
+ * Controls for block binding: what happens when a thinking block this request
4607
+ * sends back fails the conversation check. Every field is optional; an empty
4608
+ * object means every default.
4609
+ */
4610
+ export interface BetaThinkingBlockBinding {
4611
+ /**
4612
+ * What happens when a thinking block in `messages` fails the conversation check:
4613
+ * it was created in a different conversation, or the messages before it have
4614
+ * changed since. `"error"` (the default) fails the request with a 400 error.
4615
+ * `"drop_block"` removes the failing blocks and the request proceeds; the model no
4616
+ * longer sees the dropped reasoning.
4617
+ */
4618
+ prefix_mismatch_behavior?: BetaThinkingPrefixMismatchBehavior | null;
4619
+ }
4620
+
4540
4621
  export interface BetaThinkingBlockParam {
4541
4622
  /**
4542
4623
  * The `signature` value of this thinking block, exactly as returned by the API in
@@ -4558,6 +4639,13 @@ export interface BetaThinkingBlockParam {
4558
4639
  export interface BetaThinkingConfigAdaptive {
4559
4640
  type: 'adaptive';
4560
4641
 
4642
+ /**
4643
+ * Controls for block binding: what happens when a thinking block this request
4644
+ * sends back fails the conversation check. Every field is optional; an empty
4645
+ * object means every default.
4646
+ */
4647
+ block_binding?: BetaThinkingBlockBinding | null;
4648
+
4561
4649
  /**
4562
4650
  * Controls how thinking content appears in the response. When set to `summarized`,
4563
4651
  * thinking is returned normally. When set to `omitted`, thinking content is
@@ -4587,6 +4675,13 @@ export interface BetaThinkingConfigEnabled {
4587
4675
 
4588
4676
  type: 'enabled';
4589
4677
 
4678
+ /**
4679
+ * Controls for block binding: what happens when a thinking block this request
4680
+ * sends back fails the conversation check. Every field is optional; an empty
4681
+ * object means every default.
4682
+ */
4683
+ block_binding?: BetaThinkingBlockBinding | null;
4684
+
4590
4685
  /**
4591
4686
  * Controls how thinking content appears in the response. When set to `summarized`,
4592
4687
  * thinking is returned normally. When set to `omitted`, thinking content is
@@ -4635,6 +4730,50 @@ export interface BetaThinkingDelta {
4635
4730
  type: 'thinking_delta';
4636
4731
  }
4637
4732
 
4733
+ export interface BetaThinkingDroppedInputTransformation {
4734
+ /**
4735
+ * Where the removed block was in your request, as `messages.{i}.content.{j}`: `i`
4736
+ * indexes the `messages` array you sent and `j` that message's `content` array —
4737
+ * the same form error messages use.
4738
+ */
4739
+ path: string;
4740
+
4741
+ /**
4742
+ * Which binding check removed the block: `model_binding_mismatch` — it was created
4743
+ * by a model whose reasoning the requested model may not read;
4744
+ * `prefix_binding_mismatch` — the conversation before it differs from the
4745
+ * conversation it was created in (the rest of that turn's consecutive thinking
4746
+ * blocks are removed with it, each with this reason);
4747
+ * `organization_binding_mismatch` — it was created under a different organization
4748
+ * (an Anthropic organization, AWS account or Google Cloud project) and this
4749
+ * organization is not one of its additional organizations;
4750
+ * `end_user_binding_mismatch` — it was created for a different end user, or was
4751
+ * removed by the consumer-organization binding. A block that would fail several
4752
+ * checks reports one reason, in this order of precedence:
4753
+ * `organization_binding_mismatch`, `end_user_binding_mismatch`,
4754
+ * `model_binding_mismatch`, `prefix_binding_mismatch`.
4755
+ */
4756
+ reason:
4757
+ | 'model_binding_mismatch'
4758
+ | 'prefix_binding_mismatch'
4759
+ | 'organization_binding_mismatch'
4760
+ | 'end_user_binding_mismatch';
4761
+
4762
+ /**
4763
+ * Always `thinking_dropped` for this entry type.
4764
+ */
4765
+ type: 'thinking_dropped';
4766
+ }
4767
+
4768
+ /**
4769
+ * What happens when a thinking block in `messages` fails the conversation check:
4770
+ * it was created in a different conversation, or the messages before it have
4771
+ * changed since. `"error"` (the default) fails the request with a 400 error.
4772
+ * `"drop_block"` removes the failing blocks and the request proceeds; the model no
4773
+ * longer sees the dropped reasoning.
4774
+ */
4775
+ export type BetaThinkingPrefixMismatchBehavior = 'error' | 'drop_block';
4776
+
4638
4777
  export interface BetaThinkingTurns {
4639
4778
  type: 'thinking_turns';
4640
4779
 
@@ -6537,6 +6676,16 @@ export interface MessageCreateParamsBase {
6537
6676
  * beta header.
6538
6677
  */
6539
6678
  user_profile_id?: string;
6679
+
6680
+ /**
6681
+ * Header param: Optional header to select the Workspace for this request. The
6682
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
6683
+ *
6684
+ * Only needed for credentials that can act on more than one Workspace. A
6685
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
6686
+ * match that Workspace.
6687
+ */
6688
+ workspace_id?: string;
6540
6689
  }
6541
6690
 
6542
6691
  export namespace MessageCreateParams {
@@ -6835,6 +6984,16 @@ export interface MessageCountTokensParams {
6835
6984
  * beta header.
6836
6985
  */
6837
6986
  user_profile_id?: string;
6987
+
6988
+ /**
6989
+ * Header param: Optional header to select the Workspace for this request. The
6990
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
6991
+ *
6992
+ * Only needed for credentials that can act on more than one Workspace. A
6993
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
6994
+ * match that Workspace.
6995
+ */
6996
+ workspace_id?: string;
6838
6997
  }
6839
6998
 
6840
6999
  export { BetaToolRunner, type BetaToolRunnerParams } from '../../../lib/tools/BetaToolRunner';
@@ -7060,6 +7219,7 @@ export declare namespace Messages {
7060
7219
  type BetaSignatureDelta as BetaSignatureDelta,
7061
7220
  type BetaSkillParams as BetaSkillParams,
7062
7221
  type BetaStopReason as BetaStopReason,
7222
+ type BetaSystemMessageOutputConfig as BetaSystemMessageOutputConfig,
7063
7223
  type BetaTextBlock as BetaTextBlock,
7064
7224
  type BetaTextBlockParam as BetaTextBlockParam,
7065
7225
  type BetaTextCitation as BetaTextCitation,
@@ -7076,12 +7236,15 @@ export declare namespace Messages {
7076
7236
  type BetaTextEditorCodeExecutionViewResultBlock as BetaTextEditorCodeExecutionViewResultBlock,
7077
7237
  type BetaTextEditorCodeExecutionViewResultBlockParam as BetaTextEditorCodeExecutionViewResultBlockParam,
7078
7238
  type BetaThinkingBlock as BetaThinkingBlock,
7239
+ type BetaThinkingBlockBinding as BetaThinkingBlockBinding,
7079
7240
  type BetaThinkingBlockParam as BetaThinkingBlockParam,
7080
7241
  type BetaThinkingConfigAdaptive as BetaThinkingConfigAdaptive,
7081
7242
  type BetaThinkingConfigDisabled as BetaThinkingConfigDisabled,
7082
7243
  type BetaThinkingConfigEnabled as BetaThinkingConfigEnabled,
7083
7244
  type BetaThinkingConfigParam as BetaThinkingConfigParam,
7084
7245
  type BetaThinkingDelta as BetaThinkingDelta,
7246
+ type BetaThinkingDroppedInputTransformation as BetaThinkingDroppedInputTransformation,
7247
+ type BetaThinkingPrefixMismatchBehavior as BetaThinkingPrefixMismatchBehavior,
7085
7248
  type BetaThinkingTurns as BetaThinkingTurns,
7086
7249
  type BetaTokenTaskBudget as BetaTokenTaskBudget,
7087
7250
  type BetaTool as BetaTool,
@@ -27,11 +27,14 @@ export class Models extends APIResource {
27
27
  params: ModelRetrieveParams | null | undefined = {},
28
28
  options?: RequestOptions,
29
29
  ): APIPromise<BetaModelInfo> {
30
- const { betas } = params ?? {};
30
+ const { betas, workspace_id } = params ?? {};
31
31
  return this._client.get(path`/v1/models/${modelID}?beta=true`, {
32
32
  ...options,
33
33
  headers: buildHeaders([
34
- { ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
34
+ {
35
+ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined),
36
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
37
+ },
35
38
  options?.headers,
36
39
  ]),
37
40
  });
@@ -55,12 +58,15 @@ export class Models extends APIResource {
55
58
  params: ModelListParams | null | undefined = {},
56
59
  options?: RequestOptions,
57
60
  ): PagePromise<BetaModelInfosPage, BetaModelInfo> {
58
- const { betas, ...query } = params ?? {};
61
+ const { betas, workspace_id, ...query } = params ?? {};
59
62
  return this._client.getAPIList('/v1/models?beta=true', Page<BetaModelInfo>, {
60
63
  query,
61
64
  ...options,
62
65
  headers: buildHeaders([
63
- { ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
66
+ {
67
+ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined),
68
+ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
69
+ },
64
70
  options?.headers,
65
71
  ]),
66
72
  });
@@ -271,6 +277,16 @@ export interface ModelRetrieveParams {
271
277
  * Optional header to specify the beta version(s) you want to use.
272
278
  */
273
279
  betas?: Array<BetaAPI.AnthropicBeta>;
280
+
281
+ /**
282
+ * Optional header to select the Workspace for this request. The value is a
283
+ * Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
284
+ *
285
+ * Only needed for credentials that can act on more than one Workspace. A
286
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
287
+ * match that Workspace.
288
+ */
289
+ workspace_id?: string;
274
290
  }
275
291
 
276
292
  export interface ModelListParams extends PageParams {
@@ -278,6 +294,16 @@ export interface ModelListParams extends PageParams {
278
294
  * Header param: Optional header to specify the beta version(s) you want to use.
279
295
  */
280
296
  betas?: Array<BetaAPI.AnthropicBeta>;
297
+
298
+ /**
299
+ * Header param: Optional header to select the Workspace for this request. The
300
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
301
+ *
302
+ * Only needed for credentials that can act on more than one Workspace. A
303
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
304
+ * match that Workspace.
305
+ */
306
+ workspace_id?: string;
281
307
  }
282
308
 
283
309
  export declare namespace Models {