@anthropic-ai/sdk 0.34.0-alpha.0 → 0.36.2

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 (496) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/README.md +19 -17
  3. package/_shims/MultipartBody.d.ts +9 -0
  4. package/_shims/MultipartBody.d.ts.map +1 -0
  5. package/_shims/MultipartBody.js +16 -0
  6. package/_shims/MultipartBody.js.map +1 -0
  7. package/_shims/MultipartBody.mjs +12 -0
  8. package/_shims/MultipartBody.mjs.map +1 -0
  9. package/_shims/README.md +46 -0
  10. package/_shims/auto/runtime-bun.d.ts +5 -0
  11. package/_shims/auto/runtime-bun.d.ts.map +1 -0
  12. package/{internal/utils.js → _shims/auto/runtime-bun.js} +5 -8
  13. package/_shims/auto/runtime-bun.js.map +1 -0
  14. package/_shims/auto/runtime-bun.mjs +2 -0
  15. package/_shims/auto/runtime-bun.mjs.map +1 -0
  16. package/_shims/auto/runtime-node.d.ts +5 -0
  17. package/_shims/auto/runtime-node.d.ts.map +1 -0
  18. package/_shims/auto/runtime-node.js +21 -0
  19. package/_shims/auto/runtime-node.js.map +1 -0
  20. package/_shims/auto/runtime-node.mjs +2 -0
  21. package/_shims/auto/runtime-node.mjs.map +1 -0
  22. package/_shims/auto/runtime.d.ts +5 -0
  23. package/_shims/auto/runtime.d.ts.map +1 -0
  24. package/_shims/auto/runtime.js +21 -0
  25. package/_shims/auto/runtime.js.map +1 -0
  26. package/_shims/auto/runtime.mjs +2 -0
  27. package/_shims/auto/runtime.mjs.map +1 -0
  28. package/_shims/auto/types-node.d.ts +5 -0
  29. package/_shims/auto/types-node.d.ts.map +1 -0
  30. package/_shims/auto/types-node.js +21 -0
  31. package/_shims/auto/types-node.js.map +1 -0
  32. package/_shims/auto/types-node.mjs +2 -0
  33. package/_shims/auto/types-node.mjs.map +1 -0
  34. package/_shims/auto/types.d.ts +101 -0
  35. package/_shims/auto/types.js +3 -0
  36. package/_shims/auto/types.mjs +3 -0
  37. package/_shims/bun-runtime.d.ts +6 -0
  38. package/_shims/bun-runtime.d.ts.map +1 -0
  39. package/_shims/bun-runtime.js +14 -0
  40. package/_shims/bun-runtime.js.map +1 -0
  41. package/_shims/bun-runtime.mjs +10 -0
  42. package/_shims/bun-runtime.mjs.map +1 -0
  43. package/_shims/index.d.ts +81 -0
  44. package/_shims/index.js +13 -0
  45. package/_shims/index.mjs +7 -0
  46. package/_shims/manual-types.d.ts +12 -0
  47. package/_shims/manual-types.js +3 -0
  48. package/_shims/manual-types.mjs +3 -0
  49. package/_shims/node-runtime.d.ts +3 -0
  50. package/_shims/node-runtime.d.ts.map +1 -0
  51. package/_shims/node-runtime.js +89 -0
  52. package/_shims/node-runtime.js.map +1 -0
  53. package/_shims/node-runtime.mjs +56 -0
  54. package/_shims/node-runtime.mjs.map +1 -0
  55. package/_shims/node-types.d.ts +42 -0
  56. package/_shims/node-types.js +3 -0
  57. package/_shims/node-types.mjs +3 -0
  58. package/_shims/registry.d.ts +37 -0
  59. package/_shims/registry.d.ts.map +1 -0
  60. package/_shims/registry.js +41 -0
  61. package/_shims/registry.js.map +1 -0
  62. package/_shims/registry.mjs +37 -0
  63. package/_shims/registry.mjs.map +1 -0
  64. package/_shims/web-runtime.d.ts +5 -0
  65. package/_shims/web-runtime.d.ts.map +1 -0
  66. package/_shims/web-runtime.js +78 -0
  67. package/_shims/web-runtime.js.map +1 -0
  68. package/_shims/web-runtime.mjs +71 -0
  69. package/_shims/web-runtime.mjs.map +1 -0
  70. package/_shims/web-types.d.ts +83 -0
  71. package/_shims/web-types.js +3 -0
  72. package/_shims/web-types.mjs +3 -0
  73. package/core.d.ts +248 -0
  74. package/core.d.ts.map +1 -0
  75. package/core.js +929 -0
  76. package/core.js.map +1 -0
  77. package/core.mjs +897 -0
  78. package/core.mjs.map +1 -0
  79. package/error.d.ts +2 -2
  80. package/error.d.ts.map +1 -1
  81. package/error.js +3 -3
  82. package/error.js.map +1 -1
  83. package/error.mjs +2 -2
  84. package/error.mjs.map +1 -1
  85. package/index.d.mts +150 -5
  86. package/index.d.ts +150 -5
  87. package/index.d.ts.map +1 -1
  88. package/index.js +159 -18
  89. package/index.js.map +1 -1
  90. package/index.mjs +133 -5
  91. package/index.mjs.map +1 -1
  92. package/internal/decoders/jsonl.d.ts +1 -0
  93. package/internal/decoders/jsonl.d.ts.map +1 -1
  94. package/internal/decoders/jsonl.js +2 -2
  95. package/internal/decoders/jsonl.js.map +1 -1
  96. package/internal/decoders/jsonl.mjs +2 -2
  97. package/internal/decoders/jsonl.mjs.map +1 -1
  98. package/internal/decoders/line.d.ts +0 -1
  99. package/internal/decoders/line.d.ts.map +1 -1
  100. package/internal/stream-utils.d.ts +8 -0
  101. package/internal/stream-utils.d.ts.map +1 -0
  102. package/internal/stream-utils.js +39 -0
  103. package/internal/stream-utils.js.map +1 -0
  104. package/internal/stream-utils.mjs +35 -0
  105. package/internal/stream-utils.mjs.map +1 -0
  106. package/lib/{MessageStream.d.mts → BetaMessageStream.d.ts} +39 -22
  107. package/lib/BetaMessageStream.d.ts.map +1 -0
  108. package/lib/BetaMessageStream.js +492 -0
  109. package/lib/BetaMessageStream.js.map +1 -0
  110. package/lib/BetaMessageStream.mjs +488 -0
  111. package/lib/BetaMessageStream.mjs.map +1 -0
  112. package/lib/MessageStream.d.ts +25 -8
  113. package/lib/MessageStream.d.ts.map +1 -1
  114. package/lib/MessageStream.js +42 -9
  115. package/lib/MessageStream.js.map +1 -1
  116. package/lib/MessageStream.mjs +42 -9
  117. package/lib/MessageStream.mjs.map +1 -1
  118. package/package.json +64 -120
  119. package/pagination.d.ts +4 -41
  120. package/pagination.d.ts.map +1 -1
  121. package/pagination.js +21 -95
  122. package/pagination.js.map +1 -1
  123. package/pagination.mjs +19 -91
  124. package/pagination.mjs.map +1 -1
  125. package/resource.d.ts +3 -3
  126. package/resource.d.ts.map +1 -1
  127. package/resource.js.map +1 -1
  128. package/resource.mjs.map +1 -1
  129. package/resources/beta/beta.d.ts +3 -3
  130. package/resources/beta/beta.d.ts.map +1 -1
  131. package/resources/beta/beta.js +1 -0
  132. package/resources/beta/beta.js.map +1 -1
  133. package/resources/beta/beta.mjs +2 -1
  134. package/resources/beta/beta.mjs.map +1 -1
  135. package/resources/beta/index.d.ts +2 -2
  136. package/resources/beta/index.d.ts.map +1 -1
  137. package/resources/beta/index.js +4 -3
  138. package/resources/beta/index.js.map +1 -1
  139. package/resources/beta/index.mjs +1 -1
  140. package/resources/beta/index.mjs.map +1 -1
  141. package/resources/beta/messages/batches.d.ts +20 -14
  142. package/resources/beta/messages/batches.d.ts.map +1 -1
  143. package/resources/beta/messages/batches.js +36 -47
  144. package/resources/beta/messages/batches.js.map +1 -1
  145. package/resources/beta/messages/batches.mjs +34 -46
  146. package/resources/beta/messages/batches.mjs.map +1 -1
  147. package/resources/beta/messages/index.d.ts +2 -2
  148. package/resources/beta/messages/index.d.ts.map +1 -1
  149. package/resources/beta/messages/index.js +2 -1
  150. package/resources/beta/messages/index.js.map +1 -1
  151. package/resources/beta/messages/index.mjs +1 -1
  152. package/resources/beta/messages/index.mjs.map +1 -1
  153. package/resources/beta/messages/messages.d.ts +95 -10
  154. package/resources/beta/messages/messages.d.ts.map +1 -1
  155. package/resources/beta/messages/messages.js +21 -0
  156. package/resources/beta/messages/messages.js.map +1 -1
  157. package/resources/beta/messages/messages.mjs +22 -1
  158. package/resources/beta/messages/messages.mjs.map +1 -1
  159. package/resources/beta/models.d.ts +8 -7
  160. package/resources/beta/models.d.ts.map +1 -1
  161. package/resources/beta/models.js +12 -10
  162. package/resources/beta/models.js.map +1 -1
  163. package/resources/beta/models.mjs +10 -9
  164. package/resources/beta/models.mjs.map +1 -1
  165. package/resources/completions.d.ts +5 -5
  166. package/resources/completions.d.ts.map +1 -1
  167. package/resources/completions.js.map +1 -1
  168. package/resources/completions.mjs.map +1 -1
  169. package/resources/index.d.ts +2 -2
  170. package/resources/index.d.ts.map +1 -1
  171. package/resources/index.js +2 -1
  172. package/resources/index.js.map +1 -1
  173. package/resources/index.mjs +1 -1
  174. package/resources/index.mjs.map +1 -1
  175. package/resources/messages/batches.d.ts +16 -14
  176. package/resources/messages/batches.d.ts.map +1 -1
  177. package/resources/messages/batches.js +30 -18
  178. package/resources/messages/batches.js.map +1 -1
  179. package/resources/messages/batches.mjs +28 -17
  180. package/resources/messages/batches.mjs.map +1 -1
  181. package/resources/messages/index.d.ts +2 -2
  182. package/resources/messages/index.d.ts.map +1 -1
  183. package/resources/messages/index.js +2 -1
  184. package/resources/messages/index.js.map +1 -1
  185. package/resources/messages/index.mjs +1 -1
  186. package/resources/messages/index.mjs.map +1 -1
  187. package/resources/messages/messages.d.ts +90 -11
  188. package/resources/messages/messages.d.ts.map +1 -1
  189. package/resources/messages/messages.js +4 -0
  190. package/resources/messages/messages.js.map +1 -1
  191. package/resources/messages/messages.mjs +5 -1
  192. package/resources/messages/messages.mjs.map +1 -1
  193. package/resources/models.d.ts +8 -7
  194. package/resources/models.d.ts.map +1 -1
  195. package/resources/models.js +12 -10
  196. package/resources/models.js.map +1 -1
  197. package/resources/models.mjs +10 -9
  198. package/resources/models.mjs.map +1 -1
  199. package/shims/node.d.ts +30 -0
  200. package/shims/node.d.ts.map +1 -0
  201. package/shims/node.js +31 -0
  202. package/shims/node.js.map +1 -0
  203. package/shims/node.mjs +5 -0
  204. package/shims/node.mjs.map +1 -0
  205. package/shims/web.d.ts +26 -0
  206. package/shims/web.d.ts.map +1 -0
  207. package/shims/web.js +31 -0
  208. package/shims/web.js.map +1 -0
  209. package/shims/web.mjs +5 -0
  210. package/shims/web.mjs.map +1 -0
  211. package/src/_shims/MultipartBody.ts +9 -0
  212. package/src/_shims/README.md +46 -0
  213. package/src/_shims/auto/runtime-bun.ts +4 -0
  214. package/src/_shims/auto/runtime-node.ts +4 -0
  215. package/src/_shims/auto/runtime.ts +4 -0
  216. package/src/_shims/auto/types-node.ts +4 -0
  217. package/src/_shims/auto/types.d.ts +101 -0
  218. package/src/_shims/auto/types.js +3 -0
  219. package/src/_shims/auto/types.mjs +3 -0
  220. package/src/_shims/bun-runtime.ts +14 -0
  221. package/src/_shims/index.d.ts +81 -0
  222. package/src/_shims/index.js +13 -0
  223. package/src/_shims/index.mjs +7 -0
  224. package/src/_shims/manual-types.d.ts +12 -0
  225. package/src/_shims/manual-types.js +3 -0
  226. package/src/_shims/manual-types.mjs +3 -0
  227. package/src/_shims/node-runtime.ts +81 -0
  228. package/src/_shims/node-types.d.ts +42 -0
  229. package/src/_shims/node-types.js +3 -0
  230. package/src/_shims/node-types.mjs +3 -0
  231. package/src/_shims/registry.ts +67 -0
  232. package/src/_shims/web-runtime.ts +103 -0
  233. package/src/_shims/web-types.d.ts +83 -0
  234. package/src/_shims/web-types.js +3 -0
  235. package/src/_shims/web-types.mjs +3 -0
  236. package/src/core.ts +1242 -0
  237. package/src/error.ts +3 -3
  238. package/src/index.ts +432 -12
  239. package/src/internal/decoders/jsonl.ts +5 -4
  240. package/src/internal/decoders/line.ts +1 -1
  241. package/src/internal/stream-utils.ts +32 -0
  242. package/src/lib/BetaMessageStream.ts +599 -0
  243. package/src/lib/MessageStream.ts +58 -20
  244. package/src/pagination.ts +18 -122
  245. package/src/resource.ts +3 -3
  246. package/src/resources/beta/beta.ts +33 -6
  247. package/src/resources/beta/index.ts +16 -3
  248. package/src/resources/beta/messages/batches.ts +94 -42
  249. package/src/resources/beta/messages/index.ts +17 -3
  250. package/src/resources/beta/messages/messages.ts +202 -18
  251. package/src/resources/beta/models.ts +22 -12
  252. package/src/resources/completions.ts +13 -10
  253. package/src/resources/index.ts +18 -5
  254. package/src/resources/messages/batches.ts +46 -28
  255. package/src/resources/messages/index.ts +16 -3
  256. package/src/resources/messages/messages.ts +174 -22
  257. package/src/resources/models.ts +19 -12
  258. package/src/shims/node.ts +50 -0
  259. package/src/shims/web.ts +50 -0
  260. package/src/streaming.ts +15 -42
  261. package/src/tsconfig.json +1 -1
  262. package/src/uploads.ts +54 -57
  263. package/src/version.ts +1 -1
  264. package/streaming.d.ts +1 -8
  265. package/streaming.d.ts.map +1 -1
  266. package/streaming.js +8 -41
  267. package/streaming.js.map +1 -1
  268. package/streaming.mjs +7 -39
  269. package/streaming.mjs.map +1 -1
  270. package/uploads.d.ts +19 -23
  271. package/uploads.d.ts.map +1 -1
  272. package/uploads.js +27 -33
  273. package/uploads.js.map +1 -1
  274. package/uploads.mjs +21 -29
  275. package/uploads.mjs.map +1 -1
  276. package/version.d.ts +1 -1
  277. package/version.d.ts.map +1 -1
  278. package/version.js +1 -1
  279. package/version.js.map +1 -1
  280. package/version.mjs +1 -1
  281. package/version.mjs.map +1 -1
  282. package/_vendor/partial-json-parser/parser.d.mts +0 -3
  283. package/_vendor/partial-json-parser/parser.d.mts.map +0 -1
  284. package/api-promise.d.mts +0 -48
  285. package/api-promise.d.mts.map +0 -1
  286. package/api-promise.d.ts +0 -48
  287. package/api-promise.d.ts.map +0 -1
  288. package/api-promise.js +0 -71
  289. package/api-promise.js.map +0 -1
  290. package/api-promise.mjs +0 -67
  291. package/api-promise.mjs.map +0 -1
  292. package/client.d.mts +0 -212
  293. package/client.d.mts.map +0 -1
  294. package/client.d.ts +0 -212
  295. package/client.d.ts.map +0 -1
  296. package/client.js +0 -505
  297. package/client.js.map +0 -1
  298. package/client.mjs +0 -477
  299. package/client.mjs.map +0 -1
  300. package/error.d.mts +0 -48
  301. package/error.d.mts.map +0 -1
  302. package/index.d.mts.map +0 -1
  303. package/internal/builtin-types.d.mts +0 -65
  304. package/internal/builtin-types.d.mts.map +0 -1
  305. package/internal/builtin-types.d.ts +0 -65
  306. package/internal/builtin-types.d.ts.map +0 -1
  307. package/internal/builtin-types.js +0 -4
  308. package/internal/builtin-types.js.map +0 -1
  309. package/internal/builtin-types.mjs +0 -3
  310. package/internal/builtin-types.mjs.map +0 -1
  311. package/internal/decoders/jsonl.d.mts +0 -11
  312. package/internal/decoders/jsonl.d.mts.map +0 -1
  313. package/internal/decoders/line.d.mts +0 -21
  314. package/internal/decoders/line.d.mts.map +0 -1
  315. package/internal/detect-platform.d.mts +0 -15
  316. package/internal/detect-platform.d.mts.map +0 -1
  317. package/internal/detect-platform.d.ts +0 -15
  318. package/internal/detect-platform.d.ts.map +0 -1
  319. package/internal/detect-platform.js +0 -162
  320. package/internal/detect-platform.js.map +0 -1
  321. package/internal/detect-platform.mjs +0 -157
  322. package/internal/detect-platform.mjs.map +0 -1
  323. package/internal/errors.d.mts +0 -3
  324. package/internal/errors.d.mts.map +0 -1
  325. package/internal/errors.d.ts +0 -3
  326. package/internal/errors.d.ts.map +0 -1
  327. package/internal/errors.js +0 -22
  328. package/internal/errors.js.map +0 -1
  329. package/internal/errors.mjs +0 -17
  330. package/internal/errors.mjs.map +0 -1
  331. package/internal/headers.d.mts +0 -21
  332. package/internal/headers.d.mts.map +0 -1
  333. package/internal/headers.d.ts +0 -21
  334. package/internal/headers.d.ts.map +0 -1
  335. package/internal/headers.js +0 -77
  336. package/internal/headers.js.map +0 -1
  337. package/internal/headers.mjs +0 -72
  338. package/internal/headers.mjs.map +0 -1
  339. package/internal/parse.d.mts +0 -14
  340. package/internal/parse.d.mts.map +0 -1
  341. package/internal/parse.d.ts +0 -14
  342. package/internal/parse.d.ts.map +0 -1
  343. package/internal/parse.js +0 -48
  344. package/internal/parse.js.map +0 -1
  345. package/internal/parse.mjs +0 -43
  346. package/internal/parse.mjs.map +0 -1
  347. package/internal/polyfill/crypto.node.d.ts +0 -10
  348. package/internal/polyfill/crypto.node.js +0 -11
  349. package/internal/polyfill/crypto.node.mjs +0 -2
  350. package/internal/polyfill/file.node.d.ts +0 -9
  351. package/internal/polyfill/file.node.js +0 -17
  352. package/internal/polyfill/file.node.mjs +0 -9
  353. package/internal/request-options.d.mts +0 -37
  354. package/internal/request-options.d.mts.map +0 -1
  355. package/internal/request-options.d.ts +0 -37
  356. package/internal/request-options.d.ts.map +0 -1
  357. package/internal/request-options.js +0 -40
  358. package/internal/request-options.js.map +0 -1
  359. package/internal/request-options.mjs +0 -35
  360. package/internal/request-options.mjs.map +0 -1
  361. package/internal/shim-types.d.mts +0 -28
  362. package/internal/shim-types.d.ts +0 -28
  363. package/internal/shims.d.mts +0 -65
  364. package/internal/shims.d.mts.map +0 -1
  365. package/internal/shims.d.ts +0 -65
  366. package/internal/shims.d.ts.map +0 -1
  367. package/internal/shims.js +0 -66
  368. package/internal/shims.js.map +0 -1
  369. package/internal/shims.mjs +0 -58
  370. package/internal/shims.mjs.map +0 -1
  371. package/internal/types.d.mts +0 -6
  372. package/internal/types.d.mts.map +0 -1
  373. package/internal/types.d.ts +0 -6
  374. package/internal/types.d.ts.map +0 -1
  375. package/internal/types.js +0 -4
  376. package/internal/types.js.map +0 -1
  377. package/internal/types.mjs +0 -3
  378. package/internal/types.mjs.map +0 -1
  379. package/internal/utils/base64.d.mts +0 -3
  380. package/internal/utils/base64.d.mts.map +0 -1
  381. package/internal/utils/base64.d.ts +0 -3
  382. package/internal/utils/base64.d.ts.map +0 -1
  383. package/internal/utils/base64.js +0 -33
  384. package/internal/utils/base64.js.map +0 -1
  385. package/internal/utils/base64.mjs +0 -28
  386. package/internal/utils/base64.mjs.map +0 -1
  387. package/internal/utils/env.d.mts +0 -9
  388. package/internal/utils/env.d.mts.map +0 -1
  389. package/internal/utils/env.d.ts +0 -9
  390. package/internal/utils/env.d.ts.map +0 -1
  391. package/internal/utils/env.js +0 -22
  392. package/internal/utils/env.js.map +0 -1
  393. package/internal/utils/env.mjs +0 -18
  394. package/internal/utils/env.mjs.map +0 -1
  395. package/internal/utils/log.d.mts +0 -2
  396. package/internal/utils/log.d.mts.map +0 -1
  397. package/internal/utils/log.d.ts +0 -2
  398. package/internal/utils/log.d.ts.map +0 -1
  399. package/internal/utils/log.js +0 -12
  400. package/internal/utils/log.js.map +0 -1
  401. package/internal/utils/log.mjs +0 -8
  402. package/internal/utils/log.mjs.map +0 -1
  403. package/internal/utils/sleep.d.mts +0 -2
  404. package/internal/utils/sleep.d.mts.map +0 -1
  405. package/internal/utils/sleep.d.ts +0 -2
  406. package/internal/utils/sleep.d.ts.map +0 -1
  407. package/internal/utils/sleep.js +0 -7
  408. package/internal/utils/sleep.js.map +0 -1
  409. package/internal/utils/sleep.mjs +0 -3
  410. package/internal/utils/sleep.mjs.map +0 -1
  411. package/internal/utils/uuid.d.mts +0 -5
  412. package/internal/utils/uuid.d.mts.map +0 -1
  413. package/internal/utils/uuid.d.ts +0 -5
  414. package/internal/utils/uuid.d.ts.map +0 -1
  415. package/internal/utils/uuid.js +0 -15
  416. package/internal/utils/uuid.js.map +0 -1
  417. package/internal/utils/uuid.mjs +0 -11
  418. package/internal/utils/uuid.mjs.map +0 -1
  419. package/internal/utils/values.d.mts +0 -15
  420. package/internal/utils/values.d.mts.map +0 -1
  421. package/internal/utils/values.d.ts +0 -15
  422. package/internal/utils/values.d.ts.map +0 -1
  423. package/internal/utils/values.js +0 -100
  424. package/internal/utils/values.js.map +0 -1
  425. package/internal/utils/values.mjs +0 -84
  426. package/internal/utils/values.mjs.map +0 -1
  427. package/internal/utils.d.mts +0 -7
  428. package/internal/utils.d.mts.map +0 -1
  429. package/internal/utils.d.ts +0 -7
  430. package/internal/utils.d.ts.map +0 -1
  431. package/internal/utils.js.map +0 -1
  432. package/internal/utils.mjs +0 -8
  433. package/internal/utils.mjs.map +0 -1
  434. package/lib/MessageStream.d.mts.map +0 -1
  435. package/pagination.d.mts +0 -63
  436. package/pagination.d.mts.map +0 -1
  437. package/resource.d.mts +0 -6
  438. package/resource.d.mts.map +0 -1
  439. package/resources/beta/beta.d.mts +0 -57
  440. package/resources/beta/beta.d.mts.map +0 -1
  441. package/resources/beta/index.d.mts +0 -4
  442. package/resources/beta/index.d.mts.map +0 -1
  443. package/resources/beta/messages/batches.d.mts +0 -261
  444. package/resources/beta/messages/batches.d.mts.map +0 -1
  445. package/resources/beta/messages/index.d.mts +0 -3
  446. package/resources/beta/messages/index.d.mts.map +0 -1
  447. package/resources/beta/messages/messages.d.mts +0 -879
  448. package/resources/beta/messages/messages.d.mts.map +0 -1
  449. package/resources/beta/models.d.mts +0 -48
  450. package/resources/beta/models.d.mts.map +0 -1
  451. package/resources/completions.d.mts +0 -166
  452. package/resources/completions.d.mts.map +0 -1
  453. package/resources/index.d.mts +0 -6
  454. package/resources/index.d.mts.map +0 -1
  455. package/resources/messages/batches.d.mts +0 -229
  456. package/resources/messages/batches.d.mts.map +0 -1
  457. package/resources/messages/index.d.mts +0 -3
  458. package/resources/messages/index.d.mts.map +0 -1
  459. package/resources/messages/messages.d.mts +0 -859
  460. package/resources/messages/messages.d.mts.map +0 -1
  461. package/resources/models.d.mts +0 -48
  462. package/resources/models.d.mts.map +0 -1
  463. package/resources/shared.d.mts +0 -42
  464. package/resources/shared.d.mts.map +0 -1
  465. package/resources/top-level.d.mts +0 -2
  466. package/resources/top-level.d.mts.map +0 -1
  467. package/src/api-promise.ts +0 -93
  468. package/src/client.ts +0 -863
  469. package/src/internal/builtin-types.ts +0 -79
  470. package/src/internal/detect-platform.ts +0 -192
  471. package/src/internal/errors.ts +0 -18
  472. package/src/internal/headers.ts +0 -96
  473. package/src/internal/parse.ts +0 -70
  474. package/src/internal/polyfill/crypto.node.d.ts +0 -10
  475. package/src/internal/polyfill/crypto.node.js +0 -11
  476. package/src/internal/polyfill/crypto.node.mjs +0 -2
  477. package/src/internal/polyfill/file.node.d.ts +0 -9
  478. package/src/internal/polyfill/file.node.js +0 -17
  479. package/src/internal/polyfill/file.node.mjs +0 -9
  480. package/src/internal/request-options.ts +0 -71
  481. package/src/internal/shim-types.d.ts +0 -28
  482. package/src/internal/shims.ts +0 -124
  483. package/src/internal/types.ts +0 -6
  484. package/src/internal/utils/base64.ts +0 -40
  485. package/src/internal/utils/env.ts +0 -20
  486. package/src/internal/utils/log.ts +0 -9
  487. package/src/internal/utils/sleep.ts +0 -3
  488. package/src/internal/utils/uuid.ts +0 -13
  489. package/src/internal/utils/values.ts +0 -94
  490. package/src/internal/utils.ts +0 -8
  491. package/streaming.d.mts +0 -41
  492. package/streaming.d.mts.map +0 -1
  493. package/uploads.d.mts +0 -79
  494. package/uploads.d.mts.map +0 -1
  495. package/version.d.mts +0 -2
  496. package/version.d.mts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,97 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.36.2 (2025-01-23)
4
+
5
+ Full Changelog: [sdk-v0.36.1...sdk-v0.36.2](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.36.1...sdk-v0.36.2)
6
+
7
+ ### Bug Fixes
8
+
9
+ * **bedrock:** update streaming util import ([255c059](https://github.com/anthropics/anthropic-sdk-typescript/commit/255c0599e333e6fae582255e3b0631538b168c69))
10
+
11
+ ## 0.36.1 (2025-01-23)
12
+
13
+ Full Changelog: [sdk-v0.36.0...sdk-v0.36.1](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.36.0...sdk-v0.36.1)
14
+
15
+ ### Chores
16
+
17
+ * **tests:** fix types ([9efe3ee](https://github.com/anthropics/anthropic-sdk-typescript/commit/9efe3eebf64bd762a34caf362a1cd1a0f0858f92))
18
+
19
+ ## 0.36.0 (2025-01-23)
20
+
21
+ Full Changelog: [sdk-v0.35.0...sdk-v0.36.0](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.35.0...sdk-v0.36.0)
22
+
23
+ ### Features
24
+
25
+ * **api:** add citations ([#668](https://github.com/anthropics/anthropic-sdk-typescript/issues/668)) ([1fef177](https://github.com/anthropics/anthropic-sdk-typescript/commit/1fef17749adbbeb243480b96c04941be29c0746c))
26
+ * **client:** support results endpoint ([#666](https://github.com/anthropics/anthropic-sdk-typescript/issues/666)) ([db5fffe](https://github.com/anthropics/anthropic-sdk-typescript/commit/db5fffeb38a99a3e9283ebf001fbf767d756162e))
27
+ * **stream:** expose `response` property as well ([b0235c7](https://github.com/anthropics/anthropic-sdk-typescript/commit/b0235c7b3ac174b3c8e670e381b4aa038e61c826))
28
+
29
+
30
+ ### Chores
31
+
32
+ * **bedrock:** bump dependency on @anthropic-ai/sdk ([8745ca2](https://github.com/anthropics/anthropic-sdk-typescript/commit/8745ca2160f5af4d89e5732a44e560c5e2787aa8))
33
+ * **internal:** fix import ([628b55e](https://github.com/anthropics/anthropic-sdk-typescript/commit/628b55ef5ff8f0245287ecaea688480a0174e2e9))
34
+ * **internal:** minor restructuring ([#664](https://github.com/anthropics/anthropic-sdk-typescript/issues/664)) ([57aefa7](https://github.com/anthropics/anthropic-sdk-typescript/commit/57aefa73230d54da24d787a89adc277481986d02))
35
+ * **vertex:** bump dependency on @anthropic-ai/sdk ([a1c7fcd](https://github.com/anthropics/anthropic-sdk-typescript/commit/a1c7fcdce081f860cbb1148c3862e3303ddb8a62))
36
+
37
+ ## 0.35.0 (2025-01-21)
38
+
39
+ Full Changelog: [sdk-v0.34.0...sdk-v0.35.0](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.34.0...sdk-v0.35.0)
40
+
41
+ ### Features
42
+
43
+ * add beta message streaming helpers ([#655](https://github.com/anthropics/anthropic-sdk-typescript/issues/655)) ([d7b5af1](https://github.com/anthropics/anthropic-sdk-typescript/commit/d7b5af1629dbcefdb7bfdca271ab497567830227))
44
+ * **stream:** add `.withResponse()` ([#654](https://github.com/anthropics/anthropic-sdk-typescript/issues/654)) ([b54477f](https://github.com/anthropics/anthropic-sdk-typescript/commit/b54477f20c92db4c2c5ed89af5d46c36b035bf1e))
45
+ * **streaming:** add `.request_id` getter ([4572478](https://github.com/anthropics/anthropic-sdk-typescript/commit/4572478266a67e12e32ffef69817cbc495943b1d))
46
+
47
+
48
+ ### Bug Fixes
49
+
50
+ * **docs:** correct results return type ([#657](https://github.com/anthropics/anthropic-sdk-typescript/issues/657)) ([4e6d031](https://github.com/anthropics/anthropic-sdk-typescript/commit/4e6d031a41625ebf9c4311638e0c149179fcae0c))
51
+ * **examples:** add token counting example ([2498e2e](https://github.com/anthropics/anthropic-sdk-typescript/commit/2498e2eaf49d66a664ed1fdcd7bbd331979cf5b2))
52
+ * send correct Accept header for certain endpoints ([#651](https://github.com/anthropics/anthropic-sdk-typescript/issues/651)) ([17ffaeb](https://github.com/anthropics/anthropic-sdk-typescript/commit/17ffaeba5af48d13b08483973b82cfe1ae79347f))
53
+ * **vertex:** add beta.messages.countTokens method ([51d3f23](https://github.com/anthropics/anthropic-sdk-typescript/commit/51d3f23a7cc1bea798cc8e4041e08114ebc3a4eb))
54
+
55
+
56
+ ### Chores
57
+
58
+ * deprecate more models ([661f5f9](https://github.com/anthropics/anthropic-sdk-typescript/commit/661f5f9d9b24f3661df246dcf101dd9812b3e19e))
59
+ * **internal:** add test ([#660](https://github.com/anthropics/anthropic-sdk-typescript/issues/660)) ([3ec7d1a](https://github.com/anthropics/anthropic-sdk-typescript/commit/3ec7d1a9eea30255b24cdb16c1a26705bdfea0ac))
60
+ * **internal:** temporary revert commit ([#643](https://github.com/anthropics/anthropic-sdk-typescript/issues/643)) ([43dd43c](https://github.com/anthropics/anthropic-sdk-typescript/commit/43dd43c4c8ab69d5a60e59473af7dff5f7799048))
61
+ * **internal:** update examples ([#649](https://github.com/anthropics/anthropic-sdk-typescript/issues/649)) ([036a239](https://github.com/anthropics/anthropic-sdk-typescript/commit/036a239800fec7e6cbc439f125101d5475eae5b3))
62
+ * **types:** add `| undefined` to client options properties ([#656](https://github.com/anthropics/anthropic-sdk-typescript/issues/656)) ([d642298](https://github.com/anthropics/anthropic-sdk-typescript/commit/d642298334529ff95b9d7ac497d548a6b04dbcfb))
63
+
64
+
65
+ ### Documentation
66
+
67
+ * **readme:** fix misplaced period ([#650](https://github.com/anthropics/anthropic-sdk-typescript/issues/650)) ([8754744](https://github.com/anthropics/anthropic-sdk-typescript/commit/87547448c8b4bf69a61756af1f12927f33b68680))
68
+ * **readme:** fix Request IDs example ([#659](https://github.com/anthropics/anthropic-sdk-typescript/issues/659)) ([6d3162d](https://github.com/anthropics/anthropic-sdk-typescript/commit/6d3162da1ddb964b75e575376f278468ba1ed9f5))
69
+
70
+ ## 0.34.0 (2024-12-20)
71
+
72
+ Full Changelog: [sdk-v0.33.1...sdk-v0.34.0](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.33.1...sdk-v0.34.0)
73
+
74
+ ### Features
75
+
76
+ * **api:** add message batch delete endpoint ([#640](https://github.com/anthropics/anthropic-sdk-typescript/issues/640)) ([54f7e1f](https://github.com/anthropics/anthropic-sdk-typescript/commit/54f7e1ffb9a2956ee27a4a715b84717aa681eb7c))
77
+
78
+
79
+ ### Bug Fixes
80
+
81
+ * **client:** normalize method ([#639](https://github.com/anthropics/anthropic-sdk-typescript/issues/639)) ([384bb04](https://github.com/anthropics/anthropic-sdk-typescript/commit/384bb042dd854ed753c6bd8e25f522d0e042bfbf))
82
+
83
+
84
+ ### Chores
85
+
86
+ * bump testing data uri ([#637](https://github.com/anthropics/anthropic-sdk-typescript/issues/637)) ([3f23530](https://github.com/anthropics/anthropic-sdk-typescript/commit/3f23530fb55d9fec7278967ea02600e44e9f58e2))
87
+ * **internal:** temporary revert commit ([#643](https://github.com/anthropics/anthropic-sdk-typescript/issues/643)) ([8057b1e](https://github.com/anthropics/anthropic-sdk-typescript/commit/8057b1eb67ccccee042a45f2efe53cccced15682))
88
+
89
+
90
+ ### Documentation
91
+
92
+ * minor formatting changes ([#641](https://github.com/anthropics/anthropic-sdk-typescript/issues/641)) ([8b362ee](https://github.com/anthropics/anthropic-sdk-typescript/commit/8b362ee72954b31b4de920b35aed97255efa5e2e))
93
+ * **readme:** add alpha callout ([#646](https://github.com/anthropics/anthropic-sdk-typescript/issues/646)) ([640304c](https://github.com/anthropics/anthropic-sdk-typescript/commit/640304c7c7e8bc67cbf799a646169736d89ad4c8))
94
+
3
95
  ## 0.33.1 (2024-12-17)
4
96
 
5
97
  Full Changelog: [sdk-v0.33.0...sdk-v0.33.1](https://github.com/anthropics/anthropic-sdk-typescript/compare/sdk-v0.33.0...sdk-v0.33.1)
package/README.md CHANGED
@@ -1,3 +1,9 @@
1
+ > [!IMPORTANT]
2
+ > We're actively working on a new alpha version that migrates from `node-fetch` to builtin fetch.
3
+ >
4
+ > Please try it out and let us know if you run into any issues!
5
+ > https://github.com/anthropics/anthropic-sdk-typescript/issues/645
6
+
1
7
  # Anthropic TypeScript API Library
2
8
 
3
9
  [![NPM version](https://img.shields.io/npm/v/@anthropic-ai/sdk.svg)](https://npmjs.org/package/@anthropic-ai/sdk) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@anthropic-ai/sdk)
@@ -235,7 +241,7 @@ All object responses in the SDK provide a `_request_id` property which is added
235
241
 
236
242
  ```ts
237
243
  const message = await client.messages.create({ max_tokens: 1024, messages: [{ role: 'user', content: 'Hello, Claude' }], model: 'claude-3-5-sonnet-latest' });
238
- console.log(completion._request_id) // req_018EeWyXxfu5pfWkrYcMdjWG
244
+ console.log(message._request_id) // req_018EeWyXxfu5pfWkrYcMdjWG
239
245
  ```
240
246
 
241
247
 
@@ -414,23 +420,21 @@ validate or strip extra properties from the response from the API.
414
420
 
415
421
  ### Customizing the fetch client
416
422
 
417
- By default, this library expects a global `fetch` function is defined.
423
+ By default, this library uses `node-fetch` in Node, and expects a global `fetch` function in other environments.
418
424
 
419
- If you want to use a different `fetch` function, you can either polyfill the global:
425
+ If you would prefer to use a global, web-standards-compliant `fetch` function even in a Node environment,
426
+ (for example, if you are running Node with `--experimental-fetch` or using NextJS which polyfills with `undici`),
427
+ add the following import before your first import `from "Anthropic"`:
420
428
 
421
429
  ```ts
422
- import fetch from 'my-fetch';
423
-
424
- globalThis.fetch = fetch;
430
+ // Tell TypeScript and the package to use the global web fetch instead of node-fetch.
431
+ // Note, despite the name, this does not add any polyfills, but expects them to be provided if needed.
432
+ import '@anthropic-ai/sdk/shims/web';
433
+ import Anthropic from '@anthropic-ai/sdk';
425
434
  ```
426
435
 
427
- Or pass it to the client:
428
-
429
- ```ts
430
- import fetch from 'my-fetch';
431
-
432
- const client = new Anthropic({ fetch });
433
- ```
436
+ To do the inverse, add `import "@anthropic-ai/sdk/shims/node"` (which does import polyfills).
437
+ This can also be useful if you are getting the wrong TypeScript types for `Response` ([more details](https://github.com/anthropics/anthropic-sdk-typescript/tree/main/src/_shims#readme)).
434
438
 
435
439
  ### Logging and middleware
436
440
 
@@ -483,14 +487,12 @@ await client.messages.create(
483
487
  );
484
488
  ```
485
489
 
486
- ## Frequently Asked Questions
487
-
488
490
  ## Semantic versioning
489
491
 
490
492
  This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
491
493
 
492
494
  1. Changes that only affect static types, without breaking runtime behavior.
493
- 2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_.
495
+ 2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_
494
496
  3. Changes that we do not expect to impact the vast majority of users in practice.
495
497
 
496
498
  We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
@@ -499,7 +501,7 @@ We are keen for your feedback; please open an [issue](https://www.github.com/ant
499
501
 
500
502
  ## Requirements
501
503
 
502
- TypeScript >= 4.9 is supported.
504
+ TypeScript >= 4.5 is supported.
503
505
 
504
506
  The following runtimes are supported:
505
507
 
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export declare class MultipartBody {
5
+ body: any;
6
+ constructor(body: any);
7
+ get [Symbol.toStringTag](): string;
8
+ }
9
+ //# sourceMappingURL=MultipartBody.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultipartBody.d.ts","sourceRoot":"","sources":["../src/_shims/MultipartBody.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,aAAa;IACL,IAAI,EAAE,GAAG;gBAAT,IAAI,EAAE,GAAG;IAC5B,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAEjC;CACF"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MultipartBody = void 0;
4
+ /**
5
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
6
+ */
7
+ class MultipartBody {
8
+ constructor(body) {
9
+ this.body = body;
10
+ }
11
+ get [Symbol.toStringTag]() {
12
+ return 'MultipartBody';
13
+ }
14
+ }
15
+ exports.MultipartBody = MultipartBody;
16
+ //# sourceMappingURL=MultipartBody.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultipartBody.js","sourceRoot":"","sources":["../src/_shims/MultipartBody.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAa,aAAa;IACxB,YAAmB,IAAS;QAAT,SAAI,GAAJ,IAAI,CAAK;IAAG,CAAC;IAChC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACtB,OAAO,eAAe,CAAC;IACzB,CAAC;CACF;AALD,sCAKC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export class MultipartBody {
5
+ constructor(body) {
6
+ this.body = body;
7
+ }
8
+ get [Symbol.toStringTag]() {
9
+ return 'MultipartBody';
10
+ }
11
+ }
12
+ //# sourceMappingURL=MultipartBody.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultipartBody.mjs","sourceRoot":"","sources":["../src/_shims/MultipartBody.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,OAAO,aAAa;IACxB,YAAmB,IAAS;QAAT,SAAI,GAAJ,IAAI,CAAK;IAAG,CAAC;IAChC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACtB,OAAO,eAAe,CAAC;IACzB,CAAC;CACF"}
@@ -0,0 +1,46 @@
1
+ # 👋 Wondering what everything in here does?
2
+
3
+ `@anthropic-ai/sdk` supports a wide variety of runtime environments like Node.js, Deno, Bun, browsers, and various
4
+ edge runtimes, as well as both CommonJS (CJS) and EcmaScript Modules (ESM).
5
+
6
+ To do this, `@anthropic-ai/sdk` provides shims for either using `node-fetch` when in Node (because `fetch` is still experimental there) or the global `fetch` API built into the environment when not in Node.
7
+
8
+ It uses [conditional exports](https://nodejs.org/api/packages.html#conditional-exports) to
9
+ automatically select the correct shims for each environment. However, conditional exports are a fairly new
10
+ feature and not supported everywhere. For instance, the TypeScript `"moduleResolution": "node"`
11
+
12
+ setting doesn't consult the `exports` map, compared to `"moduleResolution": "nodeNext"`, which does.
13
+ Unfortunately that's still the default setting, and it can result in errors like
14
+ getting the wrong raw `Response` type from `.asResponse()`, for example.
15
+
16
+ The user can work around these issues by manually importing one of:
17
+
18
+ - `import '@anthropic-ai/sdk/shims/node'`
19
+ - `import '@anthropic-ai/sdk/shims/web'`
20
+
21
+ All of the code here in `_shims` handles selecting the automatic default shims or manual overrides.
22
+
23
+ ### How it works - Runtime
24
+
25
+ Runtime shims get installed by calling `setShims` exported by `@anthropic-ai/sdk/_shims/registry`.
26
+
27
+ Manually importing `@anthropic-ai/sdk/shims/node` or `@anthropic-ai/sdk/shims/web`, calls `setShims` with the respective runtime shims.
28
+
29
+ All client code imports shims from `@anthropic-ai/sdk/_shims/index`, which:
30
+
31
+ - checks if shims have been set manually
32
+ - if not, calls `setShims` with the shims from `@anthropic-ai/sdk/_shims/auto/runtime`
33
+ - re-exports the installed shims from `@anthropic-ai/sdk/_shims/registry`.
34
+
35
+ `@anthropic-ai/sdk/_shims/auto/runtime` exports web runtime shims.
36
+ If the `node` export condition is set, the export map replaces it with `@anthropic-ai/sdk/_shims/auto/runtime-node`.
37
+
38
+ ### How it works - Type time
39
+
40
+ All client code imports shim types from `@anthropic-ai/sdk/_shims/index`, which selects the manual types from `@anthropic-ai/sdk/_shims/manual-types` if they have been declared, otherwise it exports the auto types from `@anthropic-ai/sdk/_shims/auto/types`.
41
+
42
+ `@anthropic-ai/sdk/_shims/manual-types` exports an empty namespace.
43
+ Manually importing `@anthropic-ai/sdk/shims/node` or `@anthropic-ai/sdk/shims/web` merges declarations into this empty namespace, so they get picked up by `@anthropic-ai/sdk/_shims/index`.
44
+
45
+ `@anthropic-ai/sdk/_shims/auto/types` exports web type definitions.
46
+ If the `node` export condition is set, the export map replaces it with `@anthropic-ai/sdk/_shims/auto/types-node`, though TS only picks this up if `"moduleResolution": "nodenext"` or `"moduleResolution": "bundler"`.
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export * from "../bun-runtime.js";
5
+ //# sourceMappingURL=runtime-bun.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-bun.d.ts","sourceRoot":"","sources":["../../src/_shims/auto/runtime-bun.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,gBAAgB,CAAC"}
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
3
  if (k2 === undefined) k2 = k;
5
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -15,10 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
15
  };
17
16
  Object.defineProperty(exports, "__esModule", { value: true });
18
- __exportStar(require("./utils/values.js"), exports);
19
- __exportStar(require("./utils/base64.js"), exports);
20
- __exportStar(require("./utils/env.js"), exports);
21
- __exportStar(require("./utils/log.js"), exports);
22
- __exportStar(require("./utils/uuid.js"), exports);
23
- __exportStar(require("./utils/sleep.js"), exports);
24
- //# sourceMappingURL=utils.js.map
17
+ /**
18
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
19
+ */
20
+ __exportStar(require("../bun-runtime.js"), exports);
21
+ //# sourceMappingURL=runtime-bun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-bun.js","sourceRoot":"","sources":["../../src/_shims/auto/runtime-bun.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,oDAA+B"}
@@ -0,0 +1,2 @@
1
+ export * from "../bun-runtime.mjs";
2
+ //# sourceMappingURL=runtime-bun.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-bun.mjs","sourceRoot":"","sources":["../../src/_shims/auto/runtime-bun.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export * from "../node-runtime.js";
5
+ //# sourceMappingURL=runtime-node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-node.d.ts","sourceRoot":"","sources":["../../src/_shims/auto/runtime-node.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /**
18
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
19
+ */
20
+ __exportStar(require("../node-runtime.js"), exports);
21
+ //# sourceMappingURL=runtime-node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-node.js","sourceRoot":"","sources":["../../src/_shims/auto/runtime-node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,qDAAgC"}
@@ -0,0 +1,2 @@
1
+ export * from "../node-runtime.mjs";
2
+ //# sourceMappingURL=runtime-node.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-node.mjs","sourceRoot":"","sources":["../../src/_shims/auto/runtime-node.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export * from "../web-runtime.js";
5
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/_shims/auto/runtime.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /**
18
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
19
+ */
20
+ __exportStar(require("../web-runtime.js"), exports);
21
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/_shims/auto/runtime.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,oDAA+B"}
@@ -0,0 +1,2 @@
1
+ export * from "../web-runtime.mjs";
2
+ //# sourceMappingURL=runtime.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.mjs","sourceRoot":"","sources":["../../src/_shims/auto/runtime.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export * from "../node-types.js";
5
+ //# sourceMappingURL=types-node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-node.d.ts","sourceRoot":"","sources":["../../src/_shims/auto/types-node.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,eAAe,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /**
18
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
19
+ */
20
+ __exportStar(require("../node-types.js"), exports);
21
+ //# sourceMappingURL=types-node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-node.js","sourceRoot":"","sources":["../../src/_shims/auto/types-node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,mDAA8B"}
@@ -0,0 +1,2 @@
1
+ export * from "../node-types.mjs";
2
+ //# sourceMappingURL=types-node.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-node.mjs","sourceRoot":"","sources":["../../src/_shims/auto/types-node.ts"],"names":[],"mappings":""}
@@ -0,0 +1,101 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export type Agent = any;
5
+
6
+ // @ts-ignore
7
+ declare const _fetch: unknown extends typeof fetch ? never : typeof fetch;
8
+ export { _fetch as fetch };
9
+
10
+ // @ts-ignore
11
+ type _Request = unknown extends Request ? never : Request;
12
+ export { _Request as Request };
13
+
14
+ // @ts-ignore
15
+ type _RequestInfo = unknown extends RequestInfo ? never : RequestInfo;
16
+ export { type _RequestInfo as RequestInfo };
17
+
18
+ // @ts-ignore
19
+ type _RequestInit = unknown extends RequestInit ? never : RequestInit;
20
+ export { type _RequestInit as RequestInit };
21
+
22
+ // @ts-ignore
23
+ type _Response = unknown extends Response ? never : Response;
24
+ export { _Response as Response };
25
+
26
+ // @ts-ignore
27
+ type _ResponseInit = unknown extends ResponseInit ? never : ResponseInit;
28
+ export { type _ResponseInit as ResponseInit };
29
+
30
+ // @ts-ignore
31
+ type _ResponseType = unknown extends ResponseType ? never : ResponseType;
32
+ export { type _ResponseType as ResponseType };
33
+
34
+ // @ts-ignore
35
+ type _BodyInit = unknown extends BodyInit ? never : BodyInit;
36
+ export { type _BodyInit as BodyInit };
37
+
38
+ // @ts-ignore
39
+ type _Headers = unknown extends Headers ? never : Headers;
40
+ export { _Headers as Headers };
41
+
42
+ // @ts-ignore
43
+ type _HeadersInit = unknown extends HeadersInit ? never : HeadersInit;
44
+ export { type _HeadersInit as HeadersInit };
45
+
46
+ type EndingType = 'native' | 'transparent';
47
+
48
+ export interface BlobPropertyBag {
49
+ endings?: EndingType;
50
+ type?: string;
51
+ }
52
+
53
+ export interface FilePropertyBag extends BlobPropertyBag {
54
+ lastModified?: number;
55
+ }
56
+
57
+ export type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
58
+
59
+ // @ts-ignore
60
+ type _FormData = unknown extends FormData ? never : FormData;
61
+ // @ts-ignore
62
+ declare const _FormData: unknown extends typeof FormData ? never : typeof FormData;
63
+ export { _FormData as FormData };
64
+
65
+ // @ts-ignore
66
+ type _File = unknown extends File ? never : File;
67
+ // @ts-ignore
68
+ declare const _File: unknown extends typeof File ? never : typeof File;
69
+ export { _File as File };
70
+
71
+ // @ts-ignore
72
+ type _Blob = unknown extends Blob ? never : Blob;
73
+ // @ts-ignore
74
+ declare const _Blob: unknown extends typeof Blob ? never : typeof Blob;
75
+ export { _Blob as Blob };
76
+
77
+ export declare class Readable {
78
+ readable: boolean;
79
+ readonly readableEnded: boolean;
80
+ readonly readableFlowing: boolean | null;
81
+ readonly readableHighWaterMark: number;
82
+ readonly readableLength: number;
83
+ readonly readableObjectMode: boolean;
84
+ destroyed: boolean;
85
+ read(size?: number): any;
86
+ pause(): this;
87
+ resume(): this;
88
+ isPaused(): boolean;
89
+ destroy(error?: Error): this;
90
+ [Symbol.asyncIterator](): AsyncIterableIterator<any>;
91
+ }
92
+
93
+ export declare class FsReadStream extends Readable {
94
+ path: {}; // node type is string | Buffer
95
+ }
96
+
97
+ // @ts-ignore
98
+ type _ReadableStream<R = any> = unknown extends ReadableStream<R> ? never : ReadableStream<R>;
99
+ // @ts-ignore
100
+ declare const _ReadableStream: unknown extends typeof ReadableStream ? never : typeof ReadableStream;
101
+ export { _ReadableStream as ReadableStream };
@@ -0,0 +1,3 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
@@ -0,0 +1,3 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ import { type Shims } from "./registry.js";
5
+ export declare function getRuntime(): Shims;
6
+ //# sourceMappingURL=bun-runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bun-runtime.d.ts","sourceRoot":"","sources":["../src/_shims/bun-runtime.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAIxC,wBAAgB,UAAU,IAAI,KAAK,CAMlC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRuntime = void 0;
4
+ const web_runtime_1 = require("./web-runtime.js");
5
+ const node_fs_1 = require("node:fs");
6
+ function getRuntime() {
7
+ const runtime = (0, web_runtime_1.getRuntime)();
8
+ function isFsReadStream(value) {
9
+ return value instanceof node_fs_1.ReadStream;
10
+ }
11
+ return { ...runtime, isFsReadStream };
12
+ }
13
+ exports.getRuntime = getRuntime;
14
+ //# sourceMappingURL=bun-runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bun-runtime.js","sourceRoot":"","sources":["../src/_shims/bun-runtime.ts"],"names":[],"mappings":";;;AAIA,kDAA4D;AAC5D,qCAAqD;AAErD,SAAgB,UAAU;IACxB,MAAM,OAAO,GAAG,IAAA,wBAAa,GAAE,CAAC;IAChC,SAAS,cAAc,CAAC,KAAU;QAChC,OAAO,KAAK,YAAY,oBAAY,CAAC;IACvC,CAAC;IACD,OAAO,EAAE,GAAG,OAAO,EAAE,cAAc,EAAE,CAAC;AACxC,CAAC;AAND,gCAMC"}
@@ -0,0 +1,10 @@
1
+ import { getRuntime as getWebRuntime } from "./web-runtime.mjs";
2
+ import { ReadStream as FsReadStream } from 'node:fs';
3
+ export function getRuntime() {
4
+ const runtime = getWebRuntime();
5
+ function isFsReadStream(value) {
6
+ return value instanceof FsReadStream;
7
+ }
8
+ return { ...runtime, isFsReadStream };
9
+ }
10
+ //# sourceMappingURL=bun-runtime.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bun-runtime.mjs","sourceRoot":"","sources":["../src/_shims/bun-runtime.ts"],"names":[],"mappings":"OAIO,EAAE,UAAU,IAAI,aAAa,EAAE;OAC/B,EAAE,UAAU,IAAI,YAAY,EAAE,MAAM,SAAS;AAEpD,MAAM,UAAU,UAAU;IACxB,MAAM,OAAO,GAAG,aAAa,EAAE,CAAC;IAChC,SAAS,cAAc,CAAC,KAAU;QAChC,OAAO,KAAK,YAAY,YAAY,CAAC;IACvC,CAAC;IACD,OAAO,EAAE,GAAG,OAAO,EAAE,cAAc,EAAE,CAAC;AACxC,CAAC"}