@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
@@ -0,0 +1,177 @@
1
+ import { APIResource } from "../../../core/resource.js";
2
+ import { APIPromise } from "../../../core/api-promise.js";
3
+ import { Page, type PageParams, PagePromise } from "../../../core/pagination.js";
4
+ import { RequestOptions } from "../../../internal/request-options.js";
5
+ export declare class APIKeys extends APIResource {
6
+ /**
7
+ * Get API Key
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const betaAPIKey =
12
+ * await client.beta.organization.apiKeys.retrieve(
13
+ * 'api_key_id',
14
+ * );
15
+ * ```
16
+ */
17
+ retrieve(apiKeyID: string, options?: RequestOptions): APIPromise<BetaAPIKey>;
18
+ /**
19
+ * Update API Key
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * const betaAPIKey =
24
+ * await client.beta.organization.apiKeys.update(
25
+ * 'api_key_id',
26
+ * );
27
+ * ```
28
+ */
29
+ update(apiKeyID: string, body: APIKeyUpdateParams, options?: RequestOptions): APIPromise<BetaAPIKey>;
30
+ /**
31
+ * List API Keys
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * // Automatically fetches more pages as needed.
36
+ * for await (const betaAPIKey of client.beta.organization.apiKeys.list()) {
37
+ * // ...
38
+ * }
39
+ * ```
40
+ */
41
+ list(query?: APIKeyListParams | null | undefined, options?: RequestOptions): PagePromise<BetaAPIKeysPage, BetaAPIKey>;
42
+ }
43
+ export type BetaAPIKeysPage = Page<BetaAPIKey>;
44
+ export interface BetaAPIKey {
45
+ /**
46
+ * ID of the API key.
47
+ */
48
+ id: string;
49
+ /**
50
+ * RFC 3339 datetime string indicating when the API Key was created.
51
+ */
52
+ created_at: string;
53
+ /**
54
+ * The ID and type of the actor that created the API key, or `null` when the
55
+ * creator is not recorded (legacy, workload-identity-federated, or system-created
56
+ * keys).
57
+ */
58
+ created_by: BetaAPIKeyCreatedBy | null;
59
+ /**
60
+ * RFC 3339 datetime string indicating when the API Key expires, or `null` if it
61
+ * never expires.
62
+ */
63
+ expires_at: string | null;
64
+ /**
65
+ * Name of the API key.
66
+ */
67
+ name: string;
68
+ /**
69
+ * Partially redacted hint for the API key.
70
+ */
71
+ partial_key_hint: string | null;
72
+ /**
73
+ * The principal the API key acts as (a User or a Service Account), or `null` if
74
+ * the API key is not bound to a principal.
75
+ */
76
+ principal: BetaAPIKeyUserActor | BetaAPIKeyServiceAccountActor | null;
77
+ /**
78
+ * Where the API key belongs: its Workspace
79
+ * (`{"type": "workspace", "workspace_id": "wrkspc_..."}`, with the Workspace's
80
+ * real ID even when it is the organization's default Workspace), or the
81
+ * organization (`{"type": "organization"}`) for a principal-bound API key that has
82
+ * no Workspace.
83
+ */
84
+ scope: BetaAPIKeyOrganizationScope | BetaAPIKeyWorkspaceScope;
85
+ /**
86
+ * Status of the API key.
87
+ */
88
+ status: 'active' | 'archived' | 'expired' | 'inactive';
89
+ /**
90
+ * Object type.
91
+ *
92
+ * For API Keys, this is always `"api_key"`.
93
+ */
94
+ type: 'api_key';
95
+ /**
96
+ * @deprecated Use `scope` instead. `workspace_id` is `null` both for an API key in
97
+ * the default Workspace and for a principal-bound API key that has no Workspace.
98
+ */
99
+ workspace_id: string | null;
100
+ }
101
+ export interface BetaAPIKeyCreatedBy {
102
+ /**
103
+ * ID of the actor that created the object.
104
+ */
105
+ id: string;
106
+ /**
107
+ * Type of the actor that created the object.
108
+ */
109
+ type: 'service_account' | 'user';
110
+ }
111
+ export interface BetaAPIKeyOrganizationScope {
112
+ /**
113
+ * Scope type. Always `"organization"`: the API key has no Workspace. Only a
114
+ * principal-bound API key can have this scope.
115
+ */
116
+ type: 'organization';
117
+ }
118
+ export interface BetaAPIKeyServiceAccountActor {
119
+ /**
120
+ * ID of the Service Account the API key acts as.
121
+ */
122
+ service_account_id: string;
123
+ /**
124
+ * Principal type. Always `"service_account_actor"` for a Service Account.
125
+ */
126
+ type: 'service_account_actor';
127
+ }
128
+ export interface BetaAPIKeyUserActor {
129
+ /**
130
+ * Principal type. Always `"user_actor"` for a User.
131
+ */
132
+ type: 'user_actor';
133
+ /**
134
+ * ID of the User the API key acts as.
135
+ */
136
+ user_id: string;
137
+ }
138
+ export interface BetaAPIKeyWorkspaceScope {
139
+ /**
140
+ * Scope type. Always `"workspace"`: the API key belongs to one Workspace.
141
+ */
142
+ type: 'workspace';
143
+ /**
144
+ * ID of the Workspace the API key belongs to. Unlike the deprecated top-level
145
+ * `workspace_id`, this is the Workspace's real ID even for the organization's
146
+ * default Workspace.
147
+ */
148
+ workspace_id: string;
149
+ }
150
+ export interface APIKeyUpdateParams {
151
+ /**
152
+ * Name of the API key.
153
+ */
154
+ name?: string | null;
155
+ /**
156
+ * Status of the API key.
157
+ */
158
+ status?: 'active' | 'archived' | 'inactive' | null;
159
+ }
160
+ export interface APIKeyListParams extends PageParams {
161
+ /**
162
+ * Filter by the ID of the User who created the object.
163
+ */
164
+ created_by_user_id?: string | null;
165
+ /**
166
+ * Filter by API key status.
167
+ */
168
+ status?: 'active' | 'archived' | 'expired' | 'inactive' | null;
169
+ /**
170
+ * Filter by Workspace ID.
171
+ */
172
+ workspace_id?: string | null;
173
+ }
174
+ export declare namespace APIKeys {
175
+ export { type BetaAPIKey as BetaAPIKey, type BetaAPIKeyCreatedBy as BetaAPIKeyCreatedBy, type BetaAPIKeyOrganizationScope as BetaAPIKeyOrganizationScope, type BetaAPIKeyServiceAccountActor as BetaAPIKeyServiceAccountActor, type BetaAPIKeyUserActor as BetaAPIKeyUserActor, type BetaAPIKeyWorkspaceScope as BetaAPIKeyWorkspaceScope, type BetaAPIKeysPage as BetaAPIKeysPage, type APIKeyUpdateParams as APIKeyUpdateParams, type APIKeyListParams as APIKeyListParams, };
176
+ }
177
+ //# sourceMappingURL=api-keys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-keys.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/organization/api-keys.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,kCAA+B;AACrD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2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.APIKeys = void 0;
5
+ const resource_1 = require("../../../core/resource.js");
6
+ const pagination_1 = require("../../../core/pagination.js");
7
+ const path_1 = require("../../../internal/utils/path.js");
8
+ class APIKeys extends resource_1.APIResource {
9
+ /**
10
+ * Get API Key
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const betaAPIKey =
15
+ * await client.beta.organization.apiKeys.retrieve(
16
+ * 'api_key_id',
17
+ * );
18
+ * ```
19
+ */
20
+ retrieve(apiKeyID, options) {
21
+ return this._client.get((0, path_1.path) `/v1/organizations/api_keys/${apiKeyID}?beta=true`, options);
22
+ }
23
+ /**
24
+ * Update API Key
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * const betaAPIKey =
29
+ * await client.beta.organization.apiKeys.update(
30
+ * 'api_key_id',
31
+ * );
32
+ * ```
33
+ */
34
+ update(apiKeyID, body, options) {
35
+ return this._client.post((0, path_1.path) `/v1/organizations/api_keys/${apiKeyID}?beta=true`, { body, ...options });
36
+ }
37
+ /**
38
+ * List API Keys
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * // Automatically fetches more pages as needed.
43
+ * for await (const betaAPIKey of client.beta.organization.apiKeys.list()) {
44
+ * // ...
45
+ * }
46
+ * ```
47
+ */
48
+ list(query = {}, options) {
49
+ return this._client.getAPIList('/v1/organizations/api_keys?beta=true', (pagination_1.Page), {
50
+ query,
51
+ ...options,
52
+ });
53
+ }
54
+ }
55
+ exports.APIKeys = APIKeys;
56
+ //# sourceMappingURL=api-keys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-keys.js","sourceRoot":"","sources":["../../../src/resources/beta/organization/api-keys.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAErD,4DAA8E;AAE9E,0DAAoD;AAEpD,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,QAAgB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,8BAA8B,QAAQ,YAAY,EAAE,OAAO,CAAC,CAAC;IAC3F,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,QAAgB,EAAE,IAAwB,EAAE,OAAwB;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,8BAA8B,QAAQ,YAAY,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzG,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,sCAAsC,EAAE,CAAA,iBAAgB,CAAA,EAAE;YACvF,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF;AAnDD,0BAmDC"}
@@ -0,0 +1,52 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../../core/resource.mjs";
3
+ import { Page } from "../../../core/pagination.mjs";
4
+ import { path } from "../../../internal/utils/path.mjs";
5
+ export class APIKeys extends APIResource {
6
+ /**
7
+ * Get API Key
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const betaAPIKey =
12
+ * await client.beta.organization.apiKeys.retrieve(
13
+ * 'api_key_id',
14
+ * );
15
+ * ```
16
+ */
17
+ retrieve(apiKeyID, options) {
18
+ return this._client.get(path `/v1/organizations/api_keys/${apiKeyID}?beta=true`, options);
19
+ }
20
+ /**
21
+ * Update API Key
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const betaAPIKey =
26
+ * await client.beta.organization.apiKeys.update(
27
+ * 'api_key_id',
28
+ * );
29
+ * ```
30
+ */
31
+ update(apiKeyID, body, options) {
32
+ return this._client.post(path `/v1/organizations/api_keys/${apiKeyID}?beta=true`, { body, ...options });
33
+ }
34
+ /**
35
+ * List API Keys
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * // Automatically fetches more pages as needed.
40
+ * for await (const betaAPIKey of client.beta.organization.apiKeys.list()) {
41
+ * // ...
42
+ * }
43
+ * ```
44
+ */
45
+ list(query = {}, options) {
46
+ return this._client.getAPIList('/v1/organizations/api_keys?beta=true', (Page), {
47
+ query,
48
+ ...options,
49
+ });
50
+ }
51
+ }
52
+ //# sourceMappingURL=api-keys.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-keys.mjs","sourceRoot":"","sources":["../../../src/resources/beta/organization/api-keys.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,mCAA+B;AAErD,OAAO,EAAE,IAAI,EAAgC,qCAAiC;AAE9E,OAAO,EAAE,IAAI,EAAE,yCAAqC;AAEpD,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,QAAgB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,8BAA8B,QAAQ,YAAY,EAAE,OAAO,CAAC,CAAC;IAC3F,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,QAAgB,EAAE,IAAwB,EAAE,OAAwB;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,8BAA8B,QAAQ,YAAY,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzG,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,sCAAsC,EAAE,CAAA,IAAgB,CAAA,EAAE;YACvF,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,269 @@
1
+ import { APIResource } from "../../../core/resource.mjs";
2
+ import { APIPromise } from "../../../core/api-promise.mjs";
3
+ import { PageCursor, type PageCursorParams, PagePromise } from "../../../core/pagination.mjs";
4
+ import { RequestOptions } from "../../../internal/request-options.mjs";
5
+ export declare class ExternalKeys extends APIResource {
6
+ /**
7
+ * Create an external key config owned by the caller's organization.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const betaExternalKey =
12
+ * await client.beta.organization.externalKeys.create({
13
+ * provider_config: {
14
+ * kms_arn:
15
+ * 'arn:aws:kms:us-east-1:111122223333:key/abcd1234-5678-90ab-cdef-000011112222',
16
+ * type: 'aws',
17
+ * },
18
+ * });
19
+ * ```
20
+ */
21
+ create(body: ExternalKeyCreateParams, options?: RequestOptions): APIPromise<BetaExternalKey>;
22
+ /**
23
+ * Retrieve a single external key config in the caller's organization by ID.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * const betaExternalKey =
28
+ * await client.beta.organization.externalKeys.retrieve(
29
+ * 'external_key_id',
30
+ * );
31
+ * ```
32
+ */
33
+ retrieve(externalKeyID: string, options?: RequestOptions): APIPromise<BetaExternalKey>;
34
+ /**
35
+ * Partially update an external key config. Omitted fields are left unchanged.
36
+ *
37
+ * `display_name` is always editable. `geo` and `provider_config` cannot be changed
38
+ * once any workspace references this config, because previously encrypted data
39
+ * requires the original key identity to decrypt.
40
+ *
41
+ * @example
42
+ * ```ts
43
+ * const betaExternalKey =
44
+ * await client.beta.organization.externalKeys.update(
45
+ * 'external_key_id',
46
+ * );
47
+ * ```
48
+ */
49
+ update(externalKeyID: string, body: ExternalKeyUpdateParams, options?: RequestOptions): APIPromise<BetaExternalKey>;
50
+ /**
51
+ * List external key configs in the caller's organization.
52
+ *
53
+ * Results are ordered by creation time (newest first). Use the `next_page` cursor
54
+ * from the response to fetch subsequent pages.
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * // Automatically fetches more pages as needed.
59
+ * for await (const betaExternalKey of client.beta.organization.externalKeys.list()) {
60
+ * // ...
61
+ * }
62
+ * ```
63
+ */
64
+ list(query?: ExternalKeyListParams | null | undefined, options?: RequestOptions): PagePromise<BetaExternalKeysPageCursor, BetaExternalKey>;
65
+ /**
66
+ * Delete an external key config.
67
+ *
68
+ * The request is rejected if any workspace still references this config.
69
+ *
70
+ * @example
71
+ * ```ts
72
+ * const externalKey =
73
+ * await client.beta.organization.externalKeys.delete(
74
+ * 'external_key_id',
75
+ * );
76
+ * ```
77
+ */
78
+ delete(externalKeyID: string, options?: RequestOptions): APIPromise<ExternalKeyDeleteResponse>;
79
+ /**
80
+ * Validate an external key config against the customer's KMS.
81
+ *
82
+ * Anthropic performs an encrypt/decrypt roundtrip against the configured KMS key
83
+ * and waits up to 30 seconds for the result. The response status is `success` if
84
+ * the roundtrip succeeded, or `failure` with an error message if it failed or
85
+ * timed out.
86
+ *
87
+ * @example
88
+ * ```ts
89
+ * const response =
90
+ * await client.beta.organization.externalKeys.validate(
91
+ * 'external_key_id',
92
+ * );
93
+ * ```
94
+ */
95
+ validate(externalKeyID: string, options?: RequestOptions): APIPromise<ExternalKeyValidateResponse>;
96
+ }
97
+ export type BetaExternalKeysPageCursor = PageCursor<BetaExternalKey>;
98
+ export interface BetaAWSExternalKeyConfig {
99
+ /**
100
+ * Full ARN of the AWS KMS key.
101
+ */
102
+ kms_arn: string;
103
+ type: 'aws';
104
+ /**
105
+ * AWS region. Derived from `kms_arn` if omitted.
106
+ */
107
+ region?: string | null;
108
+ /**
109
+ * @deprecated IAM role ARN. Deprecated — Anthropic reaches the KMS key via a
110
+ * managed intermediate role; this field is ignored.
111
+ */
112
+ role_arn?: string | null;
113
+ }
114
+ export interface BetaAzureExternalKeyConfig {
115
+ /**
116
+ * Name of the key within the vault.
117
+ */
118
+ key_name: string;
119
+ /**
120
+ * Azure AD tenant ID.
121
+ */
122
+ tenant_id: string;
123
+ type: 'azure';
124
+ /**
125
+ * Key Vault data-plane URI — `https://{vault-name}.vault.azure.net` or
126
+ * `https://{hsm-name}.managedhsm.azure.net`.
127
+ */
128
+ vault_uri: string;
129
+ /**
130
+ * Azure AD application (client) ID. Omit to use Anthropic's multitenant app.
131
+ * Provide only if using a single-tenant app registration in the customer's
132
+ * directory.
133
+ */
134
+ client_id?: string | null;
135
+ }
136
+ /**
137
+ * Azure Key Vault provider configuration.
138
+ */
139
+ export interface BetaAzureExternalKeyConfigParam {
140
+ /**
141
+ * Name of the key within the vault.
142
+ */
143
+ key_name: string;
144
+ /**
145
+ * Azure AD tenant ID.
146
+ */
147
+ tenant_id: string;
148
+ type: 'azure';
149
+ /**
150
+ * Key Vault data-plane URI — `https://{vault-name}.vault.azure.net` or
151
+ * `https://{hsm-name}.managedhsm.azure.net`.
152
+ */
153
+ vault_uri: string;
154
+ /**
155
+ * Azure AD application (client) ID. Omit to use Anthropic's multitenant app.
156
+ * Provide only if using a single-tenant app registration in the customer's
157
+ * directory.
158
+ */
159
+ client_id?: string | null;
160
+ }
161
+ /**
162
+ * CMEK external key config belonging to the caller's organization.
163
+ *
164
+ * Configs are organization-scoped. Workspaces attach to a config; once any
165
+ * workspace references it, the provider fields become effectively immutable
166
+ * (existing encrypted data needs the config for decrypt).
167
+ */
168
+ export interface BetaExternalKey {
169
+ /**
170
+ * Identifier of the external key config. A tagged ID prefixed `ekey_`, or — for
171
+ * organizations on the Claude Platform on AWS — the AWS KMS key ARN.
172
+ */
173
+ id: string;
174
+ /**
175
+ * Whether any workspace uses this config to encrypt its data — counting live and
176
+ * archived workspaces (an archived workspace's data remains encrypted under the
177
+ * config), excluding deleted ones. Only an attached config is used by the
178
+ * encryption path; an `unattached` config is inert and can be deleted.
179
+ */
180
+ attachment: BetaExternalKeyAttachedAttachment | BetaExternalKeyUnattachedAttachment;
181
+ created_at: string;
182
+ /**
183
+ * Human-friendly display name. Null if none was set.
184
+ */
185
+ display_name: string | null;
186
+ /**
187
+ * Data residency geo. Selects which regional validator handles this key's
188
+ * encrypt/decrypt roundtrips.
189
+ */
190
+ geo: string;
191
+ /**
192
+ * KMS provider identity and auth coordinates.
193
+ */
194
+ provider_config: BetaAWSExternalKeyConfig | BetaGCPExternalKeyConfig | BetaAzureExternalKeyConfig;
195
+ type: 'external_key';
196
+ updated_at: string;
197
+ }
198
+ export interface BetaExternalKeyAttachedAttachment {
199
+ type: 'attached';
200
+ }
201
+ export interface BetaExternalKeyUnattachedAttachment {
202
+ type: 'unattached';
203
+ }
204
+ export interface BetaGCPExternalKeyConfig {
205
+ /**
206
+ * Full resource name of the Cloud KMS key.
207
+ */
208
+ key_name: string;
209
+ type: 'gcp';
210
+ }
211
+ export interface ExternalKeyDeleteResponse {
212
+ /**
213
+ * ID of the deleted External Key.
214
+ */
215
+ id: string;
216
+ type: 'external_key_deleted';
217
+ }
218
+ /**
219
+ * Result of a validation roundtrip against the customer's KMS.
220
+ *
221
+ * HTTP 200 for both outcomes — the operation completed; `status` says whether the
222
+ * key works.
223
+ */
224
+ export interface ExternalKeyValidateResponse {
225
+ /**
226
+ * Error message when status is `failure`. Null otherwise.
227
+ */
228
+ error: string | null;
229
+ /**
230
+ * `success` — encrypt/decrypt roundtrip succeeded. `failure` — the roundtrip
231
+ * failed or timed out; see `error`.
232
+ */
233
+ status: 'failure' | 'success';
234
+ type: 'external_key_validation';
235
+ }
236
+ export interface ExternalKeyCreateParams {
237
+ /**
238
+ * KMS provider identity and auth coordinates.
239
+ */
240
+ provider_config: BetaAWSExternalKeyConfig | BetaGCPExternalKeyConfig | BetaAzureExternalKeyConfigParam;
241
+ /**
242
+ * Human-friendly display name.
243
+ */
244
+ display_name?: string | null;
245
+ /**
246
+ * Data residency geo. Only `us` is supported.
247
+ */
248
+ geo?: 'us';
249
+ }
250
+ export interface ExternalKeyUpdateParams {
251
+ /**
252
+ * Human-friendly display name.
253
+ */
254
+ display_name?: string | null;
255
+ /**
256
+ * Data residency geo. Only `us` is supported.
257
+ */
258
+ geo?: 'us' | null;
259
+ /**
260
+ * KMS provider identity and auth coordinates.
261
+ */
262
+ provider_config?: BetaAWSExternalKeyConfig | BetaGCPExternalKeyConfig | BetaAzureExternalKeyConfigParam | null;
263
+ }
264
+ export interface ExternalKeyListParams extends PageCursorParams {
265
+ }
266
+ export declare namespace ExternalKeys {
267
+ export { type BetaAWSExternalKeyConfig as BetaAWSExternalKeyConfig, type BetaAzureExternalKeyConfig as BetaAzureExternalKeyConfig, type BetaAzureExternalKeyConfigParam as BetaAzureExternalKeyConfigParam, type BetaExternalKey as BetaExternalKey, type BetaExternalKeyAttachedAttachment as BetaExternalKeyAttachedAttachment, type BetaExternalKeyUnattachedAttachment as BetaExternalKeyUnattachedAttachment, type BetaGCPExternalKeyConfig as BetaGCPExternalKeyConfig, type ExternalKeyDeleteResponse as ExternalKeyDeleteResponse, type ExternalKeyValidateResponse as ExternalKeyValidateResponse, type BetaExternalKeysPageCursor as BetaExternalKeysPageCursor, type ExternalKeyCreateParams as ExternalKeyCreateParams, type ExternalKeyUpdateParams as ExternalKeyUpdateParams, type ExternalKeyListParams as ExternalKeyListParams, };
268
+ }
269
+ //# sourceMappingURL=external-keys.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"external-keys.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/organization/external-keys.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mCAA+B;AACrD,OAAO,EAAE,UAAU,EAAE,sCAAkC;AACvD,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE,qCAAiC;AAC1F,OAAO,EAAE,cAAc,EAAE,8CAA0C;AAGn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