@puku-ai/sdk 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (336) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +251 -0
  3. package/dist/index.cjs +7 -0
  4. package/dist/index.d.ts +23 -0
  5. package/dist/index.d.ts.map +1 -0
  6. package/dist/index.js +26 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/vendor/_vendor/partial-json-parser/parser.d.ts +3 -0
  9. package/dist/vendor/_vendor/partial-json-parser/parser.d.ts.map +1 -0
  10. package/dist/vendor/_vendor/partial-json-parser/parser.js +223 -0
  11. package/dist/vendor/_vendor/partial-json-parser/parser.js.map +1 -0
  12. package/dist/vendor/api-promise.d.ts +3 -0
  13. package/dist/vendor/api-promise.d.ts.map +1 -0
  14. package/dist/vendor/api-promise.js +3 -0
  15. package/dist/vendor/api-promise.js.map +1 -0
  16. package/dist/vendor/client.d.ts +248 -0
  17. package/dist/vendor/client.d.ts.map +1 -0
  18. package/dist/vendor/client.js +567 -0
  19. package/dist/vendor/client.js.map +1 -0
  20. package/dist/vendor/core/api-promise.d.ts +49 -0
  21. package/dist/vendor/core/api-promise.d.ts.map +1 -0
  22. package/dist/vendor/core/api-promise.js +72 -0
  23. package/dist/vendor/core/api-promise.js.map +1 -0
  24. package/dist/vendor/core/error.d.ts +50 -0
  25. package/dist/vendor/core/error.d.ts.map +1 -0
  26. package/dist/vendor/core/error.js +109 -0
  27. package/dist/vendor/core/error.js.map +1 -0
  28. package/dist/vendor/core/pagination.d.ts +105 -0
  29. package/dist/vendor/core/pagination.d.ts.map +1 -0
  30. package/dist/vendor/core/pagination.js +188 -0
  31. package/dist/vendor/core/pagination.js.map +1 -0
  32. package/dist/vendor/core/resource.d.ts +6 -0
  33. package/dist/vendor/core/resource.d.ts.map +1 -0
  34. package/dist/vendor/core/resource.js +8 -0
  35. package/dist/vendor/core/resource.js.map +1 -0
  36. package/dist/vendor/core/streaming.d.ts +33 -0
  37. package/dist/vendor/core/streaming.d.ts.map +1 -0
  38. package/dist/vendor/core/streaming.js +288 -0
  39. package/dist/vendor/core/streaming.js.map +1 -0
  40. package/dist/vendor/core/uploads.d.ts +3 -0
  41. package/dist/vendor/core/uploads.d.ts.map +1 -0
  42. package/dist/vendor/core/uploads.js +2 -0
  43. package/dist/vendor/core/uploads.js.map +1 -0
  44. package/dist/vendor/error.d.ts +3 -0
  45. package/dist/vendor/error.d.ts.map +1 -0
  46. package/dist/vendor/error.js +3 -0
  47. package/dist/vendor/error.js.map +1 -0
  48. package/dist/vendor/helpers/beta/json-schema.d.ts +31 -0
  49. package/dist/vendor/helpers/beta/json-schema.d.ts.map +1 -0
  50. package/dist/vendor/helpers/beta/json-schema.js +52 -0
  51. package/dist/vendor/helpers/beta/json-schema.js.map +1 -0
  52. package/dist/vendor/helpers/beta/mcp.d.ts +303 -0
  53. package/dist/vendor/helpers/beta/mcp.d.ts.map +1 -0
  54. package/dist/vendor/helpers/beta/mcp.js +406 -0
  55. package/dist/vendor/helpers/beta/mcp.js.map +1 -0
  56. package/dist/vendor/helpers/beta/memory.d.ts +11 -0
  57. package/dist/vendor/helpers/beta/memory.d.ts.map +1 -0
  58. package/dist/vendor/helpers/beta/memory.js +15 -0
  59. package/dist/vendor/helpers/beta/memory.js.map +1 -0
  60. package/dist/vendor/helpers/beta/zod.d.ts +7 -0
  61. package/dist/vendor/helpers/beta/zod.d.ts.map +1 -0
  62. package/dist/vendor/helpers/beta/zod.js +15 -0
  63. package/dist/vendor/helpers/beta/zod.js.map +1 -0
  64. package/dist/vendor/helpers/index.d.ts +3 -0
  65. package/dist/vendor/helpers/index.d.ts.map +1 -0
  66. package/dist/vendor/helpers/index.js +3 -0
  67. package/dist/vendor/helpers/index.js.map +1 -0
  68. package/dist/vendor/helpers/json-schema.d.ts +18 -0
  69. package/dist/vendor/helpers/json-schema.d.ts.map +1 -0
  70. package/dist/vendor/helpers/json-schema.js +34 -0
  71. package/dist/vendor/helpers/json-schema.js.map +1 -0
  72. package/dist/vendor/helpers/zod.d.ts +13 -0
  73. package/dist/vendor/helpers/zod.d.ts.map +1 -0
  74. package/dist/vendor/helpers/zod.js +21 -0
  75. package/dist/vendor/helpers/zod.js.map +1 -0
  76. package/dist/vendor/index.d.ts +8 -0
  77. package/dist/vendor/index.d.ts.map +1 -0
  78. package/dist/vendor/index.js +8 -0
  79. package/dist/vendor/index.js.map +1 -0
  80. package/dist/vendor/internal/builtin-types.d.ts +73 -0
  81. package/dist/vendor/internal/builtin-types.d.ts.map +1 -0
  82. package/dist/vendor/internal/builtin-types.js +3 -0
  83. package/dist/vendor/internal/builtin-types.js.map +1 -0
  84. package/dist/vendor/internal/constants.d.ts +5 -0
  85. package/dist/vendor/internal/constants.d.ts.map +1 -0
  86. package/dist/vendor/internal/constants.js +15 -0
  87. package/dist/vendor/internal/constants.js.map +1 -0
  88. package/dist/vendor/internal/decoders/jsonl.d.ts +10 -0
  89. package/dist/vendor/internal/decoders/jsonl.d.ts.map +1 -0
  90. package/dist/vendor/internal/decoders/jsonl.js +37 -0
  91. package/dist/vendor/internal/decoders/jsonl.js.map +1 -0
  92. package/dist/vendor/internal/decoders/line.d.ts +17 -0
  93. package/dist/vendor/internal/decoders/line.d.ts.map +1 -0
  94. package/dist/vendor/internal/decoders/line.js +105 -0
  95. package/dist/vendor/internal/decoders/line.js.map +1 -0
  96. package/dist/vendor/internal/detect-platform.d.ts +15 -0
  97. package/dist/vendor/internal/detect-platform.d.ts.map +1 -0
  98. package/dist/vendor/internal/detect-platform.js +157 -0
  99. package/dist/vendor/internal/detect-platform.js.map +1 -0
  100. package/dist/vendor/internal/errors.d.ts +3 -0
  101. package/dist/vendor/internal/errors.d.ts.map +1 -0
  102. package/dist/vendor/internal/errors.js +36 -0
  103. package/dist/vendor/internal/errors.js.map +1 -0
  104. package/dist/vendor/internal/headers.d.ts +22 -0
  105. package/dist/vendor/internal/headers.d.ts.map +1 -0
  106. package/dist/vendor/internal/headers.js +74 -0
  107. package/dist/vendor/internal/headers.js.map +1 -0
  108. package/dist/vendor/internal/parse.d.ts +17 -0
  109. package/dist/vendor/internal/parse.d.ts.map +1 -0
  110. package/dist/vendor/internal/parse.js +56 -0
  111. package/dist/vendor/internal/parse.js.map +1 -0
  112. package/dist/vendor/internal/request-options.d.ts +77 -0
  113. package/dist/vendor/internal/request-options.d.ts.map +1 -0
  114. package/dist/vendor/internal/request-options.js +10 -0
  115. package/dist/vendor/internal/request-options.js.map +1 -0
  116. package/dist/vendor/internal/shim-types.d.ts +17 -0
  117. package/dist/vendor/internal/shim-types.d.ts.map +1 -0
  118. package/dist/vendor/internal/shim-types.js +3 -0
  119. package/dist/vendor/internal/shim-types.js.map +1 -0
  120. package/dist/vendor/internal/shims.d.ts +26 -0
  121. package/dist/vendor/internal/shims.d.ts.map +1 -0
  122. package/dist/vendor/internal/shims.js +85 -0
  123. package/dist/vendor/internal/shims.js.map +1 -0
  124. package/dist/vendor/internal/stream-utils.d.ts +8 -0
  125. package/dist/vendor/internal/stream-utils.d.ts.map +1 -0
  126. package/dist/vendor/internal/stream-utils.js +35 -0
  127. package/dist/vendor/internal/stream-utils.js.map +1 -0
  128. package/dist/vendor/internal/to-file.d.ts +45 -0
  129. package/dist/vendor/internal/to-file.d.ts.map +1 -0
  130. package/dist/vendor/internal/to-file.js +93 -0
  131. package/dist/vendor/internal/to-file.js.map +1 -0
  132. package/dist/vendor/internal/types.d.ts +69 -0
  133. package/dist/vendor/internal/types.d.ts.map +1 -0
  134. package/dist/vendor/internal/types.js +3 -0
  135. package/dist/vendor/internal/types.js.map +1 -0
  136. package/dist/vendor/internal/uploads.d.ts +42 -0
  137. package/dist/vendor/internal/uploads.d.ts.map +1 -0
  138. package/dist/vendor/internal/uploads.js +135 -0
  139. package/dist/vendor/internal/uploads.js.map +1 -0
  140. package/dist/vendor/internal/utils/base64.d.ts +3 -0
  141. package/dist/vendor/internal/utils/base64.d.ts.map +1 -0
  142. package/dist/vendor/internal/utils/base64.js +33 -0
  143. package/dist/vendor/internal/utils/base64.js.map +1 -0
  144. package/dist/vendor/internal/utils/bytes.d.ts +4 -0
  145. package/dist/vendor/internal/utils/bytes.d.ts.map +1 -0
  146. package/dist/vendor/internal/utils/bytes.js +26 -0
  147. package/dist/vendor/internal/utils/bytes.js.map +1 -0
  148. package/dist/vendor/internal/utils/env.d.ts +9 -0
  149. package/dist/vendor/internal/utils/env.d.ts.map +1 -0
  150. package/dist/vendor/internal/utils/env.js +18 -0
  151. package/dist/vendor/internal/utils/env.js.map +1 -0
  152. package/dist/vendor/internal/utils/log.d.ts +37 -0
  153. package/dist/vendor/internal/utils/log.d.ts.map +1 -0
  154. package/dist/vendor/internal/utils/log.js +80 -0
  155. package/dist/vendor/internal/utils/log.js.map +1 -0
  156. package/dist/vendor/internal/utils/path.d.ts +15 -0
  157. package/dist/vendor/internal/utils/path.d.ts.map +1 -0
  158. package/dist/vendor/internal/utils/path.js +74 -0
  159. package/dist/vendor/internal/utils/path.js.map +1 -0
  160. package/dist/vendor/internal/utils/query.d.ts +5 -0
  161. package/dist/vendor/internal/utils/query.d.ts.map +1 -0
  162. package/dist/vendor/internal/utils/query.js +20 -0
  163. package/dist/vendor/internal/utils/query.js.map +1 -0
  164. package/dist/vendor/internal/utils/sleep.d.ts +2 -0
  165. package/dist/vendor/internal/utils/sleep.d.ts.map +1 -0
  166. package/dist/vendor/internal/utils/sleep.js +3 -0
  167. package/dist/vendor/internal/utils/sleep.js.map +1 -0
  168. package/dist/vendor/internal/utils/uuid.d.ts +5 -0
  169. package/dist/vendor/internal/utils/uuid.d.ts.map +1 -0
  170. package/dist/vendor/internal/utils/uuid.js +15 -0
  171. package/dist/vendor/internal/utils/uuid.js.map +1 -0
  172. package/dist/vendor/internal/utils/values.d.ts +19 -0
  173. package/dist/vendor/internal/utils/values.d.ts.map +1 -0
  174. package/dist/vendor/internal/utils/values.js +100 -0
  175. package/dist/vendor/internal/utils/values.js.map +1 -0
  176. package/dist/vendor/internal/utils.d.ts +8 -0
  177. package/dist/vendor/internal/utils.d.ts.map +1 -0
  178. package/dist/vendor/internal/utils.js +9 -0
  179. package/dist/vendor/internal/utils.js.map +1 -0
  180. package/dist/vendor/lib/BetaMessageStream.d.ts +122 -0
  181. package/dist/vendor/lib/BetaMessageStream.d.ts.map +1 -0
  182. package/dist/vendor/lib/BetaMessageStream.js +624 -0
  183. package/dist/vendor/lib/BetaMessageStream.js.map +1 -0
  184. package/dist/vendor/lib/MessageStream.d.ts +121 -0
  185. package/dist/vendor/lib/MessageStream.d.ts.map +1 -0
  186. package/dist/vendor/lib/MessageStream.js +599 -0
  187. package/dist/vendor/lib/MessageStream.js.map +1 -0
  188. package/dist/vendor/lib/beta-parser.d.ts +37 -0
  189. package/dist/vendor/lib/beta-parser.d.ts.map +1 -0
  190. package/dist/vendor/lib/beta-parser.js +75 -0
  191. package/dist/vendor/lib/beta-parser.js.map +1 -0
  192. package/dist/vendor/lib/parser.d.ts +32 -0
  193. package/dist/vendor/lib/parser.d.ts.map +1 -0
  194. package/dist/vendor/lib/parser.js +62 -0
  195. package/dist/vendor/lib/parser.js.map +1 -0
  196. package/dist/vendor/lib/stainless-helper-header.d.ts +34 -0
  197. package/dist/vendor/lib/stainless-helper-header.d.ts.map +1 -0
  198. package/dist/vendor/lib/stainless-helper-header.js +63 -0
  199. package/dist/vendor/lib/stainless-helper-header.js.map +1 -0
  200. package/dist/vendor/lib/tools/BetaRunnableTool.d.ts +12 -0
  201. package/dist/vendor/lib/tools/BetaRunnableTool.d.ts.map +1 -0
  202. package/dist/vendor/lib/tools/BetaRunnableTool.js +2 -0
  203. package/dist/vendor/lib/tools/BetaRunnableTool.js.map +1 -0
  204. package/dist/vendor/lib/tools/BetaToolRunner.d.ts +136 -0
  205. package/dist/vendor/lib/tools/BetaToolRunner.d.ts.map +1 -0
  206. package/dist/vendor/lib/tools/BetaToolRunner.js +370 -0
  207. package/dist/vendor/lib/tools/BetaToolRunner.js.map +1 -0
  208. package/dist/vendor/lib/tools/CompactionControl.d.ts +25 -0
  209. package/dist/vendor/lib/tools/CompactionControl.d.ts.map +1 -0
  210. package/dist/vendor/lib/tools/CompactionControl.js +25 -0
  211. package/dist/vendor/lib/tools/CompactionControl.js.map +1 -0
  212. package/dist/vendor/lib/tools/ToolError.d.ts +33 -0
  213. package/dist/vendor/lib/tools/ToolError.d.ts.map +1 -0
  214. package/dist/vendor/lib/tools/ToolError.js +43 -0
  215. package/dist/vendor/lib/tools/ToolError.js.map +1 -0
  216. package/dist/vendor/lib/tools/ToolRunner.d.ts +132 -0
  217. package/dist/vendor/lib/tools/ToolRunner.d.ts.map +1 -0
  218. package/dist/vendor/lib/tools/ToolRunner.js +287 -0
  219. package/dist/vendor/lib/tools/ToolRunner.js.map +1 -0
  220. package/dist/vendor/lib/transform-json-schema.d.ts +3 -0
  221. package/dist/vendor/lib/transform-json-schema.d.ts.map +1 -0
  222. package/dist/vendor/lib/transform-json-schema.js +111 -0
  223. package/dist/vendor/lib/transform-json-schema.js.map +1 -0
  224. package/dist/vendor/pagination.d.ts +3 -0
  225. package/dist/vendor/pagination.d.ts.map +1 -0
  226. package/dist/vendor/pagination.js +3 -0
  227. package/dist/vendor/pagination.js.map +1 -0
  228. package/dist/vendor/resource.d.ts +3 -0
  229. package/dist/vendor/resource.d.ts.map +1 -0
  230. package/dist/vendor/resource.js +3 -0
  231. package/dist/vendor/resource.js.map +1 -0
  232. package/dist/vendor/resources/beta/beta.d.ts +66 -0
  233. package/dist/vendor/resources/beta/beta.d.ts.map +1 -0
  234. package/dist/vendor/resources/beta/beta.js +21 -0
  235. package/dist/vendor/resources/beta/beta.js.map +1 -0
  236. package/dist/vendor/resources/beta/files.d.ts +151 -0
  237. package/dist/vendor/resources/beta/files.d.ts.map +1 -0
  238. package/dist/vendor/resources/beta/files.js +120 -0
  239. package/dist/vendor/resources/beta/files.js.map +1 -0
  240. package/dist/vendor/resources/beta/index.d.ts +6 -0
  241. package/dist/vendor/resources/beta/index.d.ts.map +1 -0
  242. package/dist/vendor/resources/beta/index.js +7 -0
  243. package/dist/vendor/resources/beta/index.js.map +1 -0
  244. package/dist/vendor/resources/beta/messages/batches.d.ts +646 -0
  245. package/dist/vendor/resources/beta/messages/batches.d.ts.map +1 -0
  246. package/dist/vendor/resources/beta/messages/batches.js +200 -0
  247. package/dist/vendor/resources/beta/messages/batches.js.map +1 -0
  248. package/dist/vendor/resources/beta/messages/index.d.ts +4 -0
  249. package/dist/vendor/resources/beta/messages/index.d.ts.map +1 -0
  250. package/dist/vendor/resources/beta/messages/index.js +5 -0
  251. package/dist/vendor/resources/beta/messages/index.js.map +1 -0
  252. package/dist/vendor/resources/beta/messages/messages.d.ts +2966 -0
  253. package/dist/vendor/resources/beta/messages/messages.d.ts.map +1 -0
  254. package/dist/vendor/resources/beta/messages/messages.js +153 -0
  255. package/dist/vendor/resources/beta/messages/messages.js.map +1 -0
  256. package/dist/vendor/resources/beta/messages.d.ts +2 -0
  257. package/dist/vendor/resources/beta/messages.d.ts.map +1 -0
  258. package/dist/vendor/resources/beta/messages.js +3 -0
  259. package/dist/vendor/resources/beta/messages.js.map +1 -0
  260. package/dist/vendor/resources/beta/models.d.ts +208 -0
  261. package/dist/vendor/resources/beta/models.d.ts.map +1 -0
  262. package/dist/vendor/resources/beta/models.js +56 -0
  263. package/dist/vendor/resources/beta/models.js.map +1 -0
  264. package/dist/vendor/resources/beta/skills/index.d.ts +3 -0
  265. package/dist/vendor/resources/beta/skills/index.d.ts.map +1 -0
  266. package/dist/vendor/resources/beta/skills/index.js +4 -0
  267. package/dist/vendor/resources/beta/skills/index.js.map +1 -0
  268. package/dist/vendor/resources/beta/skills/skills.d.ts +249 -0
  269. package/dist/vendor/resources/beta/skills/skills.d.ts.map +1 -0
  270. package/dist/vendor/resources/beta/skills/skills.js +90 -0
  271. package/dist/vendor/resources/beta/skills/skills.js.map +1 -0
  272. package/dist/vendor/resources/beta/skills/versions.d.ts +257 -0
  273. package/dist/vendor/resources/beta/skills/versions.d.ts.map +1 -0
  274. package/dist/vendor/resources/beta/skills/versions.js +96 -0
  275. package/dist/vendor/resources/beta/skills/versions.js.map +1 -0
  276. package/dist/vendor/resources/beta/skills.d.ts +2 -0
  277. package/dist/vendor/resources/beta/skills.d.ts.map +1 -0
  278. package/dist/vendor/resources/beta/skills.js +3 -0
  279. package/dist/vendor/resources/beta/skills.js.map +1 -0
  280. package/dist/vendor/resources/beta.d.ts +2 -0
  281. package/dist/vendor/resources/beta.d.ts.map +1 -0
  282. package/dist/vendor/resources/beta.js +3 -0
  283. package/dist/vendor/resources/beta.js.map +1 -0
  284. package/dist/vendor/resources/completions.d.ts +182 -0
  285. package/dist/vendor/resources/completions.d.ts.map +1 -0
  286. package/dist/vendor/resources/completions.js +19 -0
  287. package/dist/vendor/resources/completions.js.map +1 -0
  288. package/dist/vendor/resources/index.d.ts +6 -0
  289. package/dist/vendor/resources/index.d.ts.map +1 -0
  290. package/dist/vendor/resources/index.js +7 -0
  291. package/dist/vendor/resources/index.js.map +1 -0
  292. package/dist/vendor/resources/messages/batches.d.ts +304 -0
  293. package/dist/vendor/resources/messages/batches.d.ts.map +1 -0
  294. package/dist/vendor/resources/messages/batches.js +149 -0
  295. package/dist/vendor/resources/messages/batches.js.map +1 -0
  296. package/dist/vendor/resources/messages/index.d.ts +3 -0
  297. package/dist/vendor/resources/messages/index.d.ts.map +1 -0
  298. package/dist/vendor/resources/messages/index.js +4 -0
  299. package/dist/vendor/resources/messages/index.js.map +1 -0
  300. package/dist/vendor/resources/messages/messages.d.ts +2258 -0
  301. package/dist/vendor/resources/messages/messages.d.ts.map +1 -0
  302. package/dist/vendor/resources/messages/messages.js +120 -0
  303. package/dist/vendor/resources/messages/messages.js.map +1 -0
  304. package/dist/vendor/resources/messages.d.ts +2 -0
  305. package/dist/vendor/resources/messages.d.ts.map +1 -0
  306. package/dist/vendor/resources/messages.js +3 -0
  307. package/dist/vendor/resources/messages.js.map +1 -0
  308. package/dist/vendor/resources/models.d.ts +193 -0
  309. package/dist/vendor/resources/models.d.ts.map +1 -0
  310. package/dist/vendor/resources/models.js +41 -0
  311. package/dist/vendor/resources/models.js.map +1 -0
  312. package/dist/vendor/resources/shared.d.ts +44 -0
  313. package/dist/vendor/resources/shared.d.ts.map +1 -0
  314. package/dist/vendor/resources/shared.js +3 -0
  315. package/dist/vendor/resources/shared.js.map +1 -0
  316. package/dist/vendor/resources/top-level.d.ts +2 -0
  317. package/dist/vendor/resources/top-level.d.ts.map +1 -0
  318. package/dist/vendor/resources/top-level.js +3 -0
  319. package/dist/vendor/resources/top-level.js.map +1 -0
  320. package/dist/vendor/streaming.d.ts +3 -0
  321. package/dist/vendor/streaming.d.ts.map +1 -0
  322. package/dist/vendor/streaming.js +3 -0
  323. package/dist/vendor/streaming.js.map +1 -0
  324. package/dist/vendor/tools/memory/node.d.ts +18 -0
  325. package/dist/vendor/tools/memory/node.d.ts.map +1 -0
  326. package/dist/vendor/tools/memory/node.js +320 -0
  327. package/dist/vendor/tools/memory/node.js.map +1 -0
  328. package/dist/vendor/uploads.d.ts +3 -0
  329. package/dist/vendor/uploads.d.ts.map +1 -0
  330. package/dist/vendor/uploads.js +3 -0
  331. package/dist/vendor/uploads.js.map +1 -0
  332. package/dist/vendor/version.d.ts +2 -0
  333. package/dist/vendor/version.d.ts.map +1 -0
  334. package/dist/vendor/version.js +2 -0
  335. package/dist/vendor/version.js.map +1 -0
  336. package/package.json +66 -0
@@ -0,0 +1,406 @@
1
+ /**
2
+ * Helper functions for integrating MCP (Model Context Protocol) SDK types
3
+ * with the Anthropic SDK.
4
+ *
5
+ * These helpers reduce boilerplate when converting between MCP types and
6
+ * Anthropic API types. The interfaces defined here use TypeScript's structural
7
+ * typing to match MCP SDK types without requiring a direct dependency.
8
+ */
9
+ import { ToolError } from '../../lib/tools/ToolError.js';
10
+ import { SDK_HELPER_SYMBOL, collectStainlessHelpers, stainlessHelperHeader, } from '../../lib/stainless-helper-header.js';
11
+ import { fromBase64 } from '../../internal/utils/base64.js';
12
+ export { SDK_HELPER_SYMBOL, collectStainlessHelpers, stainlessHelperHeader };
13
+ // -----------------------------------------------------------------------------
14
+ // Supported MIME types
15
+ // -----------------------------------------------------------------------------
16
+ const SUPPORTED_IMAGE_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/webp'];
17
+ function isSupportedImageType(mimeType) {
18
+ return SUPPORTED_IMAGE_TYPES.includes(mimeType);
19
+ }
20
+ function isSupportedResourceMimeType(mimeType) {
21
+ return (!mimeType ||
22
+ mimeType.startsWith('text/') ||
23
+ mimeType === 'application/pdf' ||
24
+ isSupportedImageType(mimeType));
25
+ }
26
+ // -----------------------------------------------------------------------------
27
+ // Error classes
28
+ // -----------------------------------------------------------------------------
29
+ /**
30
+ * Error thrown when an MCP value cannot be converted to a format supported by the Claude API.
31
+ */
32
+ export class UnsupportedMCPValueError extends Error {
33
+ constructor(message) {
34
+ super(message);
35
+ this.name = 'UnsupportedMCPValueError';
36
+ }
37
+ }
38
+ // -----------------------------------------------------------------------------
39
+ // Helper functions
40
+ // -----------------------------------------------------------------------------
41
+ /**
42
+ * Converts an MCP tool to a BetaRunnableTool for use with the Anthropic SDK's
43
+ * `toolRunner()` method.
44
+ *
45
+ * @param tool The MCP tool definition from `mcpClient.listTools()`
46
+ * @param mcpClient The MCP client instance used to call the tool
47
+ * @param extraProps Additional Claude API properties to include in the tool definition
48
+ * @returns A runnable tool for use with `anthropic.beta.messages.toolRunner()`
49
+ * @throws {UnsupportedMCPValueError} When the tool returns unsupported content types
50
+ * @throws {UnsupportedMCPValueError} When the tool returns unsupported resource links
51
+ * @throws {UnsupportedMCPValueError} When the tool returns resources with unsupported MIME types
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * import { Client } from "@modelcontextprotocol/sdk/client/index.js";
56
+ * import Anthropic from "@anthropic-ai/sdk";
57
+ * import { mcpTool } from "@anthropic-ai/sdk/helpers/beta/mcp";
58
+ *
59
+ * const mcpClient = new Client({ name: "example", version: "1.0.0" });
60
+ * const anthropic = new Anthropic();
61
+ *
62
+ * const tools = await mcpClient.listTools();
63
+ * const runner = await anthropic.beta.messages.toolRunner({
64
+ * model: "claude-sonnet-4-20250514",
65
+ * max_tokens: 1024,
66
+ * tools: tools.tools.map(tool => mcpTool(tool, mcpClient)),
67
+ * messages: [{ role: "user", content: "Use the available tools" }],
68
+ * });
69
+ * ```
70
+ */
71
+ export function mcpTool(tool, mcpClient, extraProps) {
72
+ // Transform inputSchema to match BetaTool.InputSchema (convert undefined to null)
73
+ const inputSchema = {
74
+ ...tool.inputSchema,
75
+ type: 'object',
76
+ properties: tool.inputSchema.properties ?? null,
77
+ required: tool.inputSchema.required ?? null,
78
+ };
79
+ const betaTool = {
80
+ name: tool.name,
81
+ input_schema: inputSchema,
82
+ ...(tool.description !== undefined ? { description: tool.description } : {}),
83
+ ...extraProps,
84
+ };
85
+ const runnableTool = {
86
+ ...betaTool,
87
+ run: async (input) => {
88
+ const result = await mcpClient.callTool({
89
+ name: tool.name,
90
+ arguments: input,
91
+ });
92
+ if (result.isError) {
93
+ const content = result.content.map((item) => mcpContent(item));
94
+ throw new ToolError(content);
95
+ }
96
+ // If content is empty but structuredContent is present, JSON encode it
97
+ // Spec: "For backwards compatibility, a tool that returns structured content SHOULD also return the serialized JSON in a TextContent block."
98
+ // meaning it's not required and cannot be assumed.
99
+ if (result.content.length === 0 &&
100
+ // Spec: "Structured content is returned as a JSON object in the structuredContent field of a result."
101
+ typeof result.structuredContent === 'object' &&
102
+ result.structuredContent !== null) {
103
+ return JSON.stringify(result.structuredContent);
104
+ }
105
+ return result.content.map((item) => mcpContent(item));
106
+ },
107
+ parse: (content) => content,
108
+ [SDK_HELPER_SYMBOL]: 'mcpTool',
109
+ };
110
+ return runnableTool;
111
+ }
112
+ /**
113
+ * Converts an array of MCP tools to BetaRunnableTools.
114
+ *
115
+ * @param tools Array of MCP tool definitions from `mcpClient.listTools()`
116
+ * @param mcpClient The MCP client instance used to call the tools
117
+ * @param extraProps Additional Claude API properties to include in each tool definition
118
+ * @returns An array of runnable tools for use with `anthropic.beta.messages.toolRunner()`
119
+ *
120
+ * @example
121
+ * ```ts
122
+ * const { tools } = await mcpClient.listTools();
123
+ * const runner = await anthropic.beta.messages.toolRunner({
124
+ * model: "claude-sonnet-4-20250514",
125
+ * max_tokens: 1024,
126
+ * tools: mcpTools(tools, mcpClient),
127
+ * messages: [{ role: "user", content: "Use the available tools" }],
128
+ * });
129
+ * ```
130
+ */
131
+ export function mcpTools(tools, mcpClient, extraProps) {
132
+ return tools.map((tool) => mcpTool(tool, mcpClient, extraProps));
133
+ }
134
+ /**
135
+ * Converts an MCP prompt message to an Anthropic BetaMessageParam.
136
+ *
137
+ * @param mcpMessage The MCP prompt message from `mcpClient.getPrompt()`
138
+ * @param extraProps Additional Claude API properties to include in content blocks (e.g., `cache_control`)
139
+ * @returns A message parameter for use with `anthropic.beta.messages.create()`
140
+ * @throws {UnsupportedMCPValueError} When the message contains unsupported content types
141
+ * @throws {UnsupportedMCPValueError} When the message contains unsupported resource links
142
+ * @throws {UnsupportedMCPValueError} When the message contains resources with unsupported MIME types
143
+ *
144
+ * @example
145
+ * ```ts
146
+ * import { Client } from "@modelcontextprotocol/sdk/client/index.js";
147
+ * import Anthropic from "@anthropic-ai/sdk";
148
+ * import { mcpMessage } from "@anthropic-ai/sdk/helpers/beta/mcp";
149
+ *
150
+ * const mcpClient = new Client({ name: "example", version: "1.0.0" });
151
+ * const anthropic = new Anthropic();
152
+ *
153
+ * const prompt = await mcpClient.getPrompt({
154
+ * name: "example-prompt",
155
+ * arguments: { arg1: "value" },
156
+ * });
157
+ *
158
+ * await anthropic.beta.messages.create({
159
+ * model: "claude-sonnet-4-20250514",
160
+ * max_tokens: 1024,
161
+ * messages: prompt.messages.map(msg => mcpMessage(msg)),
162
+ * });
163
+ * ```
164
+ */
165
+ export function mcpMessage(mcpMessage, extraProps) {
166
+ const message = {
167
+ role: mcpMessage.role,
168
+ content: [mcpContent(mcpMessage.content, extraProps)],
169
+ [SDK_HELPER_SYMBOL]: 'mcpMessage',
170
+ };
171
+ return message;
172
+ }
173
+ /**
174
+ * Converts an array of MCP prompt messages to Anthropic BetaMessageParams.
175
+ *
176
+ * @param messages Array of MCP prompt messages from `mcpClient.getPrompt()`
177
+ * @param extraProps Additional Claude API properties to include in content blocks (e.g., `cache_control`)
178
+ * @returns An array of message parameters for use with `anthropic.beta.messages.create()`
179
+ * @throws {UnsupportedMCPValueError} When any message contains unsupported content types
180
+ * @throws {UnsupportedMCPValueError} When any message contains unsupported resource links
181
+ * @throws {UnsupportedMCPValueError} When any message contains resources with unsupported MIME types
182
+ *
183
+ * @example
184
+ * ```ts
185
+ * const { messages } = await mcpClient.getPrompt({ name: "example-prompt" });
186
+ * await anthropic.beta.messages.create({
187
+ * model: "claude-sonnet-4-20250514",
188
+ * max_tokens: 1024,
189
+ * messages: mcpMessages(messages),
190
+ * });
191
+ * ```
192
+ */
193
+ export function mcpMessages(messages, extraProps) {
194
+ return messages.map((message) => mcpMessage(message, extraProps));
195
+ }
196
+ /**
197
+ * Converts a single MCP prompt content item to an Anthropic content block.
198
+ *
199
+ * @param content The MCP content item (text, image, or embedded resource)
200
+ * @param extraProps Additional Claude API properties to include in the content block (e.g., `cache_control`)
201
+ * @returns A Claude content block for use in a message's content array
202
+ * @throws {UnsupportedMCPValueError} When the content type is not supported (e.g., 'audio')
203
+ * @throws {UnsupportedMCPValueError} When resource links use non-http/https protocols
204
+ * @throws {UnsupportedMCPValueError} When resources have unsupported MIME types
205
+ *
206
+ * @example
207
+ * ```ts
208
+ * const { messages } = await mcpClient.getPrompt({ name: "my-prompt" });
209
+ * // If you need to mix MCP content with other content:
210
+ * await anthropic.beta.messages.create({
211
+ * model: "claude-sonnet-4-20250514",
212
+ * max_tokens: 1024,
213
+ * messages: [{
214
+ * role: "user",
215
+ * content: [
216
+ * mcpContent(messages[0].content),
217
+ * { type: "text", text: "Additional context" },
218
+ * ],
219
+ * }],
220
+ * });
221
+ * ```
222
+ */
223
+ export function mcpContent(content, extraProps) {
224
+ switch (content.type) {
225
+ case 'text': {
226
+ const textBlock = {
227
+ type: 'text',
228
+ text: content.text,
229
+ ...extraProps,
230
+ [SDK_HELPER_SYMBOL]: 'mcpContent',
231
+ };
232
+ return textBlock;
233
+ }
234
+ case 'image': {
235
+ if (!isSupportedImageType(content.mimeType)) {
236
+ throw new UnsupportedMCPValueError(`Unsupported image MIME type: ${content.mimeType}`);
237
+ }
238
+ const imageBlock = {
239
+ type: 'image',
240
+ source: {
241
+ type: 'base64',
242
+ data: content.data,
243
+ media_type: content.mimeType,
244
+ },
245
+ ...extraProps,
246
+ [SDK_HELPER_SYMBOL]: 'mcpContent',
247
+ };
248
+ return imageBlock;
249
+ }
250
+ case 'resource':
251
+ return mcpResourceContentToContentBlock(content.resource, extraProps, 'mcpContent');
252
+ case 'resource_link':
253
+ case 'audio':
254
+ throw new UnsupportedMCPValueError(`Unsupported MCP content type: ${content.type}`);
255
+ default:
256
+ // This should never happen as we handle all MCPPromptContentLike types
257
+ content;
258
+ throw new UnsupportedMCPValueError(`Unsupported MCP content type: ${content.type}`);
259
+ }
260
+ }
261
+ /**
262
+ * Converts a single MCP resource contents item to an Anthropic content block.
263
+ */
264
+ function mcpResourceContentToContentBlock(resourceContent, extraProps, helperName = 'mcpResourceToContent') {
265
+ const mimeType = resourceContent.mimeType;
266
+ // Handle images (requires blob - base64-encoded binary data)
267
+ if (mimeType && isSupportedImageType(mimeType)) {
268
+ if (!('blob' in resourceContent)) {
269
+ throw new UnsupportedMCPValueError(`Image resource must have blob data, not text. URI: ${resourceContent.uri}`);
270
+ }
271
+ const imageBlock = {
272
+ type: 'image',
273
+ source: {
274
+ type: 'base64',
275
+ data: resourceContent.blob,
276
+ media_type: mimeType,
277
+ },
278
+ ...extraProps,
279
+ [SDK_HELPER_SYMBOL]: helperName,
280
+ };
281
+ return imageBlock;
282
+ }
283
+ // Handle PDFs (requires blob - base64-encoded binary data)
284
+ if (mimeType === 'application/pdf') {
285
+ if (!('blob' in resourceContent)) {
286
+ throw new UnsupportedMCPValueError(`PDF resource must have blob data, not text. URI: ${resourceContent.uri}`);
287
+ }
288
+ const pdfBlock = {
289
+ type: 'document',
290
+ source: {
291
+ type: 'base64',
292
+ data: resourceContent.blob,
293
+ media_type: 'application/pdf',
294
+ },
295
+ ...extraProps,
296
+ [SDK_HELPER_SYMBOL]: helperName,
297
+ };
298
+ return pdfBlock;
299
+ }
300
+ // Handle text types (text/*, or no MIME type defaults to text)
301
+ if (!mimeType || mimeType.startsWith('text/')) {
302
+ const textDocBlock = {
303
+ type: 'document',
304
+ source: textSourceFromResource(resourceContent),
305
+ ...extraProps,
306
+ [SDK_HELPER_SYMBOL]: helperName,
307
+ };
308
+ return textDocBlock;
309
+ }
310
+ throw new UnsupportedMCPValueError(`Unsupported MIME type "${mimeType}" for resource: ${resourceContent.uri}`);
311
+ }
312
+ /**
313
+ * Converts MCP resource contents to an Anthropic content block.
314
+ *
315
+ * This helper is useful when you have resource contents from `mcpClient.readResource()`
316
+ * and want to include them in a message or as a document source. It automatically
317
+ * finds the first resource with a supported MIME type.
318
+ *
319
+ * @param result The result from `mcpClient.readResource()`
320
+ * @param extraProps Additional Claude API properties to include in the content block (e.g., `cache_control`)
321
+ * @returns A Claude content block
322
+ * @throws {UnsupportedMCPValueError} When contents array is empty or none have a supported MIME type
323
+ *
324
+ * @example
325
+ * ```ts
326
+ * import { Client } from "@modelcontextprotocol/sdk/client/index.js";
327
+ * import Anthropic from "@anthropic-ai/sdk";
328
+ * import { mcpResourceToContent } from "@anthropic-ai/sdk/helpers/beta/mcp";
329
+ *
330
+ * const mcpClient = new Client({ name: "example", version: "1.0.0" });
331
+ * const anthropic = new Anthropic();
332
+ *
333
+ * const resource = await mcpClient.readResource({ uri: "file:///example.txt" });
334
+ * await anthropic.beta.messages.create({
335
+ * model: "claude-sonnet-4-20250514",
336
+ * max_tokens: 1024,
337
+ * messages: [{
338
+ * role: "user",
339
+ * content: [mcpResourceToContent(resource)],
340
+ * }],
341
+ * });
342
+ * ```
343
+ */
344
+ export function mcpResourceToContent(result, extraProps) {
345
+ if (result.contents.length === 0) {
346
+ throw new UnsupportedMCPValueError('Resource contents array must contain at least one item');
347
+ }
348
+ const supported = result.contents.find((c) => isSupportedResourceMimeType(c.mimeType));
349
+ if (!supported) {
350
+ const mimeTypes = result.contents.map((c) => c.mimeType).filter((m) => m !== undefined);
351
+ throw new UnsupportedMCPValueError(`No supported MIME type found in resource contents. Available: ${mimeTypes.join(', ')}`);
352
+ }
353
+ return mcpResourceContentToContentBlock(supported, extraProps);
354
+ }
355
+ /**
356
+ * Gets the raw bytes from an MCP resource.
357
+ */
358
+ function bytesFromResource(resource) {
359
+ if ('blob' in resource) {
360
+ return fromBase64(resource.blob);
361
+ }
362
+ return new TextEncoder().encode(resource.text);
363
+ }
364
+ /**
365
+ * Creates a text document source from an MCP resource, decoding base64 blob to UTF-8 if needed.
366
+ */
367
+ function textSourceFromResource(resource) {
368
+ const data = 'text' in resource ? resource.text : new TextDecoder().decode(fromBase64(resource.blob));
369
+ return { type: 'text', data, media_type: 'text/plain' };
370
+ }
371
+ /**
372
+ * Converts an MCP resource to a File object suitable for uploading via `anthropic.beta.files.upload()`.
373
+ *
374
+ * @param result The result from `mcpClient.readResource()`
375
+ * @returns A File object for use with `anthropic.beta.files.upload()`
376
+ * @throws {UnsupportedMCPValueError} When contents array is empty
377
+ *
378
+ * @example
379
+ * ```ts
380
+ * import { Client } from "@modelcontextprotocol/sdk/client/index.js";
381
+ * import Anthropic from "@anthropic-ai/sdk";
382
+ * import { mcpResourceToFile } from "@anthropic-ai/sdk/helpers/beta/mcp";
383
+ *
384
+ * const mcpClient = new Client({ name: "example", version: "1.0.0" });
385
+ * const anthropic = new Anthropic();
386
+ *
387
+ * const resource = await mcpClient.readResource({ uri: "file:///document.pdf" });
388
+ *
389
+ * const uploaded = await anthropic.beta.files.upload({
390
+ * file: mcpResourceToFile(resource),
391
+ * });
392
+ * ```
393
+ */
394
+ export function mcpResourceToFile(result) {
395
+ if (result.contents.length === 0) {
396
+ throw new UnsupportedMCPValueError('Resource contents array must contain at least one item');
397
+ }
398
+ const resourceContents = result.contents[0];
399
+ const name = new URL(resourceContents.uri).pathname.split('/').at(-1) || 'file';
400
+ const type = resourceContents.mimeType;
401
+ const data = bytesFromResource(resourceContents);
402
+ const file = new File([data], name, type ? { type } : undefined);
403
+ file[SDK_HELPER_SYMBOL] = 'mcpResourceToFile';
404
+ return file;
405
+ }
406
+ //# sourceMappingURL=mcp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../../../src/vendor/helpers/beta/mcp.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAUzD,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,CAAC;AA2H7E,gFAAgF;AAChF,uBAAuB;AACvB,gFAAgF;AAEhF,MAAM,qBAAqB,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,CAAU,CAAC;AAG9F,SAAS,oBAAoB,CAAC,QAAgB;IAC5C,OAAO,qBAAqB,CAAC,QAAQ,CAAC,QAA8B,CAAC,CAAC;AACxE,CAAC;AAED,SAAS,2BAA2B,CAAC,QAA4B;IAC/D,OAAO,CACL,CAAC,QAAQ;QACT,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC;QAC5B,QAAQ,KAAK,iBAAiB;QAC9B,oBAAoB,CAAC,QAAQ,CAAC,CAC/B,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,gBAAgB;AAChB,gFAAgF;AAEhF;;GAEG;AACH,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IACjD,YAAY,O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1,11 @@
1
+ import { BetaRunnableTool, Promisable } from '../../lib/tools/BetaRunnableTool.js';
2
+ import { BetaMemoryTool20250818Command, BetaToolResultContentBlockParam } from '../../resources/beta.js';
3
+ type Command = BetaMemoryTool20250818Command['command'];
4
+ export type MemoryToolHandlers = {
5
+ [K in Command]: (command: Extract<BetaMemoryTool20250818Command, {
6
+ command: K;
7
+ }>) => Promisable<string | Array<BetaToolResultContentBlockParam>>;
8
+ };
9
+ export declare function betaMemoryTool(handlers: MemoryToolHandlers): BetaRunnableTool<BetaMemoryTool20250818Command>;
10
+ export {};
11
+ //# sourceMappingURL=memory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../../src/vendor/helpers/beta/memory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACnF,OAAO,EAAE,6BAA6B,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAEzG,KAAK,OAAO,GAAG,6BAA6B,CAAC,SAAS,CAAC,CAAC;AAExD,MAAM,MAAM,kBAAkB,GAAG;KAC9B,CAAC,IAAI,OAAO,GAAG,CACd,OAAO,EAAE,OAAO,CAAC,6BAA6B,EAAE;QAAE,OAAO,EAAE,CAAC,CAAA;KAAE,CAAC,KAC5D,UAAU,CAAC,MAAM,GAAG,KAAK,CAAC,+BAA+B,CAAC,CAAC;CACjE,CAAC;AAEF,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,kBAAkB,GAC3B,gBAAgB,CAAC,6BAA6B,CAAC,CAcjD"}
@@ -0,0 +1,15 @@
1
+ export function betaMemoryTool(handlers) {
2
+ return {
3
+ type: 'memory_20250818',
4
+ name: 'memory',
5
+ parse: (content) => content,
6
+ run: (args) => {
7
+ const handler = handlers[args.command];
8
+ if (!handler) {
9
+ throw new Error(`${args.command} not implemented`);
10
+ }
11
+ return handler.bind(handlers)(args);
12
+ },
13
+ };
14
+ }
15
+ //# sourceMappingURL=memory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory.js","sourceRoot":"","sources":["../../../../src/vendor/helpers/beta/memory.ts"],"names":[],"mappings":"AAWA,MAAM,UAAU,cAAc,CAC5B,QAA4B;IAE5B,OAAO;QACL,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAwC;QAC5D,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE;YACZ,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACvC,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,kBAAkB,CAAC,CAAC;YACrD,CAAC;YAED,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAW,CAAC,CAAC;QAC7C,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Stub for the upstream beta zod helper. See ../zod.ts for context.
3
+ */
4
+ export declare function betaZodOutputFormat(_zodObject: unknown): never;
5
+ export declare function betaZodTool(_options: unknown): never;
6
+ export type InputSchema = any;
7
+ //# sourceMappingURL=zod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zod.d.ts","sourceRoot":"","sources":["../../../../src/vendor/helpers/beta/zod.ts"],"names":[],"mappings":"AAAA;;GAEG;AAWH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,OAAO,GAAG,KAAK,CAE9D;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,KAAK,CAEpD;AAED,MAAM,MAAM,WAAW,GAAG,GAAG,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Stub for the upstream beta zod helper. See ../zod.ts for context.
3
+ */
4
+ import { AnthropicError } from '../../core/error.js';
5
+ function requireZod(importName) {
6
+ throw new AnthropicError(`${importName} is provided by @puku-ai/sdk as a stub. ` +
7
+ 'Install the `zod` peer dependency to use this helper at runtime.');
8
+ }
9
+ export function betaZodOutputFormat(_zodObject) {
10
+ requireZod('betaZodOutputFormat');
11
+ }
12
+ export function betaZodTool(_options) {
13
+ requireZod('betaZodTool');
14
+ }
15
+ //# sourceMappingURL=zod.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zod.js","sourceRoot":"","sources":["../../../../src/vendor/helpers/beta/zod.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,SAAS,UAAU,CAAC,UAAkB;IACpC,MAAM,IAAI,cAAc,CACtB,GAAG,UAAU,0CAA0C;QACrD,kEAAkE,CACrE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,UAAmB;IACrD,UAAU,CAAC,qBAAqB,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,QAAiB;IAC3C,UAAU,CAAC,aAAa,CAAC,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { jsonSchemaOutputFormat } from './json-schema.js';
2
+ export { zodOutputFormat } from './zod.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vendor/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { jsonSchemaOutputFormat } from './json-schema.js';
2
+ export { zodOutputFormat } from './zod.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/vendor/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { FromSchema, JSONSchema } from 'json-schema-to-ts';
2
+ import { AutoParseableOutputFormat } from '../lib/parser.js';
3
+ type NoInfer<T> = T extends infer R ? R : never;
4
+ /**
5
+ * Creates a JSON schema output format object from the given JSON schema.
6
+ * If this is passed to the `.parse()` method then the response message will contain a
7
+ * `.parsed_output` property that is the result of parsing the content with the given JSON schema.
8
+ *
9
+ * Note: When `transform` is enabled (the default), the schema is deep-cloned before transformation,
10
+ * so the original schema object is not modified.
11
+ */
12
+ export declare function jsonSchemaOutputFormat<const Schema extends Exclude<JSONSchema, boolean> & {
13
+ type: 'object';
14
+ }>(jsonSchema: Schema, options?: {
15
+ transform?: boolean;
16
+ }): AutoParseableOutputFormat<NoInfer<FromSchema<Schema>>>;
17
+ export {};
18
+ //# sourceMappingURL=json-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-schema.d.ts","sourceRoot":"","sources":["../../../src/vendor/helpers/json-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAI7D,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAEhD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,CAAC,MAAM,SAAS,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,EAEtE,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE;IACR,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,GACA,yBAAyB,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAyBxD"}
@@ -0,0 +1,34 @@
1
+ import { AnthropicError } from '../core/error.js';
2
+ import { transformJSONSchema } from '../lib/transform-json-schema.js';
3
+ /**
4
+ * Creates a JSON schema output format object from the given JSON schema.
5
+ * If this is passed to the `.parse()` method then the response message will contain a
6
+ * `.parsed_output` property that is the result of parsing the content with the given JSON schema.
7
+ *
8
+ * Note: When `transform` is enabled (the default), the schema is deep-cloned before transformation,
9
+ * so the original schema object is not modified.
10
+ */
11
+ export function jsonSchemaOutputFormat(jsonSchema, options) {
12
+ if (jsonSchema.type !== 'object') {
13
+ throw new Error(`JSON schema must be an object, but got ${jsonSchema.type}`);
14
+ }
15
+ const transform = options?.transform ?? true;
16
+ if (transform) {
17
+ jsonSchema = transformJSONSchema(jsonSchema);
18
+ }
19
+ return {
20
+ type: 'json_schema',
21
+ schema: {
22
+ ...jsonSchema,
23
+ },
24
+ parse: (content) => {
25
+ try {
26
+ return JSON.parse(content);
27
+ }
28
+ catch (error) {
29
+ throw new AnthropicError(`Failed to parse structured output: ${error instanceof Error ? error.message : String(error)}`);
30
+ }
31
+ },
32
+ };
33
+ }
34
+ //# sourceMappingURL=json-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-schema.js","sourceRoot":"","sources":["../../../src/vendor/helpers/json-schema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAItE;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CAGpC,UAAkB,EAClB,OAEC;IAED,IAAI,UAAU,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,0CAA0C,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED,MAAM,SAAS,GAAG,OAAO,EAAE,SAAS,IAAI,IAAI,CAAC;IAC7C,IAAI,SAAS,EAAE,CAAC;QACd,UAAU,GAAG,mBAAmB,CAAC,UAAU,CAAW,CAAC;IACzD,CAAC;IAED,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,MAAM,EAAE;YACN,GAAG,UAAU;SACd;QACD,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE;YACjB,IAAI,CAAC;gBACH,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC7B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,cAAc,CACtB,sCAAsC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAC/F,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Stub for the upstream zod helper.
3
+ *
4
+ * The full @anthropic-ai/sdk zod helper pulls in `zod` v4 and
5
+ * `json-schema-to-ts` as optional peer dependencies. We vendor the surface
6
+ * so puku-cli code that imports from "@anthropic-ai/sdk" still resolves, but
7
+ * the runtime throws a clear "install zod to use this helper" error if
8
+ * invoked. Users who want the full behavior should install zod and use
9
+ * `zodOutputFormat` from the upstream package directly.
10
+ */
11
+ export declare function zodOutputFormat(_zodObject: unknown): never;
12
+ export type ZodInput = any;
13
+ //# sourceMappingURL=zod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zod.d.ts","sourceRoot":"","sources":["../../../src/vendor/helpers/zod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAaH,wBAAgB,eAAe,CAAC,UAAU,EAAE,OAAO,GAAG,KAAK,CAE1D;AAED,MAAM,MAAM,QAAQ,GAAG,GAAG,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Stub for the upstream zod helper.
3
+ *
4
+ * The full @anthropic-ai/sdk zod helper pulls in `zod` v4 and
5
+ * `json-schema-to-ts` as optional peer dependencies. We vendor the surface
6
+ * so puku-cli code that imports from "@anthropic-ai/sdk" still resolves, but
7
+ * the runtime throws a clear "install zod to use this helper" error if
8
+ * invoked. Users who want the full behavior should install zod and use
9
+ * `zodOutputFormat` from the upstream package directly.
10
+ */
11
+ import { AnthropicError } from '../core/error.js';
12
+ function requireZod(importName) {
13
+ throw new AnthropicError(`${importName} is provided by @puku-ai/sdk as a stub. ` +
14
+ 'Install the `zod` peer dependency to use this helper at runtime. ' +
15
+ 'See https://docs.anthropic.com/en/docs/build-with-claude/structured-outputs');
16
+ }
17
+ // Re-export the same public symbol shape so type imports continue to work.
18
+ export function zodOutputFormat(_zodObject) {
19
+ requireZod('zodOutputFormat');
20
+ }
21
+ //# sourceMappingURL=zod.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zod.js","sourceRoot":"","sources":["../../../src/vendor/helpers/zod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,SAAS,UAAU,CAAC,UAAkB;IACpC,MAAM,IAAI,cAAc,CACtB,GAAG,UAAU,0CAA0C;QACrD,mEAAmE;QACnE,6EAA6E,CAChF,CAAC;AACJ,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,eAAe,CAAC,UAAmB;IACjD,UAAU,CAAC,iBAAiB,CAAC,CAAC;AAChC,CAAC"}
@@ -0,0 +1,8 @@
1
+ export { PukuAI as default } from './client.js';
2
+ export { type Uploadable, toFile } from './core/uploads.js';
3
+ export { APIPromise } from './core/api-promise.js';
4
+ export { BaseAnthropic, PukuAI, type ClientOptions, HUMAN_PROMPT, AI_PROMPT } from './client.js';
5
+ export { PagePromise } from './core/pagination.js';
6
+ export { AnthropicError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from './core/error.js';
7
+ export type { AutoParseableOutputFormat, ParsedMessage, ParsedContentBlock, ParseableMessageCreateParams, ExtractParsedContentFromParams, } from './lib/parser.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vendor/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACjG,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EACL,cAAc,EACd,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACV,yBAAyB,EACzB,aAAa,EACb,kBAAkB,EAClB,4BAA4B,EAC5B,8BAA8B,GAC/B,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,8 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export { PukuAI as default } from './client.js';
3
+ export { toFile } from './core/uploads.js';
4
+ export { APIPromise } from './core/api-promise.js';
5
+ export { BaseAnthropic, PukuAI, HUMAN_PROMPT, AI_PROMPT } from './client.js';
6
+ export { PagePromise } from './core/pagination.js';
7
+ export { AnthropicError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from './core/error.js';
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/vendor/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAmB,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,EAAsB,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACjG,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EACL,cAAc,EACd,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,iBAAiB,CAAC"}