@puku-ai/sdk 4.0.0 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (583) hide show
  1. package/README.md +29 -10
  2. package/dist/index.d.ts +26 -0
  3. package/dist/index.js +32 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/vendor/_vendor/partial-json-parser/parser.d.ts +2 -0
  6. package/dist/vendor/_vendor/partial-json-parser/parser.js +223 -0
  7. package/dist/vendor/_vendor/partial-json-parser/parser.js.map +1 -0
  8. package/dist/vendor/api-promise.d.ts +2 -0
  9. package/dist/vendor/api-promise.js +3 -0
  10. package/dist/vendor/api-promise.js.map +1 -0
  11. package/dist/vendor/client.d.ts +399 -0
  12. package/dist/vendor/client.js +976 -0
  13. package/dist/vendor/client.js.map +1 -0
  14. package/dist/vendor/core/api-promise.d.ts +49 -0
  15. package/dist/vendor/core/api-promise.js +77 -0
  16. package/dist/vendor/core/api-promise.js.map +1 -0
  17. package/dist/vendor/core/api.d.ts +10 -0
  18. package/dist/vendor/core/api.js +2 -0
  19. package/dist/vendor/core/api.js.map +1 -0
  20. package/dist/vendor/core/credentials.d.ts +130 -0
  21. package/dist/vendor/core/credentials.js +274 -0
  22. package/dist/vendor/core/credentials.js.map +1 -0
  23. package/dist/vendor/core/error.d.ts +82 -0
  24. package/dist/vendor/core/error.js +140 -0
  25. package/dist/vendor/core/error.js.map +1 -0
  26. package/dist/vendor/core/middleware.d.ts +153 -0
  27. package/dist/vendor/core/middleware.js +168 -0
  28. package/dist/vendor/core/middleware.js.map +1 -0
  29. package/dist/vendor/core/pagination.d.ts +121 -0
  30. package/dist/vendor/core/pagination.js +207 -0
  31. package/dist/vendor/core/pagination.js.map +1 -0
  32. package/dist/vendor/core/resource.d.ts +5 -0
  33. package/dist/vendor/core/resource.js +8 -0
  34. package/dist/vendor/core/resource.js.map +1 -0
  35. package/dist/vendor/core/streaming.d.ts +41 -0
  36. package/dist/vendor/core/streaming.js +342 -0
  37. package/dist/vendor/core/streaming.js.map +1 -0
  38. package/dist/vendor/core/uploads.d.ts +2 -0
  39. package/dist/vendor/core/uploads.js +2 -0
  40. package/dist/vendor/core/uploads.js.map +1 -0
  41. package/dist/vendor/error.d.ts +2 -0
  42. package/dist/vendor/error.js +3 -0
  43. package/dist/vendor/error.js.map +1 -0
  44. package/dist/vendor/helpers/beta/environments.d.ts +22 -0
  45. package/dist/vendor/helpers/beta/environments.js +23 -0
  46. package/dist/vendor/helpers/beta/environments.js.map +1 -0
  47. package/dist/vendor/helpers/beta/json-schema.d.ts +36 -0
  48. package/dist/vendor/helpers/beta/json-schema.js +53 -0
  49. package/dist/vendor/helpers/beta/json-schema.js.map +1 -0
  50. package/dist/vendor/helpers/beta/mcp.d.ts +302 -0
  51. package/dist/vendor/helpers/beta/mcp.js +406 -0
  52. package/dist/vendor/helpers/beta/mcp.js.map +1 -0
  53. package/dist/vendor/helpers/beta/memory.d.ts +10 -0
  54. package/dist/vendor/helpers/beta/memory.js +15 -0
  55. package/dist/vendor/helpers/beta/memory.js.map +1 -0
  56. package/dist/vendor/helpers/beta/standard-schema.d.ts +44 -0
  57. package/dist/vendor/helpers/beta/standard-schema.js +54 -0
  58. package/dist/vendor/helpers/beta/standard-schema.js.map +1 -0
  59. package/dist/vendor/helpers/beta/zod.d.ts +32 -0
  60. package/dist/vendor/helpers/beta/zod.js +52 -0
  61. package/dist/vendor/helpers/beta/zod.js.map +1 -0
  62. package/dist/vendor/helpers/index.d.ts +2 -0
  63. package/dist/vendor/helpers/index.js +3 -0
  64. package/dist/vendor/helpers/index.js.map +1 -0
  65. package/dist/vendor/helpers/json-schema.d.ts +17 -0
  66. package/dist/vendor/helpers/json-schema.js +34 -0
  67. package/dist/vendor/helpers/json-schema.js.map +1 -0
  68. package/dist/vendor/helpers/zod.d.ts +12 -0
  69. package/dist/vendor/helpers/zod.js +42 -0
  70. package/dist/vendor/helpers/zod.js.map +1 -0
  71. package/dist/vendor/index.d.ts +16 -0
  72. package/dist/vendor/index.js +23 -0
  73. package/dist/vendor/index.js.map +1 -0
  74. package/dist/vendor/internal/builtin-types.d.ts +72 -0
  75. package/dist/vendor/internal/builtin-types.js +3 -0
  76. package/dist/vendor/internal/builtin-types.js.map +1 -0
  77. package/dist/vendor/internal/constants.d.ts +4 -0
  78. package/dist/vendor/internal/constants.js +10 -0
  79. package/dist/vendor/internal/constants.js.map +1 -0
  80. package/dist/vendor/internal/decoders/jsonl.d.ts +9 -0
  81. package/dist/vendor/internal/decoders/jsonl.js +37 -0
  82. package/dist/vendor/internal/decoders/jsonl.js.map +1 -0
  83. package/dist/vendor/internal/decoders/line.d.ts +16 -0
  84. package/dist/vendor/internal/decoders/line.js +105 -0
  85. package/dist/vendor/internal/decoders/line.js.map +1 -0
  86. package/dist/vendor/internal/detect-platform.d.ts +14 -0
  87. package/dist/vendor/internal/detect-platform.js +155 -0
  88. package/dist/vendor/internal/detect-platform.js.map +1 -0
  89. package/dist/vendor/internal/errors.d.ts +2 -0
  90. package/dist/vendor/internal/errors.js +38 -0
  91. package/dist/vendor/internal/errors.js.map +1 -0
  92. package/dist/vendor/internal/file-store.d.ts +135 -0
  93. package/dist/vendor/internal/file-store.js +529 -0
  94. package/dist/vendor/internal/file-store.js.map +1 -0
  95. package/dist/vendor/internal/headers.d.ts +28 -0
  96. package/dist/vendor/internal/headers.js +114 -0
  97. package/dist/vendor/internal/headers.js.map +1 -0
  98. package/dist/vendor/internal/message-stream-utils.d.ts +9 -0
  99. package/dist/vendor/internal/message-stream-utils.js +30 -0
  100. package/dist/vendor/internal/message-stream-utils.js.map +1 -0
  101. package/dist/vendor/internal/node.browser.d.ts +8 -0
  102. package/dist/vendor/internal/node.browser.js +19 -0
  103. package/dist/vendor/internal/node.browser.js.map +1 -0
  104. package/dist/vendor/internal/node.d.ts +13 -0
  105. package/dist/vendor/internal/node.js +14 -0
  106. package/dist/vendor/internal/node.js.map +1 -0
  107. package/dist/vendor/internal/parse.d.ts +17 -0
  108. package/dist/vendor/internal/parse.js +62 -0
  109. package/dist/vendor/internal/parse.js.map +1 -0
  110. package/dist/vendor/internal/qs/formats.d.ts +6 -0
  111. package/dist/vendor/internal/qs/formats.js +9 -0
  112. package/dist/vendor/internal/qs/formats.js.map +1 -0
  113. package/dist/vendor/internal/qs/index.d.ts +9 -0
  114. package/dist/vendor/internal/qs/index.js +10 -0
  115. package/dist/vendor/internal/qs/index.js.map +1 -0
  116. package/dist/vendor/internal/qs/stringify.d.ts +2 -0
  117. package/dist/vendor/internal/qs/stringify.js +274 -0
  118. package/dist/vendor/internal/qs/stringify.js.map +1 -0
  119. package/dist/vendor/internal/qs/types.d.ts +56 -0
  120. package/dist/vendor/internal/qs/types.js +2 -0
  121. package/dist/vendor/internal/qs/types.js.map +1 -0
  122. package/dist/vendor/internal/qs/utils.d.ts +14 -0
  123. package/dist/vendor/internal/qs/utils.js +217 -0
  124. package/dist/vendor/internal/qs/utils.js.map +1 -0
  125. package/dist/vendor/internal/request-options.d.ts +126 -0
  126. package/dist/vendor/internal/request-options.js +27 -0
  127. package/dist/vendor/internal/request-options.js.map +1 -0
  128. package/dist/vendor/internal/request-signal.d.ts +3 -0
  129. package/dist/vendor/internal/request-signal.js +45 -0
  130. package/dist/vendor/internal/request-signal.js.map +1 -0
  131. package/dist/vendor/internal/shim-types.d.ts +16 -0
  132. package/dist/vendor/internal/shim-types.js +3 -0
  133. package/dist/vendor/internal/shim-types.js.map +1 -0
  134. package/dist/vendor/internal/shims.d.ts +25 -0
  135. package/dist/vendor/internal/shims.js +85 -0
  136. package/dist/vendor/internal/shims.js.map +1 -0
  137. package/dist/vendor/internal/stainless-helper-header.d.ts +59 -0
  138. package/dist/vendor/internal/stainless-helper-header.js +83 -0
  139. package/dist/vendor/internal/stainless-helper-header.js.map +1 -0
  140. package/dist/vendor/internal/stream-utils.d.ts +7 -0
  141. package/dist/vendor/internal/stream-utils.js +35 -0
  142. package/dist/vendor/internal/stream-utils.js.map +1 -0
  143. package/dist/vendor/internal/to-file.d.ts +44 -0
  144. package/dist/vendor/internal/to-file.js +93 -0
  145. package/dist/vendor/internal/to-file.js.map +1 -0
  146. package/dist/vendor/internal/types.d.ts +62 -0
  147. package/dist/vendor/internal/types.js +3 -0
  148. package/dist/vendor/internal/types.js.map +1 -0
  149. package/dist/vendor/internal/uploads.d.ts +41 -0
  150. package/dist/vendor/internal/uploads.js +139 -0
  151. package/dist/vendor/internal/uploads.js.map +1 -0
  152. package/dist/vendor/internal/utils/abort.d.ts +11 -0
  153. package/dist/vendor/internal/utils/abort.js +22 -0
  154. package/dist/vendor/internal/utils/abort.js.map +1 -0
  155. package/dist/vendor/internal/utils/async-queue.d.ts +30 -0
  156. package/dist/vendor/internal/utils/async-queue.js +66 -0
  157. package/dist/vendor/internal/utils/async-queue.js.map +1 -0
  158. package/dist/vendor/internal/utils/backoff.d.ts +22 -0
  159. package/dist/vendor/internal/utils/backoff.js +36 -0
  160. package/dist/vendor/internal/utils/backoff.js.map +1 -0
  161. package/dist/vendor/internal/utils/base64.d.ts +2 -0
  162. package/dist/vendor/internal/utils/base64.js +33 -0
  163. package/dist/vendor/internal/utils/base64.js.map +1 -0
  164. package/dist/vendor/internal/utils/bytes.d.ts +3 -0
  165. package/dist/vendor/internal/utils/bytes.js +26 -0
  166. package/dist/vendor/internal/utils/bytes.js.map +1 -0
  167. package/dist/vendor/internal/utils/env.d.ts +8 -0
  168. package/dist/vendor/internal/utils/env.js +18 -0
  169. package/dist/vendor/internal/utils/env.js.map +1 -0
  170. package/dist/vendor/internal/utils/log.d.ts +46 -0
  171. package/dist/vendor/internal/utils/log.js +105 -0
  172. package/dist/vendor/internal/utils/log.js.map +1 -0
  173. package/dist/vendor/internal/utils/path.d.ts +14 -0
  174. package/dist/vendor/internal/utils/path.js +74 -0
  175. package/dist/vendor/internal/utils/path.js.map +1 -0
  176. package/dist/vendor/internal/utils/promise.d.ts +10 -0
  177. package/dist/vendor/internal/utils/promise.js +15 -0
  178. package/dist/vendor/internal/utils/promise.js.map +1 -0
  179. package/dist/vendor/internal/utils/query.d.ts +1 -0
  180. package/dist/vendor/internal/utils/query.js +6 -0
  181. package/dist/vendor/internal/utils/query.js.map +1 -0
  182. package/dist/vendor/internal/utils/sleep.d.ts +9 -0
  183. package/dist/vendor/internal/utils/sleep.js +24 -0
  184. package/dist/vendor/internal/utils/sleep.js.map +1 -0
  185. package/dist/vendor/internal/utils/time.d.ts +2 -0
  186. package/dist/vendor/internal/utils/time.js +5 -0
  187. package/dist/vendor/internal/utils/time.js.map +1 -0
  188. package/dist/vendor/internal/utils/uuid.d.ts +4 -0
  189. package/dist/vendor/internal/utils/uuid.js +15 -0
  190. package/dist/vendor/internal/utils/uuid.js.map +1 -0
  191. package/dist/vendor/internal/utils/values.d.ts +24 -0
  192. package/dist/vendor/internal/utils/values.js +106 -0
  193. package/dist/vendor/internal/utils/values.js.map +1 -0
  194. package/dist/vendor/internal/utils.d.ts +7 -0
  195. package/dist/vendor/internal/utils.js +9 -0
  196. package/dist/vendor/internal/utils.js.map +1 -0
  197. package/dist/vendor/lib/BetaMessageStream.d.ts +123 -0
  198. package/dist/vendor/lib/BetaMessageStream.js +662 -0
  199. package/dist/vendor/lib/BetaMessageStream.js.map +1 -0
  200. package/dist/vendor/lib/MessageStream.d.ts +122 -0
  201. package/dist/vendor/lib/MessageStream.js +609 -0
  202. package/dist/vendor/lib/MessageStream.js.map +1 -0
  203. package/dist/vendor/lib/beta-parser.d.ts +36 -0
  204. package/dist/vendor/lib/beta-parser.js +75 -0
  205. package/dist/vendor/lib/beta-parser.js.map +1 -0
  206. package/dist/vendor/lib/credentials/credential-chain.d.ts +38 -0
  207. package/dist/vendor/lib/credentials/credential-chain.js +208 -0
  208. package/dist/vendor/lib/credentials/credential-chain.js.map +1 -0
  209. package/dist/vendor/lib/credentials/identity-token.d.ts +10 -0
  210. package/dist/vendor/lib/credentials/identity-token.js +35 -0
  211. package/dist/vendor/lib/credentials/identity-token.js.map +1 -0
  212. package/dist/vendor/lib/credentials/oidc-federation.d.ts +39 -0
  213. package/dist/vendor/lib/credentials/oidc-federation.js +79 -0
  214. package/dist/vendor/lib/credentials/oidc-federation.js.map +1 -0
  215. package/dist/vendor/lib/credentials/token-cache.d.ts +53 -0
  216. package/dist/vendor/lib/credentials/token-cache.js +110 -0
  217. package/dist/vendor/lib/credentials/token-cache.js.map +1 -0
  218. package/dist/vendor/lib/credentials/types.d.ts +95 -0
  219. package/dist/vendor/lib/credentials/types.js +226 -0
  220. package/dist/vendor/lib/credentials/types.js.map +1 -0
  221. package/dist/vendor/lib/credentials/user-oauth.d.ts +20 -0
  222. package/dist/vendor/lib/credentials/user-oauth.js +94 -0
  223. package/dist/vendor/lib/credentials/user-oauth.js.map +1 -0
  224. package/dist/vendor/lib/credentials.d.ts +3 -0
  225. package/dist/vendor/lib/credentials.js +3 -0
  226. package/dist/vendor/lib/credentials.js.map +1 -0
  227. package/dist/vendor/lib/environments/index.d.ts +3 -0
  228. package/dist/vendor/lib/environments/index.js +4 -0
  229. package/dist/vendor/lib/environments/index.js.map +1 -0
  230. package/dist/vendor/lib/environments/poller.d.ts +94 -0
  231. package/dist/vendor/lib/environments/poller.js +218 -0
  232. package/dist/vendor/lib/environments/poller.js.map +1 -0
  233. package/dist/vendor/lib/environments/worker.d.ts +226 -0
  234. package/dist/vendor/lib/environments/worker.js +572 -0
  235. package/dist/vendor/lib/environments/worker.js.map +1 -0
  236. package/dist/vendor/lib/helper-client.d.ts +30 -0
  237. package/dist/vendor/lib/helper-client.js +55 -0
  238. package/dist/vendor/lib/helper-client.js.map +1 -0
  239. package/dist/vendor/lib/middleware.d.ts +97 -0
  240. package/dist/vendor/lib/middleware.js +775 -0
  241. package/dist/vendor/lib/middleware.js.map +1 -0
  242. package/dist/vendor/lib/parser.d.ts +31 -0
  243. package/dist/vendor/lib/parser.js +62 -0
  244. package/dist/vendor/lib/parser.js.map +1 -0
  245. package/dist/vendor/lib/sessions/accumulate.d.ts +22 -0
  246. package/dist/vendor/lib/sessions/accumulate.js +42 -0
  247. package/dist/vendor/lib/sessions/accumulate.js.map +1 -0
  248. package/dist/vendor/lib/standard-schema.d.ts +130 -0
  249. package/dist/vendor/lib/standard-schema.js +41 -0
  250. package/dist/vendor/lib/standard-schema.js.map +1 -0
  251. package/dist/vendor/lib/tools/BetaRunnableTool.d.ts +48 -0
  252. package/dist/vendor/lib/tools/BetaRunnableTool.js +26 -0
  253. package/dist/vendor/lib/tools/BetaRunnableTool.js.map +1 -0
  254. package/dist/vendor/lib/tools/BetaToolRunner.d.ts +160 -0
  255. package/dist/vendor/lib/tools/BetaToolRunner.js +497 -0
  256. package/dist/vendor/lib/tools/BetaToolRunner.js.map +1 -0
  257. package/dist/vendor/lib/tools/CompactionControl.d.ts +29 -0
  258. package/dist/vendor/lib/tools/CompactionControl.js +25 -0
  259. package/dist/vendor/lib/tools/CompactionControl.js.map +1 -0
  260. package/dist/vendor/lib/tools/SessionToolRunner.d.ts +178 -0
  261. package/dist/vendor/lib/tools/SessionToolRunner.js +737 -0
  262. package/dist/vendor/lib/tools/SessionToolRunner.js.map +1 -0
  263. package/dist/vendor/lib/tools/ToolError.d.ts +32 -0
  264. package/dist/vendor/lib/tools/ToolError.js +43 -0
  265. package/dist/vendor/lib/tools/ToolError.js.map +1 -0
  266. package/dist/vendor/lib/transform-json-schema.d.ts +2 -0
  267. package/dist/vendor/lib/transform-json-schema.js +111 -0
  268. package/dist/vendor/lib/transform-json-schema.js.map +1 -0
  269. package/dist/vendor/pagination.d.ts +2 -0
  270. package/dist/vendor/pagination.js +3 -0
  271. package/dist/vendor/pagination.js.map +1 -0
  272. package/dist/vendor/resource.d.ts +2 -0
  273. package/dist/vendor/resource.js +3 -0
  274. package/dist/vendor/resource.js.map +1 -0
  275. package/dist/vendor/resources/beta/agents/agents.d.ts +1128 -0
  276. package/dist/vendor/resources/beta/agents/agents.js +123 -0
  277. package/dist/vendor/resources/beta/agents/agents.js.map +1 -0
  278. package/dist/vendor/resources/beta/agents/index.d.ts +2 -0
  279. package/dist/vendor/resources/beta/agents/index.js +4 -0
  280. package/dist/vendor/resources/beta/agents/index.js.map +1 -0
  281. package/dist/vendor/resources/beta/agents/versions.d.ts +32 -0
  282. package/dist/vendor/resources/beta/agents/versions.js +32 -0
  283. package/dist/vendor/resources/beta/agents/versions.js.map +1 -0
  284. package/dist/vendor/resources/beta/agents.d.ts +1 -0
  285. package/dist/vendor/resources/beta/agents.js +3 -0
  286. package/dist/vendor/resources/beta/agents.js.map +1 -0
  287. package/dist/vendor/resources/beta/beta.d.ts +131 -0
  288. package/dist/vendor/resources/beta/beta.js +69 -0
  289. package/dist/vendor/resources/beta/beta.js.map +1 -0
  290. package/dist/vendor/resources/beta/deployment-runs.d.ts +305 -0
  291. package/dist/vendor/resources/beta/deployment-runs.js +51 -0
  292. package/dist/vendor/resources/beta/deployment-runs.js.map +1 -0
  293. package/dist/vendor/resources/beta/deployments.d.ts +698 -0
  294. package/dist/vendor/resources/beta/deployments.js +192 -0
  295. package/dist/vendor/resources/beta/deployments.js.map +1 -0
  296. package/dist/vendor/resources/beta/dreams.d.ts +335 -0
  297. package/dist/vendor/resources/beta/dreams.js +112 -0
  298. package/dist/vendor/resources/beta/dreams.js.map +1 -0
  299. package/dist/vendor/resources/beta/environments/environments.d.ts +432 -0
  300. package/dist/vendor/resources/beta/environments/environments.js +142 -0
  301. package/dist/vendor/resources/beta/environments/environments.js.map +1 -0
  302. package/dist/vendor/resources/beta/environments/index.d.ts +2 -0
  303. package/dist/vendor/resources/beta/environments/index.js +4 -0
  304. package/dist/vendor/resources/beta/environments/index.js.map +1 -0
  305. package/dist/vendor/resources/beta/environments/work.d.ts +500 -0
  306. package/dist/vendor/resources/beta/environments/work.js +251 -0
  307. package/dist/vendor/resources/beta/environments/work.js.map +1 -0
  308. package/dist/vendor/resources/beta/environments.d.ts +1 -0
  309. package/dist/vendor/resources/beta/environments.js +3 -0
  310. package/dist/vendor/resources/beta/environments.js.map +1 -0
  311. package/dist/vendor/resources/beta/files.d.ts +190 -0
  312. package/dist/vendor/resources/beta/files.js +120 -0
  313. package/dist/vendor/resources/beta/files.js.map +1 -0
  314. package/dist/vendor/resources/beta/index.d.ts +17 -0
  315. package/dist/vendor/resources/beta/index.js +19 -0
  316. package/dist/vendor/resources/beta/index.js.map +1 -0
  317. package/dist/vendor/resources/beta/memory-stores/index.d.ts +3 -0
  318. package/dist/vendor/resources/beta/memory-stores/index.js +5 -0
  319. package/dist/vendor/resources/beta/memory-stores/index.js.map +1 -0
  320. package/dist/vendor/resources/beta/memory-stores/memories.d.ts +346 -0
  321. package/dist/vendor/resources/beta/memory-stores/memories.js +126 -0
  322. package/dist/vendor/resources/beta/memory-stores/memories.js.map +1 -0
  323. package/dist/vendor/resources/beta/memory-stores/memory-stores.d.ts +230 -0
  324. package/dist/vendor/resources/beta/memory-stores/memory-stores.js +137 -0
  325. package/dist/vendor/resources/beta/memory-stores/memory-stores.js.map +1 -0
  326. package/dist/vendor/resources/beta/memory-stores/memory-versions.d.ts +252 -0
  327. package/dist/vendor/resources/beta/memory-stores/memory-versions.js +77 -0
  328. package/dist/vendor/resources/beta/memory-stores/memory-versions.js.map +1 -0
  329. package/dist/vendor/resources/beta/memory-stores.d.ts +1 -0
  330. package/dist/vendor/resources/beta/memory-stores.js +3 -0
  331. package/dist/vendor/resources/beta/memory-stores.js.map +1 -0
  332. package/dist/vendor/resources/beta/messages/batches.d.ts +685 -0
  333. package/dist/vendor/resources/beta/messages/batches.js +203 -0
  334. package/dist/vendor/resources/beta/messages/batches.js.map +1 -0
  335. package/dist/vendor/resources/beta/messages/index.d.ts +3 -0
  336. package/dist/vendor/resources/beta/messages/index.js +5 -0
  337. package/dist/vendor/resources/beta/messages/index.js.map +1 -0
  338. package/dist/vendor/resources/beta/messages/messages.d.ts +5376 -0
  339. package/dist/vendor/resources/beta/messages/messages.js +158 -0
  340. package/dist/vendor/resources/beta/messages/messages.js.map +1 -0
  341. package/dist/vendor/resources/beta/messages.d.ts +1 -0
  342. package/dist/vendor/resources/beta/messages.js +3 -0
  343. package/dist/vendor/resources/beta/messages.js.map +1 -0
  344. package/dist/vendor/resources/beta/models.d.ts +217 -0
  345. package/dist/vendor/resources/beta/models.js +56 -0
  346. package/dist/vendor/resources/beta/models.js.map +1 -0
  347. package/dist/vendor/resources/beta/organization/api-keys.d.ts +176 -0
  348. package/dist/vendor/resources/beta/organization/api-keys.js +52 -0
  349. package/dist/vendor/resources/beta/organization/api-keys.js.map +1 -0
  350. package/dist/vendor/resources/beta/organization/compliance-settings.d.ts +73 -0
  351. package/dist/vendor/resources/beta/organization/compliance-settings.js +48 -0
  352. package/dist/vendor/resources/beta/organization/compliance-settings.js.map +1 -0
  353. package/dist/vendor/resources/beta/organization/external-keys.d.ts +271 -0
  354. package/dist/vendor/resources/beta/organization/external-keys.js +115 -0
  355. package/dist/vendor/resources/beta/organization/external-keys.js.map +1 -0
  356. package/dist/vendor/resources/beta/organization/federation/federation.d.ts +13 -0
  357. package/dist/vendor/resources/beta/organization/federation/federation.js +13 -0
  358. package/dist/vendor/resources/beta/organization/federation/federation.js.map +1 -0
  359. package/dist/vendor/resources/beta/organization/federation/index.d.ts +3 -0
  360. package/dist/vendor/resources/beta/organization/federation/index.js +5 -0
  361. package/dist/vendor/resources/beta/organization/federation/index.js.map +1 -0
  362. package/dist/vendor/resources/beta/organization/federation/issuers.d.ts +352 -0
  363. package/dist/vendor/resources/beta/organization/federation/issuers.js +165 -0
  364. package/dist/vendor/resources/beta/organization/federation/issuers.js.map +1 -0
  365. package/dist/vendor/resources/beta/organization/federation/rules/index.d.ts +2 -0
  366. package/dist/vendor/resources/beta/organization/federation/rules/index.js +4 -0
  367. package/dist/vendor/resources/beta/organization/federation/rules/index.js.map +1 -0
  368. package/dist/vendor/resources/beta/organization/federation/rules/rules.d.ts +467 -0
  369. package/dist/vendor/resources/beta/organization/federation/rules/rules.js +190 -0
  370. package/dist/vendor/resources/beta/organization/federation/rules/rules.js.map +1 -0
  371. package/dist/vendor/resources/beta/organization/federation/rules/workspaces.d.ts +123 -0
  372. package/dist/vendor/resources/beta/organization/federation/rules/workspaces.js +110 -0
  373. package/dist/vendor/resources/beta/organization/federation/rules/workspaces.js.map +1 -0
  374. package/dist/vendor/resources/beta/organization/federation/rules.d.ts +1 -0
  375. package/dist/vendor/resources/beta/organization/federation/rules.js +3 -0
  376. package/dist/vendor/resources/beta/organization/federation/rules.js.map +1 -0
  377. package/dist/vendor/resources/beta/organization/federation.d.ts +1 -0
  378. package/dist/vendor/resources/beta/organization/federation.js +3 -0
  379. package/dist/vendor/resources/beta/organization/federation.js.map +1 -0
  380. package/dist/vendor/resources/beta/organization/index.d.ts +10 -0
  381. package/dist/vendor/resources/beta/organization/index.js +12 -0
  382. package/dist/vendor/resources/beta/organization/index.js.map +1 -0
  383. package/dist/vendor/resources/beta/organization/invites.d.ts +161 -0
  384. package/dist/vendor/resources/beta/organization/invites.js +72 -0
  385. package/dist/vendor/resources/beta/organization/invites.js.map +1 -0
  386. package/dist/vendor/resources/beta/organization/organization.d.ts +72 -0
  387. package/dist/vendor/resources/beta/organization/organization.js +54 -0
  388. package/dist/vendor/resources/beta/organization/organization.js.map +1 -0
  389. package/dist/vendor/resources/beta/organization/rate-limits.d.ts +76 -0
  390. package/dist/vendor/resources/beta/organization/rate-limits.js +27 -0
  391. package/dist/vendor/resources/beta/organization/rate-limits.js.map +1 -0
  392. package/dist/vendor/resources/beta/organization/service-accounts/index.d.ts +2 -0
  393. package/dist/vendor/resources/beta/organization/service-accounts/index.js +4 -0
  394. package/dist/vendor/resources/beta/organization/service-accounts/index.js.map +1 -0
  395. package/dist/vendor/resources/beta/organization/service-accounts/service-accounts.d.ts +257 -0
  396. package/dist/vendor/resources/beta/organization/service-accounts/service-accounts.js +166 -0
  397. package/dist/vendor/resources/beta/organization/service-accounts/service-accounts.js.map +1 -0
  398. package/dist/vendor/resources/beta/organization/service-accounts/workspaces.d.ts +140 -0
  399. package/dist/vendor/resources/beta/organization/service-accounts/workspaces.js +121 -0
  400. package/dist/vendor/resources/beta/organization/service-accounts/workspaces.js.map +1 -0
  401. package/dist/vendor/resources/beta/organization/service-accounts.d.ts +1 -0
  402. package/dist/vendor/resources/beta/organization/service-accounts.js +3 -0
  403. package/dist/vendor/resources/beta/organization/service-accounts.js.map +1 -0
  404. package/dist/vendor/resources/beta/organization/users.d.ts +123 -0
  405. package/dist/vendor/resources/beta/organization/users.js +63 -0
  406. package/dist/vendor/resources/beta/organization/users.js.map +1 -0
  407. package/dist/vendor/resources/beta/organization/workspaces/index.d.ts +4 -0
  408. package/dist/vendor/resources/beta/organization/workspaces/index.js +6 -0
  409. package/dist/vendor/resources/beta/organization/workspaces/index.js.map +1 -0
  410. package/dist/vendor/resources/beta/organization/workspaces/members.d.ts +134 -0
  411. package/dist/vendor/resources/beta/organization/workspaces/members.js +98 -0
  412. package/dist/vendor/resources/beta/organization/workspaces/members.js.map +1 -0
  413. package/dist/vendor/resources/beta/organization/workspaces/rate-limits.d.ts +82 -0
  414. package/dist/vendor/resources/beta/organization/workspaces/rate-limits.js +30 -0
  415. package/dist/vendor/resources/beta/organization/workspaces/rate-limits.js.map +1 -0
  416. package/dist/vendor/resources/beta/organization/workspaces/service-accounts.d.ts +209 -0
  417. package/dist/vendor/resources/beta/organization/workspaces/service-accounts.js +185 -0
  418. package/dist/vendor/resources/beta/organization/workspaces/service-accounts.js.map +1 -0
  419. package/dist/vendor/resources/beta/organization/workspaces/workspaces.d.ts +302 -0
  420. package/dist/vendor/resources/beta/organization/workspaces/workspaces.js +104 -0
  421. package/dist/vendor/resources/beta/organization/workspaces/workspaces.js.map +1 -0
  422. package/dist/vendor/resources/beta/organization/workspaces.d.ts +1 -0
  423. package/dist/vendor/resources/beta/organization/workspaces.js +3 -0
  424. package/dist/vendor/resources/beta/organization/workspaces.js.map +1 -0
  425. package/dist/vendor/resources/beta/organization.d.ts +1 -0
  426. package/dist/vendor/resources/beta/organization.js +3 -0
  427. package/dist/vendor/resources/beta/organization.js.map +1 -0
  428. package/dist/vendor/resources/beta/sessions/events.d.ts +1513 -0
  429. package/dist/vendor/resources/beta/sessions/events.js +115 -0
  430. package/dist/vendor/resources/beta/sessions/events.js.map +1 -0
  431. package/dist/vendor/resources/beta/sessions/index.d.ts +4 -0
  432. package/dist/vendor/resources/beta/sessions/index.js +6 -0
  433. package/dist/vendor/resources/beta/sessions/index.js.map +1 -0
  434. package/dist/vendor/resources/beta/sessions/resources.d.ts +227 -0
  435. package/dist/vendor/resources/beta/sessions/resources.js +128 -0
  436. package/dist/vendor/resources/beta/sessions/resources.js.map +1 -0
  437. package/dist/vendor/resources/beta/sessions/sessions.d.ts +866 -0
  438. package/dist/vendor/resources/beta/sessions/sessions.js +150 -0
  439. package/dist/vendor/resources/beta/sessions/sessions.js.map +1 -0
  440. package/dist/vendor/resources/beta/sessions/threads/events.d.ts +77 -0
  441. package/dist/vendor/resources/beta/sessions/threads/events.js +57 -0
  442. package/dist/vendor/resources/beta/sessions/threads/events.js.map +1 -0
  443. package/dist/vendor/resources/beta/sessions/threads/index.d.ts +2 -0
  444. package/dist/vendor/resources/beta/sessions/threads/index.js +4 -0
  445. package/dist/vendor/resources/beta/sessions/threads/index.js.map +1 -0
  446. package/dist/vendor/resources/beta/sessions/threads/threads.d.ts +195 -0
  447. package/dist/vendor/resources/beta/sessions/threads/threads.js +80 -0
  448. package/dist/vendor/resources/beta/sessions/threads/threads.js.map +1 -0
  449. package/dist/vendor/resources/beta/sessions/threads.d.ts +1 -0
  450. package/dist/vendor/resources/beta/sessions/threads.js +3 -0
  451. package/dist/vendor/resources/beta/sessions/threads.js.map +1 -0
  452. package/dist/vendor/resources/beta/sessions.d.ts +1 -0
  453. package/dist/vendor/resources/beta/sessions.js +3 -0
  454. package/dist/vendor/resources/beta/sessions.js.map +1 -0
  455. package/dist/vendor/resources/beta/skills/index.d.ts +2 -0
  456. package/dist/vendor/resources/beta/skills/index.js +4 -0
  457. package/dist/vendor/resources/beta/skills/index.js.map +1 -0
  458. package/dist/vendor/resources/beta/skills/skills.d.ts +178 -0
  459. package/dist/vendor/resources/beta/skills/skills.js +96 -0
  460. package/dist/vendor/resources/beta/skills/skills.js.map +1 -0
  461. package/dist/vendor/resources/beta/skills/versions.d.ts +181 -0
  462. package/dist/vendor/resources/beta/skills/versions.js +125 -0
  463. package/dist/vendor/resources/beta/skills/versions.js.map +1 -0
  464. package/dist/vendor/resources/beta/skills.d.ts +1 -0
  465. package/dist/vendor/resources/beta/skills.js +3 -0
  466. package/dist/vendor/resources/beta/skills.js.map +1 -0
  467. package/dist/vendor/resources/beta/tunnels/certificates.d.ts +162 -0
  468. package/dist/vendor/resources/beta/tunnels/certificates.js +125 -0
  469. package/dist/vendor/resources/beta/tunnels/certificates.js.map +1 -0
  470. package/dist/vendor/resources/beta/tunnels/index.d.ts +2 -0
  471. package/dist/vendor/resources/beta/tunnels/index.js +4 -0
  472. package/dist/vendor/resources/beta/tunnels/index.js.map +1 -0
  473. package/dist/vendor/resources/beta/tunnels/tunnels.d.ts +211 -0
  474. package/dist/vendor/resources/beta/tunnels/tunnels.js +173 -0
  475. package/dist/vendor/resources/beta/tunnels/tunnels.js.map +1 -0
  476. package/dist/vendor/resources/beta/tunnels.d.ts +1 -0
  477. package/dist/vendor/resources/beta/tunnels.js +3 -0
  478. package/dist/vendor/resources/beta/tunnels.js.map +1 -0
  479. package/dist/vendor/resources/beta/user-profiles.d.ts +244 -0
  480. package/dist/vendor/resources/beta/user-profiles.js +114 -0
  481. package/dist/vendor/resources/beta/user-profiles.js.map +1 -0
  482. package/dist/vendor/resources/beta/vaults/credentials.d.ts +715 -0
  483. package/dist/vendor/resources/beta/vaults/credentials.js +173 -0
  484. package/dist/vendor/resources/beta/vaults/credentials.js.map +1 -0
  485. package/dist/vendor/resources/beta/vaults/index.d.ts +2 -0
  486. package/dist/vendor/resources/beta/vaults/index.js +4 -0
  487. package/dist/vendor/resources/beta/vaults/index.js.map +1 -0
  488. package/dist/vendor/resources/beta/vaults/vaults.d.ts +191 -0
  489. package/dist/vendor/resources/beta/vaults/vaults.js +141 -0
  490. package/dist/vendor/resources/beta/vaults/vaults.js.map +1 -0
  491. package/dist/vendor/resources/beta/vaults.d.ts +1 -0
  492. package/dist/vendor/resources/beta/vaults.js +3 -0
  493. package/dist/vendor/resources/beta/vaults.js.map +1 -0
  494. package/dist/vendor/resources/beta/webhooks.d.ts +464 -0
  495. package/dist/vendor/resources/beta/webhooks.js +29 -0
  496. package/dist/vendor/resources/beta/webhooks.js.map +1 -0
  497. package/dist/vendor/resources/beta.d.ts +1 -0
  498. package/dist/vendor/resources/beta.js +3 -0
  499. package/dist/vendor/resources/beta.js.map +1 -0
  500. package/dist/vendor/resources/completions.d.ts +172 -0
  501. package/dist/vendor/resources/completions.js +19 -0
  502. package/dist/vendor/resources/completions.js.map +1 -0
  503. package/dist/vendor/resources/files.d.ts +104 -0
  504. package/dist/vendor/resources/files.js +48 -0
  505. package/dist/vendor/resources/files.js.map +1 -0
  506. package/dist/vendor/resources/index.d.ts +7 -0
  507. package/dist/vendor/resources/index.js +9 -0
  508. package/dist/vendor/resources/index.js.map +1 -0
  509. package/dist/vendor/resources/messages/batches.d.ts +312 -0
  510. package/dist/vendor/resources/messages/batches.js +157 -0
  511. package/dist/vendor/resources/messages/batches.js.map +1 -0
  512. package/dist/vendor/resources/messages/index.d.ts +2 -0
  513. package/dist/vendor/resources/messages/index.js +4 -0
  514. package/dist/vendor/resources/messages/index.js.map +1 -0
  515. package/dist/vendor/resources/messages/messages.d.ts +3886 -0
  516. package/dist/vendor/resources/messages/messages.js +130 -0
  517. package/dist/vendor/resources/messages/messages.js.map +1 -0
  518. package/dist/vendor/resources/messages.d.ts +1 -0
  519. package/dist/vendor/resources/messages.js +3 -0
  520. package/dist/vendor/resources/messages.js.map +1 -0
  521. package/dist/vendor/resources/models.d.ts +196 -0
  522. package/dist/vendor/resources/models.js +41 -0
  523. package/dist/vendor/resources/models.js.map +1 -0
  524. package/dist/vendor/resources/shared.d.ts +43 -0
  525. package/dist/vendor/resources/shared.js +3 -0
  526. package/dist/vendor/resources/shared.js.map +1 -0
  527. package/dist/vendor/resources/skills/index.d.ts +2 -0
  528. package/dist/vendor/resources/skills/index.js +4 -0
  529. package/dist/vendor/resources/skills/index.js.map +1 -0
  530. package/dist/vendor/resources/skills/skills.d.ts +128 -0
  531. package/dist/vendor/resources/skills/skills.js +36 -0
  532. package/dist/vendor/resources/skills/skills.js.map +1 -0
  533. package/dist/vendor/resources/skills/versions.d.ts +103 -0
  534. package/dist/vendor/resources/skills/versions.js +37 -0
  535. package/dist/vendor/resources/skills/versions.js.map +1 -0
  536. package/dist/vendor/resources/skills.d.ts +1 -0
  537. package/dist/vendor/resources/skills.js +3 -0
  538. package/dist/vendor/resources/skills.js.map +1 -0
  539. package/dist/vendor/resources/top-level.d.ts +1 -0
  540. package/dist/vendor/resources/top-level.js +3 -0
  541. package/dist/vendor/resources/top-level.js.map +1 -0
  542. package/dist/vendor/resources.d.ts +1 -0
  543. package/dist/vendor/resources.js +2 -0
  544. package/dist/vendor/resources.js.map +1 -0
  545. package/dist/vendor/streaming.d.ts +2 -0
  546. package/dist/vendor/streaming.js +3 -0
  547. package/dist/vendor/streaming.js.map +1 -0
  548. package/dist/vendor/tools/agent-toolset/fs-util.d.ts +74 -0
  549. package/dist/vendor/tools/agent-toolset/fs-util.js +184 -0
  550. package/dist/vendor/tools/agent-toolset/fs-util.js.map +1 -0
  551. package/dist/vendor/tools/agent-toolset/memories.d.ts +172 -0
  552. package/dist/vendor/tools/agent-toolset/memories.js +910 -0
  553. package/dist/vendor/tools/agent-toolset/memories.js.map +1 -0
  554. package/dist/vendor/tools/agent-toolset/node.browser.d.ts +80 -0
  555. package/dist/vendor/tools/agent-toolset/node.browser.js +129 -0
  556. package/dist/vendor/tools/agent-toolset/node.browser.js.map +1 -0
  557. package/dist/vendor/tools/agent-toolset/node.d.ts +191 -0
  558. package/dist/vendor/tools/agent-toolset/node.js +886 -0
  559. package/dist/vendor/tools/agent-toolset/node.js.map +1 -0
  560. package/dist/vendor/tools/agent-toolset/skills.d.ts +73 -0
  561. package/dist/vendor/tools/agent-toolset/skills.js +320 -0
  562. package/dist/vendor/tools/agent-toolset/skills.js.map +1 -0
  563. package/dist/vendor/tools/agent-toolset/sync-interval.d.ts +18 -0
  564. package/dist/vendor/tools/agent-toolset/sync-interval.js +25 -0
  565. package/dist/vendor/tools/agent-toolset/sync-interval.js.map +1 -0
  566. package/dist/vendor/tools/memory/node.browser.d.ts +26 -0
  567. package/dist/vendor/tools/memory/node.browser.js +44 -0
  568. package/dist/vendor/tools/memory/node.browser.js.map +1 -0
  569. package/dist/vendor/tools/memory/node.d.ts +17 -0
  570. package/dist/vendor/tools/memory/node.js +327 -0
  571. package/dist/vendor/tools/memory/node.js.map +1 -0
  572. package/dist/vendor/uploads.d.ts +2 -0
  573. package/dist/vendor/uploads.js +3 -0
  574. package/dist/vendor/uploads.js.map +1 -0
  575. package/dist/vendor/version.d.ts +1 -0
  576. package/dist/vendor/version.js +2 -0
  577. package/dist/vendor/version.js.map +1 -0
  578. package/package.json +7 -14
  579. package/sdk.cjs +6 -6
  580. package/sdk.cjs.map +18 -18
  581. package/sdk.d.ts +10 -10
  582. package/sdk.mjs +21 -21
  583. package/sdk.mjs.map +18 -18
@@ -0,0 +1 @@
1
+ {"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../../src/vendor/lib/middleware.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAwB,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAsBpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,C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E,cAAc,IAAI,IAAI;KAC1C,CAAC;AACJ,CAAC;AAED,+DAA+D;AAC/D,SAAS,QAAQ,CACf,OAAiD,EACjD,QAAsC;IAEtC,MAAM,GAAG,GAAQ,EAAE,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,CAAC;IAC7D,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACjC,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,IAAI,IAAK,QAAgB,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI;YAAE,GAAG,CAAC,CAAC,CAAC,GAAI,QAAgB,CAAC,CAAC,CAAC,CAAC;IACtF,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;GAKG;AACH,SAAS,YAAY,CAAC,GAAoB;IACxC,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,IAAI,GAAG,CAAC,KAAK,KAAK,IAAI;QAAE,GAAG,IAAI,UAAU,GAAG,CAAC,KAAK,IAAI,CAAC;IACvD,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;QAAE,GAAG,IAAI,SAAS,IAAI,IAAI,CAAC;IAClE,OAAO,GAAG,GAAG,IAAI,CAAC;AACpB,CAAC;AAED,SAAS,SAAS,CAAC,UAA2B,EAAE,MAAmB;IACjE,OAAO,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,31 @@
1
+ import type { Logger } from '../client';
2
+ import { ContentBlock, JSONOutputFormat, Message, OutputConfig, TextBlock, MessageCreateParams } from '../resources/messages/messages';
3
+ type Simplify<T> = {
4
+ [KeyType in keyof T]: T[KeyType];
5
+ } & {};
6
+ type AutoParseableOutputConfig = Omit<OutputConfig, 'format'> & {
7
+ format?: JSONOutputFormat | AutoParseableOutputFormat<any> | null;
8
+ };
9
+ export type ParseableMessageCreateParams = Simplify<Omit<MessageCreateParams, 'output_config'> & {
10
+ output_config?: AutoParseableOutputConfig | null;
11
+ }>;
12
+ export type ExtractParsedContentFromParams<Params extends ParseableMessageCreateParams> = Params['output_config'] extends {
13
+ format: AutoParseableOutputFormat<infer P>;
14
+ } ? P : null;
15
+ export type AutoParseableOutputFormat<ParsedT> = JSONOutputFormat & {
16
+ parse(content: string): ParsedT;
17
+ };
18
+ export type ParsedMessage<ParsedT> = Message & {
19
+ content: Array<ParsedContentBlock<ParsedT>>;
20
+ parsed_output: ParsedT | null;
21
+ };
22
+ export type ParsedContentBlock<ParsedT> = (TextBlock & {
23
+ parsed_output: ParsedT | null;
24
+ }) | Exclude<ContentBlock, TextBlock>;
25
+ export declare function maybeParseMessage<Params extends ParseableMessageCreateParams | null>(message: Message, params: Params, opts: {
26
+ logger: Logger;
27
+ }): ParsedMessage<ExtractParsedContentFromParams<NonNullable<Params>>>;
28
+ export declare function parseMessage<Params extends ParseableMessageCreateParams>(message: Message, params: Params, opts: {
29
+ logger: Logger;
30
+ }): ParsedMessage<ExtractParsedContentFromParams<Params>>;
31
+ export {};
@@ -0,0 +1,62 @@
1
+ import { PukuError } from '../core/error.js';
2
+ function getOutputFormat(params) {
3
+ return params?.output_config?.format;
4
+ }
5
+ export function maybeParseMessage(message, params, opts) {
6
+ const outputFormat = getOutputFormat(params);
7
+ if (!params || !('parse' in (outputFormat ?? {}))) {
8
+ return {
9
+ ...message,
10
+ content: message.content.map((block) => {
11
+ if (block.type === 'text') {
12
+ const parsedBlock = Object.defineProperty({ ...block }, 'parsed_output', {
13
+ value: null,
14
+ enumerable: false,
15
+ });
16
+ return parsedBlock;
17
+ }
18
+ return block;
19
+ }),
20
+ parsed_output: null,
21
+ };
22
+ }
23
+ return parseMessage(message, params, opts);
24
+ }
25
+ export function parseMessage(message, params, opts) {
26
+ let firstParsedOutput = null;
27
+ const content = message.content.map((block) => {
28
+ if (block.type === 'text') {
29
+ const parsedOutput = parseOutputFormat(params, block.text);
30
+ if (firstParsedOutput === null) {
31
+ firstParsedOutput = parsedOutput;
32
+ }
33
+ const parsedBlock = Object.defineProperty({ ...block }, 'parsed_output', {
34
+ value: parsedOutput,
35
+ enumerable: false,
36
+ });
37
+ return parsedBlock;
38
+ }
39
+ return block;
40
+ });
41
+ return {
42
+ ...message,
43
+ content,
44
+ parsed_output: firstParsedOutput,
45
+ };
46
+ }
47
+ function parseOutputFormat(params, content) {
48
+ const outputFormat = getOutputFormat(params);
49
+ if (outputFormat?.type !== 'json_schema') {
50
+ return null;
51
+ }
52
+ try {
53
+ if ('parse' in outputFormat) {
54
+ return outputFormat.parse(content);
55
+ }
56
+ return JSON.parse(content);
57
+ }
58
+ catch (error) {
59
+ throw new PukuError(`Failed to parse structured output: ${error}`);
60
+ }
61
+ }
62
+ //# sourceMappingURL=parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../src/vendor/lib/parser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAuC1C,SAAS,eAAe,CACtB,MAA2C;IAE3C,OAAO,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,OAAgB,EAChB,MAAc,EACd,IAAwB;IAExB,MAAM,YAAY,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IAC7C,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;QAClD,OAAO;YACL,GAAG,OAAO;YACV,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;gBACrC,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;oBAC1B,MAAM,WAAW,GAAG,MAAM,CAAC,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OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,IAAI,OAAO,IAAI,YAAY,EAAE,CAAC;YAC5B,OAAO,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,SAAS,CAAC,sCAAsC,KAAK,EAAE,CAAC,CAAC;IACrE,CAAC;AACH,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { BetaManagedAgentsAgentMessageEvent, BetaManagedAgentsStreamSessionEvents } from '../../resources/beta/sessions/events';
2
+ export type AccumulatedEvent = BetaManagedAgentsAgentMessageEvent;
3
+ /**
4
+ * Fold one preview event into an `agent.message` snapshot. Returns a fresh
5
+ * snapshot — the `msg` argument is never mutated.
6
+ *
7
+ * - `event_start` opens the preview: a new snapshot with empty content is
8
+ * returned (so `msg` may be `undefined`). Returns `undefined` when the
9
+ * previewed event is not an `agent.message` — this helper only tracks
10
+ * `agent.message` previews.
11
+ * - `event_delta` is folded into `msg`: a new `delta.index` inserts the
12
+ * fragment as a fresh content entry; an existing index returns a copy with
13
+ * that entry appended to. An unrecognised fragment type on an existing
14
+ * index passes the entry through unchanged — deltas are best-effort and the
15
+ * buffered final event is canonical.
16
+ * - `agent.message` is the buffered final event: a copy of it is returned,
17
+ * replacing whatever the preview had accumulated.
18
+ * - Every other event type returns `accumulated` unchanged, so new event types
19
+ * added to the stream union need no change here.
20
+ */
21
+ export declare function accumulateManagedAgentsEvent<T extends AccumulatedEvent>(accumulated: AccumulatedEvent | undefined, event: T): T;
22
+ export declare function accumulateManagedAgentsEvent(accumulated: AccumulatedEvent | undefined, event: BetaManagedAgentsStreamSessionEvents): AccumulatedEvent | undefined;
@@ -0,0 +1,42 @@
1
+ import { PukuError } from '../../core/error.js';
2
+ export function accumulateManagedAgentsEvent(accumulated, event) {
3
+ switch (event.type) {
4
+ case 'event_start': {
5
+ if (event.event.type === 'agent.message') {
6
+ return { id: event.event.id, type: 'agent.message', content: [], processed_at: '' };
7
+ }
8
+ return accumulated;
9
+ }
10
+ case 'agent.message': {
11
+ return { ...event, content: event.content.map((block) => ({ ...block })) };
12
+ }
13
+ case 'event_delta': {
14
+ if (accumulated === undefined) {
15
+ throw new PukuError(`event_delta for ${event.event_id} received before its event_start`);
16
+ }
17
+ const idx = event.delta.index ?? 0;
18
+ const fragment = event.delta.content;
19
+ // Indices arrive in order — the first delta at a new index opens the slot.
20
+ // A gap means deltas arrived out of order or were mis-routed.
21
+ if (idx > accumulated.content.length) {
22
+ throw new PukuError(`event_delta index ${idx} is beyond the end of content (length ${accumulated.content.length})`);
23
+ }
24
+ const existing = accumulated.content[idx];
25
+ if (existing === undefined) {
26
+ // New index: pass the fragment through as a fresh block.
27
+ return { ...accumulated, content: [...accumulated.content, { ...fragment }] };
28
+ }
29
+ let updated = existing;
30
+ if (fragment.type === 'text' && existing.type === 'text') {
31
+ updated = { ...existing, text: existing.text + fragment.text };
32
+ }
33
+ const content = accumulated.content.slice();
34
+ content[idx] = updated;
35
+ return { ...accumulated, content };
36
+ }
37
+ default:
38
+ // Any other event, including types newer than this SDK, leaves the snapshot unchanged.
39
+ return accumulated;
40
+ }
41
+ }
42
+ //# sourceMappingURL=accumulate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accumulate.js","sourceRoot":"","sources":["../../../../src/vendor/lib/sessions/accumulate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAkC7C,MAAM,UAAU,4BAA4B,CAC1C,WAAyC,EACzC,KAA2C;IAE3C,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,aAAa,CAAC,CAAC,CAAC;YACnB,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;gBACzC,OAAO,EAAE,EAAE,EAAE,KA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,MAAM,IAAI,QAAQ,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;gBACzD,OAAO,GAAG,EAAE,GAAG,QAAQ,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;YACjE,CAAC;YAED,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;YAC5C,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;YACvB,OAAO,EAAE,GAAG,WAAW,EAAE,OAAO,EAAE,CAAC;QACrC,CAAC;QAED;YACE,uFAAuF;YACvF,OAAO,WAAW,CAAC;IACvB,CAAC;AACH,CAAC"}
@@ -0,0 +1,130 @@
1
+ /** The Standard Typed interface. This is a base type extended by other specs. */
2
+ export interface StandardTypedV1<Input = unknown, Output = Input> {
3
+ /** The Standard properties. */
4
+ readonly '~standard': StandardTypedV1.Props<Input, Output>;
5
+ }
6
+ export declare namespace StandardTypedV1 {
7
+ /** The Standard Typed properties interface. */
8
+ interface Props<Input = unknown, Output = Input> {
9
+ /** The version number of the standard. */
10
+ readonly version: 1;
11
+ /** The vendor name of the schema library. */
12
+ readonly vendor: string;
13
+ /** Inferred types associated with the schema. */
14
+ readonly types?: Types<Input, Output> | undefined;
15
+ }
16
+ /** The Standard Typed types interface. */
17
+ interface Types<Input = unknown, Output = Input> {
18
+ /** The input type of the schema. */
19
+ readonly input: Input;
20
+ /** The output type of the schema. */
21
+ readonly output: Output;
22
+ }
23
+ /** Infers the input type of a Standard Typed. */
24
+ type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema['~standard']['types']>['input'];
25
+ /** Infers the output type of a Standard Typed. */
26
+ type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema['~standard']['types']>['output'];
27
+ }
28
+ /** The Standard Schema interface. */
29
+ export interface StandardSchemaV1<Input = unknown, Output = Input> {
30
+ /** The Standard Schema properties. */
31
+ readonly '~standard': StandardSchemaV1.Props<Input, Output>;
32
+ }
33
+ export declare namespace StandardSchemaV1 {
34
+ /** The Standard Schema properties interface. */
35
+ interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
36
+ /** Validates unknown input values. */
37
+ readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
38
+ }
39
+ /** The result interface of the validate function. */
40
+ type Result<Output> = SuccessResult<Output> | FailureResult;
41
+ /** The result interface if validation succeeds. */
42
+ interface SuccessResult<Output> {
43
+ /** The typed output value. */
44
+ readonly value: Output;
45
+ /** A falsy value for `issues` indicates success. */
46
+ readonly issues?: undefined;
47
+ }
48
+ interface Options {
49
+ /** Explicit support for additional vendor-specific parameters, if needed. */
50
+ readonly libraryOptions?: Record<string, unknown> | undefined;
51
+ }
52
+ /** The result interface if validation fails. */
53
+ interface FailureResult {
54
+ /** The issues of failed validation. */
55
+ readonly issues: ReadonlyArray<Issue>;
56
+ }
57
+ /** The issue interface of the failure output. */
58
+ interface Issue {
59
+ /** The error message of the issue. */
60
+ readonly message: string;
61
+ /** The path of the issue, if any. */
62
+ readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
63
+ }
64
+ /** The path segment interface of the issue. */
65
+ interface PathSegment {
66
+ /** The key representing a path segment. */
67
+ readonly key: PropertyKey;
68
+ }
69
+ /** The Standard types interface. */
70
+ interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {
71
+ }
72
+ /** Infers the input type of a Standard. */
73
+ type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
74
+ /** Infers the output type of a Standard. */
75
+ type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
76
+ }
77
+ /** The Standard JSON Schema interface. */
78
+ export interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
79
+ /** The Standard JSON Schema properties. */
80
+ readonly '~standard': StandardJSONSchemaV1.Props<Input, Output>;
81
+ }
82
+ export declare namespace StandardJSONSchemaV1 {
83
+ /** The Standard JSON Schema properties interface. */
84
+ interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
85
+ /** Methods for generating the input/output JSON Schema. */
86
+ readonly jsonSchema: StandardJSONSchemaV1.Converter;
87
+ }
88
+ /** The Standard JSON Schema converter interface. */
89
+ interface Converter {
90
+ /** Converts the input type to JSON Schema. May throw if conversion is not supported. */
91
+ readonly input: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
92
+ /** Converts the output type to JSON Schema. May throw if conversion is not supported. */
93
+ readonly output: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
94
+ }
95
+ /**
96
+ * The target version of the generated JSON Schema.
97
+ *
98
+ * It is *strongly recommended* that implementers support `"draft-2020-12"` and `"draft-07"`, as they
99
+ * are both in wide use. All other targets can be implemented on a best-effort basis. Libraries should
100
+ * throw if they don't support a specified target.
101
+ *
102
+ * The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a
103
+ * superset of JSON Schema `"draft-04"`.
104
+ */
105
+ type Target = 'draft-2020-12' | 'draft-07' | 'openapi-3.0' | ({} & string);
106
+ /** The options for the input/output methods. */
107
+ interface Options {
108
+ /** Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw. */
109
+ readonly target: Target;
110
+ /** Explicit support for additional vendor-specific parameters, if needed. */
111
+ readonly libraryOptions?: Record<string, unknown> | undefined;
112
+ }
113
+ /** The Standard types interface. */
114
+ interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {
115
+ }
116
+ /** Infers the input type of a Standard. */
117
+ type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
118
+ /** Infers the output type of a Standard. */
119
+ type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
120
+ }
121
+ /**
122
+ * Returns `jsonSchema` if given, otherwise the schema's Standard JSON Schema `input`
123
+ * representation (the model produces the value that the validator consumes).
124
+ */
125
+ export declare function standardSchemaToJSONSchema(schema: StandardSchemaV1, jsonSchema?: Record<string, unknown> | undefined): Record<string, unknown>;
126
+ /**
127
+ * Validates `value` with `~standard.validate` and returns the typed output, throwing an
128
+ * `PukuError` on issues. Validation must be synchronous because `parse` hooks are.
129
+ */
130
+ export declare function parseWithStandardSchema<Schema extends StandardSchemaV1>(schema: Schema, value: unknown): StandardSchemaV1.InferOutput<Schema>;
@@ -0,0 +1,41 @@
1
+ import { PukuError } from '../core/error.js';
2
+ /**
3
+ * Returns `jsonSchema` if given, otherwise the schema's Standard JSON Schema `input`
4
+ * representation (the model produces the value that the validator consumes).
5
+ */
6
+ export function standardSchemaToJSONSchema(schema, jsonSchema) {
7
+ if (jsonSchema) {
8
+ return jsonSchema;
9
+ }
10
+ const std = schema['~standard'];
11
+ if (std.jsonSchema) {
12
+ return std.jsonSchema.input({ target: 'draft-2020-12' });
13
+ }
14
+ throw new PukuError(`Could not derive a JSON Schema from this ${std.vendor} schema as it does not implement Standard JSON Schema (\`~standard.jsonSchema\`). Pass the \`jsonSchema\` option, or use a library version that implements it (e.g. zod >= 4.2, or valibot via \`toStandardJsonSchema()\`).`);
15
+ }
16
+ /**
17
+ * Validates `value` with `~standard.validate` and returns the typed output, throwing an
18
+ * `PukuError` on issues. Validation must be synchronous because `parse` hooks are.
19
+ */
20
+ export function parseWithStandardSchema(schema, value) {
21
+ const result = schema['~standard'].validate(value);
22
+ if (result instanceof Promise) {
23
+ // avoid an unhandled rejection from the discarded result
24
+ result.catch(() => { });
25
+ throw new PukuError(`Async validation is not supported: the ${schema['~standard'].vendor} schema's \`~standard.validate()\` returned a Promise.`);
26
+ }
27
+ if (result.issues) {
28
+ const formattedIssues = result.issues.slice(0, 5).map(formatIssue).join('\n');
29
+ const issueCount = result.issues.length;
30
+ const suffix = issueCount > 5 ? `\n ... and ${issueCount - 5} more issue(s)` : '';
31
+ throw new PukuError(`Schema validation failed with ${issueCount} issue(s):\n${formattedIssues}${suffix}`);
32
+ }
33
+ return result.value;
34
+ }
35
+ function formatIssue(issue) {
36
+ const path = (issue.path ?? [])
37
+ .map((segment) => String(typeof segment === 'object' ? segment.key : segment))
38
+ .join('.');
39
+ return path ? ` - ${path}: ${issue.message}` : ` - ${issue.message}`;
40
+ }
41
+ //# sourceMappingURL=standard-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standard-schema.js","sourceRoot":"","sources":["../../../src/vendor/lib/standard-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAsJ1C;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CACxC,MAAwB,EACxB,UAAgD;IAEhD,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,MAAM,GAAG,GAAiE,MAAM,CAAC,WAAW,CAAC,CAAC;IAC9F,IAAI,GAAG,CAAC,UAAU,EAAE,CAAC;QACnB,OAAO,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC,CAAC;IAC3D,CAAC;IAED,MAAM,IAAI,SAAS,CACjB,4CAA4C,GAAG,CAAC,MAAM,6NAA6N,CACpR,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CACrC,MAAc,EACd,KAAc;IAEd,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEnD,IAAI,MAAM,YAAY,OAAO,EAAE,CAAC;QAC9B,yDAAyD;QACzD,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QACvB,MAAM,IAAI,SAAS,CACjB,0CAA0C,MAAM,CAAC,WAAW,CAAC,CAAC,MAAM,wDAAwD,CAC7H,CAAC;IACJ,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAClB,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9E,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;QACxC,MAAM,MAAM,GAAG,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,eAAe,UAAU,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;QAEnF,MAAM,IAAI,SAAS,CACjB,iCAAiC,UAAU,eAAe,eAAe,GAAG,MAAM,EAAE,CACrF,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC,KAAK,CAAC;AACtB,CAAC;AAED,SAAS,WAAW,CAAC,KAA6B;IAChD,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;SAC5B,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;SAC7E,IAAI,CAAC,GAAG,CAAC,CAAC;IACb,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;AACzE,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { BetaMemoryTool20250818, BetaTool, BetaToolBash20241022, BetaToolBash20250124, BetaToolComputerUse20241022, BetaToolComputerUse20250124, BetaToolComputerUse20251124, BetaToolResultContentBlockParam, BetaToolTextEditor20241022, BetaToolTextEditor20250124, BetaToolTextEditor20250429, BetaToolTextEditor20250728, BetaToolUnion, BetaToolUseBlock } from '../../resources/beta';
2
+ import type { BetaManagedAgentsAgentCustomToolUseEvent, BetaManagedAgentsAgentToolUseEvent } from '../../resources/beta/sessions/events';
3
+ export type Promisable<T> = T | Promise<T>;
4
+ /** Tools that run on the client. Server-side tools (code execution, web search, MCP toolsets) are not included. */
5
+ export type BetaClientRunnableToolType = BetaTool | BetaMemoryTool20250818 | BetaToolBash20241022 | BetaToolBash20250124 | BetaToolComputerUse20241022 | BetaToolComputerUse20250124 | BetaToolComputerUse20251124 | BetaToolTextEditor20241022 | BetaToolTextEditor20250124 | BetaToolTextEditor20250429 | BetaToolTextEditor20250728;
6
+ /**
7
+ * The tool call being served: a Messages `tool_use` block, or a session
8
+ * `agent.tool_use` / `agent.custom_tool_use` event. All three carry `id`,
9
+ * `name` and `input`.
10
+ */
11
+ export type BetaToolUse = BetaToolUseBlock | BetaManagedAgentsAgentToolUseEvent | BetaManagedAgentsAgentCustomToolUseEvent;
12
+ export type BetaToolRunContext = {
13
+ toolUse: BetaToolUse;
14
+ /** @deprecated Use `toolUse`. */
15
+ toolUseBlock: BetaToolUse;
16
+ /**
17
+ * Aborted when the runner is aborted or, in the session runner, when the
18
+ * per-tool timeout fires. The runner still waits for `run` to return, so
19
+ * check it in long-running work.
20
+ */
21
+ signal?: AbortSignal | null | undefined;
22
+ };
23
+ /** A tool definition plus the `run` and `parse` the tool runners call. */
24
+ export type BetaRunnableTool<Input = any> = BetaClientRunnableToolType & {
25
+ /**
26
+ * Runs on the event loop: a body that blocks synchronously stalls the runner
27
+ * and, in an `EnvironmentWorker`, the lease heartbeat. Await async work or
28
+ * move it to a worker thread.
29
+ */
30
+ run: (args: Input, context?: BetaToolRunContext) => Promisable<string | Array<BetaToolResultContentBlockParam>>;
31
+ parse: (content: unknown) => Input;
32
+ /** Called once by the session runner when it stops. Release held resources here (e.g. a shell). */
33
+ close?: () => Promisable<void>;
34
+ };
35
+ /**
36
+ * The name the model calls a tool by: `mcp_server_name` for MCP toolsets, `type` for nameless server
37
+ * toolsets (browser/computer), `name` for everything else.
38
+ */
39
+ export declare function toolName(tool: BetaToolUnion | BetaRunnableTool): string;
40
+ /** Tool-result content for a thrown value: a {@link ToolError}'s own content, otherwise `Error: <message>`. */
41
+ export declare function toolErrorContent(e: unknown): string | Array<BetaToolResultContentBlockParam>;
42
+ /** What a tool run produced, and whether it failed. */
43
+ export interface RunnableToolOutcome {
44
+ content: string | Array<BetaToolResultContentBlockParam>;
45
+ isError: boolean;
46
+ }
47
+ /** Parse the input, run the tool, and turn anything thrown into an error result. */
48
+ export declare function runRunnableTool(tool: BetaRunnableTool, rawInput: unknown, context: BetaToolRunContext): Promise<RunnableToolOutcome>;
@@ -0,0 +1,26 @@
1
+ import { ToolError } from './ToolError.js';
2
+ /**
3
+ * The name the model calls a tool by: `mcp_server_name` for MCP toolsets, `type` for nameless server
4
+ * toolsets (browser/computer), `name` for everything else.
5
+ */
6
+ export function toolName(tool) {
7
+ return ('name' in tool ? tool.name
8
+ : 'mcp_server_name' in tool ? tool.mcp_server_name
9
+ : tool.type);
10
+ }
11
+ /** Tool-result content for a thrown value: a {@link ToolError}'s own content, otherwise `Error: <message>`. */
12
+ export function toolErrorContent(e) {
13
+ return e instanceof ToolError ? e.content : `Error: ${e instanceof Error ? e.message : String(e)}`;
14
+ }
15
+ /** Parse the input, run the tool, and turn anything thrown into an error result. */
16
+ export async function runRunnableTool(tool, rawInput, context) {
17
+ try {
18
+ const input = tool.parse ? tool.parse(rawInput) : rawInput;
19
+ const content = await tool.run(input, context);
20
+ return { content, isError: false };
21
+ }
22
+ catch (e) {
23
+ return { content: toolErrorContent(e), isError: true };
24
+ }
25
+ }
26
+ //# sourceMappingURL=BetaRunnableTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BetaRunnableTool.js","sourceRoot":"","sources":["../../../../src/vendor/lib/tools/BetaRunnableTool.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAwDxC;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAsC;IAC7D,OAAO,CACL,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI;QAC1B,CAAC,CAAC,iBAAiB,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe;YAClD,CAAC,CAAC,IAAI,CAAC,IAAI,CACZ,CAAC;AACJ,CAAC;AAED,+GAA+G;AAC/G,MAAM,UAAU,gBAAgB,CAAC,CAAU;IACzC,OAAO,CAAC,YAAY,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;AACrG,CAAC;AAQD,oFAAoF;AACpF,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,IAAsB,EACtB,QAAiB,EACjB,OAA2B;IAE3B,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;QAC3D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAC/C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACrC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACzD,CAAC;AACH,CAAC"}
@@ -0,0 +1,160 @@
1
+ import { BetaRunnableTool } from './BetaRunnableTool';
2
+ import { PukuAI } from '../..';
3
+ import { BetaMessage, BetaMessageParam, BetaToolUnion, MessageCreateParams } from '../../resources/beta';
4
+ import { BetaMessageStream } from '../BetaMessageStream';
5
+ import { RequestOptions } from '../../internal/request-options';
6
+ import { CompactionControl } from './CompactionControl';
7
+ /**
8
+ * A ToolRunner handles the automatic conversation loop between the assistant and tools.
9
+ *
10
+ * A ToolRunner is an async iterable that yields either BetaMessage or BetaMessageStream objects
11
+ * depending on the streaming configuration.
12
+ */
13
+ export declare class BetaToolRunner<Stream extends boolean> {
14
+ #private;
15
+ private client;
16
+ constructor(client: PukuAI, params: BetaToolRunnerParams, options?: BetaToolRunnerRequestOptions);
17
+ [Symbol.asyncIterator](): AsyncIterator<Stream extends true ? BetaMessageStream : Stream extends false ? BetaMessage : BetaMessage | BetaMessageStream>;
18
+ /**
19
+ * Update the parameters for the next API call. This invalidates any cached tool responses.
20
+ *
21
+ * @param paramsOrMutator - Either new parameters or a function to mutate existing parameters
22
+ *
23
+ * @example
24
+ * // Direct parameter update
25
+ * runner.setMessagesParams({
26
+ * model: 'puku-haiku-4-5',
27
+ * max_tokens: 500,
28
+ * });
29
+ *
30
+ * @example
31
+ * // Using a mutator function
32
+ * runner.setMessagesParams((params) => ({
33
+ * ...params,
34
+ * max_tokens: 100,
35
+ * }));
36
+ */
37
+ setMessagesParams(params: BetaToolRunnerParams): void;
38
+ setMessagesParams(mutator: (prevParams: BetaToolRunnerParams) => BetaToolRunnerParams): void;
39
+ /**
40
+ * Update the request options for future API calls.
41
+ *
42
+ * @param optionsOrMutator - Either new options or a function to mutate existing options
43
+ *
44
+ * @example
45
+ * // Direct options update
46
+ * runner.setRequestOptions({
47
+ * signal: controller.signal,
48
+ * });
49
+ *
50
+ * @example
51
+ * // Using a mutator function
52
+ * runner.setRequestOptions((prevOptions) => ({
53
+ * ...prevOptions,
54
+ * signal: controller.signal,
55
+ * }));
56
+ */
57
+ setRequestOptions(options: BetaToolRunnerRequestOptions): void;
58
+ setRequestOptions(mutator: (prevOptions: BetaToolRunnerRequestOptions) => BetaToolRunnerRequestOptions): void;
59
+ /**
60
+ * Get the tool response for the last message from the assistant.
61
+ * Avoids redundant tool executions by caching results.
62
+ *
63
+ * @returns A promise that resolves to a BetaMessageParam containing tool results, or null if no tools need to be executed
64
+ *
65
+ * @example
66
+ * const toolResponse = await runner.generateToolResponse();
67
+ * if (toolResponse) {
68
+ * console.log('Tool results:', toolResponse.content);
69
+ * }
70
+ */
71
+ generateToolResponse(signal?: AbortSignal | null | undefined): Promise<PukuAI.Beta.Messages.BetaMessageParam | null>;
72
+ /**
73
+ * Wait for the async iterator to complete. This works even if the async iterator hasn't yet started, and
74
+ * will wait for an instance to start and go to completion.
75
+ *
76
+ * @returns A promise that resolves to the final BetaMessage when the iterator completes
77
+ *
78
+ * @example
79
+ * // Start consuming the iterator
80
+ * for await (const message of runner) {
81
+ * console.log('Message:', message.content);
82
+ * }
83
+ *
84
+ * // Meanwhile, wait for completion from another part of the code
85
+ * const finalMessage = await runner.done();
86
+ * console.log('Final response:', finalMessage.content);
87
+ */
88
+ done(): Promise<BetaMessage>;
89
+ /**
90
+ * Returns a promise indicating that the stream is done. Unlike .done(), this will eagerly read the stream:
91
+ * * If the iterator has not been consumed, consume the entire iterator and return the final message from the
92
+ * assistant.
93
+ * * If the iterator has been consumed, waits for it to complete and returns the final message.
94
+ *
95
+ * @returns A promise that resolves to the final BetaMessage from the conversation
96
+ * @throws {PukuError} If no messages were processed during the conversation
97
+ *
98
+ * @example
99
+ * const finalMessage = await runner.runUntilDone();
100
+ * console.log('Final response:', finalMessage.content);
101
+ */
102
+ runUntilDone(): Promise<BetaMessage>;
103
+ /**
104
+ * Get the current parameters being used by the ToolRunner.
105
+ *
106
+ * @returns A readonly view of the current ToolRunnerParams
107
+ *
108
+ * @example
109
+ * const currentParams = runner.params;
110
+ * console.log('Current model:', currentParams.model);
111
+ * console.log('Message count:', currentParams.messages.length);
112
+ */
113
+ get params(): Readonly<BetaToolRunnerParams>;
114
+ /**
115
+ * Add one or more messages to the conversation history.
116
+ *
117
+ * @param messages - One or more BetaMessageParam objects to add to the conversation
118
+ *
119
+ * @example
120
+ * runner.pushMessages(
121
+ * { role: 'user', content: 'Also, what about the weather in NYC?' }
122
+ * );
123
+ *
124
+ * @example
125
+ * // Adding multiple messages
126
+ * runner.pushMessages(
127
+ * { role: 'user', content: 'What about NYC?' },
128
+ * { role: 'user', content: 'And Boston?' }
129
+ * );
130
+ */
131
+ pushMessages(...messages: BetaMessageParam[]): void;
132
+ /**
133
+ * Makes the ToolRunner directly awaitable, equivalent to calling .runUntilDone()
134
+ * This allows using `await runner` instead of `await runner.runUntilDone()`
135
+ */
136
+ then<TResult1 = BetaMessage, TResult2 = never>(onfulfilled?: ((value: BetaMessage) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
137
+ }
138
+ type Simplify<T> = {
139
+ [KeyType in keyof T]: T[KeyType];
140
+ } & {};
141
+ /**
142
+ * Parameters for creating a ToolRunner, extending MessageCreateParams with runnable tools.
143
+ */
144
+ export type BetaToolRunnerParams = Simplify<Omit<MessageCreateParams, 'tools'> & {
145
+ tools: (BetaToolUnion | BetaRunnableTool<any>)[];
146
+ /**
147
+ * Maximum number of iterations (API requests) to make in the tool execution loop.
148
+ * Each iteration consists of: assistant response → tool execution → tool results.
149
+ * When exceeded, the loop will terminate even if tools are still being requested.
150
+ */
151
+ max_iterations?: number;
152
+ /**
153
+ * @deprecated Use server-side compaction instead by passing
154
+ * `edits: [{ type: 'compact_20260112' }]` in the params passed to `toolRunner()`.
155
+ * See https://platform.puku.com/docs/en/build-with-puku/compaction
156
+ */
157
+ compactionControl?: CompactionControl;
158
+ }>;
159
+ export type BetaToolRunnerRequestOptions = Pick<RequestOptions, 'headers' | 'signal' | 'fallbackState'>;
160
+ export {};