@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
|
@@ -360,42 +360,41 @@ const onVcsEvent = (name: string, data: unknown): void => {
|
|
|
360
360
|
});
|
|
361
361
|
};
|
|
362
362
|
|
|
363
|
+
// Every bus name the bridge forwards to extension handlers. Handlers trust these payloads,
|
|
364
|
+
// so only server code may emit them (the workflow-events API refuses them).
|
|
365
|
+
const BRIDGED_EVENTS: ReadonlyArray<readonly [string, (data: unknown) => void]> = [
|
|
366
|
+
["task.created", onTaskCreated],
|
|
367
|
+
["task.create_blocked", onTaskBlocked],
|
|
368
|
+
["task.completed", onTaskCompleted],
|
|
369
|
+
["task.failed", onTaskFailed],
|
|
370
|
+
["task.cancelled", onTaskCancelled],
|
|
371
|
+
["task.superseded", onTaskSuperseded],
|
|
372
|
+
["task.progress", onTaskProgress],
|
|
373
|
+
["slack.message", onSlackMessage],
|
|
374
|
+
["approval.resolved", onApprovalResolved],
|
|
375
|
+
["task.budget_refused", onTaskBudgetRefused],
|
|
376
|
+
["agentmail.message.received", onEmailReceived],
|
|
377
|
+
["kapso.message.received", onKapsoMessage],
|
|
378
|
+
["chat.message.received", onChatMessageReceived],
|
|
379
|
+
["chat.message.sent", onChatMessageSent],
|
|
380
|
+
];
|
|
381
|
+
const BRIDGED_EVENT_NAMES: ReadonlySet<string> = new Set(BRIDGED_EVENTS.map(([name]) => name));
|
|
382
|
+
|
|
383
|
+
/** True for a bus name the extension post-bridge forwards: server-emitted only. */
|
|
384
|
+
export function isExtensionBridgedEvent(name: string): boolean {
|
|
385
|
+
return BRIDGED_EVENT_NAMES.has(name) || VCS_PREFIXES.some((prefix) => name.startsWith(prefix));
|
|
386
|
+
}
|
|
387
|
+
|
|
363
388
|
export function initExtensionPostBridge(): void {
|
|
364
389
|
if (subscribed) return;
|
|
365
390
|
subscribed = true;
|
|
366
|
-
workflowEventBus.on(
|
|
367
|
-
workflowEventBus.on("task.create_blocked", onTaskBlocked);
|
|
368
|
-
workflowEventBus.on("task.completed", onTaskCompleted);
|
|
369
|
-
workflowEventBus.on("task.failed", onTaskFailed);
|
|
370
|
-
workflowEventBus.on("task.cancelled", onTaskCancelled);
|
|
371
|
-
workflowEventBus.on("task.superseded", onTaskSuperseded);
|
|
372
|
-
workflowEventBus.on("task.progress", onTaskProgress);
|
|
373
|
-
workflowEventBus.on("slack.message", onSlackMessage);
|
|
374
|
-
workflowEventBus.on("approval.resolved", onApprovalResolved);
|
|
375
|
-
workflowEventBus.on("task.budget_refused", onTaskBudgetRefused);
|
|
376
|
-
workflowEventBus.on("agentmail.message.received", onEmailReceived);
|
|
377
|
-
workflowEventBus.on("kapso.message.received", onKapsoMessage);
|
|
378
|
-
workflowEventBus.on("chat.message.received", onChatMessageReceived);
|
|
379
|
-
workflowEventBus.on("chat.message.sent", onChatMessageSent);
|
|
391
|
+
for (const [name, handler] of BRIDGED_EVENTS) workflowEventBus.on(name, handler);
|
|
380
392
|
for (const prefix of VCS_PREFIXES) workflowEventBus.onPrefix(prefix, onVcsEvent);
|
|
381
393
|
}
|
|
382
394
|
|
|
383
395
|
export function teardownExtensionPostBridge(): void {
|
|
384
396
|
if (!subscribed) return;
|
|
385
397
|
subscribed = false;
|
|
386
|
-
workflowEventBus.off(
|
|
387
|
-
workflowEventBus.off("task.create_blocked", onTaskBlocked);
|
|
388
|
-
workflowEventBus.off("task.completed", onTaskCompleted);
|
|
389
|
-
workflowEventBus.off("task.failed", onTaskFailed);
|
|
390
|
-
workflowEventBus.off("task.cancelled", onTaskCancelled);
|
|
391
|
-
workflowEventBus.off("task.superseded", onTaskSuperseded);
|
|
392
|
-
workflowEventBus.off("task.progress", onTaskProgress);
|
|
393
|
-
workflowEventBus.off("slack.message", onSlackMessage);
|
|
394
|
-
workflowEventBus.off("approval.resolved", onApprovalResolved);
|
|
395
|
-
workflowEventBus.off("task.budget_refused", onTaskBudgetRefused);
|
|
396
|
-
workflowEventBus.off("agentmail.message.received", onEmailReceived);
|
|
397
|
-
workflowEventBus.off("kapso.message.received", onKapsoMessage);
|
|
398
|
-
workflowEventBus.off("chat.message.received", onChatMessageReceived);
|
|
399
|
-
workflowEventBus.off("chat.message.sent", onChatMessageSent);
|
|
398
|
+
for (const [name, handler] of BRIDGED_EVENTS) workflowEventBus.off(name, handler);
|
|
400
399
|
for (const prefix of VCS_PREFIXES) workflowEventBus.offPrefix(prefix, onVcsEvent);
|
|
401
400
|
}
|
|
@@ -56,6 +56,7 @@ const createActiveSession = route({
|
|
|
56
56
|
201: { description: "Session created", schema: z.object({ session: ActiveSessionSchema }) },
|
|
57
57
|
400: { description: "Validation error" },
|
|
58
58
|
},
|
|
59
|
+
rbac: { ungated: "worker runner bookkeeping for its own active session; no user flow writes it" },
|
|
59
60
|
});
|
|
60
61
|
|
|
61
62
|
const deleteSessionByTask = route({
|
|
@@ -69,6 +70,7 @@ const deleteSessionByTask = route({
|
|
|
69
70
|
responses: {
|
|
70
71
|
200: { description: "Session deleted", schema: z.object({ deleted: z.boolean() }) },
|
|
71
72
|
},
|
|
73
|
+
rbac: { ungated: "worker runner bookkeeping for its own active session; no user flow writes it" },
|
|
72
74
|
});
|
|
73
75
|
|
|
74
76
|
const deleteSessionById = route({
|
|
@@ -82,6 +84,7 @@ const deleteSessionById = route({
|
|
|
82
84
|
responses: {
|
|
83
85
|
200: { description: "Session deleted", schema: z.object({ deleted: z.boolean() }) },
|
|
84
86
|
},
|
|
87
|
+
rbac: { ungated: "worker runner bookkeeping for its own active session; no user flow writes it" },
|
|
85
88
|
});
|
|
86
89
|
|
|
87
90
|
const heartbeatSession = route({
|
|
@@ -95,6 +98,7 @@ const heartbeatSession = route({
|
|
|
95
98
|
responses: {
|
|
96
99
|
200: { description: "Heartbeat updated", schema: z.object({ updated: z.boolean() }) },
|
|
97
100
|
},
|
|
101
|
+
rbac: { ungated: "worker runner bookkeeping for its own active session; no user flow writes it" },
|
|
98
102
|
});
|
|
99
103
|
|
|
100
104
|
const updateProviderSession = route({
|
|
@@ -109,6 +113,7 @@ const updateProviderSession = route({
|
|
|
109
113
|
responses: {
|
|
110
114
|
200: { description: "Provider session ID updated", schema: z.object({ updated: z.boolean() }) },
|
|
111
115
|
},
|
|
116
|
+
rbac: { ungated: "worker runner bookkeeping for its own active session; no user flow writes it" },
|
|
112
117
|
});
|
|
113
118
|
|
|
114
119
|
const cleanupSessions = route({
|
|
@@ -127,6 +132,7 @@ const cleanupSessions = route({
|
|
|
127
132
|
responses: {
|
|
128
133
|
200: { description: "Cleanup result", schema: z.object({ cleaned: z.number().int() }) },
|
|
129
134
|
},
|
|
135
|
+
rbac: { ungated: "worker runner bookkeeping for its own active session; no user flow writes it" },
|
|
130
136
|
});
|
|
131
137
|
|
|
132
138
|
const recoverOrphanedTasks = route({
|
|
@@ -147,6 +153,7 @@ const recoverOrphanedTasks = route({
|
|
|
147
153
|
},
|
|
148
154
|
403: { description: "Can only recover orphaned tasks for the calling agent" },
|
|
149
155
|
},
|
|
156
|
+
rbac: { ungated: "worker runner bookkeeping for its own active session; no user flow writes it" },
|
|
150
157
|
});
|
|
151
158
|
|
|
152
159
|
// ─── Handler ─────────────────────────────────────────────────────────────────
|
package/src/http/agents.ts
CHANGED
|
@@ -200,6 +200,7 @@ const registerAgent = route({
|
|
|
200
200
|
description: "An operator deleted this agent id (`agent_deleted`); the worker must stop",
|
|
201
201
|
},
|
|
202
202
|
},
|
|
203
|
+
rbac: { ungated: "worker self-registration at boot; no user flow calls it" },
|
|
203
204
|
});
|
|
204
205
|
|
|
205
206
|
const setAgentHarnessProviderRoute = route({
|
|
@@ -219,6 +220,7 @@ const setAgentHarnessProviderRoute = route({
|
|
|
219
220
|
400: { description: "Validation error (unknown provider)" },
|
|
220
221
|
404: { description: "Agent not found" },
|
|
221
222
|
},
|
|
223
|
+
rbac: { permission: "config.write.any" },
|
|
222
224
|
});
|
|
223
225
|
|
|
224
226
|
const LocalHarnessProviderSchema = z.enum([
|
|
@@ -316,6 +318,7 @@ const updateAgentRuntimeRoute = route({
|
|
|
316
318
|
400: { description: "Validation error, or `{ error, check }` when the profile check fails" },
|
|
317
319
|
404: { description: "Agent not found" },
|
|
318
320
|
},
|
|
321
|
+
rbac: { permission: "config.write.any" },
|
|
319
322
|
});
|
|
320
323
|
|
|
321
324
|
class ClaudeTransportConflictError extends Error {}
|
|
@@ -460,6 +463,7 @@ const updateAgentNameRoute = route({
|
|
|
460
463
|
404: { description: "Agent not found" },
|
|
461
464
|
409: { description: "Name conflict" },
|
|
462
465
|
},
|
|
466
|
+
rbac: { permission: "agent.profile.update.any" },
|
|
463
467
|
});
|
|
464
468
|
|
|
465
469
|
const getAgentSetupScript = route({
|
|
@@ -584,6 +588,7 @@ const updateAgentProfileRoute = route({
|
|
|
584
588
|
},
|
|
585
589
|
404: { description: "Agent not found, or changedByAgentId names no agent" },
|
|
586
590
|
},
|
|
591
|
+
rbac: { permission: "agent.profile.update.any" },
|
|
587
592
|
});
|
|
588
593
|
|
|
589
594
|
const updateAgentActivityRoute = route({
|
|
@@ -596,6 +601,7 @@ const updateAgentActivityRoute = route({
|
|
|
596
601
|
responses: {
|
|
597
602
|
204: { description: "Activity updated" },
|
|
598
603
|
},
|
|
604
|
+
rbac: { ungated: "worker telemetry ingest; no user flow writes it" },
|
|
599
605
|
});
|
|
600
606
|
|
|
601
607
|
const getAgent = route({
|
|
@@ -653,6 +659,7 @@ const updateAgentCredentialStatusRoute = route({
|
|
|
653
659
|
400: { description: "Missing X-Runtime-Instance-ID in multi-runtime mode" },
|
|
654
660
|
404: { description: "Agent not found" },
|
|
655
661
|
},
|
|
662
|
+
rbac: { ungated: "worker telemetry ingest; no user flow writes it" },
|
|
656
663
|
});
|
|
657
664
|
|
|
658
665
|
const getAgentCredentialStatusRoute = route({
|
package/src/http/api-keys.ts
CHANGED
|
@@ -88,6 +88,7 @@ const reportUsage = route({
|
|
|
88
88
|
401: { description: "Unauthorized" },
|
|
89
89
|
},
|
|
90
90
|
auth: { apiKey: true },
|
|
91
|
+
rbac: { ungated: "worker credential-pool bookkeeping; no user flow calls it" },
|
|
91
92
|
});
|
|
92
93
|
|
|
93
94
|
/** A provider spend limit behind a key's rate limit (`SpendCap`). */
|
|
@@ -119,6 +120,7 @@ const reportRateLimit = route({
|
|
|
119
120
|
401: { description: "Unauthorized" },
|
|
120
121
|
},
|
|
121
122
|
auth: { apiKey: true },
|
|
123
|
+
rbac: { ungated: "worker credential-pool bookkeeping; no user flow calls it" },
|
|
122
124
|
});
|
|
123
125
|
|
|
124
126
|
const reportValidation = route({
|
|
@@ -652,6 +654,10 @@ const setKeyName = route({
|
|
|
652
654
|
404: { description: "Key not found" },
|
|
653
655
|
},
|
|
654
656
|
auth: { apiKey: true },
|
|
657
|
+
rbac: {
|
|
658
|
+
ungated:
|
|
659
|
+
"credential display metadata on a pooled key; no verb covers it, so user roles need admin",
|
|
660
|
+
},
|
|
655
661
|
});
|
|
656
662
|
|
|
657
663
|
const clearRateLimitRoute = route({
|
|
@@ -688,6 +694,7 @@ const clearRateLimitRoute = route({
|
|
|
688
694
|
401: { description: "Unauthorized" },
|
|
689
695
|
},
|
|
690
696
|
auth: { apiKey: true },
|
|
697
|
+
rbac: { ungated: "worker credential-pool bookkeeping; no user flow calls it" },
|
|
691
698
|
});
|
|
692
699
|
|
|
693
700
|
const listPlans = route({
|
|
@@ -422,6 +422,10 @@ const createRoute = route({
|
|
|
422
422
|
403: { description: "Slack notifications require a lead agent" },
|
|
423
423
|
},
|
|
424
424
|
auth: { apiKey: true },
|
|
425
|
+
rbac: {
|
|
426
|
+
ungated:
|
|
427
|
+
"agents raise approval requests for their task (session posture checks it); the Slack-notification branch gates integration.slack.post in the handler",
|
|
428
|
+
},
|
|
425
429
|
});
|
|
426
430
|
|
|
427
431
|
const getByIdRoute = route({
|
package/src/http/budgets.ts
CHANGED
|
@@ -101,6 +101,7 @@ const upsertBudgetRoute = route({
|
|
|
101
101
|
200: { description: "Budget upserted", schema: BudgetSchema },
|
|
102
102
|
400: { description: "Validation error" },
|
|
103
103
|
},
|
|
104
|
+
rbac: { ungated: "spend controls: no verb covers them, so user roles need admin" },
|
|
104
105
|
});
|
|
105
106
|
|
|
106
107
|
const deleteBudgetRoute = route({
|
|
@@ -114,6 +115,7 @@ const deleteBudgetRoute = route({
|
|
|
114
115
|
204: { description: "Budget deleted" },
|
|
115
116
|
404: { description: "Budget not configured" },
|
|
116
117
|
},
|
|
118
|
+
rbac: { ungated: "spend controls: no verb covers them, so user roles need admin" },
|
|
117
119
|
});
|
|
118
120
|
|
|
119
121
|
// ─── Handler ─────────────────────────────────────────────────────────────────
|
|
@@ -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 {
|
|
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 =
|
|
106
|
+
const apiUrl = getScriptApiBaseUrl();
|
|
103
107
|
const apiKey = getApiKey();
|
|
104
108
|
const maxAgeMs = keepWarmMaxAgeMs();
|
|
105
109
|
const slots = await loadAllCodexOAuthSlots(apiUrl, apiKey);
|
package/src/http/config.ts
CHANGED
package/src/http/context.ts
CHANGED
|
@@ -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({
|
package/src/http/db-query.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { scrubObject } from "../utils/secret-scrubber";
|
|
3
|
+
import { createSweepScrubber, scrubObject } from "../utils/secret-scrubber";
|
|
4
4
|
import { executeReadOnlyQueryBounded } from "./db-query-bounded";
|
|
5
5
|
import {
|
|
6
6
|
assertSingleStatement,
|
|
@@ -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(
|
|
@@ -139,7 +142,13 @@ export async function handleDbQuery(
|
|
|
139
142
|
);
|
|
140
143
|
// Rows can hold secrets pasted into free text (task output, logs, events).
|
|
141
144
|
// The MCP tool gets this from the registrar; the HTTP route does it here.
|
|
142
|
-
|
|
145
|
+
// The scrub is synchronous, so one sweep scrubber per request stays valid; it
|
|
146
|
+
// skips the rules a clean row cannot trigger (rows run to MBs on this route).
|
|
147
|
+
dbQueryRoute.respond(
|
|
148
|
+
res,
|
|
149
|
+
200,
|
|
150
|
+
scrubObject(result, undefined, undefined, createSweepScrubber()),
|
|
151
|
+
);
|
|
143
152
|
} catch (err: unknown) {
|
|
144
153
|
if (err instanceof DbQueryConcurrencyCapError) {
|
|
145
154
|
// Machine-readable code + Retry-After so a caller can back off instead
|
package/src/http/events.ts
CHANGED
|
@@ -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({
|
package/src/http/integrations.ts
CHANGED
|
@@ -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({
|
package/src/http/mcp-bridge.ts
CHANGED
|
@@ -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 {
|
package/src/http/memory.ts
CHANGED
|
@@ -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).
|
package/src/http/metrics.ts
CHANGED
|
@@ -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({
|
package/src/http/oauth-locks.ts
CHANGED
|
@@ -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(
|
|
@@ -57,14 +57,9 @@ export function getOperatorActor(req: IncomingMessage, res: ServerResponse): Ide
|
|
|
57
57
|
const rawKey = extractBearer(req);
|
|
58
58
|
const swarmKey = getApiKey();
|
|
59
59
|
|
|
60
|
-
//
|
|
61
|
-
//
|
|
62
|
-
|
|
63
|
-
if (!swarmKey) {
|
|
64
|
-
return { kind: "operator", id: fingerprintApiKey("") };
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (!rawKey || !verifyTokenEquality(swarmKey, rawKey)) {
|
|
60
|
+
// With no swarm key configured there is no operator credential to match, so
|
|
61
|
+
// a non-user caller (such as an agent session token) is refused here too.
|
|
62
|
+
if (!swarmKey || !rawKey || !verifyTokenEquality(swarmKey, rawKey)) {
|
|
68
63
|
jsonError(res, "Unauthorized", 401);
|
|
69
64
|
return null;
|
|
70
65
|
}
|
package/src/http/page-proxy.ts
CHANGED
|
@@ -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
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
updateAgentStatusFromCapacity,
|
|
27
27
|
upsertChannelActivityCursor,
|
|
28
28
|
} from "../be/db";
|
|
29
|
+
import { resolveGroupForAgent } from "../be/model-group-resolution";
|
|
29
30
|
import { checkProfileForAgent } from "../be/model-profile-check";
|
|
30
31
|
import {
|
|
31
32
|
modelTierOverridesDiffer,
|
|
@@ -330,6 +331,7 @@ const commitCursorsRoute = route({
|
|
|
330
331
|
},
|
|
331
332
|
400: { description: "Invalid request" },
|
|
332
333
|
},
|
|
334
|
+
rbac: { ungated: "lead worker commits its channel-activity cursors; no user flow calls it" },
|
|
333
335
|
});
|
|
334
336
|
|
|
335
337
|
// ─── Handler ─────────────────────────────────────────────────────────────────
|
|
@@ -669,13 +671,31 @@ export async function handlePoll(
|
|
|
669
671
|
profileOk.set(memoKey, ok);
|
|
670
672
|
return ok;
|
|
671
673
|
};
|
|
674
|
+
// A model group task waits, the same way, for an agent with a member that
|
|
675
|
+
// passes; otherwise claim would hard-stop it with [model-group-unavailable].
|
|
676
|
+
const groupOk = new Map<string, boolean>();
|
|
677
|
+
const passesGroupCheck = async (
|
|
678
|
+
group: string,
|
|
679
|
+
vcsRepo: string | null | undefined,
|
|
680
|
+
): Promise<boolean> => {
|
|
681
|
+
const memoKey = JSON.stringify([group, vcsRepo ?? null]);
|
|
682
|
+
const cached = groupOk.get(memoKey);
|
|
683
|
+
if (cached !== undefined) return cached;
|
|
684
|
+
const ok =
|
|
685
|
+
(await resolveGroupForAgent(group, myAgentId, { vcsRepo, includeRepoSecrets }))
|
|
686
|
+
.kind !== "none";
|
|
687
|
+
groupOk.set(memoKey, ok);
|
|
688
|
+
return ok;
|
|
689
|
+
};
|
|
672
690
|
// The filter runs inside the paginated scan, so incompatible rows never use up the limit.
|
|
673
691
|
const unassignedIds = await getUnassignedTaskIdsForAgent(
|
|
674
692
|
myAgentId,
|
|
675
693
|
5,
|
|
676
694
|
async (task) =>
|
|
677
695
|
(await poolTaskRunsOnHarness(task, harness)) &&
|
|
678
|
-
(
|
|
696
|
+
(task.profile
|
|
697
|
+
? await passesProfileCheck(task.profile, task.vcsRepo)
|
|
698
|
+
: !task.modelGroup || (await passesGroupCheck(task.modelGroup, task.vcsRepo))),
|
|
679
699
|
);
|
|
680
700
|
// Budget admission gate (Phase 3). Pool path is workers-only —
|
|
681
701
|
// per-agent budgets matter most here, but we still check global.
|
package/src/http/pricing.ts
CHANGED
|
@@ -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 ─────────────────────────────────────────────────────────────────
|