@anthropic-ai/claude-code 0.2.29 → 0.2.31

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 (415) hide show
  1. package/cli.mjs +443 -692
  2. package/package.json +1 -5
  3. package/vendor/sdk/CHANGELOG.md +0 -1421
  4. package/vendor/sdk/LICENSE +0 -8
  5. package/vendor/sdk/README.md +0 -536
  6. package/vendor/sdk/_shims/MultipartBody.d.ts +0 -9
  7. package/vendor/sdk/_shims/MultipartBody.d.ts.map +0 -1
  8. package/vendor/sdk/_shims/MultipartBody.js +0 -16
  9. package/vendor/sdk/_shims/MultipartBody.js.map +0 -1
  10. package/vendor/sdk/_shims/MultipartBody.mjs +0 -12
  11. package/vendor/sdk/_shims/MultipartBody.mjs.map +0 -1
  12. package/vendor/sdk/_shims/README.md +0 -46
  13. package/vendor/sdk/_shims/auto/runtime-bun.d.ts +0 -5
  14. package/vendor/sdk/_shims/auto/runtime-bun.d.ts.map +0 -1
  15. package/vendor/sdk/_shims/auto/runtime-bun.js +0 -21
  16. package/vendor/sdk/_shims/auto/runtime-bun.js.map +0 -1
  17. package/vendor/sdk/_shims/auto/runtime-bun.mjs +0 -2
  18. package/vendor/sdk/_shims/auto/runtime-bun.mjs.map +0 -1
  19. package/vendor/sdk/_shims/auto/runtime-node.d.ts +0 -5
  20. package/vendor/sdk/_shims/auto/runtime-node.d.ts.map +0 -1
  21. package/vendor/sdk/_shims/auto/runtime-node.js +0 -21
  22. package/vendor/sdk/_shims/auto/runtime-node.js.map +0 -1
  23. package/vendor/sdk/_shims/auto/runtime-node.mjs +0 -2
  24. package/vendor/sdk/_shims/auto/runtime-node.mjs.map +0 -1
  25. package/vendor/sdk/_shims/auto/runtime.d.ts +0 -5
  26. package/vendor/sdk/_shims/auto/runtime.d.ts.map +0 -1
  27. package/vendor/sdk/_shims/auto/runtime.js +0 -21
  28. package/vendor/sdk/_shims/auto/runtime.js.map +0 -1
  29. package/vendor/sdk/_shims/auto/runtime.mjs +0 -2
  30. package/vendor/sdk/_shims/auto/runtime.mjs.map +0 -1
  31. package/vendor/sdk/_shims/auto/types-node.d.ts +0 -5
  32. package/vendor/sdk/_shims/auto/types-node.d.ts.map +0 -1
  33. package/vendor/sdk/_shims/auto/types-node.js +0 -21
  34. package/vendor/sdk/_shims/auto/types-node.js.map +0 -1
  35. package/vendor/sdk/_shims/auto/types-node.mjs +0 -2
  36. package/vendor/sdk/_shims/auto/types-node.mjs.map +0 -1
  37. package/vendor/sdk/_shims/auto/types.d.ts +0 -101
  38. package/vendor/sdk/_shims/auto/types.js +0 -3
  39. package/vendor/sdk/_shims/auto/types.mjs +0 -3
  40. package/vendor/sdk/_shims/bun-runtime.d.ts +0 -6
  41. package/vendor/sdk/_shims/bun-runtime.d.ts.map +0 -1
  42. package/vendor/sdk/_shims/bun-runtime.js +0 -14
  43. package/vendor/sdk/_shims/bun-runtime.js.map +0 -1
  44. package/vendor/sdk/_shims/bun-runtime.mjs +0 -10
  45. package/vendor/sdk/_shims/bun-runtime.mjs.map +0 -1
  46. package/vendor/sdk/_shims/index.d.ts +0 -81
  47. package/vendor/sdk/_shims/index.js +0 -13
  48. package/vendor/sdk/_shims/index.mjs +0 -7
  49. package/vendor/sdk/_shims/manual-types.d.ts +0 -12
  50. package/vendor/sdk/_shims/manual-types.js +0 -3
  51. package/vendor/sdk/_shims/manual-types.mjs +0 -3
  52. package/vendor/sdk/_shims/node-runtime.d.ts +0 -3
  53. package/vendor/sdk/_shims/node-runtime.d.ts.map +0 -1
  54. package/vendor/sdk/_shims/node-runtime.js +0 -89
  55. package/vendor/sdk/_shims/node-runtime.js.map +0 -1
  56. package/vendor/sdk/_shims/node-runtime.mjs +0 -56
  57. package/vendor/sdk/_shims/node-runtime.mjs.map +0 -1
  58. package/vendor/sdk/_shims/node-types.d.ts +0 -42
  59. package/vendor/sdk/_shims/node-types.js +0 -3
  60. package/vendor/sdk/_shims/node-types.mjs +0 -3
  61. package/vendor/sdk/_shims/registry.d.ts +0 -37
  62. package/vendor/sdk/_shims/registry.d.ts.map +0 -1
  63. package/vendor/sdk/_shims/registry.js +0 -41
  64. package/vendor/sdk/_shims/registry.js.map +0 -1
  65. package/vendor/sdk/_shims/registry.mjs +0 -37
  66. package/vendor/sdk/_shims/registry.mjs.map +0 -1
  67. package/vendor/sdk/_shims/web-runtime.d.ts +0 -5
  68. package/vendor/sdk/_shims/web-runtime.d.ts.map +0 -1
  69. package/vendor/sdk/_shims/web-runtime.js +0 -78
  70. package/vendor/sdk/_shims/web-runtime.js.map +0 -1
  71. package/vendor/sdk/_shims/web-runtime.mjs +0 -71
  72. package/vendor/sdk/_shims/web-runtime.mjs.map +0 -1
  73. package/vendor/sdk/_shims/web-types.d.ts +0 -83
  74. package/vendor/sdk/_shims/web-types.js +0 -3
  75. package/vendor/sdk/_shims/web-types.mjs +0 -3
  76. package/vendor/sdk/_vendor/partial-json-parser/parser.d.ts +0 -3
  77. package/vendor/sdk/_vendor/partial-json-parser/parser.d.ts.map +0 -1
  78. package/vendor/sdk/_vendor/partial-json-parser/parser.js +0 -226
  79. package/vendor/sdk/_vendor/partial-json-parser/parser.js.map +0 -1
  80. package/vendor/sdk/_vendor/partial-json-parser/parser.mjs +0 -223
  81. package/vendor/sdk/_vendor/partial-json-parser/parser.mjs.map +0 -1
  82. package/vendor/sdk/core.d.ts +0 -248
  83. package/vendor/sdk/core.d.ts.map +0 -1
  84. package/vendor/sdk/core.js +0 -935
  85. package/vendor/sdk/core.js.map +0 -1
  86. package/vendor/sdk/core.mjs +0 -903
  87. package/vendor/sdk/core.mjs.map +0 -1
  88. package/vendor/sdk/error.d.ts +0 -48
  89. package/vendor/sdk/error.d.ts.map +0 -1
  90. package/vendor/sdk/error.js +0 -114
  91. package/vendor/sdk/error.js.map +0 -1
  92. package/vendor/sdk/error.mjs +0 -98
  93. package/vendor/sdk/error.mjs.map +0 -1
  94. package/vendor/sdk/index.d.mts +0 -152
  95. package/vendor/sdk/index.d.ts +0 -152
  96. package/vendor/sdk/index.d.ts.map +0 -1
  97. package/vendor/sdk/index.js +0 -179
  98. package/vendor/sdk/index.js.map +0 -1
  99. package/vendor/sdk/index.mjs +0 -136
  100. package/vendor/sdk/index.mjs.map +0 -1
  101. package/vendor/sdk/internal/decoders/jsonl.d.ts +0 -12
  102. package/vendor/sdk/internal/decoders/jsonl.d.ts.map +0 -1
  103. package/vendor/sdk/internal/decoders/jsonl.js +0 -35
  104. package/vendor/sdk/internal/decoders/jsonl.js.map +0 -1
  105. package/vendor/sdk/internal/decoders/jsonl.mjs +0 -31
  106. package/vendor/sdk/internal/decoders/jsonl.mjs.map +0 -1
  107. package/vendor/sdk/internal/decoders/line.d.ts +0 -20
  108. package/vendor/sdk/internal/decoders/line.d.ts.map +0 -1
  109. package/vendor/sdk/internal/decoders/line.js +0 -123
  110. package/vendor/sdk/internal/decoders/line.js.map +0 -1
  111. package/vendor/sdk/internal/decoders/line.mjs +0 -119
  112. package/vendor/sdk/internal/decoders/line.mjs.map +0 -1
  113. package/vendor/sdk/internal/stream-utils.d.ts +0 -8
  114. package/vendor/sdk/internal/stream-utils.d.ts.map +0 -1
  115. package/vendor/sdk/internal/stream-utils.js +0 -39
  116. package/vendor/sdk/internal/stream-utils.js.map +0 -1
  117. package/vendor/sdk/internal/stream-utils.mjs +0 -35
  118. package/vendor/sdk/internal/stream-utils.mjs.map +0 -1
  119. package/vendor/sdk/lib/BetaMessageStream.d.ts +0 -114
  120. package/vendor/sdk/lib/BetaMessageStream.d.ts.map +0 -1
  121. package/vendor/sdk/lib/BetaMessageStream.js +0 -547
  122. package/vendor/sdk/lib/BetaMessageStream.js.map +0 -1
  123. package/vendor/sdk/lib/BetaMessageStream.mjs +0 -543
  124. package/vendor/sdk/lib/BetaMessageStream.mjs.map +0 -1
  125. package/vendor/sdk/lib/MessageStream.d.ts +0 -114
  126. package/vendor/sdk/lib/MessageStream.d.ts.map +0 -1
  127. package/vendor/sdk/lib/MessageStream.js +0 -547
  128. package/vendor/sdk/lib/MessageStream.js.map +0 -1
  129. package/vendor/sdk/lib/MessageStream.mjs +0 -543
  130. package/vendor/sdk/lib/MessageStream.mjs.map +0 -1
  131. package/vendor/sdk/node_modules/@types/node/LICENSE +0 -21
  132. package/vendor/sdk/node_modules/@types/node/README.md +0 -15
  133. package/vendor/sdk/node_modules/@types/node/assert/strict.d.ts +0 -8
  134. package/vendor/sdk/node_modules/@types/node/assert.d.ts +0 -985
  135. package/vendor/sdk/node_modules/@types/node/async_hooks.d.ts +0 -522
  136. package/vendor/sdk/node_modules/@types/node/buffer.buffer.d.ts +0 -385
  137. package/vendor/sdk/node_modules/@types/node/buffer.d.ts +0 -1903
  138. package/vendor/sdk/node_modules/@types/node/child_process.d.ts +0 -1549
  139. package/vendor/sdk/node_modules/@types/node/cluster.d.ts +0 -578
  140. package/vendor/sdk/node_modules/@types/node/compatibility/disposable.d.ts +0 -14
  141. package/vendor/sdk/node_modules/@types/node/compatibility/index.d.ts +0 -9
  142. package/vendor/sdk/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
  143. package/vendor/sdk/node_modules/@types/node/compatibility/iterators.d.ts +0 -20
  144. package/vendor/sdk/node_modules/@types/node/console.d.ts +0 -452
  145. package/vendor/sdk/node_modules/@types/node/constants.d.ts +0 -19
  146. package/vendor/sdk/node_modules/@types/node/crypto.d.ts +0 -4453
  147. package/vendor/sdk/node_modules/@types/node/dgram.d.ts +0 -596
  148. package/vendor/sdk/node_modules/@types/node/diagnostics_channel.d.ts +0 -546
  149. package/vendor/sdk/node_modules/@types/node/dns/promises.d.ts +0 -475
  150. package/vendor/sdk/node_modules/@types/node/dns.d.ts +0 -853
  151. package/vendor/sdk/node_modules/@types/node/dom-events.d.ts +0 -124
  152. package/vendor/sdk/node_modules/@types/node/domain.d.ts +0 -170
  153. package/vendor/sdk/node_modules/@types/node/events.d.ts +0 -819
  154. package/vendor/sdk/node_modules/@types/node/fs/promises.d.ts +0 -1205
  155. package/vendor/sdk/node_modules/@types/node/fs.d.ts +0 -4237
  156. package/vendor/sdk/node_modules/@types/node/globals.d.ts +0 -442
  157. package/vendor/sdk/node_modules/@types/node/globals.typedarray.d.ts +0 -21
  158. package/vendor/sdk/node_modules/@types/node/http.d.ts +0 -1839
  159. package/vendor/sdk/node_modules/@types/node/http2.d.ts +0 -2517
  160. package/vendor/sdk/node_modules/@types/node/https.d.ts +0 -544
  161. package/vendor/sdk/node_modules/@types/node/index.d.ts +0 -90
  162. package/vendor/sdk/node_modules/@types/node/inspector.d.ts +0 -2775
  163. package/vendor/sdk/node_modules/@types/node/module.d.ts +0 -291
  164. package/vendor/sdk/node_modules/@types/node/net.d.ts +0 -924
  165. package/vendor/sdk/node_modules/@types/node/os.d.ts +0 -473
  166. package/vendor/sdk/node_modules/@types/node/package.json +0 -225
  167. package/vendor/sdk/node_modules/@types/node/path.d.ts +0 -191
  168. package/vendor/sdk/node_modules/@types/node/perf_hooks.d.ts +0 -753
  169. package/vendor/sdk/node_modules/@types/node/process.d.ts +0 -1553
  170. package/vendor/sdk/node_modules/@types/node/punycode.d.ts +0 -117
  171. package/vendor/sdk/node_modules/@types/node/querystring.d.ts +0 -141
  172. package/vendor/sdk/node_modules/@types/node/readline/promises.d.ts +0 -154
  173. package/vendor/sdk/node_modules/@types/node/readline.d.ts +0 -715
  174. package/vendor/sdk/node_modules/@types/node/repl.d.ts +0 -430
  175. package/vendor/sdk/node_modules/@types/node/stream/consumers.d.ts +0 -12
  176. package/vendor/sdk/node_modules/@types/node/stream/promises.d.ts +0 -90
  177. package/vendor/sdk/node_modules/@types/node/stream/web.d.ts +0 -523
  178. package/vendor/sdk/node_modules/@types/node/stream.d.ts +0 -1731
  179. package/vendor/sdk/node_modules/@types/node/string_decoder.d.ts +0 -67
  180. package/vendor/sdk/node_modules/@types/node/test.d.ts +0 -1245
  181. package/vendor/sdk/node_modules/@types/node/timers/promises.d.ts +0 -93
  182. package/vendor/sdk/node_modules/@types/node/timers.d.ts +0 -126
  183. package/vendor/sdk/node_modules/@types/node/tls.d.ts +0 -1203
  184. package/vendor/sdk/node_modules/@types/node/trace_events.d.ts +0 -171
  185. package/vendor/sdk/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -385
  186. package/vendor/sdk/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -19
  187. package/vendor/sdk/node_modules/@types/node/ts5.6/index.d.ts +0 -90
  188. package/vendor/sdk/node_modules/@types/node/tty.d.ts +0 -206
  189. package/vendor/sdk/node_modules/@types/node/url.d.ts +0 -957
  190. package/vendor/sdk/node_modules/@types/node/util.d.ts +0 -2083
  191. package/vendor/sdk/node_modules/@types/node/v8.d.ts +0 -753
  192. package/vendor/sdk/node_modules/@types/node/vm.d.ts +0 -666
  193. package/vendor/sdk/node_modules/@types/node/wasi.d.ts +0 -160
  194. package/vendor/sdk/node_modules/@types/node/worker_threads.d.ts +0 -695
  195. package/vendor/sdk/node_modules/@types/node/zlib.d.ts +0 -517
  196. package/vendor/sdk/node_modules/undici-types/README.md +0 -6
  197. package/vendor/sdk/node_modules/undici-types/agent.d.ts +0 -31
  198. package/vendor/sdk/node_modules/undici-types/api.d.ts +0 -43
  199. package/vendor/sdk/node_modules/undici-types/balanced-pool.d.ts +0 -18
  200. package/vendor/sdk/node_modules/undici-types/cache.d.ts +0 -36
  201. package/vendor/sdk/node_modules/undici-types/client.d.ts +0 -97
  202. package/vendor/sdk/node_modules/undici-types/connector.d.ts +0 -34
  203. package/vendor/sdk/node_modules/undici-types/content-type.d.ts +0 -21
  204. package/vendor/sdk/node_modules/undici-types/cookies.d.ts +0 -28
  205. package/vendor/sdk/node_modules/undici-types/diagnostics-channel.d.ts +0 -67
  206. package/vendor/sdk/node_modules/undici-types/dispatcher.d.ts +0 -241
  207. package/vendor/sdk/node_modules/undici-types/errors.d.ts +0 -128
  208. package/vendor/sdk/node_modules/undici-types/fetch.d.ts +0 -209
  209. package/vendor/sdk/node_modules/undici-types/file.d.ts +0 -39
  210. package/vendor/sdk/node_modules/undici-types/filereader.d.ts +0 -54
  211. package/vendor/sdk/node_modules/undici-types/formdata.d.ts +0 -108
  212. package/vendor/sdk/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  213. package/vendor/sdk/node_modules/undici-types/global-origin.d.ts +0 -7
  214. package/vendor/sdk/node_modules/undici-types/handlers.d.ts +0 -9
  215. package/vendor/sdk/node_modules/undici-types/header.d.ts +0 -4
  216. package/vendor/sdk/node_modules/undici-types/index.d.ts +0 -63
  217. package/vendor/sdk/node_modules/undici-types/interceptors.d.ts +0 -5
  218. package/vendor/sdk/node_modules/undici-types/mock-agent.d.ts +0 -50
  219. package/vendor/sdk/node_modules/undici-types/mock-client.d.ts +0 -25
  220. package/vendor/sdk/node_modules/undici-types/mock-errors.d.ts +0 -12
  221. package/vendor/sdk/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  222. package/vendor/sdk/node_modules/undici-types/mock-pool.d.ts +0 -25
  223. package/vendor/sdk/node_modules/undici-types/package.json +0 -55
  224. package/vendor/sdk/node_modules/undici-types/patch.d.ts +0 -71
  225. package/vendor/sdk/node_modules/undici-types/pool-stats.d.ts +0 -19
  226. package/vendor/sdk/node_modules/undici-types/pool.d.ts +0 -28
  227. package/vendor/sdk/node_modules/undici-types/proxy-agent.d.ts +0 -30
  228. package/vendor/sdk/node_modules/undici-types/readable.d.ts +0 -61
  229. package/vendor/sdk/node_modules/undici-types/webidl.d.ts +0 -220
  230. package/vendor/sdk/node_modules/undici-types/websocket.d.ts +0 -131
  231. package/vendor/sdk/package.json +0 -124
  232. package/vendor/sdk/pagination.d.ts +0 -27
  233. package/vendor/sdk/pagination.d.ts.map +0 -1
  234. package/vendor/sdk/pagination.js +0 -60
  235. package/vendor/sdk/pagination.js.map +0 -1
  236. package/vendor/sdk/pagination.mjs +0 -56
  237. package/vendor/sdk/pagination.mjs.map +0 -1
  238. package/vendor/sdk/resource.d.ts +0 -6
  239. package/vendor/sdk/resource.d.ts.map +0 -1
  240. package/vendor/sdk/resource.js +0 -11
  241. package/vendor/sdk/resource.js.map +0 -1
  242. package/vendor/sdk/resource.mjs +0 -7
  243. package/vendor/sdk/resource.mjs.map +0 -1
  244. package/vendor/sdk/resources/beta/beta.d.ts +0 -57
  245. package/vendor/sdk/resources/beta/beta.d.ts.map +0 -1
  246. package/vendor/sdk/resources/beta/beta.js +0 -44
  247. package/vendor/sdk/resources/beta/beta.js.map +0 -1
  248. package/vendor/sdk/resources/beta/beta.mjs +0 -17
  249. package/vendor/sdk/resources/beta/beta.mjs.map +0 -1
  250. package/vendor/sdk/resources/beta/index.d.ts +0 -4
  251. package/vendor/sdk/resources/beta/index.d.ts.map +0 -1
  252. package/vendor/sdk/resources/beta/index.js +0 -12
  253. package/vendor/sdk/resources/beta/index.js.map +0 -1
  254. package/vendor/sdk/resources/beta/index.mjs +0 -5
  255. package/vendor/sdk/resources/beta/index.mjs.map +0 -1
  256. package/vendor/sdk/resources/beta/messages/batches.d.ts +0 -289
  257. package/vendor/sdk/resources/beta/messages/batches.d.ts.map +0 -1
  258. package/vendor/sdk/resources/beta/messages/batches.js +0 -112
  259. package/vendor/sdk/resources/beta/messages/batches.js.map +0 -1
  260. package/vendor/sdk/resources/beta/messages/batches.mjs +0 -107
  261. package/vendor/sdk/resources/beta/messages/batches.mjs.map +0 -1
  262. package/vendor/sdk/resources/beta/messages/index.d.ts +0 -3
  263. package/vendor/sdk/resources/beta/messages/index.d.ts.map +0 -1
  264. package/vendor/sdk/resources/beta/messages/index.js +0 -10
  265. package/vendor/sdk/resources/beta/messages/index.js.map +0 -1
  266. package/vendor/sdk/resources/beta/messages/index.mjs +0 -4
  267. package/vendor/sdk/resources/beta/messages/index.mjs.map +0 -1
  268. package/vendor/sdk/resources/beta/messages/messages.d.ts +0 -1038
  269. package/vendor/sdk/resources/beta/messages/messages.d.ts.map +0 -1
  270. package/vendor/sdk/resources/beta/messages/messages.js +0 -93
  271. package/vendor/sdk/resources/beta/messages/messages.js.map +0 -1
  272. package/vendor/sdk/resources/beta/messages/messages.mjs +0 -66
  273. package/vendor/sdk/resources/beta/messages/messages.mjs.map +0 -1
  274. package/vendor/sdk/resources/beta/models.d.ts +0 -49
  275. package/vendor/sdk/resources/beta/models.d.ts.map +0 -1
  276. package/vendor/sdk/resources/beta/models.js +0 -30
  277. package/vendor/sdk/resources/beta/models.js.map +0 -1
  278. package/vendor/sdk/resources/beta/models.mjs +0 -25
  279. package/vendor/sdk/resources/beta/models.mjs.map +0 -1
  280. package/vendor/sdk/resources/completions.d.ts +0 -166
  281. package/vendor/sdk/resources/completions.d.ts.map +0 -1
  282. package/vendor/sdk/resources/completions.js +0 -17
  283. package/vendor/sdk/resources/completions.js.map +0 -1
  284. package/vendor/sdk/resources/completions.mjs +0 -13
  285. package/vendor/sdk/resources/completions.mjs.map +0 -1
  286. package/vendor/sdk/resources/index.d.ts +0 -6
  287. package/vendor/sdk/resources/index.d.ts.map +0 -1
  288. package/vendor/sdk/resources/index.js +0 -29
  289. package/vendor/sdk/resources/index.js.map +0 -1
  290. package/vendor/sdk/resources/index.mjs +0 -7
  291. package/vendor/sdk/resources/index.mjs.map +0 -1
  292. package/vendor/sdk/resources/messages/batches.d.ts +0 -253
  293. package/vendor/sdk/resources/messages/batches.d.ts.map +0 -1
  294. package/vendor/sdk/resources/messages/batches.js +0 -102
  295. package/vendor/sdk/resources/messages/batches.js.map +0 -1
  296. package/vendor/sdk/resources/messages/batches.mjs +0 -97
  297. package/vendor/sdk/resources/messages/batches.mjs.map +0 -1
  298. package/vendor/sdk/resources/messages/index.d.ts +0 -3
  299. package/vendor/sdk/resources/messages/index.d.ts.map +0 -1
  300. package/vendor/sdk/resources/messages/index.js +0 -10
  301. package/vendor/sdk/resources/messages/index.js.map +0 -1
  302. package/vendor/sdk/resources/messages/index.mjs +0 -4
  303. package/vendor/sdk/resources/messages/index.mjs.map +0 -1
  304. package/vendor/sdk/resources/messages/messages.d.ts +0 -1028
  305. package/vendor/sdk/resources/messages/messages.d.ts.map +0 -1
  306. package/vendor/sdk/resources/messages/messages.js +0 -82
  307. package/vendor/sdk/resources/messages/messages.js.map +0 -1
  308. package/vendor/sdk/resources/messages/messages.mjs +0 -54
  309. package/vendor/sdk/resources/messages/messages.mjs.map +0 -1
  310. package/vendor/sdk/resources/models.d.ts +0 -49
  311. package/vendor/sdk/resources/models.d.ts.map +0 -1
  312. package/vendor/sdk/resources/models.js +0 -30
  313. package/vendor/sdk/resources/models.js.map +0 -1
  314. package/vendor/sdk/resources/models.mjs +0 -25
  315. package/vendor/sdk/resources/models.mjs.map +0 -1
  316. package/vendor/sdk/resources/shared.d.ts +0 -42
  317. package/vendor/sdk/resources/shared.d.ts.map +0 -1
  318. package/vendor/sdk/resources/shared.js +0 -4
  319. package/vendor/sdk/resources/shared.js.map +0 -1
  320. package/vendor/sdk/resources/shared.mjs +0 -3
  321. package/vendor/sdk/resources/shared.mjs.map +0 -1
  322. package/vendor/sdk/resources/top-level.d.ts +0 -2
  323. package/vendor/sdk/resources/top-level.d.ts.map +0 -1
  324. package/vendor/sdk/resources/top-level.js +0 -4
  325. package/vendor/sdk/resources/top-level.js.map +0 -1
  326. package/vendor/sdk/resources/top-level.mjs +0 -3
  327. package/vendor/sdk/resources/top-level.mjs.map +0 -1
  328. package/vendor/sdk/shims/node.d.ts +0 -30
  329. package/vendor/sdk/shims/node.d.ts.map +0 -1
  330. package/vendor/sdk/shims/node.js +0 -31
  331. package/vendor/sdk/shims/node.js.map +0 -1
  332. package/vendor/sdk/shims/node.mjs +0 -5
  333. package/vendor/sdk/shims/node.mjs.map +0 -1
  334. package/vendor/sdk/shims/web.d.ts +0 -26
  335. package/vendor/sdk/shims/web.d.ts.map +0 -1
  336. package/vendor/sdk/shims/web.js +0 -31
  337. package/vendor/sdk/shims/web.js.map +0 -1
  338. package/vendor/sdk/shims/web.mjs +0 -5
  339. package/vendor/sdk/shims/web.mjs.map +0 -1
  340. package/vendor/sdk/src/_shims/MultipartBody.ts +0 -9
  341. package/vendor/sdk/src/_shims/README.md +0 -46
  342. package/vendor/sdk/src/_shims/auto/runtime-bun.ts +0 -4
  343. package/vendor/sdk/src/_shims/auto/runtime-node.ts +0 -4
  344. package/vendor/sdk/src/_shims/auto/runtime.ts +0 -4
  345. package/vendor/sdk/src/_shims/auto/types-node.ts +0 -4
  346. package/vendor/sdk/src/_shims/auto/types.d.ts +0 -101
  347. package/vendor/sdk/src/_shims/auto/types.js +0 -3
  348. package/vendor/sdk/src/_shims/auto/types.mjs +0 -3
  349. package/vendor/sdk/src/_shims/bun-runtime.ts +0 -14
  350. package/vendor/sdk/src/_shims/index.d.ts +0 -81
  351. package/vendor/sdk/src/_shims/index.js +0 -13
  352. package/vendor/sdk/src/_shims/index.mjs +0 -7
  353. package/vendor/sdk/src/_shims/manual-types.d.ts +0 -12
  354. package/vendor/sdk/src/_shims/manual-types.js +0 -3
  355. package/vendor/sdk/src/_shims/manual-types.mjs +0 -3
  356. package/vendor/sdk/src/_shims/node-runtime.ts +0 -81
  357. package/vendor/sdk/src/_shims/node-types.d.ts +0 -42
  358. package/vendor/sdk/src/_shims/node-types.js +0 -3
  359. package/vendor/sdk/src/_shims/node-types.mjs +0 -3
  360. package/vendor/sdk/src/_shims/registry.ts +0 -67
  361. package/vendor/sdk/src/_shims/web-runtime.ts +0 -103
  362. package/vendor/sdk/src/_shims/web-types.d.ts +0 -83
  363. package/vendor/sdk/src/_shims/web-types.js +0 -3
  364. package/vendor/sdk/src/_shims/web-types.mjs +0 -3
  365. package/vendor/sdk/src/_vendor/partial-json-parser/README.md +0 -3
  366. package/vendor/sdk/src/_vendor/partial-json-parser/parser.ts +0 -264
  367. package/vendor/sdk/src/core.ts +0 -1250
  368. package/vendor/sdk/src/error.ts +0 -133
  369. package/vendor/sdk/src/index.ts +0 -465
  370. package/vendor/sdk/src/internal/decoders/jsonl.ts +0 -41
  371. package/vendor/sdk/src/internal/decoders/line.ts +0 -145
  372. package/vendor/sdk/src/internal/stream-utils.ts +0 -32
  373. package/vendor/sdk/src/lib/.keep +0 -4
  374. package/vendor/sdk/src/lib/BetaMessageStream.ts +0 -661
  375. package/vendor/sdk/src/lib/MessageStream.ts +0 -662
  376. package/vendor/sdk/src/pagination.ts +0 -92
  377. package/vendor/sdk/src/resource.ts +0 -11
  378. package/vendor/sdk/src/resources/beta/beta.ts +0 -249
  379. package/vendor/sdk/src/resources/beta/index.ts +0 -83
  380. package/vendor/sdk/src/resources/beta/messages/batches.ts +0 -486
  381. package/vendor/sdk/src/resources/beta/messages/index.ts +0 -87
  382. package/vendor/sdk/src/resources/beta/messages/messages.ts +0 -1444
  383. package/vendor/sdk/src/resources/beta/models.ts +0 -78
  384. package/vendor/sdk/src/resources/completions.ts +0 -210
  385. package/vendor/sdk/src/resources/index.ts +0 -95
  386. package/vendor/sdk/src/resources/messages/batches.ts +0 -352
  387. package/vendor/sdk/src/resources/messages/index.ts +0 -85
  388. package/vendor/sdk/src/resources/messages/messages.ts +0 -1412
  389. package/vendor/sdk/src/resources/models.ts +0 -75
  390. package/vendor/sdk/src/resources/shared.ts +0 -72
  391. package/vendor/sdk/src/resources/top-level.ts +0 -3
  392. package/vendor/sdk/src/shims/node.ts +0 -50
  393. package/vendor/sdk/src/shims/web.ts +0 -50
  394. package/vendor/sdk/src/streaming.ts +0 -372
  395. package/vendor/sdk/src/tsconfig.json +0 -11
  396. package/vendor/sdk/src/uploads.ts +0 -255
  397. package/vendor/sdk/src/version.ts +0 -1
  398. package/vendor/sdk/streaming.d.ts +0 -36
  399. package/vendor/sdk/streaming.d.ts.map +0 -1
  400. package/vendor/sdk/streaming.js +0 -316
  401. package/vendor/sdk/streaming.js.map +0 -1
  402. package/vendor/sdk/streaming.mjs +0 -310
  403. package/vendor/sdk/streaming.mjs.map +0 -1
  404. package/vendor/sdk/uploads.d.ts +0 -75
  405. package/vendor/sdk/uploads.d.ts.map +0 -1
  406. package/vendor/sdk/uploads.js +0 -171
  407. package/vendor/sdk/uploads.js.map +0 -1
  408. package/vendor/sdk/uploads.mjs +0 -158
  409. package/vendor/sdk/uploads.mjs.map +0 -1
  410. package/vendor/sdk/version.d.ts +0 -2
  411. package/vendor/sdk/version.d.ts.map +0 -1
  412. package/vendor/sdk/version.js +0 -5
  413. package/vendor/sdk/version.js.map +0 -1
  414. package/vendor/sdk/version.mjs +0 -2
  415. package/vendor/sdk/version.mjs.map +0 -1
@@ -1,1028 +0,0 @@
1
- import { APIResource } from "../../resource.js";
2
- import { APIPromise } from "../../core.js";
3
- import * as Core from "../../core.js";
4
- import * as MessagesAPI from "./messages.js";
5
- import * as BatchesAPI from "./batches.js";
6
- import { BatchCreateParams, BatchListParams, Batches, DeletedMessageBatch, MessageBatch, MessageBatchCanceledResult, MessageBatchErroredResult, MessageBatchExpiredResult, MessageBatchIndividualResponse, MessageBatchRequestCounts, MessageBatchResult, MessageBatchSucceededResult, MessageBatchesPage } from "./batches.js";
7
- import { Stream } from "../../streaming.js";
8
- import { MessageStream } from "../../lib/MessageStream.js";
9
- export { MessageStream } from "../../lib/MessageStream.js";
10
- export declare class Messages extends APIResource {
11
- batches: BatchesAPI.Batches;
12
- /**
13
- * Send a structured list of input messages with text and/or image content, and the
14
- * model will generate the next message in the conversation.
15
- *
16
- * The Messages API can be used for either single queries or stateless multi-turn
17
- * conversations.
18
- *
19
- * Learn more about the Messages API in our [user guide](/en/docs/initial-setup)
20
- */
21
- create(body: MessageCreateParamsNonStreaming, options?: Core.RequestOptions): APIPromise<Message>;
22
- create(body: MessageCreateParamsStreaming, options?: Core.RequestOptions): APIPromise<Stream<RawMessageStreamEvent>>;
23
- create(body: MessageCreateParamsBase, options?: Core.RequestOptions): APIPromise<Stream<RawMessageStreamEvent> | Message>;
24
- /**
25
- * Create a Message stream
26
- */
27
- stream(body: MessageStreamParams, options?: Core.RequestOptions): MessageStream;
28
- /**
29
- * Count the number of tokens in a Message.
30
- *
31
- * The Token Count API can be used to count the number of tokens in a Message,
32
- * including tools, images, and documents, without creating it.
33
- *
34
- * Learn more about token counting in our
35
- * [user guide](/en/docs/build-with-claude/token-counting)
36
- */
37
- countTokens(body: MessageCountTokensParams, options?: Core.RequestOptions): Core.APIPromise<MessageTokensCount>;
38
- }
39
- export interface Base64PDFSource {
40
- data: string;
41
- media_type: 'application/pdf';
42
- type: 'base64';
43
- }
44
- export interface CacheControlEphemeral {
45
- type: 'ephemeral';
46
- }
47
- export interface CitationCharLocation {
48
- cited_text: string;
49
- document_index: number;
50
- document_title: string | null;
51
- end_char_index: number;
52
- start_char_index: number;
53
- type: 'char_location';
54
- }
55
- export interface CitationCharLocationParam {
56
- cited_text: string;
57
- document_index: number;
58
- document_title: string | null;
59
- end_char_index: number;
60
- start_char_index: number;
61
- type: 'char_location';
62
- }
63
- export interface CitationContentBlockLocation {
64
- cited_text: string;
65
- document_index: number;
66
- document_title: string | null;
67
- end_block_index: number;
68
- start_block_index: number;
69
- type: 'content_block_location';
70
- }
71
- export interface CitationContentBlockLocationParam {
72
- cited_text: string;
73
- document_index: number;
74
- document_title: string | null;
75
- end_block_index: number;
76
- start_block_index: number;
77
- type: 'content_block_location';
78
- }
79
- export interface CitationPageLocation {
80
- cited_text: string;
81
- document_index: number;
82
- document_title: string | null;
83
- end_page_number: number;
84
- start_page_number: number;
85
- type: 'page_location';
86
- }
87
- export interface CitationPageLocationParam {
88
- cited_text: string;
89
- document_index: number;
90
- document_title: string | null;
91
- end_page_number: number;
92
- start_page_number: number;
93
- type: 'page_location';
94
- }
95
- export interface CitationsConfigParam {
96
- enabled?: boolean;
97
- }
98
- export interface CitationsDelta {
99
- citation: CitationCharLocation | CitationPageLocation | CitationContentBlockLocation;
100
- type: 'citations_delta';
101
- }
102
- export type ContentBlock = TextBlock | ToolUseBlock | ThinkingBlock | RedactedThinkingBlock;
103
- export type ContentBlockDeltaEvent = RawContentBlockDeltaEvent;
104
- export type ContentBlockParam = TextBlockParam | ImageBlockParam | ToolUseBlockParam | ToolResultBlockParam | DocumentBlockParam | ThinkingBlockParam | RedactedThinkingBlockParam;
105
- export interface ContentBlockSource {
106
- content: string | Array<ContentBlockSourceContent>;
107
- type: 'content';
108
- }
109
- export type ContentBlockSourceContent = TextBlockParam | ImageBlockParam;
110
- export type ContentBlockStartEvent = RawContentBlockStartEvent;
111
- export type ContentBlockStopEvent = RawContentBlockStopEvent;
112
- export interface DocumentBlockParam {
113
- source: Base64PDFSource | PlainTextSource | ContentBlockSource;
114
- type: 'document';
115
- cache_control?: CacheControlEphemeral | null;
116
- citations?: CitationsConfigParam;
117
- context?: string | null;
118
- title?: string | null;
119
- }
120
- export interface ImageBlockParam {
121
- source: ImageBlockParam.Source;
122
- type: 'image';
123
- cache_control?: CacheControlEphemeral | null;
124
- }
125
- export declare namespace ImageBlockParam {
126
- interface Source {
127
- data: string;
128
- media_type: 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp';
129
- type: 'base64';
130
- }
131
- }
132
- export type InputJsonDelta = InputJSONDelta;
133
- export interface InputJSONDelta {
134
- partial_json: string;
135
- type: 'input_json_delta';
136
- }
137
- export interface Message {
138
- /**
139
- * Unique object identifier.
140
- *
141
- * The format and length of IDs may change over time.
142
- */
143
- id: string;
144
- /**
145
- * Content generated by the model.
146
- *
147
- * This is an array of content blocks, each of which has a `type` that determines
148
- * its shape.
149
- *
150
- * Example:
151
- *
152
- * ```json
153
- * [{ "type": "text", "text": "Hi, I'm Claude." }]
154
- * ```
155
- *
156
- * If the request input `messages` ended with an `assistant` turn, then the
157
- * response `content` will continue directly from that last turn. You can use this
158
- * to constrain the model's output.
159
- *
160
- * For example, if the input `messages` were:
161
- *
162
- * ```json
163
- * [
164
- * {
165
- * "role": "user",
166
- * "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
167
- * },
168
- * { "role": "assistant", "content": "The best answer is (" }
169
- * ]
170
- * ```
171
- *
172
- * Then the response `content` might be:
173
- *
174
- * ```json
175
- * [{ "type": "text", "text": "B)" }]
176
- * ```
177
- */
178
- content: Array<ContentBlock>;
179
- /**
180
- * The model that will complete your prompt.\n\nSee
181
- * [models](https://docs.anthropic.com/en/docs/models-overview) for additional
182
- * details and options.
183
- */
184
- model: Model;
185
- /**
186
- * Conversational role of the generated message.
187
- *
188
- * This will always be `"assistant"`.
189
- */
190
- role: 'assistant';
191
- /**
192
- * The reason that we stopped.
193
- *
194
- * This may be one the following values:
195
- *
196
- * - `"end_turn"`: the model reached a natural stopping point
197
- * - `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
198
- * - `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
199
- * - `"tool_use"`: the model invoked one or more tools
200
- *
201
- * In non-streaming mode this value is always non-null. In streaming mode, it is
202
- * null in the `message_start` event and non-null otherwise.
203
- */
204
- stop_reason: 'end_turn' | 'max_tokens' | 'stop_sequence' | 'tool_use' | null;
205
- /**
206
- * Which custom stop sequence was generated, if any.
207
- *
208
- * This value will be a non-null string if one of your custom stop sequences was
209
- * generated.
210
- */
211
- stop_sequence: string | null;
212
- /**
213
- * Object type.
214
- *
215
- * For Messages, this is always `"message"`.
216
- */
217
- type: 'message';
218
- /**
219
- * Billing and rate-limit usage.
220
- *
221
- * Anthropic's API bills and rate-limits by token counts, as tokens represent the
222
- * underlying cost to our systems.
223
- *
224
- * Under the hood, the API transforms requests into a format suitable for the
225
- * model. The model's output then goes through a parsing stage before becoming an
226
- * API response. As a result, the token counts in `usage` will not match one-to-one
227
- * with the exact visible content of an API request or response.
228
- *
229
- * For example, `output_tokens` will be non-zero, even for an empty string response
230
- * from Claude.
231
- *
232
- * Total input tokens in a request is the summation of `input_tokens`,
233
- * `cache_creation_input_tokens`, and `cache_read_input_tokens`.
234
- */
235
- usage: Usage;
236
- }
237
- export type MessageDeltaEvent = RawMessageDeltaEvent;
238
- export interface MessageDeltaUsage {
239
- /**
240
- * The cumulative number of output tokens which were used.
241
- */
242
- output_tokens: number;
243
- }
244
- export interface MessageParam {
245
- content: string | Array<ContentBlockParam>;
246
- role: 'user' | 'assistant';
247
- }
248
- export type MessageStartEvent = RawMessageStartEvent;
249
- export type MessageStopEvent = RawMessageStopEvent;
250
- export type MessageStreamEvent = RawMessageStreamEvent;
251
- export interface MessageTokensCount {
252
- /**
253
- * The total number of tokens across the provided list of messages, system prompt,
254
- * and tools.
255
- */
256
- input_tokens: number;
257
- }
258
- export interface Metadata {
259
- /**
260
- * An external identifier for the user who is associated with the request.
261
- *
262
- * This should be a uuid, hash value, or other opaque identifier. Anthropic may use
263
- * this id to help detect abuse. Do not include any identifying information such as
264
- * name, email address, or phone number.
265
- */
266
- user_id?: string | null;
267
- }
268
- /**
269
- * The model that will complete your prompt.\n\nSee
270
- * [models](https://docs.anthropic.com/en/docs/models-overview) for additional
271
- * details and options.
272
- */
273
- export type Model = 'claude-3-5-haiku-latest' | 'claude-3-5-haiku-20241022' | 'claude-3-5-sonnet-latest' | 'claude-3-5-sonnet-20241022' | 'claude-3-5-sonnet-20240620' | 'claude-3-opus-latest' | 'claude-3-opus-20240229' | 'claude-3-sonnet-20240229' | 'claude-3-haiku-20240307' | 'claude-2.1' | 'claude-2.0' | (string & {});
274
- export interface PlainTextSource {
275
- data: string;
276
- media_type: 'text/plain';
277
- type: 'text';
278
- }
279
- export interface RawContentBlockDeltaEvent {
280
- delta: TextDelta | InputJSONDelta | CitationsDelta | ThinkingDelta | SignatureDelta;
281
- index: number;
282
- type: 'content_block_delta';
283
- }
284
- export interface RawContentBlockStartEvent {
285
- content_block: TextBlock | ToolUseBlock | ThinkingBlock | RedactedThinkingBlock;
286
- index: number;
287
- type: 'content_block_start';
288
- }
289
- export interface RawContentBlockStopEvent {
290
- index: number;
291
- type: 'content_block_stop';
292
- }
293
- export interface RawMessageDeltaEvent {
294
- delta: RawMessageDeltaEvent.Delta;
295
- type: 'message_delta';
296
- /**
297
- * Billing and rate-limit usage.
298
- *
299
- * Anthropic's API bills and rate-limits by token counts, as tokens represent the
300
- * underlying cost to our systems.
301
- *
302
- * Under the hood, the API transforms requests into a format suitable for the
303
- * model. The model's output then goes through a parsing stage before becoming an
304
- * API response. As a result, the token counts in `usage` will not match one-to-one
305
- * with the exact visible content of an API request or response.
306
- *
307
- * For example, `output_tokens` will be non-zero, even for an empty string response
308
- * from Claude.
309
- *
310
- * Total input tokens in a request is the summation of `input_tokens`,
311
- * `cache_creation_input_tokens`, and `cache_read_input_tokens`.
312
- */
313
- usage: MessageDeltaUsage;
314
- }
315
- export declare namespace RawMessageDeltaEvent {
316
- interface Delta {
317
- stop_reason: 'end_turn' | 'max_tokens' | 'stop_sequence' | 'tool_use' | null;
318
- stop_sequence: string | null;
319
- }
320
- }
321
- export interface RawMessageStartEvent {
322
- message: Message;
323
- type: 'message_start';
324
- }
325
- export interface RawMessageStopEvent {
326
- type: 'message_stop';
327
- }
328
- export type RawMessageStreamEvent = RawMessageStartEvent | RawMessageDeltaEvent | RawMessageStopEvent | RawContentBlockStartEvent | RawContentBlockDeltaEvent | RawContentBlockStopEvent;
329
- export interface RedactedThinkingBlock {
330
- data: string;
331
- type: 'redacted_thinking';
332
- }
333
- export interface RedactedThinkingBlockParam {
334
- data: string;
335
- type: 'redacted_thinking';
336
- }
337
- export interface SignatureDelta {
338
- signature: string;
339
- type: 'signature_delta';
340
- }
341
- export interface TextBlock {
342
- /**
343
- * Citations supporting the text block.
344
- *
345
- * The type of citation returned will depend on the type of document being cited.
346
- * Citing a PDF results in `page_location`, plain text results in `char_location`,
347
- * and content document results in `content_block_location`.
348
- */
349
- citations: Array<TextCitation> | null;
350
- text: string;
351
- type: 'text';
352
- }
353
- export interface TextBlockParam {
354
- text: string;
355
- type: 'text';
356
- cache_control?: CacheControlEphemeral | null;
357
- citations?: Array<TextCitationParam> | null;
358
- }
359
- export type TextCitation = CitationCharLocation | CitationPageLocation | CitationContentBlockLocation;
360
- export type TextCitationParam = CitationCharLocationParam | CitationPageLocationParam | CitationContentBlockLocationParam;
361
- export interface TextDelta {
362
- text: string;
363
- type: 'text_delta';
364
- }
365
- export interface ThinkingBlock {
366
- signature: string;
367
- thinking: string;
368
- type: 'thinking';
369
- }
370
- export interface ThinkingBlockParam {
371
- signature: string;
372
- thinking: string;
373
- type: 'thinking';
374
- }
375
- export interface ThinkingConfigDisabled {
376
- type: 'disabled';
377
- }
378
- export interface ThinkingConfigEnabled {
379
- budget_tokens: number;
380
- type: 'enabled';
381
- }
382
- export interface ThinkingDelta {
383
- thinking: string;
384
- type: 'thinking_delta';
385
- }
386
- export interface Tool {
387
- /**
388
- * [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
389
- *
390
- * This defines the shape of the `input` that your tool accepts and that the model
391
- * will produce.
392
- */
393
- input_schema: Tool.InputSchema;
394
- /**
395
- * Name of the tool.
396
- *
397
- * This is how the tool will be called by the model and in tool_use blocks.
398
- */
399
- name: string;
400
- cache_control?: CacheControlEphemeral | null;
401
- /**
402
- * Description of what this tool does.
403
- *
404
- * Tool descriptions should be as detailed as possible. The more information that
405
- * the model has about what the tool is and how to use it, the better it will
406
- * perform. You can use natural language descriptions to reinforce important
407
- * aspects of the tool input JSON schema.
408
- */
409
- description?: string;
410
- }
411
- export declare namespace Tool {
412
- /**
413
- * [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
414
- *
415
- * This defines the shape of the `input` that your tool accepts and that the model
416
- * will produce.
417
- */
418
- interface InputSchema {
419
- type: 'object';
420
- properties?: unknown | null;
421
- [k: string]: unknown;
422
- }
423
- }
424
- /**
425
- * How the model should use the provided tools. The model can use a specific tool,
426
- * any available tool, or decide by itself.
427
- */
428
- export type ToolChoice = ToolChoiceAuto | ToolChoiceAny | ToolChoiceTool;
429
- /**
430
- * The model will use any available tools.
431
- */
432
- export interface ToolChoiceAny {
433
- type: 'any';
434
- /**
435
- * Whether to disable parallel tool use.
436
- *
437
- * Defaults to `false`. If set to `true`, the model will output exactly one tool
438
- * use.
439
- */
440
- disable_parallel_tool_use?: boolean;
441
- }
442
- /**
443
- * The model will automatically decide whether to use tools.
444
- */
445
- export interface ToolChoiceAuto {
446
- type: 'auto';
447
- /**
448
- * Whether to disable parallel tool use.
449
- *
450
- * Defaults to `false`. If set to `true`, the model will output at most one tool
451
- * use.
452
- */
453
- disable_parallel_tool_use?: boolean;
454
- }
455
- /**
456
- * The model will use the specified tool with `tool_choice.name`.
457
- */
458
- export interface ToolChoiceTool {
459
- /**
460
- * The name of the tool to use.
461
- */
462
- name: string;
463
- type: 'tool';
464
- /**
465
- * Whether to disable parallel tool use.
466
- *
467
- * Defaults to `false`. If set to `true`, the model will output exactly one tool
468
- * use.
469
- */
470
- disable_parallel_tool_use?: boolean;
471
- }
472
- export interface ToolResultBlockParam {
473
- tool_use_id: string;
474
- type: 'tool_result';
475
- cache_control?: CacheControlEphemeral | null;
476
- content?: string | Array<TextBlockParam | ImageBlockParam>;
477
- is_error?: boolean;
478
- }
479
- export interface ToolUseBlock {
480
- id: string;
481
- input: unknown;
482
- name: string;
483
- type: 'tool_use';
484
- }
485
- export interface ToolUseBlockParam {
486
- id: string;
487
- input: unknown;
488
- name: string;
489
- type: 'tool_use';
490
- cache_control?: CacheControlEphemeral | null;
491
- }
492
- export interface Usage {
493
- /**
494
- * The number of input tokens used to create the cache entry.
495
- */
496
- cache_creation_input_tokens: number | null;
497
- /**
498
- * The number of input tokens read from the cache.
499
- */
500
- cache_read_input_tokens: number | null;
501
- /**
502
- * The number of input tokens which were used.
503
- */
504
- input_tokens: number;
505
- /**
506
- * The number of output tokens which were used.
507
- */
508
- output_tokens: number;
509
- }
510
- export type MessageCreateParams = MessageCreateParamsNonStreaming | MessageCreateParamsStreaming;
511
- export interface MessageCreateParamsBase {
512
- /**
513
- * The maximum number of tokens to generate before stopping.
514
- *
515
- * Note that our models may stop _before_ reaching this maximum. This parameter
516
- * only specifies the absolute maximum number of tokens to generate.
517
- *
518
- * Different models have different maximum values for this parameter. See
519
- * [models](https://docs.anthropic.com/en/docs/models-overview) for details.
520
- */
521
- max_tokens: number;
522
- /**
523
- * Input messages.
524
- *
525
- * Our models are trained to operate on alternating `user` and `assistant`
526
- * conversational turns. When creating a new `Message`, you specify the prior
527
- * conversational turns with the `messages` parameter, and the model then generates
528
- * the next `Message` in the conversation. Consecutive `user` or `assistant` turns
529
- * in your request will be combined into a single turn.
530
- *
531
- * Each input message must be an object with a `role` and `content`. You can
532
- * specify a single `user`-role message, or you can include multiple `user` and
533
- * `assistant` messages.
534
- *
535
- * If the final message uses the `assistant` role, the response content will
536
- * continue immediately from the content in that message. This can be used to
537
- * constrain part of the model's response.
538
- *
539
- * Example with a single `user` message:
540
- *
541
- * ```json
542
- * [{ "role": "user", "content": "Hello, Claude" }]
543
- * ```
544
- *
545
- * Example with multiple conversational turns:
546
- *
547
- * ```json
548
- * [
549
- * { "role": "user", "content": "Hello there." },
550
- * { "role": "assistant", "content": "Hi, I'm Claude. How can I help you?" },
551
- * { "role": "user", "content": "Can you explain LLMs in plain English?" }
552
- * ]
553
- * ```
554
- *
555
- * Example with a partially-filled response from Claude:
556
- *
557
- * ```json
558
- * [
559
- * {
560
- * "role": "user",
561
- * "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
562
- * },
563
- * { "role": "assistant", "content": "The best answer is (" }
564
- * ]
565
- * ```
566
- *
567
- * Each input message `content` may be either a single `string` or an array of
568
- * content blocks, where each block has a specific `type`. Using a `string` for
569
- * `content` is shorthand for an array of one content block of type `"text"`. The
570
- * following input messages are equivalent:
571
- *
572
- * ```json
573
- * { "role": "user", "content": "Hello, Claude" }
574
- * ```
575
- *
576
- * ```json
577
- * { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
578
- * ```
579
- *
580
- * Starting with Claude 3 models, you can also send image content blocks:
581
- *
582
- * ```json
583
- * {
584
- * "role": "user",
585
- * "content": [
586
- * {
587
- * "type": "image",
588
- * "source": {
589
- * "type": "base64",
590
- * "media_type": "image/jpeg",
591
- * "data": "/9j/4AAQSkZJRg..."
592
- * }
593
- * },
594
- * { "type": "text", "text": "What is in this image?" }
595
- * ]
596
- * }
597
- * ```
598
- *
599
- * We currently support the `base64` source type for images, and the `image/jpeg`,
600
- * `image/png`, `image/gif`, and `image/webp` media types.
601
- *
602
- * See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
603
- * more input examples.
604
- *
605
- * Note that if you want to include a
606
- * [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
607
- * the top-level `system` parameter — there is no `"system"` role for input
608
- * messages in the Messages API.
609
- */
610
- messages: Array<MessageParam>;
611
- /**
612
- * The model that will complete your prompt.\n\nSee
613
- * [models](https://docs.anthropic.com/en/docs/models-overview) for additional
614
- * details and options.
615
- */
616
- model: Model;
617
- /**
618
- * An object describing metadata about the request.
619
- */
620
- metadata?: Metadata;
621
- /**
622
- * Custom text sequences that will cause the model to stop generating.
623
- *
624
- * Our models will normally stop when they have naturally completed their turn,
625
- * which will result in a response `stop_reason` of `"end_turn"`.
626
- *
627
- * If you want the model to stop generating when it encounters custom strings of
628
- * text, you can use the `stop_sequences` parameter. If the model encounters one of
629
- * the custom sequences, the response `stop_reason` value will be `"stop_sequence"`
630
- * and the response `stop_sequence` value will contain the matched stop sequence.
631
- */
632
- stop_sequences?: Array<string>;
633
- /**
634
- * Whether to incrementally stream the response using server-sent events.
635
- *
636
- * See [streaming](https://docs.anthropic.com/en/api/messages-streaming) for
637
- * details.
638
- */
639
- stream?: boolean;
640
- /**
641
- * System prompt.
642
- *
643
- * A system prompt is a way of providing context and instructions to Claude, such
644
- * as specifying a particular goal or role. See our
645
- * [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts).
646
- */
647
- system?: string | Array<TextBlockParam>;
648
- /**
649
- * Amount of randomness injected into the response.
650
- *
651
- * Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0`
652
- * for analytical / multiple choice, and closer to `1.0` for creative and
653
- * generative tasks.
654
- *
655
- * Note that even with `temperature` of `0.0`, the results will not be fully
656
- * deterministic.
657
- */
658
- temperature?: number;
659
- thinking?: ThinkingConfigEnabled | ThinkingConfigDisabled;
660
- /**
661
- * How the model should use the provided tools. The model can use a specific tool,
662
- * any available tool, or decide by itself.
663
- */
664
- tool_choice?: ToolChoice;
665
- /**
666
- * Definitions of tools that the model may use.
667
- *
668
- * If you include `tools` in your API request, the model may return `tool_use`
669
- * content blocks that represent the model's use of those tools. You can then run
670
- * those tools using the tool input generated by the model and then optionally
671
- * return results back to the model using `tool_result` content blocks.
672
- *
673
- * Each tool definition includes:
674
- *
675
- * - `name`: Name of the tool.
676
- * - `description`: Optional, but strongly-recommended description of the tool.
677
- * - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the
678
- * tool `input` shape that the model will produce in `tool_use` output content
679
- * blocks.
680
- *
681
- * For example, if you defined `tools` as:
682
- *
683
- * ```json
684
- * [
685
- * {
686
- * "name": "get_stock_price",
687
- * "description": "Get the current stock price for a given ticker symbol.",
688
- * "input_schema": {
689
- * "type": "object",
690
- * "properties": {
691
- * "ticker": {
692
- * "type": "string",
693
- * "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
694
- * }
695
- * },
696
- * "required": ["ticker"]
697
- * }
698
- * }
699
- * ]
700
- * ```
701
- *
702
- * And then asked the model "What's the S&P 500 at today?", the model might produce
703
- * `tool_use` content blocks in the response like this:
704
- *
705
- * ```json
706
- * [
707
- * {
708
- * "type": "tool_use",
709
- * "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
710
- * "name": "get_stock_price",
711
- * "input": { "ticker": "^GSPC" }
712
- * }
713
- * ]
714
- * ```
715
- *
716
- * You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an
717
- * input, and return the following back to the model in a subsequent `user`
718
- * message:
719
- *
720
- * ```json
721
- * [
722
- * {
723
- * "type": "tool_result",
724
- * "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
725
- * "content": "259.75 USD"
726
- * }
727
- * ]
728
- * ```
729
- *
730
- * Tools can be used for workflows that include running client-side tools and
731
- * functions, or more generally whenever you want the model to produce a particular
732
- * JSON structure of output.
733
- *
734
- * See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
735
- */
736
- tools?: Array<MessageCreateParams.BashTool20250124 | MessageCreateParams.TextEditor20250124 | Tool>;
737
- /**
738
- * Only sample from the top K options for each subsequent token.
739
- *
740
- * Used to remove "long tail" low probability responses.
741
- * [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
742
- *
743
- * Recommended for advanced use cases only. You usually only need to use
744
- * `temperature`.
745
- */
746
- top_k?: number;
747
- /**
748
- * Use nucleus sampling.
749
- *
750
- * In nucleus sampling, we compute the cumulative distribution over all the options
751
- * for each subsequent token in decreasing probability order and cut it off once it
752
- * reaches a particular probability specified by `top_p`. You should either alter
753
- * `temperature` or `top_p`, but not both.
754
- *
755
- * Recommended for advanced use cases only. You usually only need to use
756
- * `temperature`.
757
- */
758
- top_p?: number;
759
- }
760
- export declare namespace MessageCreateParams {
761
- /**
762
- * @deprecated use `Anthropic.Messages.ToolChoiceAuto` instead
763
- */
764
- type Metadata = MessagesAPI.Metadata;
765
- /**
766
- * @deprecated use `Anthropic.Messages.ToolChoiceAuto` instead
767
- */
768
- type ToolChoiceAuto = MessagesAPI.ToolChoiceAuto;
769
- /**
770
- * @deprecated use `Anthropic.Messages.ToolChoiceAny` instead
771
- */
772
- type ToolChoiceAny = MessagesAPI.ToolChoiceAny;
773
- /**
774
- * @deprecated use `Anthropic.Messages.ToolChoiceTool` instead
775
- */
776
- type ToolChoiceTool = MessagesAPI.ToolChoiceTool;
777
- interface BashTool20250124 {
778
- /**
779
- * Name of the tool.
780
- *
781
- * This is how the tool will be called by the model and in tool_use blocks.
782
- */
783
- name: 'bash';
784
- type: 'bash_20250124';
785
- cache_control?: MessagesAPI.CacheControlEphemeral | null;
786
- }
787
- interface TextEditor20250124 {
788
- /**
789
- * Name of the tool.
790
- *
791
- * This is how the tool will be called by the model and in tool_use blocks.
792
- */
793
- name: 'str_replace_editor';
794
- type: 'text_editor_20250124';
795
- cache_control?: MessagesAPI.CacheControlEphemeral | null;
796
- }
797
- type MessageCreateParamsNonStreaming = MessagesAPI.MessageCreateParamsNonStreaming;
798
- type MessageCreateParamsStreaming = MessagesAPI.MessageCreateParamsStreaming;
799
- }
800
- export interface MessageCreateParamsNonStreaming extends MessageCreateParamsBase {
801
- /**
802
- * Whether to incrementally stream the response using server-sent events.
803
- *
804
- * See [streaming](https://docs.anthropic.com/en/api/messages-streaming) for
805
- * details.
806
- */
807
- stream?: false;
808
- }
809
- export interface MessageCreateParamsStreaming extends MessageCreateParamsBase {
810
- /**
811
- * Whether to incrementally stream the response using server-sent events.
812
- *
813
- * See [streaming](https://docs.anthropic.com/en/api/messages-streaming) for
814
- * details.
815
- */
816
- stream: true;
817
- }
818
- export type MessageStreamParams = MessageCreateParamsBase;
819
- export interface MessageCountTokensParams {
820
- /**
821
- * Input messages.
822
- *
823
- * Our models are trained to operate on alternating `user` and `assistant`
824
- * conversational turns. When creating a new `Message`, you specify the prior
825
- * conversational turns with the `messages` parameter, and the model then generates
826
- * the next `Message` in the conversation. Consecutive `user` or `assistant` turns
827
- * in your request will be combined into a single turn.
828
- *
829
- * Each input message must be an object with a `role` and `content`. You can
830
- * specify a single `user`-role message, or you can include multiple `user` and
831
- * `assistant` messages.
832
- *
833
- * If the final message uses the `assistant` role, the response content will
834
- * continue immediately from the content in that message. This can be used to
835
- * constrain part of the model's response.
836
- *
837
- * Example with a single `user` message:
838
- *
839
- * ```json
840
- * [{ "role": "user", "content": "Hello, Claude" }]
841
- * ```
842
- *
843
- * Example with multiple conversational turns:
844
- *
845
- * ```json
846
- * [
847
- * { "role": "user", "content": "Hello there." },
848
- * { "role": "assistant", "content": "Hi, I'm Claude. How can I help you?" },
849
- * { "role": "user", "content": "Can you explain LLMs in plain English?" }
850
- * ]
851
- * ```
852
- *
853
- * Example with a partially-filled response from Claude:
854
- *
855
- * ```json
856
- * [
857
- * {
858
- * "role": "user",
859
- * "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
860
- * },
861
- * { "role": "assistant", "content": "The best answer is (" }
862
- * ]
863
- * ```
864
- *
865
- * Each input message `content` may be either a single `string` or an array of
866
- * content blocks, where each block has a specific `type`. Using a `string` for
867
- * `content` is shorthand for an array of one content block of type `"text"`. The
868
- * following input messages are equivalent:
869
- *
870
- * ```json
871
- * { "role": "user", "content": "Hello, Claude" }
872
- * ```
873
- *
874
- * ```json
875
- * { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
876
- * ```
877
- *
878
- * Starting with Claude 3 models, you can also send image content blocks:
879
- *
880
- * ```json
881
- * {
882
- * "role": "user",
883
- * "content": [
884
- * {
885
- * "type": "image",
886
- * "source": {
887
- * "type": "base64",
888
- * "media_type": "image/jpeg",
889
- * "data": "/9j/4AAQSkZJRg..."
890
- * }
891
- * },
892
- * { "type": "text", "text": "What is in this image?" }
893
- * ]
894
- * }
895
- * ```
896
- *
897
- * We currently support the `base64` source type for images, and the `image/jpeg`,
898
- * `image/png`, `image/gif`, and `image/webp` media types.
899
- *
900
- * See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
901
- * more input examples.
902
- *
903
- * Note that if you want to include a
904
- * [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
905
- * the top-level `system` parameter — there is no `"system"` role for input
906
- * messages in the Messages API.
907
- */
908
- messages: Array<MessageParam>;
909
- /**
910
- * The model that will complete your prompt.\n\nSee
911
- * [models](https://docs.anthropic.com/en/docs/models-overview) for additional
912
- * details and options.
913
- */
914
- model: Model;
915
- /**
916
- * System prompt.
917
- *
918
- * A system prompt is a way of providing context and instructions to Claude, such
919
- * as specifying a particular goal or role. See our
920
- * [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts).
921
- */
922
- system?: string | Array<TextBlockParam>;
923
- thinking?: ThinkingConfigEnabled | ThinkingConfigDisabled;
924
- /**
925
- * How the model should use the provided tools. The model can use a specific tool,
926
- * any available tool, or decide by itself.
927
- */
928
- tool_choice?: ToolChoice;
929
- /**
930
- * Definitions of tools that the model may use.
931
- *
932
- * If you include `tools` in your API request, the model may return `tool_use`
933
- * content blocks that represent the model's use of those tools. You can then run
934
- * those tools using the tool input generated by the model and then optionally
935
- * return results back to the model using `tool_result` content blocks.
936
- *
937
- * Each tool definition includes:
938
- *
939
- * - `name`: Name of the tool.
940
- * - `description`: Optional, but strongly-recommended description of the tool.
941
- * - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the
942
- * tool `input` shape that the model will produce in `tool_use` output content
943
- * blocks.
944
- *
945
- * For example, if you defined `tools` as:
946
- *
947
- * ```json
948
- * [
949
- * {
950
- * "name": "get_stock_price",
951
- * "description": "Get the current stock price for a given ticker symbol.",
952
- * "input_schema": {
953
- * "type": "object",
954
- * "properties": {
955
- * "ticker": {
956
- * "type": "string",
957
- * "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
958
- * }
959
- * },
960
- * "required": ["ticker"]
961
- * }
962
- * }
963
- * ]
964
- * ```
965
- *
966
- * And then asked the model "What's the S&P 500 at today?", the model might produce
967
- * `tool_use` content blocks in the response like this:
968
- *
969
- * ```json
970
- * [
971
- * {
972
- * "type": "tool_use",
973
- * "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
974
- * "name": "get_stock_price",
975
- * "input": { "ticker": "^GSPC" }
976
- * }
977
- * ]
978
- * ```
979
- *
980
- * You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an
981
- * input, and return the following back to the model in a subsequent `user`
982
- * message:
983
- *
984
- * ```json
985
- * [
986
- * {
987
- * "type": "tool_result",
988
- * "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
989
- * "content": "259.75 USD"
990
- * }
991
- * ]
992
- * ```
993
- *
994
- * Tools can be used for workflows that include running client-side tools and
995
- * functions, or more generally whenever you want the model to produce a particular
996
- * JSON structure of output.
997
- *
998
- * See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
999
- */
1000
- tools?: Array<MessageCountTokensParams.BashTool20250124 | MessageCountTokensParams.TextEditor20250124 | Tool>;
1001
- }
1002
- export declare namespace MessageCountTokensParams {
1003
- interface BashTool20250124 {
1004
- /**
1005
- * Name of the tool.
1006
- *
1007
- * This is how the tool will be called by the model and in tool_use blocks.
1008
- */
1009
- name: 'bash';
1010
- type: 'bash_20250124';
1011
- cache_control?: MessagesAPI.CacheControlEphemeral | null;
1012
- }
1013
- interface TextEditor20250124 {
1014
- /**
1015
- * Name of the tool.
1016
- *
1017
- * This is how the tool will be called by the model and in tool_use blocks.
1018
- */
1019
- name: 'str_replace_editor';
1020
- type: 'text_editor_20250124';
1021
- cache_control?: MessagesAPI.CacheControlEphemeral | null;
1022
- }
1023
- }
1024
- export declare namespace Messages {
1025
- export { type Base64PDFSource as Base64PDFSource, type CacheControlEphemeral as CacheControlEphemeral, type CitationCharLocation as CitationCharLocation, type CitationCharLocationParam as CitationCharLocationParam, type CitationContentBlockLocation as CitationContentBlockLocation, type CitationContentBlockLocationParam as CitationContentBlockLocationParam, type CitationPageLocation as CitationPageLocation, type CitationPageLocationParam as CitationPageLocationParam, type CitationsConfigParam as CitationsConfigParam, type CitationsDelta as CitationsDelta, type ContentBlock as ContentBlock, type ContentBlockDeltaEvent as ContentBlockDeltaEvent, type ContentBlockParam as ContentBlockParam, type ContentBlockSource as ContentBlockSource, type ContentBlockSourceContent as ContentBlockSourceContent, type ContentBlockStartEvent as ContentBlockStartEvent, type ContentBlockStopEvent as ContentBlockStopEvent, type DocumentBlockParam as DocumentBlockParam, type ImageBlockParam as ImageBlockParam, type InputJsonDelta as InputJsonDelta, type InputJSONDelta as InputJSONDelta, type Message as Message, type MessageDeltaEvent as MessageDeltaEvent, type MessageDeltaUsage as MessageDeltaUsage, type MessageParam as MessageParam, type MessageStartEvent as MessageStartEvent, type MessageStopEvent as MessageStopEvent, type MessageStreamEvent as MessageStreamEvent, type MessageTokensCount as MessageTokensCount, type Metadata as Metadata, type Model as Model, type PlainTextSource as PlainTextSource, type RawContentBlockDeltaEvent as RawContentBlockDeltaEvent, type RawContentBlockStartEvent as RawContentBlockStartEvent, type RawContentBlockStopEvent as RawContentBlockStopEvent, type RawMessageDeltaEvent as RawMessageDeltaEvent, type RawMessageStartEvent as RawMessageStartEvent, type RawMessageStopEvent as RawMessageStopEvent, type RawMessageStreamEvent as RawMessageStreamEvent, type RedactedThinkingBlock as RedactedThinkingBlock, type RedactedThinkingBlockParam as RedactedThinkingBlockParam, type SignatureDelta as SignatureDelta, type TextBlock as TextBlock, type TextBlockParam as TextBlockParam, type TextCitation as TextCitation, type TextCitationParam as TextCitationParam, type TextDelta as TextDelta, type ThinkingBlock as ThinkingBlock, type ThinkingBlockParam as ThinkingBlockParam, type ThinkingConfigDisabled as ThinkingConfigDisabled, type ThinkingConfigEnabled as ThinkingConfigEnabled, type ThinkingDelta as ThinkingDelta, type Tool as Tool, type ToolChoice as ToolChoice, type ToolChoiceAny as ToolChoiceAny, type ToolChoiceAuto as ToolChoiceAuto, type ToolChoiceTool as ToolChoiceTool, type ToolResultBlockParam as ToolResultBlockParam, type ToolUseBlock as ToolUseBlock, type ToolUseBlockParam as ToolUseBlockParam, type Usage as Usage, type MessageCreateParams as MessageCreateParams, type MessageCreateParamsNonStreaming as MessageCreateParamsNonStreaming, type MessageCreateParamsStreaming as MessageCreateParamsStreaming, type MessageStreamParams as MessageStreamParams, type MessageCountTokensParams as MessageCountTokensParams, };
1026
- export { Batches as Batches, 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, MessageBatchesPage as MessageBatchesPage, type BatchCreateParams as BatchCreateParams, type BatchListParams as BatchListParams, };
1027
- }
1028
- //# sourceMappingURL=messages.d.ts.map