@desplega.ai/agent-swarm 2.13.0 → 2.13.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 (306) hide show
  1. package/README.md +1 -1
  2. package/dist/acp-adapter-x1qqgzwx.js +17 -0
  3. package/dist/{acp-targets-86f0sh6g.js → acp-targets-mz8c5dnt.js} +10 -10
  4. package/dist/{actions-zv8vcxvr.js → actions-5ft3qp5a.js} +27 -27
  5. package/dist/{agent-fs-provision-jqshb33y.js → agent-fs-provision-6fgz7wvz.js} +4 -4
  6. package/dist/{amp-adapter-gt503ywc.js → amp-adapter-nthn8ezm.js} +3 -3
  7. package/dist/{app-6t4k5rh1.js → app-535m78qw.js} +10 -10
  8. package/dist/{approval-notifications-fcfw063h.js → approval-notifications-dewbk403.js} +11 -11
  9. package/dist/{assistant-9dzybh12.js → assistant-39zyabv2.js} +28 -28
  10. package/dist/{boot-args-schema-xzfp2feg.js → boot-args-schema-bqv5bf77.js} +1 -1
  11. package/dist/{boot-reembed-3jz0p2jk.js → boot-reembed-157c0gcz.js} +1 -1
  12. package/dist/{boot-reembed-r88wngfg.js → boot-reembed-fas7z3zn.js} +1 -1
  13. package/dist/{boot-scrub-sweep-scrqhw48.js → boot-scrub-sweep-tmec0be2.js} +2 -2
  14. package/dist/{boot-seeds-vb2dcrrb.js → boot-seeds-32zm50x2.js} +4 -4
  15. package/dist/{boxd-68n75y1s.js → boxd-hr8rsxzq.js} +1 -1
  16. package/dist/{claude-adapter-h3mp9hgs.js → claude-adapter-gwq7x2nj.js} +9 -9
  17. package/dist/{claude-managed-adapter-kpbyj2vb.js → claude-managed-adapter-rkvw6fvq.js} +4 -4
  18. package/dist/{claude-managed-setup-0efr3wkg.js → claude-managed-setup-0vgz4d1j.js} +6 -6
  19. package/dist/{claude-sdk-session-03dw669q.js → claude-sdk-session-5wbwxy8c.js} +20967 -19390
  20. package/dist/{cli-z64t9pe6.js → cli-0f7n3td3.js} +1 -1
  21. package/dist/{cli-j53hpbsm.js → cli-0xwb7zpt.js} +2 -2
  22. package/dist/{cli-wxwv3t11.js → cli-1f48qdnb.js} +55 -13
  23. package/dist/{cli-gfcv679k.js → cli-1gevjrc1.js} +1 -1
  24. package/dist/{cli-0jkenasr.js → cli-2v4xxnx2.js} +1 -1
  25. package/dist/{cli-hc6e4tac.js → cli-2wde56gv.js} +6 -6
  26. package/dist/{cli-mh7pdxe0.js → cli-31vt7baf.js} +17 -17
  27. package/dist/{cli-ercwc8xn.js → cli-3mf04tkh.js} +1 -1
  28. package/dist/{cli-s6zk31gr.js → cli-43dsqhcp.js} +4 -4
  29. package/dist/{cli-1dbv9mj9.js → cli-4djg31jh.js} +1 -1
  30. package/dist/{cli-tn91wc6e.js → cli-50whymxq.js} +1 -1
  31. package/dist/{cli-js10kdk7.js → cli-5basv0e7.js} +19 -5
  32. package/dist/{cli-b2jh3dyb.js → cli-5k1hvycs.js} +4 -4
  33. package/dist/{cli-dkejt425.js → cli-62fjschk.js} +7 -7
  34. package/dist/{cli-zqmmy073.js → cli-69eq6gdk.js} +18 -18
  35. package/dist/{cli-qm3ntjqs.js → cli-6rmryz03.js} +13 -13
  36. package/dist/{cli-mz34pxbk.js → cli-7m6bbtab.js} +11 -11
  37. package/dist/{cli-wv20kbr3.js → cli-8a4qg44m.js} +5 -5
  38. package/dist/{cli-2m6yaq6b.js → cli-8fj8yfmk.js} +1 -1
  39. package/dist/{cli-9m9kyw77.js → cli-8qvte9hn.js} +2 -2
  40. package/dist/{cli-x05p2d05.js → cli-9tevdxyf.js} +1 -1
  41. package/dist/{cli-qec9bynj.js → cli-a6rzw649.js} +3 -3
  42. package/dist/{cli-ex1y88j3.js → cli-at67kvnp.js} +1 -1
  43. package/dist/{cli-yn4kt85g.js → cli-b0kqw55g.js} +1 -1
  44. package/dist/{cli-n3qe7tyr.js → cli-b0m3bg0f.js} +134 -3
  45. package/dist/{cli-xfjn2kyq.js → cli-bp2rt28p.js} +9 -9
  46. package/dist/{cli-2jk4s7z1.js → cli-c9bwawf9.js} +3 -3
  47. package/dist/{cli-wndegmns.js → cli-cmgdptmx.js} +3 -3
  48. package/dist/{cli-3p288654.js → cli-cpkxh68d.js} +2 -2
  49. package/dist/{cli-117g15t4.js → cli-cs26ed89.js} +8 -8
  50. package/dist/{cli-prf7kz78.js → cli-d0jb2qnt.js} +603 -78
  51. package/dist/{cli-8hp56wat.js → cli-d2epqm0y.js} +1 -1
  52. package/dist/{cli-wrhbym01.js → cli-d528acsw.js} +6 -6
  53. package/dist/{cli-tstj6e8e.js → cli-dnvmwsvc.js} +310 -88
  54. package/dist/{cli-9fsagra4.js → cli-e87fg3en.js} +1 -1
  55. package/dist/{cli-jj3c5nyb.js → cli-erh1rgh4.js} +116 -56
  56. package/dist/{cli-f1952kjy.js → cli-ewb028rs.js} +4 -4
  57. package/dist/{cli-ct8sz3np.js → cli-f1sdh8ca.js} +6 -6
  58. package/dist/{cli-0b655smz.js → cli-fcwrd7bh.js} +5 -5
  59. package/dist/{cli-eb279wn3.js → cli-fgm2mad9.js} +2 -2
  60. package/dist/{cli-bpje8n65.js → cli-fp65jdp2.js} +31 -6
  61. package/dist/{cli-dnh64e8e.js → cli-g0b3ma7r.js} +7 -7
  62. package/dist/{cli-avxh26pd.js → cli-gc7jkf4a.js} +4 -4
  63. package/dist/{cli-2skf1mdf.js → cli-gedf48yw.js} +4 -4
  64. package/dist/{cli-ajjvqhf3.js → cli-getrvmtx.js} +27 -6
  65. package/dist/{cli-c8v2yvej.js → cli-gq6qhmrr.js} +2 -2
  66. package/dist/{cli-mbwmqb5w.js → cli-h0ewec3d.js} +1 -1
  67. package/dist/{cli-tdk7jtka.js → cli-hv3820ez.js} +1 -1
  68. package/dist/{cli-avqkr20b.js → cli-j2ybkdk2.js} +2 -2
  69. package/dist/{cli-pqfecppn.js → cli-je587f74.js} +1 -1
  70. package/dist/{cli-hgsxnjyg.js → cli-jkkcm72j.js} +13 -13
  71. package/dist/{cli-g6j6ac3h.js → cli-ka13xx6b.js} +2 -2
  72. package/dist/{cli-t35hx078.js → cli-m1wddksc.js} +2 -2
  73. package/dist/{cli-50w82h6m.js → cli-mwxez0pz.js} +1 -0
  74. package/dist/{cli-nc6a8b5b.js → cli-n14r8h4n.js} +2 -2
  75. package/dist/{cli-y4a4458j.js → cli-n46d87mj.js} +3 -3
  76. package/dist/{cli-0dg7ytxm.js → cli-nkfv398a.js} +1096 -75
  77. package/dist/{cli-fhvk2nvp.js → cli-nvqq3232.js} +9 -9
  78. package/dist/{cli-bhgrhedp.js → cli-q8aq48v1.js} +1 -1
  79. package/dist/{cli-6a40p4kv.js → cli-qn79645p.js} +1 -1
  80. package/dist/{cli-hbq0kwxz.js → cli-r4fphq38.js} +4 -4
  81. package/dist/{cli-47hz21se.js → cli-r8ddn0hf.js} +4 -5
  82. package/dist/{cli-hpb9x72z.js → cli-rvhaahfv.js} +9 -9
  83. package/dist/{cli-qhhb30e8.js → cli-s08zsqva.js} +9 -9
  84. package/dist/{cli-sdh61g52.js → cli-s6fhqbz1.js} +2 -2
  85. package/dist/{cli-y518qkjg.js → cli-sjk85d7v.js} +13 -12
  86. package/dist/{cli-ytc7fpza.js → cli-t25rq8mg.js} +4 -4
  87. package/dist/{cli-sq913bh1.js → cli-t9nxq30h.js} +8 -8
  88. package/dist/{cli-49f5jyhh.js → cli-tbdw3f92.js} +3 -3
  89. package/dist/{cli-1v82d2w6.js → cli-tceqvv6h.js} +4 -4
  90. package/dist/{cli-fz9pcjsw.js → cli-tgmate57.js} +4 -4
  91. package/dist/{cli-rtmqzat7.js → cli-vdfngx2g.js} +2 -2
  92. package/dist/{cli-9w8712tq.js → cli-vr4eyq6p.js} +43 -14
  93. package/dist/{cli-z4f346g5.js → cli-vx9acp12.js} +1 -1
  94. package/dist/{cli-7dbhnsj9.js → cli-wdtqkqnq.js} +4 -4
  95. package/dist/{cli-kde4ky90.js → cli-x5yb8zc8.js} +2 -2
  96. package/dist/{cli-w14j2z4k.js → cli-x7aqhxj5.js} +2 -2
  97. package/dist/{cli-kspxjftk.js → cli-xerdrnqs.js} +15 -6
  98. package/dist/{cli-48nvk6sb.js → cli-xhkek467.js} +2 -2
  99. package/dist/{cli-dka73bak.js → cli-xysy1g8x.js} +152 -12
  100. package/dist/{cli-7wy8gbwb.js → cli-ya1cj689.js} +1 -1
  101. package/dist/{cli-n85m2wkq.js → cli-zkbz8m2q.js} +3 -2
  102. package/dist/{cli-0pazkmd4.js → cli-zm6bkx3e.js} +4 -4
  103. package/dist/{cli-6h88mn9q.js → cli-zqy28rwx.js} +4 -4
  104. package/dist/cli.js +30 -29
  105. package/dist/{codex-adapter-f3yp0kaj.js → codex-adapter-x25xfbnh.js} +8 -8
  106. package/dist/{codex-hook-262cekfp.js → codex-hook-c0nvm30r.js} +2 -2
  107. package/dist/{codex-login-1ven7yje.js → codex-login-ven5cz5j.js} +1 -1
  108. package/dist/{codex-session-runner-ns4mv70p.js → codex-session-runner-kn5xnrvp.js} +9 -9
  109. package/dist/{commands-5bzf2tfw.js → commands-8n59gxmy.js} +3 -3
  110. package/dist/{controller-5xt7kvfm.js → controller-wn3vd217.js} +3 -3
  111. package/dist/{controllers-connect-0gg13mzp.js → controllers-connect-09gvkrhc.js} +28 -28
  112. package/dist/core-2b8bv6ny.js +42 -0
  113. package/dist/{cursor-adapter-p0c5zv6r.js → cursor-adapter-w1681kp1.js} +2 -2
  114. package/dist/{db-2s68ycq7.js → db-e71keqxk.js} +3 -3
  115. package/dist/{db-q7q639k5.js → db-spg81qtr.js} +2 -2
  116. package/dist/{devin-adapter-t8d86q9x.js → devin-adapter-fs90ab4v.js} +1 -1
  117. package/dist/{dispatcher-j2y1q7ae.js → dispatcher-fr4vawwb.js} +25 -25
  118. package/dist/{docker-1b41eysj.js → docker-1h33jvh9.js} +2 -2
  119. package/dist/{dsh-adapter-pgnkf4st.js → dsh-adapter-g9yqv09y.js} +2 -2
  120. package/dist/{e2b-xm60c8ad.js → e2b-jnk0yeva.js} +2 -2
  121. package/dist/{e2b-ew8c5j5v.js → e2b-y7e5kmzf.js} +2 -2
  122. package/dist/{easter-egg-3d-0kea97jf.js → easter-egg-3d-ac9tv9a6.js} +1 -1
  123. package/dist/{embedding-space-3n6mhhmy.js → embedding-space-an77f45k.js} +6 -6
  124. package/dist/{embeddings-jfmj6yme.js → embeddings-jkrehejr.js} +1 -1
  125. package/dist/{event-bus-v4ywhc2p.js → event-bus-08t2b4y2.js} +1 -1
  126. package/dist/{execute-tjrej979.js → execute-3mys4nta.js} +1 -1
  127. package/dist/{external-channel-jy8w2gg3.js → external-channel-s6zxpts9.js} +2 -2
  128. package/dist/fx-adapter-4yet1c4f.js +20 -0
  129. package/dist/grok-adapter-8ge6tw7m.js +20 -0
  130. package/dist/handlers-0r9evrdj.js +41 -0
  131. package/dist/heartbeat-jjpb44e5.js +50 -0
  132. package/dist/{hook-fv1jwrv7.js → hook-68gbs87k.js} +6 -6
  133. package/dist/{hook-bpnncsec.js → hook-y6n23zzj.js} +8 -8
  134. package/dist/{http-bpa26czn.js → http-8c6y008s.js} +404 -146
  135. package/dist/{index-w216g9y9.js → index-0vthtbc2.js} +38 -22
  136. package/dist/index-1v23363p.js +39 -0
  137. package/dist/index-30qw6vyw.js +44 -0
  138. package/dist/index-6bm3w6cn.js +40 -0
  139. package/dist/{index-s8re7mvq.js → index-6h3r0vpe.js} +1 -1
  140. package/dist/{index-620y7jzq.js → index-7dgxveck.js} +3 -3
  141. package/dist/{index-4k7m5dgj.js → index-maddg9ys.js} +143 -103
  142. package/dist/{index-0h6qd4p1.js → index-mbpxhc4w.js} +3 -4
  143. package/dist/index-rz8ve510.js +569 -0
  144. package/dist/{index-mpj0z9e0.js → index-we3nd2t0.js} +1 -1
  145. package/dist/{index-pe3d8jfy.js → index-whysn1wf.js} +1 -1
  146. package/dist/{index-52tgbhrw.js → index-xcw7hjt5.js} +28 -28
  147. package/dist/{index-8p0j4h4j.js → index-ym9fgxad.js} +94 -89
  148. package/dist/{k8s-fy8hbhkg.js → k8s-8326q0rq.js} +2 -2
  149. package/dist/{keepalive-d6z12s04.js → keepalive-7e9r5dvp.js} +5 -4
  150. package/dist/lead-3jpc7kcr.js +79 -0
  151. package/dist/{maintenance-7kac6g2g.js → maintenance-d3erjvcg.js} +1 -1
  152. package/dist/{oauth-refresh-sweep-t1xjetbh.js → oauth-refresh-sweep-0qh70988.js} +4 -3
  153. package/dist/{object-webhooks-6rdagg0r.js → object-webhooks-ac7v2q5p.js} +7 -7
  154. package/dist/{onboard-32y1cfxy.js → onboard-5yphtken.js} +4 -4
  155. package/dist/{opencode-adapter-enp3v31n.js → opencode-adapter-0xvyba4m.js} +8 -8
  156. package/dist/{otel-impl-k0tm5ptj.js → otel-impl-svqp691q.js} +2 -2
  157. package/dist/{pending-24zebgvs.js → pending-bn4xe5br.js} +26 -26
  158. package/dist/{pi-mono-adapter-yj72xxxe.js → pi-mono-adapter-763s8a3w.js} +20 -18
  159. package/dist/{pricing-refresh-cf25x38j.js → pricing-refresh-kfc215mf.js} +2 -2
  160. package/dist/{rbac-roles-0wydd22m.js → rbac-roles-3bznvkpt.js} +3 -3
  161. package/dist/{rbac-roles-at6crb3r.js → rbac-roles-6r4h2ghj.js} +2 -2
  162. package/dist/{render-v2-nvcw0jd7.js → render-v2-f3qedbpy.js} +10 -10
  163. package/dist/{resume-y4w0k5v3.js → resume-vcag4ann.js} +13 -13
  164. package/dist/{runtime-vpe43hx0.js → runtime-x0s55z2t.js} +1 -1
  165. package/dist/{session-access-gkyvnfye.js → session-access-nwzve8q2.js} +5 -5
  166. package/dist/{session-source-backfill-3w2st4m2.js → session-source-backfill-jpqfzmgz.js} +2 -2
  167. package/dist/{setup-axxvqtys.js → setup-d2smwaem.js} +1 -1
  168. package/dist/thread-buffer-8fc703jc.js +42 -0
  169. package/dist/{tree-visibility-y4fqvab5.js → tree-visibility-dwzc8en0.js} +2 -2
  170. package/dist/{user-merge-jobs-kcmwvrc6.js → user-merge-jobs-4ce7kma2.js} +3 -3
  171. package/dist/{virtual-modules-7d92dct1.js → virtual-modules-78a6yw71.js} +3 -3
  172. package/dist/{work-objects-f708e069.js → work-objects-m0w1e7q8.js} +28 -28
  173. package/dist/worker-3p2vq107.js +79 -0
  174. package/dist/{worker-follow-up-0by8wztc.js → worker-follow-up-e3t6f895.js} +25 -25
  175. package/dist/{x-3dtaf2r9.js → x-asbrnafg.js} +2 -2
  176. package/openapi.json +1795 -1623
  177. package/package.json +13 -12
  178. package/src/apps/catalog.generated.json +726 -0
  179. package/src/apps/definition.ts +24 -7
  180. package/src/apps/page-validator.ts +225 -3
  181. package/src/be/db.ts +38 -10
  182. package/src/be/mcp-proxy.ts +5 -4
  183. package/src/be/migrations/340_api_key_spend_cap.sql +5 -0
  184. package/src/be/migrations/341_user_token_expiry.sql +4 -0
  185. package/src/be/schedules/validate.ts +26 -0
  186. package/src/be/scripts/run-credential.ts +55 -1
  187. package/src/be/scripts/typecheck.ts +4 -4
  188. package/src/be/scripts/user-code-mode.ts +160 -0
  189. package/src/be/swarm-config-guard.ts +4 -0
  190. package/src/be/users.ts +48 -7
  191. package/src/commands/credential-outcome-report.ts +5 -2
  192. package/src/commands/onboard/agent-fs-version.ts +1 -1
  193. package/src/commands/provider-credentials.ts +19 -0
  194. package/src/commands/provider-error-class.ts +4 -1
  195. package/src/commands/rate-limit-outcome.ts +48 -3
  196. package/src/commands/runner.ts +113 -55
  197. package/src/commands/worktree-reaper.ts +600 -0
  198. package/src/extensions/contract-types.generated.ts +1 -1
  199. package/src/http/agents.ts +4 -0
  200. package/src/http/api-keys.ts +27 -3
  201. package/src/http/pages-public.ts +40 -4
  202. package/src/http/pool-keys.ts +21 -2
  203. package/src/http/schedules.ts +28 -3
  204. package/src/http/script-connection-proxy.ts +18 -6
  205. package/src/http/script-connections.ts +12 -4
  206. package/src/http/script-runs.ts +12 -3
  207. package/src/http/scripts.ts +2 -11
  208. package/src/http/tasks.ts +6 -10
  209. package/src/http/users.ts +1 -0
  210. package/src/integrations/chat-sdk/adapters.ts +29 -0
  211. package/src/integrations/chat-sdk/limits.ts +3 -0
  212. package/src/integrations/chat-sdk/rocketchat/README.md +8 -0
  213. package/src/integrations/chat-sdk/rocketchat/index.ts +790 -0
  214. package/src/integrations/chat-sdk/rocketchat/markdown.ts +210 -0
  215. package/src/integrations/chat-sdk/rocketchat/types.ts +249 -0
  216. package/src/integrations/chat-sdk/runtime.ts +11 -5
  217. package/src/integrations/chat-sdk/schema.ts +37 -3
  218. package/src/integrations/chat-sdk/status.ts +9 -0
  219. package/src/mcp-client/http-client.ts +3 -1
  220. package/src/oauth/identity-capture.ts +6 -1
  221. package/src/oauth/mcp-wrapper.ts +10 -3
  222. package/src/oauth/wrapper.ts +15 -3
  223. package/src/prompts/session-templates.ts +1 -0
  224. package/src/providers/acp-targets.ts +2 -2
  225. package/src/providers/amp-adapter.ts +1 -1
  226. package/src/providers/dsh-adapter.ts +1 -1
  227. package/src/providers/pi-mono-adapter.ts +4 -2
  228. package/src/providers/runtime-dependencies.ts +1 -1
  229. package/src/rbac/legacy-policy.ts +3 -0
  230. package/src/rbac/permissions.ts +9 -0
  231. package/src/scripts-runtime/executors/native.ts +225 -67
  232. package/src/scripts-runtime/mcp-client.ts +2 -1
  233. package/src/scripts-runtime/swarm-sdk.ts +2 -1
  234. package/src/scripts-runtime/types/stdlib.d.ts +4 -4
  235. package/src/scripts-runtime/types/swarm-extension.d.ts +7 -7
  236. package/src/scripts-runtime/types/swarm-sdk.d.ts +4 -4
  237. package/src/server-user.ts +98 -0
  238. package/src/slack/enrich.ts +14 -11
  239. package/src/tests/agents-list-model-display.test.ts +23 -0
  240. package/src/tests/apps-spike2.test.ts +35 -0
  241. package/src/tests/base-prompt.test.ts +1 -0
  242. package/src/tests/chat-sdk-rocketchat-vendored.test.ts +67 -0
  243. package/src/tests/chat-sdk-status-route.test.ts +13 -1
  244. package/src/tests/codex-app-server.test.ts +4 -6
  245. package/src/tests/deploy-guard.test.ts +24 -0
  246. package/src/tests/dsh-adapter.test.ts +1 -1
  247. package/src/tests/ensure-token.test.ts +2 -2
  248. package/src/tests/entrypoint-repo-autoclone-args.test.ts +202 -0
  249. package/src/tests/fake-dns.ts +47 -0
  250. package/src/tests/fixtures/base-prompt-baseline.json +12 -12
  251. package/src/tests/latest-model-report.test.ts +138 -0
  252. package/src/tests/mcp-oauth-dcr-reuse.test.ts +5 -2
  253. package/src/tests/mcp-oauth-ensure-token.test.ts +3 -2
  254. package/src/tests/mcp-oauth-manual-client.test.ts +6 -1
  255. package/src/tests/mcp-oauth-wrapper.test.ts +20 -4
  256. package/src/tests/mcp-outbound-fetch-guard.test.ts +169 -0
  257. package/src/tests/mcp-server-ssrf.test.ts +2 -0
  258. package/src/tests/mcp-user-route.test.ts +10 -1
  259. package/src/tests/memory-search-stall.test.ts +5 -0
  260. package/src/tests/oauth-connection-fetch-guard.test.ts +162 -0
  261. package/src/tests/oauth-token-endpoint-fetch-guard.test.ts +121 -0
  262. package/src/tests/oauth-wrapper.test.ts +1 -2
  263. package/src/tests/pages-head-v2.test.ts +2 -1
  264. package/src/tests/script-connections-http.test.ts +8 -3
  265. package/src/tests/script-connections-mcp.test.ts +14 -10
  266. package/src/tests/script-connections-sql.test.ts +6 -2
  267. package/src/tests/script-connections.test.ts +4 -0
  268. package/src/tests/slack-thread-participants.test.ts +14 -3
  269. package/src/tests/spend-cap-credentials.test.ts +34 -0
  270. package/src/tests/spend-cap-outcome.test.ts +67 -0
  271. package/src/tests/subscription-first.test.ts +119 -0
  272. package/src/tests/worktree-reaper.test.ts +424 -0
  273. package/src/tools/get-task-details.ts +247 -5
  274. package/src/tools/schedules/patch-schedule.ts +26 -1
  275. package/src/tools/schedules/update-schedule.ts +28 -2
  276. package/src/tools/script-common.ts +37 -22
  277. package/src/tools/script-query-types.ts +1 -1
  278. package/src/tools/script-run.ts +1 -1
  279. package/src/tools/script-search.ts +12 -10
  280. package/src/tools/utils.ts +7 -1
  281. package/src/utils/credentials.ts +36 -1
  282. package/src/utils/egress-guard.ts +40 -10
  283. package/src/utils/error-tracker.ts +17 -0
  284. package/templates/skills/apps/SKILL.md +191 -2
  285. package/templates/skills/apps/content.md +191 -2
  286. package/templates/skills/boards-and-sheets/content.md +11 -0
  287. package/templates/skills/chat-sdk/content.md +2 -2
  288. package/templates/skills/pages/content.md +11 -0
  289. package/templates/skills/swarm-docs/content.md +4 -0
  290. package/templates/skills/swarm-scripts/SKILL.md +1 -0
  291. package/templates/skills/swarm-scripts/content.md +1 -0
  292. package/templates/workflows/ralph-loop/content.md +6 -6
  293. package/dist/acp-adapter-cn53011z.js +0 -17
  294. package/dist/cli-pr0eze3x.js +0 -149
  295. package/dist/core-0fqtbrxa.js +0 -42
  296. package/dist/fx-adapter-k6w3jvz9.js +0 -20
  297. package/dist/grok-adapter-4q5tssw0.js +0 -20
  298. package/dist/handlers-qxgfvvsf.js +0 -41
  299. package/dist/heartbeat-6tr2w2da.js +0 -50
  300. package/dist/index-0mcxjdsa.js +0 -44
  301. package/dist/index-dz4q23ag.js +0 -40
  302. package/dist/index-s175jckx.js +0 -39
  303. package/dist/lead-p3hx7h35.js +0 -79
  304. package/dist/thread-buffer-rwa7d4dx.js +0 -42
  305. package/dist/worker-8rg9gz74.js +0 -79
  306. /package/dist/{cli-m4ejz4nj.js → cli-cah298e5.js} +0 -0
@@ -3,6 +3,7 @@ import {
3
3
  CredentialBroker,
4
4
  defaultCredentialBindings,
5
5
  assertUrlSafe,
6
+ createSsrfGuardedFetch,
6
7
  parseEgressAllowlist,
7
8
  init_egress_guard,
8
9
  init_credential_broker,
@@ -45,11 +46,11 @@ import {
45
46
  getWorkflowVersions2,
46
47
  getMcpServerById2,
47
48
  init_db4
48
- } from "./cli-jj3c5nyb.js";
49
+ } from "./cli-erh1rgh4.js";
49
50
  import {
50
51
  McpHttpClient,
51
52
  init_http_client
52
- } from "./cli-x05p2d05.js";
53
+ } from "./cli-9tevdxyf.js";
53
54
  import {
54
55
  detachedProcessGroup,
55
56
  registerProcessGroup,
@@ -60,17 +61,17 @@ import {
60
61
  oauthAppRowToProviderConfig,
61
62
  ensureAuthorizationTokenOrThrow,
62
63
  init_ensure_token
63
- } from "./cli-kspxjftk.js";
64
+ } from "./cli-xerdrnqs.js";
64
65
  import {
65
66
  AGENT_FS_API_KEY_CONFIG,
66
67
  init_script_fs,
67
68
  resolveAgentFsIdentity,
68
69
  init_agent_fs_identity
69
- } from "./cli-avqkr20b.js";
70
+ } from "./cli-j2ybkdk2.js";
70
71
  import {
71
72
  validateDefinition,
72
73
  init_definition2
73
- } from "./cli-hgsxnjyg.js";
74
+ } from "./cli-jkkcm72j.js";
74
75
  import {
75
76
  getApiKey,
76
77
  init_api_key
@@ -82,12 +83,14 @@ import {
82
83
  refreshMcpToken,
83
84
  computeExpiresAt,
84
85
  init_mcp_wrapper
85
- } from "./cli-dka73bak.js";
86
+ } from "./cli-xysy1g8x.js";
86
87
  import {
88
+ mintUserScriptRunToken,
89
+ revokeUserScriptRunToken,
87
90
  mintScriptRunToken,
88
91
  revokeSessionToken,
89
92
  init_users
90
- } from "./cli-ajjvqhf3.js";
93
+ } from "./cli-getrvmtx.js";
91
94
  import {
92
95
  defaultAssetKey,
93
96
  init_key,
@@ -126,7 +129,7 @@ import {
126
129
  refreshSecretScrubberCache,
127
130
  registerVolatileSecret,
128
131
  init_secret_scrubber
129
- } from "./cli-bpje8n65.js";
132
+ } from "./cli-fp65jdp2.js";
130
133
  import {
131
134
  __toESM,
132
135
  __commonJS,
@@ -7073,7 +7076,7 @@ async function createMcpServerClient(serverId, context = {}) {
7073
7076
  clientInfo: { name: "agent-swarm-script-mcp-proxy", version: "1.0.0" },
7074
7077
  omitEmptyAuthHeaders: true,
7075
7078
  timeoutMs: context.timeoutMs ?? MCP_PROXY_TIMEOUT_MS,
7076
- validateUrl: (url) => assertUrlSafe(url, publicEndpointSsrfOptions())
7079
+ fetch: createSsrfGuardedFetch(publicEndpointSsrfOptions())
7077
7080
  });
7078
7081
  client.useRawUrl = true;
7079
7082
  client.customHeaders = await resolveMcpHeaders(server2, context);
@@ -7095,6 +7098,7 @@ var init_mcp_proxy = __esm(() => {
7095
7098
  init_http_client();
7096
7099
  init_ensure_mcp_token();
7097
7100
  init_mcp_wrapper();
7101
+ init_egress_guard();
7098
7102
  init_secret_scrubber();
7099
7103
  });
7100
7104
 
@@ -9017,14 +9021,127 @@ async function linkOrWriteBareImportShims(baseTmpDir, tmpdir) {
9017
9021
  await writeBareImportShims(tmpdir);
9018
9022
  }
9019
9023
  }
9020
- function harnessCommand(harnessPath, input, env, runAs) {
9021
- return buildSandboxedCommand(["bun", "run", harnessPath], env, {
9022
- virtualMemoryMb: input.resources.memoryMb,
9023
- cpuTimeSec: input.resources.cpuTimeSec,
9024
- maxProcs: input.resources.maxProcs,
9025
- maxFileKb: Math.floor(input.resources.maxFileBytes / 1024),
9026
- maxFdCount: input.resources.maxFdCount
9027
- }, "inline", runAs);
9024
+ function harnessRunPaths(tmpdir) {
9025
+ return {
9026
+ argsFile: `${tmpdir}/args.json`,
9027
+ sourceFile: `${tmpdir}/user-module/user-script.ts`,
9028
+ resultFile: `${tmpdir}/result.json`,
9029
+ errorFile: `${tmpdir}/error.json`,
9030
+ startedFile: `${tmpdir}/started.marker`
9031
+ };
9032
+ }
9033
+ function harnessEnvFor(spec, tmpdir) {
9034
+ const paths = harnessRunPaths(tmpdir);
9035
+ return {
9036
+ PATH: process.env.PATH ?? "/usr/bin:/bin",
9037
+ HOME: spec.runAs ? tmpdir : process.env.HOME ?? "/tmp",
9038
+ LANG: process.env.LANG ?? "C.UTF-8",
9039
+ LC_ALL: process.env.LC_ALL ?? "C.UTF-8",
9040
+ TMPDIR: tmpdir,
9041
+ SWARM_SCRIPT_TMPDIR: tmpdir,
9042
+ SWARM_SCRIPT_ARGS_FILE: paths.argsFile,
9043
+ SWARM_SCRIPT_SOURCE_FILE: paths.sourceFile,
9044
+ SWARM_SCRIPT_RESULT_FILE: paths.resultFile,
9045
+ SWARM_SCRIPT_ERROR_FILE: paths.errorFile,
9046
+ SWARM_SCRIPT_STARTED_FILE: paths.startedFile,
9047
+ ...spec.hostValidatedArgs ? { SWARM_SCRIPT_HOST_VALIDATED_ARGS: "1" } : {}
9048
+ };
9049
+ }
9050
+ function spawnHarness(spec, tmpdir) {
9051
+ const harnessEnv = harnessEnvFor(spec, tmpdir);
9052
+ const limits = {
9053
+ virtualMemoryMb: spec.resources.memoryMb,
9054
+ cpuTimeSec: spec.resources.cpuTimeSec,
9055
+ maxProcs: spec.resources.maxProcs,
9056
+ maxFileKb: Math.floor(spec.resources.maxFileBytes / 1024),
9057
+ maxFdCount: spec.resources.maxFdCount
9058
+ };
9059
+ return registerProcessGroup(Bun.spawn(buildSandboxedCommand(["bun", "run", spec.harnessPath], harnessEnv, limits, "inline", spec.runAs), {
9060
+ env: sandboxSpawnEnv(harnessEnv),
9061
+ cwd: tmpdir,
9062
+ detached: detachedProcessGroup,
9063
+ stdin: "pipe",
9064
+ stdout: "pipe",
9065
+ stderr: "pipe"
9066
+ }));
9067
+ }
9068
+ function harnessSpecKey(spec) {
9069
+ return JSON.stringify([
9070
+ spec.harnessPath,
9071
+ spec.baseTmpDir,
9072
+ spec.runAs ?? null,
9073
+ spec.hostValidatedArgs,
9074
+ spec.resources.memoryMb,
9075
+ spec.resources.cpuTimeSec,
9076
+ spec.resources.maxProcs,
9077
+ spec.resources.maxFileBytes,
9078
+ spec.resources.maxFdCount,
9079
+ process.env.PATH ?? null,
9080
+ process.env.HOME ?? null,
9081
+ process.env.LANG ?? null,
9082
+ process.env.LC_ALL ?? null
9083
+ ]);
9084
+ }
9085
+ function harnessAlive(proc) {
9086
+ return proc.exitCode === null && proc.signalCode === null && !proc.killed;
9087
+ }
9088
+ function discardWarmHarness(entry) {
9089
+ clearTimeout(entry.idleTimer);
9090
+ if (warmHarnesses.get(entry.key) === entry)
9091
+ warmHarnesses.delete(entry.key);
9092
+ terminateProcessGroup(entry.proc.pid).catch(() => {}).finally(() => rm(entry.tmpdir, { recursive: true, force: true }).catch(() => {}));
9093
+ }
9094
+ function takeWarmHarness(key) {
9095
+ const entry = warmHarnesses.get(key);
9096
+ if (!entry)
9097
+ return;
9098
+ warmHarnesses.delete(key);
9099
+ clearTimeout(entry.idleTimer);
9100
+ if (!harnessAlive(entry.proc)) {
9101
+ discardWarmHarness(entry);
9102
+ return;
9103
+ }
9104
+ entry.proc.ref();
9105
+ return entry;
9106
+ }
9107
+ async function startWarmHarness(key, spec) {
9108
+ if (process.platform === "win32")
9109
+ return;
9110
+ if (warmHarnesses.has(key) || warmingSpecs.has(key))
9111
+ return;
9112
+ warmingSpecs.add(key);
9113
+ const tmpdir = `${spec.baseTmpDir}/swarm-script-${crypto.randomUUID()}`;
9114
+ let started = false;
9115
+ try {
9116
+ await mkdir(tmpdir, { recursive: true, mode: 493 });
9117
+ await linkOrWriteBareImportShims(spec.baseTmpDir, tmpdir);
9118
+ if (warmHarnesses.has(key))
9119
+ return;
9120
+ const proc = spawnHarness(spec, tmpdir);
9121
+ proc.unref();
9122
+ started = true;
9123
+ const entry = {
9124
+ key,
9125
+ tmpdir,
9126
+ proc,
9127
+ idleTimer: setTimeout(() => discardWarmHarness(entry), WARM_IDLE_MS)
9128
+ };
9129
+ entry.idleTimer.unref?.();
9130
+ if (warmHarnesses.size >= MAX_WARM_SPECS) {
9131
+ const oldest = warmHarnesses.values().next().value;
9132
+ if (oldest)
9133
+ discardWarmHarness(oldest);
9134
+ }
9135
+ warmHarnesses.set(key, entry);
9136
+ proc.exited.then(() => {
9137
+ if (warmHarnesses.get(key) === entry)
9138
+ discardWarmHarness(entry);
9139
+ }, () => {});
9140
+ } catch {} finally {
9141
+ warmingSpecs.delete(key);
9142
+ if (!started)
9143
+ await rm(tmpdir, { recursive: true, force: true }).catch(() => {});
9144
+ }
9028
9145
  }
9029
9146
 
9030
9147
  class NativeScriptExecutor {
@@ -9035,15 +9152,16 @@ class NativeScriptExecutor {
9035
9152
  }
9036
9153
  const start = Date.now();
9037
9154
  const baseTmpDir = process.env.TMPDIR ?? (process.platform === "win32" ? osTmpdir() : "/tmp");
9038
- const tmpdir = `${baseTmpDir}/swarm-script-${crypto.randomUUID()}`;
9039
- await mkdir(`${tmpdir}/user-module`, { recursive: true });
9040
- const argsFile = `${tmpdir}/args.json`;
9041
- const sourceFile = `${tmpdir}/user-module/user-script.ts`;
9042
- const resultFile = `${tmpdir}/result.json`;
9043
- const errorFile = `${tmpdir}/error.json`;
9044
- const startedFile = `${tmpdir}/started.marker`;
9045
9155
  const runAs = resolveSandboxIdentity();
9046
9156
  const harnessPath = process.env.SCRIPT_RUNTIME_DIR ? `${process.env.SCRIPT_RUNTIME_DIR}/eval-harness.bundle.js` : fileURLToPath(new URL("../eval-harness.ts", import.meta.url));
9157
+ const spec = {
9158
+ harnessPath,
9159
+ baseTmpDir,
9160
+ runAs,
9161
+ hostValidatedArgs: Boolean(input.hostValidatedArgs),
9162
+ resources: input.resources
9163
+ };
9164
+ const specKey = harnessSpecKey(spec);
9047
9165
  let timedOut = false;
9048
9166
  let killed = input.signal?.aborted ?? false;
9049
9167
  let removeAbortListener;
@@ -9057,9 +9175,14 @@ class NativeScriptExecutor {
9057
9175
  exitCode: 1,
9058
9176
  error: "killed"
9059
9177
  });
9178
+ if (killed)
9179
+ return killedOutput();
9180
+ const warm = takeWarmHarness(specKey);
9181
+ const tmpdir = warm?.tmpdir ?? `${baseTmpDir}/swarm-script-${crypto.randomUUID()}`;
9182
+ const { argsFile, sourceFile, resultFile, errorFile, startedFile } = harnessRunPaths(tmpdir);
9183
+ if (warm)
9184
+ proc = warm.proc;
9060
9185
  try {
9061
- if (killed)
9062
- return killedOutput();
9063
9186
  const onExternalAbort = () => {
9064
9187
  killed = true;
9065
9188
  if (proc)
@@ -9067,11 +9190,13 @@ class NativeScriptExecutor {
9067
9190
  };
9068
9191
  input.signal?.addEventListener("abort", onExternalAbort, { once: true });
9069
9192
  removeAbortListener = () => input.signal?.removeEventListener("abort", onExternalAbort);
9193
+ await mkdir(`${tmpdir}/user-module`, { recursive: true });
9070
9194
  await Promise.all([
9071
9195
  Bun.write(argsFile, JSON.stringify(input.args ?? null)),
9072
- Bun.write(sourceFile, input.source),
9073
- linkOrWriteBareImportShims(baseTmpDir, tmpdir)
9196
+ Bun.write(sourceFile, input.source)
9074
9197
  ]);
9198
+ if (!warm)
9199
+ await linkOrWriteBareImportShims(baseTmpDir, tmpdir);
9075
9200
  if (runAs) {
9076
9201
  await Promise.all([tmpdir, `${tmpdir}/user-module`, argsFile, sourceFile].map((path) => chown(path, runAs.uid, runAs.gid)));
9077
9202
  }
@@ -9082,34 +9207,15 @@ class NativeScriptExecutor {
9082
9207
  if (proc)
9083
9208
  terminateProcessGroup(proc.pid);
9084
9209
  }, input.resources.wallClockMs);
9085
- const harnessEnv = {
9086
- PATH: process.env.PATH ?? "/usr/bin:/bin",
9087
- HOME: runAs ? tmpdir : process.env.HOME ?? "/tmp",
9088
- LANG: process.env.LANG ?? "C.UTF-8",
9089
- LC_ALL: process.env.LC_ALL ?? "C.UTF-8",
9090
- TMPDIR: tmpdir,
9091
- SWARM_SCRIPT_TMPDIR: tmpdir,
9092
- SWARM_SCRIPT_ARGS_FILE: argsFile,
9093
- SWARM_SCRIPT_SOURCE_FILE: sourceFile,
9094
- SWARM_SCRIPT_RESULT_FILE: resultFile,
9095
- SWARM_SCRIPT_ERROR_FILE: errorFile,
9096
- SWARM_SCRIPT_STARTED_FILE: startedFile,
9097
- ...input.hostValidatedArgs ? { SWARM_SCRIPT_HOST_VALIDATED_ARGS: "1" } : {}
9098
- };
9099
- proc = registerProcessGroup(Bun.spawn(harnessCommand(harnessPath, input, harnessEnv, runAs), {
9100
- env: sandboxSpawnEnv(harnessEnv),
9101
- cwd: tmpdir,
9102
- detached: detachedProcessGroup,
9103
- stdin: "pipe",
9104
- stdout: "pipe",
9105
- stderr: "pipe"
9106
- }));
9107
- proc.stdin.write(JSON.stringify(input.configPayload));
9108
- proc.stdin.end();
9210
+ const child = proc ?? spawnHarness(spec, tmpdir);
9211
+ proc = child;
9212
+ startWarmHarness(specKey, spec);
9213
+ child.stdin.write(JSON.stringify(input.configPayload));
9214
+ child.stdin.end();
9109
9215
  const [stdout, stderr, exitCode] = await Promise.all([
9110
- readStreamCapped(proc.stdout, input.resources.maxStdoutBytes),
9111
- readStreamCapped(proc.stderr, input.resources.maxStdoutBytes),
9112
- proc.exited.catch(() => timedOut ? 124 : 1)
9216
+ readStreamCapped(child.stdout, input.resources.maxStdoutBytes),
9217
+ readStreamCapped(child.stderr, input.resources.maxStdoutBytes),
9218
+ child.exited.catch(() => timedOut ? 124 : 1)
9113
9219
  ]).finally(() => clearTimeout(timeout));
9114
9220
  const runDirCheck = {
9115
9221
  maxBytes: input.resources.maxFileBytes,
@@ -9147,12 +9253,14 @@ class NativeScriptExecutor {
9147
9253
  }
9148
9254
  }
9149
9255
  }
9150
- var SANDBOX_CAPACITY_EXIT_CODE = 134, RUN_DIR_OPEN_FLAGS, cachedDevTargets, sharedShimDirPromises;
9256
+ var SANDBOX_CAPACITY_EXIT_CODE = 134, RUN_DIR_OPEN_FLAGS, cachedDevTargets, sharedShimDirPromises, WARM_IDLE_MS = 30000, MAX_WARM_SPECS = 4, warmHarnesses, warmingSpecs;
9151
9257
  var init_native = __esm(() => {
9152
9258
  init_process_group();
9153
9259
  init_sandboxed_process();
9154
9260
  RUN_DIR_OPEN_FLAGS = fsConstants.O_RDONLY | (fsConstants.O_NOFOLLOW ?? 0) | (fsConstants.O_NONBLOCK ?? 0);
9155
9261
  sharedShimDirPromises = new Map;
9262
+ warmHarnesses = new Map;
9263
+ warmingSpecs = new Set;
9156
9264
  });
9157
9265
 
9158
9266
  // src/scripts-runtime/executors/quickjs.ts
@@ -178311,6 +178419,10 @@ var init_loader = __esm(() => {
178311
178419
  });
178312
178420
 
178313
178421
  // src/be/scripts/run-credential.ts
178422
+ function userScriptRunTokenTtlMs() {
178423
+ const override = Number(process.env.SCRIPT_RUN_USER_TOKEN_TTL_MS);
178424
+ return override > 0 && override < SCRIPT_RUN_TOKEN_TTL_MS ? override : SCRIPT_RUN_TOKEN_TTL_MS;
178425
+ }
178314
178426
  async function acquireScriptApiCredential(agentId, provenance = {}) {
178315
178427
  if (!await getAgentById2(agentId)) {
178316
178428
  return { apiKey: undefined, release: async () => {} };
@@ -178335,6 +178447,23 @@ async function runScriptWithRunCredential(input, provenance = {}) {
178335
178447
  await credential.release();
178336
178448
  }
178337
178449
  }
178450
+ async function runScriptAsUserWithRunCredential(input, userId) {
178451
+ const token = await mintUserScriptRunToken(userId, userScriptRunTokenTtlMs());
178452
+ try {
178453
+ return await runScript({
178454
+ ...input,
178455
+ apiKey: token.plaintext,
178456
+ agentId: "",
178457
+ egressSecrets: [],
178458
+ failedBindings: [],
178459
+ userConfig: {},
178460
+ apiConnections: [],
178461
+ mcpConnections: []
178462
+ });
178463
+ } finally {
178464
+ await revokeUserScriptRunToken(token.tokenId);
178465
+ }
178466
+ }
178338
178467
  var SCRIPT_RUN_TOKEN_TTL_MS;
178339
178468
  var init_run_credential = __esm(() => {
178340
178469
  init_loader();
@@ -178769,7 +178898,7 @@ var content_default11 = `# Iterative Review Loop
178769
178898
 
178770
178899
  Template parameter: {{REPO_URL}}
178771
178900
 
178772
- A bounded implement → review loop. A coder agent implements the task and reports the diff; a reviewer agent checks it and returns PASS or a blocking fix list. Use this when you want automated quality control with a clear exit condition rather than open-ended implementation.
178901
+ A single implement → review pass. A coder agent implements the task and reports the diff; a reviewer agent checks it and returns PASS or a blocking fix list. Use this when you want automated quality control with a clear exit condition rather than open-ended implementation.
178773
178902
 
178774
178903
  ## Configuration
178775
178904
 
@@ -178779,15 +178908,15 @@ A bounded implement → review loop. A coder agent implements the task and repor
178779
178908
 
178780
178909
  ## What It Does
178781
178910
 
178782
- A two-node implement → review loop:
178911
+ A two-node implement → review pass:
178783
178912
 
178784
178913
  1. **Implement node (coder):** Takes the \`task\` description and \`repoUrl\`, produces a working implementation, runs focused checks (lint, types, relevant tests), and reports the diff.
178785
178914
 
178786
178915
  2. **Review node (reviewer):** Reads the implementation output, checks correctness and quality, and returns either \`PASS\` (implementation is accepted) or a list of blocking fixes only (no nitpicks — only what must change before this can ship).
178787
178916
 
178788
- The \`maxIterations\` parameter is declarative: the reviewer signals PASS when done. The workflow engine handles the iteration ceiling.
178917
+ The trigger’s \`maxIterations\` is only a hint to the agents, not an engine-enforced ceiling. The global engine limits are \`WORKFLOW_MAX_ITERATIONS\` (default 100 node executions per graph walk, reset on resume) and \`WORKFLOW_MAX_STEPS_PER_RUN\` (default 500 total steps per run).
178789
178918
 
178790
- **Note:** In the current workflow schema, looping back is not native — the review node does not automatically re-trigger the implement node. To iterate, re-trigger the workflow with the reviewer's feedback as the new \`task\` input, or extend with a \`workflow-iterate\` skill pattern.
178919
+ **Note:** The shipped definition has no back-edge, so it runs once. The engine supports native loops through port back-edges: add a separate entry node before \`implement\`, then a \`property-match\` node after review whose \`false\` port routes back to \`implement\` when the verdict is FAIL.
178791
178920
 
178792
178921
  ## When to Use
178793
178922
 
@@ -178798,14 +178927,14 @@ The \`maxIterations\` parameter is declarative: the reviewer signals PASS when d
178798
178927
 
178799
178928
  ## Customization Notes
178800
178929
 
178801
- - **\`maxIterations\`** is passed in but not natively enforced by the two-node shape. It's a hint to the agents — include it in the implement node's task prompt if you want the coder to self-limit attempts.
178930
+ - **\`maxIterations\`** is declared in the trigger schema but is not enforced by the engine. It's a hint to the agents — include it in the implement node's task prompt if you want the coder to self-limit attempts.
178802
178931
  - **Pin \`agentId\`** on the implement node to a coder-capable agent with repo access. Pin the review node to a reviewer-capable agent that can reason about code quality.
178803
178932
  - **Add a PR creation node:** Extend with a third agent-task node that takes the reviewer's PASS output and creates a pull request via \`gh pr create\`.
178804
178933
  - **Add structured output to the review node:** Use \`outputSchema: { "type": "object", "properties": { "verdict": { "type": "string", "enum": ["PASS", "FAIL"] }, "fixes": { "type": "array" } } }\` to make the verdict machine-readable for downstream automation.
178805
178934
 
178806
178935
  ## Trade-offs
178807
178936
 
178808
- **No native loop:** This workflow is a single implement → review pass. True multi-iteration requires re-triggering or a more complex DAG. Use the \`workflow-iterate\` skill if you need the lead agent to drive multiple rounds based on reviewer feedback.
178937
+ **Single pass as shipped:** Native iteration requires adding a port back-edge and an explicit budget check if you want to enforce the trigger’s \`maxIterations\`. The global engine limits are safety backstops, not a review-round budget.
178809
178938
 
178810
178939
  **Reviewer quality matters:** The review node's output is only as good as the reviewer agent's judgment. For high-stakes code, add a second reviewer node or route to a human-in-the-loop step before the PASS verdict is accepted.
178811
178940
 
@@ -179547,6 +179676,7 @@ var init_catalog_generated = __esm(() => {
179547
179676
  "SearchInput",
179548
179677
  "Select",
179549
179678
  "NumberInput",
179679
+ "Input",
179550
179680
  "Button",
179551
179681
  "Metric",
179552
179682
  "Chart",
@@ -179582,12 +179712,21 @@ var init_catalog_generated = __esm(() => {
179582
179712
  "SessionThread",
179583
179713
  "PageFrame",
179584
179714
  "ElementRef",
179715
+ "Svg",
179716
+ "Rect",
179717
+ "Line",
179718
+ "Path",
179719
+ "Circle",
179720
+ "SvgText",
179585
179721
  "ElementSlot"
179586
179722
  ],
179587
179723
  actionTypes: [
179588
179724
  "swarm.sdk",
179589
179725
  "swarm.call",
179590
179726
  "ui.toast",
179727
+ "ui.set",
179728
+ "ui.focus",
179729
+ "ui.when",
179591
179730
  "app.mutate",
179592
179731
  "app.refresh",
179593
179732
  "app.action",
@@ -180164,6 +180303,315 @@ var init_catalog_generated = __esm(() => {
180164
180303
  additionalProperties: false
180165
180304
  }
180166
180305
  },
180306
+ Input: {
180307
+ description: 'Low-level text field. `value` binds two-way to page-local state: `{ "$bindState": "/local/<name>/..." }`, or `{ "$bindItem": "" }` inside a `repeat` over a `/local` list. `onInput` runs after every edit (`{ "$chain": "value" }` is the new text); `onPaste` replaces the browser paste (`{ "$chain": "text" }` is the clipboard text); `onKeyDown:<Key>` (Backspace, Delete, Enter, Escape, Tab, ArrowLeft, ArrowRight, ArrowUp, ArrowDown, Home, End) replaces that key\'s default. `id` is what `ui.focus` targets. `size: "cell"` is a square one-character box; `selectOnFocus` selects the value so typing replaces it.',
180308
+ props: {
180309
+ $schema: "http://json-schema.org/draft-07/schema#",
180310
+ type: "object",
180311
+ properties: {
180312
+ id: {
180313
+ type: "string"
180314
+ },
180315
+ value: {
180316
+ type: "string"
180317
+ },
180318
+ label: {
180319
+ type: "string"
180320
+ },
180321
+ placeholder: {
180322
+ type: "string"
180323
+ },
180324
+ type: {
180325
+ type: "string",
180326
+ enum: ["text", "password"]
180327
+ },
180328
+ inputMode: {
180329
+ type: "string",
180330
+ enum: ["text", "numeric", "tel", "email", "url", "search"]
180331
+ },
180332
+ autoComplete: {
180333
+ type: "string",
180334
+ enum: ["off", "one-time-code"]
180335
+ },
180336
+ maxLength: {
180337
+ type: "integer",
180338
+ minimum: 1,
180339
+ maximum: 1e4
180340
+ },
180341
+ size: {
180342
+ type: "string",
180343
+ enum: ["default", "cell"]
180344
+ },
180345
+ selectOnFocus: {
180346
+ type: "boolean"
180347
+ },
180348
+ disabled: {
180349
+ type: "boolean"
180350
+ },
180351
+ onInput: {
180352
+ type: "array",
180353
+ items: {
180354
+ type: "object",
180355
+ properties: {
180356
+ action: {
180357
+ type: "string"
180358
+ },
180359
+ params: {
180360
+ type: "object",
180361
+ propertyNames: {
180362
+ type: "string"
180363
+ },
180364
+ additionalProperties: {}
180365
+ }
180366
+ },
180367
+ required: ["action"],
180368
+ additionalProperties: false
180369
+ }
180370
+ },
180371
+ onPaste: {
180372
+ type: "array",
180373
+ items: {
180374
+ type: "object",
180375
+ properties: {
180376
+ action: {
180377
+ type: "string"
180378
+ },
180379
+ params: {
180380
+ type: "object",
180381
+ propertyNames: {
180382
+ type: "string"
180383
+ },
180384
+ additionalProperties: {}
180385
+ }
180386
+ },
180387
+ required: ["action"],
180388
+ additionalProperties: false
180389
+ }
180390
+ },
180391
+ "onKeyDown:Backspace": {
180392
+ type: "array",
180393
+ items: {
180394
+ type: "object",
180395
+ properties: {
180396
+ action: {
180397
+ type: "string"
180398
+ },
180399
+ params: {
180400
+ type: "object",
180401
+ propertyNames: {
180402
+ type: "string"
180403
+ },
180404
+ additionalProperties: {}
180405
+ }
180406
+ },
180407
+ required: ["action"],
180408
+ additionalProperties: false
180409
+ }
180410
+ },
180411
+ "onKeyDown:Delete": {
180412
+ type: "array",
180413
+ items: {
180414
+ type: "object",
180415
+ properties: {
180416
+ action: {
180417
+ type: "string"
180418
+ },
180419
+ params: {
180420
+ type: "object",
180421
+ propertyNames: {
180422
+ type: "string"
180423
+ },
180424
+ additionalProperties: {}
180425
+ }
180426
+ },
180427
+ required: ["action"],
180428
+ additionalProperties: false
180429
+ }
180430
+ },
180431
+ "onKeyDown:Enter": {
180432
+ type: "array",
180433
+ items: {
180434
+ type: "object",
180435
+ properties: {
180436
+ action: {
180437
+ type: "string"
180438
+ },
180439
+ params: {
180440
+ type: "object",
180441
+ propertyNames: {
180442
+ type: "string"
180443
+ },
180444
+ additionalProperties: {}
180445
+ }
180446
+ },
180447
+ required: ["action"],
180448
+ additionalProperties: false
180449
+ }
180450
+ },
180451
+ "onKeyDown:Escape": {
180452
+ type: "array",
180453
+ items: {
180454
+ type: "object",
180455
+ properties: {
180456
+ action: {
180457
+ type: "string"
180458
+ },
180459
+ params: {
180460
+ type: "object",
180461
+ propertyNames: {
180462
+ type: "string"
180463
+ },
180464
+ additionalProperties: {}
180465
+ }
180466
+ },
180467
+ required: ["action"],
180468
+ additionalProperties: false
180469
+ }
180470
+ },
180471
+ "onKeyDown:Tab": {
180472
+ type: "array",
180473
+ items: {
180474
+ type: "object",
180475
+ properties: {
180476
+ action: {
180477
+ type: "string"
180478
+ },
180479
+ params: {
180480
+ type: "object",
180481
+ propertyNames: {
180482
+ type: "string"
180483
+ },
180484
+ additionalProperties: {}
180485
+ }
180486
+ },
180487
+ required: ["action"],
180488
+ additionalProperties: false
180489
+ }
180490
+ },
180491
+ "onKeyDown:ArrowLeft": {
180492
+ type: "array",
180493
+ items: {
180494
+ type: "object",
180495
+ properties: {
180496
+ action: {
180497
+ type: "string"
180498
+ },
180499
+ params: {
180500
+ type: "object",
180501
+ propertyNames: {
180502
+ type: "string"
180503
+ },
180504
+ additionalProperties: {}
180505
+ }
180506
+ },
180507
+ required: ["action"],
180508
+ additionalProperties: false
180509
+ }
180510
+ },
180511
+ "onKeyDown:ArrowRight": {
180512
+ type: "array",
180513
+ items: {
180514
+ type: "object",
180515
+ properties: {
180516
+ action: {
180517
+ type: "string"
180518
+ },
180519
+ params: {
180520
+ type: "object",
180521
+ propertyNames: {
180522
+ type: "string"
180523
+ },
180524
+ additionalProperties: {}
180525
+ }
180526
+ },
180527
+ required: ["action"],
180528
+ additionalProperties: false
180529
+ }
180530
+ },
180531
+ "onKeyDown:ArrowUp": {
180532
+ type: "array",
180533
+ items: {
180534
+ type: "object",
180535
+ properties: {
180536
+ action: {
180537
+ type: "string"
180538
+ },
180539
+ params: {
180540
+ type: "object",
180541
+ propertyNames: {
180542
+ type: "string"
180543
+ },
180544
+ additionalProperties: {}
180545
+ }
180546
+ },
180547
+ required: ["action"],
180548
+ additionalProperties: false
180549
+ }
180550
+ },
180551
+ "onKeyDown:ArrowDown": {
180552
+ type: "array",
180553
+ items: {
180554
+ type: "object",
180555
+ properties: {
180556
+ action: {
180557
+ type: "string"
180558
+ },
180559
+ params: {
180560
+ type: "object",
180561
+ propertyNames: {
180562
+ type: "string"
180563
+ },
180564
+ additionalProperties: {}
180565
+ }
180566
+ },
180567
+ required: ["action"],
180568
+ additionalProperties: false
180569
+ }
180570
+ },
180571
+ "onKeyDown:Home": {
180572
+ type: "array",
180573
+ items: {
180574
+ type: "object",
180575
+ properties: {
180576
+ action: {
180577
+ type: "string"
180578
+ },
180579
+ params: {
180580
+ type: "object",
180581
+ propertyNames: {
180582
+ type: "string"
180583
+ },
180584
+ additionalProperties: {}
180585
+ }
180586
+ },
180587
+ required: ["action"],
180588
+ additionalProperties: false
180589
+ }
180590
+ },
180591
+ "onKeyDown:End": {
180592
+ type: "array",
180593
+ items: {
180594
+ type: "object",
180595
+ properties: {
180596
+ action: {
180597
+ type: "string"
180598
+ },
180599
+ params: {
180600
+ type: "object",
180601
+ propertyNames: {
180602
+ type: "string"
180603
+ },
180604
+ additionalProperties: {}
180605
+ }
180606
+ },
180607
+ required: ["action"],
180608
+ additionalProperties: false
180609
+ }
180610
+ }
180611
+ },
180612
+ additionalProperties: false
180613
+ }
180614
+ },
180167
180615
  Button: {
180168
180616
  description: 'Interactive button. Wire to actions via `on.press`. `variant: "destructive-outline"` is the canonical red-outlined destructive look (standalone deletes should use it, not solid red). `disabled` accepts a constant or a bound boolean; `busyWith: "<actionName>"` swaps the label for a spinner (presses ignored) while that custom action is running, then shows a check plus `successLabel` for ~1.5s when it finishes ok. `icon` + `iconPosition` (start|end) add an icon from the curated set; `size` sm|default|lg. `shortcut` (one key, e.g. `"n"`) shows a keycap inside the button and presses it from anywhere on the page (not while typing in a field, not with Ctrl/Cmd/Alt). `hint` is a hover tooltip.',
180169
180617
  props: {
@@ -183105,6 +183553,364 @@ var init_catalog_generated = __esm(() => {
183105
183553
  additionalProperties: false
183106
183554
  }
183107
183555
  },
183556
+ Svg: {
183557
+ description: 'Vector drawing, `width` x `height` user units, scaled to its container width. Children are Rect, Line, Path, Circle, SvgText or a nested Svg (a group: put `repeat` on it to draw one set of shapes per item, offset by `x`/`y`). Every numeric attribute accepts an expression, e.g. a Gantt bar `x: { "$mul": [{ "$item": "start" }, 20] }`. Colors are palette tokens only.',
183558
+ slots: ["default"],
183559
+ props: {
183560
+ $schema: "http://json-schema.org/draft-07/schema#",
183561
+ type: "object",
183562
+ properties: {
183563
+ width: {
183564
+ type: "number",
183565
+ exclusiveMinimum: 0,
183566
+ maximum: 1e4
183567
+ },
183568
+ height: {
183569
+ type: "number",
183570
+ exclusiveMinimum: 0,
183571
+ maximum: 1e4
183572
+ },
183573
+ x: {
183574
+ type: "number"
183575
+ },
183576
+ y: {
183577
+ type: "number"
183578
+ },
183579
+ label: {
183580
+ type: "string"
183581
+ }
183582
+ },
183583
+ additionalProperties: false
183584
+ }
183585
+ },
183586
+ Rect: {
183587
+ description: "Rectangle inside an Svg. `rx` rounds corners; `title` is a hover tooltip.",
183588
+ props: {
183589
+ $schema: "http://json-schema.org/draft-07/schema#",
183590
+ type: "object",
183591
+ properties: {
183592
+ x: {
183593
+ type: "number"
183594
+ },
183595
+ y: {
183596
+ type: "number"
183597
+ },
183598
+ width: {
183599
+ type: "number"
183600
+ },
183601
+ height: {
183602
+ type: "number"
183603
+ },
183604
+ rx: {
183605
+ type: "number",
183606
+ minimum: 0
183607
+ },
183608
+ fill: {
183609
+ type: "string",
183610
+ enum: [
183611
+ "chart-1",
183612
+ "chart-2",
183613
+ "chart-3",
183614
+ "chart-4",
183615
+ "chart-5",
183616
+ "primary",
183617
+ "success",
183618
+ "warning",
183619
+ "error",
183620
+ "info",
183621
+ "muted",
183622
+ "foreground",
183623
+ "background",
183624
+ "border",
183625
+ "none"
183626
+ ]
183627
+ },
183628
+ stroke: {
183629
+ type: "string",
183630
+ enum: [
183631
+ "chart-1",
183632
+ "chart-2",
183633
+ "chart-3",
183634
+ "chart-4",
183635
+ "chart-5",
183636
+ "primary",
183637
+ "success",
183638
+ "warning",
183639
+ "error",
183640
+ "info",
183641
+ "muted",
183642
+ "foreground",
183643
+ "background",
183644
+ "border",
183645
+ "none"
183646
+ ]
183647
+ },
183648
+ strokeWidth: {
183649
+ type: "number",
183650
+ minimum: 0,
183651
+ maximum: 100
183652
+ },
183653
+ opacity: {
183654
+ type: "number",
183655
+ minimum: 0,
183656
+ maximum: 1
183657
+ },
183658
+ title: {
183659
+ type: "string"
183660
+ }
183661
+ },
183662
+ required: ["x", "y", "width", "height"],
183663
+ additionalProperties: false
183664
+ }
183665
+ },
183666
+ Line: {
183667
+ description: "Line inside an Svg, from (x1, y1) to (x2, y2). `dashed` draws it dashed.",
183668
+ props: {
183669
+ $schema: "http://json-schema.org/draft-07/schema#",
183670
+ type: "object",
183671
+ properties: {
183672
+ x1: {
183673
+ type: "number"
183674
+ },
183675
+ y1: {
183676
+ type: "number"
183677
+ },
183678
+ x2: {
183679
+ type: "number"
183680
+ },
183681
+ y2: {
183682
+ type: "number"
183683
+ },
183684
+ dashed: {
183685
+ type: "boolean"
183686
+ },
183687
+ stroke: {
183688
+ type: "string",
183689
+ enum: [
183690
+ "chart-1",
183691
+ "chart-2",
183692
+ "chart-3",
183693
+ "chart-4",
183694
+ "chart-5",
183695
+ "primary",
183696
+ "success",
183697
+ "warning",
183698
+ "error",
183699
+ "info",
183700
+ "muted",
183701
+ "foreground",
183702
+ "background",
183703
+ "border",
183704
+ "none"
183705
+ ]
183706
+ },
183707
+ strokeWidth: {
183708
+ type: "number",
183709
+ minimum: 0,
183710
+ maximum: 100
183711
+ },
183712
+ opacity: {
183713
+ type: "number",
183714
+ minimum: 0,
183715
+ maximum: 1
183716
+ }
183717
+ },
183718
+ required: ["x1", "y1", "x2", "y2"],
183719
+ additionalProperties: false
183720
+ }
183721
+ },
183722
+ Path: {
183723
+ description: "SVG path inside an Svg. `d` holds path commands and numbers only.",
183724
+ props: {
183725
+ $schema: "http://json-schema.org/draft-07/schema#",
183726
+ type: "object",
183727
+ properties: {
183728
+ d: {
183729
+ type: "string",
183730
+ maxLength: 1e4
183731
+ },
183732
+ fill: {
183733
+ type: "string",
183734
+ enum: [
183735
+ "chart-1",
183736
+ "chart-2",
183737
+ "chart-3",
183738
+ "chart-4",
183739
+ "chart-5",
183740
+ "primary",
183741
+ "success",
183742
+ "warning",
183743
+ "error",
183744
+ "info",
183745
+ "muted",
183746
+ "foreground",
183747
+ "background",
183748
+ "border",
183749
+ "none"
183750
+ ]
183751
+ },
183752
+ stroke: {
183753
+ type: "string",
183754
+ enum: [
183755
+ "chart-1",
183756
+ "chart-2",
183757
+ "chart-3",
183758
+ "chart-4",
183759
+ "chart-5",
183760
+ "primary",
183761
+ "success",
183762
+ "warning",
183763
+ "error",
183764
+ "info",
183765
+ "muted",
183766
+ "foreground",
183767
+ "background",
183768
+ "border",
183769
+ "none"
183770
+ ]
183771
+ },
183772
+ strokeWidth: {
183773
+ type: "number",
183774
+ minimum: 0,
183775
+ maximum: 100
183776
+ },
183777
+ opacity: {
183778
+ type: "number",
183779
+ minimum: 0,
183780
+ maximum: 1
183781
+ }
183782
+ },
183783
+ required: ["d"],
183784
+ additionalProperties: false
183785
+ }
183786
+ },
183787
+ Circle: {
183788
+ description: "Circle inside an Svg, centered at (cx, cy) with radius `r`.",
183789
+ props: {
183790
+ $schema: "http://json-schema.org/draft-07/schema#",
183791
+ type: "object",
183792
+ properties: {
183793
+ cx: {
183794
+ type: "number"
183795
+ },
183796
+ cy: {
183797
+ type: "number"
183798
+ },
183799
+ r: {
183800
+ type: "number",
183801
+ minimum: 0
183802
+ },
183803
+ fill: {
183804
+ type: "string",
183805
+ enum: [
183806
+ "chart-1",
183807
+ "chart-2",
183808
+ "chart-3",
183809
+ "chart-4",
183810
+ "chart-5",
183811
+ "primary",
183812
+ "success",
183813
+ "warning",
183814
+ "error",
183815
+ "info",
183816
+ "muted",
183817
+ "foreground",
183818
+ "background",
183819
+ "border",
183820
+ "none"
183821
+ ]
183822
+ },
183823
+ stroke: {
183824
+ type: "string",
183825
+ enum: [
183826
+ "chart-1",
183827
+ "chart-2",
183828
+ "chart-3",
183829
+ "chart-4",
183830
+ "chart-5",
183831
+ "primary",
183832
+ "success",
183833
+ "warning",
183834
+ "error",
183835
+ "info",
183836
+ "muted",
183837
+ "foreground",
183838
+ "background",
183839
+ "border",
183840
+ "none"
183841
+ ]
183842
+ },
183843
+ strokeWidth: {
183844
+ type: "number",
183845
+ minimum: 0,
183846
+ maximum: 100
183847
+ },
183848
+ opacity: {
183849
+ type: "number",
183850
+ minimum: 0,
183851
+ maximum: 1
183852
+ },
183853
+ title: {
183854
+ type: "string"
183855
+ }
183856
+ },
183857
+ required: ["cx", "cy", "r"],
183858
+ additionalProperties: false
183859
+ }
183860
+ },
183861
+ SvgText: {
183862
+ description: "Text label inside an Svg at (x, y). `anchor` start|middle|end aligns it horizontally; `size` is the font size in user units.",
183863
+ props: {
183864
+ $schema: "http://json-schema.org/draft-07/schema#",
183865
+ type: "object",
183866
+ properties: {
183867
+ x: {
183868
+ type: "number"
183869
+ },
183870
+ y: {
183871
+ type: "number"
183872
+ },
183873
+ text: {
183874
+ type: "string"
183875
+ },
183876
+ anchor: {
183877
+ type: "string",
183878
+ enum: ["start", "middle", "end"]
183879
+ },
183880
+ size: {
183881
+ type: "number",
183882
+ minimum: 6,
183883
+ maximum: 96
183884
+ },
183885
+ weight: {
183886
+ type: "string",
183887
+ enum: ["normal", "bold"]
183888
+ },
183889
+ fill: {
183890
+ type: "string",
183891
+ enum: [
183892
+ "chart-1",
183893
+ "chart-2",
183894
+ "chart-3",
183895
+ "chart-4",
183896
+ "chart-5",
183897
+ "primary",
183898
+ "success",
183899
+ "warning",
183900
+ "error",
183901
+ "info",
183902
+ "muted",
183903
+ "foreground",
183904
+ "background",
183905
+ "border",
183906
+ "none"
183907
+ ]
183908
+ }
183909
+ },
183910
+ required: ["x", "y", "text"],
183911
+ additionalProperties: false
183912
+ }
183913
+ },
183108
183914
  ElementSlot: {
183109
183915
  description: "Leaf insertion point for children supplied by an ElementRef consumer.",
183110
183916
  props: {
@@ -183248,6 +184054,55 @@ var init_catalog_generated = __esm(() => {
183248
184054
  additionalProperties: false
183249
184055
  }
183250
184056
  },
184057
+ "ui.set": {
184058
+ description: 'Write `value` to a page-local state path (`/local/<name>/...`, declared in the page `state`). `path` may be an expression, e.g. `{ "$join": [["/local/otp", { "$index": true }], "/"] }`.',
184059
+ params: {
184060
+ $schema: "http://json-schema.org/draft-07/schema#",
184061
+ type: "object",
184062
+ properties: {
184063
+ path: {
184064
+ type: "string"
184065
+ },
184066
+ value: {}
184067
+ },
184068
+ required: ["path", "value"],
184069
+ additionalProperties: false
184070
+ }
184071
+ },
184072
+ "ui.focus": {
184073
+ description: 'Focus the Input whose `id` matches. Inside a `repeat`, pass the item `index` (an expression such as `{ "$add": [{ "$index": true }, 1] }` moves to the next cell); a missing target is a no-op.',
184074
+ params: {
184075
+ $schema: "http://json-schema.org/draft-07/schema#",
184076
+ type: "object",
184077
+ properties: {
184078
+ id: {
184079
+ type: "string"
184080
+ },
184081
+ index: {
184082
+ type: "integer",
184083
+ minimum: -9007199254740991,
184084
+ maximum: 9007199254740991
184085
+ }
184086
+ },
184087
+ required: ["id"],
184088
+ additionalProperties: false
184089
+ }
184090
+ },
184091
+ "ui.when": {
184092
+ description: "Guard: the chain continues only when `value` equals `eq` (or is truthy when `eq` is omitted); otherwise the rest of the chain is skipped quietly.",
184093
+ params: {
184094
+ $schema: "http://json-schema.org/draft-07/schema#",
184095
+ type: "object",
184096
+ properties: {
184097
+ value: {},
184098
+ eq: {
184099
+ type: ["string", "number", "boolean", "null"]
184100
+ }
184101
+ },
184102
+ required: ["value"],
184103
+ additionalProperties: false
184104
+ }
184105
+ },
183251
184106
  "app.mutate": {
183252
184107
  description: "Create / update / delete a swarm-app row, then refetch every named query on the same model.",
183253
184108
  params: {
@@ -183461,6 +184316,18 @@ function collectRepeatBindingPaths(value, path, paths) {
183461
184316
  collectRepeatBindingPaths(child, appendPath(path, key), paths);
183462
184317
  }
183463
184318
  }
184319
+ function expressionOp(value) {
184320
+ if (!isPlainObject(value))
184321
+ return null;
184322
+ const keys = Object.keys(value);
184323
+ return keys.length === 1 && Object.hasOwn(EXPRESSION_ARITY, keys[0]) ? keys[0] : null;
184324
+ }
184325
+ function isBindStateBinding(value) {
184326
+ return isPlainObject(value) && Object.keys(value).length === 1 && typeof value.$bindState === "string";
184327
+ }
184328
+ function isBindItemBinding(value) {
184329
+ return isPlainObject(value) && Object.keys(value).length === 1 && typeof value.$bindItem === "string";
184330
+ }
183464
184331
  function isActionSentinel(value) {
183465
184332
  if (!isPlainObject(value) || Object.keys(value).length !== 1)
183466
184333
  return false;
@@ -183522,6 +184389,31 @@ function validateSchema(value, schema, path, allowActionSentinels, skipPath) {
183522
184389
  }
183523
184390
  if (isRepeatBinding(value))
183524
184391
  return { issues: [], stateRefs: [] };
184392
+ if (isBindStateBinding(value) || isBindItemBinding(value)) {
184393
+ return {
184394
+ issues: [issue(path, "$bindState and $bindItem are only allowed on Input.value")],
184395
+ stateRefs: []
184396
+ };
184397
+ }
184398
+ const op = expressionOp(value);
184399
+ if (op) {
184400
+ const operands = value[op];
184401
+ const [min, max] = EXPRESSION_ARITY[op];
184402
+ if (!Array.isArray(operands) || operands.length < min || operands.length > max) {
184403
+ const count = min === max ? `${min}` : max === Infinity ? `at least ${min}` : `${min}-${max}`;
184404
+ return {
184405
+ issues: [issue(appendPath(path, op), `must be an array of ${count} operand(s)`)],
184406
+ stateRefs: []
184407
+ };
184408
+ }
184409
+ const result = { issues: [], stateRefs: [] };
184410
+ for (const [index, operand] of operands.entries()) {
184411
+ const operandResult = validateSchema(operand, {}, appendPath(appendPath(path, op), index), allowActionSentinels);
184412
+ result.issues.push(...operandResult.issues);
184413
+ result.stateRefs.push(...operandResult.stateRefs);
184414
+ }
184415
+ return result;
184416
+ }
183525
184417
  if (isActionSentinel(value)) {
183526
184418
  return allowActionSentinels ? { issues: [], stateRefs: [] } : {
183527
184419
  issues: [
@@ -183684,6 +184576,16 @@ function actionParams(step, path, definition, catalog, validateNavigation = fals
183684
184576
  result.issues.push(issue(appendPath(sessionPath, "scope"), 'scope "shared" is not supported yet'));
183685
184577
  }
183686
184578
  }
184579
+ } else if (step.action === "ui.set") {
184580
+ if (typeof params.path === "string") {
184581
+ result.stateRefs.push({
184582
+ path: appendPath(paramsPath, "path"),
184583
+ value: params.path,
184584
+ write: true
184585
+ });
184586
+ } else if (!expressionOp(params.path)) {
184587
+ result.issues.push(issue(appendPath(paramsPath, "path"), "must be a /local/<name> path or an expression"));
184588
+ }
183687
184589
  } else if (step.action === "ui.toast") {
183688
184590
  const undo = toastUndoChain(step);
183689
184591
  if (Array.isArray(undo)) {
@@ -183727,7 +184629,18 @@ function validateActionMap(value, path, definition, catalog, allowSingle) {
183727
184629
  }
183728
184630
  return result;
183729
184631
  }
183730
- function validateStateRef(ref, definition, formIds, uiIds, pageParams) {
184632
+ function validateStateRef(ref, definition, formIds, uiIds, pageParams, pageState) {
184633
+ const localMatch = /^\/local\/([^/]+)(?:\/.*)?$/.exec(ref.value);
184634
+ if (localMatch) {
184635
+ const name = localMatch[1];
184636
+ if (!Object.hasOwn(pageState, name)) {
184637
+ return issue(ref.path, `state reference targets undeclared page state "${name}"; declare it in the page's \`state\``);
184638
+ }
184639
+ return ref.value.split("/").some((segment) => RESERVED_UI_IDS.has(segment)) ? issue(ref.path, `invalid state reference "${ref.value}"`) : null;
184640
+ }
184641
+ if (ref.write) {
184642
+ return issue(ref.path, `only page-local /local/<name> state is writable (got "${ref.value}")`);
184643
+ }
183731
184644
  if (ref.value === "/route/page")
183732
184645
  return null;
183733
184646
  const routeParam = /^\/route\/params\/([^/]+)$/.exec(ref.value);
@@ -184388,6 +185301,9 @@ function validatePage(definition, catalog, target) {
184388
185301
  const page = options?.tree ?? definition.pages[pageName];
184389
185302
  const pagePath = options?.path ?? appendPath("pages", pageName);
184390
185303
  const pageParams = pageName ? definition.pages[pageName]?.params ?? {} : {};
185304
+ const pageState = pageName ? definition.pages[pageName]?.state ?? {} : {};
185305
+ const inputIds = new Set;
185306
+ const bindItemPaths = [];
184391
185307
  const elementsPath = appendPath(pagePath, "elements");
184392
185308
  const root = page.root;
184393
185309
  const elements = page.elements;
@@ -184433,7 +185349,17 @@ function validatePage(definition, catalog, target) {
184433
185349
  if (component) {
184434
185350
  const propsPath = appendPath(elementPath, "props");
184435
185351
  const itemChainPaths = new Set(isPlainObject(rawElement.props) ? itemActionChains(type, rawElement.props, propsPath).map(({ path }) => path) : []);
184436
- const actionChainPath = (path) => (PROP_ACTION_CHAINS[String(type)] ?? []).some((prop) => path === `${propsPath}.${prop}`) || itemChainPaths.has(path);
185352
+ const inputValue = type === "Input" && isPlainObject(rawElement.props) ? rawElement.props.value : undefined;
185353
+ const boundInputValue = isBindStateBinding(inputValue) || isBindItemBinding(inputValue);
185354
+ const actionChainPath = (path) => (PROP_ACTION_CHAINS[String(type)] ?? []).some((prop) => path === `${propsPath}.${prop}`) || itemChainPaths.has(path) || boundInputValue && path === `${propsPath}.value`;
185355
+ if (isBindStateBinding(inputValue)) {
185356
+ stateRefs.push({ path: `${propsPath}.value`, value: inputValue.$bindState, write: true });
185357
+ } else if (isBindItemBinding(inputValue)) {
185358
+ bindItemPaths.push({ elementId, path: `${propsPath}.value` });
185359
+ }
185360
+ if (type === "Input" && isPlainObject(rawElement.props) && typeof rawElement.props.id === "string") {
185361
+ inputIds.add(rawElement.props.id);
185362
+ }
184437
185363
  const propsResult = validateSchema(Object.hasOwn(rawElement, "props") ? rawElement.props : {}, component.props, propsPath, false, actionChainPath);
184438
185364
  issues.push(...propsResult.issues);
184439
185365
  stateRefs.push(...propsResult.stateRefs);
@@ -184688,6 +185614,64 @@ function validatePage(definition, catalog, target) {
184688
185614
  }
184689
185615
  }
184690
185616
  }
185617
+ for (const { elementId, path } of bindItemPaths) {
185618
+ let parentId = parentByChild.get(elementId);
185619
+ const seen = new Set;
185620
+ let repeatPath;
185621
+ while (parentId && !seen.has(parentId)) {
185622
+ seen.add(parentId);
185623
+ const parent = elements[parentId];
185624
+ if (isPlainObject(parent) && isPlainObject(parent.repeat)) {
185625
+ repeatPath = parent.repeat.statePath;
185626
+ break;
185627
+ }
185628
+ parentId = parentByChild.get(parentId);
185629
+ }
185630
+ if (typeof repeatPath !== "string") {
185631
+ issues.push(issue(path, "$bindItem is only allowed inside a repeated element"));
185632
+ } else {
185633
+ stateRefs.push({ path, value: repeatPath, write: true });
185634
+ }
185635
+ }
185636
+ for (const [elementId, rawElement] of elementEntries) {
185637
+ if (!isPlainObject(rawElement))
185638
+ continue;
185639
+ const elementPath = `${elementsPath}.${elementId}`;
185640
+ const parent = elements[parentByChild.get(elementId) ?? ""];
185641
+ const parentType = isPlainObject(parent) ? parent.type : undefined;
185642
+ if (typeof rawElement.type === "string" && SVG_SHAPES.has(rawElement.type)) {
185643
+ if (parentType !== "Svg") {
185644
+ issues.push(issue(appendPath(elementPath, "type"), `${rawElement.type} must be a child of an Svg`));
185645
+ }
185646
+ }
185647
+ if (rawElement.type === "Svg" && parentType !== "Svg") {
185648
+ const props = isPlainObject(rawElement.props) ? rawElement.props : {};
185649
+ for (const key of ["width", "height"]) {
185650
+ if (props[key] === undefined) {
185651
+ issues.push(issue(`${elementPath}.props.${key}`, "is required on an outer Svg"));
185652
+ }
185653
+ }
185654
+ }
185655
+ if (rawElement.type === "Svg" && Array.isArray(rawElement.children)) {
185656
+ for (const [index, child] of rawElement.children.entries()) {
185657
+ const childType = isPlainObject(elements[String(child)]) ? elements[String(child)].type : undefined;
185658
+ if (typeof childType === "string" && childType !== "Svg" && !SVG_SHAPES.has(childType)) {
185659
+ issues.push(issue(`${elementPath}.children.${index}`, `Svg children must be Rect, Line, Path, Circle, SvgText or Svg (got ${childType})`));
185660
+ }
185661
+ }
185662
+ }
185663
+ if (rawElement.type === "Path" && isPlainObject(rawElement.props) && typeof rawElement.props.d === "string" && !SVG_PATH_DATA.test(rawElement.props.d)) {
185664
+ issues.push(issue(`${elementPath}.props.d`, "must hold SVG path commands and numbers only"));
185665
+ }
185666
+ }
185667
+ visitPageActionSteps(page, pagePath, (step, path) => {
185668
+ if (step.action !== "ui.focus" || !isPlainObject(step.params))
185669
+ return;
185670
+ const id = step.params.id;
185671
+ if (typeof id === "string" && !inputIds.has(id)) {
185672
+ issues.push(issue(`${path}.params.id`, `no Input with id "${id}" on this page`));
185673
+ }
185674
+ });
184691
185675
  const visited = new Set;
184692
185676
  const visiting = new Set;
184693
185677
  const visit = (elementId) => {
@@ -184746,21 +185730,23 @@ function validatePage(definition, catalog, target) {
184746
185730
  const propMatch = /^\/props\/([^/]+)(?:\/.*)?$/.exec(ref.value);
184747
185731
  const userConfigRef = ref.value === "/user" || ref.value.startsWith("/user/");
184748
185732
  let stateIssue;
184749
- if (options?.elementMode && userConfigRef) {
185733
+ if (options?.elementMode && ref.write) {
185734
+ stateIssue = issue(ref.path, `${options.elementMode} elements cannot write state; bind page-local state at page level`);
185735
+ } else if (options?.elementMode && userConfigRef) {
184750
185736
  stateIssue = issue(ref.path, `${options.elementMode} elements cannot read /user state; read userConfig via a prop or bind it at page level`);
184751
185737
  } else if (options?.elementMode && propMatch) {
184752
185738
  stateIssue = Object.hasOwn(options.elementProps ?? {}, propMatch[1]) ? null : issue(ref.path, `state reference targets unknown element prop "${propMatch[1]}"`);
184753
185739
  } else if (options?.elementMode === "pure") {
184754
185740
  stateIssue = issue(ref.path, `pure element state reference "${ref.value}" escapes /props/<declared>; use a declared prop or switch the element to bound mode`);
184755
185741
  } else {
184756
- stateIssue = validateStateRef(ref, definition, formIds, uiIds, pageParams);
185742
+ stateIssue = validateStateRef(ref, definition, formIds, uiIds, pageParams, pageState);
184757
185743
  }
184758
185744
  if (stateIssue)
184759
185745
  issues.push(stateIssue);
184760
185746
  }
184761
185747
  return dedupeIssues(issues);
184762
185748
  }
184763
- var ELEMENT_KEYS, UI_STATE_COMPONENTS, SCHEMA_FORM_ID, PLAIN_TOKEN_ID_COMPONENTS, SESSION_KEY, RESERVED_UI_IDS, PROP_ACTION_CHAINS, ITEM_ACTION_CHAINS, ROUTE_PANEL_TYPES, APPROVAL_CHAIN_KEYS, DATA_FIELD_PROPS, CONDITION_KEYS, COMPARISON_KEYS, POPOVER_MAX_FIELDS = 12, LINK_FIELD_PROPS, MAX_ELEMENT_REF_DEPTH = 5, MAX_ELEMENT_REF_EXPANSION_WORK = 100, MAX_ELEMENT_REF_EXPANSION_ISSUES = 100, CHART_MAX_SERIES = 8, CURRENCY_CODE, FILE_ROW_FIELDS, PAGE_FRAME_ID;
185749
+ var ELEMENT_KEYS, UI_STATE_COMPONENTS, SCHEMA_FORM_ID, PLAIN_TOKEN_ID_COMPONENTS, SESSION_KEY, RESERVED_UI_IDS, INPUT_KEYS, PROP_ACTION_CHAINS, ITEM_ACTION_CHAINS, ROUTE_PANEL_TYPES, APPROVAL_CHAIN_KEYS, DATA_FIELD_PROPS, CONDITION_KEYS, EXPRESSION_ARITY, SVG_SHAPES, SVG_PATH_DATA, COMPARISON_KEYS, POPOVER_MAX_FIELDS = 12, LINK_FIELD_PROPS, MAX_ELEMENT_REF_DEPTH = 5, MAX_ELEMENT_REF_EXPANSION_WORK = 100, MAX_ELEMENT_REF_EXPANSION_ISSUES = 100, CHART_MAX_SERIES = 8, CURRENCY_CODE, FILE_ROW_FIELDS, PAGE_FRAME_ID;
184764
185750
  var init_page_validator = __esm(() => {
184765
185751
  init_definition();
184766
185752
  ELEMENT_KEYS = new Set([
@@ -184789,7 +185775,21 @@ var init_page_validator = __esm(() => {
184789
185775
  PLAIN_TOKEN_ID_COMPONENTS = new Set(["SchemaForm", "SessionThread"]);
184790
185776
  SESSION_KEY = /^[A-Za-z0-9_-]{1,128}$/;
184791
185777
  RESERVED_UI_IDS = new Set(["__proto__", "constructor", "prototype"]);
185778
+ INPUT_KEYS = [
185779
+ "Backspace",
185780
+ "Delete",
185781
+ "Enter",
185782
+ "Escape",
185783
+ "Tab",
185784
+ "ArrowLeft",
185785
+ "ArrowRight",
185786
+ "ArrowUp",
185787
+ "ArrowDown",
185788
+ "Home",
185789
+ "End"
185790
+ ];
184792
185791
  PROP_ACTION_CHAINS = {
185792
+ Input: ["onInput", "onPaste", ...INPUT_KEYS.map((key) => `onKeyDown:${key}`)],
184793
185793
  Table: ["onRowClick", "onRetry"],
184794
185794
  Form: ["onSubmit"],
184795
185795
  Kanban: ["onMove", "onCardClick"],
@@ -184819,6 +185819,19 @@ var init_page_validator = __esm(() => {
184819
185819
  Chart: ["x"]
184820
185820
  };
184821
185821
  CONDITION_KEYS = new Set(["eq", "neq", "gt", "gte", "lt", "lte", "not"]);
185822
+ EXPRESSION_ARITY = {
185823
+ $add: [1, Infinity],
185824
+ $sub: [2, 2],
185825
+ $mul: [1, Infinity],
185826
+ $div: [2, 2],
185827
+ $min: [1, Infinity],
185828
+ $max: [1, Infinity],
185829
+ $split: [1, 3],
185830
+ $join: [1, 2],
185831
+ $length: [1, 1]
185832
+ };
185833
+ SVG_SHAPES = new Set(["Rect", "Line", "Path", "Circle", "SvgText"]);
185834
+ SVG_PATH_DATA = /^[MmLlHhVvCcSsQqTtAaZz0-9eE.,\s+-]*$/;
184822
185835
  COMPARISON_KEYS = ["eq", "neq", "gt", "gte", "lt", "lte"];
184823
185836
  LINK_FIELD_PROPS = {
184824
185837
  Table: "columns",
@@ -185182,11 +186195,18 @@ async function parseAppDefinition(input, elementContext = {}) {
185182
186195
  });
185183
186196
  continue;
185184
186197
  }
185185
- if (foreignScriptForWriter(elementContext, script) && grandfatheredScriptRefs.get(`actions.${name}`) !== scriptRefKey(action.scriptId, action.args, undefined)) {
186198
+ const grandfatheredRef = grandfatheredScriptRefs.get(`actions.${name}`) === scriptRefKey(action.scriptId, action.args, undefined);
186199
+ const owner = getSavedScriptOwnerAgentId(script);
186200
+ if (foreignScriptForWriter(elementContext, script) && !grandfatheredRef) {
185186
186201
  issues.push({
185187
186202
  path: `actions.${name}.scriptId`,
185188
186203
  message: `script "${action.scriptId}" is agent-scoped to another agent — reference a script you own or a global script`
185189
186204
  });
186205
+ } else if (script.scope !== "agent" && owner !== null && (elementContext.writerIsUser === true || typeof elementContext.writerAgentId === "string") && elementContext.writerAgentId !== owner && !grandfatheredRef) {
186206
+ issues.push({
186207
+ path: `actions.${name}.scriptId`,
186208
+ message: `script "${action.scriptId}" runs with agent "${owner}"'s credentials — only that agent or the operator may wire or alter this action`
186209
+ });
185190
186210
  }
185191
186211
  }
185192
186212
  if (issues.length > 0)
@@ -185270,7 +186290,7 @@ function applyMergePatch(target, patch, path) {
185270
186290
  if (!isMergePatchObject(patch))
185271
186291
  return patch;
185272
186292
  const result = isMergePatchObject(target) ? { ...target } : {};
185273
- const entriesAreAtomic = path.length === 1 && path[0] === "actions" || path.length === 1 && path[0] === "elements" || path.length === 1 && path[0] === "userConfig" || path.length === 3 && path[0] === "models" && path[2] === "columns" || path.length === 3 && path[0] === "models" && path[2] === "sources" || path.length === 3 && path[0] === "elements" && path[2] === "elements" || path.length === 3 && path[0] === "pages" && (path[2] === "elements" || path[2] === "params");
186293
+ const entriesAreAtomic = path.length === 1 && path[0] === "actions" || path.length === 1 && path[0] === "elements" || path.length === 1 && path[0] === "userConfig" || path.length === 3 && path[0] === "models" && path[2] === "columns" || path.length === 3 && path[0] === "models" && path[2] === "sources" || path.length === 3 && path[0] === "elements" && path[2] === "elements" || path.length === 3 && path[0] === "pages" && (path[2] === "elements" || path[2] === "params" || path[2] === "state");
185274
186294
  for (const [key, value] of Object.entries(patch)) {
185275
186295
  if (value === null) {
185276
186296
  delete result[key];
@@ -185504,7 +186524,8 @@ var init_definition = __esm(() => {
185504
186524
  icon: string2().optional(),
185505
186525
  description: string2().max(280).optional(),
185506
186526
  headerActions: string2().optional(),
185507
- nav: boolean().optional()
186527
+ nav: boolean().optional(),
186528
+ state: record2(AppNameSchema, unknown()).optional()
185508
186529
  }).strict();
185509
186530
  ElementPropDefSchema = object2({
185510
186531
  kind: ScalarColumnKindSchema,
@@ -186908,10 +187929,10 @@ export interface SwarmSdk {
186908
187929
 
186909
187930
  // --- write: chat sdk ---
186910
187931
  chat_reply(args: { text?: string; card?: unknown }): Promise<unknown>;
186911
- chat_post(args: { adapter: "telegram" | "slack" | "discord" | "teams"; threadId?: string; channelId?: string; text?: string; card?: unknown }): Promise<unknown>;
186912
- chat_openDm(args: { adapter: "telegram" | "slack" | "discord" | "teams"; userId: string }): Promise<unknown>;
186913
- chat_registerChannel(args: { adapter: "telegram" | "slack" | "discord" | "teams"; channelId: string; agentId?: string; workflowId?: string; name?: string }): Promise<unknown>;
186914
- chat_unregisterChannel(args: { adapter: "telegram" | "slack" | "discord" | "teams"; channelId: string }): Promise<unknown>;
187932
+ chat_post(args: { adapter: "telegram" | "slack" | "discord" | "teams" | "rocketchat"; threadId?: string; channelId?: string; text?: string; card?: unknown }): Promise<unknown>;
187933
+ chat_openDm(args: { adapter: "telegram" | "slack" | "discord" | "teams" | "rocketchat"; userId: string }): Promise<unknown>;
187934
+ chat_registerChannel(args: { adapter: "telegram" | "slack" | "discord" | "teams" | "rocketchat"; channelId: string; agentId?: string; workflowId?: string; name?: string }): Promise<unknown>;
187935
+ chat_unregisterChannel(args: { adapter: "telegram" | "slack" | "discord" | "teams" | "rocketchat"; channelId: string }): Promise<unknown>;
186915
187936
 
186916
187937
  // --- write: messaging (internal) ---
186917
187938
  message_post(args: { channel?: string; content: string; to?: string }): Promise<unknown>;
@@ -187693,4 +188714,4 @@ function parseSkillContent(content) {
187693
188714
  }
187694
188715
  var init_skill_parser = () => {};
187695
188716
 
187696
- export { require_dist, getMcpOAuthToken, findReusableMcpOAuthClient, invalidateMcpOAuthClient, upsertMcpOAuthToken, applyMcpOAuthRefresh, markMcpOAuthTokenStatus, deleteMcpOAuthToken, insertMcpOAuthPending, consumeMcpOAuthPending, gcMcpOAuthPending, setMcpServerAuthMethod, init_mcp_oauth, ensureMcpToken, init_ensure_mcp_token, callMcpServerTool, init_mcp_proxy, resolveSqlDsn, runReadOnlyQuery, init_sql_connections, listVendoredOpenapiEntries, init_vendored_openapi, ConnectionAuthInputSchema, SqlDsnInputSchema, connectionAuthSummary, listRelationalCredentialBindings, getCredentialBindingById, findCredentialBindingByIdentity, upsertCredentialBinding, disableCredentialBinding, listScriptConnections, listScriptConnectionsAsync, getScriptConnectionById, ScriptConnectionConflictError, connectionAuthInputFromFlat, upsertScriptConnection, refreshScriptConnection, setScriptConnectionEnabled, deleteScriptConnection, getScriptApiConnectionDescriptors, getScriptMcpConnectionDescriptors, getScriptApiTypes, getScriptMcpTypes, init_script_connections, oauthAppToProviderConfig, getOAuthProviderConfig, getOAuthBindingTokenStatus, init_oauth_credential_bindings, buildScriptCredentialBindingsWithFailures, init_script_credential_broker, DEFAULT_SANDBOX_LIMITS, buildSandboxedCommand, sandboxSpawnEnv, createCappedStreamState, snapshotCapped, readStreamCapped, init_sandboxed_process, writeBareImportShim, init_native, isExecutorAllowedByDeployment, init_registry, MIN_SCRIPT_WALL_CLOCK_MS, SCRIPT_LONG_TIMEOUT_HINT_MS, MAX_SCRIPT_WALL_CLOCK_MS, DEFAULT_SCRIPT_RESOURCES, init_types3, HOST_VALIDATED_ARGS, init_host_validated_args, require_typescript2, checkImportAllowlist, validateScriptImports, init_import_allowlist, runScriptWithRunCredential, init_run_credential, resolveSeededEnabled, init_automation_toggle, getSeedState, recordSeedState, deleteSeedState, init_state_db, canonicalJson, seededWorkflowState, workflowsSeeder, init_workflows_seeder, extractScriptSignature, init_extract_signature, extractArgsJsonSchema, init_extract_schema, getSavedScriptOwnerAgentId, runSavedScriptAsAgent, init_run_saved, checkQuickJSCompat, quickJSCompatWarnings, init_quickjs_compat, resolveSyncRunAs, init_sync_run_as, AppNameSchema, ScalarColumnKindSchema, isIso8601Date, jsonColumnSizeLabel, jsonColumnValueIssue, isValidColumnValue, SYSTEM_COLUMN_KINDS, SORTABLE_SYSTEM_DATE_COLUMNS, AppElementsSchema, AppDefinitionSchema, collectScriptReferences, scriptCompatWarnings, parseAppDefinition, applyAppDefinitionPatch, init_definition, upgradeAppDefinition, init_format_upgrades, decodeAppDefinition, appDefinitionNeedsRepair, createApp, getApp, listApps, listAppRecords, updateApp, deleteApp, init_store2, getScriptAppTypes, init_script_types, SCRIPT_SDK_TYPES, scriptSdkTypesWithGeneratedApis, SCRIPT_STDLIB_MODULE_TYPES, scriptStdlibTypesWithGeneratedApis, typecheckWithAmbient, typecheckScript, init_typecheck, parseSkillContent, init_skill_parser };
188717
+ export { require_dist, getMcpOAuthToken, findReusableMcpOAuthClient, invalidateMcpOAuthClient, upsertMcpOAuthToken, applyMcpOAuthRefresh, markMcpOAuthTokenStatus, deleteMcpOAuthToken, insertMcpOAuthPending, consumeMcpOAuthPending, gcMcpOAuthPending, setMcpServerAuthMethod, init_mcp_oauth, ensureMcpToken, init_ensure_mcp_token, callMcpServerTool, init_mcp_proxy, resolveSqlDsn, runReadOnlyQuery, init_sql_connections, listVendoredOpenapiEntries, init_vendored_openapi, ConnectionAuthInputSchema, SqlDsnInputSchema, connectionAuthSummary, listRelationalCredentialBindings, getCredentialBindingById, findCredentialBindingByIdentity, upsertCredentialBinding, disableCredentialBinding, listScriptConnections, listScriptConnectionsAsync, getScriptConnectionById, ScriptConnectionConflictError, connectionAuthInputFromFlat, upsertScriptConnection, refreshScriptConnection, setScriptConnectionEnabled, deleteScriptConnection, getScriptApiConnectionDescriptors, getScriptMcpConnectionDescriptors, getScriptApiTypes, getScriptMcpTypes, init_script_connections, oauthAppToProviderConfig, getOAuthProviderConfig, getOAuthBindingTokenStatus, init_oauth_credential_bindings, buildScriptCredentialBindingsWithFailures, init_script_credential_broker, DEFAULT_SANDBOX_LIMITS, buildSandboxedCommand, sandboxSpawnEnv, createCappedStreamState, snapshotCapped, readStreamCapped, init_sandboxed_process, writeBareImportShim, init_native, isExecutorAllowedByDeployment, init_registry, MIN_SCRIPT_WALL_CLOCK_MS, SCRIPT_LONG_TIMEOUT_HINT_MS, MAX_SCRIPT_WALL_CLOCK_MS, DEFAULT_SCRIPT_RESOURCES, init_types3, HOST_VALIDATED_ARGS, init_host_validated_args, require_typescript2, checkImportAllowlist, validateScriptImports, init_import_allowlist, runScriptWithRunCredential, runScriptAsUserWithRunCredential, init_run_credential, resolveSeededEnabled, init_automation_toggle, getSeedState, recordSeedState, deleteSeedState, init_state_db, canonicalJson, seededWorkflowState, workflowsSeeder, init_workflows_seeder, extractScriptSignature, init_extract_signature, extractArgsJsonSchema, init_extract_schema, getSavedScriptOwnerAgentId, runSavedScriptAsAgent, init_run_saved, checkQuickJSCompat, quickJSCompatWarnings, init_quickjs_compat, resolveSyncRunAs, init_sync_run_as, AppNameSchema, ScalarColumnKindSchema, isIso8601Date, jsonColumnSizeLabel, jsonColumnValueIssue, isValidColumnValue, SYSTEM_COLUMN_KINDS, SORTABLE_SYSTEM_DATE_COLUMNS, AppElementsSchema, AppDefinitionSchema, collectScriptReferences, scriptCompatWarnings, parseAppDefinition, applyAppDefinitionPatch, init_definition, upgradeAppDefinition, init_format_upgrades, decodeAppDefinition, appDefinitionNeedsRepair, createApp, getApp, listApps, listAppRecords, updateApp, deleteApp, init_store2, getScriptAppTypes, init_script_types, SCRIPT_SDK_TYPES, scriptSdkTypesWithGeneratedApis, SCRIPT_STDLIB_MODULE_TYPES, scriptStdlibTypesWithGeneratedApis, typecheckWithAmbient, typecheckScript, init_typecheck, parseSkillContent, init_skill_parser };