@ainative/cody-sdk 0.1.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 (770) hide show
  1. package/.github/logo.svg +3 -0
  2. package/CHANGELOG.md +2345 -0
  3. package/LICENSE +8 -0
  4. package/README.md +45 -0
  5. package/_vendor/partial-json-parser/parser.d.mts +3 -0
  6. package/_vendor/partial-json-parser/parser.d.mts.map +1 -0
  7. package/_vendor/partial-json-parser/parser.d.ts +3 -0
  8. package/_vendor/partial-json-parser/parser.d.ts.map +1 -0
  9. package/_vendor/partial-json-parser/parser.js +226 -0
  10. package/_vendor/partial-json-parser/parser.js.map +1 -0
  11. package/_vendor/partial-json-parser/parser.mjs +223 -0
  12. package/_vendor/partial-json-parser/parser.mjs.map +1 -0
  13. package/ainative.d.mts +32 -0
  14. package/ainative.d.mts.map +1 -0
  15. package/ainative.d.ts +32 -0
  16. package/ainative.d.ts.map +1 -0
  17. package/ainative.js +78 -0
  18. package/ainative.js.map +1 -0
  19. package/ainative.mjs +71 -0
  20. package/ainative.mjs.map +1 -0
  21. package/api-promise.d.mts +2 -0
  22. package/api-promise.d.mts.map +1 -0
  23. package/api-promise.d.ts +2 -0
  24. package/api-promise.d.ts.map +1 -0
  25. package/api-promise.js +6 -0
  26. package/api-promise.js.map +1 -0
  27. package/api-promise.mjs +2 -0
  28. package/api-promise.mjs.map +1 -0
  29. package/bin/cli +53 -0
  30. package/bin/migration-config.json +82 -0
  31. package/client.d.mts +247 -0
  32. package/client.d.mts.map +1 -0
  33. package/client.d.ts +247 -0
  34. package/client.d.ts.map +1 -0
  35. package/client.js +567 -0
  36. package/client.js.map +1 -0
  37. package/client.mjs +562 -0
  38. package/client.mjs.map +1 -0
  39. package/core/api-promise.d.mts +49 -0
  40. package/core/api-promise.d.mts.map +1 -0
  41. package/core/api-promise.d.ts +49 -0
  42. package/core/api-promise.d.ts.map +1 -0
  43. package/core/api-promise.js +76 -0
  44. package/core/api-promise.js.map +1 -0
  45. package/core/api-promise.mjs +72 -0
  46. package/core/api-promise.mjs.map +1 -0
  47. package/core/error.d.mts +50 -0
  48. package/core/error.d.mts.map +1 -0
  49. package/core/error.d.ts +50 -0
  50. package/core/error.d.ts.map +1 -0
  51. package/core/error.js +116 -0
  52. package/core/error.js.map +1 -0
  53. package/core/error.mjs +100 -0
  54. package/core/error.mjs.map +1 -0
  55. package/core/pagination.d.mts +105 -0
  56. package/core/pagination.d.mts.map +1 -0
  57. package/core/pagination.d.ts +105 -0
  58. package/core/pagination.d.ts.map +1 -0
  59. package/core/pagination.js +185 -0
  60. package/core/pagination.js.map +1 -0
  61. package/core/pagination.mjs +177 -0
  62. package/core/pagination.mjs.map +1 -0
  63. package/core/resource.d.mts +6 -0
  64. package/core/resource.d.mts.map +1 -0
  65. package/core/resource.d.ts +6 -0
  66. package/core/resource.d.ts.map +1 -0
  67. package/core/resource.js +11 -0
  68. package/core/resource.js.map +1 -0
  69. package/core/resource.mjs +7 -0
  70. package/core/resource.mjs.map +1 -0
  71. package/core/streaming.d.mts +33 -0
  72. package/core/streaming.d.mts.map +1 -0
  73. package/core/streaming.d.ts +33 -0
  74. package/core/streaming.d.ts.map +1 -0
  75. package/core/streaming.js +290 -0
  76. package/core/streaming.js.map +1 -0
  77. package/core/streaming.mjs +285 -0
  78. package/core/streaming.mjs.map +1 -0
  79. package/core/uploads.d.mts +3 -0
  80. package/core/uploads.d.mts.map +1 -0
  81. package/core/uploads.d.ts +3 -0
  82. package/core/uploads.d.ts.map +1 -0
  83. package/core/uploads.js +6 -0
  84. package/core/uploads.js.map +1 -0
  85. package/core/uploads.mjs +2 -0
  86. package/core/uploads.mjs.map +1 -0
  87. package/error.d.mts +2 -0
  88. package/error.d.mts.map +1 -0
  89. package/error.d.ts +2 -0
  90. package/error.d.ts.map +1 -0
  91. package/error.js +6 -0
  92. package/error.js.map +1 -0
  93. package/error.mjs +2 -0
  94. package/error.mjs.map +1 -0
  95. package/helpers/beta/json-schema.d.mts +31 -0
  96. package/helpers/beta/json-schema.d.mts.map +1 -0
  97. package/helpers/beta/json-schema.d.ts +31 -0
  98. package/helpers/beta/json-schema.d.ts.map +1 -0
  99. package/helpers/beta/json-schema.js +56 -0
  100. package/helpers/beta/json-schema.js.map +1 -0
  101. package/helpers/beta/json-schema.mjs +52 -0
  102. package/helpers/beta/json-schema.mjs.map +1 -0
  103. package/helpers/beta/mcp.d.mts +303 -0
  104. package/helpers/beta/mcp.d.mts.map +1 -0
  105. package/helpers/beta/mcp.d.ts +303 -0
  106. package/helpers/beta/mcp.d.ts.map +1 -0
  107. package/helpers/beta/mcp.js +419 -0
  108. package/helpers/beta/mcp.js.map +1 -0
  109. package/helpers/beta/mcp.mjs +406 -0
  110. package/helpers/beta/mcp.mjs.map +1 -0
  111. package/helpers/beta/memory.d.mts +11 -0
  112. package/helpers/beta/memory.d.mts.map +1 -0
  113. package/helpers/beta/memory.d.ts +11 -0
  114. package/helpers/beta/memory.d.ts.map +1 -0
  115. package/helpers/beta/memory.js +18 -0
  116. package/helpers/beta/memory.js.map +1 -0
  117. package/helpers/beta/memory.mjs +15 -0
  118. package/helpers/beta/memory.mjs.map +1 -0
  119. package/helpers/beta/zod.d.mts +27 -0
  120. package/helpers/beta/zod.d.mts.map +1 -0
  121. package/helpers/beta/zod.d.ts +27 -0
  122. package/helpers/beta/zod.d.ts.map +1 -0
  123. package/helpers/beta/zod.js +57 -0
  124. package/helpers/beta/zod.js.map +1 -0
  125. package/helpers/beta/zod.mjs +52 -0
  126. package/helpers/beta/zod.mjs.map +1 -0
  127. package/helpers/index.d.mts +3 -0
  128. package/helpers/index.d.mts.map +1 -0
  129. package/helpers/index.d.ts +3 -0
  130. package/helpers/index.d.ts.map +1 -0
  131. package/helpers/index.js +8 -0
  132. package/helpers/index.js.map +1 -0
  133. package/helpers/index.mjs +3 -0
  134. package/helpers/index.mjs.map +1 -0
  135. package/helpers/json-schema.d.mts +18 -0
  136. package/helpers/json-schema.d.mts.map +1 -0
  137. package/helpers/json-schema.d.ts +18 -0
  138. package/helpers/json-schema.d.ts.map +1 -0
  139. package/helpers/json-schema.js +37 -0
  140. package/helpers/json-schema.js.map +1 -0
  141. package/helpers/json-schema.mjs +34 -0
  142. package/helpers/json-schema.mjs.map +1 -0
  143. package/helpers/zod.d.mts +13 -0
  144. package/helpers/zod.d.mts.map +1 -0
  145. package/helpers/zod.d.ts +13 -0
  146. package/helpers/zod.d.ts.map +1 -0
  147. package/helpers/zod.js +47 -0
  148. package/helpers/zod.js.map +1 -0
  149. package/helpers/zod.mjs +43 -0
  150. package/helpers/zod.mjs.map +1 -0
  151. package/index.d.mts +9 -0
  152. package/index.d.mts.map +1 -0
  153. package/index.d.ts +9 -0
  154. package/index.d.ts.map +1 -0
  155. package/index.js +42 -0
  156. package/index.js.map +1 -0
  157. package/index.mjs +9 -0
  158. package/index.mjs.map +1 -0
  159. package/internal/builtin-types.d.mts +73 -0
  160. package/internal/builtin-types.d.mts.map +1 -0
  161. package/internal/builtin-types.d.ts +73 -0
  162. package/internal/builtin-types.d.ts.map +1 -0
  163. package/internal/builtin-types.js +4 -0
  164. package/internal/builtin-types.js.map +1 -0
  165. package/internal/builtin-types.mjs +3 -0
  166. package/internal/builtin-types.mjs.map +1 -0
  167. package/internal/constants.d.mts +5 -0
  168. package/internal/constants.d.mts.map +1 -0
  169. package/internal/constants.d.ts +5 -0
  170. package/internal/constants.d.ts.map +1 -0
  171. package/internal/constants.js +18 -0
  172. package/internal/constants.js.map +1 -0
  173. package/internal/constants.mjs +15 -0
  174. package/internal/constants.mjs.map +1 -0
  175. package/internal/decoders/jsonl.d.mts +10 -0
  176. package/internal/decoders/jsonl.d.mts.map +1 -0
  177. package/internal/decoders/jsonl.d.ts +10 -0
  178. package/internal/decoders/jsonl.d.ts.map +1 -0
  179. package/internal/decoders/jsonl.js +39 -0
  180. package/internal/decoders/jsonl.js.map +1 -0
  181. package/internal/decoders/jsonl.mjs +35 -0
  182. package/internal/decoders/jsonl.mjs.map +1 -0
  183. package/internal/decoders/line.d.mts +17 -0
  184. package/internal/decoders/line.d.mts.map +1 -0
  185. package/internal/decoders/line.d.ts +17 -0
  186. package/internal/decoders/line.d.ts.map +1 -0
  187. package/internal/decoders/line.js +113 -0
  188. package/internal/decoders/line.js.map +1 -0
  189. package/internal/decoders/line.mjs +108 -0
  190. package/internal/decoders/line.mjs.map +1 -0
  191. package/internal/detect-platform.d.mts +15 -0
  192. package/internal/detect-platform.d.mts.map +1 -0
  193. package/internal/detect-platform.d.ts +15 -0
  194. package/internal/detect-platform.d.ts.map +1 -0
  195. package/internal/detect-platform.js +162 -0
  196. package/internal/detect-platform.js.map +1 -0
  197. package/internal/detect-platform.mjs +157 -0
  198. package/internal/detect-platform.mjs.map +1 -0
  199. package/internal/errors.d.mts +3 -0
  200. package/internal/errors.d.mts.map +1 -0
  201. package/internal/errors.d.ts +3 -0
  202. package/internal/errors.d.ts.map +1 -0
  203. package/internal/errors.js +41 -0
  204. package/internal/errors.js.map +1 -0
  205. package/internal/errors.mjs +36 -0
  206. package/internal/errors.mjs.map +1 -0
  207. package/internal/headers.d.mts +22 -0
  208. package/internal/headers.d.mts.map +1 -0
  209. package/internal/headers.d.ts +22 -0
  210. package/internal/headers.d.ts.map +1 -0
  211. package/internal/headers.js +79 -0
  212. package/internal/headers.js.map +1 -0
  213. package/internal/headers.mjs +74 -0
  214. package/internal/headers.mjs.map +1 -0
  215. package/internal/parse.d.mts +17 -0
  216. package/internal/parse.d.mts.map +1 -0
  217. package/internal/parse.d.ts +17 -0
  218. package/internal/parse.d.ts.map +1 -0
  219. package/internal/parse.js +60 -0
  220. package/internal/parse.js.map +1 -0
  221. package/internal/parse.mjs +56 -0
  222. package/internal/parse.mjs.map +1 -0
  223. package/internal/request-options.d.mts +77 -0
  224. package/internal/request-options.d.mts.map +1 -0
  225. package/internal/request-options.d.ts +77 -0
  226. package/internal/request-options.d.ts.map +1 -0
  227. package/internal/request-options.js +14 -0
  228. package/internal/request-options.js.map +1 -0
  229. package/internal/request-options.mjs +10 -0
  230. package/internal/request-options.mjs.map +1 -0
  231. package/internal/shim-types.d.mts +17 -0
  232. package/internal/shim-types.d.mts.map +1 -0
  233. package/internal/shim-types.d.ts +17 -0
  234. package/internal/shim-types.d.ts.map +1 -0
  235. package/internal/shim-types.js +4 -0
  236. package/internal/shim-types.js.map +1 -0
  237. package/internal/shim-types.mjs +3 -0
  238. package/internal/shim-types.mjs.map +1 -0
  239. package/internal/shims.d.mts +20 -0
  240. package/internal/shims.d.mts.map +1 -0
  241. package/internal/shims.d.ts +20 -0
  242. package/internal/shims.d.ts.map +1 -0
  243. package/internal/shims.js +92 -0
  244. package/internal/shims.js.map +1 -0
  245. package/internal/shims.mjs +85 -0
  246. package/internal/shims.mjs.map +1 -0
  247. package/internal/stream-utils.d.mts +8 -0
  248. package/internal/stream-utils.d.mts.map +1 -0
  249. package/internal/stream-utils.d.ts +8 -0
  250. package/internal/stream-utils.d.ts.map +1 -0
  251. package/internal/stream-utils.js +38 -0
  252. package/internal/stream-utils.js.map +1 -0
  253. package/internal/stream-utils.mjs +35 -0
  254. package/internal/stream-utils.mjs.map +1 -0
  255. package/internal/to-file.d.mts +45 -0
  256. package/internal/to-file.d.mts.map +1 -0
  257. package/internal/to-file.d.ts +45 -0
  258. package/internal/to-file.d.ts.map +1 -0
  259. package/internal/to-file.js +96 -0
  260. package/internal/to-file.js.map +1 -0
  261. package/internal/to-file.mjs +93 -0
  262. package/internal/to-file.mjs.map +1 -0
  263. package/internal/tslib.js +81 -0
  264. package/internal/tslib.mjs +17 -0
  265. package/internal/types.d.mts +69 -0
  266. package/internal/types.d.mts.map +1 -0
  267. package/internal/types.d.ts +69 -0
  268. package/internal/types.d.ts.map +1 -0
  269. package/internal/types.js +4 -0
  270. package/internal/types.js.map +1 -0
  271. package/internal/types.mjs +3 -0
  272. package/internal/types.mjs.map +1 -0
  273. package/internal/uploads.d.mts +42 -0
  274. package/internal/uploads.d.mts.map +1 -0
  275. package/internal/uploads.d.ts +42 -0
  276. package/internal/uploads.d.ts.map +1 -0
  277. package/internal/uploads.js +145 -0
  278. package/internal/uploads.js.map +1 -0
  279. package/internal/uploads.mjs +135 -0
  280. package/internal/uploads.mjs.map +1 -0
  281. package/internal/utils/base64.d.mts +3 -0
  282. package/internal/utils/base64.d.mts.map +1 -0
  283. package/internal/utils/base64.d.ts +3 -0
  284. package/internal/utils/base64.d.ts.map +1 -0
  285. package/internal/utils/base64.js +38 -0
  286. package/internal/utils/base64.js.map +1 -0
  287. package/internal/utils/base64.mjs +33 -0
  288. package/internal/utils/base64.mjs.map +1 -0
  289. package/internal/utils/bytes.d.mts +4 -0
  290. package/internal/utils/bytes.d.mts.map +1 -0
  291. package/internal/utils/bytes.d.ts +4 -0
  292. package/internal/utils/bytes.d.ts.map +1 -0
  293. package/internal/utils/bytes.js +31 -0
  294. package/internal/utils/bytes.js.map +1 -0
  295. package/internal/utils/bytes.mjs +26 -0
  296. package/internal/utils/bytes.mjs.map +1 -0
  297. package/internal/utils/env.d.mts +9 -0
  298. package/internal/utils/env.d.mts.map +1 -0
  299. package/internal/utils/env.d.ts +9 -0
  300. package/internal/utils/env.d.ts.map +1 -0
  301. package/internal/utils/env.js +22 -0
  302. package/internal/utils/env.js.map +1 -0
  303. package/internal/utils/env.mjs +18 -0
  304. package/internal/utils/env.mjs.map +1 -0
  305. package/internal/utils/log.d.mts +37 -0
  306. package/internal/utils/log.d.mts.map +1 -0
  307. package/internal/utils/log.d.ts +37 -0
  308. package/internal/utils/log.d.ts.map +1 -0
  309. package/internal/utils/log.js +86 -0
  310. package/internal/utils/log.js.map +1 -0
  311. package/internal/utils/log.mjs +80 -0
  312. package/internal/utils/log.mjs.map +1 -0
  313. package/internal/utils/path.d.mts +15 -0
  314. package/internal/utils/path.d.mts.map +1 -0
  315. package/internal/utils/path.d.ts +15 -0
  316. package/internal/utils/path.d.ts.map +1 -0
  317. package/internal/utils/path.js +79 -0
  318. package/internal/utils/path.js.map +1 -0
  319. package/internal/utils/path.mjs +74 -0
  320. package/internal/utils/path.mjs.map +1 -0
  321. package/internal/utils/query.d.mts +5 -0
  322. package/internal/utils/query.d.mts.map +1 -0
  323. package/internal/utils/query.d.ts +5 -0
  324. package/internal/utils/query.d.ts.map +1 -0
  325. package/internal/utils/query.js +23 -0
  326. package/internal/utils/query.js.map +1 -0
  327. package/internal/utils/query.mjs +20 -0
  328. package/internal/utils/query.mjs.map +1 -0
  329. package/internal/utils/sleep.d.mts +2 -0
  330. package/internal/utils/sleep.d.mts.map +1 -0
  331. package/internal/utils/sleep.d.ts +2 -0
  332. package/internal/utils/sleep.d.ts.map +1 -0
  333. package/internal/utils/sleep.js +7 -0
  334. package/internal/utils/sleep.js.map +1 -0
  335. package/internal/utils/sleep.mjs +3 -0
  336. package/internal/utils/sleep.mjs.map +1 -0
  337. package/internal/utils/uuid.d.mts +5 -0
  338. package/internal/utils/uuid.d.mts.map +1 -0
  339. package/internal/utils/uuid.d.ts +5 -0
  340. package/internal/utils/uuid.d.ts.map +1 -0
  341. package/internal/utils/uuid.js +19 -0
  342. package/internal/utils/uuid.js.map +1 -0
  343. package/internal/utils/uuid.mjs +15 -0
  344. package/internal/utils/uuid.mjs.map +1 -0
  345. package/internal/utils/values.d.mts +19 -0
  346. package/internal/utils/values.d.mts.map +1 -0
  347. package/internal/utils/values.d.ts +19 -0
  348. package/internal/utils/values.d.ts.map +1 -0
  349. package/internal/utils/values.js +119 -0
  350. package/internal/utils/values.js.map +1 -0
  351. package/internal/utils/values.mjs +100 -0
  352. package/internal/utils/values.mjs.map +1 -0
  353. package/internal/utils.d.mts +8 -0
  354. package/internal/utils.d.mts.map +1 -0
  355. package/internal/utils.d.ts +8 -0
  356. package/internal/utils.d.ts.map +1 -0
  357. package/internal/utils.js +12 -0
  358. package/internal/utils.js.map +1 -0
  359. package/internal/utils.mjs +9 -0
  360. package/internal/utils.mjs.map +1 -0
  361. package/lib/BetaMessageStream.d.mts +122 -0
  362. package/lib/BetaMessageStream.d.mts.map +1 -0
  363. package/lib/BetaMessageStream.d.ts +122 -0
  364. package/lib/BetaMessageStream.d.ts.map +1 -0
  365. package/lib/BetaMessageStream.js +620 -0
  366. package/lib/BetaMessageStream.js.map +1 -0
  367. package/lib/BetaMessageStream.mjs +616 -0
  368. package/lib/BetaMessageStream.mjs.map +1 -0
  369. package/lib/MessageStream.d.mts +121 -0
  370. package/lib/MessageStream.d.mts.map +1 -0
  371. package/lib/MessageStream.d.ts +121 -0
  372. package/lib/MessageStream.d.ts.map +1 -0
  373. package/lib/MessageStream.js +595 -0
  374. package/lib/MessageStream.js.map +1 -0
  375. package/lib/MessageStream.mjs +591 -0
  376. package/lib/MessageStream.mjs.map +1 -0
  377. package/lib/beta-parser.d.mts +37 -0
  378. package/lib/beta-parser.d.mts.map +1 -0
  379. package/lib/beta-parser.d.ts +37 -0
  380. package/lib/beta-parser.d.ts.map +1 -0
  381. package/lib/beta-parser.js +79 -0
  382. package/lib/beta-parser.js.map +1 -0
  383. package/lib/beta-parser.mjs +75 -0
  384. package/lib/beta-parser.mjs.map +1 -0
  385. package/lib/parser.d.mts +32 -0
  386. package/lib/parser.d.mts.map +1 -0
  387. package/lib/parser.d.ts +32 -0
  388. package/lib/parser.d.ts.map +1 -0
  389. package/lib/parser.js +66 -0
  390. package/lib/parser.js.map +1 -0
  391. package/lib/parser.mjs +62 -0
  392. package/lib/parser.mjs.map +1 -0
  393. package/lib/stainless-helper-header.d.mts +34 -0
  394. package/lib/stainless-helper-header.d.mts.map +1 -0
  395. package/lib/stainless-helper-header.d.ts +34 -0
  396. package/lib/stainless-helper-header.d.ts.map +1 -0
  397. package/lib/stainless-helper-header.js +70 -0
  398. package/lib/stainless-helper-header.js.map +1 -0
  399. package/lib/stainless-helper-header.mjs +63 -0
  400. package/lib/stainless-helper-header.mjs.map +1 -0
  401. package/lib/tools/BetaRunnableTool.d.mts +12 -0
  402. package/lib/tools/BetaRunnableTool.d.mts.map +1 -0
  403. package/lib/tools/BetaRunnableTool.d.ts +12 -0
  404. package/lib/tools/BetaRunnableTool.d.ts.map +1 -0
  405. package/lib/tools/BetaRunnableTool.js +3 -0
  406. package/lib/tools/BetaRunnableTool.js.map +1 -0
  407. package/lib/tools/BetaRunnableTool.mjs +2 -0
  408. package/lib/tools/BetaRunnableTool.mjs.map +1 -0
  409. package/lib/tools/BetaToolRunner.d.mts +141 -0
  410. package/lib/tools/BetaToolRunner.d.mts.map +1 -0
  411. package/lib/tools/BetaToolRunner.d.ts +141 -0
  412. package/lib/tools/BetaToolRunner.d.ts.map +1 -0
  413. package/lib/tools/BetaToolRunner.js +381 -0
  414. package/lib/tools/BetaToolRunner.js.map +1 -0
  415. package/lib/tools/BetaToolRunner.mjs +377 -0
  416. package/lib/tools/BetaToolRunner.mjs.map +1 -0
  417. package/lib/tools/CompactionControl.d.mts +30 -0
  418. package/lib/tools/CompactionControl.d.mts.map +1 -0
  419. package/lib/tools/CompactionControl.d.ts +30 -0
  420. package/lib/tools/CompactionControl.d.ts.map +1 -0
  421. package/lib/tools/CompactionControl.js +28 -0
  422. package/lib/tools/CompactionControl.js.map +1 -0
  423. package/lib/tools/CompactionControl.mjs +25 -0
  424. package/lib/tools/CompactionControl.mjs.map +1 -0
  425. package/lib/tools/ToolError.d.mts +33 -0
  426. package/lib/tools/ToolError.d.mts.map +1 -0
  427. package/lib/tools/ToolError.d.ts +33 -0
  428. package/lib/tools/ToolError.d.ts.map +1 -0
  429. package/lib/tools/ToolError.js +42 -0
  430. package/lib/tools/ToolError.js.map +1 -0
  431. package/lib/tools/ToolError.mjs +38 -0
  432. package/lib/tools/ToolError.mjs.map +1 -0
  433. package/lib/tools/ToolRunner.d.mts +132 -0
  434. package/lib/tools/ToolRunner.d.mts.map +1 -0
  435. package/lib/tools/ToolRunner.d.ts +132 -0
  436. package/lib/tools/ToolRunner.d.ts.map +1 -0
  437. package/lib/tools/ToolRunner.js +294 -0
  438. package/lib/tools/ToolRunner.js.map +1 -0
  439. package/lib/tools/ToolRunner.mjs +290 -0
  440. package/lib/tools/ToolRunner.mjs.map +1 -0
  441. package/lib/transform-json-schema.d.mts +3 -0
  442. package/lib/transform-json-schema.d.mts.map +1 -0
  443. package/lib/transform-json-schema.d.ts +3 -0
  444. package/lib/transform-json-schema.d.ts.map +1 -0
  445. package/lib/transform-json-schema.js +114 -0
  446. package/lib/transform-json-schema.js.map +1 -0
  447. package/lib/transform-json-schema.mjs +111 -0
  448. package/lib/transform-json-schema.mjs.map +1 -0
  449. package/package.json +246 -0
  450. package/pagination.d.mts +2 -0
  451. package/pagination.d.mts.map +1 -0
  452. package/pagination.d.ts +2 -0
  453. package/pagination.d.ts.map +1 -0
  454. package/pagination.js +6 -0
  455. package/pagination.js.map +1 -0
  456. package/pagination.mjs +2 -0
  457. package/pagination.mjs.map +1 -0
  458. package/resource.d.mts +2 -0
  459. package/resource.d.mts.map +1 -0
  460. package/resource.d.ts +2 -0
  461. package/resource.d.ts.map +1 -0
  462. package/resource.js +6 -0
  463. package/resource.js.map +1 -0
  464. package/resource.mjs +2 -0
  465. package/resource.mjs.map +1 -0
  466. package/resources/beta/beta.d.mts +66 -0
  467. package/resources/beta/beta.d.mts.map +1 -0
  468. package/resources/beta/beta.d.ts +66 -0
  469. package/resources/beta/beta.d.ts.map +1 -0
  470. package/resources/beta/beta.js +29 -0
  471. package/resources/beta/beta.js.map +1 -0
  472. package/resources/beta/beta.mjs +24 -0
  473. package/resources/beta/beta.mjs.map +1 -0
  474. package/resources/beta/files.d.mts +151 -0
  475. package/resources/beta/files.d.mts.map +1 -0
  476. package/resources/beta/files.d.ts +151 -0
  477. package/resources/beta/files.d.ts.map +1 -0
  478. package/resources/beta/files.js +124 -0
  479. package/resources/beta/files.js.map +1 -0
  480. package/resources/beta/files.mjs +120 -0
  481. package/resources/beta/files.mjs.map +1 -0
  482. package/resources/beta/index.d.mts +6 -0
  483. package/resources/beta/index.d.mts.map +1 -0
  484. package/resources/beta/index.d.ts +6 -0
  485. package/resources/beta/index.d.ts.map +1 -0
  486. package/resources/beta/index.js +15 -0
  487. package/resources/beta/index.js.map +1 -0
  488. package/resources/beta/index.mjs +7 -0
  489. package/resources/beta/index.mjs.map +1 -0
  490. package/resources/beta/messages/batches.d.mts +646 -0
  491. package/resources/beta/messages/batches.d.mts.map +1 -0
  492. package/resources/beta/messages/batches.d.ts +646 -0
  493. package/resources/beta/messages/batches.d.ts.map +1 -0
  494. package/resources/beta/messages/batches.js +204 -0
  495. package/resources/beta/messages/batches.js.map +1 -0
  496. package/resources/beta/messages/batches.mjs +200 -0
  497. package/resources/beta/messages/batches.mjs.map +1 -0
  498. package/resources/beta/messages/index.d.mts +4 -0
  499. package/resources/beta/messages/index.d.mts.map +1 -0
  500. package/resources/beta/messages/index.d.ts +4 -0
  501. package/resources/beta/messages/index.d.ts.map +1 -0
  502. package/resources/beta/messages/index.js +12 -0
  503. package/resources/beta/messages/index.js.map +1 -0
  504. package/resources/beta/messages/index.mjs +5 -0
  505. package/resources/beta/messages/index.mjs.map +1 -0
  506. package/resources/beta/messages/messages.d.mts +2993 -0
  507. package/resources/beta/messages/messages.d.mts.map +1 -0
  508. package/resources/beta/messages/messages.d.ts +2993 -0
  509. package/resources/beta/messages/messages.d.ts.map +1 -0
  510. package/resources/beta/messages/messages.js +163 -0
  511. package/resources/beta/messages/messages.js.map +1 -0
  512. package/resources/beta/messages/messages.mjs +156 -0
  513. package/resources/beta/messages/messages.mjs.map +1 -0
  514. package/resources/beta/messages.d.mts +2 -0
  515. package/resources/beta/messages.d.mts.map +1 -0
  516. package/resources/beta/messages.d.ts +2 -0
  517. package/resources/beta/messages.d.ts.map +1 -0
  518. package/resources/beta/messages.js +6 -0
  519. package/resources/beta/messages.js.map +1 -0
  520. package/resources/beta/messages.mjs +3 -0
  521. package/resources/beta/messages.mjs.map +1 -0
  522. package/resources/beta/models.d.mts +208 -0
  523. package/resources/beta/models.d.mts.map +1 -0
  524. package/resources/beta/models.d.ts +208 -0
  525. package/resources/beta/models.d.ts.map +1 -0
  526. package/resources/beta/models.js +60 -0
  527. package/resources/beta/models.js.map +1 -0
  528. package/resources/beta/models.mjs +56 -0
  529. package/resources/beta/models.mjs.map +1 -0
  530. package/resources/beta/skills/index.d.mts +3 -0
  531. package/resources/beta/skills/index.d.mts.map +1 -0
  532. package/resources/beta/skills/index.d.ts +3 -0
  533. package/resources/beta/skills/index.d.ts.map +1 -0
  534. package/resources/beta/skills/index.js +9 -0
  535. package/resources/beta/skills/index.js.map +1 -0
  536. package/resources/beta/skills/index.mjs +4 -0
  537. package/resources/beta/skills/index.mjs.map +1 -0
  538. package/resources/beta/skills/skills.d.mts +249 -0
  539. package/resources/beta/skills/skills.d.mts.map +1 -0
  540. package/resources/beta/skills/skills.d.ts +249 -0
  541. package/resources/beta/skills/skills.d.ts.map +1 -0
  542. package/resources/beta/skills/skills.js +98 -0
  543. package/resources/beta/skills/skills.js.map +1 -0
  544. package/resources/beta/skills/skills.mjs +93 -0
  545. package/resources/beta/skills/skills.mjs.map +1 -0
  546. package/resources/beta/skills/versions.d.mts +257 -0
  547. package/resources/beta/skills/versions.d.mts.map +1 -0
  548. package/resources/beta/skills/versions.d.ts +257 -0
  549. package/resources/beta/skills/versions.d.ts.map +1 -0
  550. package/resources/beta/skills/versions.js +100 -0
  551. package/resources/beta/skills/versions.js.map +1 -0
  552. package/resources/beta/skills/versions.mjs +96 -0
  553. package/resources/beta/skills/versions.mjs.map +1 -0
  554. package/resources/beta/skills.d.mts +2 -0
  555. package/resources/beta/skills.d.mts.map +1 -0
  556. package/resources/beta/skills.d.ts +2 -0
  557. package/resources/beta/skills.d.ts.map +1 -0
  558. package/resources/beta/skills.js +6 -0
  559. package/resources/beta/skills.js.map +1 -0
  560. package/resources/beta/skills.mjs +3 -0
  561. package/resources/beta/skills.mjs.map +1 -0
  562. package/resources/beta.d.mts +2 -0
  563. package/resources/beta.d.mts.map +1 -0
  564. package/resources/beta.d.ts +2 -0
  565. package/resources/beta.d.ts.map +1 -0
  566. package/resources/beta.js +6 -0
  567. package/resources/beta.js.map +1 -0
  568. package/resources/beta.mjs +3 -0
  569. package/resources/beta.mjs.map +1 -0
  570. package/resources/completions.d.mts +182 -0
  571. package/resources/completions.d.mts.map +1 -0
  572. package/resources/completions.d.ts +182 -0
  573. package/resources/completions.d.ts.map +1 -0
  574. package/resources/completions.js +23 -0
  575. package/resources/completions.js.map +1 -0
  576. package/resources/completions.mjs +19 -0
  577. package/resources/completions.mjs.map +1 -0
  578. package/resources/index.d.mts +6 -0
  579. package/resources/index.d.mts.map +1 -0
  580. package/resources/index.d.ts +6 -0
  581. package/resources/index.d.ts.map +1 -0
  582. package/resources/index.js +15 -0
  583. package/resources/index.js.map +1 -0
  584. package/resources/index.mjs +7 -0
  585. package/resources/index.mjs.map +1 -0
  586. package/resources/messages/batches.d.mts +304 -0
  587. package/resources/messages/batches.d.mts.map +1 -0
  588. package/resources/messages/batches.d.ts +304 -0
  589. package/resources/messages/batches.d.ts.map +1 -0
  590. package/resources/messages/batches.js +153 -0
  591. package/resources/messages/batches.js.map +1 -0
  592. package/resources/messages/batches.mjs +149 -0
  593. package/resources/messages/batches.mjs.map +1 -0
  594. package/resources/messages/index.d.mts +3 -0
  595. package/resources/messages/index.d.mts.map +1 -0
  596. package/resources/messages/index.d.ts +3 -0
  597. package/resources/messages/index.d.ts.map +1 -0
  598. package/resources/messages/index.js +9 -0
  599. package/resources/messages/index.js.map +1 -0
  600. package/resources/messages/index.mjs +4 -0
  601. package/resources/messages/index.mjs.map +1 -0
  602. package/resources/messages/messages.d.mts +2285 -0
  603. package/resources/messages/messages.d.mts.map +1 -0
  604. package/resources/messages/messages.d.ts +2285 -0
  605. package/resources/messages/messages.d.ts.map +1 -0
  606. package/resources/messages/messages.js +128 -0
  607. package/resources/messages/messages.js.map +1 -0
  608. package/resources/messages/messages.mjs +123 -0
  609. package/resources/messages/messages.mjs.map +1 -0
  610. package/resources/messages.d.mts +2 -0
  611. package/resources/messages.d.mts.map +1 -0
  612. package/resources/messages.d.ts +2 -0
  613. package/resources/messages.d.ts.map +1 -0
  614. package/resources/messages.js +6 -0
  615. package/resources/messages.js.map +1 -0
  616. package/resources/messages.mjs +3 -0
  617. package/resources/messages.mjs.map +1 -0
  618. package/resources/models.d.mts +193 -0
  619. package/resources/models.d.mts.map +1 -0
  620. package/resources/models.d.ts +193 -0
  621. package/resources/models.d.ts.map +1 -0
  622. package/resources/models.js +45 -0
  623. package/resources/models.js.map +1 -0
  624. package/resources/models.mjs +41 -0
  625. package/resources/models.mjs.map +1 -0
  626. package/resources/shared.d.mts +44 -0
  627. package/resources/shared.d.mts.map +1 -0
  628. package/resources/shared.d.ts +44 -0
  629. package/resources/shared.d.ts.map +1 -0
  630. package/resources/shared.js +4 -0
  631. package/resources/shared.js.map +1 -0
  632. package/resources/shared.mjs +3 -0
  633. package/resources/shared.mjs.map +1 -0
  634. package/resources/top-level.d.mts +2 -0
  635. package/resources/top-level.d.mts.map +1 -0
  636. package/resources/top-level.d.ts +2 -0
  637. package/resources/top-level.d.ts.map +1 -0
  638. package/resources/top-level.js +4 -0
  639. package/resources/top-level.js.map +1 -0
  640. package/resources/top-level.mjs +3 -0
  641. package/resources/top-level.mjs.map +1 -0
  642. package/resources.d.mts +2 -0
  643. package/resources.d.mts.map +1 -0
  644. package/resources.d.ts +2 -0
  645. package/resources.d.ts.map +1 -0
  646. package/resources.js +5 -0
  647. package/resources.js.map +1 -0
  648. package/resources.mjs +2 -0
  649. package/resources.mjs.map +1 -0
  650. package/src/_vendor/partial-json-parser/README.md +3 -0
  651. package/src/_vendor/partial-json-parser/parser.ts +264 -0
  652. package/src/ainative.ts +85 -0
  653. package/src/api-promise.ts +2 -0
  654. package/src/client.ts +1326 -0
  655. package/src/core/README.md +3 -0
  656. package/src/core/api-promise.ts +101 -0
  657. package/src/core/error.ts +145 -0
  658. package/src/core/pagination.ts +331 -0
  659. package/src/core/resource.ts +11 -0
  660. package/src/core/streaming.ts +348 -0
  661. package/src/core/uploads.ts +2 -0
  662. package/src/error.ts +2 -0
  663. package/src/helpers/beta/json-schema.ts +75 -0
  664. package/src/helpers/beta/mcp.ts +624 -0
  665. package/src/helpers/beta/memory.ts +28 -0
  666. package/src/helpers/beta/zod.ts +72 -0
  667. package/src/helpers/index.ts +2 -0
  668. package/src/helpers/json-schema.ts +48 -0
  669. package/src/helpers/zod.ts +58 -0
  670. package/src/index.ts +40 -0
  671. package/src/internal/README.md +3 -0
  672. package/src/internal/builtin-types.ts +93 -0
  673. package/src/internal/constants.ts +15 -0
  674. package/src/internal/decoders/jsonl.ts +48 -0
  675. package/src/internal/decoders/line.ts +135 -0
  676. package/src/internal/detect-platform.ts +196 -0
  677. package/src/internal/errors.ts +33 -0
  678. package/src/internal/headers.ts +99 -0
  679. package/src/internal/parse.ts +90 -0
  680. package/src/internal/request-options.ts +93 -0
  681. package/src/internal/shim-types.ts +26 -0
  682. package/src/internal/shims.ts +107 -0
  683. package/src/internal/stream-utils.ts +32 -0
  684. package/src/internal/to-file.ts +159 -0
  685. package/src/internal/types.ts +95 -0
  686. package/src/internal/uploads.ts +204 -0
  687. package/src/internal/utils/base64.ts +40 -0
  688. package/src/internal/utils/bytes.ts +32 -0
  689. package/src/internal/utils/env.ts +18 -0
  690. package/src/internal/utils/log.ts +127 -0
  691. package/src/internal/utils/path.ts +88 -0
  692. package/src/internal/utils/query.ts +23 -0
  693. package/src/internal/utils/sleep.ts +3 -0
  694. package/src/internal/utils/uuid.ts +17 -0
  695. package/src/internal/utils/values.ts +112 -0
  696. package/src/internal/utils.ts +9 -0
  697. package/src/lib/.keep +4 -0
  698. package/src/lib/BetaMessageStream.ts +764 -0
  699. package/src/lib/MessageStream.ts +743 -0
  700. package/src/lib/beta-parser.ts +148 -0
  701. package/src/lib/parser.ts +125 -0
  702. package/src/lib/stainless-helper-header.ts +80 -0
  703. package/src/lib/tools/BetaRunnableTool.ts +40 -0
  704. package/src/lib/tools/BetaToolRunner.ts +494 -0
  705. package/src/lib/tools/CompactionControl.ts +57 -0
  706. package/src/lib/tools/ToolError.ts +47 -0
  707. package/src/lib/tools/ToolRunner.ts +381 -0
  708. package/src/lib/transform-json-schema.ts +124 -0
  709. package/src/pagination.ts +2 -0
  710. package/src/resource.ts +2 -0
  711. package/src/resources/beta/beta.ts +603 -0
  712. package/src/resources/beta/files.ts +261 -0
  713. package/src/resources/beta/index.ts +259 -0
  714. package/src/resources/beta/messages/batches.ts +827 -0
  715. package/src/resources/beta/messages/index.ts +229 -0
  716. package/src/resources/beta/messages/messages.ts +4372 -0
  717. package/src/resources/beta/messages.ts +3 -0
  718. package/src/resources/beta/models.ts +284 -0
  719. package/src/resources/beta/skills/index.ts +26 -0
  720. package/src/resources/beta/skills/skills.ts +384 -0
  721. package/src/resources/beta/skills/versions.ts +374 -0
  722. package/src/resources/beta/skills.ts +3 -0
  723. package/src/resources/beta.ts +3 -0
  724. package/src/resources/completions.ts +230 -0
  725. package/src/resources/index.ts +206 -0
  726. package/src/resources/messages/batches.ts +396 -0
  727. package/src/resources/messages/index.ts +189 -0
  728. package/src/resources/messages/messages.ts +3361 -0
  729. package/src/resources/messages.ts +3 -0
  730. package/src/resources/models.ts +269 -0
  731. package/src/resources/shared.ts +85 -0
  732. package/src/resources/top-level.ts +3 -0
  733. package/src/resources.ts +1 -0
  734. package/src/streaming.ts +2 -0
  735. package/src/tools/memory/node.ts +392 -0
  736. package/src/tsconfig.json +11 -0
  737. package/src/uploads.ts +2 -0
  738. package/src/version.ts +1 -0
  739. package/streaming.d.mts +2 -0
  740. package/streaming.d.mts.map +1 -0
  741. package/streaming.d.ts +2 -0
  742. package/streaming.d.ts.map +1 -0
  743. package/streaming.js +6 -0
  744. package/streaming.js.map +1 -0
  745. package/streaming.mjs +2 -0
  746. package/streaming.mjs.map +1 -0
  747. package/tools/memory/node.d.mts +18 -0
  748. package/tools/memory/node.d.mts.map +1 -0
  749. package/tools/memory/node.d.ts +18 -0
  750. package/tools/memory/node.d.ts.map +1 -0
  751. package/tools/memory/node.js +324 -0
  752. package/tools/memory/node.js.map +1 -0
  753. package/tools/memory/node.mjs +318 -0
  754. package/tools/memory/node.mjs.map +1 -0
  755. package/uploads.d.mts +2 -0
  756. package/uploads.d.mts.map +1 -0
  757. package/uploads.d.ts +2 -0
  758. package/uploads.d.ts.map +1 -0
  759. package/uploads.js +6 -0
  760. package/uploads.js.map +1 -0
  761. package/uploads.mjs +2 -0
  762. package/uploads.mjs.map +1 -0
  763. package/version.d.mts +2 -0
  764. package/version.d.mts.map +1 -0
  765. package/version.d.ts +2 -0
  766. package/version.d.ts.map +1 -0
  767. package/version.js +5 -0
  768. package/version.js.map +1 -0
  769. package/version.mjs +2 -0
  770. package/version.mjs.map +1 -0
@@ -0,0 +1,304 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import * as Shared from "../shared.js";
3
+ import * as MessagesAPI from "./messages.js";
4
+ import { APIPromise } from "../../core/api-promise.js";
5
+ import { Page, type PageParams, PagePromise } from "../../core/pagination.js";
6
+ import { RequestOptions } from "../../internal/request-options.js";
7
+ import { JSONLDecoder } from "../../internal/decoders/jsonl.js";
8
+ export declare class Batches extends APIResource {
9
+ /**
10
+ * Send a batch of Message creation requests.
11
+ *
12
+ * The Message Batches API can be used to process multiple Messages API requests at
13
+ * once. Once a Message Batch is created, it begins processing immediately. Batches
14
+ * can take up to 24 hours to complete.
15
+ *
16
+ * Learn more about the Message Batches API in our
17
+ * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const messageBatch = await client.messages.batches.create({
22
+ * requests: [
23
+ * {
24
+ * custom_id: 'my-custom-id-1',
25
+ * params: {
26
+ * max_tokens: 1024,
27
+ * messages: [
28
+ * { content: 'Hello, world', role: 'user' },
29
+ * ],
30
+ * model: 'claude-opus-4-6',
31
+ * },
32
+ * },
33
+ * ],
34
+ * });
35
+ * ```
36
+ */
37
+ create(body: BatchCreateParams, options?: RequestOptions): APIPromise<MessageBatch>;
38
+ /**
39
+ * This endpoint is idempotent and can be used to poll for Message Batch
40
+ * completion. To access the results of a Message Batch, make a request to the
41
+ * `results_url` field in the response.
42
+ *
43
+ * Learn more about the Message Batches API in our
44
+ * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * const messageBatch = await client.messages.batches.retrieve(
49
+ * 'message_batch_id',
50
+ * );
51
+ * ```
52
+ */
53
+ retrieve(messageBatchID: string, options?: RequestOptions): APIPromise<MessageBatch>;
54
+ /**
55
+ * List all Message Batches within a Workspace. Most recently created batches are
56
+ * returned first.
57
+ *
58
+ * Learn more about the Message Batches API in our
59
+ * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
60
+ *
61
+ * @example
62
+ * ```ts
63
+ * // Automatically fetches more pages as needed.
64
+ * for await (const messageBatch of client.messages.batches.list()) {
65
+ * // ...
66
+ * }
67
+ * ```
68
+ */
69
+ list(query?: BatchListParams | null | undefined, options?: RequestOptions): PagePromise<MessageBatchesPage, MessageBatch>;
70
+ /**
71
+ * Delete a Message Batch.
72
+ *
73
+ * Message Batches can only be deleted once they've finished processing. If you'd
74
+ * like to delete an in-progress batch, you must first cancel it.
75
+ *
76
+ * Learn more about the Message Batches API in our
77
+ * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
78
+ *
79
+ * @example
80
+ * ```ts
81
+ * const deletedMessageBatch =
82
+ * await client.messages.batches.delete('message_batch_id');
83
+ * ```
84
+ */
85
+ delete(messageBatchID: string, options?: RequestOptions): APIPromise<DeletedMessageBatch>;
86
+ /**
87
+ * Batches may be canceled any time before processing ends. Once cancellation is
88
+ * initiated, the batch enters a `canceling` state, at which time the system may
89
+ * complete any in-progress, non-interruptible requests before finalizing
90
+ * cancellation.
91
+ *
92
+ * The number of canceled requests is specified in `request_counts`. To determine
93
+ * which requests were canceled, check the individual results within the batch.
94
+ * Note that cancellation may not result in any canceled requests if they were
95
+ * non-interruptible.
96
+ *
97
+ * Learn more about the Message Batches API in our
98
+ * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
99
+ *
100
+ * @example
101
+ * ```ts
102
+ * const messageBatch = await client.messages.batches.cancel(
103
+ * 'message_batch_id',
104
+ * );
105
+ * ```
106
+ */
107
+ cancel(messageBatchID: string, options?: RequestOptions): APIPromise<MessageBatch>;
108
+ /**
109
+ * Streams the results of a Message Batch as a `.jsonl` file.
110
+ *
111
+ * Each line in the file is a JSON object containing the result of a single request
112
+ * in the Message Batch. Results are not guaranteed to be in the same order as
113
+ * requests. Use the `custom_id` field to match results to requests.
114
+ *
115
+ * Learn more about the Message Batches API in our
116
+ * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
117
+ *
118
+ * @example
119
+ * ```ts
120
+ * const messageBatchIndividualResponse =
121
+ * await client.messages.batches.results('message_batch_id');
122
+ * ```
123
+ */
124
+ results(messageBatchID: string, options?: RequestOptions): Promise<JSONLDecoder<MessageBatchIndividualResponse>>;
125
+ }
126
+ export type MessageBatchesPage = Page<MessageBatch>;
127
+ export interface DeletedMessageBatch {
128
+ /**
129
+ * ID of the Message Batch.
130
+ */
131
+ id: string;
132
+ /**
133
+ * Deleted object type.
134
+ *
135
+ * For Message Batches, this is always `"message_batch_deleted"`.
136
+ */
137
+ type: 'message_batch_deleted';
138
+ }
139
+ export interface MessageBatch {
140
+ /**
141
+ * Unique object identifier.
142
+ *
143
+ * The format and length of IDs may change over time.
144
+ */
145
+ id: string;
146
+ /**
147
+ * RFC 3339 datetime string representing the time at which the Message Batch was
148
+ * archived and its results became unavailable.
149
+ */
150
+ archived_at: string | null;
151
+ /**
152
+ * RFC 3339 datetime string representing the time at which cancellation was
153
+ * initiated for the Message Batch. Specified only if cancellation was initiated.
154
+ */
155
+ cancel_initiated_at: string | null;
156
+ /**
157
+ * RFC 3339 datetime string representing the time at which the Message Batch was
158
+ * created.
159
+ */
160
+ created_at: string;
161
+ /**
162
+ * RFC 3339 datetime string representing the time at which processing for the
163
+ * Message Batch ended. Specified only once processing ends.
164
+ *
165
+ * Processing ends when every request in a Message Batch has either succeeded,
166
+ * errored, canceled, or expired.
167
+ */
168
+ ended_at: string | null;
169
+ /**
170
+ * RFC 3339 datetime string representing the time at which the Message Batch will
171
+ * expire and end processing, which is 24 hours after creation.
172
+ */
173
+ expires_at: string;
174
+ /**
175
+ * Processing status of the Message Batch.
176
+ */
177
+ processing_status: 'in_progress' | 'canceling' | 'ended';
178
+ /**
179
+ * Tallies requests within the Message Batch, categorized by their status.
180
+ *
181
+ * Requests start as `processing` and move to one of the other statuses only once
182
+ * processing of the entire batch ends. The sum of all values always matches the
183
+ * total number of requests in the batch.
184
+ */
185
+ request_counts: MessageBatchRequestCounts;
186
+ /**
187
+ * URL to a `.jsonl` file containing the results of the Message Batch requests.
188
+ * Specified only once processing ends.
189
+ *
190
+ * Results in the file are not guaranteed to be in the same order as requests. Use
191
+ * the `custom_id` field to match results to requests.
192
+ */
193
+ results_url: string | null;
194
+ /**
195
+ * Object type.
196
+ *
197
+ * For Message Batches, this is always `"message_batch"`.
198
+ */
199
+ type: 'message_batch';
200
+ }
201
+ export interface MessageBatchCanceledResult {
202
+ type: 'canceled';
203
+ }
204
+ export interface MessageBatchErroredResult {
205
+ error: Shared.ErrorResponse;
206
+ type: 'errored';
207
+ }
208
+ export interface MessageBatchExpiredResult {
209
+ type: 'expired';
210
+ }
211
+ /**
212
+ * This is a single line in the response `.jsonl` file and does not represent the
213
+ * response as a whole.
214
+ */
215
+ export interface MessageBatchIndividualResponse {
216
+ /**
217
+ * Developer-provided ID created for each request in a Message Batch. Useful for
218
+ * matching results to requests, as results may be given out of request order.
219
+ *
220
+ * Must be unique for each request within the Message Batch.
221
+ */
222
+ custom_id: string;
223
+ /**
224
+ * Processing result for this request.
225
+ *
226
+ * Contains a Message output if processing was successful, an error response if
227
+ * processing failed, or the reason why processing was not attempted, such as
228
+ * cancellation or expiration.
229
+ */
230
+ result: MessageBatchResult;
231
+ }
232
+ export interface MessageBatchRequestCounts {
233
+ /**
234
+ * Number of requests in the Message Batch that have been canceled.
235
+ *
236
+ * This is zero until processing of the entire Message Batch has ended.
237
+ */
238
+ canceled: number;
239
+ /**
240
+ * Number of requests in the Message Batch that encountered an error.
241
+ *
242
+ * This is zero until processing of the entire Message Batch has ended.
243
+ */
244
+ errored: number;
245
+ /**
246
+ * Number of requests in the Message Batch that have expired.
247
+ *
248
+ * This is zero until processing of the entire Message Batch has ended.
249
+ */
250
+ expired: number;
251
+ /**
252
+ * Number of requests in the Message Batch that are processing.
253
+ */
254
+ processing: number;
255
+ /**
256
+ * Number of requests in the Message Batch that have completed successfully.
257
+ *
258
+ * This is zero until processing of the entire Message Batch has ended.
259
+ */
260
+ succeeded: number;
261
+ }
262
+ /**
263
+ * Processing result for this request.
264
+ *
265
+ * Contains a Message output if processing was successful, an error response if
266
+ * processing failed, or the reason why processing was not attempted, such as
267
+ * cancellation or expiration.
268
+ */
269
+ export type MessageBatchResult = MessageBatchSucceededResult | MessageBatchErroredResult | MessageBatchCanceledResult | MessageBatchExpiredResult;
270
+ export interface MessageBatchSucceededResult {
271
+ message: MessagesAPI.Message;
272
+ type: 'succeeded';
273
+ }
274
+ export interface BatchCreateParams {
275
+ /**
276
+ * List of requests for prompt completion. Each is an individual request to create
277
+ * a Message.
278
+ */
279
+ requests: Array<BatchCreateParams.Request>;
280
+ }
281
+ export declare namespace BatchCreateParams {
282
+ interface Request {
283
+ /**
284
+ * Developer-provided ID created for each request in a Message Batch. Useful for
285
+ * matching results to requests, as results may be given out of request order.
286
+ *
287
+ * Must be unique for each request within the Message Batch.
288
+ */
289
+ custom_id: string;
290
+ /**
291
+ * Messages API creation parameters for the individual request.
292
+ *
293
+ * See the [Messages API reference](https://docs.claude.com/en/api/messages) for
294
+ * full documentation on available parameters.
295
+ */
296
+ params: MessagesAPI.MessageCreateParamsNonStreaming;
297
+ }
298
+ }
299
+ export interface BatchListParams extends PageParams {
300
+ }
301
+ export declare namespace Batches {
302
+ export { type DeletedMessageBatch as DeletedMessageBatch, type MessageBatch as MessageBatch, type MessageBatchCanceledResult as MessageBatchCanceledResult, type MessageBatchErroredResult as MessageBatchErroredResult, type MessageBatchExpiredResult as MessageBatchExpiredResult, type MessageBatchIndividualResponse as MessageBatchIndividualResponse, type MessageBatchRequestCounts as MessageBatchRequestCounts, type MessageBatchResult as MessageBatchResult, type MessageBatchSucceededResult as MessageBatchSucceededResult, type MessageBatchesPage as MessageBatchesPage, type BatchCreateParams as BatchCreateParams, type BatchListParams as BatchListParams, };
303
+ }
304
+ //# sourceMappingURL=batches.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batches.d.ts","sourceRoot":"","sources":["../../src/resources/messages/batches.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,KAAK,WAAW;OAChB,EAAE,UAAU,EAAE;OACd,EAAE,IAAI,EAAE,KAAK,UAAU,EAAE,WAAW,EAAE;OAEtC,EAAE,cAAc,EAAE;OAClB,EAAE,YAAY,EAAE;AAIvB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,MAAM,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,YAAY,CAAC;IAInF;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,YAAY,CAAC;IAIpF;;;;;;;;;;;;;;OAcG;IACH,IAAI,CACF,KAAK,GAAE,eAAe,GAAG,IAAI,GAAG,SAAc,EAC9C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,kBAAkB,EAAE,YAAY,CAAC;IAIhD;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,mBAAmB,CAAC;IAIzF;;;;;;;;;;;;;;;;;;;;OAoBG;IAC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AAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;CACH"}
@@ -0,0 +1,153 @@
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.Batches = void 0;
5
+ const resource_1 = require("../../core/resource.js");
6
+ const pagination_1 = require("../../core/pagination.js");
7
+ const headers_1 = require("../../internal/headers.js");
8
+ const jsonl_1 = require("../../internal/decoders/jsonl.js");
9
+ const error_1 = require("../../error.js");
10
+ const path_1 = require("../../internal/utils/path.js");
11
+ class Batches extends resource_1.APIResource {
12
+ /**
13
+ * Send a batch of Message creation requests.
14
+ *
15
+ * The Message Batches API can be used to process multiple Messages API requests at
16
+ * once. Once a Message Batch is created, it begins processing immediately. Batches
17
+ * can take up to 24 hours to complete.
18
+ *
19
+ * Learn more about the Message Batches API in our
20
+ * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * const messageBatch = await client.messages.batches.create({
25
+ * requests: [
26
+ * {
27
+ * custom_id: 'my-custom-id-1',
28
+ * params: {
29
+ * max_tokens: 1024,
30
+ * messages: [
31
+ * { content: 'Hello, world', role: 'user' },
32
+ * ],
33
+ * model: 'claude-opus-4-6',
34
+ * },
35
+ * },
36
+ * ],
37
+ * });
38
+ * ```
39
+ */
40
+ create(body, options) {
41
+ return this._client.post('/v1/messages/batches', { body, ...options });
42
+ }
43
+ /**
44
+ * This endpoint is idempotent and can be used to poll for Message Batch
45
+ * completion. To access the results of a Message Batch, make a request to the
46
+ * `results_url` field in the response.
47
+ *
48
+ * Learn more about the Message Batches API in our
49
+ * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * const messageBatch = await client.messages.batches.retrieve(
54
+ * 'message_batch_id',
55
+ * );
56
+ * ```
57
+ */
58
+ retrieve(messageBatchID, options) {
59
+ return this._client.get((0, path_1.path) `/v1/messages/batches/${messageBatchID}`, options);
60
+ }
61
+ /**
62
+ * List all Message Batches within a Workspace. Most recently created batches are
63
+ * returned first.
64
+ *
65
+ * Learn more about the Message Batches API in our
66
+ * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * // Automatically fetches more pages as needed.
71
+ * for await (const messageBatch of client.messages.batches.list()) {
72
+ * // ...
73
+ * }
74
+ * ```
75
+ */
76
+ list(query = {}, options) {
77
+ return this._client.getAPIList('/v1/messages/batches', (pagination_1.Page), { query, ...options });
78
+ }
79
+ /**
80
+ * Delete a Message Batch.
81
+ *
82
+ * Message Batches can only be deleted once they've finished processing. If you'd
83
+ * like to delete an in-progress batch, you must first cancel it.
84
+ *
85
+ * Learn more about the Message Batches API in our
86
+ * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
87
+ *
88
+ * @example
89
+ * ```ts
90
+ * const deletedMessageBatch =
91
+ * await client.messages.batches.delete('message_batch_id');
92
+ * ```
93
+ */
94
+ delete(messageBatchID, options) {
95
+ return this._client.delete((0, path_1.path) `/v1/messages/batches/${messageBatchID}`, options);
96
+ }
97
+ /**
98
+ * Batches may be canceled any time before processing ends. Once cancellation is
99
+ * initiated, the batch enters a `canceling` state, at which time the system may
100
+ * complete any in-progress, non-interruptible requests before finalizing
101
+ * cancellation.
102
+ *
103
+ * The number of canceled requests is specified in `request_counts`. To determine
104
+ * which requests were canceled, check the individual results within the batch.
105
+ * Note that cancellation may not result in any canceled requests if they were
106
+ * non-interruptible.
107
+ *
108
+ * Learn more about the Message Batches API in our
109
+ * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
110
+ *
111
+ * @example
112
+ * ```ts
113
+ * const messageBatch = await client.messages.batches.cancel(
114
+ * 'message_batch_id',
115
+ * );
116
+ * ```
117
+ */
118
+ cancel(messageBatchID, options) {
119
+ return this._client.post((0, path_1.path) `/v1/messages/batches/${messageBatchID}/cancel`, options);
120
+ }
121
+ /**
122
+ * Streams the results of a Message Batch as a `.jsonl` file.
123
+ *
124
+ * Each line in the file is a JSON object containing the result of a single request
125
+ * in the Message Batch. Results are not guaranteed to be in the same order as
126
+ * requests. Use the `custom_id` field to match results to requests.
127
+ *
128
+ * Learn more about the Message Batches API in our
129
+ * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
130
+ *
131
+ * @example
132
+ * ```ts
133
+ * const messageBatchIndividualResponse =
134
+ * await client.messages.batches.results('message_batch_id');
135
+ * ```
136
+ */
137
+ async results(messageBatchID, options) {
138
+ const batch = await this.retrieve(messageBatchID);
139
+ if (!batch.results_url) {
140
+ throw new error_1.AnthropicError(`No batch \`results_url\`; Has it finished processing? ${batch.processing_status} - ${batch.id}`);
141
+ }
142
+ return this._client
143
+ .get(batch.results_url, {
144
+ ...options,
145
+ headers: (0, headers_1.buildHeaders)([{ Accept: 'application/binary' }, options?.headers]),
146
+ stream: true,
147
+ __binaryResponse: true,
148
+ })
149
+ ._thenUnwrap((_, props) => jsonl_1.JSONLDecoder.fromResponse(props.response, props.controller));
150
+ }
151
+ }
152
+ exports.Batches = Batches;
153
+ //# sourceMappingURL=batches.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batches.js","sourceRoot":"","sources":["../../src/resources/messages/batches.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAIlD,yDAA2E;AAC3E,uDAAsD;AAEtD,4DAA6D;AAC7D,0CAA6C;AAC7C,uDAAiD;AAEjD,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,MAAM,CAAC,IAAuB,EAAE,OAAwB;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI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K,CAAC,WAAW,EAAE;YACtB,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,oBAAoB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAC3E,MAAM,EAAE,IAAI;YACZ,gBAAgB,EAAE,IAAI;SACvB,CAAC;aACD,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,oBAAY,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,CAEvF,CAAC;IACJ,CAAC;CACF;AA5JD,0BA4JC"}
@@ -0,0 +1,149 @@
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 { buildHeaders } from "../../internal/headers.mjs";
5
+ import { JSONLDecoder } from "../../internal/decoders/jsonl.mjs";
6
+ import { AnthropicError } from "../../error.mjs";
7
+ import { path } from "../../internal/utils/path.mjs";
8
+ export class Batches extends APIResource {
9
+ /**
10
+ * Send a batch of Message creation requests.
11
+ *
12
+ * The Message Batches API can be used to process multiple Messages API requests at
13
+ * once. Once a Message Batch is created, it begins processing immediately. Batches
14
+ * can take up to 24 hours to complete.
15
+ *
16
+ * Learn more about the Message Batches API in our
17
+ * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const messageBatch = await client.messages.batches.create({
22
+ * requests: [
23
+ * {
24
+ * custom_id: 'my-custom-id-1',
25
+ * params: {
26
+ * max_tokens: 1024,
27
+ * messages: [
28
+ * { content: 'Hello, world', role: 'user' },
29
+ * ],
30
+ * model: 'claude-opus-4-6',
31
+ * },
32
+ * },
33
+ * ],
34
+ * });
35
+ * ```
36
+ */
37
+ create(body, options) {
38
+ return this._client.post('/v1/messages/batches', { body, ...options });
39
+ }
40
+ /**
41
+ * This endpoint is idempotent and can be used to poll for Message Batch
42
+ * completion. To access the results of a Message Batch, make a request to the
43
+ * `results_url` field in the response.
44
+ *
45
+ * Learn more about the Message Batches API in our
46
+ * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const messageBatch = await client.messages.batches.retrieve(
51
+ * 'message_batch_id',
52
+ * );
53
+ * ```
54
+ */
55
+ retrieve(messageBatchID, options) {
56
+ return this._client.get(path `/v1/messages/batches/${messageBatchID}`, options);
57
+ }
58
+ /**
59
+ * List all Message Batches within a Workspace. Most recently created batches are
60
+ * returned first.
61
+ *
62
+ * Learn more about the Message Batches API in our
63
+ * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * // Automatically fetches more pages as needed.
68
+ * for await (const messageBatch of client.messages.batches.list()) {
69
+ * // ...
70
+ * }
71
+ * ```
72
+ */
73
+ list(query = {}, options) {
74
+ return this._client.getAPIList('/v1/messages/batches', (Page), { query, ...options });
75
+ }
76
+ /**
77
+ * Delete a Message Batch.
78
+ *
79
+ * Message Batches can only be deleted once they've finished processing. If you'd
80
+ * like to delete an in-progress batch, you must first cancel it.
81
+ *
82
+ * Learn more about the Message Batches API in our
83
+ * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
84
+ *
85
+ * @example
86
+ * ```ts
87
+ * const deletedMessageBatch =
88
+ * await client.messages.batches.delete('message_batch_id');
89
+ * ```
90
+ */
91
+ delete(messageBatchID, options) {
92
+ return this._client.delete(path `/v1/messages/batches/${messageBatchID}`, options);
93
+ }
94
+ /**
95
+ * Batches may be canceled any time before processing ends. Once cancellation is
96
+ * initiated, the batch enters a `canceling` state, at which time the system may
97
+ * complete any in-progress, non-interruptible requests before finalizing
98
+ * cancellation.
99
+ *
100
+ * The number of canceled requests is specified in `request_counts`. To determine
101
+ * which requests were canceled, check the individual results within the batch.
102
+ * Note that cancellation may not result in any canceled requests if they were
103
+ * non-interruptible.
104
+ *
105
+ * Learn more about the Message Batches API in our
106
+ * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
107
+ *
108
+ * @example
109
+ * ```ts
110
+ * const messageBatch = await client.messages.batches.cancel(
111
+ * 'message_batch_id',
112
+ * );
113
+ * ```
114
+ */
115
+ cancel(messageBatchID, options) {
116
+ return this._client.post(path `/v1/messages/batches/${messageBatchID}/cancel`, options);
117
+ }
118
+ /**
119
+ * Streams the results of a Message Batch as a `.jsonl` file.
120
+ *
121
+ * Each line in the file is a JSON object containing the result of a single request
122
+ * in the Message Batch. Results are not guaranteed to be in the same order as
123
+ * requests. Use the `custom_id` field to match results to requests.
124
+ *
125
+ * Learn more about the Message Batches API in our
126
+ * [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)
127
+ *
128
+ * @example
129
+ * ```ts
130
+ * const messageBatchIndividualResponse =
131
+ * await client.messages.batches.results('message_batch_id');
132
+ * ```
133
+ */
134
+ async results(messageBatchID, options) {
135
+ const batch = await this.retrieve(messageBatchID);
136
+ if (!batch.results_url) {
137
+ throw new AnthropicError(`No batch \`results_url\`; Has it finished processing? ${batch.processing_status} - ${batch.id}`);
138
+ }
139
+ return this._client
140
+ .get(batch.results_url, {
141
+ ...options,
142
+ headers: buildHeaders([{ Accept: 'application/binary' }, options?.headers]),
143
+ stream: true,
144
+ __binaryResponse: true,
145
+ })
146
+ ._thenUnwrap((_, props) => JSONLDecoder.fromResponse(props.response, props.controller));
147
+ }
148
+ }
149
+ //# sourceMappingURL=batches.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batches.mjs","sourceRoot":"","sources":["../../src/resources/messages/batches.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,IAAI,EAAgC;OACtC,EAAE,YAAY,EAAE;OAEhB,EAAE,YAAY,EAAE;OAChB,EAAE,cAAc,EAAE;OAClB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,OAA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CAAC,iBAAiB,MAAM,KAAK,CAAC,EAAE,EAAE,CACjG,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC,OAAO;aAChB,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE;YACtB,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,oBAAoB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAC3E,MAAM,EAAE,IAAI;YACZ,gBAAgB,EAAE,IAAI;SACvB,CAAC;aACD,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,CAEvF,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,3 @@
1
+ export { Batches, type DeletedMessageBatch, type MessageBatch, type MessageBatchCanceledResult, type MessageBatchErroredResult, type MessageBatchExpiredResult, type MessageBatchIndividualResponse, type MessageBatchRequestCounts, type MessageBatchResult, type MessageBatchSucceededResult, type BatchCreateParams, type BatchListParams, type MessageBatchesPage, } from "./batches.mjs";
2
+ export { Messages, type Base64ImageSource, type Base64PDFSource, type BashCodeExecutionOutputBlock, type BashCodeExecutionOutputBlockParam, type BashCodeExecutionResultBlock, type BashCodeExecutionResultBlockParam, type BashCodeExecutionToolResultBlock, type BashCodeExecutionToolResultBlockParam, type BashCodeExecutionToolResultError, type BashCodeExecutionToolResultErrorCode, type BashCodeExecutionToolResultErrorParam, type CacheControlEphemeral, type CacheCreation, type CitationCharLocation, type CitationCharLocationParam, type CitationContentBlockLocation, type CitationContentBlockLocationParam, type CitationPageLocation, type CitationPageLocationParam, type CitationSearchResultLocationParam, type CitationWebSearchResultLocationParam, type CitationsConfig, type CitationsConfigParam, type CitationsDelta, type CitationsSearchResultLocation, type CitationsWebSearchResultLocation, type CodeExecutionOutputBlock, type CodeExecutionOutputBlockParam, type CodeExecutionResultBlock, type CodeExecutionResultBlockParam, type CodeExecutionTool20250522, type CodeExecutionTool20250825, type CodeExecutionTool20260120, type CodeExecutionToolResultBlock, type CodeExecutionToolResultBlockContent, type CodeExecutionToolResultBlockParam, type CodeExecutionToolResultBlockParamContent, type CodeExecutionToolResultError, type CodeExecutionToolResultErrorCode, type CodeExecutionToolResultErrorParam, type Container, type ContainerUploadBlock, type ContainerUploadBlockParam, type ContentBlock, type ContentBlockParam, type ContentBlockStartEvent, type ContentBlockStopEvent, type ContentBlockSource, type ContentBlockSourceContent, type DirectCaller, type DocumentBlock, type DocumentBlockParam, type EncryptedCodeExecutionResultBlock, type EncryptedCodeExecutionResultBlockParam, type ImageBlockParam, type InputJSONDelta, type JSONOutputFormat, type MemoryTool20250818, type Message, type MessageCountTokensTool, type MessageDeltaEvent, type MessageDeltaUsage, type MessageParam, type MessageTokensCount, type Metadata, type Model, type OutputConfig, type PlainTextSource, type RawContentBlockDelta, type RawContentBlockDeltaEvent, type RawContentBlockStartEvent, type RawContentBlockStopEvent, type RawMessageDeltaEvent, type RawMessageStartEvent, type RawMessageStopEvent, type RawMessageStreamEvent, type RedactedThinkingBlock, type RedactedThinkingBlockParam, type RefusalStopDetails, type SearchResultBlockParam, type ServerToolCaller, type ServerToolCaller20260120, type ServerToolUsage, type ServerToolUseBlock, type ServerToolUseBlockParam, type SignatureDelta, type StopReason, type TextBlock, type TextBlockParam, type TextCitation, type TextCitationParam, type TextDelta, type TextEditorCodeExecutionCreateResultBlock, type TextEditorCodeExecutionCreateResultBlockParam, type TextEditorCodeExecutionStrReplaceResultBlock, type TextEditorCodeExecutionStrReplaceResultBlockParam, type TextEditorCodeExecutionToolResultBlock, type TextEditorCodeExecutionToolResultBlockParam, type TextEditorCodeExecutionToolResultError, type TextEditorCodeExecutionToolResultErrorCode, type TextEditorCodeExecutionToolResultErrorParam, type TextEditorCodeExecutionViewResultBlock, type TextEditorCodeExecutionViewResultBlockParam, type ThinkingBlock, type ThinkingBlockParam, type ThinkingConfigAdaptive, type ThinkingConfigDisabled, type ThinkingConfigEnabled, type ThinkingConfigParam, type ThinkingDelta, type Tool, type ToolBash20250124, type ToolChoice, type ToolChoiceAny, type ToolChoiceAuto, type ToolChoiceNone, type ToolChoiceTool, type ToolReferenceBlock, type ToolReferenceBlockParam, type ToolResultBlockParam, type ToolSearchToolBm25_20251119, type ToolSearchToolRegex20251119, type ToolSearchToolResultBlock, type ToolSearchToolResultBlockParam, type ToolSearchToolResultError, type ToolSearchToolResultErrorCode, type ToolSearchToolResultErrorParam, type ToolSearchToolSearchResultBlock, type ToolSearchToolSearchResultBlockParam, type ToolTextEditor20250124, type ToolTextEditor20250429, type ToolTextEditor20250728, type ToolUnion, type ToolUseBlock, type ToolUseBlockParam, type URLImageSource, type URLPDFSource, type Usage, type UserLocation, type WebFetchBlock, type WebFetchBlockParam, type WebFetchTool20250910, type WebFetchTool20260209, type WebFetchTool20260309, type WebFetchToolResultBlock, type WebFetchToolResultBlockParam, type WebFetchToolResultErrorBlock, type WebFetchToolResultErrorBlockParam, type WebFetchToolResultErrorCode, type WebSearchResultBlock, type WebSearchResultBlockParam, type WebSearchTool20250305, type WebSearchTool20260209, type WebSearchToolRequestError, type WebSearchToolResultBlock, type WebSearchToolResultBlockContent, type WebSearchToolResultBlockParam, type WebSearchToolResultBlockParamContent, type WebSearchToolResultError, type WebSearchToolResultErrorCode, type MessageStreamEvent, type MessageStartEvent, type MessageStopEvent, type ContentBlockDeltaEvent, type MessageCreateParams, type MessageCreateParamsBase, type MessageCreateParamsNonStreaming, type MessageCreateParamsStreaming, type MessageCountTokensParams, } from "./messages.mjs";
3
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/messages/index.ts"],"names":[],"mappings":"OAEO,EACL,OAAO,EACP,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK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Ac,EACnB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC9B,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,EACnC,KAAK,+BAA+B,EACpC,KAAK,oCAAoC,EACzC,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,KAAK,EACV,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EACjC,KAAK,iCAAiC,EACtC,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,+BAA+B,EACpC,KAAK,6BAA6B,EAClC,KAAK,oCAAoC,EACzC,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EACjC,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,+BAA+B,EACpC,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,GAC9B"}
@@ -0,0 +1,3 @@
1
+ export { Batches, type DeletedMessageBatch, type MessageBatch, type MessageBatchCanceledResult, type MessageBatchErroredResult, type MessageBatchExpiredResult, type MessageBatchIndividualResponse, type MessageBatchRequestCounts, type MessageBatchResult, type MessageBatchSucceededResult, type BatchCreateParams, type BatchListParams, type MessageBatchesPage, } from "./batches.js";
2
+ export { Messages, type Base64ImageSource, type Base64PDFSource, type BashCodeExecutionOutputBlock, type BashCodeExecutionOutputBlockParam, type BashCodeExecutionResultBlock, type BashCodeExecutionResultBlockParam, type BashCodeExecutionToolResultBlock, type BashCodeExecutionToolResultBlockParam, type BashCodeExecutionToolResultError, type BashCodeExecutionToolResultErrorCode, type BashCodeExecutionToolResultErrorParam, type CacheControlEphemeral, type CacheCreation, type CitationCharLocation, type CitationCharLocationParam, type CitationContentBlockLocation, type CitationContentBlockLocationParam, type CitationPageLocation, type CitationPageLocationParam, type CitationSearchResultLocationParam, type CitationWebSearchResultLocationParam, type CitationsConfig, type CitationsConfigParam, type CitationsDelta, type CitationsSearchResultLocation, type CitationsWebSearchResultLocation, type CodeExecutionOutputBlock, type CodeExecutionOutputBlockParam, type CodeExecutionResultBlock, type CodeExecutionResultBlockParam, type CodeExecutionTool20250522, type CodeExecutionTool20250825, type CodeExecutionTool20260120, type CodeExecutionToolResultBlock, type CodeExecutionToolResultBlockContent, type CodeExecutionToolResultBlockParam, type CodeExecutionToolResultBlockParamContent, type CodeExecutionToolResultError, type CodeExecutionToolResultErrorCode, type CodeExecutionToolResultErrorParam, type Container, type ContainerUploadBlock, type ContainerUploadBlockParam, type ContentBlock, type ContentBlockParam, type ContentBlockStartEvent, type ContentBlockStopEvent, type ContentBlockSource, type ContentBlockSourceContent, type DirectCaller, type DocumentBlock, type DocumentBlockParam, type EncryptedCodeExecutionResultBlock, type EncryptedCodeExecutionResultBlockParam, type ImageBlockParam, type InputJSONDelta, type JSONOutputFormat, type MemoryTool20250818, type Message, type MessageCountTokensTool, type MessageDeltaEvent, type MessageDeltaUsage, type MessageParam, type MessageTokensCount, type Metadata, type Model, type OutputConfig, type PlainTextSource, type RawContentBlockDelta, type RawContentBlockDeltaEvent, type RawContentBlockStartEvent, type RawContentBlockStopEvent, type RawMessageDeltaEvent, type RawMessageStartEvent, type RawMessageStopEvent, type RawMessageStreamEvent, type RedactedThinkingBlock, type RedactedThinkingBlockParam, type RefusalStopDetails, type SearchResultBlockParam, type ServerToolCaller, type ServerToolCaller20260120, type ServerToolUsage, type ServerToolUseBlock, type ServerToolUseBlockParam, type SignatureDelta, type StopReason, type TextBlock, type TextBlockParam, type TextCitation, type TextCitationParam, type TextDelta, type TextEditorCodeExecutionCreateResultBlock, type TextEditorCodeExecutionCreateResultBlockParam, type TextEditorCodeExecutionStrReplaceResultBlock, type TextEditorCodeExecutionStrReplaceResultBlockParam, type TextEditorCodeExecutionToolResultBlock, type TextEditorCodeExecutionToolResultBlockParam, type TextEditorCodeExecutionToolResultError, type TextEditorCodeExecutionToolResultErrorCode, type TextEditorCodeExecutionToolResultErrorParam, type TextEditorCodeExecutionViewResultBlock, type TextEditorCodeExecutionViewResultBlockParam, type ThinkingBlock, type ThinkingBlockParam, type ThinkingConfigAdaptive, type ThinkingConfigDisabled, type ThinkingConfigEnabled, type ThinkingConfigParam, type ThinkingDelta, type Tool, type ToolBash20250124, type ToolChoice, type ToolChoiceAny, type ToolChoiceAuto, type ToolChoiceNone, type ToolChoiceTool, type ToolReferenceBlock, type ToolReferenceBlockParam, type ToolResultBlockParam, type ToolSearchToolBm25_20251119, type ToolSearchToolRegex20251119, type ToolSearchToolResultBlock, type ToolSearchToolResultBlockParam, type ToolSearchToolResultError, type ToolSearchToolResultErrorCode, type ToolSearchToolResultErrorParam, type ToolSearchToolSearchResultBlock, type ToolSearchToolSearchResultBlockParam, type ToolTextEditor20250124, type ToolTextEditor20250429, type ToolTextEditor20250728, type ToolUnion, type ToolUseBlock, type ToolUseBlockParam, type URLImageSource, type URLPDFSource, type Usage, type UserLocation, type WebFetchBlock, type WebFetchBlockParam, type WebFetchTool20250910, type WebFetchTool20260209, type WebFetchTool20260309, type WebFetchToolResultBlock, type WebFetchToolResultBlockParam, type WebFetchToolResultErrorBlock, type WebFetchToolResultErrorBlockParam, type WebFetchToolResultErrorCode, type WebSearchResultBlock, type WebSearchResultBlockParam, type WebSearchTool20250305, type WebSearchTool20260209, type WebSearchToolRequestError, type WebSearchToolResultBlock, type WebSearchToolResultBlockContent, type WebSearchToolResultBlockParam, type WebSearchToolResultBlockParamContent, type WebSearchToolResultError, type WebSearchToolResultErrorCode, type MessageStreamEvent, type MessageStartEvent, type MessageStopEvent, type ContentBlockDeltaEvent, type MessageCreateParams, type MessageCreateParamsBase, type MessageCreateParamsNonStreaming, type MessageCreateParamsStreaming, type MessageCountTokensParams, } from "./messages.js";
3
+ //# sourceMappingURL=index.d.ts.map