@anthropic-ai/sdk 0.119.0 → 0.121.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 (466) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/helpers/beta/environments.d.mts +5 -4
  3. package/helpers/beta/environments.d.mts.map +1 -1
  4. package/helpers/beta/environments.d.ts +5 -4
  5. package/helpers/beta/environments.d.ts.map +1 -1
  6. package/helpers/beta/environments.js +5 -4
  7. package/helpers/beta/environments.js.map +1 -1
  8. package/helpers/beta/environments.mjs +5 -4
  9. package/helpers/beta/environments.mjs.map +1 -1
  10. package/helpers/beta/standard-schema.d.mts +45 -0
  11. package/helpers/beta/standard-schema.d.mts.map +1 -0
  12. package/helpers/beta/standard-schema.d.ts +45 -0
  13. package/helpers/beta/standard-schema.d.ts.map +1 -0
  14. package/helpers/beta/standard-schema.js +58 -0
  15. package/helpers/beta/standard-schema.js.map +1 -0
  16. package/helpers/beta/standard-schema.mjs +54 -0
  17. package/helpers/beta/standard-schema.mjs.map +1 -0
  18. package/internal/detect-platform.js +1 -1
  19. package/internal/detect-platform.js.map +1 -1
  20. package/internal/detect-platform.mjs +1 -1
  21. package/internal/detect-platform.mjs.map +1 -1
  22. package/internal/file-store.d.mts +136 -0
  23. package/internal/file-store.d.mts.map +1 -0
  24. package/internal/file-store.d.ts +136 -0
  25. package/internal/file-store.d.ts.map +1 -0
  26. package/internal/file-store.js +531 -0
  27. package/internal/file-store.js.map +1 -0
  28. package/internal/file-store.mjs +523 -0
  29. package/internal/file-store.mjs.map +1 -0
  30. package/internal/utils/values.d.mts +6 -0
  31. package/internal/utils/values.d.mts.map +1 -1
  32. package/internal/utils/values.d.ts +6 -0
  33. package/internal/utils/values.d.ts.map +1 -1
  34. package/internal/utils/values.js +7 -0
  35. package/internal/utils/values.js.map +1 -1
  36. package/internal/utils/values.mjs +6 -0
  37. package/internal/utils/values.mjs.map +1 -1
  38. package/lib/BetaMessageStream.d.mts.map +1 -1
  39. package/lib/BetaMessageStream.d.ts.map +1 -1
  40. package/lib/BetaMessageStream.js +3 -4
  41. package/lib/BetaMessageStream.js.map +1 -1
  42. package/lib/BetaMessageStream.mjs +1 -2
  43. package/lib/BetaMessageStream.mjs.map +1 -1
  44. package/lib/MessageStream.d.mts.map +1 -1
  45. package/lib/MessageStream.d.ts.map +1 -1
  46. package/lib/MessageStream.js +3 -4
  47. package/lib/MessageStream.js.map +1 -1
  48. package/lib/MessageStream.mjs +1 -2
  49. package/lib/MessageStream.mjs.map +1 -1
  50. package/lib/environments/poller.d.mts +6 -0
  51. package/lib/environments/poller.d.mts.map +1 -1
  52. package/lib/environments/poller.d.ts +6 -0
  53. package/lib/environments/poller.d.ts.map +1 -1
  54. package/lib/environments/poller.js +46 -1
  55. package/lib/environments/poller.js.map +1 -1
  56. package/lib/environments/poller.mjs +46 -1
  57. package/lib/environments/poller.mjs.map +1 -1
  58. package/lib/environments/worker.d.mts +89 -12
  59. package/lib/environments/worker.d.mts.map +1 -1
  60. package/lib/environments/worker.d.ts +89 -12
  61. package/lib/environments/worker.d.ts.map +1 -1
  62. package/lib/environments/worker.js +336 -67
  63. package/lib/environments/worker.js.map +1 -1
  64. package/lib/environments/worker.mjs +336 -68
  65. package/lib/environments/worker.mjs.map +1 -1
  66. package/lib/sessions/accumulate.d.mts.map +1 -1
  67. package/lib/sessions/accumulate.d.ts.map +1 -1
  68. package/lib/sessions/accumulate.js +3 -4
  69. package/lib/sessions/accumulate.js.map +1 -1
  70. package/lib/sessions/accumulate.mjs +1 -2
  71. package/lib/sessions/accumulate.mjs.map +1 -1
  72. package/lib/standard-schema.d.mts +131 -0
  73. package/lib/standard-schema.d.mts.map +1 -0
  74. package/lib/standard-schema.d.ts +131 -0
  75. package/lib/standard-schema.d.ts.map +1 -0
  76. package/lib/standard-schema.js +45 -0
  77. package/lib/standard-schema.js.map +1 -0
  78. package/lib/standard-schema.mjs +41 -0
  79. package/lib/standard-schema.mjs.map +1 -0
  80. package/lib/tools/BetaToolRunner.d.mts.map +1 -1
  81. package/lib/tools/BetaToolRunner.d.ts.map +1 -1
  82. package/lib/tools/BetaToolRunner.js +35 -6
  83. package/lib/tools/BetaToolRunner.js.map +1 -1
  84. package/lib/tools/BetaToolRunner.mjs +35 -6
  85. package/lib/tools/BetaToolRunner.mjs.map +1 -1
  86. package/package.json +2 -11
  87. package/resources/beta/agents/agents.d.mts +322 -27
  88. package/resources/beta/agents/agents.d.mts.map +1 -1
  89. package/resources/beta/agents/agents.d.ts +322 -27
  90. package/resources/beta/agents/agents.d.ts.map +1 -1
  91. package/resources/beta/agents/agents.js.map +1 -1
  92. package/resources/beta/agents/agents.mjs.map +1 -1
  93. package/resources/beta/agents/index.d.mts +1 -1
  94. package/resources/beta/agents/index.d.mts.map +1 -1
  95. package/resources/beta/agents/index.d.ts +1 -1
  96. package/resources/beta/agents/index.d.ts.map +1 -1
  97. package/resources/beta/agents/index.js.map +1 -1
  98. package/resources/beta/agents/index.mjs.map +1 -1
  99. package/resources/beta/beta.d.mts +7 -3
  100. package/resources/beta/beta.d.mts.map +1 -1
  101. package/resources/beta/beta.d.ts +7 -3
  102. package/resources/beta/beta.d.ts.map +1 -1
  103. package/resources/beta/beta.js +4 -0
  104. package/resources/beta/beta.js.map +1 -1
  105. package/resources/beta/beta.mjs +4 -0
  106. package/resources/beta/beta.mjs.map +1 -1
  107. package/resources/beta/environments/environments.d.mts +8 -1
  108. package/resources/beta/environments/environments.d.mts.map +1 -1
  109. package/resources/beta/environments/environments.d.ts +8 -1
  110. package/resources/beta/environments/environments.d.ts.map +1 -1
  111. package/resources/beta/environments/environments.js.map +1 -1
  112. package/resources/beta/environments/environments.mjs.map +1 -1
  113. package/resources/beta/environments/work.d.mts +5 -1
  114. package/resources/beta/environments/work.d.mts.map +1 -1
  115. package/resources/beta/environments/work.d.ts +5 -1
  116. package/resources/beta/environments/work.d.ts.map +1 -1
  117. package/resources/beta/environments/work.js +0 -17
  118. package/resources/beta/environments/work.js.map +1 -1
  119. package/resources/beta/environments/work.mjs +0 -17
  120. package/resources/beta/environments/work.mjs.map +1 -1
  121. package/resources/beta/index.d.mts +2 -1
  122. package/resources/beta/index.d.mts.map +1 -1
  123. package/resources/beta/index.d.ts +2 -1
  124. package/resources/beta/index.d.ts.map +1 -1
  125. package/resources/beta/index.js +11 -9
  126. package/resources/beta/index.js.map +1 -1
  127. package/resources/beta/index.mjs +1 -0
  128. package/resources/beta/index.mjs.map +1 -1
  129. package/resources/beta/memory-stores/memories.d.mts +6 -5
  130. package/resources/beta/memory-stores/memories.d.mts.map +1 -1
  131. package/resources/beta/memory-stores/memories.d.ts +6 -5
  132. package/resources/beta/memory-stores/memories.d.ts.map +1 -1
  133. package/resources/beta/memory-stores/memory-versions.d.mts +8 -5
  134. package/resources/beta/memory-stores/memory-versions.d.mts.map +1 -1
  135. package/resources/beta/memory-stores/memory-versions.d.ts +8 -5
  136. package/resources/beta/memory-stores/memory-versions.d.ts.map +1 -1
  137. package/resources/beta/messages/messages.d.mts +51 -9
  138. package/resources/beta/messages/messages.d.mts.map +1 -1
  139. package/resources/beta/messages/messages.d.ts +51 -9
  140. package/resources/beta/messages/messages.d.ts.map +1 -1
  141. package/resources/beta/messages/messages.js.map +1 -1
  142. package/resources/beta/messages/messages.mjs.map +1 -1
  143. package/resources/beta/organization/api-keys.d.mts +177 -0
  144. package/resources/beta/organization/api-keys.d.mts.map +1 -0
  145. package/resources/beta/organization/api-keys.d.ts +177 -0
  146. package/resources/beta/organization/api-keys.d.ts.map +1 -0
  147. package/resources/beta/organization/api-keys.js +56 -0
  148. package/resources/beta/organization/api-keys.js.map +1 -0
  149. package/resources/beta/organization/api-keys.mjs +52 -0
  150. package/resources/beta/organization/api-keys.mjs.map +1 -0
  151. package/resources/beta/organization/external-keys.d.mts +269 -0
  152. package/resources/beta/organization/external-keys.d.mts.map +1 -0
  153. package/resources/beta/organization/external-keys.d.ts +269 -0
  154. package/resources/beta/organization/external-keys.d.ts.map +1 -0
  155. package/resources/beta/organization/external-keys.js +119 -0
  156. package/resources/beta/organization/external-keys.js.map +1 -0
  157. package/resources/beta/organization/external-keys.mjs +115 -0
  158. package/resources/beta/organization/external-keys.mjs.map +1 -0
  159. package/resources/beta/organization/federation/federation.d.mts +14 -0
  160. package/resources/beta/organization/federation/federation.d.mts.map +1 -0
  161. package/resources/beta/organization/federation/federation.d.ts +14 -0
  162. package/resources/beta/organization/federation/federation.d.ts.map +1 -0
  163. package/resources/beta/organization/federation/federation.js +21 -0
  164. package/resources/beta/organization/federation/federation.js.map +1 -0
  165. package/resources/beta/organization/federation/federation.mjs +16 -0
  166. package/resources/beta/organization/federation/federation.mjs.map +1 -0
  167. package/resources/beta/organization/federation/index.d.mts +4 -0
  168. package/resources/beta/organization/federation/index.d.mts.map +1 -0
  169. package/resources/beta/organization/federation/index.d.ts +4 -0
  170. package/resources/beta/organization/federation/index.d.ts.map +1 -0
  171. package/resources/beta/organization/federation/index.js +11 -0
  172. package/resources/beta/organization/federation/index.js.map +1 -0
  173. package/resources/beta/organization/federation/index.mjs +5 -0
  174. package/resources/beta/organization/federation/index.mjs.map +1 -0
  175. package/resources/beta/organization/federation/issuers.d.mts +353 -0
  176. package/resources/beta/organization/federation/issuers.d.mts.map +1 -0
  177. package/resources/beta/organization/federation/issuers.d.ts +353 -0
  178. package/resources/beta/organization/federation/issuers.d.ts.map +1 -0
  179. package/resources/beta/organization/federation/issuers.js +169 -0
  180. package/resources/beta/organization/federation/issuers.js.map +1 -0
  181. package/resources/beta/organization/federation/issuers.mjs +165 -0
  182. package/resources/beta/organization/federation/issuers.mjs.map +1 -0
  183. package/resources/beta/organization/federation/rules/index.d.mts +3 -0
  184. package/resources/beta/organization/federation/rules/index.d.mts.map +1 -0
  185. package/resources/beta/organization/federation/rules/index.d.ts +3 -0
  186. package/resources/beta/organization/federation/rules/index.d.ts.map +1 -0
  187. package/resources/beta/organization/federation/rules/index.js +9 -0
  188. package/resources/beta/organization/federation/rules/index.js.map +1 -0
  189. package/resources/beta/organization/federation/rules/index.mjs +4 -0
  190. package/resources/beta/organization/federation/rules/index.mjs.map +1 -0
  191. package/resources/beta/organization/federation/rules/rules.d.mts +468 -0
  192. package/resources/beta/organization/federation/rules/rules.d.mts.map +1 -0
  193. package/resources/beta/organization/federation/rules/rules.d.ts +468 -0
  194. package/resources/beta/organization/federation/rules/rules.d.ts.map +1 -0
  195. package/resources/beta/organization/federation/rules/rules.js +198 -0
  196. package/resources/beta/organization/federation/rules/rules.js.map +1 -0
  197. package/resources/beta/organization/federation/rules/rules.mjs +193 -0
  198. package/resources/beta/organization/federation/rules/rules.mjs.map +1 -0
  199. package/resources/beta/organization/federation/rules/workspaces.d.mts +124 -0
  200. package/resources/beta/organization/federation/rules/workspaces.d.mts.map +1 -0
  201. package/resources/beta/organization/federation/rules/workspaces.d.ts +124 -0
  202. package/resources/beta/organization/federation/rules/workspaces.d.ts.map +1 -0
  203. package/resources/beta/organization/federation/rules/workspaces.js +114 -0
  204. package/resources/beta/organization/federation/rules/workspaces.js.map +1 -0
  205. package/resources/beta/organization/federation/rules/workspaces.mjs +110 -0
  206. package/resources/beta/organization/federation/rules/workspaces.mjs.map +1 -0
  207. package/resources/beta/organization/federation/rules.d.mts +2 -0
  208. package/resources/beta/organization/federation/rules.d.mts.map +1 -0
  209. package/resources/beta/organization/federation/rules.d.ts +2 -0
  210. package/resources/beta/organization/federation/rules.d.ts.map +1 -0
  211. package/resources/beta/organization/federation/rules.js +6 -0
  212. package/resources/beta/organization/federation/rules.js.map +1 -0
  213. package/resources/beta/organization/federation/rules.mjs +3 -0
  214. package/resources/beta/organization/federation/rules.mjs.map +1 -0
  215. package/resources/beta/organization/federation.d.mts +2 -0
  216. package/resources/beta/organization/federation.d.mts.map +1 -0
  217. package/resources/beta/organization/federation.d.ts +2 -0
  218. package/resources/beta/organization/federation.d.ts.map +1 -0
  219. package/resources/beta/organization/federation.js +6 -0
  220. package/resources/beta/organization/federation.js.map +1 -0
  221. package/resources/beta/organization/federation.mjs +3 -0
  222. package/resources/beta/organization/federation.mjs.map +1 -0
  223. package/resources/beta/organization/index.d.mts +10 -0
  224. package/resources/beta/organization/index.d.mts.map +1 -0
  225. package/resources/beta/organization/index.d.ts +10 -0
  226. package/resources/beta/organization/index.d.ts.map +1 -0
  227. package/resources/beta/organization/index.js +23 -0
  228. package/resources/beta/organization/index.js.map +1 -0
  229. package/resources/beta/organization/index.mjs +11 -0
  230. package/resources/beta/organization/index.mjs.map +1 -0
  231. package/resources/beta/organization/invites.d.mts +162 -0
  232. package/resources/beta/organization/invites.d.mts.map +1 -0
  233. package/resources/beta/organization/invites.d.ts +162 -0
  234. package/resources/beta/organization/invites.d.ts.map +1 -0
  235. package/resources/beta/organization/invites.js +76 -0
  236. package/resources/beta/organization/invites.js.map +1 -0
  237. package/resources/beta/organization/invites.mjs +72 -0
  238. package/resources/beta/organization/invites.mjs.map +1 -0
  239. package/resources/beta/organization/organization.d.mts +69 -0
  240. package/resources/beta/organization/organization.d.mts.map +1 -0
  241. package/resources/beta/organization/organization.d.ts +69 -0
  242. package/resources/beta/organization/organization.d.ts.map +1 -0
  243. package/resources/beta/organization/organization.js +58 -0
  244. package/resources/beta/organization/organization.js.map +1 -0
  245. package/resources/beta/organization/organization.mjs +53 -0
  246. package/resources/beta/organization/organization.mjs.map +1 -0
  247. package/resources/beta/organization/rate-limits.d.mts +78 -0
  248. package/resources/beta/organization/rate-limits.d.mts.map +1 -0
  249. package/resources/beta/organization/rate-limits.d.ts +78 -0
  250. package/resources/beta/organization/rate-limits.d.ts.map +1 -0
  251. package/resources/beta/organization/rate-limits.js +32 -0
  252. package/resources/beta/organization/rate-limits.js.map +1 -0
  253. package/resources/beta/organization/rate-limits.mjs +28 -0
  254. package/resources/beta/organization/rate-limits.mjs.map +1 -0
  255. package/resources/beta/organization/service-accounts/index.d.mts +3 -0
  256. package/resources/beta/organization/service-accounts/index.d.mts.map +1 -0
  257. package/resources/beta/organization/service-accounts/index.d.ts +3 -0
  258. package/resources/beta/organization/service-accounts/index.d.ts.map +1 -0
  259. package/resources/beta/organization/service-accounts/index.js +9 -0
  260. package/resources/beta/organization/service-accounts/index.js.map +1 -0
  261. package/resources/beta/organization/service-accounts/index.mjs +4 -0
  262. package/resources/beta/organization/service-accounts/index.mjs.map +1 -0
  263. package/resources/beta/organization/service-accounts/service-accounts.d.mts +258 -0
  264. package/resources/beta/organization/service-accounts/service-accounts.d.mts.map +1 -0
  265. package/resources/beta/organization/service-accounts/service-accounts.d.ts +258 -0
  266. package/resources/beta/organization/service-accounts/service-accounts.d.ts.map +1 -0
  267. package/resources/beta/organization/service-accounts/service-accounts.js +174 -0
  268. package/resources/beta/organization/service-accounts/service-accounts.js.map +1 -0
  269. package/resources/beta/organization/service-accounts/service-accounts.mjs +169 -0
  270. package/resources/beta/organization/service-accounts/service-accounts.mjs.map +1 -0
  271. package/resources/beta/organization/service-accounts/workspaces.d.mts +141 -0
  272. package/resources/beta/organization/service-accounts/workspaces.d.mts.map +1 -0
  273. package/resources/beta/organization/service-accounts/workspaces.d.ts +141 -0
  274. package/resources/beta/organization/service-accounts/workspaces.d.ts.map +1 -0
  275. package/resources/beta/organization/service-accounts/workspaces.js +125 -0
  276. package/resources/beta/organization/service-accounts/workspaces.js.map +1 -0
  277. package/resources/beta/organization/service-accounts/workspaces.mjs +121 -0
  278. package/resources/beta/organization/service-accounts/workspaces.mjs.map +1 -0
  279. package/resources/beta/organization/service-accounts.d.mts +2 -0
  280. package/resources/beta/organization/service-accounts.d.mts.map +1 -0
  281. package/resources/beta/organization/service-accounts.d.ts +2 -0
  282. package/resources/beta/organization/service-accounts.d.ts.map +1 -0
  283. package/resources/beta/organization/service-accounts.js +6 -0
  284. package/resources/beta/organization/service-accounts.js.map +1 -0
  285. package/resources/beta/organization/service-accounts.mjs +3 -0
  286. package/resources/beta/organization/service-accounts.mjs.map +1 -0
  287. package/resources/beta/organization/users.d.mts +124 -0
  288. package/resources/beta/organization/users.d.mts.map +1 -0
  289. package/resources/beta/organization/users.d.ts +124 -0
  290. package/resources/beta/organization/users.d.ts.map +1 -0
  291. package/resources/beta/organization/users.js +67 -0
  292. package/resources/beta/organization/users.js.map +1 -0
  293. package/resources/beta/organization/users.mjs +63 -0
  294. package/resources/beta/organization/users.mjs.map +1 -0
  295. package/resources/beta/organization/workspaces/index.d.mts +5 -0
  296. package/resources/beta/organization/workspaces/index.d.mts.map +1 -0
  297. package/resources/beta/organization/workspaces/index.d.ts +5 -0
  298. package/resources/beta/organization/workspaces/index.d.ts.map +1 -0
  299. package/resources/beta/organization/workspaces/index.js +13 -0
  300. package/resources/beta/organization/workspaces/index.js.map +1 -0
  301. package/resources/beta/organization/workspaces/index.mjs +6 -0
  302. package/resources/beta/organization/workspaces/index.mjs.map +1 -0
  303. package/resources/beta/organization/workspaces/members.d.mts +135 -0
  304. package/resources/beta/organization/workspaces/members.d.mts.map +1 -0
  305. package/resources/beta/organization/workspaces/members.d.ts +135 -0
  306. package/resources/beta/organization/workspaces/members.d.ts.map +1 -0
  307. package/resources/beta/organization/workspaces/members.js +102 -0
  308. package/resources/beta/organization/workspaces/members.js.map +1 -0
  309. package/resources/beta/organization/workspaces/members.mjs +98 -0
  310. package/resources/beta/organization/workspaces/members.mjs.map +1 -0
  311. package/resources/beta/organization/workspaces/rate-limits.d.mts +84 -0
  312. package/resources/beta/organization/workspaces/rate-limits.d.mts.map +1 -0
  313. package/resources/beta/organization/workspaces/rate-limits.d.ts +84 -0
  314. package/resources/beta/organization/workspaces/rate-limits.d.ts.map +1 -0
  315. package/resources/beta/organization/workspaces/rate-limits.js +35 -0
  316. package/resources/beta/organization/workspaces/rate-limits.js.map +1 -0
  317. package/resources/beta/organization/workspaces/rate-limits.mjs +31 -0
  318. package/resources/beta/organization/workspaces/rate-limits.mjs.map +1 -0
  319. package/resources/beta/organization/workspaces/service-accounts.d.mts +210 -0
  320. package/resources/beta/organization/workspaces/service-accounts.d.mts.map +1 -0
  321. package/resources/beta/organization/workspaces/service-accounts.d.ts +210 -0
  322. package/resources/beta/organization/workspaces/service-accounts.d.ts.map +1 -0
  323. package/resources/beta/organization/workspaces/service-accounts.js +189 -0
  324. package/resources/beta/organization/workspaces/service-accounts.js.map +1 -0
  325. package/resources/beta/organization/workspaces/service-accounts.mjs +185 -0
  326. package/resources/beta/organization/workspaces/service-accounts.mjs.map +1 -0
  327. package/resources/beta/organization/workspaces/workspaces.d.mts +287 -0
  328. package/resources/beta/organization/workspaces/workspaces.d.mts.map +1 -0
  329. package/resources/beta/organization/workspaces/workspaces.d.ts +287 -0
  330. package/resources/beta/organization/workspaces/workspaces.d.ts.map +1 -0
  331. package/resources/beta/organization/workspaces/workspaces.js +112 -0
  332. package/resources/beta/organization/workspaces/workspaces.js.map +1 -0
  333. package/resources/beta/organization/workspaces/workspaces.mjs +107 -0
  334. package/resources/beta/organization/workspaces/workspaces.mjs.map +1 -0
  335. package/resources/beta/organization/workspaces.d.mts +2 -0
  336. package/resources/beta/organization/workspaces.d.mts.map +1 -0
  337. package/resources/beta/organization/workspaces.d.ts +2 -0
  338. package/resources/beta/organization/workspaces.d.ts.map +1 -0
  339. package/resources/beta/organization/workspaces.js +6 -0
  340. package/resources/beta/organization/workspaces.js.map +1 -0
  341. package/resources/beta/organization/workspaces.mjs +3 -0
  342. package/resources/beta/organization/workspaces.mjs.map +1 -0
  343. package/resources/beta/organization.d.mts +2 -0
  344. package/resources/beta/organization.d.mts.map +1 -0
  345. package/resources/beta/organization.d.ts +2 -0
  346. package/resources/beta/organization.d.ts.map +1 -0
  347. package/resources/beta/organization.js +6 -0
  348. package/resources/beta/organization.js.map +1 -0
  349. package/resources/beta/organization.mjs +3 -0
  350. package/resources/beta/organization.mjs.map +1 -0
  351. package/resources/beta/sessions/threads/threads.d.mts +2 -1
  352. package/resources/beta/sessions/threads/threads.d.mts.map +1 -1
  353. package/resources/beta/sessions/threads/threads.d.ts +2 -1
  354. package/resources/beta/sessions/threads/threads.d.ts.map +1 -1
  355. package/resources/beta/sessions/threads/threads.js.map +1 -1
  356. package/resources/beta/sessions/threads/threads.mjs.map +1 -1
  357. package/resources/messages/messages.d.mts +1 -1
  358. package/resources/messages/messages.d.ts +1 -1
  359. package/src/helpers/beta/environments.ts +5 -4
  360. package/src/helpers/beta/standard-schema.ts +99 -0
  361. package/src/internal/detect-platform.ts +1 -1
  362. package/src/internal/file-store.ts +550 -0
  363. package/src/internal/utils/values.ts +7 -0
  364. package/src/lib/BetaMessageStream.ts +1 -3
  365. package/src/lib/MessageStream.ts +1 -3
  366. package/src/lib/environments/poller.ts +47 -1
  367. package/src/lib/environments/worker.ts +419 -79
  368. package/src/lib/sessions/accumulate.ts +1 -3
  369. package/src/lib/standard-schema.ts +209 -0
  370. package/src/lib/tools/BetaToolRunner.ts +38 -6
  371. package/src/resources/beta/agents/agents.ts +435 -30
  372. package/src/resources/beta/agents/index.ts +17 -0
  373. package/src/resources/beta/beta.ts +52 -1
  374. package/src/resources/beta/environments/environments.ts +8 -1
  375. package/src/resources/beta/environments/work.ts +7 -0
  376. package/src/resources/beta/index.ts +18 -0
  377. package/src/resources/beta/memory-stores/memories.ts +6 -5
  378. package/src/resources/beta/memory-stores/memory-versions.ts +8 -5
  379. package/src/resources/beta/messages/messages.ts +51 -9
  380. package/src/resources/beta/organization/api-keys.ts +231 -0
  381. package/src/resources/beta/organization/external-keys.ts +362 -0
  382. package/src/resources/beta/organization/federation/federation.ts +71 -0
  383. package/src/resources/beta/organization/federation/index.ts +31 -0
  384. package/src/resources/beta/organization/federation/issuers.ts +486 -0
  385. package/src/resources/beta/organization/federation/rules/index.ts +23 -0
  386. package/src/resources/beta/organization/federation/rules/rules.ts +624 -0
  387. package/src/resources/beta/organization/federation/rules/workspaces.ts +196 -0
  388. package/src/resources/beta/organization/federation/rules.ts +3 -0
  389. package/src/resources/beta/organization/federation.ts +3 -0
  390. package/src/resources/beta/organization/index.ts +83 -0
  391. package/src/resources/beta/organization/invites.ts +207 -0
  392. package/src/resources/beta/organization/organization.ts +245 -0
  393. package/src/resources/beta/organization/rate-limits.ts +105 -0
  394. package/src/resources/beta/organization/service-accounts/index.ts +21 -0
  395. package/src/resources/beta/organization/service-accounts/service-accounts.ts +389 -0
  396. package/src/resources/beta/organization/service-accounts/workspaces.ts +217 -0
  397. package/src/resources/beta/organization/service-accounts.ts +3 -0
  398. package/src/resources/beta/organization/users.ts +163 -0
  399. package/src/resources/beta/organization/workspaces/index.ts +43 -0
  400. package/src/resources/beta/organization/workspaces/members.ts +209 -0
  401. package/src/resources/beta/organization/workspaces/rate-limits.ts +114 -0
  402. package/src/resources/beta/organization/workspaces/service-accounts.ts +325 -0
  403. package/src/resources/beta/organization/workspaces/workspaces.ts +434 -0
  404. package/src/resources/beta/organization/workspaces.ts +3 -0
  405. package/src/resources/beta/organization.ts +3 -0
  406. package/src/resources/beta/sessions/threads/threads.ts +2 -1
  407. package/src/resources/messages/messages.ts +1 -1
  408. package/src/tools/agent-toolset/fs-util.ts +40 -24
  409. package/src/tools/agent-toolset/memories.ts +1017 -0
  410. package/src/tools/agent-toolset/node.browser.ts +69 -1
  411. package/src/tools/agent-toolset/node.ts +143 -57
  412. package/src/tools/agent-toolset/skills.ts +29 -9
  413. package/src/tools/agent-toolset/sync-interval.ts +30 -0
  414. package/src/version.ts +1 -1
  415. package/tools/agent-toolset/fs-util.d.mts +23 -10
  416. package/tools/agent-toolset/fs-util.d.mts.map +1 -1
  417. package/tools/agent-toolset/fs-util.d.ts +23 -10
  418. package/tools/agent-toolset/fs-util.d.ts.map +1 -1
  419. package/tools/agent-toolset/fs-util.js +40 -25
  420. package/tools/agent-toolset/fs-util.js.map +1 -1
  421. package/tools/agent-toolset/fs-util.mjs +38 -25
  422. package/tools/agent-toolset/fs-util.mjs.map +1 -1
  423. package/tools/agent-toolset/memories.d.mts +173 -0
  424. package/tools/agent-toolset/memories.d.mts.map +1 -0
  425. package/tools/agent-toolset/memories.d.ts +173 -0
  426. package/tools/agent-toolset/memories.d.ts.map +1 -0
  427. package/tools/agent-toolset/memories.js +902 -0
  428. package/tools/agent-toolset/memories.js.map +1 -0
  429. package/tools/agent-toolset/memories.mjs +895 -0
  430. package/tools/agent-toolset/memories.mjs.map +1 -0
  431. package/tools/agent-toolset/node.browser.d.mts +32 -1
  432. package/tools/agent-toolset/node.browser.d.mts.map +1 -1
  433. package/tools/agent-toolset/node.browser.d.ts +32 -1
  434. package/tools/agent-toolset/node.browser.d.ts.map +1 -1
  435. package/tools/agent-toolset/node.browser.js +59 -1
  436. package/tools/agent-toolset/node.browser.js.map +1 -1
  437. package/tools/agent-toolset/node.browser.mjs +54 -0
  438. package/tools/agent-toolset/node.browser.mjs.map +1 -1
  439. package/tools/agent-toolset/node.d.mts +56 -24
  440. package/tools/agent-toolset/node.d.mts.map +1 -1
  441. package/tools/agent-toolset/node.d.ts +56 -24
  442. package/tools/agent-toolset/node.d.ts.map +1 -1
  443. package/tools/agent-toolset/node.js +83 -44
  444. package/tools/agent-toolset/node.js.map +1 -1
  445. package/tools/agent-toolset/node.mjs +77 -44
  446. package/tools/agent-toolset/node.mjs.map +1 -1
  447. package/tools/agent-toolset/skills.d.mts +16 -7
  448. package/tools/agent-toolset/skills.d.mts.map +1 -1
  449. package/tools/agent-toolset/skills.d.ts +16 -7
  450. package/tools/agent-toolset/skills.d.ts.map +1 -1
  451. package/tools/agent-toolset/skills.js +27 -9
  452. package/tools/agent-toolset/skills.js.map +1 -1
  453. package/tools/agent-toolset/skills.mjs +27 -9
  454. package/tools/agent-toolset/skills.mjs.map +1 -1
  455. package/tools/agent-toolset/sync-interval.d.mts +19 -0
  456. package/tools/agent-toolset/sync-interval.d.mts.map +1 -0
  457. package/tools/agent-toolset/sync-interval.d.ts +19 -0
  458. package/tools/agent-toolset/sync-interval.d.ts.map +1 -0
  459. package/tools/agent-toolset/sync-interval.js +29 -0
  460. package/tools/agent-toolset/sync-interval.js.map +1 -0
  461. package/tools/agent-toolset/sync-interval.mjs +25 -0
  462. package/tools/agent-toolset/sync-interval.mjs.map +1 -0
  463. package/version.d.mts +1 -1
  464. package/version.d.ts +1 -1
  465. package/version.js +1 -1
  466. package/version.mjs +1 -1
@@ -218,16 +218,24 @@ import {
218
218
  BetaManagedAgentsAlwaysAskPolicy,
219
219
  BetaManagedAgentsAnthropicSkill,
220
220
  BetaManagedAgentsAnthropicSkillParams,
221
+ BetaManagedAgentsBashToolConfig,
222
+ BetaManagedAgentsBashToolConfigParams,
221
223
  BetaManagedAgentsCustomSkill,
222
224
  BetaManagedAgentsCustomSkillParams,
223
225
  BetaManagedAgentsCustomTool,
224
226
  BetaManagedAgentsCustomToolInputSchema,
225
227
  BetaManagedAgentsCustomToolParams,
228
+ BetaManagedAgentsEditToolConfig,
229
+ BetaManagedAgentsEditToolConfigParams,
226
230
  BetaManagedAgentsEffortHigh,
227
231
  BetaManagedAgentsEffortLow,
228
232
  BetaManagedAgentsEffortMax,
229
233
  BetaManagedAgentsEffortMedium,
230
234
  BetaManagedAgentsEffortXhigh,
235
+ BetaManagedAgentsGlobToolConfig,
236
+ BetaManagedAgentsGlobToolConfigParams,
237
+ BetaManagedAgentsGrepToolConfig,
238
+ BetaManagedAgentsGrepToolConfigParams,
231
239
  BetaManagedAgentsMCPServerURLDefinition,
232
240
  BetaManagedAgentsMCPToolConfig,
233
241
  BetaManagedAgentsMCPToolConfigParams,
@@ -241,9 +249,18 @@ import {
241
249
  BetaManagedAgentsMultiagentCoordinator,
242
250
  BetaManagedAgentsMultiagentCoordinatorParams,
243
251
  BetaManagedAgentsMultiagentSelfParams,
252
+ BetaManagedAgentsReadToolConfig,
253
+ BetaManagedAgentsReadToolConfigParams,
244
254
  BetaManagedAgentsSessionThreadAgent,
245
255
  BetaManagedAgentsSkillParams,
246
256
  BetaManagedAgentsURLMCPServerParams,
257
+ BetaManagedAgentsUserLocation,
258
+ BetaManagedAgentsWebFetchToolConfig,
259
+ BetaManagedAgentsWebFetchToolConfigParams,
260
+ BetaManagedAgentsWebSearchToolConfig,
261
+ BetaManagedAgentsWebSearchToolConfigParams,
262
+ BetaManagedAgentsWriteToolConfig,
263
+ BetaManagedAgentsWriteToolConfigParams,
247
264
  } from './agents/agents';
248
265
  import * as EnvironmentsAPI from './environments/environments';
249
266
  import {
@@ -578,6 +595,8 @@ import {
578
595
  BetaMCPToolConfig,
579
596
  BetaMCPToolDefaultConfig,
580
597
  } from './messages/messages';
598
+ import * as OrganizationAPI from './organization/organization';
599
+ import { BetaOrganization, BetaOrganizationRole, Organization } from './organization/organization';
581
600
  import * as SessionsAPI from './sessions/sessions';
582
601
  import {
583
602
  BetaManagedAgentsAdvisorParams,
@@ -679,6 +698,7 @@ export class Beta extends APIResource {
679
698
  userProfiles: UserProfilesAPI.UserProfiles = new UserProfilesAPI.UserProfiles(this._client);
680
699
  dreams: DreamsAPI.Dreams = new DreamsAPI.Dreams(this._client);
681
700
  tunnels: TunnelsAPI.Tunnels = new TunnelsAPI.Tunnels(this._client);
701
+ organization: OrganizationAPI.Organization = new OrganizationAPI.Organization(this._client);
682
702
  }
683
703
 
684
704
  export type AnthropicBeta =
@@ -716,7 +736,14 @@ export type AnthropicBeta =
716
736
  | 'fallback-credit-2026-06-01'
717
737
  | 'fallback-credit-2026-07-01'
718
738
  | 'agent-memory-2026-07-22'
719
- | 'mid-conversation-tool-changes-2026-07-01';
739
+ | 'mid-conversation-tool-changes-2026-07-01'
740
+ | 'compact-2026-01-12'
741
+ | 'computer-use-2025-11-24'
742
+ | 'mcp-tunnels-2026-06-22'
743
+ | 'structured-outputs-2025-11-13'
744
+ | 'task-budgets-2026-03-13'
745
+ | 'thinking-display-updates-2026-08-18'
746
+ | 'ce-user-management-2026-07-13';
720
747
 
721
748
  export interface BetaAPIError {
722
749
  message: string;
@@ -827,6 +854,7 @@ Beta.Webhooks = Webhooks;
827
854
  Beta.UserProfiles = UserProfiles;
828
855
  Beta.Dreams = Dreams;
829
856
  Beta.Tunnels = Tunnels;
857
+ Beta.Organization = Organization;
830
858
 
831
859
  export declare namespace Beta {
832
860
  export {
@@ -1179,16 +1207,24 @@ export declare namespace Beta {
1179
1207
  type BetaManagedAgentsAlwaysAskPolicy as BetaManagedAgentsAlwaysAskPolicy,
1180
1208
  type BetaManagedAgentsAnthropicSkill as BetaManagedAgentsAnthropicSkill,
1181
1209
  type BetaManagedAgentsAnthropicSkillParams as BetaManagedAgentsAnthropicSkillParams,
1210
+ type BetaManagedAgentsBashToolConfig as BetaManagedAgentsBashToolConfig,
1211
+ type BetaManagedAgentsBashToolConfigParams as BetaManagedAgentsBashToolConfigParams,
1182
1212
  type BetaManagedAgentsCustomSkill as BetaManagedAgentsCustomSkill,
1183
1213
  type BetaManagedAgentsCustomSkillParams as BetaManagedAgentsCustomSkillParams,
1184
1214
  type BetaManagedAgentsCustomTool as BetaManagedAgentsCustomTool,
1185
1215
  type BetaManagedAgentsCustomToolInputSchema as BetaManagedAgentsCustomToolInputSchema,
1186
1216
  type BetaManagedAgentsCustomToolParams as BetaManagedAgentsCustomToolParams,
1217
+ type BetaManagedAgentsEditToolConfig as BetaManagedAgentsEditToolConfig,
1218
+ type BetaManagedAgentsEditToolConfigParams as BetaManagedAgentsEditToolConfigParams,
1187
1219
  type BetaManagedAgentsEffortHigh as BetaManagedAgentsEffortHigh,
1188
1220
  type BetaManagedAgentsEffortLow as BetaManagedAgentsEffortLow,
1189
1221
  type BetaManagedAgentsEffortMax as BetaManagedAgentsEffortMax,
1190
1222
  type BetaManagedAgentsEffortMedium as BetaManagedAgentsEffortMedium,
1191
1223
  type BetaManagedAgentsEffortXhigh as BetaManagedAgentsEffortXhigh,
1224
+ type BetaManagedAgentsGlobToolConfig as BetaManagedAgentsGlobToolConfig,
1225
+ type BetaManagedAgentsGlobToolConfigParams as BetaManagedAgentsGlobToolConfigParams,
1226
+ type BetaManagedAgentsGrepToolConfig as BetaManagedAgentsGrepToolConfig,
1227
+ type BetaManagedAgentsGrepToolConfigParams as BetaManagedAgentsGrepToolConfigParams,
1192
1228
  type BetaManagedAgentsMCPServerURLDefinition as BetaManagedAgentsMCPServerURLDefinition,
1193
1229
  type BetaManagedAgentsMCPToolConfig as BetaManagedAgentsMCPToolConfig,
1194
1230
  type BetaManagedAgentsMCPToolConfigParams as BetaManagedAgentsMCPToolConfigParams,
@@ -1202,9 +1238,18 @@ export declare namespace Beta {
1202
1238
  type BetaManagedAgentsMultiagentCoordinator as BetaManagedAgentsMultiagentCoordinator,
1203
1239
  type BetaManagedAgentsMultiagentCoordinatorParams as BetaManagedAgentsMultiagentCoordinatorParams,
1204
1240
  type BetaManagedAgentsMultiagentSelfParams as BetaManagedAgentsMultiagentSelfParams,
1241
+ type BetaManagedAgentsReadToolConfig as BetaManagedAgentsReadToolConfig,
1242
+ type BetaManagedAgentsReadToolConfigParams as BetaManagedAgentsReadToolConfigParams,
1205
1243
  type BetaManagedAgentsSessionThreadAgent as BetaManagedAgentsSessionThreadAgent,
1206
1244
  type BetaManagedAgentsSkillParams as BetaManagedAgentsSkillParams,
1207
1245
  type BetaManagedAgentsURLMCPServerParams as BetaManagedAgentsURLMCPServerParams,
1246
+ type BetaManagedAgentsUserLocation as BetaManagedAgentsUserLocation,
1247
+ type BetaManagedAgentsWebFetchToolConfig as BetaManagedAgentsWebFetchToolConfig,
1248
+ type BetaManagedAgentsWebFetchToolConfigParams as BetaManagedAgentsWebFetchToolConfigParams,
1249
+ type BetaManagedAgentsWebSearchToolConfig as BetaManagedAgentsWebSearchToolConfig,
1250
+ type BetaManagedAgentsWebSearchToolConfigParams as BetaManagedAgentsWebSearchToolConfigParams,
1251
+ type BetaManagedAgentsWriteToolConfig as BetaManagedAgentsWriteToolConfig,
1252
+ type BetaManagedAgentsWriteToolConfigParams as BetaManagedAgentsWriteToolConfigParams,
1208
1253
  type BetaManagedAgentsAgentsPageCursor as BetaManagedAgentsAgentsPageCursor,
1209
1254
  type AgentCreateParams as AgentCreateParams,
1210
1255
  type AgentRetrieveParams as AgentRetrieveParams,
@@ -1506,4 +1551,10 @@ export declare namespace Beta {
1506
1551
  type TunnelRevealTokenParams as TunnelRevealTokenParams,
1507
1552
  type TunnelRotateTokenParams as TunnelRotateTokenParams,
1508
1553
  };
1554
+
1555
+ export {
1556
+ Organization as Organization,
1557
+ type BetaOrganization as BetaOrganization,
1558
+ type BetaOrganizationRole as BetaOrganizationRole,
1559
+ };
1509
1560
  }
@@ -231,6 +231,9 @@ export interface BetaCloudConfigParams {
231
231
  * When versioning, use the version semantics relevant for the package manager,
232
232
  * e.g. for `pip` use `package==1.0.0`. You are responsible for validating the
233
233
  * package and version exist. Unversioned installs the latest.
234
+ *
235
+ * Under `limited` networking, requires `networking.allow_package_managers` to be
236
+ * `true`.
234
237
  */
235
238
  packages?: BetaPackagesParams | null;
236
239
  }
@@ -352,7 +355,8 @@ export interface BetaLimitedNetworkParams {
352
355
 
353
356
  /**
354
357
  * Permits outbound access to public package registries (PyPI, npm, etc.) beyond
355
- * those listed in the `allowed_hosts` array. Defaults to `false`.
358
+ * those listed in the `allowed_hosts` array. Defaults to `false` on creation. Must
359
+ * be `true` when `packages` are specified.
356
360
  */
357
361
  allow_package_managers?: boolean | null;
358
362
 
@@ -408,6 +412,9 @@ export interface BetaPackages {
408
412
  * When versioning, use the version semantics relevant for the package manager,
409
413
  * e.g. for `pip` use `package==1.0.0`. You are responsible for validating the
410
414
  * package and version exist. Unversioned installs the latest.
415
+ *
416
+ * Under `limited` networking, requires `networking.allow_package_managers` to be
417
+ * `true`.
411
418
  */
412
419
  export interface BetaPackagesParams {
413
420
  /**
@@ -302,6 +302,13 @@ export class Work extends APIResource {
302
302
  * await client.beta.environments.work.worker({ workdir: '/workspace' }).handleItem();
303
303
  * ```
304
304
  */
305
+ worker(opts: Omit<RunnerEnvironmentWorkerOptions, 'client' | 'unrestrictedPaths'>): EnvironmentWorker;
306
+ /** @deprecated `unrestrictedPaths` is no longer accepted — see {@link RunnerEnvironmentWorkerOptions.unrestrictedPaths}. */
307
+ worker(
308
+ opts: Omit<RunnerEnvironmentWorkerOptions, 'client' | 'unrestrictedPaths'> & {
309
+ unrestrictedPaths: boolean;
310
+ },
311
+ ): EnvironmentWorker; // help language servers see deprecation
305
312
  worker(opts: Omit<RunnerEnvironmentWorkerOptions, 'client'>): EnvironmentWorker {
306
313
  return new EnvironmentWorker({ ...opts, client: this._client as Anthropic });
307
314
  }
@@ -21,16 +21,24 @@ export {
21
21
  type BetaManagedAgentsAlwaysAskPolicy,
22
22
  type BetaManagedAgentsAnthropicSkill,
23
23
  type BetaManagedAgentsAnthropicSkillParams,
24
+ type BetaManagedAgentsBashToolConfig,
25
+ type BetaManagedAgentsBashToolConfigParams,
24
26
  type BetaManagedAgentsCustomSkill,
25
27
  type BetaManagedAgentsCustomSkillParams,
26
28
  type BetaManagedAgentsCustomTool,
27
29
  type BetaManagedAgentsCustomToolInputSchema,
28
30
  type BetaManagedAgentsCustomToolParams,
31
+ type BetaManagedAgentsEditToolConfig,
32
+ type BetaManagedAgentsEditToolConfigParams,
29
33
  type BetaManagedAgentsEffortHigh,
30
34
  type BetaManagedAgentsEffortLow,
31
35
  type BetaManagedAgentsEffortMax,
32
36
  type BetaManagedAgentsEffortMedium,
33
37
  type BetaManagedAgentsEffortXhigh,
38
+ type BetaManagedAgentsGlobToolConfig,
39
+ type BetaManagedAgentsGlobToolConfigParams,
40
+ type BetaManagedAgentsGrepToolConfig,
41
+ type BetaManagedAgentsGrepToolConfigParams,
34
42
  type BetaManagedAgentsMCPServerURLDefinition,
35
43
  type BetaManagedAgentsMCPToolConfig,
36
44
  type BetaManagedAgentsMCPToolConfigParams,
@@ -44,9 +52,18 @@ export {
44
52
  type BetaManagedAgentsMultiagentCoordinator,
45
53
  type BetaManagedAgentsMultiagentCoordinatorParams,
46
54
  type BetaManagedAgentsMultiagentSelfParams,
55
+ type BetaManagedAgentsReadToolConfig,
56
+ type BetaManagedAgentsReadToolConfigParams,
47
57
  type BetaManagedAgentsSessionThreadAgent,
48
58
  type BetaManagedAgentsSkillParams,
49
59
  type BetaManagedAgentsURLMCPServerParams,
60
+ type BetaManagedAgentsUserLocation,
61
+ type BetaManagedAgentsWebFetchToolConfig,
62
+ type BetaManagedAgentsWebFetchToolConfigParams,
63
+ type BetaManagedAgentsWebSearchToolConfig,
64
+ type BetaManagedAgentsWebSearchToolConfigParams,
65
+ type BetaManagedAgentsWriteToolConfig,
66
+ type BetaManagedAgentsWriteToolConfigParams,
50
67
  type AgentCreateParams,
51
68
  type AgentRetrieveParams,
52
69
  type AgentUpdateParams,
@@ -531,6 +548,7 @@ export {
531
548
  type ModelListParams,
532
549
  type BetaModelInfosPage,
533
550
  } from './models';
551
+ export { Organization, type BetaOrganization, type BetaOrganizationRole } from './organization/index';
534
552
  export {
535
553
  Sessions,
536
554
  type BetaManagedAgentsAdvisorParams,
@@ -187,10 +187,11 @@ export interface BetaManagedAgentsContentSha256Precondition {
187
187
 
188
188
  /**
189
189
  * Tombstone returned by
190
- * [Delete a memory](/en/api/beta/memory_stores/memories/delete). The memory's
191
- * version history persists and remains listable via
192
- * [List memory versions](/en/api/beta/memory_stores/memory_versions/list) until
193
- * the store itself is deleted.
190
+ * [Delete a memory](/en/api/beta/memory_stores/memories/delete). Deleting a memory
191
+ * does not erase its version history: its versions remain listable via
192
+ * [List memory versions](/en/api/beta/memory_stores/memory_versions/list) while
193
+ * they are retained (each version is kept for at least the version retention
194
+ * period after it was written, unless the store itself is deleted).
194
195
  */
195
196
  export interface BetaManagedAgentsDeletedMemory {
196
197
  /**
@@ -258,7 +259,7 @@ export interface BetaManagedAgentsMemory {
258
259
  * ID of the `memory_version` representing this memory's current content (a
259
260
  * `memver_...` value). This is the authoritative head pointer; `memory_version`
260
261
  * objects do not carry an `is_latest` flag, so compare against this field instead.
261
- * Enumerate the full history via
262
+ * Enumerate the history via
262
263
  * [List memory versions](/en/api/beta/memory_stores/memory_versions/list).
263
264
  */
264
265
  memory_version_id: string;
@@ -137,10 +137,12 @@ export interface BetaManagedAgentsAPIActor {
137
137
  /**
138
138
  * A `memory_version` object: one immutable, attributed row in a memory's
139
139
  * append-only history. Every non-no-op mutation to a memory produces a new
140
- * version. Versions belong to the store (not the individual memory) and persist
141
- * after the memory is deleted. Retrieving a redacted version returns 200 with
142
- * `content`, `path`, `content_size_bytes`, and `content_sha256` set to `null`;
143
- * branch on `redacted_at`, not HTTP status.
140
+ * version. Versions belong to the store (not the individual memory) and are not
141
+ * deleted with the memory; each version is retained for at least the version
142
+ * retention period after it was written, unless the store itself is deleted.
143
+ * Retrieving a redacted version returns 200 with `content`, `path`,
144
+ * `content_size_bytes`, and `content_sha256` set to `null`; branch on
145
+ * `redacted_at`, not HTTP status.
144
146
  */
145
147
  export interface BetaManagedAgentsMemoryVersion {
146
148
  /**
@@ -157,7 +159,8 @@ export interface BetaManagedAgentsMemoryVersion {
157
159
  * ID of the memory this version snapshots (a `mem_...` value). Remains valid after
158
160
  * the memory is deleted; pass it as `memory_id` to
159
161
  * [List memory versions](/en/api/beta/memory_stores/memory_versions/list) to
160
- * retrieve the full lineage including the `deleted` row.
162
+ * retrieve the memory's retained versions, including the `deleted` row while the
163
+ * lineage is retained.
161
164
  */
162
165
  memory_id: string;
163
166
 
@@ -3256,11 +3256,25 @@ export interface BetaInputTokensTrigger {
3256
3256
  * Per-iteration token usage breakdown.
3257
3257
  *
3258
3258
  * Each entry represents one sampling iteration, with its own input/output token
3259
- * counts and cache statistics. This allows you to:
3259
+ * counts and cache statistics, discriminated by `type`. For `message` entries
3260
+ * (model sampling iterations, such as the turns of a server-side tool use loop),
3261
+ * this allows you to:
3260
3262
  *
3261
3263
  * - Determine which iterations exceeded long context thresholds (>=200k tokens)
3262
- * - Calculate the true context window size from the last iteration
3264
+ * - Calculate the context window size from the last `message` entry
3263
3265
  * - Understand token accumulation across server-side tool use loops
3266
+ *
3267
+ * A `compaction` entry reports the token usage of the compaction operation itself
3268
+ * — the server-side request that summarizes the context being closed — NOT the
3269
+ * size of the context that was compacted away, and its token counts can be much
3270
+ * smaller than that closed context (for example, a compaction that closes a
3271
+ * ~200k-token context can report only a few thousand tokens). Do not derive the
3272
+ * context window size from a `compaction` entry, even when it is the last entry. A
3273
+ * `compaction` entry's tokens are not included in the top-level `usage` fields.
3274
+ * When an input-token trigger is in effect (the default — 150,000 tokens unless
3275
+ * configured otherwise), each `compaction` entry closes a context that had reached
3276
+ * at least that threshold, though the context can exceed it by the final
3277
+ * iteration's output and tool results.
3264
3278
  */
3265
3279
  export type BetaIterationsUsage = Array<
3266
3280
  | BetaMessageIterationUsage
@@ -3685,11 +3699,25 @@ export interface BetaMessageDeltaUsage {
3685
3699
  * Per-iteration token usage breakdown.
3686
3700
  *
3687
3701
  * Each entry represents one sampling iteration, with its own input/output token
3688
- * counts and cache statistics. This allows you to:
3702
+ * counts and cache statistics, discriminated by `type`. For `message` entries
3703
+ * (model sampling iterations, such as the turns of a server-side tool use loop),
3704
+ * this allows you to:
3689
3705
  *
3690
3706
  * - Determine which iterations exceeded long context thresholds (>=200k tokens)
3691
- * - Calculate the true context window size from the last iteration
3707
+ * - Calculate the context window size from the last `message` entry
3692
3708
  * - Understand token accumulation across server-side tool use loops
3709
+ *
3710
+ * A `compaction` entry reports the token usage of the compaction operation itself
3711
+ * — the server-side request that summarizes the context being closed — NOT the
3712
+ * size of the context that was compacted away, and its token counts can be much
3713
+ * smaller than that closed context (for example, a compaction that closes a
3714
+ * ~200k-token context can report only a few thousand tokens). Do not derive the
3715
+ * context window size from a `compaction` entry, even when it is the last entry. A
3716
+ * `compaction` entry's tokens are not included in the top-level `usage` fields.
3717
+ * When an input-token trigger is in effect (the default — 150,000 tokens unless
3718
+ * configured otherwise), each `compaction` entry closes a context that had reached
3719
+ * at least that threshold, though the context can exceed it by the final
3720
+ * iteration's output and tool results.
3693
3721
  */
3694
3722
  iterations: BetaIterationsUsage | null;
3695
3723
 
@@ -4280,7 +4308,7 @@ export interface BetaSkill {
4280
4308
  type: 'anthropic' | 'custom';
4281
4309
 
4282
4310
  /**
4283
- * Skill version or 'latest' for most recent version
4311
+ * The resolved version: a skill version ID for custom skills.
4284
4312
  */
4285
4313
  version: string;
4286
4314
  }
@@ -4536,7 +4564,7 @@ export interface BetaThinkingConfigAdaptive {
4536
4564
  * redacted but a signature is returned for multi-turn continuity. Defaults to
4537
4565
  * `summarized`.
4538
4566
  */
4539
- display?: 'summarized' | 'omitted' | null;
4567
+ display?: 'summarized' | 'omitted' | 'updates' | null;
4540
4568
  }
4541
4569
 
4542
4570
  export interface BetaThinkingConfigDisabled {
@@ -4565,7 +4593,7 @@ export interface BetaThinkingConfigEnabled {
4565
4593
  * redacted but a signature is returned for multi-turn continuity. Defaults to
4566
4594
  * `summarized`.
4567
4595
  */
4568
- display?: 'summarized' | 'omitted' | null;
4596
+ display?: 'summarized' | 'omitted' | 'updates' | null;
4569
4597
  }
4570
4598
 
4571
4599
  /**
@@ -5460,11 +5488,25 @@ export interface BetaUsage {
5460
5488
  * Per-iteration token usage breakdown.
5461
5489
  *
5462
5490
  * Each entry represents one sampling iteration, with its own input/output token
5463
- * counts and cache statistics. This allows you to:
5491
+ * counts and cache statistics, discriminated by `type`. For `message` entries
5492
+ * (model sampling iterations, such as the turns of a server-side tool use loop),
5493
+ * this allows you to:
5464
5494
  *
5465
5495
  * - Determine which iterations exceeded long context thresholds (>=200k tokens)
5466
- * - Calculate the true context window size from the last iteration
5496
+ * - Calculate the context window size from the last `message` entry
5467
5497
  * - Understand token accumulation across server-side tool use loops
5498
+ *
5499
+ * A `compaction` entry reports the token usage of the compaction operation itself
5500
+ * — the server-side request that summarizes the context being closed — NOT the
5501
+ * size of the context that was compacted away, and its token counts can be much
5502
+ * smaller than that closed context (for example, a compaction that closes a
5503
+ * ~200k-token context can report only a few thousand tokens). Do not derive the
5504
+ * context window size from a `compaction` entry, even when it is the last entry. A
5505
+ * `compaction` entry's tokens are not included in the top-level `usage` fields.
5506
+ * When an input-token trigger is in effect (the default — 150,000 tokens unless
5507
+ * configured otherwise), each `compaction` entry closes a context that had reached
5508
+ * at least that threshold, though the context can exceed it by the final
5509
+ * iteration's output and tool results.
5468
5510
  */
5469
5511
  iterations: BetaIterationsUsage | null;
5470
5512
 
@@ -0,0 +1,231 @@
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 { Page, type PageParams, PagePromise } from '../../../core/pagination';
6
+ import { RequestOptions } from '../../../internal/request-options';
7
+ import { path } from '../../../internal/utils/path';
8
+
9
+ export class APIKeys extends APIResource {
10
+ /**
11
+ * Get API Key
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const betaAPIKey =
16
+ * await client.beta.organization.apiKeys.retrieve(
17
+ * 'api_key_id',
18
+ * );
19
+ * ```
20
+ */
21
+ retrieve(apiKeyID: string, options?: RequestOptions): APIPromise<BetaAPIKey> {
22
+ return this._client.get(path`/v1/organizations/api_keys/${apiKeyID}?beta=true`, options);
23
+ }
24
+
25
+ /**
26
+ * Update API Key
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * const betaAPIKey =
31
+ * await client.beta.organization.apiKeys.update(
32
+ * 'api_key_id',
33
+ * );
34
+ * ```
35
+ */
36
+ update(apiKeyID: string, body: APIKeyUpdateParams, options?: RequestOptions): APIPromise<BetaAPIKey> {
37
+ return this._client.post(path`/v1/organizations/api_keys/${apiKeyID}?beta=true`, { body, ...options });
38
+ }
39
+
40
+ /**
41
+ * List API Keys
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * // Automatically fetches more pages as needed.
46
+ * for await (const betaAPIKey of client.beta.organization.apiKeys.list()) {
47
+ * // ...
48
+ * }
49
+ * ```
50
+ */
51
+ list(
52
+ query: APIKeyListParams | null | undefined = {},
53
+ options?: RequestOptions,
54
+ ): PagePromise<BetaAPIKeysPage, BetaAPIKey> {
55
+ return this._client.getAPIList('/v1/organizations/api_keys?beta=true', Page<BetaAPIKey>, {
56
+ query,
57
+ ...options,
58
+ });
59
+ }
60
+ }
61
+
62
+ export type BetaAPIKeysPage = Page<BetaAPIKey>;
63
+
64
+ export interface BetaAPIKey {
65
+ /**
66
+ * ID of the API key.
67
+ */
68
+ id: string;
69
+
70
+ /**
71
+ * RFC 3339 datetime string indicating when the API Key was created.
72
+ */
73
+ created_at: string;
74
+
75
+ /**
76
+ * The ID and type of the actor that created the API key, or `null` when the
77
+ * creator is not recorded (legacy, workload-identity-federated, or system-created
78
+ * keys).
79
+ */
80
+ created_by: BetaAPIKeyCreatedBy | null;
81
+
82
+ /**
83
+ * RFC 3339 datetime string indicating when the API Key expires, or `null` if it
84
+ * never expires.
85
+ */
86
+ expires_at: string | null;
87
+
88
+ /**
89
+ * Name of the API key.
90
+ */
91
+ name: string;
92
+
93
+ /**
94
+ * Partially redacted hint for the API key.
95
+ */
96
+ partial_key_hint: string | null;
97
+
98
+ /**
99
+ * The principal the API key acts as (a User or a Service Account), or `null` if
100
+ * the API key is not bound to a principal.
101
+ */
102
+ principal: BetaAPIKeyUserActor | BetaAPIKeyServiceAccountActor | null;
103
+
104
+ /**
105
+ * Where the API key belongs: its Workspace
106
+ * (`{"type": "workspace", "workspace_id": "wrkspc_..."}`, with the Workspace's
107
+ * real ID even when it is the organization's default Workspace), or the
108
+ * organization (`{"type": "organization"}`) for a principal-bound API key that has
109
+ * no Workspace.
110
+ */
111
+ scope: BetaAPIKeyOrganizationScope | BetaAPIKeyWorkspaceScope;
112
+
113
+ /**
114
+ * Status of the API key.
115
+ */
116
+ status: 'active' | 'archived' | 'expired' | 'inactive';
117
+
118
+ /**
119
+ * Object type.
120
+ *
121
+ * For API Keys, this is always `"api_key"`.
122
+ */
123
+ type: 'api_key';
124
+
125
+ /**
126
+ * @deprecated Use `scope` instead. `workspace_id` is `null` both for an API key in
127
+ * the default Workspace and for a principal-bound API key that has no Workspace.
128
+ */
129
+ workspace_id: string | null;
130
+ }
131
+
132
+ export interface BetaAPIKeyCreatedBy {
133
+ /**
134
+ * ID of the actor that created the object.
135
+ */
136
+ id: string;
137
+
138
+ /**
139
+ * Type of the actor that created the object.
140
+ */
141
+ type: 'service_account' | 'user';
142
+ }
143
+
144
+ export interface BetaAPIKeyOrganizationScope {
145
+ /**
146
+ * Scope type. Always `"organization"`: the API key has no Workspace. Only a
147
+ * principal-bound API key can have this scope.
148
+ */
149
+ type: 'organization';
150
+ }
151
+
152
+ export interface BetaAPIKeyServiceAccountActor {
153
+ /**
154
+ * ID of the Service Account the API key acts as.
155
+ */
156
+ service_account_id: string;
157
+
158
+ /**
159
+ * Principal type. Always `"service_account_actor"` for a Service Account.
160
+ */
161
+ type: 'service_account_actor';
162
+ }
163
+
164
+ export interface BetaAPIKeyUserActor {
165
+ /**
166
+ * Principal type. Always `"user_actor"` for a User.
167
+ */
168
+ type: 'user_actor';
169
+
170
+ /**
171
+ * ID of the User the API key acts as.
172
+ */
173
+ user_id: string;
174
+ }
175
+
176
+ export interface BetaAPIKeyWorkspaceScope {
177
+ /**
178
+ * Scope type. Always `"workspace"`: the API key belongs to one Workspace.
179
+ */
180
+ type: 'workspace';
181
+
182
+ /**
183
+ * ID of the Workspace the API key belongs to. Unlike the deprecated top-level
184
+ * `workspace_id`, this is the Workspace's real ID even for the organization's
185
+ * default Workspace.
186
+ */
187
+ workspace_id: string;
188
+ }
189
+
190
+ export interface APIKeyUpdateParams {
191
+ /**
192
+ * Name of the API key.
193
+ */
194
+ name?: string | null;
195
+
196
+ /**
197
+ * Status of the API key.
198
+ */
199
+ status?: 'active' | 'archived' | 'inactive' | null;
200
+ }
201
+
202
+ export interface APIKeyListParams extends PageParams {
203
+ /**
204
+ * Filter by the ID of the User who created the object.
205
+ */
206
+ created_by_user_id?: string | null;
207
+
208
+ /**
209
+ * Filter by API key status.
210
+ */
211
+ status?: 'active' | 'archived' | 'expired' | 'inactive' | null;
212
+
213
+ /**
214
+ * Filter by Workspace ID.
215
+ */
216
+ workspace_id?: string | null;
217
+ }
218
+
219
+ export declare namespace APIKeys {
220
+ export {
221
+ type BetaAPIKey as BetaAPIKey,
222
+ type BetaAPIKeyCreatedBy as BetaAPIKeyCreatedBy,
223
+ type BetaAPIKeyOrganizationScope as BetaAPIKeyOrganizationScope,
224
+ type BetaAPIKeyServiceAccountActor as BetaAPIKeyServiceAccountActor,
225
+ type BetaAPIKeyUserActor as BetaAPIKeyUserActor,
226
+ type BetaAPIKeyWorkspaceScope as BetaAPIKeyWorkspaceScope,
227
+ type BetaAPIKeysPage as BetaAPIKeysPage,
228
+ type APIKeyUpdateParams as APIKeyUpdateParams,
229
+ type APIKeyListParams as APIKeyListParams,
230
+ };
231
+ }