@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
@@ -31,7 +31,7 @@ import { deriveCodexKeySuffix } from "../providers/codex-oauth/auth-json.js";
31
31
  import { getValidCodexOAuth, loadAllCodexOAuthSlots } from "../providers/codex-oauth/storage.js";
32
32
  import { getApiKey } from "../utils/api-key";
33
33
  import { CODEX_AUTH_WATCH_NAMESPACE, codexAuthBenchMarkerKey } from "../utils/codex-auth-failure";
34
- import { getMcpBaseUrl } from "../utils/constants";
34
+ import { getScriptApiBaseUrl } from "../utils/constants";
35
35
  import { route } from "./route-def";
36
36
 
37
37
  /**
@@ -88,6 +88,10 @@ const keepWarmRoute = route({
88
88
  schema: z.object({ results: z.array(slotOutcomeSchema) }),
89
89
  },
90
90
  },
91
+ rbac: {
92
+ ungated:
93
+ "internal OAuth refresh coordination between API processes and workers; no user flow calls it",
94
+ },
91
95
  });
92
96
 
93
97
  export async function handleCodexOAuthKeepWarm(
@@ -99,7 +103,7 @@ export async function handleCodexOAuthKeepWarm(
99
103
  const parsed = await keepWarmRoute.parse(req, res, pathSegments, new URLSearchParams());
100
104
  if (!parsed) return true;
101
105
 
102
- const apiUrl = getMcpBaseUrl();
106
+ const apiUrl = getScriptApiBaseUrl();
103
107
  const apiKey = getApiKey();
104
108
  const maxAgeMs = keepWarmMaxAgeMs();
105
109
  const slots = await loadAllCodexOAuthSlots(apiUrl, apiKey);
@@ -339,6 +339,7 @@ const reloadConfigRoute = route({
339
339
  },
340
340
  500: { description: "Reload failed" },
341
341
  },
342
+ rbac: { permission: "config.write.any" },
342
343
  });
343
344
 
344
345
  const getConfigById = route({
@@ -67,6 +67,10 @@ const postContext = route({
67
67
  404: { description: "Task not found" },
68
68
  },
69
69
  auth: { apiKey: true, agentId: true },
70
+ rbac: {
71
+ ungated:
72
+ "worker runner endpoint for its own task; the route's session posture gates any user caller",
73
+ },
70
74
  });
71
75
 
72
76
  const getContext = route({
@@ -115,6 +115,9 @@ const dbQueryRoute = route({
115
115
  429: { description: "Too many concurrent bounded db-query executions; retry shortly" },
116
116
  },
117
117
  auth: { apiKey: true },
118
+ rbac: {
119
+ ungated: "read-only SQL for agents, same posture as the db-query tool; user roles need admin",
120
+ },
118
121
  });
119
122
 
120
123
  export async function handleDbQuery(
@@ -49,6 +49,7 @@ const createEventRoute = route({
49
49
  400: { description: "Validation error" },
50
50
  },
51
51
  auth: { apiKey: true },
52
+ rbac: { ungated: "worker telemetry ingest; no user flow writes it" },
52
53
  });
53
54
 
54
55
  const createEventsBatchRoute = route({
@@ -69,6 +70,7 @@ const createEventsBatchRoute = route({
69
70
  400: { description: "Validation error" },
70
71
  },
71
72
  auth: { apiKey: true },
73
+ rbac: { ungated: "worker telemetry ingest; no user flow writes it" },
72
74
  });
73
75
 
74
76
  const getEventsRoute = route({
package/src/http/fs.ts CHANGED
@@ -295,6 +295,7 @@ const ensureAgentCredentialsRoute = route({
295
295
  500: { description: "Provisioning failed" },
296
296
  },
297
297
  auth: { apiKey: true, agentId: true },
298
+ rbac: { ungated: "worker-only: needs X-Agent-ID, which a user token cannot send" },
298
299
  });
299
300
 
300
301
  const inviteMemberRoute = route({
@@ -89,6 +89,10 @@ const claudeManagedTestRoute = route({
89
89
  schema: ClaudeManagedTestResultSchema,
90
90
  },
91
91
  },
92
+ rbac: {
93
+ ungated:
94
+ "connection test that resolves integration secrets server-side; no verb covers it, so user roles need admin",
95
+ },
92
96
  });
93
97
 
94
98
  const mcpUserConfigRoute = route({
@@ -141,6 +141,7 @@ const mcpBridgeRoute = route({
141
141
  403: { description: "Tool not in SDK allowlist" },
142
142
  404: { description: "Tool not found" },
143
143
  },
144
+ rbac: { ungated: "scripts SDK bridge: each proxied MCP tool runs its own gates" },
144
145
  });
145
146
 
146
147
  function headerValue(req: IncomingMessage, name: string): string | undefined {
@@ -153,6 +153,7 @@ const searchMemory = route({
153
153
  },
154
154
  400: { description: "Missing query or agent ID" },
155
155
  },
156
+ rbac: { ungated: "worker-only: needs X-Agent-ID, which a user token cannot send" },
156
157
  });
157
158
 
158
159
  // Mirrors `MemoryEditResult` (src/be/memory/types.ts) — `store.edit()`'s
@@ -201,6 +202,7 @@ const reEmbedMemory = route({
201
202
  summary: "Re-embed all memories using the current embedding provider",
202
203
  tags: ["Memory"],
203
204
  auth: { apiKey: true },
205
+ rbac: { permission: "memory.reembed" },
204
206
  body: z.object({
205
207
  agentId: z
206
208
  .string()
@@ -710,6 +712,7 @@ const rateMemory = route({
710
712
  400: { description: "Validation error or explicit-self R6 spam-guard rejection" },
711
713
  409: { description: "Duplicate explicit-self rating for (taskId, memoryId)" },
712
714
  },
715
+ rbac: { ungated: "worker-only: needs X-Agent-ID, which a user token cannot send" },
713
716
  });
714
717
 
715
718
  // Mirrors `RetrievalListRow` (src/be/memory/retrieval-store.ts).
@@ -225,6 +225,10 @@ const createMetricRoute = route({
225
225
  400: { description: "Invalid metric definition" },
226
226
  409: { description: "Slug already exists for this agent" },
227
227
  },
228
+ rbac: {
229
+ ungated:
230
+ "metric definitions: open to agents like the metric tools; no verb covers them, so user roles need admin",
231
+ },
228
232
  });
229
233
 
230
234
  const listMetricsRoute = route({
@@ -277,6 +281,10 @@ const updateMetricRoute = route({
277
281
  200: { description: "Metric updated", schema: metricIdVersionSchema },
278
282
  404: { description: "Metric not found" },
279
283
  },
284
+ rbac: {
285
+ ungated:
286
+ "metric definitions: open to agents like the metric tools; no verb covers them, so user roles need admin",
287
+ },
280
288
  });
281
289
 
282
290
  const deleteMetricRoute = route({
@@ -290,6 +298,10 @@ const deleteMetricRoute = route({
290
298
  204: { description: "Metric deleted" },
291
299
  404: { description: "Metric not found" },
292
300
  },
301
+ rbac: {
302
+ ungated:
303
+ "metric definitions: open to agents like the metric tools; no verb covers them, so user roles need admin",
304
+ },
293
305
  });
294
306
 
295
307
  // Wire shape of a single widget's query result inside a `run` response — see
@@ -331,6 +343,10 @@ const runMetricRoute = route({
331
343
  400: { description: "Invalid or disallowed query" },
332
344
  404: { description: "Metric not found" },
333
345
  },
346
+ rbac: {
347
+ ungated:
348
+ "metric definitions: open to agents like the metric tools; no verb covers them, so user roles need admin",
349
+ },
334
350
  });
335
351
 
336
352
  const listMetricVersionsRoute = route({
@@ -46,6 +46,10 @@ const acquireLockRoute = route({
46
46
  409: { description: "Lock is currently held by another caller" },
47
47
  400: { description: "Validation error" },
48
48
  },
49
+ rbac: {
50
+ ungated:
51
+ "internal OAuth refresh coordination between API processes and workers; no user flow calls it",
52
+ },
49
53
  });
50
54
 
51
55
  const releaseLockRoute = route({
@@ -60,6 +64,10 @@ const releaseLockRoute = route({
60
64
  204: { description: "Released (a mismatched/expired owner is a no-op, also 204)" },
61
65
  400: { description: "Validation error" },
62
66
  },
67
+ rbac: {
68
+ ungated:
69
+ "internal OAuth refresh coordination between API processes and workers; no user flow calls it",
70
+ },
63
71
  });
64
72
 
65
73
  export async function handleOAuthLocks(
@@ -71,6 +71,10 @@ route({
71
71
  401: { description: "No or invalid page-session cookie" },
72
72
  },
73
73
  auth: { apiKey: false },
74
+ rbac: {
75
+ ungated:
76
+ "the page-session cookie is the credential; the handler allowlists the target and re-issues it to /api/*",
77
+ },
74
78
  });
75
79
  route({
76
80
  method: "put",
@@ -88,6 +92,10 @@ route({
88
92
  401: { description: "No or invalid page-session cookie" },
89
93
  },
90
94
  auth: { apiKey: false },
95
+ rbac: {
96
+ ungated:
97
+ "the page-session cookie is the credential; the handler allowlists the target and re-issues it to /api/*",
98
+ },
91
99
  });
92
100
  route({
93
101
  method: "delete",
@@ -105,6 +113,10 @@ route({
105
113
  401: { description: "No or invalid page-session cookie" },
106
114
  },
107
115
  auth: { apiKey: false },
116
+ rbac: {
117
+ ungated:
118
+ "the page-session cookie is the credential; the handler allowlists the target and re-issues it to /api/*",
119
+ },
108
120
  });
109
121
  route({
110
122
  method: "patch",
@@ -122,6 +134,10 @@ route({
122
134
  401: { description: "No or invalid page-session cookie" },
123
135
  },
124
136
  auth: { apiKey: false },
137
+ rbac: {
138
+ ungated:
139
+ "the page-session cookie is the credential; the handler allowlists the target and re-issues it to /api/*",
140
+ },
125
141
  });
126
142
 
127
143
  const PROXY_PREFIX = "/@swarm/api/";
package/src/http/pages.ts CHANGED
@@ -180,6 +180,10 @@ const createPageRoute = route({
180
180
  400: { description: "Invalid body, unknown theme, or invalid themeTokens" },
181
181
  409: { description: "Slug already exists for this agent" },
182
182
  },
183
+ rbac: {
184
+ ungated:
185
+ "agents publish pages like the create-page tool; no verb covers page writes, so user roles need admin",
186
+ },
183
187
  });
184
188
 
185
189
  const getPageRoute = route({
@@ -291,6 +295,10 @@ const updatePageRoute = route({
291
295
  404: { description: "Page not found" },
292
296
  413: { description: "Payload too large" },
293
297
  },
298
+ rbac: {
299
+ ungated:
300
+ "agents publish pages like the create-page tool; no verb covers page writes, so user roles need admin",
301
+ },
294
302
  });
295
303
 
296
304
  /**
@@ -364,6 +372,7 @@ const deletePageRoute = route({
364
372
  204: { description: "Page deleted" },
365
373
  404: { description: "Page not found" },
366
374
  },
375
+ rbac: { permission: "page.delete.any" },
367
376
  });
368
377
 
369
378
  const listPagesRoute = route({
package/src/http/poll.ts CHANGED
@@ -331,6 +331,7 @@ const commitCursorsRoute = route({
331
331
  },
332
332
  400: { description: "Invalid request" },
333
333
  },
334
+ rbac: { ungated: "lead worker commits its channel-activity cursors; no user flow calls it" },
334
335
  });
335
336
 
336
337
  // ─── Handler ─────────────────────────────────────────────────────────────────
@@ -97,6 +97,7 @@ const insertPricing = route({
97
97
  400: { description: "Validation error" },
98
98
  409: { description: "Duplicate (provider, model, tokenClass, effectiveFrom)" },
99
99
  },
100
+ rbac: { ungated: "spend controls: no verb covers them, so user roles need admin" },
100
101
  });
101
102
 
102
103
  const deletePricing = route({
@@ -116,6 +117,7 @@ const deletePricing = route({
116
117
  204: { description: "Pricing row deleted" },
117
118
  404: { description: "Pricing row not found" },
118
119
  },
120
+ rbac: { ungated: "spend controls: no verb covers them, so user roles need admin" },
119
121
  });
120
122
 
121
123
  // ─── Handler ─────────────────────────────────────────────────────────────────
@@ -14,11 +14,18 @@ import {
14
14
  import { getPromptTemplateDefaultDrift } from "../prompts/default-drift";
15
15
  import { getAllTemplateDefinitions, getTemplateDefinition } from "../prompts/registry";
16
16
  import { resolveTemplate } from "../prompts/resolver";
17
+ import type { RbacResource } from "../rbac";
17
18
  import { type PromptTemplate, PromptTemplateHistorySchema, PromptTemplateSchema } from "../types";
18
19
  import { interpolate } from "../utils/template";
20
+ import { refuseAgentTokenWithout } from "./request-principal";
19
21
  import { route } from "./route-def";
20
22
  import { jsonError } from "./utils";
21
23
 
24
+ /** An agent-scope override belongs to its agent; global and repo overrides belong to no agent. */
25
+ function templateOwner(template: Pick<PromptTemplate, "scope" | "scopeId"> | null): RbacResource {
26
+ return { kind: "owned", ownerAgentId: template?.scope === "agent" ? template.scopeId : null };
27
+ }
28
+
22
29
  // ─── Response Schemas ────────────────────────────────────────────────────────
23
30
 
24
31
  /** Mirrors `EventTemplateDefinition["variables"]` entries from src/prompts/registry.ts */
@@ -129,6 +136,7 @@ const previewRoute = route({
129
136
  400: { description: "Validation error" },
130
137
  },
131
138
  auth: { apiKey: true },
139
+ rbac: { ungated: "read-only render over POST; open to agents like the prompt-template tools" },
132
140
  });
133
141
 
134
142
  const renderRoute = route({
@@ -148,6 +156,7 @@ const renderRoute = route({
148
156
  400: { description: "Validation error" },
149
157
  },
150
158
  auth: { apiKey: true },
159
+ rbac: { ungated: "read-only render over POST; open to agents like the prompt-template tools" },
151
160
  });
152
161
 
153
162
  const checkoutRoute = route({
@@ -167,6 +176,7 @@ const checkoutRoute = route({
167
176
  404: { description: "Template or version not found" },
168
177
  },
169
178
  auth: { apiKey: true },
179
+ rbac: { permission: "prompt-template.write" },
170
180
  });
171
181
 
172
182
  const resetRoute = route({
@@ -184,6 +194,7 @@ const resetRoute = route({
184
194
  404: { description: "Template not found or no code default available" },
185
195
  },
186
196
  auth: { apiKey: true },
197
+ rbac: { permission: "prompt-template.write" },
187
198
  });
188
199
 
189
200
  const getByIdRoute = route({
@@ -222,6 +233,7 @@ const deleteByIdRoute = route({
222
233
  404: { description: "Template not found" },
223
234
  },
224
235
  auth: { apiKey: true },
236
+ rbac: { permission: "prompt-template.write" },
225
237
  });
226
238
 
227
239
  const listRoute = route({
@@ -268,6 +280,7 @@ const upsertRoute = route({
268
280
  400: { description: "Validation error" },
269
281
  },
270
282
  auth: { apiKey: true },
283
+ rbac: { permission: "prompt-template.write" },
271
284
  });
272
285
 
273
286
  // ─── Handler ─────────────────────────────────────────────────────────────────
@@ -361,6 +374,10 @@ export async function handlePromptTemplates(
361
374
  if (checkoutRoute.match(req.method, pathSegments)) {
362
375
  const parsed = await checkoutRoute.parse(req, res, pathSegments, queryParams);
363
376
  if (!parsed) return true;
377
+ const target = await getPromptTemplateById(parsed.params.id);
378
+ if (await refuseAgentTokenWithout(req, res, "prompt-template.write", templateOwner(target))) {
379
+ return true;
380
+ }
364
381
 
365
382
  try {
366
383
  const template = await checkoutPromptTemplate(parsed.params.id, parsed.body.version);
@@ -386,6 +403,9 @@ export async function handlePromptTemplates(
386
403
  jsonError(res, `Prompt template ${parsed.params.id} not found`, 404);
387
404
  return true;
388
405
  }
406
+ if (await refuseAgentTokenWithout(req, res, "prompt-template.write", templateOwner(existing))) {
407
+ return true;
408
+ }
389
409
 
390
410
  const definition = getTemplateDefinition(existing.eventType);
391
411
  if (!definition) {
@@ -428,6 +448,10 @@ export async function handlePromptTemplates(
428
448
  if (deleteByIdRoute.match(req.method, pathSegments)) {
429
449
  const parsed = await deleteByIdRoute.parse(req, res, pathSegments, queryParams);
430
450
  if (!parsed) return true;
451
+ const target = await getPromptTemplateById(parsed.params.id);
452
+ if (await refuseAgentTokenWithout(req, res, "prompt-template.write", templateOwner(target))) {
453
+ return true;
454
+ }
431
455
 
432
456
  try {
433
457
  const deleted = await deletePromptTemplate(parsed.params.id);
@@ -483,6 +507,16 @@ export async function handlePromptTemplates(
483
507
  jsonError(res, "Agent/repo scope requires scopeId", 400);
484
508
  return true;
485
509
  }
510
+ if (
511
+ await refuseAgentTokenWithout(
512
+ req,
513
+ res,
514
+ "prompt-template.write",
515
+ templateOwner({ scope, scopeId: scopeId ?? null }),
516
+ )
517
+ ) {
518
+ return true;
519
+ }
486
520
 
487
521
  try {
488
522
  // Same rationale as the reset route: serialize the sync raw-handle
@@ -151,6 +151,9 @@ const createSchedule = route({
151
151
  400: { description: "Validation error" },
152
152
  409: { description: "Duplicate name" },
153
153
  },
154
+ rbac: {
155
+ ungated: "matches PATCH /api/schedules/{id}: bearer-authenticated agents may manage schedules",
156
+ },
154
157
  });
155
158
 
156
159
  const runScheduleNow = route({
@@ -172,6 +175,7 @@ const runScheduleNow = route({
172
175
  400: { description: "Schedule is disabled" },
173
176
  404: { description: "Schedule not found" },
174
177
  },
178
+ rbac: { permission: "schedule.run.any" },
175
179
  });
176
180
 
177
181
  const listSchedules = route({
@@ -245,6 +249,9 @@ const updateSchedule = route({
245
249
  404: { description: "Schedule not found" },
246
250
  409: { description: "Duplicate name" },
247
251
  },
252
+ rbac: {
253
+ ungated: "matches PATCH /api/schedules/{id}: bearer-authenticated agents may manage schedules",
254
+ },
248
255
  });
249
256
 
250
257
  const patchSchedule = route({
@@ -281,6 +288,9 @@ const deleteSchedule = route({
281
288
  200: { description: "Schedule deleted", schema: z.object({ success: z.literal(true) }) },
282
289
  404: { description: "Schedule not found" },
283
290
  },
291
+ rbac: {
292
+ ungated: "matches PATCH /api/schedules/{id}: bearer-authenticated agents may manage schedules",
293
+ },
284
294
  });
285
295
 
286
296
  // ─── Handler ─────────────────────────────────────────────────────────────────
@@ -223,6 +223,10 @@ const deleteScriptRunRoute = route({
223
223
  204: { description: "Script run cancelled, or already terminal" },
224
224
  404: { description: "Script run not found" },
225
225
  },
226
+ rbac: {
227
+ ungated:
228
+ "script workflow runs: open to agents like the script tools; no verb covers cancel, so user roles need admin",
229
+ },
226
230
  });
227
231
 
228
232
  const getInternalStepRoute = route({
@@ -254,6 +258,10 @@ const postInternalStepRoute = route({
254
258
  201: { description: "Journal step written", schema: z.object({ ok: z.literal(true) }) },
255
259
  404: { description: "Script run not found" },
256
260
  },
261
+ rbac: {
262
+ ungated:
263
+ "script-run subprocess callback authenticated by the run credential; no user flow calls it",
264
+ },
257
265
  });
258
266
 
259
267
  const heartbeatRoute = route({
@@ -268,6 +276,10 @@ const heartbeatRoute = route({
268
276
  204: { description: "Heartbeat recorded" },
269
277
  404: { description: "Script run not found" },
270
278
  },
279
+ rbac: {
280
+ ungated:
281
+ "script-run subprocess callback authenticated by the run credential; no user flow calls it",
282
+ },
271
283
  });
272
284
 
273
285
  const statusRoute = route({
@@ -283,6 +295,10 @@ const statusRoute = route({
283
295
  204: { description: "Status updated" },
284
296
  404: { description: "Script run not found" },
285
297
  },
298
+ rbac: {
299
+ ungated:
300
+ "script-run subprocess callback authenticated by the run credential; no user flow calls it",
301
+ },
286
302
  });
287
303
 
288
304
  const rawLlmRoute = route({
@@ -297,6 +313,10 @@ const rawLlmRoute = route({
297
313
  200: { description: "LLM call completed", schema: RawLlmOutputSchema },
298
314
  500: { description: "LLM call failed" },
299
315
  },
316
+ rbac: {
317
+ ungated:
318
+ "script-run subprocess callback authenticated by the run credential; no user flow calls it",
319
+ },
300
320
  });
301
321
 
302
322
  const agentTaskRoute = route({
@@ -326,6 +346,10 @@ const agentTaskRoute = route({
326
346
  409: { description: "Agent task failed, was cancelled, or was superseded" },
327
347
  422: { description: "Blocked by the follow-up re-delegation guard" },
328
348
  },
349
+ rbac: {
350
+ ungated:
351
+ "script-run subprocess callback authenticated by the run credential; no user flow calls it",
352
+ },
329
353
  });
330
354
 
331
355
  /**
@@ -316,6 +316,7 @@ const runRoute = route({
316
316
  409: { description: "Object busy, re-entry, or lease lost" },
317
317
  501: { description: "workspace-rw scripts are not supported in v1" },
318
318
  },
319
+ rbac: { permission: "script.run" },
319
320
  });
320
321
 
321
322
  const searchRoute = route({
@@ -154,6 +154,7 @@ const createSessionLogsRoute = route({
154
154
  },
155
155
  400: { description: "Validation error" },
156
156
  },
157
+ rbac: { ungated: "worker telemetry ingest; no user flow writes it" },
157
158
  });
158
159
 
159
160
  const getSessionLogsByTask = route({
@@ -255,6 +256,7 @@ const createSessionCostRoute = route({
255
256
  403: { description: "Untrusted session attribution" },
256
257
  409: { description: "Session identity conflict" },
257
258
  },
259
+ rbac: { ungated: "worker telemetry ingest; no user flow writes it" },
258
260
  });
259
261
 
260
262
  const getSessionCostSummaryRoute = route({
@@ -866,6 +866,7 @@ const postTestConnection = route({
866
866
  401: { description: "Unauthorized" },
867
867
  },
868
868
  auth: { apiKey: true },
869
+ rbac: { ungated: "reads worker-reported credential status over POST; writes nothing" },
869
870
  });
870
871
 
871
872
  // ─── Handler ─────────────────────────────────────────────────────────────────
package/src/http/tasks.ts CHANGED
@@ -494,6 +494,10 @@ const updateSession = route({
494
494
  200: { description: "Session ID updated", schema: AgentTaskSchema },
495
495
  404: { description: "Task not found" },
496
496
  },
497
+ rbac: {
498
+ ungated:
499
+ "worker runner endpoint for its own task; the route's session posture gates any user caller",
500
+ },
497
501
  });
498
502
 
499
503
  const cancelTaskRoute = route({
@@ -708,6 +712,7 @@ const updateTaskProgressRoute = route({
708
712
  session: { taskParam: "id" },
709
713
  summary: "Update task progress text",
710
714
  tags: ["Tasks"],
715
+ rbac: { permission: "task.progress.write" },
711
716
  params: z.object({ id: z.string() }),
712
717
  body: z.object({ progress: z.string().min(1) }),
713
718
  responses: {
@@ -749,6 +754,10 @@ const finishTask = route({
749
754
  schema: FinishTaskConflictSchema,
750
755
  },
751
756
  },
757
+ rbac: {
758
+ ungated:
759
+ "worker runner endpoint for its own task; the route's session posture gates any user caller",
760
+ },
752
761
  });
753
762
 
754
763
  const listPausedTasks = route({
@@ -876,6 +885,10 @@ const supersedeTaskRoute = route({
876
885
  403: { description: "Task belongs to another agent" },
877
886
  404: { description: "Task not found" },
878
887
  },
888
+ rbac: {
889
+ ungated:
890
+ "worker runner endpoint for its own task; the route's session posture gates any user caller",
891
+ },
879
892
  });
880
893
 
881
894
  const updateTaskVcsRoute = route({
@@ -898,6 +911,10 @@ const updateTaskVcsRoute = route({
898
911
  404: { description: "Task not found" },
899
912
  },
900
913
  auth: { apiKey: true },
914
+ rbac: {
915
+ ungated:
916
+ "worker runner endpoint for its own task; the route's session posture gates any user caller",
917
+ },
901
918
  });
902
919
 
903
920
  const updateTaskTitleRoute = route({
@@ -157,6 +157,7 @@ const jiraRefresh = route({
157
157
  500: { description: "Refresh failed (e.g. revoked grant, network error)" },
158
158
  503: { description: "Jira integration not configured" },
159
159
  },
160
+ rbac: { permission: "oauth-authorization.manage" },
160
161
  });
161
162
 
162
163
  const jiraWebhook = route({
@@ -173,6 +174,7 @@ const jiraWebhook = route({
173
174
  401: { description: "Invalid URL token" },
174
175
  503: { description: "Jira webhook handler not configured" },
175
176
  },
177
+ rbac: { ungated: "inbound Jira webhook: the URL token is the credential, no bearer principal" },
176
178
  });
177
179
 
178
180
  // Admin: register a new dynamic webhook with Atlassian. apiKey is required
@@ -117,6 +117,7 @@ const linearRefresh = route({
117
117
  500: { description: "Refresh failed" },
118
118
  503: { description: "Linear integration not configured" },
119
119
  },
120
+ rbac: { permission: "oauth-authorization.manage" },
120
121
  });
121
122
 
122
123
  const linearWebhook = route({
@@ -131,6 +132,9 @@ const linearWebhook = route({
131
132
  401: { description: "Invalid signature" },
132
133
  503: { description: "Linear integration not configured" },
133
134
  },
135
+ rbac: {
136
+ ungated: "inbound webhook: the provider signature is the credential, no bearer principal",
137
+ },
134
138
  });
135
139
 
136
140
  // Admin: full disconnect — best-effort revoke the OAuth grant with Linear,