@desplega.ai/agent-swarm 2.14.1 → 2.14.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 (346) hide show
  1. package/dist/{acp-adapter-7jv7w8jh.js → acp-adapter-q1vz4hh2.js} +8 -8
  2. package/dist/{acp-targets-0ebmg3et.js → acp-targets-d44eerh4.js} +7 -7
  3. package/dist/{actions-0ds9dx6c.js → actions-z4k4bvss.js} +27 -27
  4. package/dist/{agent-fs-provision-zpbxa9jc.js → agent-fs-provision-aan1cgpx.js} +4 -4
  5. package/dist/{amp-adapter-awh5nn7a.js → amp-adapter-wac3py0p.js} +1 -1
  6. package/dist/{anthropic-messages-gtgp9r85.js → anthropic-messages-njt2r5m4.js} +16 -15
  7. package/dist/{app-nzejkvpp.js → app-wax6qz5e.js} +9 -9
  8. package/dist/{approval-notifications-hbqtb2w3.js → approval-notifications-6fvkhnma.js} +10 -10
  9. package/dist/{assistant-1paft129.js → assistant-e8fe08zx.js} +25 -25
  10. package/dist/{azure-openai-responses-e76k86gf.js → azure-openai-responses-6ewf9rwp.js} +9 -9
  11. package/dist/{boot-args-schema-zs435mfx.js → boot-args-schema-rv97cmnt.js} +1 -1
  12. package/dist/{boot-reembed-91qrd4mz.js → boot-reembed-bcn7frk9.js} +1 -1
  13. package/dist/{boot-reembed-7xq2qgg4.js → boot-reembed-xakrdy6y.js} +1 -1
  14. package/dist/{boot-scrub-sweep-3h5xscw6.js → boot-scrub-sweep-20t8akhf.js} +2 -2
  15. package/dist/{boot-seeds-xkxqa8zc.js → boot-seeds-48rr6r29.js} +4 -4
  16. package/dist/{boxd-464x3w4m.js → boxd-tjpxwecx.js} +2 -2
  17. package/dist/{claude-adapter-6d8eyf2f.js → claude-adapter-0wzwntrj.js} +8 -8
  18. package/dist/{claude-managed-adapter-jzxcaf9m.js → claude-managed-adapter-4xcgt46w.js} +2 -2
  19. package/dist/{claude-managed-setup-5fcx0qh3.js → claude-managed-setup-91cyktw7.js} +5 -5
  20. package/dist/{claude-sdk-session-11vhz1hc.js → claude-sdk-session-ngj4dce5.js} +9658 -9634
  21. package/dist/{cli-hamdfjtx.js → cli-021hrewp.js} +1 -1
  22. package/dist/{cli-pgdqhdkw.js → cli-0kyjrbaa.js} +2 -2
  23. package/dist/{cli-132h67ps.js → cli-0nz04gqv.js} +48 -48
  24. package/dist/{cli-6a77m17n.js → cli-0rrft7s3.js} +2 -2
  25. package/dist/{cli-z0effej1.js → cli-1d9q7qrn.js} +5 -5
  26. package/dist/{cli-tdd9dvw6.js → cli-1t5vhrpv.js} +1 -1
  27. package/dist/{cli-zyf288rw.js → cli-2ja7eadd.js} +1 -1
  28. package/dist/{cli-k9m8fckz.js → cli-3ffzr65w.js} +4 -4
  29. package/dist/{cli-02ba8qx5.js → cli-3kdgm393.js} +4 -4
  30. package/dist/{cli-hh5m39pt.js → cli-3vc518cw.js} +1 -1
  31. package/dist/{cli-5pyes68e.js → cli-5188hq0a.js} +8 -8
  32. package/dist/{cli-zcghfsdg.js → cli-53gt8wfv.js} +1 -1
  33. package/dist/{cli-5t00r6c9.js → cli-5njmmmer.js} +2 -2
  34. package/dist/{cli-etykr11s.js → cli-5rw7nt99.js} +1 -1
  35. package/dist/{cli-6c61yjwy.js → cli-5xx353cy.js} +7554 -1534
  36. package/dist/{cli-by7s3n4p.js → cli-65k149j5.js} +2 -2
  37. package/dist/{cli-1e13gvfn.js → cli-6zpn5hmp.js} +11 -11
  38. package/dist/{cli-rb1z91g8.js → cli-7dpdq7yh.js} +1230 -540
  39. package/dist/{cli-3bagv8rt.js → cli-7wwewkf4.js} +1 -1
  40. package/dist/{cli-288k5ep1.js → cli-83hynhes.js} +15 -11
  41. package/dist/{cli-v84kb7af.js → cli-8ee7xt75.js} +11 -11
  42. package/dist/{cli-v3jxx8dv.js → cli-8ef94zm2.js} +2 -2
  43. package/dist/{cli-9fvk9mv8.js → cli-8gr1bg9t.js} +1 -1
  44. package/dist/{cli-vrb8pvrf.js → cli-9j1qcs0b.js} +6 -6
  45. package/dist/{cli-0dkpdvnn.js → cli-9mvfvggt.js} +5 -5
  46. package/dist/{cli-3bcsc3m7.js → cli-an8bpy60.js} +1 -1
  47. package/dist/{cli-6yhjqd6k.js → cli-azptj8xe.js} +810 -184
  48. package/dist/{cli-3a3hm1z8.js → cli-c0rt16vk.js} +2 -2
  49. package/dist/{cli-byzq8xht.js → cli-c6vhcknq.js} +6 -6
  50. package/dist/{cli-eaqxkeq0.js → cli-cczffwak.js} +8 -8
  51. package/dist/{cli-83kf2y60.js → cli-cgmka83w.js} +6 -6
  52. package/dist/{cli-5xjdft4s.js → cli-d13qgcct.js} +207 -142
  53. package/dist/{cli-k3facve0.js → cli-d5nvy1jy.js} +1 -1
  54. package/dist/{cli-zvsy4abb.js → cli-dev6f0px.js} +3 -3
  55. package/dist/{cli-e1wprqnd.js → cli-dzhht0vq.js} +2 -2
  56. package/dist/{cli-zdkcp8p0.js → cli-e13kbyq0.js} +1 -1
  57. package/dist/{cli-f07sgaax.js → cli-e2k0ej0d.js} +2 -2
  58. package/dist/{cli-dt931hb8.js → cli-ek8b88kv.js} +21 -21
  59. package/dist/{cli-20mkgwev.js → cli-ertcjw6z.js} +249 -19
  60. package/dist/{cli-0qyfna7a.js → cli-f3ta4e67.js} +4 -4
  61. package/dist/{cli-6xrbpj5j.js → cli-f4xv7s0t.js} +4 -4
  62. package/dist/{cli-d1zkys4j.js → cli-fdam1t9b.js} +29 -13
  63. package/dist/{cli-spfz393q.js → cli-feh37wgs.js} +598 -219
  64. package/dist/{cli-ebqx630g.js → cli-fjzjtqna.js} +35 -18
  65. package/dist/{cli-zgsd2w2k.js → cli-fs9t2m2k.js} +16 -16
  66. package/dist/{cli-trvtxwzt.js → cli-g03x26q6.js} +2 -2
  67. package/dist/{cli-0mq8kxfx.js → cli-gnkzh8ed.js} +3 -3
  68. package/dist/{cli-phantfg3.js → cli-gy0r7gb8.js} +40 -15
  69. package/dist/{cli-wsh5vfa7.js → cli-h364asjc.js} +2 -2
  70. package/dist/{cli-3ktfe5jx.js → cli-h3xcfp4c.js} +22 -7
  71. package/dist/{cli-976m0zcw.js → cli-h8k5801a.js} +49 -13
  72. package/dist/{cli-727sq1f9.js → cli-h96yp7xv.js} +2 -2
  73. package/dist/{cli-ytgtqsy9.js → cli-hab0bvrh.js} +1 -1
  74. package/dist/{cli-7dwsn9y5.js → cli-j3wqt73b.js} +4 -4
  75. package/dist/{cli-8kemtj1r.js → cli-jfgaz10x.js} +7 -7
  76. package/dist/{cli-wtwe8vng.js → cli-jrhvywah.js} +25 -24
  77. package/dist/{cli-tjrrabez.js → cli-jrxt5j0n.js} +3 -3
  78. package/dist/{cli-7b7rxz22.js → cli-jw7n9pct.js} +5 -2
  79. package/dist/{cli-k791mabe.js → cli-k9kfck3s.js} +5 -5
  80. package/dist/{cli-44r66df2.js → cli-kkwq5b12.js} +1 -1
  81. package/dist/{cli-e9p9h14n.js → cli-nc842kc9.js} +4 -4
  82. package/dist/{cli-3179w2rz.js → cli-nmj4phcg.js} +1 -1
  83. package/dist/{cli-ny8f5g7t.js → cli-praaw1wh.js} +1 -1
  84. package/dist/{cli-j8fmn3wv.js → cli-q44p4869.js} +7 -7
  85. package/dist/{cli-sq32dgfe.js → cli-q58qt9dw.js} +237 -57
  86. package/dist/{cli-2n7qdqfv.js → cli-qqz5z36e.js} +2 -2
  87. package/dist/{cli-b70cpf8f.js → cli-r7rpy2xz.js} +1 -1
  88. package/dist/{cli-1hj68b3h.js → cli-rcqgr0hs.js} +1 -1
  89. package/dist/{cli-ph95yejc.js → cli-rjc464jg.js} +2 -2
  90. package/dist/{cli-967jrz7j.js → cli-rw3m83j4.js} +15 -15
  91. package/dist/{cli-0vxbrxr3.js → cli-rwcj6wt3.js} +304 -19
  92. package/dist/{cli-yvnnyjxm.js → cli-ryn4y478.js} +1 -1
  93. package/dist/{cli-3g0vbq46.js → cli-s48k2rzx.js} +3 -3
  94. package/dist/{cli-98sea4d9.js → cli-s90wcbk9.js} +2 -2
  95. package/dist/{cli-e2wzzw17.js → cli-svcy72s5.js} +1 -1
  96. package/dist/{cli-643skca1.js → cli-swtwbg85.js} +17 -17
  97. package/dist/{cli-4y2bekkn.js → cli-t1bqpzgz.js} +2 -2
  98. package/dist/{cli-zmfs06hg.js → cli-t5jbjq61.js} +3 -3
  99. package/dist/{cli-mz7ycqn8.js → cli-td2h8zej.js} +6 -6
  100. package/dist/{cli-9t7syepg.js → cli-ttatvwn6.js} +1 -1
  101. package/dist/{cli-v1rhq77v.js → cli-txxcf9s1.js} +6 -6
  102. package/dist/{cli-q4z9s6zs.js → cli-v7az4d1g.js} +2 -2
  103. package/dist/cli-vqt44168.js +14 -0
  104. package/dist/{cli-tkrp183j.js → cli-vs9h3vw2.js} +5 -5
  105. package/dist/{cli-7abeph0b.js → cli-w2fg8kjc.js} +3 -3
  106. package/dist/{cli-sf5kp73f.js → cli-wz7qj1jy.js} +12 -12
  107. package/dist/{cli-ww8wxfzx.js → cli-x5t54ytt.js} +2 -2
  108. package/dist/{cli-nmdy8bzf.js → cli-xphbv66z.js} +1 -1
  109. package/dist/{cli-redtbppc.js → cli-xxgqn93n.js} +3753 -1186
  110. package/dist/{cli-s7bfz1ye.js → cli-z209g721.js} +109 -85
  111. package/dist/{cli-vp2ksaq9.js → cli-z5andw8k.js} +1 -1
  112. package/dist/{cli-xmc2nrtv.js → cli-zr2sc5tr.js} +1 -1
  113. package/dist/{cli-z0c98h7h.js → cli-zrm0610v.js} +61 -54
  114. package/dist/cli.js +41 -40
  115. package/dist/{cloudflare-workers-ai-system-one-w3m0fbf8.js → cloudflare-workers-ai-system-one-kb0tq22h.js} +2 -2
  116. package/dist/{codex-adapter-seht4h9t.js → codex-adapter-0c1ynrmt.js} +5 -5
  117. package/dist/{codex-session-runner-tq95x3gq.js → codex-session-runner-z4t9z7yy.js} +5 -5
  118. package/dist/{commands-0awwqxq5.js → commands-h0jxqdhk.js} +3 -3
  119. package/dist/{controller-hgjx521c.js → controller-4ygy66hv.js} +3 -3
  120. package/dist/{controllers-connect-j4kdmhfj.js → controllers-connect-ynbvv8pv.js} +26 -26
  121. package/dist/core-mj9fzrcm.js +41 -0
  122. package/dist/{cursor-adapter-0rg8wk6j.js → cursor-adapter-9e4d6658.js} +1 -1
  123. package/dist/{db-8xs2js3s.js → db-bg0hxjq1.js} +3 -3
  124. package/dist/{db-dd6hj211.js → db-q12gmpns.js} +2 -2
  125. package/dist/{devtools-b8qts77k.js → devtools-t8my9az6.js} +1 -1
  126. package/dist/{dispatcher-v7drd034.js → dispatcher-v5dbfscq.js} +23 -23
  127. package/dist/{dsh-adapter-ah8npj2x.js → dsh-adapter-z3fneea1.js} +1 -1
  128. package/dist/{e2b-z1g7vpz6.js → e2b-k3kb8b52.js} +3 -3
  129. package/dist/{e2b-hg80w0qr.js → e2b-p269awh6.js} +4 -4
  130. package/dist/{easter-egg-3d-8n4w3s9k.js → easter-egg-3d-y49v5z90.js} +1 -1
  131. package/dist/{embedding-space-0p921zt3.js → embedding-space-mjt5ksq0.js} +5 -5
  132. package/dist/{embeddings-9s7kbrc6.js → embeddings-td9hgnc5.js} +1 -1
  133. package/dist/{execute-x0fy9j0m.js → execute-z8nc8bba.js} +1 -1
  134. package/dist/{external-channel-ktfvn29c.js → external-channel-pjenc2ag.js} +2 -2
  135. package/dist/{fx-adapter-15vjxvgm.js → fx-adapter-pjeztp0n.js} +9 -9
  136. package/dist/getMachineId-bsd-hjs2tbdp.js +36 -0
  137. package/dist/getMachineId-darwin-kzbvr8s3.js +40 -0
  138. package/dist/getMachineId-linux-embmcq2c.js +26 -0
  139. package/dist/getMachineId-unsupported-jvznc6d4.js +20 -0
  140. package/dist/getMachineId-win-qr8z0b13.js +36 -0
  141. package/dist/{google-generative-ai-nzndg246.js → google-generative-ai-tf3w7557.js} +11 -16
  142. package/dist/{google-vertex-ragh3nnw.js → google-vertex-9pj87bd8.js} +15 -17
  143. package/dist/{grok-adapter-77httan0.js → grok-adapter-davbhx8t.js} +9 -9
  144. package/dist/handlers-rf130hnp.js +39 -0
  145. package/dist/{heartbeat-5yaj6dym.js → heartbeat-9hmvqxk0.js} +26 -26
  146. package/dist/{hook-c99nycyh.js → hook-0b1jqs2t.js} +6 -6
  147. package/dist/{hook-2jttae8s.js → hook-1n0sjv8p.js} +7 -7
  148. package/dist/{http-7y9dbfrr.js → http-vykejyjx.js} +412 -183
  149. package/dist/{index-tcegcysh.js → index-07d66kdm.js} +5 -5
  150. package/dist/{index-fqf82sbk.js → index-0hgjxqz8.js} +1 -1
  151. package/dist/{index-t274qhhs.js → index-0nt39qwy.js} +6 -6
  152. package/dist/{index-8p03vx1h.js → index-2xbxq71g.js} +8 -8
  153. package/dist/{index-jvfp0j47.js → index-3j8hffkb.js} +12038 -7667
  154. package/dist/index-8w09aggw.js +43 -0
  155. package/dist/{index-xhp7yp3t.js → index-b3wy4jzs.js} +1 -1
  156. package/dist/{index-6g9rdcrj.js → index-dt9vr7tb.js} +162 -57
  157. package/dist/{index-cw8nxnba.js → index-ezfas4jj.js} +1912 -346
  158. package/dist/index-g2jntx15.js +38 -0
  159. package/dist/{index-h9xnzfhx.js → index-j6sqtb83.js} +101 -72
  160. package/dist/{index-m6g8q65g.js → index-na0tczq0.js} +9268 -10220
  161. package/dist/{index-tn1m3q9b.js → index-p9dkwhwe.js} +3 -3
  162. package/dist/{index-g7rthzrv.js → index-pe2etczf.js} +8 -8
  163. package/dist/index-qffex5k4.js +41 -0
  164. package/dist/index-qrp11tp9.js +4 -0
  165. package/dist/{index-t4n9z755.js → index-ryyrg0d8.js} +406 -317
  166. package/dist/{index-t17p395x.js → index-sf06w57a.js} +13 -13
  167. package/dist/{index-qxcfv8vq.js → index-vybnwd5v.js} +1 -1
  168. package/dist/{index-dm7c6hw5.js → index-wsf1f5pe.js} +27 -27
  169. package/dist/{keepalive-7eyb8y4t.js → keepalive-86z0tzzf.js} +3 -3
  170. package/dist/lead-edmwagkn.js +81 -0
  171. package/dist/{llama-cpp-classify-yvb8vh7w.js → llama-cpp-classify-wd7htn1x.js} +2 -2
  172. package/dist/{maintenance-tdrd8nwv.js → maintenance-19h6tfwz.js} +1 -1
  173. package/dist/{mistral-conversations-w4bncwbt.js → mistral-conversations-txjmc64f.js} +7 -7
  174. package/dist/{module-ES6BEMUI-6htewwha.js → module-ES6BEMUI-44w9s1dx.js} +4 -4
  175. package/dist/{multipart-parser-xevcstye.js → multipart-parser-xqbgwrav.js} +1 -1
  176. package/dist/{oauth-refresh-sweep-f4c7g37h.js → oauth-refresh-sweep-6nmyrv32.js} +2 -2
  177. package/dist/{object-webhooks-p190rdxp.js → object-webhooks-2kynmdf8.js} +7 -7
  178. package/dist/{onboard-56h4sks6.js → onboard-zbpm96mn.js} +5 -5
  179. package/dist/{openai-codex-responses-z2h941b8.js → openai-codex-responses-6ckhys6r.js} +31 -25
  180. package/dist/{openai-completions-5bxdkeg9.js → openai-completions-c9dsq9jh.js} +17 -17
  181. package/dist/{openai-decisions-fyq1p9f9.js → openai-decisions-9vzvv10c.js} +2 -2
  182. package/dist/{openai-responses-dzf3e8r5.js → openai-responses-bhfmt9sa.js} +9 -9
  183. package/dist/{opencode-adapter-xg3yxfr0.js → opencode-adapter-fyqcbdra.js} +5 -5
  184. package/dist/{openrouter-images-0jj12a2q.js → openrouter-images-hkk5p580.js} +3 -3
  185. package/dist/otel-impl-txa20w1h.js +11178 -0
  186. package/dist/{pending-xgv316w0.js → pending-4rxawq8y.js} +24 -24
  187. package/dist/{pi-messages-zk3g4esn.js → pi-messages-py3f96p7.js} +5 -5
  188. package/dist/{pi-mono-adapter-txe0syzb.js → pi-mono-adapter-rnsed1xa.js} +14 -14
  189. package/dist/{pricing-refresh-041zpyhf.js → pricing-refresh-4314hwtw.js} +2 -2
  190. package/dist/{rbac-roles-8f3jbcaf.js → rbac-roles-fztcm8ky.js} +2 -2
  191. package/dist/{rbac-roles-cw7rrw5b.js → rbac-roles-msqt7a3k.js} +3 -3
  192. package/dist/{render-v2-2ezw4mzt.js → render-v2-w49wtecg.js} +9 -9
  193. package/dist/{resume-p14wdx8m.js → resume-gwgtp4m3.js} +12 -12
  194. package/dist/{runtime-he7c9g1r.js → runtime-kkebz8yq.js} +1 -1
  195. package/dist/{session-access-8jvq86fj.js → session-access-kjb19m2w.js} +5 -5
  196. package/dist/{session-source-backfill-6fe3hcgb.js → session-source-backfill-805p4wqr.js} +2 -2
  197. package/dist/{setup-6v0bn4r1.js → setup-q8y168c8.js} +3 -3
  198. package/dist/thread-buffer-yqbffd0t.js +40 -0
  199. package/dist/{tree-visibility-g1a8ff4r.js → tree-visibility-qj323994.js} +2 -2
  200. package/dist/{typesafe-system-one-qkvkgrcz.js → typesafe-system-one-avrdb4zm.js} +2 -2
  201. package/dist/{user-merge-jobs-vjsps179.js → user-merge-jobs-qfp40f2s.js} +3 -3
  202. package/dist/{virtual-modules-mreda4fp.js → virtual-modules-nzxegw0a.js} +7 -7
  203. package/dist/{work-objects-hfw15e35.js → work-objects-hs089w60.js} +25 -25
  204. package/dist/{worker-follow-up-gbaz2ydz.js → worker-follow-up-zwgg20sr.js} +23 -23
  205. package/dist/worker-kg4g7rnx.js +81 -0
  206. package/openapi.json +3 -3
  207. package/package.json +25 -24
  208. package/plugin/commands/create-pr.md +5 -2
  209. package/plugin/pi-skills/create-pr/SKILL.md +5 -2
  210. package/src/apps/sync.ts +7 -2
  211. package/src/be/db/workflow-runs.ts +12 -8
  212. package/src/be/db.ts +4 -1
  213. package/src/be/migrations/367_workflow_run_principal.sql +5 -0
  214. package/src/be/swarm-config-guard.ts +3 -0
  215. package/src/be/task-auto-title-listener.ts +2 -2
  216. package/src/commands/onboard/agent-fs-version.ts +1 -1
  217. package/src/extensions/post-bridge.ts +27 -28
  218. package/src/http/active-sessions.ts +7 -0
  219. package/src/http/agents.ts +7 -0
  220. package/src/http/api-keys.ts +7 -0
  221. package/src/http/approval-requests.ts +4 -0
  222. package/src/http/budgets.ts +2 -0
  223. package/src/http/codex-oauth-keep-warm.ts +6 -2
  224. package/src/http/config.ts +1 -0
  225. package/src/http/context.ts +4 -0
  226. package/src/http/db-query.ts +3 -0
  227. package/src/http/events.ts +2 -0
  228. package/src/http/fs.ts +1 -0
  229. package/src/http/integrations.ts +4 -0
  230. package/src/http/mcp-bridge.ts +1 -0
  231. package/src/http/memory.ts +3 -0
  232. package/src/http/metrics.ts +16 -0
  233. package/src/http/oauth-locks.ts +8 -0
  234. package/src/http/page-proxy.ts +16 -0
  235. package/src/http/pages.ts +9 -0
  236. package/src/http/poll.ts +1 -0
  237. package/src/http/pricing.ts +2 -0
  238. package/src/http/prompt-templates.ts +34 -0
  239. package/src/http/schedules.ts +10 -0
  240. package/src/http/script-runs.ts +24 -0
  241. package/src/http/scripts.ts +1 -0
  242. package/src/http/session-data.ts +2 -0
  243. package/src/http/status.ts +1 -0
  244. package/src/http/tasks.ts +17 -0
  245. package/src/http/trackers/jira.ts +2 -0
  246. package/src/http/trackers/linear.ts +4 -0
  247. package/src/http/users.ts +18 -0
  248. package/src/http/webhooks.ts +12 -0
  249. package/src/http/workflow-events.ts +26 -6
  250. package/src/http/workflows.ts +40 -0
  251. package/src/http/x.ts +4 -0
  252. package/src/linear/app.ts +3 -2
  253. package/src/linear/client.ts +5 -1
  254. package/src/linear/host.ts +40 -0
  255. package/src/linear/oauth.ts +3 -2
  256. package/src/linear/sync.ts +4 -3
  257. package/src/otel-impl.ts +8 -5
  258. package/src/providers/amp-adapter.ts +1 -1
  259. package/src/rbac/legacy-policy.ts +2 -0
  260. package/src/rbac/permissions.ts +5 -0
  261. package/src/scripts-runtime/quickjs-compat.ts +44 -10
  262. package/src/slack/render-v2.ts +50 -23
  263. package/src/slack/reviewed-deliverables.ts +251 -0
  264. package/src/tests/check-pr-body.test.ts +408 -93
  265. package/src/tests/compose-dev-object-store.test.ts +13 -0
  266. package/src/tests/compose-example-object-store.test.ts +67 -0
  267. package/src/tests/db-query.test.ts +8 -4
  268. package/src/tests/e2b-dispatch.test.ts +7 -1
  269. package/src/tests/otel-event-loop-and-logs.test.ts +1 -1
  270. package/src/tests/quickjs-compat.test.ts +40 -4
  271. package/src/tests/rbac-route-verbs-e2e.test.ts +142 -0
  272. package/src/tests/script-connections.test.ts +2 -0
  273. package/src/tests/slack-render-v2.test.ts +52 -8
  274. package/src/tests/workflow-definition-pinning.test.ts +2 -0
  275. package/src/tests/workflow-hitl-routing.test.ts +67 -5
  276. package/src/tests/workflow-replay.test.ts +13 -1
  277. package/src/tests/x402-client.test.ts +82 -0
  278. package/src/tools/memory-rate.ts +2 -2
  279. package/src/tools/prompt-templates/delete.ts +22 -1
  280. package/src/tools/prompt-templates/set.ts +15 -1
  281. package/src/utils/constants.ts +5 -4
  282. package/src/utils/task-citations.ts +11 -0
  283. package/src/workflows/engine.ts +5 -0
  284. package/src/workflows/executors/sub-workflow.ts +5 -7
  285. package/src/workflows/executors/swarm-script.ts +4 -5
  286. package/src/workflows/resume.ts +21 -4
  287. package/src/workflows/run-principal.ts +51 -0
  288. package/src/x402/client.ts +38 -17
  289. package/templates/skills/code-quality/content.md +1 -1
  290. package/templates/skills/pages/content.md +36 -12
  291. package/templates/skills/swarm-docs/content.md +46 -41
  292. package/templates/skills/swarm-scripts/SKILL.md +1 -1
  293. package/templates/skills/swarm-scripts/content.md +1 -1
  294. package/dist/cli-547fsc36.js +0 -15
  295. package/dist/cli-dr6x9qdk.js +0 -15
  296. package/dist/cli-h5cveb69.js +0 -15
  297. package/dist/cli-jngvszex.js +0 -1514
  298. package/dist/cli-p0g0erm9.js +0 -15
  299. package/dist/cli-ph1jce1b.js +0 -16
  300. package/dist/cli-vxxdf2ma.js +0 -15
  301. package/dist/cli-x80zagf5.js +0 -15
  302. package/dist/core-8fw1gwg7.js +0 -41
  303. package/dist/getMachineId-bsd-2rd3pnz7.js +0 -36
  304. package/dist/getMachineId-bsd-3p48mkt1.js +0 -36
  305. package/dist/getMachineId-bsd-bk6tmeen.js +0 -36
  306. package/dist/getMachineId-bsd-pssqgwmm.js +0 -37
  307. package/dist/getMachineId-bsd-v218x3xd.js +0 -36
  308. package/dist/getMachineId-bsd-wbxcazef.js +0 -36
  309. package/dist/getMachineId-bsd-x0942pbz.js +0 -36
  310. package/dist/getMachineId-darwin-5qsy4qcg.js +0 -36
  311. package/dist/getMachineId-darwin-6v7zsshx.js +0 -37
  312. package/dist/getMachineId-darwin-fcc3fjag.js +0 -36
  313. package/dist/getMachineId-darwin-pg84hftj.js +0 -36
  314. package/dist/getMachineId-darwin-tyyevt26.js +0 -36
  315. package/dist/getMachineId-darwin-wagmbf0d.js +0 -36
  316. package/dist/getMachineId-darwin-zvkmwr3y.js +0 -36
  317. package/dist/getMachineId-linux-2ncg1epd.js +0 -29
  318. package/dist/getMachineId-linux-2tmt2ptc.js +0 -29
  319. package/dist/getMachineId-linux-empwyp2y.js +0 -29
  320. package/dist/getMachineId-linux-fanqd45b.js +0 -29
  321. package/dist/getMachineId-linux-h6fyga0x.js +0 -29
  322. package/dist/getMachineId-linux-tbhgz1k9.js +0 -29
  323. package/dist/getMachineId-linux-zrbyw7dt.js +0 -29
  324. package/dist/getMachineId-unsupported-29g9dkgv.js +0 -19
  325. package/dist/getMachineId-unsupported-8xfq8djv.js +0 -19
  326. package/dist/getMachineId-unsupported-8y9cag1p.js +0 -19
  327. package/dist/getMachineId-unsupported-a6sjrm02.js +0 -19
  328. package/dist/getMachineId-unsupported-bp3w7ds0.js +0 -19
  329. package/dist/getMachineId-unsupported-sj6fk8sw.js +0 -19
  330. package/dist/getMachineId-unsupported-v0p5gdxp.js +0 -19
  331. package/dist/getMachineId-win-hc996p0x.js +0 -38
  332. package/dist/getMachineId-win-msq9ad87.js +0 -38
  333. package/dist/getMachineId-win-tajyqwd6.js +0 -38
  334. package/dist/getMachineId-win-tzc163da.js +0 -38
  335. package/dist/getMachineId-win-xdaa0mgq.js +0 -38
  336. package/dist/getMachineId-win-xk6p98m5.js +0 -38
  337. package/dist/getMachineId-win-xtk658fm.js +0 -38
  338. package/dist/handlers-c1jp5b6h.js +0 -39
  339. package/dist/index-7dwh9kxh.js +0 -41
  340. package/dist/index-wp9tarbt.js +0 -43
  341. package/dist/index-z6np2405.js +0 -38
  342. package/dist/lead-50cgn8s1.js +0 -81
  343. package/dist/otel-impl-kepzgm4n.js +0 -55386
  344. package/dist/thread-buffer-8860v1ta.js +0 -40
  345. package/dist/worker-hkm8ftqp.js +0 -81
  346. /package/dist/{node-gbx1t3pa.js → node-q4628t0b.js} +0 -0
@@ -38,21 +38,17 @@ import {
38
38
  createJsonResponseHandler,
39
39
  withoutTrailingSlash,
40
40
  executeTool,
41
- init_dist
42
- } from "./cli-643skca1.js";
41
+ init_dist4
42
+ } from "./cli-swtwbg85.js";
43
43
  import {
44
44
  init_v4
45
45
  } from "./cli-4jjrhy48.js";
46
- import {
47
- SpanStatusCode,
48
- context,
49
- trace,
50
- init_dist5
51
- } from "./cli-0vxbrxr3.js";
52
46
  import {
53
47
  init_zod
54
48
  } from "./cli-96234j5w.js";
55
49
  import {
50
+ NEVER,
51
+ _minLength,
56
52
  string2,
57
53
  number2,
58
54
  boolean,
@@ -72,6 +68,12 @@ import {
72
68
  custom,
73
69
  _instanceof
74
70
  } from "./cli-qrzq3hvg.js";
71
+ import {
72
+ SpanStatusCode,
73
+ context,
74
+ trace,
75
+ init_dist10
76
+ } from "./cli-rwcj6wt3.js";
75
77
  import {
76
78
  __toESM,
77
79
  __commonJS,
@@ -92,7 +94,7 @@ function getErrorMessage2(error) {
92
94
  return JSON.stringify(error);
93
95
  }
94
96
  var marker = "vercel.ai.error", symbol, _a, _b, AISDKError, name = "AI_APICallError", marker2, symbol2, _a2, _b2, APICallError, name2 = "AI_EmptyResponseBodyError", marker3, symbol3, _a3, _b3, EmptyResponseBodyError, name3 = "AI_InvalidArgumentError", marker4, symbol4, _a4, _b4, InvalidArgumentError, name4 = "AI_InvalidPromptError", marker5, symbol5, _a5, _b5, InvalidPromptError, name5 = "AI_InvalidResponseDataError", marker6, symbol6, _a6, _b6, InvalidResponseDataError, name6 = "AI_JSONParseError", marker7, symbol7, _a7, _b7, JSONParseError, name7 = "AI_LoadAPIKeyError", marker8, symbol8, _a8, _b8, LoadAPIKeyError, name8 = "AI_LoadSettingError", marker9, symbol9, _a9, _b9, LoadSettingError, name9 = "AI_NoContentGeneratedError", marker10, symbol10, _a10, _b10, NoContentGeneratedError, name10 = "AI_NoSuchModelError", marker11, symbol11, _a11, _b11, NoSuchModelError, name11 = "AI_TooManyEmbeddingValuesForCallError", marker12, symbol12, _a12, _b12, TooManyEmbeddingValuesForCallError, name12 = "AI_TypeValidationError", marker13, symbol13, _a13, _b13, TypeValidationError, name13 = "AI_UnsupportedFunctionalityError", marker14, symbol14, _a14, _b14, UnsupportedFunctionalityError;
95
- var init_dist2 = __esm(() => {
97
+ var init_dist = __esm(() => {
96
98
  symbol = Symbol.for(marker);
97
99
  AISDKError = class _AISDKError extends (_b = Error, _a = symbol, _b) {
98
100
  constructor({
@@ -1900,56 +1902,56 @@ var import_oidc, import_oidc2, marker15 = "vercel.ai.gateway.error", symbol15, _
1900
1902
  source_name: string2().nullish(),
1901
1903
  publish_date: string2().nullish(),
1902
1904
  content: takoResultContentSchema().nullish()
1903
- }).passthrough(), takoSearchOutputSchema, takoSearchToolFactory, takoSearch = (config = {}) => takoSearchToolFactory(config), gatewayTools, VERSION = "3.0.235", AI_GATEWAY_PROTOCOL_VERSION = "0.0.1", gateway;
1904
- var init_dist3 = __esm(() => {
1905
+ }).passthrough(), takoSearchOutputSchema, takoSearchToolFactory, takoSearch = (config = {}) => takoSearchToolFactory(config), gatewayTools, VERSION = "3.0.236", AI_GATEWAY_PROTOCOL_VERSION = "0.0.1", gateway;
1906
+ var init_dist2 = __esm(() => {
1907
+ init_dist4();
1905
1908
  init_dist();
1906
- init_dist2();
1907
1909
  init_v4();
1908
1910
  init_v4();
1909
- init_dist();
1911
+ init_dist4();
1910
1912
  init_v4();
1911
- init_dist();
1912
- init_dist();
1913
- init_dist();
1913
+ init_dist4();
1914
+ init_dist4();
1915
+ init_dist4();
1914
1916
  init_v4();
1915
- init_dist();
1916
- init_dist();
1917
+ init_dist4();
1918
+ init_dist4();
1917
1919
  init_v4();
1918
- init_dist();
1920
+ init_dist4();
1919
1921
  init_v4();
1920
- init_dist();
1922
+ init_dist4();
1921
1923
  init_v4();
1922
- init_dist();
1924
+ init_dist4();
1923
1925
  init_v4();
1924
- init_dist();
1926
+ init_dist4();
1925
1927
  init_v4();
1926
- init_dist();
1928
+ init_dist4();
1927
1929
  init_v4();
1928
- init_dist2();
1929
1930
  init_dist();
1931
+ init_dist4();
1930
1932
  init_v4();
1931
- init_dist();
1933
+ init_dist4();
1932
1934
  init_v4();
1933
- init_dist();
1935
+ init_dist4();
1934
1936
  init_v4();
1935
- init_dist();
1937
+ init_dist4();
1936
1938
  init_v4();
1937
- init_dist();
1939
+ init_dist4();
1938
1940
  init_zod();
1939
- init_dist();
1941
+ init_dist4();
1940
1942
  init_zod();
1941
- init_dist();
1943
+ init_dist4();
1942
1944
  init_zod();
1943
1945
  init_zod();
1944
- init_dist();
1946
+ init_dist4();
1945
1947
  init_zod();
1946
- init_dist();
1948
+ init_dist4();
1947
1949
  init_zod();
1948
- init_dist();
1950
+ init_dist4();
1949
1951
  init_zod();
1950
- init_dist();
1952
+ init_dist4();
1951
1953
  init_zod();
1952
- init_dist();
1954
+ init_dist4();
1953
1955
  init_zod();
1954
1956
  import_oidc = __toESM(require_dist(), 1);
1955
1957
  import_oidc2 = __toESM(require_dist(), 1);
@@ -2812,7 +2814,7 @@ function isJSONObject(value) {
2812
2814
  return value != null && typeof value === "object" && Object.entries(value).every(([key, val]) => typeof key === "string" && (val === undefined || isJSONValue(val)));
2813
2815
  }
2814
2816
  var marker16 = "vercel.ai.error", symbol16, _a16, _b16, AISDKError2, name15 = "AI_APICallError", marker23, symbol23, _a23, _b23, APICallError2, name23 = "AI_EmptyResponseBodyError", marker33, symbol33, _a33, _b33, EmptyResponseBodyError2, name33 = "AI_InvalidArgumentError", marker43, symbol43, _a43, _b43, InvalidArgumentError2, name43 = "AI_InvalidPromptError", marker53, symbol53, _a53, _b53, InvalidPromptError2, name53 = "AI_InvalidResponseDataError", marker63, symbol63, _a63, _b63, InvalidResponseDataError2, name63 = "AI_JSONParseError", marker73, symbol73, _a73, _b73, JSONParseError2, name73 = "AI_LoadAPIKeyError", marker83, symbol83, _a83, _b83, LoadAPIKeyError2, name83 = "AI_LoadSettingError", marker93, symbol93, _a93, _b93, LoadSettingError2, name93 = "AI_NoContentGeneratedError", marker103, symbol103, _a103, _b103, NoContentGeneratedError2, name102 = "AI_NoSuchModelError", marker112, symbol112, _a112, _b112, NoSuchModelError2, name112 = "AI_TooManyEmbeddingValuesForCallError", marker122, symbol122, _a122, _b122, TooManyEmbeddingValuesForCallError2, name122 = "AI_TypeValidationError", marker132, symbol132, _a132, _b132, TypeValidationError2, name132 = "AI_UnsupportedFunctionalityError", marker142, symbol142, _a142, _b142, UnsupportedFunctionalityError2;
2815
- var init_dist4 = __esm(() => {
2817
+ var init_dist3 = __esm(() => {
2816
2818
  symbol16 = Symbol.for(marker16);
2817
2819
  AISDKError2 = class _AISDKError extends (_b16 = Error, _a16 = symbol16, _b16) {
2818
2820
  constructor({
@@ -6445,6 +6447,71 @@ function createAsyncIterableStream(source) {
6445
6447
  };
6446
6448
  return stream;
6447
6449
  }
6450
+ function findInvalidJsonValuePath(value, path = [], visited = /* @__PURE__ */ new WeakSet) {
6451
+ switch (typeof value) {
6452
+ case "number":
6453
+ return Number.isFinite(value) ? undefined : [...path];
6454
+ case "bigint":
6455
+ case "symbol":
6456
+ case "function":
6457
+ return [...path];
6458
+ case "object": {
6459
+ if (value === null || visited.has(value)) {
6460
+ return;
6461
+ }
6462
+ visited.add(value);
6463
+ const keys = Array.isArray(value) ? value.keys() : Object.keys(value);
6464
+ for (const key of keys) {
6465
+ if (key === "__proto__")
6466
+ continue;
6467
+ path.push(key);
6468
+ const invalidPath = findInvalidJsonValuePath(value[key], path, visited);
6469
+ if (invalidPath != null)
6470
+ return invalidPath;
6471
+ path.pop();
6472
+ }
6473
+ return;
6474
+ }
6475
+ default:
6476
+ return;
6477
+ }
6478
+ }
6479
+ function withJsonValueCheck(schema, jsonValuePath = []) {
6480
+ return unknown().check((context2) => {
6481
+ let jsonValue = context2.value;
6482
+ for (const key of jsonValuePath) {
6483
+ jsonValue = jsonValue != null && typeof jsonValue === "object" ? jsonValue[key] : undefined;
6484
+ }
6485
+ const invalidPath = findInvalidJsonValuePath(jsonValue);
6486
+ if (invalidPath != null) {
6487
+ context2.issues.push({
6488
+ code: "custom",
6489
+ message: "Invalid JSON value. Expected null, a string, a finite number, a boolean, an array, or an object.",
6490
+ input: context2.value,
6491
+ path: [...jsonValuePath, ...invalidPath]
6492
+ });
6493
+ }
6494
+ }).pipe(schema);
6495
+ }
6496
+ function arrayUntilFirstInvalidElement(selectElementSchema) {
6497
+ return array2(unknown()).transform((elements, context2) => {
6498
+ const validatedElements = [];
6499
+ for (const [index, element] of elements.entries()) {
6500
+ const result = selectElementSchema(element).safeParse(element);
6501
+ if (!result.success) {
6502
+ for (const issue of result.error.issues) {
6503
+ context2.issues.push({
6504
+ ...issue,
6505
+ path: [index, ...issue.path]
6506
+ });
6507
+ }
6508
+ return NEVER;
6509
+ }
6510
+ validatedElements.push(result.data);
6511
+ }
6512
+ return validatedElements;
6513
+ });
6514
+ }
6448
6515
  function getOutputStrategy({
6449
6516
  output,
6450
6517
  schema,
@@ -6890,7 +6957,7 @@ var __defProp, __export = (target, all) => {
6890
6957
  }, imageMediaTypeSignatures, DEFAULT_SNIFF_BYTES = 18, MAX_SIGNATURE_BYTES = 12, MAX_ID3_TAG_BYTES, ID3_SCAN_BYTES, stripID3 = (bytes) => {
6891
6958
  const id3Size = (bytes[6] & 127) << 21 | (bytes[7] & 127) << 14 | (bytes[8] & 127) << 7 | bytes[9] & 127;
6892
6959
  return bytes.subarray(id3Size + 10);
6893
- }, VERSION2 = "6.0.330", download = async ({
6960
+ }, VERSION2 = "6.0.331", download = async ({
6894
6961
  url,
6895
6962
  maxBytes,
6896
6963
  abortSignal
@@ -7392,7 +7459,7 @@ var __defProp, __export = (target, all) => {
7392
7459
  }
7393
7460
  return this._output;
7394
7461
  }
7395
- }, JsonToSseTransformStream, toolMetadataSchema, uiMessageChunkSchema, originalGenerateId2, toolMetadataSchema2, uiMessagesSchema, textEncoder, noSchemaOutputStrategy, objectOutputStrategy = (schema) => ({
7462
+ }, JsonToSseTransformStream, toolMetadataSchema, uiMessageChunkSchema, originalGenerateId2, toolMetadataRecordSchema, toolMetadataSchema2, providerMetadataSchema2, uiMessagesSchema, textEncoder, noSchemaOutputStrategy, objectOutputStrategy = (schema) => ({
7396
7463
  type: "object",
7397
7464
  jsonSchema: async () => await schema.jsonSchema,
7398
7465
  async validatePartialResult({ value, textDelta }) {
@@ -7610,67 +7677,67 @@ var __defProp, __export = (target, all) => {
7610
7677
  });
7611
7678
  }
7612
7679
  }, atob, originalGenerateId4, defaultDownload, name222 = "AI_NoSuchProviderError", marker222, symbol222, _a222, defaultDownload2;
7613
- var init_dist6 = __esm(() => {
7614
- init_dist();
7615
- init_dist();
7680
+ var init_dist5 = __esm(() => {
7616
7681
  init_dist4();
7617
7682
  init_dist4();
7683
+ init_dist3();
7684
+ init_dist3();
7685
+ init_dist3();
7686
+ init_dist3();
7687
+ init_dist3();
7688
+ init_dist3();
7689
+ init_dist3();
7690
+ init_dist3();
7691
+ init_dist3();
7692
+ init_dist3();
7693
+ init_dist3();
7694
+ init_dist3();
7695
+ init_dist3();
7696
+ init_dist3();
7697
+ init_dist3();
7698
+ init_dist2();
7618
7699
  init_dist4();
7619
7700
  init_dist4();
7620
7701
  init_dist4();
7702
+ init_dist3();
7621
7703
  init_dist4();
7704
+ init_v4();
7705
+ init_dist3();
7622
7706
  init_dist4();
7707
+ init_dist3();
7623
7708
  init_dist4();
7709
+ init_v4();
7710
+ init_v4();
7711
+ init_v4();
7712
+ init_v4();
7713
+ init_v4();
7714
+ init_dist2();
7715
+ init_dist3();
7716
+ init_dist10();
7717
+ init_dist10();
7718
+ init_dist3();
7719
+ init_dist2();
7624
7720
  init_dist4();
7625
7721
  init_dist4();
7626
7722
  init_dist4();
7627
7723
  init_dist4();
7628
7724
  init_dist4();
7725
+ init_dist3();
7629
7726
  init_dist4();
7630
7727
  init_dist4();
7631
- init_dist3();
7632
- init_dist();
7633
- init_dist();
7634
- init_dist();
7635
7728
  init_dist4();
7636
- init_dist();
7637
- init_v4();
7638
7729
  init_dist4();
7639
- init_dist();
7640
7730
  init_dist4();
7641
- init_dist();
7642
- init_v4();
7643
- init_v4();
7644
- init_v4();
7645
7731
  init_v4();
7732
+ init_dist4();
7733
+ init_dist4();
7646
7734
  init_v4();
7647
- init_dist3();
7648
7735
  init_dist4();
7649
- init_dist5();
7650
- init_dist5();
7736
+ init_dist3();
7651
7737
  init_dist4();
7652
7738
  init_dist3();
7653
- init_dist();
7654
- init_dist();
7655
- init_dist();
7656
- init_dist();
7657
- init_dist();
7658
7739
  init_dist4();
7659
- init_dist();
7660
- init_dist();
7661
- init_dist();
7662
- init_dist();
7663
- init_dist();
7664
- init_v4();
7665
- init_dist();
7666
- init_dist();
7667
- init_v4();
7668
- init_dist();
7669
7740
  init_dist4();
7670
- init_dist();
7671
- init_dist4();
7672
- init_dist();
7673
- init_dist();
7674
7741
  __defProp = Object.defineProperty;
7675
7742
  marker17 = `vercel.ai.error.${name16}`;
7676
7743
  symbol17 = Symbol.for(marker17);
@@ -8491,7 +8558,9 @@ var init_dist6 = __esm(() => {
8491
8558
  prefix: "aitxt",
8492
8559
  size: 24
8493
8560
  });
8494
- toolMetadataSchema2 = record2(string2(), jsonValueSchema.optional());
8561
+ toolMetadataRecordSchema = record2(string2(), jsonValueSchema.optional());
8562
+ toolMetadataSchema2 = withJsonValueCheck(toolMetadataRecordSchema);
8563
+ providerMetadataSchema2 = withJsonValueCheck(providerMetadataSchema);
8495
8564
  uiMessagesSchema = lazySchema(() => {
8496
8565
  const approvalRequestedSchema = object2({
8497
8566
  id: string2(),
@@ -8511,249 +8580,268 @@ var init_dist6 = __esm(() => {
8511
8580
  const approvalDeniedSchema = approvalRespondedSchema.extend({
8512
8581
  approved: literal2(false)
8513
8582
  });
8514
- return zodSchema(array2(object2({
8583
+ const invalidPartTypeMessage = 'Invalid UI message part type. Expected a known part type (for example "text" or "dynamic-tool") or a type starting with "data-" or "tool-".';
8584
+ const staticPartSchema = discriminatedUnion("type", [
8585
+ object2({
8586
+ type: literal2("text"),
8587
+ text: string2(),
8588
+ state: _enum2(["streaming", "done"]).optional(),
8589
+ providerMetadata: providerMetadataSchema2.optional()
8590
+ }),
8591
+ object2({
8592
+ type: literal2("reasoning"),
8593
+ id: string2().optional(),
8594
+ text: string2(),
8595
+ state: _enum2(["streaming", "done"]).optional(),
8596
+ providerMetadata: providerMetadataSchema2.optional()
8597
+ }),
8598
+ object2({
8599
+ type: literal2("source-url"),
8600
+ sourceId: string2(),
8601
+ url: string2(),
8602
+ title: string2().optional(),
8603
+ providerMetadata: providerMetadataSchema2.optional()
8604
+ }),
8605
+ object2({
8606
+ type: literal2("source-document"),
8607
+ sourceId: string2(),
8608
+ mediaType: string2(),
8609
+ title: string2(),
8610
+ filename: string2().optional(),
8611
+ providerMetadata: providerMetadataSchema2.optional()
8612
+ }),
8613
+ object2({
8614
+ type: literal2("file"),
8615
+ mediaType: string2(),
8616
+ filename: string2().optional(),
8617
+ url: string2(),
8618
+ providerMetadata: providerMetadataSchema2.optional()
8619
+ }),
8620
+ object2({
8621
+ type: literal2("step-start")
8622
+ })
8623
+ ], {
8624
+ error: (issue) => issue.code === "invalid_union" ? invalidPartTypeMessage : undefined
8625
+ });
8626
+ const dataPartSchema = object2({
8627
+ type: string2().startsWith("data-"),
8628
+ id: string2().optional(),
8629
+ data: unknown()
8630
+ });
8631
+ const dynamicToolPartSchema = discriminatedUnion("state", [
8632
+ object2({
8633
+ type: literal2("dynamic-tool"),
8634
+ dynamic: literal2(false).optional(),
8635
+ toolName: string2(),
8636
+ toolCallId: string2(),
8637
+ toolMetadata: toolMetadataSchema2.optional(),
8638
+ state: literal2("input-streaming"),
8639
+ input: unknown().optional(),
8640
+ rawInput: string2().optional(),
8641
+ inputEncoding: _enum2(["json", "text"]).optional(),
8642
+ providerExecuted: boolean().optional(),
8643
+ callProviderMetadata: providerMetadataSchema2.optional(),
8644
+ output: never().optional(),
8645
+ errorText: never().optional(),
8646
+ approval: never().optional()
8647
+ }),
8648
+ object2({
8649
+ type: literal2("dynamic-tool"),
8650
+ dynamic: literal2(false).optional(),
8651
+ toolName: string2(),
8652
+ toolCallId: string2(),
8653
+ toolMetadata: toolMetadataSchema2.optional(),
8654
+ state: literal2("input-available"),
8655
+ input: unknown(),
8656
+ providerExecuted: boolean().optional(),
8657
+ output: never().optional(),
8658
+ errorText: never().optional(),
8659
+ callProviderMetadata: providerMetadataSchema2.optional(),
8660
+ approval: never().optional()
8661
+ }),
8662
+ object2({
8663
+ type: literal2("dynamic-tool"),
8664
+ dynamic: literal2(false).optional(),
8665
+ toolName: string2(),
8666
+ toolCallId: string2(),
8667
+ toolMetadata: toolMetadataSchema2.optional(),
8668
+ state: literal2("approval-requested"),
8669
+ input: unknown(),
8670
+ providerExecuted: boolean().optional(),
8671
+ output: never().optional(),
8672
+ errorText: never().optional(),
8673
+ callProviderMetadata: providerMetadataSchema2.optional(),
8674
+ approval: approvalRequestedSchema
8675
+ }),
8676
+ object2({
8677
+ type: literal2("dynamic-tool"),
8678
+ dynamic: literal2(false).optional(),
8679
+ toolName: string2(),
8680
+ toolCallId: string2(),
8681
+ toolMetadata: toolMetadataSchema2.optional(),
8682
+ state: literal2("approval-responded"),
8683
+ input: unknown(),
8684
+ providerExecuted: boolean().optional(),
8685
+ output: never().optional(),
8686
+ errorText: never().optional(),
8687
+ callProviderMetadata: providerMetadataSchema2.optional(),
8688
+ approval: approvalRespondedSchema
8689
+ }),
8690
+ object2({
8691
+ type: literal2("dynamic-tool"),
8692
+ dynamic: literal2(false).optional(),
8693
+ toolName: string2(),
8694
+ toolCallId: string2(),
8695
+ toolMetadata: toolMetadataSchema2.optional(),
8696
+ state: literal2("output-available"),
8697
+ input: unknown(),
8698
+ providerExecuted: boolean().optional(),
8699
+ output: unknown(),
8700
+ errorText: never().optional(),
8701
+ callProviderMetadata: providerMetadataSchema2.optional(),
8702
+ resultProviderMetadata: providerMetadataSchema2.optional(),
8703
+ preliminary: boolean().optional(),
8704
+ approval: approvalGrantedSchema.optional()
8705
+ }),
8706
+ object2({
8707
+ type: literal2("dynamic-tool"),
8708
+ dynamic: literal2(false).optional(),
8709
+ toolName: string2(),
8710
+ toolCallId: string2(),
8711
+ toolMetadata: toolMetadataSchema2.optional(),
8712
+ state: literal2("output-error"),
8713
+ input: unknown().optional(),
8714
+ rawInput: unknown().optional(),
8715
+ providerExecuted: boolean().optional(),
8716
+ output: never().optional(),
8717
+ errorText: string2(),
8718
+ callProviderMetadata: providerMetadataSchema2.optional(),
8719
+ resultProviderMetadata: providerMetadataSchema2.optional(),
8720
+ approval: approvalGrantedSchema.optional()
8721
+ }),
8722
+ object2({
8723
+ type: literal2("dynamic-tool"),
8724
+ dynamic: literal2(false).optional(),
8725
+ toolName: string2(),
8726
+ toolCallId: string2(),
8727
+ toolMetadata: toolMetadataSchema2.optional(),
8728
+ state: literal2("output-denied"),
8729
+ input: unknown(),
8730
+ providerExecuted: boolean().optional(),
8731
+ output: never().optional(),
8732
+ errorText: never().optional(),
8733
+ callProviderMetadata: providerMetadataSchema2.optional(),
8734
+ approval: approvalDeniedSchema
8735
+ })
8736
+ ]);
8737
+ const toolPartSchema = discriminatedUnion("state", [
8738
+ object2({
8739
+ type: string2().startsWith("tool-"),
8740
+ toolCallId: string2(),
8741
+ toolMetadata: toolMetadataSchema2.optional(),
8742
+ state: literal2("input-streaming"),
8743
+ providerExecuted: boolean().optional(),
8744
+ callProviderMetadata: providerMetadataSchema2.optional(),
8745
+ input: unknown().optional(),
8746
+ rawInput: string2().optional(),
8747
+ inputEncoding: _enum2(["json", "text"]).optional(),
8748
+ output: never().optional(),
8749
+ errorText: never().optional(),
8750
+ approval: never().optional()
8751
+ }),
8752
+ object2({
8753
+ type: string2().startsWith("tool-"),
8754
+ toolCallId: string2(),
8755
+ toolMetadata: toolMetadataSchema2.optional(),
8756
+ state: literal2("input-available"),
8757
+ providerExecuted: boolean().optional(),
8758
+ input: unknown(),
8759
+ output: never().optional(),
8760
+ errorText: never().optional(),
8761
+ callProviderMetadata: providerMetadataSchema2.optional(),
8762
+ approval: never().optional()
8763
+ }),
8764
+ object2({
8765
+ type: string2().startsWith("tool-"),
8766
+ toolCallId: string2(),
8767
+ toolMetadata: toolMetadataSchema2.optional(),
8768
+ state: literal2("approval-requested"),
8769
+ input: unknown(),
8770
+ providerExecuted: boolean().optional(),
8771
+ output: never().optional(),
8772
+ errorText: never().optional(),
8773
+ callProviderMetadata: providerMetadataSchema2.optional(),
8774
+ approval: approvalRequestedSchema
8775
+ }),
8776
+ object2({
8777
+ type: string2().startsWith("tool-"),
8778
+ toolCallId: string2(),
8779
+ toolMetadata: toolMetadataSchema2.optional(),
8780
+ state: literal2("approval-responded"),
8781
+ input: unknown(),
8782
+ providerExecuted: boolean().optional(),
8783
+ output: never().optional(),
8784
+ errorText: never().optional(),
8785
+ callProviderMetadata: providerMetadataSchema2.optional(),
8786
+ approval: approvalRespondedSchema
8787
+ }),
8788
+ object2({
8789
+ type: string2().startsWith("tool-"),
8790
+ toolCallId: string2(),
8791
+ toolMetadata: toolMetadataSchema2.optional(),
8792
+ state: literal2("output-available"),
8793
+ providerExecuted: boolean().optional(),
8794
+ input: unknown(),
8795
+ output: unknown(),
8796
+ errorText: never().optional(),
8797
+ callProviderMetadata: providerMetadataSchema2.optional(),
8798
+ resultProviderMetadata: providerMetadataSchema2.optional(),
8799
+ preliminary: boolean().optional(),
8800
+ approval: approvalGrantedSchema.optional()
8801
+ }),
8802
+ object2({
8803
+ type: string2().startsWith("tool-"),
8804
+ toolCallId: string2(),
8805
+ toolMetadata: toolMetadataSchema2.optional(),
8806
+ state: literal2("output-error"),
8807
+ providerExecuted: boolean().optional(),
8808
+ input: unknown().optional(),
8809
+ rawInput: unknown().optional(),
8810
+ output: never().optional(),
8811
+ errorText: string2(),
8812
+ callProviderMetadata: providerMetadataSchema2.optional(),
8813
+ resultProviderMetadata: providerMetadataSchema2.optional(),
8814
+ approval: approvalGrantedSchema.optional()
8815
+ }),
8816
+ object2({
8817
+ type: string2().startsWith("tool-"),
8818
+ toolCallId: string2(),
8819
+ toolMetadata: toolMetadataSchema2.optional(),
8820
+ state: literal2("output-denied"),
8821
+ providerExecuted: boolean().optional(),
8822
+ input: unknown(),
8823
+ output: never().optional(),
8824
+ errorText: never().optional(),
8825
+ callProviderMetadata: providerMetadataSchema2.optional(),
8826
+ approval: approvalDeniedSchema
8827
+ })
8828
+ ]);
8829
+ const messageSchema = object2({
8515
8830
  id: string2(),
8516
8831
  role: _enum2(["system", "user", "assistant"]),
8517
8832
  metadata: unknown().optional(),
8518
- parts: array2(union3([
8519
- object2({
8520
- type: literal2("text"),
8521
- text: string2(),
8522
- state: _enum2(["streaming", "done"]).optional(),
8523
- providerMetadata: providerMetadataSchema.optional()
8524
- }),
8525
- object2({
8526
- type: literal2("reasoning"),
8527
- id: string2().optional(),
8528
- text: string2(),
8529
- state: _enum2(["streaming", "done"]).optional(),
8530
- providerMetadata: providerMetadataSchema.optional()
8531
- }),
8532
- object2({
8533
- type: literal2("source-url"),
8534
- sourceId: string2(),
8535
- url: string2(),
8536
- title: string2().optional(),
8537
- providerMetadata: providerMetadataSchema.optional()
8538
- }),
8539
- object2({
8540
- type: literal2("source-document"),
8541
- sourceId: string2(),
8542
- mediaType: string2(),
8543
- title: string2(),
8544
- filename: string2().optional(),
8545
- providerMetadata: providerMetadataSchema.optional()
8546
- }),
8547
- object2({
8548
- type: literal2("file"),
8549
- mediaType: string2(),
8550
- filename: string2().optional(),
8551
- url: string2(),
8552
- providerMetadata: providerMetadataSchema.optional()
8553
- }),
8554
- object2({
8555
- type: literal2("step-start")
8556
- }),
8557
- object2({
8558
- type: string2().startsWith("data-"),
8559
- id: string2().optional(),
8560
- data: unknown()
8561
- }),
8562
- object2({
8563
- type: literal2("dynamic-tool"),
8564
- dynamic: literal2(false).optional(),
8565
- toolName: string2(),
8566
- toolCallId: string2(),
8567
- toolMetadata: toolMetadataSchema2.optional(),
8568
- state: literal2("input-streaming"),
8569
- input: unknown().optional(),
8570
- rawInput: string2().optional(),
8571
- inputEncoding: _enum2(["json", "text"]).optional(),
8572
- providerExecuted: boolean().optional(),
8573
- callProviderMetadata: providerMetadataSchema.optional(),
8574
- output: never().optional(),
8575
- errorText: never().optional(),
8576
- approval: never().optional()
8577
- }),
8578
- object2({
8579
- type: literal2("dynamic-tool"),
8580
- dynamic: literal2(false).optional(),
8581
- toolName: string2(),
8582
- toolCallId: string2(),
8583
- toolMetadata: toolMetadataSchema2.optional(),
8584
- state: literal2("input-available"),
8585
- input: unknown(),
8586
- providerExecuted: boolean().optional(),
8587
- output: never().optional(),
8588
- errorText: never().optional(),
8589
- callProviderMetadata: providerMetadataSchema.optional(),
8590
- approval: never().optional()
8591
- }),
8592
- object2({
8593
- type: literal2("dynamic-tool"),
8594
- dynamic: literal2(false).optional(),
8595
- toolName: string2(),
8596
- toolCallId: string2(),
8597
- toolMetadata: toolMetadataSchema2.optional(),
8598
- state: literal2("approval-requested"),
8599
- input: unknown(),
8600
- providerExecuted: boolean().optional(),
8601
- output: never().optional(),
8602
- errorText: never().optional(),
8603
- callProviderMetadata: providerMetadataSchema.optional(),
8604
- approval: approvalRequestedSchema
8605
- }),
8606
- object2({
8607
- type: literal2("dynamic-tool"),
8608
- dynamic: literal2(false).optional(),
8609
- toolName: string2(),
8610
- toolCallId: string2(),
8611
- toolMetadata: toolMetadataSchema2.optional(),
8612
- state: literal2("approval-responded"),
8613
- input: unknown(),
8614
- providerExecuted: boolean().optional(),
8615
- output: never().optional(),
8616
- errorText: never().optional(),
8617
- callProviderMetadata: providerMetadataSchema.optional(),
8618
- approval: approvalRespondedSchema
8619
- }),
8620
- object2({
8621
- type: literal2("dynamic-tool"),
8622
- dynamic: literal2(false).optional(),
8623
- toolName: string2(),
8624
- toolCallId: string2(),
8625
- toolMetadata: toolMetadataSchema2.optional(),
8626
- state: literal2("output-available"),
8627
- input: unknown(),
8628
- providerExecuted: boolean().optional(),
8629
- output: unknown(),
8630
- errorText: never().optional(),
8631
- callProviderMetadata: providerMetadataSchema.optional(),
8632
- resultProviderMetadata: providerMetadataSchema.optional(),
8633
- preliminary: boolean().optional(),
8634
- approval: approvalGrantedSchema.optional()
8635
- }),
8636
- object2({
8637
- type: literal2("dynamic-tool"),
8638
- dynamic: literal2(false).optional(),
8639
- toolName: string2(),
8640
- toolCallId: string2(),
8641
- toolMetadata: toolMetadataSchema2.optional(),
8642
- state: literal2("output-error"),
8643
- input: unknown().optional(),
8644
- rawInput: unknown().optional(),
8645
- providerExecuted: boolean().optional(),
8646
- output: never().optional(),
8647
- errorText: string2(),
8648
- callProviderMetadata: providerMetadataSchema.optional(),
8649
- resultProviderMetadata: providerMetadataSchema.optional(),
8650
- approval: approvalGrantedSchema.optional()
8651
- }),
8652
- object2({
8653
- type: literal2("dynamic-tool"),
8654
- dynamic: literal2(false).optional(),
8655
- toolName: string2(),
8656
- toolCallId: string2(),
8657
- toolMetadata: toolMetadataSchema2.optional(),
8658
- state: literal2("output-denied"),
8659
- input: unknown(),
8660
- providerExecuted: boolean().optional(),
8661
- output: never().optional(),
8662
- errorText: never().optional(),
8663
- callProviderMetadata: providerMetadataSchema.optional(),
8664
- approval: approvalDeniedSchema
8665
- }),
8666
- object2({
8667
- type: string2().startsWith("tool-"),
8668
- toolCallId: string2(),
8669
- toolMetadata: toolMetadataSchema2.optional(),
8670
- state: literal2("input-streaming"),
8671
- providerExecuted: boolean().optional(),
8672
- callProviderMetadata: providerMetadataSchema.optional(),
8673
- input: unknown().optional(),
8674
- rawInput: string2().optional(),
8675
- inputEncoding: _enum2(["json", "text"]).optional(),
8676
- output: never().optional(),
8677
- errorText: never().optional(),
8678
- approval: never().optional()
8679
- }),
8680
- object2({
8681
- type: string2().startsWith("tool-"),
8682
- toolCallId: string2(),
8683
- toolMetadata: toolMetadataSchema2.optional(),
8684
- state: literal2("input-available"),
8685
- providerExecuted: boolean().optional(),
8686
- input: unknown(),
8687
- output: never().optional(),
8688
- errorText: never().optional(),
8689
- callProviderMetadata: providerMetadataSchema.optional(),
8690
- approval: never().optional()
8691
- }),
8692
- object2({
8693
- type: string2().startsWith("tool-"),
8694
- toolCallId: string2(),
8695
- toolMetadata: toolMetadataSchema2.optional(),
8696
- state: literal2("approval-requested"),
8697
- input: unknown(),
8698
- providerExecuted: boolean().optional(),
8699
- output: never().optional(),
8700
- errorText: never().optional(),
8701
- callProviderMetadata: providerMetadataSchema.optional(),
8702
- approval: approvalRequestedSchema
8703
- }),
8704
- object2({
8705
- type: string2().startsWith("tool-"),
8706
- toolCallId: string2(),
8707
- toolMetadata: toolMetadataSchema2.optional(),
8708
- state: literal2("approval-responded"),
8709
- input: unknown(),
8710
- providerExecuted: boolean().optional(),
8711
- output: never().optional(),
8712
- errorText: never().optional(),
8713
- callProviderMetadata: providerMetadataSchema.optional(),
8714
- approval: approvalRespondedSchema
8715
- }),
8716
- object2({
8717
- type: string2().startsWith("tool-"),
8718
- toolCallId: string2(),
8719
- toolMetadata: toolMetadataSchema2.optional(),
8720
- state: literal2("output-available"),
8721
- providerExecuted: boolean().optional(),
8722
- input: unknown(),
8723
- output: unknown(),
8724
- errorText: never().optional(),
8725
- callProviderMetadata: providerMetadataSchema.optional(),
8726
- resultProviderMetadata: providerMetadataSchema.optional(),
8727
- preliminary: boolean().optional(),
8728
- approval: approvalGrantedSchema.optional()
8729
- }),
8730
- object2({
8731
- type: string2().startsWith("tool-"),
8732
- toolCallId: string2(),
8733
- toolMetadata: toolMetadataSchema2.optional(),
8734
- state: literal2("output-error"),
8735
- providerExecuted: boolean().optional(),
8736
- input: unknown().optional(),
8737
- rawInput: unknown().optional(),
8738
- output: never().optional(),
8739
- errorText: string2(),
8740
- callProviderMetadata: providerMetadataSchema.optional(),
8741
- resultProviderMetadata: providerMetadataSchema.optional(),
8742
- approval: approvalGrantedSchema.optional()
8743
- }),
8744
- object2({
8745
- type: string2().startsWith("tool-"),
8746
- toolCallId: string2(),
8747
- toolMetadata: toolMetadataSchema2.optional(),
8748
- state: literal2("output-denied"),
8749
- providerExecuted: boolean().optional(),
8750
- input: unknown(),
8751
- output: never().optional(),
8752
- errorText: never().optional(),
8753
- callProviderMetadata: providerMetadataSchema.optional(),
8754
- approval: approvalDeniedSchema
8755
- })
8756
- ]))
8833
+ parts: arrayUntilFirstInvalidElement((part) => {
8834
+ const type = part == null ? undefined : part.type;
8835
+ if (typeof type === "string") {
8836
+ if (type.startsWith("data-"))
8837
+ return dataPartSchema;
8838
+ if (type.startsWith("tool-"))
8839
+ return toolPartSchema;
8840
+ if (type === "dynamic-tool")
8841
+ return dynamicToolPartSchema;
8842
+ }
8843
+ return staticPartSchema;
8844
+ })
8757
8845
  }).superRefine((message, context2) => {
8758
8846
  if (message.role !== "assistant" && message.parts.length === 0) {
8759
8847
  context2.addIssue({
@@ -8766,7 +8854,8 @@ var init_dist6 = __esm(() => {
8766
8854
  message: "Message must contain at least one part"
8767
8855
  });
8768
8856
  }
8769
- })).nonempty("Messages array must not be empty"));
8857
+ });
8858
+ return zodSchema(arrayUntilFirstInvalidElement(() => messageSchema).check(_minLength(1, "Messages array must not be empty")));
8770
8859
  });
8771
8860
  textEncoder = new TextEncoder;
8772
8861
  noSchemaOutputStrategy = {
@@ -8804,7 +8893,7 @@ var init_dist6 = __esm(() => {
8804
8893
  _a222 = symbol222;
8805
8894
  defaultDownload2 = createDownload();
8806
8895
  });
8807
- init_dist6();
8896
+ init_dist5();
8808
8897
 
8809
8898
  export {
8810
8899
  generateObject,