@desplega.ai/agent-swarm 2.14.0 → 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.
- package/dist/acp-adapter-q1vz4hh2.js +17 -0
- package/dist/{acp-targets-23exz4z4.js → acp-targets-d44eerh4.js} +10 -10
- package/dist/{actions-zcr25x27.js → actions-z4k4bvss.js} +28 -28
- package/dist/{agent-fs-provision-7fa9e12e.js → agent-fs-provision-aan1cgpx.js} +4 -4
- package/dist/{amp-adapter-s7ytmv6b.js → amp-adapter-wac3py0p.js} +3 -3
- package/dist/{anthropic-messages-vdd1zmha.js → anthropic-messages-njt2r5m4.js} +28 -27
- package/dist/{app-5d3sz1hy.js → app-wax6qz5e.js} +10 -10
- package/dist/{approval-notifications-7qgkzkzx.js → approval-notifications-6fvkhnma.js} +11 -11
- package/dist/{assistant-p2yvhc3j.js → assistant-e8fe08zx.js} +29 -29
- package/dist/{azure-openai-responses-jeaas6x0.js → azure-openai-responses-6ewf9rwp.js} +6 -6
- package/dist/{boot-args-schema-ry6cb0p7.js → boot-args-schema-rv97cmnt.js} +1 -1
- package/dist/{boot-reembed-c9643ms3.js → boot-reembed-bcn7frk9.js} +1 -1
- package/dist/{boot-reembed-2hkm3vz2.js → boot-reembed-xakrdy6y.js} +1 -1
- package/dist/{boot-scrub-sweep-3ycxr51t.js → boot-scrub-sweep-20t8akhf.js} +2 -2
- package/dist/{boot-seeds-2hzvvzg0.js → boot-seeds-48rr6r29.js} +4 -4
- package/dist/{boxd-9py3x0jb.js → boxd-tjpxwecx.js} +3 -3
- package/dist/{claude-adapter-dnkww93e.js → claude-adapter-0wzwntrj.js} +12 -13
- package/dist/{claude-managed-adapter-yk0cr5x6.js → claude-managed-adapter-4xcgt46w.js} +4 -4
- package/dist/{claude-managed-setup-4byxpp47.js → claude-managed-setup-91cyktw7.js} +7 -7
- package/dist/{claude-sdk-session-4wf3dbvs.js → claude-sdk-session-ngj4dce5.js} +11144 -12464
- package/dist/{cli-gcyws2bp.js → cli-021hrewp.js} +2 -2
- package/dist/{cli-wvgg7r4j.js → cli-08gfvs58.js} +2 -2
- package/dist/{cli-2zjxake1.js → cli-0kyjrbaa.js} +4 -4
- package/dist/{cli-rp1n2xpd.js → cli-0nvqg1hb.js} +1 -1
- package/dist/{cli-vxmmttmt.js → cli-0nz04gqv.js} +50 -50
- package/dist/{cli-vr4eyq6p.js → cli-0rrft7s3.js} +538 -410
- package/dist/{cli-mw1tmn3x.js → cli-1d9q7qrn.js} +7 -7
- package/dist/{cli-84xn7bgz.js → cli-1t5vhrpv.js} +1 -1
- package/dist/{cli-hzhv7yac.js → cli-1zbj28py.js} +1 -1
- package/dist/{cli-z8t4485r.js → cli-2ja7eadd.js} +2 -2
- package/dist/{cli-r04ve9xw.js → cli-2r62jy9s.js} +1 -1
- package/dist/{cli-9fwznq4p.js → cli-3ffzr65w.js} +7 -7
- package/dist/{cli-2ckwgs7q.js → cli-3kdgm393.js} +5 -5
- package/dist/{cli-jwnac23b.js → cli-3vc518cw.js} +1 -1
- package/dist/{cli-6p8p2e6r.js → cli-5188hq0a.js} +1286 -31
- package/dist/{cli-zcghfsdg.js → cli-53gt8wfv.js} +1 -1
- package/dist/{cli-930zbczq.js → cli-5njmmmer.js} +3 -3
- package/dist/{cli-dw9rtjm3.js → cli-5rw7nt99.js} +3061 -727
- package/dist/{cli-6c61yjwy.js → cli-5xx353cy.js} +7554 -1534
- package/dist/{cli-2ap1the6.js → cli-65k149j5.js} +2 -2
- package/dist/{cli-v41kn3cd.js → cli-6prwz0zn.js} +4427 -5566
- package/dist/{cli-yd7e590v.js → cli-6zpn5hmp.js} +12 -12
- package/dist/{cli-ty3gha1p.js → cli-7b9bwrfg.js} +2 -2
- package/dist/{cli-2414h5r9.js → cli-7dpdq7yh.js} +11428 -1914
- package/dist/{cli-r9d2tya0.js → cli-7qkbab03.js} +5 -5
- package/dist/{cli-7ca8hczj.js → cli-7svwhw1a.js} +1 -1
- package/dist/cli-7wwewkf4.js +37 -0
- package/dist/{cli-ejnhs815.js → cli-83hynhes.js} +17 -13
- package/dist/{cli-rs1rzwp4.js → cli-8crn0510.js} +1 -1
- package/dist/{cli-f2rwt43y.js → cli-8ee7xt75.js} +13 -13
- package/dist/{cli-9j47sgzy.js → cli-8ef94zm2.js} +2 -2
- package/dist/{cli-9fvk9mv8.js → cli-8gr1bg9t.js} +1 -1
- package/dist/{cli-b0m3bg0f.js → cli-9j1qcs0b.js} +1 -1
- package/dist/{cli-ad00h1st.js → cli-9mvfvggt.js} +7 -7
- package/dist/{cli-xh5fpmg8.js → cli-9txap41q.js} +101 -18
- package/dist/{cli-24wervhz.js → cli-aktk3qt6.js} +3 -3
- package/dist/{cli-6ajyhxh7.js → cli-an8bpy60.js} +2 -2
- package/dist/{cli-meydjstb.js → cli-azptj8xe.js} +5591 -69
- package/dist/cli-c0rt16vk.js +15 -0
- package/dist/{cli-w4bvtxet.js → cli-c6vhcknq.js} +7 -7
- package/dist/{cli-2savn6mm.js → cli-cczffwak.js} +7 -7
- package/dist/{cli-ze1ndjs4.js → cli-cgmka83w.js} +3 -3
- package/dist/{cli-kc7vd07m.js → cli-d13qgcct.js} +3699 -1733
- package/dist/{cli-k3facve0.js → cli-d5nvy1jy.js} +1 -1
- package/dist/{cli-edxfzgah.js → cli-dev6f0px.js} +4 -4
- package/dist/{cli-0e914dp9.js → cli-dzhht0vq.js} +3 -3
- package/dist/{cli-m0ea8ggd.js → cli-e13kbyq0.js} +2 -2
- package/dist/{cli-73rmgm45.js → cli-e2k0ej0d.js} +2 -2
- package/dist/cli-ek8b88kv.js +9740 -0
- package/dist/{cli-0k7ppk9k.js → cli-ertcjw6z.js} +281 -46
- package/dist/{cli-qrwjk4xy.js → cli-f3ta4e67.js} +5 -5
- package/dist/{cli-1nfabrt4.js → cli-f4xv7s0t.js} +7 -7
- package/dist/{cli-phe2vcw5.js → cli-fdam1t9b.js} +171 -104
- package/dist/{cli-gc6b94tj.js → cli-fe8he9cy.js} +2 -2
- package/dist/{cli-spfz393q.js → cli-feh37wgs.js} +598 -219
- package/dist/{cli-ebqx630g.js → cli-fjzjtqna.js} +35 -18
- package/dist/{cli-37p61fcg.js → cli-fs9t2m2k.js} +18 -20
- package/dist/{cli-7w1fs01q.js → cli-g03x26q6.js} +2 -2
- package/dist/{cli-879txsac.js → cli-gnkzh8ed.js} +4 -4
- package/dist/{cli-v4z5v3jd.js → cli-gy0r7gb8.js} +514 -337
- package/dist/{cli-s4pccby1.js → cli-h0edykd1.js} +1 -1
- package/dist/{cli-pq0kv31y.js → cli-h364asjc.js} +9 -9
- package/dist/{cli-69szn7w7.js → cli-h3xcfp4c.js} +93 -54
- package/dist/{cli-jcnc5ret.js → cli-h8k5801a.js} +73 -27
- package/dist/{cli-6yy4fepf.js → cli-h96yp7xv.js} +4 -4
- package/dist/{cli-q5n3deaf.js → cli-hab0bvrh.js} +1 -1
- package/dist/{cli-g6a696c0.js → cli-j3wqt73b.js} +4 -4
- package/dist/{cli-wym6rxgt.js → cli-jfgaz10x.js} +10 -15
- package/dist/{cli-shyhb4t5.js → cli-jrhvywah.js} +53 -52
- package/dist/{cli-qkbevqer.js → cli-jrxt5j0n.js} +3 -3
- package/dist/{cli-7b7rxz22.js → cli-jw7n9pct.js} +5 -2
- package/dist/{cli-8vbxjzk0.js → cli-k9kfck3s.js} +3 -3
- package/dist/{cli-yjb3cddd.js → cli-kkwq5b12.js} +1 -1
- package/dist/{cli-39t9d248.js → cli-kz8rar0g.js} +1 -1
- package/dist/{cli-rzbsh6bw.js → cli-n15fhd43.js} +1 -1
- package/dist/{cli-1jx0srjt.js → cli-nc842kc9.js} +1921 -80
- package/dist/{cli-9j1t3kf6.js → cli-nmj4phcg.js} +2 -2
- package/dist/{cli-t9pzz2eq.js → cli-ntmjzyte.js} +4 -1
- package/dist/{cli-adzmmcvf.js → cli-praaw1wh.js} +2 -2
- package/dist/{cli-f9g96z28.js → cli-q44p4869.js} +11 -11
- package/dist/{cli-fww016hh.js → cli-q58qt9dw.js} +1711 -7287
- package/dist/{cli-njvpngc6.js → cli-qqz5z36e.js} +3 -3
- package/dist/{cli-096aftq6.js → cli-r7rpy2xz.js} +7 -7
- package/dist/cli-rcqgr0hs.js +30 -0
- package/dist/{cli-ph95yejc.js → cli-rjc464jg.js} +2 -2
- package/dist/{cli-md4tn21h.js → cli-rw3m83j4.js} +40 -26
- package/dist/cli-rwcj6wt3.js +1291 -0
- package/dist/{cli-srq69pn1.js → cli-ryn4y478.js} +1 -1
- package/dist/{cli-jgq9xptq.js → cli-s48k2rzx.js} +4 -4
- package/dist/{cli-cbg0j1yt.js → cli-s90wcbk9.js} +3 -3
- package/dist/{cli-2ayk9gn8.js → cli-svcy72s5.js} +2 -2
- package/dist/{cli-4dyzzkfb.js → cli-swtwbg85.js} +944 -170
- package/dist/{cli-mv8ft7b0.js → cli-t1bqpzgz.js} +3 -3
- package/dist/{cli-tc165vrb.js → cli-t5jbjq61.js} +4 -3
- package/dist/{cli-enavhq6r.js → cli-tbrjvrrg.js} +1 -1
- package/dist/{cli-mz7ycqn8.js → cli-td2h8zej.js} +6 -6
- package/dist/{cli-9t7syepg.js → cli-ttatvwn6.js} +1 -1
- package/dist/{cli-ayxxkk3p.js → cli-txxcf9s1.js} +8 -8
- package/dist/{cli-q4z9s6zs.js → cli-v7az4d1g.js} +2 -2
- package/dist/cli-vqt44168.js +14 -0
- package/dist/{cli-q457ga28.js → cli-vs9h3vw2.js} +14 -14
- package/dist/{cli-snxhtehz.js → cli-w2fg8kjc.js} +7 -8
- package/dist/{cli-wd7b5hgc.js → cli-w81s97bn.js} +1 -1
- package/dist/{cli-bqfx72e6.js → cli-wkzrknpt.js} +1 -1
- package/dist/{cli-cg1q8ymp.js → cli-wqpvfq2m.js} +1 -1
- package/dist/{cli-kg63yp1r.js → cli-wz7qj1jy.js} +19 -19
- package/dist/{cli-3wsabyt0.js → cli-x5t54ytt.js} +2 -2
- package/dist/{cli-r495stwd.js → cli-xd6ntv7x.js} +2 -2
- package/dist/{cli-wvbaq052.js → cli-xphbv66z.js} +10 -3
- package/dist/{cli-a49frv85.js → cli-xxgqn93n.js} +3753 -1186
- package/dist/{cli-91amj3md.js → cli-z209g721.js} +111 -87
- package/dist/{cli-3mhdmcd4.js → cli-z5andw8k.js} +1 -1
- package/dist/{cli-7g5qj2ca.js → cli-zcb64xzv.js} +1 -1
- package/dist/{cli-0h6m6z5g.js → cli-zr2sc5tr.js} +1 -1
- package/dist/{cli-krk8y8c7.js → cli-zrm0610v.js} +1833 -518
- package/dist/cli.js +73 -73
- package/dist/{cloudflare-workers-ai-system-one-w3m0fbf8.js → cloudflare-workers-ai-system-one-kb0tq22h.js} +2 -2
- package/dist/{codex-adapter-eq61radw.js → codex-adapter-0c1ynrmt.js} +9 -9
- package/dist/{codex-hook-8nmepvz6.js → codex-hook-w5nmtrn2.js} +2 -2
- package/dist/{codex-login-vbd9707w.js → codex-login-67qarfcg.js} +1 -1
- package/dist/{codex-session-runner-rfx355h4.js → codex-session-runner-z4t9z7yy.js} +10 -10
- package/dist/{commands-d1z0sx62.js → commands-h0jxqdhk.js} +3 -3
- package/dist/{controller-9hz6d8x3.js → controller-4ygy66hv.js} +4 -4
- package/dist/{controllers-connect-tz07d2xr.js → controllers-connect-ynbvv8pv.js} +28 -28
- package/dist/core-mj9fzrcm.js +41 -0
- package/dist/{cursor-adapter-ef22ze3j.js → cursor-adapter-9e4d6658.js} +2 -2
- package/dist/{db-gd81d68c.js → db-bg0hxjq1.js} +3 -3
- package/dist/{db-vrckks6q.js → db-q12gmpns.js} +2 -2
- package/dist/{devin-adapter-kdt6a2bh.js → devin-adapter-tn1twrha.js} +1 -1
- package/dist/{devtools-qxfgbsqz.js → devtools-t8my9az6.js} +1 -1
- package/dist/{dispatcher-76as8w2t.js → dispatcher-v5dbfscq.js} +24 -24
- package/dist/{docker-51ta7jsh.js → docker-6007r2fj.js} +2 -2
- package/dist/{dsh-adapter-ypfvcdyz.js → dsh-adapter-z3fneea1.js} +2 -2
- package/dist/{e2b-05kn3kpq.js → e2b-k3kb8b52.js} +4 -4
- package/dist/{e2b-dm9r8hpy.js → e2b-p269awh6.js} +5 -5
- package/dist/{easter-egg-3d-sg21j15g.js → easter-egg-3d-y49v5z90.js} +1 -1
- package/dist/{embedding-space-zsdw37bb.js → embedding-space-mjt5ksq0.js} +5 -5
- package/dist/{embeddings-p4e3e1m6.js → embeddings-td9hgnc5.js} +1 -1
- package/dist/emscripten-module-Q67P5WYC-3sde6cre.js +2458 -0
- package/dist/{event-bus-tvf2grf4.js → event-bus-pawddp92.js} +1 -1
- package/dist/{execute-nztd0af0.js → execute-z8nc8bba.js} +1 -1
- package/dist/{external-channel-717yzn4d.js → external-channel-pjenc2ag.js} +2 -2
- package/dist/ffi-cbfmmtqk.js +85 -0
- package/dist/fx-adapter-pjeztp0n.js +20 -0
- package/dist/getMachineId-bsd-hjs2tbdp.js +36 -0
- package/dist/getMachineId-darwin-kzbvr8s3.js +40 -0
- package/dist/getMachineId-linux-embmcq2c.js +26 -0
- package/dist/getMachineId-unsupported-jvznc6d4.js +20 -0
- package/dist/getMachineId-win-qr8z0b13.js +36 -0
- package/dist/{google-generative-ai-sw77egmr.js → google-generative-ai-tf3w7557.js} +11 -16
- package/dist/{google-vertex-rrw93g8h.js → google-vertex-9pj87bd8.js} +15 -17
- package/dist/grok-adapter-davbhx8t.js +20 -0
- package/dist/handlers-rf130hnp.js +39 -0
- package/dist/heartbeat-9hmvqxk0.js +49 -0
- package/dist/hook-0b1jqs2t.js +21 -0
- package/dist/{hook-ctz0xmp3.js → hook-1n0sjv8p.js} +10 -11
- package/dist/{http-zregegrx.js → http-vykejyjx.js} +432 -170
- package/dist/{index-7dgxveck.js → index-07d66kdm.js} +3 -3
- package/dist/index-0hgjxqz8.js +10584 -0
- package/dist/{index-rz8ve510.js → index-0nt39qwy.js} +2 -2
- package/dist/{index-ym9fgxad.js → index-2xbxq71g.js} +2 -2
- package/dist/{index-42jq9yy3.js → index-3j8hffkb.js} +12327 -7450
- package/dist/index-8w09aggw.js +43 -0
- package/dist/{index-5kx15d19.js → index-b3wy4jzs.js} +1 -1
- package/dist/{index-kzdqn3dd.js → index-dt9vr7tb.js} +3143 -760
- package/dist/{index-maddg9ys.js → index-ezfas4jj.js} +5858 -15337
- package/dist/index-g2jntx15.js +38 -0
- package/dist/{index-x9qf8dg7.js → index-j6sqtb83.js} +105 -75
- package/dist/{index-m6g8q65g.js → index-na0tczq0.js} +9268 -10220
- package/dist/{index-whysn1wf.js → index-p9dkwhwe.js} +1 -1
- package/dist/{index-126v2d0t.js → index-pe2etczf.js} +6 -2918
- package/dist/{index-mtnbhe12.js → index-q60mhcpd.js} +23631 -19921
- package/dist/index-qffex5k4.js +41 -0
- package/dist/index-qrp11tp9.js +4 -0
- package/dist/{index-kdmkfjt7.js → index-ryyrg0d8.js} +3426 -2333
- package/dist/{index-t17p395x.js → index-sf06w57a.js} +13 -13
- package/dist/{index-evay0xyk.js → index-vybnwd5v.js} +1 -1
- package/dist/{index-fdym6ryb.js → index-wsf1f5pe.js} +28 -28
- package/dist/{k8s-ejkk0aw7.js → k8s-mr1r12th.js} +2 -2
- package/dist/{keepalive-zdqay870.js → keepalive-86z0tzzf.js} +4 -4
- package/dist/lead-edmwagkn.js +81 -0
- package/dist/{llama-cpp-classify-yvb8vh7w.js → llama-cpp-classify-wd7htn1x.js} +2 -2
- package/dist/{maintenance-t5ndg11m.js → maintenance-19h6tfwz.js} +1 -1
- package/dist/{mistral-conversations-w4bncwbt.js → mistral-conversations-txjmc64f.js} +7 -7
- package/dist/module-ES6BEMUI-44w9s1dx.js +1210 -0
- package/dist/{multipart-parser-xevcstye.js → multipart-parser-xqbgwrav.js} +1 -1
- package/dist/{node-0as4n1ef.js → node-q4628t0b.js} +1 -1
- package/dist/{oauth-refresh-sweep-y9zyd7t6.js → oauth-refresh-sweep-6nmyrv32.js} +3 -3
- package/dist/{object-webhooks-mkca91s0.js → object-webhooks-2kynmdf8.js} +7 -7
- package/dist/{onboard-ss995244.js → onboard-zbpm96mn.js} +7 -7
- package/dist/{openai-codex-responses-70g39cgz.js → openai-codex-responses-6ckhys6r.js} +35 -29
- package/dist/{openai-completions-cv3hp4h5.js → openai-completions-c9dsq9jh.js} +15 -15
- package/dist/{openai-decisions-fyq1p9f9.js → openai-decisions-9vzvv10c.js} +2 -2
- package/dist/{openai-responses-trsvnks6.js → openai-responses-bhfmt9sa.js} +6 -6
- package/dist/{opencode-adapter-mwpz0278.js → opencode-adapter-fyqcbdra.js} +8 -8
- package/dist/{openrouter-images-0jj12a2q.js → openrouter-images-hkk5p580.js} +3 -3
- package/dist/otel-impl-txa20w1h.js +11178 -0
- package/dist/{pending-2sxh1t6j.js → pending-4rxawq8y.js} +25 -25
- package/dist/{pi-messages-zk3g4esn.js → pi-messages-py3f96p7.js} +5 -5
- package/dist/{pi-mono-adapter-sfb7zy43.js → pi-mono-adapter-rnsed1xa.js} +24 -27
- package/dist/{pricing-refresh-h79bg4cf.js → pricing-refresh-4314hwtw.js} +2 -2
- package/dist/{rbac-roles-ckq0czp4.js → rbac-roles-fztcm8ky.js} +2 -2
- package/dist/{rbac-roles-jg2e260w.js → rbac-roles-msqt7a3k.js} +3 -3
- package/dist/{render-v2-ymbshmn0.js → render-v2-w49wtecg.js} +10 -10
- package/dist/{resume-jdhnt4jk.js → resume-gwgtp4m3.js} +13 -13
- package/dist/{runtime-y28jhhnf.js → runtime-kkebz8yq.js} +1 -1
- package/dist/{session-access-k4ta5hvp.js → session-access-kjb19m2w.js} +5 -5
- package/dist/{session-source-backfill-528j4s8j.js → session-source-backfill-805p4wqr.js} +3 -3
- package/dist/{setup-d6pj82fr.js → setup-q8y168c8.js} +3 -3
- package/dist/thread-buffer-yqbffd0t.js +40 -0
- package/dist/{token-util-pjgekqxr.js → token-util-hnzceyn9.js} +1 -1
- package/dist/{token-pgr2w4s3.js → token-xnc02n6w.js} +21 -14
- package/dist/{tree-visibility-kjxv3nxk.js → tree-visibility-qj323994.js} +2 -2
- package/dist/{typesafe-system-one-qkvkgrcz.js → typesafe-system-one-avrdb4zm.js} +2 -2
- package/dist/{user-merge-jobs-rabbncf6.js → user-merge-jobs-qfp40f2s.js} +3 -3
- package/dist/{virtual-modules-22k51txd.js → virtual-modules-nzxegw0a.js} +7 -7
- package/dist/{work-objects-xtjbar3r.js → work-objects-hs089w60.js} +26 -26
- package/dist/{worker-follow-up-fg48vk6d.js → worker-follow-up-zwgg20sr.js} +24 -24
- package/dist/worker-kg4g7rnx.js +81 -0
- package/dist/{x-vfsqypht.js → x-k29vmskt.js} +2 -2
- package/openapi.json +59 -3
- package/package.json +53 -52
- package/plugin/commands/create-pr.md +5 -2
- package/plugin/pi-skills/create-pr/SKILL.md +5 -2
- package/src/apps/sync.ts +7 -2
- package/src/be/db/model-profiles.ts +103 -12
- package/src/be/db/tasks/read.ts +5 -0
- package/src/be/db/workflow-runs.ts +12 -8
- package/src/be/db.ts +18 -5
- package/src/be/migrations/367_workflow_run_principal.sql +5 -0
- package/src/be/model-group-resolution.ts +134 -0
- package/src/be/model-tier-resolution.ts +120 -17
- package/src/be/model-validation.ts +9 -1
- package/src/be/runtime-pools/routing.ts +22 -8
- package/src/be/scripts/extract-schema.ts +7 -0
- package/src/be/swarm-config-guard.ts +20 -7
- package/src/be/task-auto-title-listener.ts +2 -2
- package/src/commands/onboard/agent-fs-version.ts +1 -1
- package/src/extensions/contract-types.generated.ts +1 -1
- package/src/extensions/post-bridge.ts +27 -28
- package/src/http/active-sessions.ts +7 -0
- package/src/http/agents.ts +7 -0
- package/src/http/api-keys.ts +7 -0
- package/src/http/approval-requests.ts +4 -0
- package/src/http/budgets.ts +2 -0
- package/src/http/codex-oauth-keep-warm.ts +6 -2
- package/src/http/config.ts +1 -0
- package/src/http/context.ts +4 -0
- package/src/http/db-query.ts +11 -2
- package/src/http/events.ts +2 -0
- package/src/http/fs.ts +1 -0
- package/src/http/integrations.ts +4 -0
- package/src/http/mcp-bridge.ts +1 -0
- package/src/http/memory.ts +3 -0
- package/src/http/metrics.ts +16 -0
- package/src/http/oauth-locks.ts +8 -0
- package/src/http/operator-actor.ts +3 -8
- package/src/http/page-proxy.ts +16 -0
- package/src/http/pages.ts +9 -0
- package/src/http/poll.ts +21 -1
- package/src/http/pricing.ts +2 -0
- package/src/http/prompt-templates.ts +34 -0
- package/src/http/repos.ts +3 -1
- package/src/http/schedules.ts +33 -3
- package/src/http/script-runs.ts +24 -0
- package/src/http/scripts.ts +1 -0
- package/src/http/session-data.ts +2 -0
- package/src/http/status.ts +1 -0
- package/src/http/tasks.ts +28 -1
- package/src/http/trackers/jira.ts +2 -0
- package/src/http/trackers/linear.ts +4 -0
- package/src/http/users.ts +18 -0
- package/src/http/webhooks.ts +12 -0
- package/src/http/workflow-events.ts +26 -6
- package/src/http/workflows.ts +40 -0
- package/src/http/x.ts +4 -0
- package/src/linear/app.ts +3 -2
- package/src/linear/client.ts +5 -1
- package/src/linear/host.ts +40 -0
- package/src/linear/oauth.ts +3 -2
- package/src/linear/sync.ts +4 -3
- package/src/otel-impl.ts +8 -5
- package/src/prompts/base-prompt.ts +10 -6
- package/src/prompts/session-templates.ts +3 -3
- package/src/providers/acp-targets.ts +1 -1
- package/src/providers/amp-adapter.ts +11 -9
- package/src/providers/cursor-adapter.ts +1 -1
- package/src/rbac/legacy-policy.ts +2 -0
- package/src/rbac/permissions.ts +5 -0
- package/src/realtime/browser.generated.txt +1 -1
- package/src/scheduler/schedule-task.ts +1 -0
- package/src/scripts-runtime/quickjs-compat.ts +44 -10
- package/src/scripts-runtime/types/swarm-extension.d.ts +2 -0
- package/src/slack/config.ts +4 -0
- package/src/slack/render-v2.ts +52 -24
- package/src/slack/responses.ts +2 -1
- package/src/slack/reviewed-deliverables.ts +251 -0
- package/src/tasks/follow-up-gate.ts +142 -38
- package/src/tasks/worker-follow-up.ts +126 -37
- package/src/tests/amp-adapter.test.ts +57 -9
- package/src/tests/base-prompt.test.ts +36 -2
- package/src/tests/check-pr-body.test.ts +408 -93
- package/src/tests/compose-dev-object-store.test.ts +13 -0
- package/src/tests/compose-example-object-store.test.ts +67 -0
- package/src/tests/db-query.test.ts +8 -4
- package/src/tests/db-retention-defaults.test.ts +28 -3
- package/src/tests/e2b-dispatch.test.ts +7 -1
- package/src/tests/entrypoint-repo-autoclone-args.test.ts +10 -0
- package/src/tests/follow-up-gate-shadow.test.ts +268 -10
- package/src/tests/linear-outbound-sync.test.ts +59 -25
- package/src/tests/operator-actor-keyless.test.ts +103 -0
- package/src/tests/otel-event-loop-and-logs.test.ts +1 -1
- package/src/tests/profile-tier-alias.test.ts +9 -3
- package/src/tests/quickjs-compat.test.ts +40 -4
- package/src/tests/rbac-route-verbs-e2e.test.ts +142 -0
- package/src/tests/runner-repo-clone-args.test.ts +15 -6
- package/src/tests/script-connections.test.ts +2 -0
- package/src/tests/slack-render-v2.test.ts +52 -8
- package/src/tests/workflow-definition-pinning.test.ts +2 -0
- package/src/tests/workflow-hitl-routing.test.ts +67 -5
- package/src/tests/workflow-replay.test.ts +13 -1
- package/src/tests/workflow-system-one-extraction.test.ts +21 -0
- package/src/tests/workflow-wait-filter.test.ts +7 -7
- package/src/tests/worktree-reaper.test.ts +15 -4
- package/src/tests/x402-client.test.ts +82 -0
- package/src/tools/memory-rate.ts +2 -2
- package/src/tools/prompt-templates/delete.ts +22 -1
- package/src/tools/prompt-templates/set.ts +15 -1
- package/src/tools/schedules/create-schedule.ts +20 -3
- package/src/tools/schedules/patch-schedule.ts +30 -4
- package/src/tools/schedules/update-schedule.ts +30 -4
- package/src/tools/send-task.ts +17 -3
- package/src/tools/slack-post.ts +7 -2
- package/src/tools/slack-reply.ts +6 -2
- package/src/tools/task-action.ts +16 -3
- package/src/tools/utils.ts +1 -1
- package/src/types.ts +10 -0
- package/src/utils/amp-models.ts +20 -4
- package/src/utils/constants.ts +5 -4
- package/src/utils/secret-scrubber.ts +6 -4
- package/src/utils/task-citations.ts +11 -0
- package/src/workflows/engine.ts +41 -8
- package/src/workflows/executors/agent-task.ts +13 -2
- package/src/workflows/executors/code-match.ts +11 -31
- package/src/workflows/executors/script.ts +13 -0
- package/src/workflows/executors/sub-workflow.ts +5 -7
- package/src/workflows/executors/swarm-script.ts +4 -5
- package/src/workflows/executors/system-one-extraction.ts +9 -6
- package/src/workflows/executors/wait.ts +1 -1
- package/src/workflows/foreach-driver.ts +5 -1
- package/src/workflows/model-validation.ts +13 -1
- package/src/workflows/predicate-sandbox.ts +171 -0
- package/src/workflows/resume.ts +21 -4
- package/src/workflows/retry-poller.ts +1 -1
- package/src/workflows/run-principal.ts +51 -0
- package/src/workflows/wait-filter.ts +14 -192
- package/src/x402/client.ts +38 -17
- package/templates/skills/code-quality/content.md +1 -1
- package/templates/skills/heartbeat-runbook/content.md +1 -0
- package/templates/skills/pages/content.md +36 -12
- package/templates/skills/slack-interaction/content.md +4 -0
- package/templates/skills/swarm-docs/content.md +47 -41
- package/templates/skills/swarm-scripts/SKILL.md +1 -1
- package/templates/skills/swarm-scripts/content.md +1 -1
- package/dist/acp-adapter-99n6z9ky.js +0 -17
- package/dist/cli-5ss6qqt9.js +0 -45
- package/dist/cli-dzzh58sy.js +0 -6996
- package/dist/cli-e8trbfx1.js +0 -15
- package/dist/cli-j9ccfveb.js +0 -1849
- package/dist/cli-mna6pmfx.js +0 -1485
- package/dist/cli-r8ddn0hf.js +0 -25583
- package/dist/core-dynsv289.js +0 -41
- package/dist/fx-adapter-9k0hptnz.js +0 -20
- package/dist/getMachineId-bsd-637a7rbk.js +0 -36
- package/dist/getMachineId-darwin-9vytrcnn.js +0 -36
- package/dist/getMachineId-linux-mkzsvyyz.js +0 -29
- package/dist/getMachineId-unsupported-4cfs2n11.js +0 -19
- package/dist/getMachineId-win-154s3qma.js +0 -38
- package/dist/grok-adapter-skdj2pce.js +0 -20
- package/dist/handlers-5btjqkz6.js +0 -39
- package/dist/heartbeat-vfb1gy84.js +0 -49
- package/dist/hook-eh52p7yd.js +0 -22
- package/dist/index-7w8p6em0.js +0 -41
- package/dist/index-t56y945n.js +0 -4
- package/dist/index-vfemrwwk.js +0 -10002
- package/dist/index-vz4semsx.js +0 -38
- package/dist/index-y3s0xp2v.js +0 -43
- package/dist/lead-6cscw8a5.js +0 -82
- package/dist/otel-impl-6n6vva3x.js +0 -28205
- package/dist/thread-buffer-9w6x5zec.js +0 -40
- package/dist/worker-g4aj93dt.js +0 -82
|
@@ -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
|
package/src/http/repos.ts
CHANGED
|
@@ -102,7 +102,9 @@ const updateRepo = route({
|
|
|
102
102
|
404: { description: "Repo not found", schema: z.object({ error: z.string() }) },
|
|
103
103
|
409: { description: "Duplicate repo", schema: z.object({ error: z.string() }) },
|
|
104
104
|
},
|
|
105
|
-
|
|
105
|
+
// `url`, `clonePath` and `hooks` changes gate on `repo.exec-config.write` instead; the
|
|
106
|
+
// handler decides per changed field inside the update transaction.
|
|
107
|
+
rbac: { permission: "repo.merge-policy.write", alsoAdmits: ["repo.exec-config.write"] },
|
|
106
108
|
});
|
|
107
109
|
|
|
108
110
|
const deleteRepo = route({
|
package/src/http/schedules.ts
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
withFavoriteFlags,
|
|
18
18
|
} from "../be/db";
|
|
19
19
|
import {
|
|
20
|
+
modelGroupRefError,
|
|
20
21
|
modelProfileRefError,
|
|
21
22
|
scheduleProfileUpdate,
|
|
22
23
|
taskProfileError,
|
|
@@ -65,6 +66,8 @@ const scheduleUpdateBodySchema = z.object({
|
|
|
65
66
|
modelTier: ModelTierSchema.nullable().optional(),
|
|
66
67
|
/** Model profile for every fired task. Exclusive with model/modelTier; setting one clears the other. */
|
|
67
68
|
profile: z.string().nullable().optional(),
|
|
69
|
+
/** Model group for every fired task. Exclusive with model/modelTier/profile; setting one clears the others. */
|
|
70
|
+
modelGroup: z.string().nullable().optional(),
|
|
68
71
|
/** Accept a `model` the catalog does not list (a custom id). Without it an unknown id is a 400. */
|
|
69
72
|
allowCustomModel: z.boolean().optional(),
|
|
70
73
|
nextRunAt: z.string().nullable().optional(),
|
|
@@ -128,6 +131,8 @@ const createSchedule = route({
|
|
|
128
131
|
modelTier: ModelTierSchema.optional(),
|
|
129
132
|
/** Model profile for every fired task. Exclusive with model/modelTier. */
|
|
130
133
|
profile: z.string().optional(),
|
|
134
|
+
/** Model group for every fired task. Exclusive with model/modelTier/profile. */
|
|
135
|
+
modelGroup: z.string().optional(),
|
|
131
136
|
/** Accept a `model` the catalog does not list (a custom id). Without it an unknown id is a 400. */
|
|
132
137
|
allowCustomModel: z.boolean().optional(),
|
|
133
138
|
scheduleType: z.enum(["recurring", "one_time"]).optional(),
|
|
@@ -146,6 +151,9 @@ const createSchedule = route({
|
|
|
146
151
|
400: { description: "Validation error" },
|
|
147
152
|
409: { description: "Duplicate name" },
|
|
148
153
|
},
|
|
154
|
+
rbac: {
|
|
155
|
+
ungated: "matches PATCH /api/schedules/{id}: bearer-authenticated agents may manage schedules",
|
|
156
|
+
},
|
|
149
157
|
});
|
|
150
158
|
|
|
151
159
|
const runScheduleNow = route({
|
|
@@ -167,6 +175,7 @@ const runScheduleNow = route({
|
|
|
167
175
|
400: { description: "Schedule is disabled" },
|
|
168
176
|
404: { description: "Schedule not found" },
|
|
169
177
|
},
|
|
178
|
+
rbac: { permission: "schedule.run.any" },
|
|
170
179
|
});
|
|
171
180
|
|
|
172
181
|
const listSchedules = route({
|
|
@@ -240,6 +249,9 @@ const updateSchedule = route({
|
|
|
240
249
|
404: { description: "Schedule not found" },
|
|
241
250
|
409: { description: "Duplicate name" },
|
|
242
251
|
},
|
|
252
|
+
rbac: {
|
|
253
|
+
ungated: "matches PATCH /api/schedules/{id}: bearer-authenticated agents may manage schedules",
|
|
254
|
+
},
|
|
243
255
|
});
|
|
244
256
|
|
|
245
257
|
const patchSchedule = route({
|
|
@@ -276,6 +288,9 @@ const deleteSchedule = route({
|
|
|
276
288
|
200: { description: "Schedule deleted", schema: z.object({ success: z.literal(true) }) },
|
|
277
289
|
404: { description: "Schedule not found" },
|
|
278
290
|
},
|
|
291
|
+
rbac: {
|
|
292
|
+
ungated: "matches PATCH /api/schedules/{id}: bearer-authenticated agents may manage schedules",
|
|
293
|
+
},
|
|
279
294
|
});
|
|
280
295
|
|
|
281
296
|
// ─── Handler ─────────────────────────────────────────────────────────────────
|
|
@@ -430,6 +445,7 @@ export async function handleSchedules(
|
|
|
430
445
|
profile: body.profile,
|
|
431
446
|
model: body.model,
|
|
432
447
|
modelTier: body.modelTier,
|
|
448
|
+
modelGroup: body.modelGroup,
|
|
433
449
|
agentId: body.targetAgentId,
|
|
434
450
|
});
|
|
435
451
|
if (profileError) {
|
|
@@ -484,6 +500,7 @@ export async function handleSchedules(
|
|
|
484
500
|
timezone: body.timezone,
|
|
485
501
|
...splitLegacyModelAlias({ model: body.model, modelTier: body.modelTier }),
|
|
486
502
|
profile: body.profile?.trim() || undefined,
|
|
503
|
+
modelGroup: body.modelGroup?.trim() || undefined,
|
|
487
504
|
scheduleType: body.scheduleType,
|
|
488
505
|
targetType: body.targetType,
|
|
489
506
|
workflowId: body.workflowId,
|
|
@@ -499,7 +516,11 @@ export async function handleSchedules(
|
|
|
499
516
|
|
|
500
517
|
createSchedule.respond(res, 201, schedule);
|
|
501
518
|
} catch (error) {
|
|
502
|
-
// The profile was deleted between taskProfileError and the insert.
|
|
519
|
+
// The profile or group was deleted between taskProfileError and the insert.
|
|
520
|
+
if (modelGroupRefError(error)) {
|
|
521
|
+
jsonError(res, `Unknown model group "${body.modelGroup}".`, 400);
|
|
522
|
+
return true;
|
|
523
|
+
}
|
|
503
524
|
if (modelProfileRefError(error) === "missing") {
|
|
504
525
|
jsonError(res, `Unknown model profile "${body.profile}".`, 400);
|
|
505
526
|
return true;
|
|
@@ -691,7 +712,12 @@ export async function handleSchedules(
|
|
|
691
712
|
if (parsed.body.modelTier !== undefined || normalizedModel.modelTier) {
|
|
692
713
|
body.modelTier = normalizedModel.modelTier ?? null;
|
|
693
714
|
}
|
|
694
|
-
} else if (
|
|
715
|
+
} else if (
|
|
716
|
+
agentChanged &&
|
|
717
|
+
existing.model &&
|
|
718
|
+
!profileUpdate.fields.profile &&
|
|
719
|
+
!profileUpdate.fields.modelGroup
|
|
720
|
+
) {
|
|
695
721
|
// Harness only: the stored id already passed the catalog check when it was written.
|
|
696
722
|
const modelError = await explicitModelErrorForAgent({
|
|
697
723
|
model: existing.model,
|
|
@@ -842,7 +868,11 @@ export async function handleSchedules(
|
|
|
842
868
|
try {
|
|
843
869
|
schedule = await updateScheduledTask(parsed.params.id, body);
|
|
844
870
|
} catch (error) {
|
|
845
|
-
// The profile was deleted between scheduleProfileUpdate and the write.
|
|
871
|
+
// The profile or group was deleted between scheduleProfileUpdate and the write.
|
|
872
|
+
if (modelGroupRefError(error)) {
|
|
873
|
+
jsonError(res, `Unknown model group "${body.modelGroup}".`, 400);
|
|
874
|
+
return true;
|
|
875
|
+
}
|
|
846
876
|
if (modelProfileRefError(error) !== "missing") throw error;
|
|
847
877
|
jsonError(res, `Unknown model profile "${body.profile}".`, 400);
|
|
848
878
|
return true;
|
package/src/http/script-runs.ts
CHANGED
|
@@ -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
|
/**
|
package/src/http/scripts.ts
CHANGED
|
@@ -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({
|
package/src/http/session-data.ts
CHANGED
|
@@ -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({
|
package/src/http/status.ts
CHANGED
|
@@ -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
|
@@ -45,6 +45,7 @@ import {
|
|
|
45
45
|
import {
|
|
46
46
|
getModelProfileByName,
|
|
47
47
|
hasUnreadableCredentialAllowlist,
|
|
48
|
+
modelGroupRefError,
|
|
48
49
|
modelProfileRefError,
|
|
49
50
|
taskProfileError,
|
|
50
51
|
} from "../be/db/model-profiles";
|
|
@@ -180,6 +181,7 @@ const AgentTaskSummarySchema = AgentTaskSchema.pick({
|
|
|
180
181
|
resolvedEffort: true,
|
|
181
182
|
profile: true,
|
|
182
183
|
resolvedProfile: true,
|
|
184
|
+
modelGroup: true,
|
|
183
185
|
provider: true,
|
|
184
186
|
requestedByUserId: true,
|
|
185
187
|
progress: true,
|
|
@@ -398,6 +400,8 @@ const createTask = route({
|
|
|
398
400
|
effort: ReasoningEffortSchema.optional(),
|
|
399
401
|
/** Model profile name, applied at claim. Exclusive with `model` and `modelTier`. */
|
|
400
402
|
profile: z.string().trim().min(1).optional(),
|
|
403
|
+
/** Model group name, resolved per agent at claim. Exclusive with `model`, `modelTier` and `profile`. */
|
|
404
|
+
modelGroup: z.string().trim().min(1).optional(),
|
|
401
405
|
/**
|
|
402
406
|
* Create in `draft` status instead of the normal pending/unassigned/offered
|
|
403
407
|
* status (#1240) — the task exists and is visible to its owner, but is not
|
|
@@ -490,6 +494,10 @@ const updateSession = route({
|
|
|
490
494
|
200: { description: "Session ID updated", schema: AgentTaskSchema },
|
|
491
495
|
404: { description: "Task not found" },
|
|
492
496
|
},
|
|
497
|
+
rbac: {
|
|
498
|
+
ungated:
|
|
499
|
+
"worker runner endpoint for its own task; the route's session posture gates any user caller",
|
|
500
|
+
},
|
|
493
501
|
});
|
|
494
502
|
|
|
495
503
|
const cancelTaskRoute = route({
|
|
@@ -704,6 +712,7 @@ const updateTaskProgressRoute = route({
|
|
|
704
712
|
session: { taskParam: "id" },
|
|
705
713
|
summary: "Update task progress text",
|
|
706
714
|
tags: ["Tasks"],
|
|
715
|
+
rbac: { permission: "task.progress.write" },
|
|
707
716
|
params: z.object({ id: z.string() }),
|
|
708
717
|
body: z.object({ progress: z.string().min(1) }),
|
|
709
718
|
responses: {
|
|
@@ -745,6 +754,10 @@ const finishTask = route({
|
|
|
745
754
|
schema: FinishTaskConflictSchema,
|
|
746
755
|
},
|
|
747
756
|
},
|
|
757
|
+
rbac: {
|
|
758
|
+
ungated:
|
|
759
|
+
"worker runner endpoint for its own task; the route's session posture gates any user caller",
|
|
760
|
+
},
|
|
748
761
|
});
|
|
749
762
|
|
|
750
763
|
const listPausedTasks = route({
|
|
@@ -872,6 +885,10 @@ const supersedeTaskRoute = route({
|
|
|
872
885
|
403: { description: "Task belongs to another agent" },
|
|
873
886
|
404: { description: "Task not found" },
|
|
874
887
|
},
|
|
888
|
+
rbac: {
|
|
889
|
+
ungated:
|
|
890
|
+
"worker runner endpoint for its own task; the route's session posture gates any user caller",
|
|
891
|
+
},
|
|
875
892
|
});
|
|
876
893
|
|
|
877
894
|
const updateTaskVcsRoute = route({
|
|
@@ -894,6 +911,10 @@ const updateTaskVcsRoute = route({
|
|
|
894
911
|
404: { description: "Task not found" },
|
|
895
912
|
},
|
|
896
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
|
+
},
|
|
897
918
|
});
|
|
898
919
|
|
|
899
920
|
const updateTaskTitleRoute = route({
|
|
@@ -1279,6 +1300,7 @@ export async function handleTasks(
|
|
|
1279
1300
|
// the worker loads config from, so the profile check judges the same pool.
|
|
1280
1301
|
const profileError = await taskProfileError({
|
|
1281
1302
|
profile: parsed.body.profile,
|
|
1303
|
+
modelGroup: parsed.body.modelGroup,
|
|
1282
1304
|
...splitLegacyModelAlias({ model: parsed.body.model, modelTier: parsed.body.modelTier }),
|
|
1283
1305
|
agentId: defaultAgentId,
|
|
1284
1306
|
vcsRepo: vcsRepo ?? parentTask?.vcsRepo,
|
|
@@ -1349,6 +1371,7 @@ export async function handleTasks(
|
|
|
1349
1371
|
}),
|
|
1350
1372
|
effort: parsed.body.effort,
|
|
1351
1373
|
profile: parsed.body.profile,
|
|
1374
|
+
modelGroup: parsed.body.modelGroup,
|
|
1352
1375
|
},
|
|
1353
1376
|
{ origin: "rest", allowCustomModel: parsed.body.allowCustomModel },
|
|
1354
1377
|
);
|
|
@@ -1412,7 +1435,11 @@ export async function handleTasks(
|
|
|
1412
1435
|
jsonError(res, error.message, 400);
|
|
1413
1436
|
return true;
|
|
1414
1437
|
}
|
|
1415
|
-
// The profile was deleted between taskProfileError and the insert.
|
|
1438
|
+
// The profile or group was deleted between taskProfileError and the insert.
|
|
1439
|
+
if (modelGroupRefError(error)) {
|
|
1440
|
+
jsonError(res, `Unknown model group "${parsed.body.modelGroup}"`, 400);
|
|
1441
|
+
return true;
|
|
1442
|
+
}
|
|
1416
1443
|
if (modelProfileRefError(error) === "missing") {
|
|
1417
1444
|
jsonError(res, `Unknown model profile "${parsed.body.profile}"`, 400);
|
|
1418
1445
|
return true;
|
|
@@ -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,
|
package/src/http/users.ts
CHANGED
|
@@ -269,6 +269,13 @@ const listUsers = route({
|
|
|
269
269
|
auth: { apiKey: true },
|
|
270
270
|
});
|
|
271
271
|
|
|
272
|
+
// User and identity admin can mint a grant-all admin (every new user gets the
|
|
273
|
+
// admin role) or bind a chat identity to one, so a scoped `user.manage` grant
|
|
274
|
+
// must not admit it. No verb keeps admission grant-all only, like the
|
|
275
|
+
// mcp-token routes.
|
|
276
|
+
const USER_ADMIN_UNGATED =
|
|
277
|
+
"creates users or binds identities, which can reach a grant-all admin (operator-only admission)";
|
|
278
|
+
|
|
272
279
|
const createUserRoute = route({
|
|
273
280
|
method: "post",
|
|
274
281
|
path: "/api/users",
|
|
@@ -301,6 +308,7 @@ const createUserRoute = route({
|
|
|
301
308
|
409: { description: "A user with this email already exists (user_exists)" },
|
|
302
309
|
},
|
|
303
310
|
auth: { apiKey: true },
|
|
311
|
+
rbac: { ungated: USER_ADMIN_UNGATED },
|
|
304
312
|
});
|
|
305
313
|
|
|
306
314
|
const listUnmapped = route({
|
|
@@ -356,6 +364,7 @@ const resolveUnmapped = route({
|
|
|
356
364
|
404: { description: "Target user not found" },
|
|
357
365
|
},
|
|
358
366
|
auth: { apiKey: true },
|
|
367
|
+
rbac: { ungated: USER_ADMIN_UNGATED },
|
|
359
368
|
});
|
|
360
369
|
|
|
361
370
|
const DISMISS_RBAC = {
|
|
@@ -472,6 +481,7 @@ const updateUserRoute = route({
|
|
|
472
481
|
404: { description: "User not found" },
|
|
473
482
|
},
|
|
474
483
|
auth: { apiKey: true },
|
|
484
|
+
rbac: { ungated: USER_ADMIN_UNGATED },
|
|
475
485
|
});
|
|
476
486
|
|
|
477
487
|
const mintUserMcpTokenRoute = route({
|
|
@@ -503,6 +513,10 @@ const mintUserMcpTokenRoute = route({
|
|
|
503
513
|
404: { description: "User not found" },
|
|
504
514
|
},
|
|
505
515
|
auth: { apiKey: true },
|
|
516
|
+
rbac: {
|
|
517
|
+
ungated:
|
|
518
|
+
"mints another user's bearer token, so no scoped grant admits it (operator-only admission)",
|
|
519
|
+
},
|
|
506
520
|
});
|
|
507
521
|
|
|
508
522
|
const revokeUserMcpTokenRoute = route({
|
|
@@ -521,6 +535,7 @@ const revokeUserMcpTokenRoute = route({
|
|
|
521
535
|
404: { description: "User or token not found" },
|
|
522
536
|
},
|
|
523
537
|
auth: { apiKey: true },
|
|
538
|
+
rbac: { ungated: "same posture as POST /api/users/{id}/mcp-tokens (operator-only admission)" },
|
|
524
539
|
});
|
|
525
540
|
|
|
526
541
|
const createConnectorCodeRoute = route({
|
|
@@ -710,6 +725,7 @@ const mergeUsersRoute = route({
|
|
|
710
725
|
},
|
|
711
726
|
},
|
|
712
727
|
auth: { apiKey: true },
|
|
728
|
+
rbac: { ungated: USER_ADMIN_UNGATED },
|
|
713
729
|
});
|
|
714
730
|
|
|
715
731
|
const listMergeJobsRoute = route({
|
|
@@ -795,6 +811,7 @@ const addIdentityRoute = route({
|
|
|
795
811
|
409: { description: "The (kind, externalId) identity is already linked (identity_taken)" },
|
|
796
812
|
},
|
|
797
813
|
auth: { apiKey: true },
|
|
814
|
+
rbac: { ungated: USER_ADMIN_UNGATED },
|
|
798
815
|
});
|
|
799
816
|
|
|
800
817
|
const deleteIdentityRoute = route({
|
|
@@ -813,6 +830,7 @@ const deleteIdentityRoute = route({
|
|
|
813
830
|
404: { description: "User not found" },
|
|
814
831
|
},
|
|
815
832
|
auth: { apiKey: true },
|
|
833
|
+
rbac: { ungated: USER_ADMIN_UNGATED },
|
|
816
834
|
});
|
|
817
835
|
|
|
818
836
|
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
package/src/http/webhooks.ts
CHANGED
|
@@ -198,6 +198,9 @@ const githubWebhook = route({
|
|
|
198
198
|
401: { description: "Invalid signature" },
|
|
199
199
|
503: { description: "GitHub integration not configured" },
|
|
200
200
|
},
|
|
201
|
+
rbac: {
|
|
202
|
+
ungated: "inbound webhook: the provider signature is the credential, no bearer principal",
|
|
203
|
+
},
|
|
201
204
|
});
|
|
202
205
|
|
|
203
206
|
const gitlabWebhook = route({
|
|
@@ -212,6 +215,9 @@ const gitlabWebhook = route({
|
|
|
212
215
|
401: { description: "Invalid token" },
|
|
213
216
|
503: { description: "GitLab integration not configured" },
|
|
214
217
|
},
|
|
218
|
+
rbac: {
|
|
219
|
+
ungated: "inbound webhook: the provider signature is the credential, no bearer principal",
|
|
220
|
+
},
|
|
215
221
|
});
|
|
216
222
|
|
|
217
223
|
const azureDevOpsWebhook = route({
|
|
@@ -266,6 +272,9 @@ const agentmailWebhook = route({
|
|
|
266
272
|
401: { description: "Invalid signature" },
|
|
267
273
|
503: { description: "AgentMail integration not configured or inbound archive unavailable" },
|
|
268
274
|
},
|
|
275
|
+
rbac: {
|
|
276
|
+
ungated: "inbound webhook: the provider signature is the credential, no bearer principal",
|
|
277
|
+
},
|
|
269
278
|
});
|
|
270
279
|
|
|
271
280
|
const kapsoWebhook = route({
|
|
@@ -286,6 +295,9 @@ const kapsoWebhook = route({
|
|
|
286
295
|
401: { description: "Invalid signature" },
|
|
287
296
|
503: { description: "Kapso integration not configured" },
|
|
288
297
|
},
|
|
298
|
+
rbac: {
|
|
299
|
+
ungated: "inbound webhook: the provider signature is the credential, no bearer principal",
|
|
300
|
+
},
|
|
289
301
|
});
|
|
290
302
|
|
|
291
303
|
const chatSdkWebhook = route({
|
|
@@ -2,6 +2,7 @@ import type { IncomingMessage, ServerResponse } from "node:http";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { getWorkflowRun } from "../be/db";
|
|
4
4
|
import { isReservedProviderEvent } from "../event-waits";
|
|
5
|
+
import { isExtensionBridgedEvent } from "../extensions/post-bridge";
|
|
5
6
|
import { workflowEventBus } from "../workflows/event-bus";
|
|
6
7
|
import { route } from "./route-def";
|
|
7
8
|
import { jsonError } from "./utils";
|
|
@@ -40,10 +41,14 @@ const runScopedSignalRoute = route({
|
|
|
40
41
|
}),
|
|
41
42
|
},
|
|
42
43
|
404: { description: "Workflow run not found" },
|
|
43
|
-
403: { description: "Event name is reserved for provider webhooks" },
|
|
44
|
+
403: { description: "Event name is reserved for provider webhooks or server-emitted events" },
|
|
44
45
|
400: { description: "Validation error" },
|
|
45
46
|
},
|
|
46
47
|
auth: { apiKey: true },
|
|
48
|
+
rbac: {
|
|
49
|
+
ungated:
|
|
50
|
+
"workflow runs: open to agents like the workflow tools; no verb covers them, so user roles need admin",
|
|
51
|
+
},
|
|
47
52
|
});
|
|
48
53
|
|
|
49
54
|
/**
|
|
@@ -72,13 +77,26 @@ const globalSignalRoute = route({
|
|
|
72
77
|
name: z.string(),
|
|
73
78
|
}),
|
|
74
79
|
},
|
|
75
|
-
403: { description: "Event name is reserved for provider webhooks" },
|
|
80
|
+
403: { description: "Event name is reserved for provider webhooks or server-emitted events" },
|
|
76
81
|
400: { description: "Validation error" },
|
|
77
82
|
},
|
|
78
83
|
auth: { apiKey: true },
|
|
84
|
+
rbac: {
|
|
85
|
+
ungated:
|
|
86
|
+
"workflow runs: open to agents like the workflow tools; no verb covers them, so user roles need admin",
|
|
87
|
+
},
|
|
79
88
|
});
|
|
80
89
|
|
|
81
90
|
const RESERVED_EVENT_MESSAGE = "Event name is reserved for provider webhooks";
|
|
91
|
+
const SERVER_EVENT_MESSAGE = "Event name is reserved for server-emitted events";
|
|
92
|
+
|
|
93
|
+
/** The refusal message for a name only the server may emit, or null when callers may emit it. */
|
|
94
|
+
function reservedEventError(name: string): string | null {
|
|
95
|
+
if (isReservedProviderEvent(name)) return RESERVED_EVENT_MESSAGE;
|
|
96
|
+
// Extension handlers trust bridged payloads (approval outcomes, task and chat events).
|
|
97
|
+
if (isExtensionBridgedEvent(name)) return SERVER_EVENT_MESSAGE;
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
82
100
|
|
|
83
101
|
// ─── Handler ─────────────────────────────────────────────────────────────────
|
|
84
102
|
|
|
@@ -93,8 +111,9 @@ export async function handleWorkflowEvents(
|
|
|
93
111
|
const parsed = await runScopedSignalRoute.parse(req, res, pathSegments, queryParams);
|
|
94
112
|
if (!parsed) return true;
|
|
95
113
|
|
|
96
|
-
|
|
97
|
-
|
|
114
|
+
const reserved = reservedEventError(parsed.body.name);
|
|
115
|
+
if (reserved) {
|
|
116
|
+
jsonError(res, reserved, 403);
|
|
98
117
|
return true;
|
|
99
118
|
}
|
|
100
119
|
const run = await getWorkflowRun(parsed.params.runId);
|
|
@@ -119,8 +138,9 @@ export async function handleWorkflowEvents(
|
|
|
119
138
|
const parsed = await globalSignalRoute.parse(req, res, pathSegments, queryParams);
|
|
120
139
|
if (!parsed) return true;
|
|
121
140
|
|
|
122
|
-
|
|
123
|
-
|
|
141
|
+
const reserved = reservedEventError(parsed.body.name);
|
|
142
|
+
if (reserved) {
|
|
143
|
+
jsonError(res, reserved, 403);
|
|
124
144
|
return true;
|
|
125
145
|
}
|
|
126
146
|
workflowEventBus.emit(parsed.body.name, parsed.body.payload ?? {});
|