@anthropic-ai/sdk 0.122.0 → 0.124.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (486) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/client.d.mts +6 -5
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +6 -5
  5. package/client.d.ts.map +1 -1
  6. package/client.js +2 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +2 -1
  9. package/client.mjs.map +1 -1
  10. package/core/credentials.d.mts.map +1 -1
  11. package/core/credentials.d.ts.map +1 -1
  12. package/core/credentials.js +5 -7
  13. package/core/credentials.js.map +1 -1
  14. package/core/credentials.mjs +5 -7
  15. package/core/credentials.mjs.map +1 -1
  16. package/core/streaming.js +4 -2
  17. package/core/streaming.js.map +1 -1
  18. package/core/streaming.mjs +4 -2
  19. package/core/streaming.mjs.map +1 -1
  20. package/internal/file-store.d.mts.map +1 -1
  21. package/internal/file-store.d.ts.map +1 -1
  22. package/internal/file-store.js +23 -25
  23. package/internal/file-store.js.map +1 -1
  24. package/internal/file-store.mjs +5 -6
  25. package/internal/file-store.mjs.map +1 -1
  26. package/internal/node.browser.d.mts +9 -0
  27. package/internal/node.browser.d.mts.map +1 -0
  28. package/internal/node.browser.d.ts +9 -0
  29. package/internal/node.browser.d.ts.map +1 -0
  30. package/internal/node.browser.js +22 -0
  31. package/internal/node.browser.js.map +1 -0
  32. package/internal/node.browser.mjs +19 -0
  33. package/internal/node.browser.mjs.map +1 -0
  34. package/internal/node.d.mts +14 -0
  35. package/internal/node.d.mts.map +1 -0
  36. package/internal/node.d.ts +14 -0
  37. package/internal/node.d.ts.map +1 -0
  38. package/internal/node.js +24 -0
  39. package/internal/node.js.map +1 -0
  40. package/internal/node.mjs +14 -0
  41. package/internal/node.mjs.map +1 -0
  42. package/lib/BetaMessageStream.d.mts.map +1 -1
  43. package/lib/BetaMessageStream.d.ts.map +1 -1
  44. package/lib/BetaMessageStream.js +3 -0
  45. package/lib/BetaMessageStream.js.map +1 -1
  46. package/lib/BetaMessageStream.mjs +3 -0
  47. package/lib/BetaMessageStream.mjs.map +1 -1
  48. package/lib/credentials/credential-chain.js +1 -1
  49. package/lib/credentials/credential-chain.js.map +1 -1
  50. package/lib/credentials/credential-chain.mjs +1 -1
  51. package/lib/credentials/credential-chain.mjs.map +1 -1
  52. package/lib/credentials/identity-token.js +1 -1
  53. package/lib/credentials/identity-token.js.map +1 -1
  54. package/lib/credentials/identity-token.mjs +1 -1
  55. package/lib/credentials/identity-token.mjs.map +1 -1
  56. package/lib/credentials/types.d.mts.map +1 -1
  57. package/lib/credentials/types.d.ts.map +1 -1
  58. package/lib/credentials/types.js +2 -3
  59. package/lib/credentials/types.js.map +1 -1
  60. package/lib/credentials/types.mjs +2 -3
  61. package/lib/credentials/types.mjs.map +1 -1
  62. package/lib/credentials/user-oauth.js +1 -1
  63. package/lib/credentials/user-oauth.js.map +1 -1
  64. package/lib/credentials/user-oauth.mjs +1 -1
  65. package/lib/credentials/user-oauth.mjs.map +1 -1
  66. package/lib/middleware.d.mts.map +1 -1
  67. package/lib/middleware.d.ts.map +1 -1
  68. package/lib/middleware.js +30 -7
  69. package/lib/middleware.js.map +1 -1
  70. package/lib/middleware.mjs +30 -7
  71. package/lib/middleware.mjs.map +1 -1
  72. package/package.json +3 -1
  73. package/resources/beta/agents/agents.d.mts +46 -1
  74. package/resources/beta/agents/agents.d.mts.map +1 -1
  75. package/resources/beta/agents/agents.d.ts +46 -1
  76. package/resources/beta/agents/agents.d.ts.map +1 -1
  77. package/resources/beta/agents/agents.js +25 -10
  78. package/resources/beta/agents/agents.js.map +1 -1
  79. package/resources/beta/agents/agents.mjs +25 -10
  80. package/resources/beta/agents/agents.mjs.map +1 -1
  81. package/resources/beta/agents/versions.d.mts +9 -0
  82. package/resources/beta/agents/versions.d.mts.map +1 -1
  83. package/resources/beta/agents/versions.d.ts +9 -0
  84. package/resources/beta/agents/versions.d.ts.map +1 -1
  85. package/resources/beta/agents/versions.js +5 -2
  86. package/resources/beta/agents/versions.js.map +1 -1
  87. package/resources/beta/agents/versions.mjs +5 -2
  88. package/resources/beta/agents/versions.mjs.map +1 -1
  89. package/resources/beta/beta.d.mts +5 -5
  90. package/resources/beta/beta.d.mts.map +1 -1
  91. package/resources/beta/beta.d.ts +5 -5
  92. package/resources/beta/beta.d.ts.map +1 -1
  93. package/resources/beta/beta.js.map +1 -1
  94. package/resources/beta/beta.mjs.map +1 -1
  95. package/resources/beta/deployment-runs.d.mts +24 -6
  96. package/resources/beta/deployment-runs.d.mts.map +1 -1
  97. package/resources/beta/deployment-runs.d.ts +24 -6
  98. package/resources/beta/deployment-runs.d.ts.map +1 -1
  99. package/resources/beta/deployment-runs.js +10 -4
  100. package/resources/beta/deployment-runs.js.map +1 -1
  101. package/resources/beta/deployment-runs.mjs +10 -4
  102. package/resources/beta/deployment-runs.mjs.map +1 -1
  103. package/resources/beta/deployments.d.mts +75 -2
  104. package/resources/beta/deployments.d.mts.map +1 -1
  105. package/resources/beta/deployments.d.ts +75 -2
  106. package/resources/beta/deployments.d.ts.map +1 -1
  107. package/resources/beta/deployments.js +40 -16
  108. package/resources/beta/deployments.js.map +1 -1
  109. package/resources/beta/deployments.mjs +40 -16
  110. package/resources/beta/deployments.mjs.map +1 -1
  111. package/resources/beta/dreams.d.mts +73 -1
  112. package/resources/beta/dreams.d.mts.map +1 -1
  113. package/resources/beta/dreams.d.ts +73 -1
  114. package/resources/beta/dreams.d.ts.map +1 -1
  115. package/resources/beta/dreams.js +25 -10
  116. package/resources/beta/dreams.js.map +1 -1
  117. package/resources/beta/dreams.mjs +25 -10
  118. package/resources/beta/dreams.mjs.map +1 -1
  119. package/resources/beta/environments/environments.d.mts +54 -0
  120. package/resources/beta/environments/environments.d.mts.map +1 -1
  121. package/resources/beta/environments/environments.d.ts +54 -0
  122. package/resources/beta/environments/environments.d.ts.map +1 -1
  123. package/resources/beta/environments/environments.js +30 -12
  124. package/resources/beta/environments/environments.js.map +1 -1
  125. package/resources/beta/environments/environments.mjs +30 -12
  126. package/resources/beta/environments/environments.mjs.map +1 -1
  127. package/resources/beta/environments/work.d.mts +36 -0
  128. package/resources/beta/environments/work.d.mts.map +1 -1
  129. package/resources/beta/environments/work.d.ts +36 -0
  130. package/resources/beta/environments/work.d.ts.map +1 -1
  131. package/resources/beta/environments/work.js +20 -8
  132. package/resources/beta/environments/work.js.map +1 -1
  133. package/resources/beta/environments/work.mjs +20 -8
  134. package/resources/beta/environments/work.mjs.map +1 -1
  135. package/resources/beta/files.d.mts +48 -1
  136. package/resources/beta/files.d.mts.map +1 -1
  137. package/resources/beta/files.d.ts +48 -1
  138. package/resources/beta/files.d.ts.map +1 -1
  139. package/resources/beta/files.js +22 -9
  140. package/resources/beta/files.js.map +1 -1
  141. package/resources/beta/files.mjs +22 -9
  142. package/resources/beta/files.mjs.map +1 -1
  143. package/resources/beta/index.d.mts +2 -2
  144. package/resources/beta/index.d.mts.map +1 -1
  145. package/resources/beta/index.d.ts +2 -2
  146. package/resources/beta/index.d.ts.map +1 -1
  147. package/resources/beta/index.js.map +1 -1
  148. package/resources/beta/index.mjs.map +1 -1
  149. package/resources/beta/memory-stores/memories.d.mts +51 -4
  150. package/resources/beta/memory-stores/memories.d.mts.map +1 -1
  151. package/resources/beta/memory-stores/memories.d.ts +51 -4
  152. package/resources/beta/memory-stores/memories.d.ts.map +1 -1
  153. package/resources/beta/memory-stores/memories.js +25 -10
  154. package/resources/beta/memory-stores/memories.js.map +1 -1
  155. package/resources/beta/memory-stores/memories.mjs +25 -10
  156. package/resources/beta/memory-stores/memories.mjs.map +1 -1
  157. package/resources/beta/memory-stores/memory-stores.d.mts +54 -0
  158. package/resources/beta/memory-stores/memory-stores.d.mts.map +1 -1
  159. package/resources/beta/memory-stores/memory-stores.d.ts +54 -0
  160. package/resources/beta/memory-stores/memory-stores.d.ts.map +1 -1
  161. package/resources/beta/memory-stores/memory-stores.js +30 -12
  162. package/resources/beta/memory-stores/memory-stores.js.map +1 -1
  163. package/resources/beta/memory-stores/memory-stores.mjs +30 -12
  164. package/resources/beta/memory-stores/memory-stores.mjs.map +1 -1
  165. package/resources/beta/memory-stores/memory-versions.d.mts +31 -4
  166. package/resources/beta/memory-stores/memory-versions.d.mts.map +1 -1
  167. package/resources/beta/memory-stores/memory-versions.d.ts +31 -4
  168. package/resources/beta/memory-stores/memory-versions.d.ts.map +1 -1
  169. package/resources/beta/memory-stores/memory-versions.js +15 -6
  170. package/resources/beta/memory-stores/memory-versions.js.map +1 -1
  171. package/resources/beta/memory-stores/memory-versions.mjs +15 -6
  172. package/resources/beta/memory-stores/memory-versions.mjs.map +1 -1
  173. package/resources/beta/messages/batches.d.mts +54 -0
  174. package/resources/beta/messages/batches.d.mts.map +1 -1
  175. package/resources/beta/messages/batches.d.ts +54 -0
  176. package/resources/beta/messages/batches.d.ts.map +1 -1
  177. package/resources/beta/messages/batches.js +25 -11
  178. package/resources/beta/messages/batches.js.map +1 -1
  179. package/resources/beta/messages/batches.mjs +25 -11
  180. package/resources/beta/messages/batches.mjs.map +1 -1
  181. package/resources/beta/messages/index.d.mts +1 -1
  182. package/resources/beta/messages/index.d.mts.map +1 -1
  183. package/resources/beta/messages/index.d.ts +1 -1
  184. package/resources/beta/messages/index.d.ts.map +1 -1
  185. package/resources/beta/messages/index.js.map +1 -1
  186. package/resources/beta/messages/index.mjs.map +1 -1
  187. package/resources/beta/messages/messages.d.mts +148 -3
  188. package/resources/beta/messages/messages.d.mts.map +1 -1
  189. package/resources/beta/messages/messages.d.ts +148 -3
  190. package/resources/beta/messages/messages.d.ts.map +1 -1
  191. package/resources/beta/messages/messages.js +4 -2
  192. package/resources/beta/messages/messages.js.map +1 -1
  193. package/resources/beta/messages/messages.mjs +4 -2
  194. package/resources/beta/messages/messages.mjs.map +1 -1
  195. package/resources/beta/models.d.mts +18 -0
  196. package/resources/beta/models.d.mts.map +1 -1
  197. package/resources/beta/models.d.ts +18 -0
  198. package/resources/beta/models.d.ts.map +1 -1
  199. package/resources/beta/models.js +10 -4
  200. package/resources/beta/models.js.map +1 -1
  201. package/resources/beta/models.mjs +10 -4
  202. package/resources/beta/models.mjs.map +1 -1
  203. package/resources/beta/organization/compliance-settings.d.mts +76 -0
  204. package/resources/beta/organization/compliance-settings.d.mts.map +1 -0
  205. package/resources/beta/organization/compliance-settings.d.ts +76 -0
  206. package/resources/beta/organization/compliance-settings.d.ts.map +1 -0
  207. package/resources/beta/organization/compliance-settings.js +52 -0
  208. package/resources/beta/organization/compliance-settings.js.map +1 -0
  209. package/resources/beta/organization/compliance-settings.mjs +48 -0
  210. package/resources/beta/organization/compliance-settings.mjs.map +1 -0
  211. package/resources/beta/organization/external-keys.d.mts +6 -3
  212. package/resources/beta/organization/external-keys.d.mts.map +1 -1
  213. package/resources/beta/organization/external-keys.d.ts +6 -3
  214. package/resources/beta/organization/external-keys.d.ts.map +1 -1
  215. package/resources/beta/organization/index.d.mts +1 -0
  216. package/resources/beta/organization/index.d.mts.map +1 -1
  217. package/resources/beta/organization/index.d.ts +1 -0
  218. package/resources/beta/organization/index.d.ts.map +1 -1
  219. package/resources/beta/organization/index.js +3 -1
  220. package/resources/beta/organization/index.js.map +1 -1
  221. package/resources/beta/organization/index.mjs +1 -0
  222. package/resources/beta/organization/index.mjs.map +1 -1
  223. package/resources/beta/organization/organization.d.mts +4 -0
  224. package/resources/beta/organization/organization.d.mts.map +1 -1
  225. package/resources/beta/organization/organization.d.ts +4 -0
  226. package/resources/beta/organization/organization.d.ts.map +1 -1
  227. package/resources/beta/organization/organization.js +4 -0
  228. package/resources/beta/organization/organization.js.map +1 -1
  229. package/resources/beta/organization/organization.mjs +4 -0
  230. package/resources/beta/organization/organization.mjs.map +1 -1
  231. package/resources/beta/organization/workspaces/workspaces.d.mts +28 -12
  232. package/resources/beta/organization/workspaces/workspaces.d.mts.map +1 -1
  233. package/resources/beta/organization/workspaces/workspaces.d.ts +28 -12
  234. package/resources/beta/organization/workspaces/workspaces.d.ts.map +1 -1
  235. package/resources/beta/organization/workspaces/workspaces.js.map +1 -1
  236. package/resources/beta/organization/workspaces/workspaces.mjs.map +1 -1
  237. package/resources/beta/sessions/events.d.mts +28 -1
  238. package/resources/beta/sessions/events.d.mts.map +1 -1
  239. package/resources/beta/sessions/events.d.ts +28 -1
  240. package/resources/beta/sessions/events.d.ts.map +1 -1
  241. package/resources/beta/sessions/events.js +15 -6
  242. package/resources/beta/sessions/events.js.map +1 -1
  243. package/resources/beta/sessions/events.mjs +15 -6
  244. package/resources/beta/sessions/events.mjs.map +1 -1
  245. package/resources/beta/sessions/resources.d.mts +45 -0
  246. package/resources/beta/sessions/resources.d.mts.map +1 -1
  247. package/resources/beta/sessions/resources.d.ts +45 -0
  248. package/resources/beta/sessions/resources.d.ts.map +1 -1
  249. package/resources/beta/sessions/resources.js +25 -10
  250. package/resources/beta/sessions/resources.js.map +1 -1
  251. package/resources/beta/sessions/resources.mjs +25 -10
  252. package/resources/beta/sessions/resources.mjs.map +1 -1
  253. package/resources/beta/sessions/sessions.d.mts +64 -10
  254. package/resources/beta/sessions/sessions.d.mts.map +1 -1
  255. package/resources/beta/sessions/sessions.d.ts +64 -10
  256. package/resources/beta/sessions/sessions.d.ts.map +1 -1
  257. package/resources/beta/sessions/sessions.js +30 -12
  258. package/resources/beta/sessions/sessions.js.map +1 -1
  259. package/resources/beta/sessions/sessions.mjs +30 -12
  260. package/resources/beta/sessions/sessions.mjs.map +1 -1
  261. package/resources/beta/sessions/threads/events.d.mts +18 -0
  262. package/resources/beta/sessions/threads/events.d.mts.map +1 -1
  263. package/resources/beta/sessions/threads/events.d.ts +18 -0
  264. package/resources/beta/sessions/threads/events.d.ts.map +1 -1
  265. package/resources/beta/sessions/threads/events.js +10 -4
  266. package/resources/beta/sessions/threads/events.js.map +1 -1
  267. package/resources/beta/sessions/threads/events.mjs +10 -4
  268. package/resources/beta/sessions/threads/events.mjs.map +1 -1
  269. package/resources/beta/sessions/threads/threads.d.mts +27 -0
  270. package/resources/beta/sessions/threads/threads.d.mts.map +1 -1
  271. package/resources/beta/sessions/threads/threads.d.ts +27 -0
  272. package/resources/beta/sessions/threads/threads.d.ts.map +1 -1
  273. package/resources/beta/sessions/threads/threads.js +15 -6
  274. package/resources/beta/sessions/threads/threads.js.map +1 -1
  275. package/resources/beta/sessions/threads/threads.mjs +15 -6
  276. package/resources/beta/sessions/threads/threads.mjs.map +1 -1
  277. package/resources/beta/skills/skills.d.mts +36 -0
  278. package/resources/beta/skills/skills.d.mts.map +1 -1
  279. package/resources/beta/skills/skills.d.ts +36 -0
  280. package/resources/beta/skills/skills.d.ts.map +1 -1
  281. package/resources/beta/skills/skills.js +20 -8
  282. package/resources/beta/skills/skills.js.map +1 -1
  283. package/resources/beta/skills/skills.mjs +20 -8
  284. package/resources/beta/skills/skills.mjs.map +1 -1
  285. package/resources/beta/skills/versions.d.mts +45 -0
  286. package/resources/beta/skills/versions.d.mts.map +1 -1
  287. package/resources/beta/skills/versions.d.ts +45 -0
  288. package/resources/beta/skills/versions.d.ts.map +1 -1
  289. package/resources/beta/skills/versions.js +22 -9
  290. package/resources/beta/skills/versions.js.map +1 -1
  291. package/resources/beta/skills/versions.mjs +22 -9
  292. package/resources/beta/skills/versions.mjs.map +1 -1
  293. package/resources/beta/tunnels/certificates.d.mts +36 -0
  294. package/resources/beta/tunnels/certificates.d.mts.map +1 -1
  295. package/resources/beta/tunnels/certificates.d.ts +36 -0
  296. package/resources/beta/tunnels/certificates.d.ts.map +1 -1
  297. package/resources/beta/tunnels/certificates.js +20 -8
  298. package/resources/beta/tunnels/certificates.js.map +1 -1
  299. package/resources/beta/tunnels/certificates.mjs +20 -8
  300. package/resources/beta/tunnels/certificates.mjs.map +1 -1
  301. package/resources/beta/tunnels/tunnels.d.mts +54 -0
  302. package/resources/beta/tunnels/tunnels.d.mts.map +1 -1
  303. package/resources/beta/tunnels/tunnels.d.ts +54 -0
  304. package/resources/beta/tunnels/tunnels.d.ts.map +1 -1
  305. package/resources/beta/tunnels/tunnels.js +30 -12
  306. package/resources/beta/tunnels/tunnels.js.map +1 -1
  307. package/resources/beta/tunnels/tunnels.mjs +30 -12
  308. package/resources/beta/tunnels/tunnels.mjs.map +1 -1
  309. package/resources/beta/user-profiles.d.mts +21 -25
  310. package/resources/beta/user-profiles.d.mts.map +1 -1
  311. package/resources/beta/user-profiles.d.ts +21 -25
  312. package/resources/beta/user-profiles.d.ts.map +1 -1
  313. package/resources/beta/vaults/credentials.d.mts +63 -0
  314. package/resources/beta/vaults/credentials.d.mts.map +1 -1
  315. package/resources/beta/vaults/credentials.d.ts +63 -0
  316. package/resources/beta/vaults/credentials.d.ts.map +1 -1
  317. package/resources/beta/vaults/credentials.js +35 -14
  318. package/resources/beta/vaults/credentials.js.map +1 -1
  319. package/resources/beta/vaults/credentials.mjs +35 -14
  320. package/resources/beta/vaults/credentials.mjs.map +1 -1
  321. package/resources/beta/vaults/vaults.d.mts +54 -0
  322. package/resources/beta/vaults/vaults.d.mts.map +1 -1
  323. package/resources/beta/vaults/vaults.d.ts +54 -0
  324. package/resources/beta/vaults/vaults.d.ts.map +1 -1
  325. package/resources/beta/vaults/vaults.js +30 -12
  326. package/resources/beta/vaults/vaults.js.map +1 -1
  327. package/resources/beta/vaults/vaults.mjs +30 -12
  328. package/resources/beta/vaults/vaults.mjs.map +1 -1
  329. package/resources/completions.d.mts +9 -0
  330. package/resources/completions.d.mts.map +1 -1
  331. package/resources/completions.d.ts +9 -0
  332. package/resources/completions.d.ts.map +1 -1
  333. package/resources/completions.js +5 -2
  334. package/resources/completions.js.map +1 -1
  335. package/resources/completions.mjs +5 -2
  336. package/resources/completions.mjs.map +1 -1
  337. package/resources/files.d.mts +104 -15
  338. package/resources/files.d.mts.map +1 -1
  339. package/resources/files.d.ts +104 -15
  340. package/resources/files.d.ts.map +1 -1
  341. package/resources/files.js +79 -10
  342. package/resources/files.js.map +1 -1
  343. package/resources/files.mjs +79 -10
  344. package/resources/files.mjs.map +1 -1
  345. package/resources/index.d.mts +2 -2
  346. package/resources/index.d.mts.map +1 -1
  347. package/resources/index.d.ts +2 -2
  348. package/resources/index.d.ts.map +1 -1
  349. package/resources/index.js.map +1 -1
  350. package/resources/index.mjs.map +1 -1
  351. package/resources/messages/batches.d.mts +68 -6
  352. package/resources/messages/batches.d.mts.map +1 -1
  353. package/resources/messages/batches.d.ts +68 -6
  354. package/resources/messages/batches.d.ts.map +1 -1
  355. package/resources/messages/batches.js +52 -13
  356. package/resources/messages/batches.js.map +1 -1
  357. package/resources/messages/batches.mjs +52 -13
  358. package/resources/messages/batches.mjs.map +1 -1
  359. package/resources/messages/index.d.mts +1 -1
  360. package/resources/messages/index.d.mts.map +1 -1
  361. package/resources/messages/index.d.ts +1 -1
  362. package/resources/messages/index.d.ts.map +1 -1
  363. package/resources/messages/index.js.map +1 -1
  364. package/resources/messages/index.mjs.map +1 -1
  365. package/resources/messages/messages.d.mts +21 -5
  366. package/resources/messages/messages.d.mts.map +1 -1
  367. package/resources/messages/messages.d.ts +21 -5
  368. package/resources/messages/messages.d.ts.map +1 -1
  369. package/resources/messages/messages.js +10 -4
  370. package/resources/messages/messages.js.map +1 -1
  371. package/resources/messages/messages.mjs +10 -4
  372. package/resources/messages/messages.mjs.map +1 -1
  373. package/resources/models.d.mts +31 -0
  374. package/resources/models.d.mts.map +1 -1
  375. package/resources/models.d.ts +31 -0
  376. package/resources/models.d.ts.map +1 -1
  377. package/resources/models.js +23 -4
  378. package/resources/models.js.map +1 -1
  379. package/resources/models.mjs +23 -4
  380. package/resources/models.mjs.map +1 -1
  381. package/resources/skills/index.d.mts +1 -1
  382. package/resources/skills/index.d.mts.map +1 -1
  383. package/resources/skills/index.d.ts +1 -1
  384. package/resources/skills/index.d.ts.map +1 -1
  385. package/resources/skills/index.js.map +1 -1
  386. package/resources/skills/index.mjs.map +1 -1
  387. package/resources/skills/skills.d.mts +75 -10
  388. package/resources/skills/skills.d.mts.map +1 -1
  389. package/resources/skills/skills.d.ts +75 -10
  390. package/resources/skills/skills.d.ts.map +1 -1
  391. package/resources/skills/skills.js +64 -8
  392. package/resources/skills/skills.js.map +1 -1
  393. package/resources/skills/skills.mjs +64 -8
  394. package/resources/skills/skills.mjs.map +1 -1
  395. package/resources/skills/versions.d.mts +75 -5
  396. package/resources/skills/versions.d.mts.map +1 -1
  397. package/resources/skills/versions.d.ts +75 -5
  398. package/resources/skills/versions.d.ts.map +1 -1
  399. package/resources/skills/versions.js +67 -7
  400. package/resources/skills/versions.js.map +1 -1
  401. package/resources/skills/versions.mjs +67 -7
  402. package/resources/skills/versions.mjs.map +1 -1
  403. package/src/client.ts +12 -1
  404. package/src/core/credentials.ts +5 -7
  405. package/src/core/streaming.ts +4 -2
  406. package/src/internal/file-store.ts +11 -10
  407. package/src/internal/node.browser.ts +22 -0
  408. package/src/internal/node.ts +14 -0
  409. package/src/lib/BetaMessageStream.ts +4 -0
  410. package/src/lib/credentials/credential-chain.ts +1 -1
  411. package/src/lib/credentials/identity-token.ts +1 -1
  412. package/src/lib/credentials/types.ts +2 -3
  413. package/src/lib/credentials/user-oauth.ts +1 -1
  414. package/src/lib/middleware.ts +33 -9
  415. package/src/resources/beta/agents/agents.ts +76 -10
  416. package/src/resources/beta/agents/versions.ts +15 -2
  417. package/src/resources/beta/beta.ts +16 -1
  418. package/src/resources/beta/deployment-runs.ts +36 -10
  419. package/src/resources/beta/deployments.ts +123 -18
  420. package/src/resources/beta/dreams.ts +117 -10
  421. package/src/resources/beta/environments/environments.ts +90 -12
  422. package/src/resources/beta/environments/work.ts +60 -8
  423. package/src/resources/beta/files.ts +75 -11
  424. package/src/resources/beta/index.ts +6 -0
  425. package/src/resources/beta/memory-stores/memories.ts +81 -14
  426. package/src/resources/beta/memory-stores/memory-stores.ts +90 -12
  427. package/src/resources/beta/memory-stores/memory-versions.ts +49 -10
  428. package/src/resources/beta/messages/batches.ts +85 -11
  429. package/src/resources/beta/messages/index.ts +4 -0
  430. package/src/resources/beta/messages/messages.ts +173 -10
  431. package/src/resources/beta/models.ts +30 -4
  432. package/src/resources/beta/organization/compliance-settings.ts +106 -0
  433. package/src/resources/beta/organization/external-keys.ts +6 -3
  434. package/src/resources/beta/organization/index.ts +11 -0
  435. package/src/resources/beta/organization/organization.ts +28 -0
  436. package/src/resources/beta/organization/workspaces/workspaces.ts +28 -12
  437. package/src/resources/beta/sessions/events.ts +46 -7
  438. package/src/resources/beta/sessions/resources.ts +75 -10
  439. package/src/resources/beta/sessions/sessions.ts +100 -22
  440. package/src/resources/beta/sessions/threads/events.ts +30 -4
  441. package/src/resources/beta/sessions/threads/threads.ts +45 -6
  442. package/src/resources/beta/skills/skills.ts +60 -8
  443. package/src/resources/beta/skills/versions.ts +72 -9
  444. package/src/resources/beta/tunnels/certificates.ts +60 -8
  445. package/src/resources/beta/tunnels/tunnels.ts +90 -12
  446. package/src/resources/beta/user-profiles.ts +24 -27
  447. package/src/resources/beta/vaults/credentials.ts +105 -14
  448. package/src/resources/beta/vaults/vaults.ts +90 -12
  449. package/src/resources/completions.ts +15 -2
  450. package/src/resources/files.ts +161 -18
  451. package/src/resources/index.ts +5 -0
  452. package/src/resources/messages/batches.ts +137 -13
  453. package/src/resources/messages/index.ts +4 -0
  454. package/src/resources/messages/messages.ts +40 -12
  455. package/src/resources/models.ts +43 -4
  456. package/src/resources/skills/index.ts +2 -0
  457. package/src/resources/skills/skills.ts +127 -13
  458. package/src/resources/skills/versions.ts +115 -11
  459. package/src/tools/agent-toolset/fs-util.ts +22 -9
  460. package/src/tools/agent-toolset/memories.ts +5 -3
  461. package/src/tools/agent-toolset/skills.ts +5 -10
  462. package/src/version.ts +1 -1
  463. package/tools/agent-toolset/fs-util.d.mts +11 -4
  464. package/tools/agent-toolset/fs-util.d.mts.map +1 -1
  465. package/tools/agent-toolset/fs-util.d.ts +11 -4
  466. package/tools/agent-toolset/fs-util.d.ts.map +1 -1
  467. package/tools/agent-toolset/fs-util.js +27 -19
  468. package/tools/agent-toolset/fs-util.js.map +1 -1
  469. package/tools/agent-toolset/fs-util.mjs +17 -8
  470. package/tools/agent-toolset/fs-util.mjs.map +1 -1
  471. package/tools/agent-toolset/memories.d.mts.map +1 -1
  472. package/tools/agent-toolset/memories.d.ts.map +1 -1
  473. package/tools/agent-toolset/memories.js +6 -4
  474. package/tools/agent-toolset/memories.js.map +1 -1
  475. package/tools/agent-toolset/memories.mjs +5 -3
  476. package/tools/agent-toolset/memories.mjs.map +1 -1
  477. package/tools/agent-toolset/skills.d.mts.map +1 -1
  478. package/tools/agent-toolset/skills.d.ts.map +1 -1
  479. package/tools/agent-toolset/skills.js +15 -21
  480. package/tools/agent-toolset/skills.js.map +1 -1
  481. package/tools/agent-toolset/skills.mjs +4 -9
  482. package/tools/agent-toolset/skills.mjs.map +1 -1
  483. package/version.d.mts +1 -1
  484. package/version.d.ts +1 -1
  485. package/version.js +1 -1
  486. package/version.mjs +1 -1
@@ -6,18 +6,52 @@ import { RequestOptions } from "../../internal/request-options.mjs";
6
6
  export declare class Versions extends APIResource {
7
7
  /**
8
8
  * Create Skill Version
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const skillVersion = await client.skills.versions.create(
13
+ * 'skill_id',
14
+ * { files: [fs.createReadStream('path/to/file')] },
15
+ * );
16
+ * ```
9
17
  */
10
- create(skillID: string, body: VersionCreateParams, options?: RequestOptions): APIPromise<SkillVersion>;
18
+ create(skillID: string, params: VersionCreateParams, options?: RequestOptions): APIPromise<SkillVersion>;
11
19
  /**
12
20
  * Get Skill Version
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * const skillVersion = await client.skills.versions.retrieve(
25
+ * 'version',
26
+ * { skill_id: 'skill_id' },
27
+ * );
28
+ * ```
13
29
  */
14
30
  retrieve(version: string, params: VersionRetrieveParams, options?: RequestOptions): APIPromise<SkillVersion>;
15
31
  /**
16
32
  * List Skill Versions
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * // Automatically fetches more pages as needed.
37
+ * for await (const skillVersion of client.skills.versions.list(
38
+ * 'skill_id',
39
+ * )) {
40
+ * // ...
41
+ * }
42
+ * ```
17
43
  */
18
- list(skillID: string, query?: VersionListParams | null | undefined, options?: RequestOptions): PagePromise<SkillVersionsPageCursor, SkillVersion>;
44
+ list(skillID: string, params?: VersionListParams | null | undefined, options?: RequestOptions): PagePromise<SkillVersionsPageCursor, SkillVersion>;
19
45
  /**
20
46
  * Delete Skill Version
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const deletedSkillVersion =
51
+ * await client.skills.versions.delete('version', {
52
+ * skill_id: 'skill_id',
53
+ * });
54
+ * ```
21
55
  */
22
56
  delete(version: string, params: VersionDeleteParams, options?: RequestOptions): APIPromise<DeletedSkillVersion>;
23
57
  }
@@ -73,30 +107,66 @@ export interface SkillVersion {
73
107
  }
74
108
  export interface VersionCreateParams {
75
109
  /**
76
- * Files to upload for the skill.
110
+ * Body param: Files to upload for the skill.
77
111
  *
78
112
  * All files must be in the same top-level directory and must include a SKILL.md
79
113
  * file at the root of that directory.
80
114
  */
81
115
  files: Array<Uploadable>;
116
+ /**
117
+ * Header param: Optional header to select the Workspace for this request. The
118
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
119
+ *
120
+ * Only needed for credentials that can act on more than one Workspace. A
121
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
122
+ * match that Workspace.
123
+ */
124
+ workspace_id?: string;
82
125
  }
83
126
  export interface VersionRetrieveParams {
84
127
  /**
85
- * Unique identifier for the skill.
128
+ * Path param: Unique identifier for the skill.
86
129
  *
87
130
  * The format and length of IDs may change over time.
88
131
  */
89
132
  skill_id: string;
133
+ /**
134
+ * Header param: Optional header to select the Workspace for this request. The
135
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
136
+ *
137
+ * Only needed for credentials that can act on more than one Workspace. A
138
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
139
+ * match that Workspace.
140
+ */
141
+ workspace_id?: string;
90
142
  }
91
143
  export interface VersionListParams extends PageCursorParams {
144
+ /**
145
+ * Header param: Optional header to select the Workspace for this request. The
146
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
147
+ *
148
+ * Only needed for credentials that can act on more than one Workspace. A
149
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
150
+ * match that Workspace.
151
+ */
152
+ workspace_id?: string;
92
153
  }
93
154
  export interface VersionDeleteParams {
94
155
  /**
95
- * Unique identifier for the skill.
156
+ * Path param: Unique identifier for the skill.
96
157
  *
97
158
  * The format and length of IDs may change over time.
98
159
  */
99
160
  skill_id: string;
161
+ /**
162
+ * Header param: Optional header to select the Workspace for this request. The
163
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
164
+ *
165
+ * Only needed for credentials that can act on more than one Workspace. A
166
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
167
+ * match that Workspace.
168
+ */
169
+ workspace_id?: string;
100
170
  }
101
171
  export declare namespace Versions {
102
172
  export { type DeletedSkillVersion as DeletedSkillVersion, type SkillVersion as SkillVersion, type SkillVersionsPageCursor as SkillVersionsPageCursor, type VersionCreateParams as VersionCreateParams, type VersionRetrieveParams as VersionRetrieveParams, type VersionListParams as VersionListParams, type VersionDeleteParams as VersionDeleteParams, };
@@ -1 +1 @@
1
- {"version":3,"file":"versions.d.mts","sourceRoot":"","sources":["../../src/resources/skills/versions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE,kCAA8B;AACvF,OAAO,EAAE,KAAK,UAAU,EAAE,+BAA2B;AACrD,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAIhE,qBAAa,QAAS,SAAQ,WAAW;IACvC;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAA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uBAAuB,IAAI,uBAAuB,EACvD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
@@ -6,18 +6,52 @@ import { RequestOptions } from "../../internal/request-options.js";
6
6
  export declare class Versions extends APIResource {
7
7
  /**
8
8
  * Create Skill Version
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const skillVersion = await client.skills.versions.create(
13
+ * 'skill_id',
14
+ * { files: [fs.createReadStream('path/to/file')] },
15
+ * );
16
+ * ```
9
17
  */
10
- create(skillID: string, body: VersionCreateParams, options?: RequestOptions): APIPromise<SkillVersion>;
18
+ create(skillID: string, params: VersionCreateParams, options?: RequestOptions): APIPromise<SkillVersion>;
11
19
  /**
12
20
  * Get Skill Version
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * const skillVersion = await client.skills.versions.retrieve(
25
+ * 'version',
26
+ * { skill_id: 'skill_id' },
27
+ * );
28
+ * ```
13
29
  */
14
30
  retrieve(version: string, params: VersionRetrieveParams, options?: RequestOptions): APIPromise<SkillVersion>;
15
31
  /**
16
32
  * List Skill Versions
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * // Automatically fetches more pages as needed.
37
+ * for await (const skillVersion of client.skills.versions.list(
38
+ * 'skill_id',
39
+ * )) {
40
+ * // ...
41
+ * }
42
+ * ```
17
43
  */
18
- list(skillID: string, query?: VersionListParams | null | undefined, options?: RequestOptions): PagePromise<SkillVersionsPageCursor, SkillVersion>;
44
+ list(skillID: string, params?: VersionListParams | null | undefined, options?: RequestOptions): PagePromise<SkillVersionsPageCursor, SkillVersion>;
19
45
  /**
20
46
  * Delete Skill Version
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const deletedSkillVersion =
51
+ * await client.skills.versions.delete('version', {
52
+ * skill_id: 'skill_id',
53
+ * });
54
+ * ```
21
55
  */
22
56
  delete(version: string, params: VersionDeleteParams, options?: RequestOptions): APIPromise<DeletedSkillVersion>;
23
57
  }
@@ -73,30 +107,66 @@ export interface SkillVersion {
73
107
  }
74
108
  export interface VersionCreateParams {
75
109
  /**
76
- * Files to upload for the skill.
110
+ * Body param: Files to upload for the skill.
77
111
  *
78
112
  * All files must be in the same top-level directory and must include a SKILL.md
79
113
  * file at the root of that directory.
80
114
  */
81
115
  files: Array<Uploadable>;
116
+ /**
117
+ * Header param: Optional header to select the Workspace for this request. The
118
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
119
+ *
120
+ * Only needed for credentials that can act on more than one Workspace. A
121
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
122
+ * match that Workspace.
123
+ */
124
+ workspace_id?: string;
82
125
  }
83
126
  export interface VersionRetrieveParams {
84
127
  /**
85
- * Unique identifier for the skill.
128
+ * Path param: Unique identifier for the skill.
86
129
  *
87
130
  * The format and length of IDs may change over time.
88
131
  */
89
132
  skill_id: string;
133
+ /**
134
+ * Header param: Optional header to select the Workspace for this request. The
135
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
136
+ *
137
+ * Only needed for credentials that can act on more than one Workspace. A
138
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
139
+ * match that Workspace.
140
+ */
141
+ workspace_id?: string;
90
142
  }
91
143
  export interface VersionListParams extends PageCursorParams {
144
+ /**
145
+ * Header param: Optional header to select the Workspace for this request. The
146
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
147
+ *
148
+ * Only needed for credentials that can act on more than one Workspace. A
149
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
150
+ * match that Workspace.
151
+ */
152
+ workspace_id?: string;
92
153
  }
93
154
  export interface VersionDeleteParams {
94
155
  /**
95
- * Unique identifier for the skill.
156
+ * Path param: Unique identifier for the skill.
96
157
  *
97
158
  * The format and length of IDs may change over time.
98
159
  */
99
160
  skill_id: string;
161
+ /**
162
+ * Header param: Optional header to select the Workspace for this request. The
163
+ * value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
164
+ *
165
+ * Only needed for credentials that can act on more than one Workspace. A
166
+ * credential that belongs to a specific Workspace may omit it; if sent, it must
167
+ * match that Workspace.
168
+ */
169
+ workspace_id?: string;
100
170
  }
101
171
  export declare namespace Versions {
102
172
  export { type DeletedSkillVersion as DeletedSkillVersion, type SkillVersion as SkillVersion, type SkillVersionsPageCursor as SkillVersionsPageCursor, type VersionCreateParams as VersionCreateParams, type VersionRetrieveParams as VersionRetrieveParams, type VersionListParams as VersionListParams, type VersionDeleteParams as VersionDeleteParams, };
@@ -1 +1 @@
1
- {"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../src/resources/skills/versions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE,iCAA8B;AACvF,OAAO,EAAE,KAAK,UAAU,EAAE,8BAA2B;AACrD,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAIhE,qBAAa,QAAS,SAAQ,WAAW;IACvC;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,YAAY,CAAC;IAOtG;;OAEG;IACH,QAAQ,CACN,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,qBAAqB,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,YAAY,CAAC;IAK3B;;OAEG;IACH,IAAI,CACF,OAAO,EAAE,MAAM,EACf,KAAK,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,uBAAuB,EAAE,YAAY,CAAC;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CAAC;IAEX;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,IAAI,EAAE,eAAe,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAEzB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACzD;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
@@ -4,37 +4,97 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Versions = void 0;
5
5
  const resource_1 = require("../../core/resource.js");
6
6
  const pagination_1 = require("../../core/pagination.js");
7
+ const headers_1 = require("../../internal/headers.js");
7
8
  const uploads_1 = require("../../internal/uploads.js");
8
9
  const path_1 = require("../../internal/utils/path.js");
9
10
  class Versions extends resource_1.APIResource {
10
11
  /**
11
12
  * Create Skill Version
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const skillVersion = await client.skills.versions.create(
17
+ * 'skill_id',
18
+ * { files: [fs.createReadStream('path/to/file')] },
19
+ * );
20
+ * ```
12
21
  */
13
- create(skillID, body, options) {
14
- return this._client.post((0, path_1.path) `/v1/skills/${skillID}/versions`, (0, uploads_1.multipartFormRequestOptions)({ body, ...options }, this._client, false));
22
+ create(skillID, params, options) {
23
+ const { workspace_id, ...body } = params;
24
+ return this._client.post((0, path_1.path) `/v1/skills/${skillID}/versions`, (0, uploads_1.multipartFormRequestOptions)({
25
+ body,
26
+ ...options,
27
+ headers: (0, headers_1.buildHeaders)([
28
+ { ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
29
+ options?.headers,
30
+ ]),
31
+ }, this._client, false));
15
32
  }
16
33
  /**
17
34
  * Get Skill Version
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * const skillVersion = await client.skills.versions.retrieve(
39
+ * 'version',
40
+ * { skill_id: 'skill_id' },
41
+ * );
42
+ * ```
18
43
  */
19
44
  retrieve(version, params, options) {
20
- const { skill_id } = params;
21
- return this._client.get((0, path_1.path) `/v1/skills/${skill_id}/versions/${version}`, options);
45
+ const { skill_id, workspace_id } = params;
46
+ return this._client.get((0, path_1.path) `/v1/skills/${skill_id}/versions/${version}`, {
47
+ ...options,
48
+ headers: (0, headers_1.buildHeaders)([
49
+ { ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
50
+ options?.headers,
51
+ ]),
52
+ });
22
53
  }
23
54
  /**
24
55
  * List Skill Versions
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * // Automatically fetches more pages as needed.
60
+ * for await (const skillVersion of client.skills.versions.list(
61
+ * 'skill_id',
62
+ * )) {
63
+ * // ...
64
+ * }
65
+ * ```
25
66
  */
26
- list(skillID, query = {}, options) {
67
+ list(skillID, params = {}, options) {
68
+ const { workspace_id, ...query } = params ?? {};
27
69
  return this._client.getAPIList((0, path_1.path) `/v1/skills/${skillID}/versions`, (pagination_1.PageCursor), {
28
70
  query,
29
71
  ...options,
72
+ headers: (0, headers_1.buildHeaders)([
73
+ { ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
74
+ options?.headers,
75
+ ]),
30
76
  });
31
77
  }
32
78
  /**
33
79
  * Delete Skill Version
80
+ *
81
+ * @example
82
+ * ```ts
83
+ * const deletedSkillVersion =
84
+ * await client.skills.versions.delete('version', {
85
+ * skill_id: 'skill_id',
86
+ * });
87
+ * ```
34
88
  */
35
89
  delete(version, params, options) {
36
- const { skill_id } = params;
37
- return this._client.delete((0, path_1.path) `/v1/skills/${skill_id}/versions/${version}`, options);
90
+ const { skill_id, workspace_id } = params;
91
+ return this._client.delete((0, path_1.path) `/v1/skills/${skill_id}/versions/${version}`, {
92
+ ...options,
93
+ headers: (0, headers_1.buildHeaders)([
94
+ { ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
95
+ options?.headers,
96
+ ]),
97
+ });
38
98
  }
39
99
  }
40
100
  exports.Versions = Versions;
@@ -1 +1 @@
1
- {"version":3,"file":"versions.js","sourceRoot":"","sources":["../../src/resources/skills/versions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAElD,yDAAuF;AAGvF,uDAAqE;AACrE,uDAAiD;AAEjD,MAAa,QAAS,SAAQ,sBAAW;IACvC;;OAEG;IACH,MAAM,CAAC,OAAe,EAAE,IAAyB,EAAE,OAAwB;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,IAAA,WAAI,EAAA,cAAc,OAAO,WAAW,EACpC,IAAA,qCAA2B,EAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CACvE,CAAC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AAE;gBACtF,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CACJ,OAAe,EACf,MAA2B,EAC3B,OAAwB;QAExB,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;QAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,cAAc,QAAQ,aAAa,OAAO,EAAE,EAAE;YAC3E,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB,EAAE,GAAG,CAAC,YAAY,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,wBAAwB,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;gBACtF,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF;AA/GD,4BA+GC"}
@@ -1,37 +1,97 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
  import { APIResource } from "../../core/resource.mjs";
3
3
  import { PageCursor } from "../../core/pagination.mjs";
4
+ import { buildHeaders } from "../../internal/headers.mjs";
4
5
  import { multipartFormRequestOptions } from "../../internal/uploads.mjs";
5
6
  import { path } from "../../internal/utils/path.mjs";
6
7
  export class Versions extends APIResource {
7
8
  /**
8
9
  * Create Skill Version
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const skillVersion = await client.skills.versions.create(
14
+ * 'skill_id',
15
+ * { files: [fs.createReadStream('path/to/file')] },
16
+ * );
17
+ * ```
9
18
  */
10
- create(skillID, body, options) {
11
- return this._client.post(path `/v1/skills/${skillID}/versions`, multipartFormRequestOptions({ body, ...options }, this._client, false));
19
+ create(skillID, params, options) {
20
+ const { workspace_id, ...body } = params;
21
+ return this._client.post(path `/v1/skills/${skillID}/versions`, multipartFormRequestOptions({
22
+ body,
23
+ ...options,
24
+ headers: buildHeaders([
25
+ { ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
26
+ options?.headers,
27
+ ]),
28
+ }, this._client, false));
12
29
  }
13
30
  /**
14
31
  * Get Skill Version
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const skillVersion = await client.skills.versions.retrieve(
36
+ * 'version',
37
+ * { skill_id: 'skill_id' },
38
+ * );
39
+ * ```
15
40
  */
16
41
  retrieve(version, params, options) {
17
- const { skill_id } = params;
18
- return this._client.get(path `/v1/skills/${skill_id}/versions/${version}`, options);
42
+ const { skill_id, workspace_id } = params;
43
+ return this._client.get(path `/v1/skills/${skill_id}/versions/${version}`, {
44
+ ...options,
45
+ headers: buildHeaders([
46
+ { ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
47
+ options?.headers,
48
+ ]),
49
+ });
19
50
  }
20
51
  /**
21
52
  * List Skill Versions
53
+ *
54
+ * @example
55
+ * ```ts
56
+ * // Automatically fetches more pages as needed.
57
+ * for await (const skillVersion of client.skills.versions.list(
58
+ * 'skill_id',
59
+ * )) {
60
+ * // ...
61
+ * }
62
+ * ```
22
63
  */
23
- list(skillID, query = {}, options) {
64
+ list(skillID, params = {}, options) {
65
+ const { workspace_id, ...query } = params ?? {};
24
66
  return this._client.getAPIList(path `/v1/skills/${skillID}/versions`, (PageCursor), {
25
67
  query,
26
68
  ...options,
69
+ headers: buildHeaders([
70
+ { ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
71
+ options?.headers,
72
+ ]),
27
73
  });
28
74
  }
29
75
  /**
30
76
  * Delete Skill Version
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * const deletedSkillVersion =
81
+ * await client.skills.versions.delete('version', {
82
+ * skill_id: 'skill_id',
83
+ * });
84
+ * ```
31
85
  */
32
86
  delete(version, params, options) {
33
- const { skill_id } = params;
34
- return this._client.delete(path `/v1/skills/${skill_id}/versions/${version}`, options);
87
+ const { skill_id, workspace_id } = params;
88
+ return this._client.delete(path `/v1/skills/${skill_id}/versions/${version}`, {
89
+ ...options,
90
+ headers: buildHeaders([
91
+ { ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
92
+ options?.headers,
93
+ ]),
94
+ });
35
95
  }
36
96
  }
37
97
  //# sourceMappingURL=versions.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"versions.mjs","sourceRoot":"","sources":["../../src/resources/skills/versions.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAElD,OAAO,EAAE,UAAU,EAAsC,kCAA8B;AAGvF,OAAO,EAAE,2BAA2B,EAAE,mCAA+B;AACrE,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;OAEG;IACH,MAAM,CAAC,OAAe,EAAE,IAAyB,EAAE,OAAwB;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,IAAI,CAAA,cAAc,OAAO,WAAW,EACpC,2BAA2B,CAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CACvE,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,QAAQ,CACN,OAAe,EACf,MAA6B,EAC7B,OAAwB;QAExB,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,cAAc,QAAQ,aAAa,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IACrF,CAAC;IAED;;OAEG;IACH,IAAI,CACF,OAAe,EACf,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAA,cAAc,OAAO,WAAW,EAAE,CAAA,UAAwB,CAAA,EAAE;YAC7F,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,MAAM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,SAAS,CAAC,EAAE;gBACtF,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF"}
package/src/client.ts CHANGED
@@ -55,9 +55,12 @@ import {
55
55
  } from './resources/completions';
56
56
  import {
57
57
  DeletedFile,
58
+ FileDeleteParams,
59
+ FileDownloadParams,
58
60
  FileListParams,
59
61
  FileMetadata,
60
62
  FileMetadataPageCursor,
63
+ FileRetrieveMetadataParams,
61
64
  FileUploadParams,
62
65
  Files,
63
66
  } from './resources/files';
@@ -337,7 +340,9 @@ import {
337
340
  DeletedSkill,
338
341
  Skill,
339
342
  SkillCreateParams,
343
+ SkillDeleteParams,
340
344
  SkillListParams,
345
+ SkillRetrieveParams,
341
346
  SkillSource,
342
347
  Skills,
343
348
  SkillsPageCursor,
@@ -781,7 +786,8 @@ export class BaseAnthropic {
781
786
  }
782
787
 
783
788
  /**
784
- * Create a new client instance re-using the same options given to the current client with optional overriding.
789
+ * Create a new client instance re-using the same options given to the
790
+ * current client with optional overriding.
785
791
  */
786
792
  withOptions(options: Partial<ClientOptions>): this {
787
793
  // Share the auth state object unless the caller passes any auth-related
@@ -1982,6 +1988,9 @@ export declare namespace Anthropic {
1982
1988
  type FileMetadata as FileMetadata,
1983
1989
  type FileMetadataPageCursor as FileMetadataPageCursor,
1984
1990
  type FileListParams as FileListParams,
1991
+ type FileDeleteParams as FileDeleteParams,
1992
+ type FileDownloadParams as FileDownloadParams,
1993
+ type FileRetrieveMetadataParams as FileRetrieveMetadataParams,
1985
1994
  type FileUploadParams as FileUploadParams,
1986
1995
  };
1987
1996
 
@@ -1992,7 +2001,9 @@ export declare namespace Anthropic {
1992
2001
  type SkillSource as SkillSource,
1993
2002
  type SkillsPageCursor as SkillsPageCursor,
1994
2003
  type SkillCreateParams as SkillCreateParams,
2004
+ type SkillRetrieveParams as SkillRetrieveParams,
1995
2005
  type SkillListParams as SkillListParams,
2006
+ type SkillDeleteParams as SkillDeleteParams,
1996
2007
  };
1997
2008
 
1998
2009
  export {
@@ -146,8 +146,7 @@ export const loadConfigWithSource = async (profile?: string): Promise<LoadedConf
146
146
  }
147
147
  validateProfileName(profileName);
148
148
 
149
- const fs = await import('node:fs');
150
- const path = await import('node:path');
149
+ const { fs, path } = await import('../internal/node');
151
150
  const configPath = path.join(rootConfigPath, 'configs', `${profileName}.json`);
152
151
  let configRaw: string | null;
153
152
  try {
@@ -252,7 +251,7 @@ export const loadCredentials = async (): Promise<AnthropicCredentials | null> =>
252
251
  return null;
253
252
  }
254
253
 
255
- const fs = await import('node:fs');
254
+ const { fs } = await import('../internal/node');
256
255
  let raw: string;
257
256
  try {
258
257
  raw = await fs.promises.readFile(credentialsPath, 'utf-8');
@@ -304,7 +303,7 @@ export const getCredentialsPath = async (
304
303
  }
305
304
  validateProfileName(profileName);
306
305
 
307
- const path = await import('node:path');
306
+ const { path } = await import('../internal/node');
308
307
  return path.join(rootConfigPath, 'credentials', `${profileName}.json`);
309
308
  };
310
309
 
@@ -313,7 +312,7 @@ const getRootConfigPath = async (): Promise<string | null> => {
313
312
  return null;
314
313
  }
315
314
 
316
- const path = await import('node:path');
315
+ const { path } = await import('../internal/node');
317
316
 
318
317
  // ANTHROPIC_CONFIG_DIR is treated as a trusted path: it is set by the
319
318
  // process operator, not by remote input, so it is not validated.
@@ -365,8 +364,7 @@ const getActiveProfileName = async (): Promise<string | null> => {
365
364
  return profileName;
366
365
  }
367
366
 
368
- const fs = await import('node:fs');
369
- const path = await import('node:path');
367
+ const { fs, path } = await import('../internal/node');
370
368
  const filePath = path.join(rootConfigPath, 'active_config');
371
369
  try {
372
370
  return (await fs.promises.readFile(filePath, 'utf-8')).trim() || 'default';
@@ -329,10 +329,12 @@ async function* iterSSEChunks(iterator: AsyncIterableIterator<Bytes>): AsyncGene
329
329
  newData.set(binaryChunk, data.length);
330
330
  data = newData;
331
331
 
332
+ // Yield views, not copies, so a chunk holding many events is not re-copied
333
+ // once per event. This relies on newData never being written again.
332
334
  let patternIndex;
333
335
  while ((patternIndex = findDoubleNewlineIndex(data)) !== -1) {
334
- yield data.slice(0, patternIndex);
335
- data = data.slice(patternIndex);
336
+ yield data.subarray(0, patternIndex);
337
+ data = data.subarray(patternIndex);
336
338
  }
337
339
  }
338
340