@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,17 @@ import {
|
|
|
14
14
|
ReasoningEffortSchema,
|
|
15
15
|
SUPERSEDED_WORKFLOW_TASK_REASON,
|
|
16
16
|
} from "../../types";
|
|
17
|
+
import {
|
|
18
|
+
groupUnavailableMessage,
|
|
19
|
+
modelGroupMemberHarnesses,
|
|
20
|
+
resolveGroupForAgent,
|
|
21
|
+
} from "../model-group-resolution";
|
|
17
22
|
import {
|
|
18
23
|
checkProfileForAgent,
|
|
19
24
|
formatProfileCheckFailures,
|
|
20
25
|
vcsRepoId,
|
|
21
26
|
} from "../model-profile-check";
|
|
27
|
+
import { getAgentById } from "./agents";
|
|
22
28
|
import { getDbClient } from "./runtime";
|
|
23
29
|
import { SUPERSEDED_RESUME_REPAIR_WINDOW_MS } from "./tasks/read";
|
|
24
30
|
|
|
@@ -445,15 +451,22 @@ export async function repoModelOverrideKeys(
|
|
|
445
451
|
* (harness, model, credentials, allowlist). A pooled task (no agent) is judged
|
|
446
452
|
* per agent at claim instead. `profile` is exclusive with `model` and
|
|
447
453
|
* `modelTier`, which pick the model another way.
|
|
454
|
+
*
|
|
455
|
+
* A `modelGroup` is judged the same way: exclusive with `model`, `modelTier`
|
|
456
|
+
* and `profile`, the group must exist, and with a known agent one of its
|
|
457
|
+
* members must run there (`resolveGroupForAgent`).
|
|
448
458
|
*/
|
|
449
459
|
export async function taskProfileError(check: {
|
|
450
460
|
profile?: string | null;
|
|
451
461
|
model?: string | null;
|
|
452
462
|
modelTier?: string | null;
|
|
463
|
+
modelGroup?: string | null;
|
|
453
464
|
agentId?: string | null;
|
|
454
465
|
/** The task's repo; its scoped credentials count, as on the worker. */
|
|
455
466
|
vcsRepo?: string | null;
|
|
456
467
|
}): Promise<string | null> {
|
|
468
|
+
const group = check.modelGroup?.trim();
|
|
469
|
+
if (group) return await taskModelGroupError({ ...check, modelGroup: group });
|
|
457
470
|
const name = check.profile?.trim();
|
|
458
471
|
if (!name) return null;
|
|
459
472
|
if (check.model?.trim() || check.modelTier?.trim()) {
|
|
@@ -472,26 +485,94 @@ export async function taskProfileError(check: {
|
|
|
472
485
|
return formatProfileCheckFailures(result);
|
|
473
486
|
}
|
|
474
487
|
|
|
488
|
+
async function taskModelGroupError(check: {
|
|
489
|
+
modelGroup: string;
|
|
490
|
+
profile?: string | null;
|
|
491
|
+
model?: string | null;
|
|
492
|
+
modelTier?: string | null;
|
|
493
|
+
agentId?: string | null;
|
|
494
|
+
vcsRepo?: string | null;
|
|
495
|
+
}): Promise<string | null> {
|
|
496
|
+
if (check.model?.trim() || check.modelTier?.trim() || check.profile?.trim()) {
|
|
497
|
+
return "Pass `modelGroup`, or `model`/`modelTier`/`profile`, not both.";
|
|
498
|
+
}
|
|
499
|
+
if (!check.agentId) {
|
|
500
|
+
return (await modelGroupMemberHarnesses(check.modelGroup))
|
|
501
|
+
? null
|
|
502
|
+
: unknownModelGroupMessage(check.modelGroup);
|
|
503
|
+
}
|
|
504
|
+
const resolution = await resolveGroupForAgent(check.modelGroup, check.agentId, {
|
|
505
|
+
vcsRepo: check.vcsRepo,
|
|
506
|
+
});
|
|
507
|
+
if (resolution.kind === "missing") return unknownModelGroupMessage(check.modelGroup);
|
|
508
|
+
if (resolution.kind === "resolved") return null;
|
|
509
|
+
const agent = await getAgentById(check.agentId);
|
|
510
|
+
return groupUnavailableMessage(
|
|
511
|
+
check.modelGroup,
|
|
512
|
+
agent?.harnessProvider ?? agent?.provider,
|
|
513
|
+
resolution.skipped,
|
|
514
|
+
);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
function unknownModelGroupMessage(name: string): string {
|
|
518
|
+
return `Unknown model group "${name}". List groups with GET /api/model-groups.`;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* Whether a model-group reference trigger (migration 314) refused a write:
|
|
523
|
+
* the group was deleted between the gate and the insert.
|
|
524
|
+
*/
|
|
525
|
+
export function modelGroupRefError(error: unknown): boolean {
|
|
526
|
+
const message = error instanceof Error ? error.message : "";
|
|
527
|
+
return message.includes("model-group-missing:");
|
|
528
|
+
}
|
|
529
|
+
|
|
475
530
|
/**
|
|
476
|
-
* The profile half of a schedule update. `profile` and
|
|
477
|
-
* pick the model
|
|
478
|
-
* is an error. A new profile, or a move of a
|
|
479
|
-
*
|
|
531
|
+
* The profile and group half of a schedule update. `profile`, `modelGroup` and
|
|
532
|
+
* `model`/`modelTier` pick the model three ways, so setting one clears the
|
|
533
|
+
* others, and sending two is an error. A new profile or group, or a move of a
|
|
534
|
+
* profiled or grouped schedule to another agent, is judged by
|
|
535
|
+
* `taskProfileError`. Returns the columns to write.
|
|
480
536
|
*/
|
|
481
537
|
export async function scheduleProfileUpdate(
|
|
482
|
-
existing: {
|
|
538
|
+
existing: {
|
|
539
|
+
profile?: string | null;
|
|
540
|
+
modelGroup?: string | null;
|
|
541
|
+
targetAgentId?: string | null;
|
|
542
|
+
},
|
|
483
543
|
patch: {
|
|
484
544
|
profile?: string | null;
|
|
545
|
+
modelGroup?: string | null;
|
|
485
546
|
model?: string | null;
|
|
486
547
|
modelTier?: string | null;
|
|
487
548
|
targetAgentId?: string | null;
|
|
488
549
|
},
|
|
489
550
|
): Promise<
|
|
490
551
|
| { error: string }
|
|
491
|
-
| {
|
|
552
|
+
| {
|
|
553
|
+
error?: undefined;
|
|
554
|
+
fields: {
|
|
555
|
+
profile?: string | null;
|
|
556
|
+
modelGroup?: string | null;
|
|
557
|
+
model?: null;
|
|
558
|
+
modelTier?: null;
|
|
559
|
+
};
|
|
560
|
+
}
|
|
492
561
|
> {
|
|
493
562
|
const profile = patch.profile === undefined ? undefined : patch.profile?.trim() || null;
|
|
563
|
+
const modelGroup = patch.modelGroup === undefined ? undefined : patch.modelGroup?.trim() || null;
|
|
494
564
|
const agentId = patch.targetAgentId !== undefined ? patch.targetAgentId : existing.targetAgentId;
|
|
565
|
+
if (modelGroup) {
|
|
566
|
+
const error = await taskProfileError({
|
|
567
|
+
modelGroup,
|
|
568
|
+
profile,
|
|
569
|
+
model: patch.model,
|
|
570
|
+
modelTier: patch.modelTier,
|
|
571
|
+
agentId,
|
|
572
|
+
});
|
|
573
|
+
if (error) return { error };
|
|
574
|
+
return { fields: { modelGroup, profile: null, model: null, modelTier: null } };
|
|
575
|
+
}
|
|
495
576
|
if (profile) {
|
|
496
577
|
const error = await taskProfileError({
|
|
497
578
|
profile,
|
|
@@ -500,18 +581,28 @@ export async function scheduleProfileUpdate(
|
|
|
500
581
|
agentId,
|
|
501
582
|
});
|
|
502
583
|
if (error) return { error };
|
|
503
|
-
return { fields: { profile, model: null, modelTier: null } };
|
|
584
|
+
return { fields: { profile, modelGroup: null, model: null, modelTier: null } };
|
|
504
585
|
}
|
|
505
|
-
if (patch.model?.trim() || patch.modelTier?.trim()
|
|
506
|
-
return { fields: { profile: null } };
|
|
586
|
+
if (patch.model?.trim() || patch.modelTier?.trim()) {
|
|
587
|
+
return { fields: { profile: null, modelGroup: null } };
|
|
507
588
|
}
|
|
589
|
+
const cleared = {
|
|
590
|
+
...(profile === null ? { profile: null } : {}),
|
|
591
|
+
...(modelGroup === null ? { modelGroup: null } : {}),
|
|
592
|
+
};
|
|
508
593
|
const agentChanged =
|
|
509
594
|
patch.targetAgentId !== undefined && patch.targetAgentId !== existing.targetAgentId;
|
|
510
|
-
if (agentChanged
|
|
511
|
-
const
|
|
595
|
+
if (agentChanged) {
|
|
596
|
+
const keptProfile = profile === null ? null : existing.profile;
|
|
597
|
+
const keptGroup = modelGroup === null ? null : existing.modelGroup;
|
|
598
|
+
const error = keptGroup
|
|
599
|
+
? await taskProfileError({ modelGroup: keptGroup, agentId })
|
|
600
|
+
: keptProfile
|
|
601
|
+
? await taskProfileError({ profile: keptProfile, agentId })
|
|
602
|
+
: null;
|
|
512
603
|
if (error) return { error };
|
|
513
604
|
}
|
|
514
|
-
return { fields:
|
|
605
|
+
return { fields: cleared };
|
|
515
606
|
}
|
|
516
607
|
|
|
517
608
|
type OverrideRowState = { value: string; exportToEnv?: number } | null;
|
package/src/be/db/tasks/read.ts
CHANGED
|
@@ -106,6 +106,7 @@ export type AgentTaskRow = {
|
|
|
106
106
|
modelAlias?: string | null;
|
|
107
107
|
profile?: string | null;
|
|
108
108
|
resolvedProfile?: string | null;
|
|
109
|
+
modelGroup?: string | null;
|
|
109
110
|
fallbackHops?: string | null;
|
|
110
111
|
scheduleId: string | null;
|
|
111
112
|
workflowRunId: string | null;
|
|
@@ -176,6 +177,7 @@ type AgentTaskSummaryRow = Pick<
|
|
|
176
177
|
| "resolvedEffort"
|
|
177
178
|
| "profile"
|
|
178
179
|
| "resolvedProfile"
|
|
180
|
+
| "modelGroup"
|
|
179
181
|
| "provider"
|
|
180
182
|
| "requestedByUserId"
|
|
181
183
|
| "progress"
|
|
@@ -258,6 +260,7 @@ const LIST_COLUMNS = {
|
|
|
258
260
|
agent_tasks.scheduleId, agent_tasks.model, agent_tasks.modelTier,
|
|
259
261
|
agent_tasks.resolvedModel, agent_tasks.modelSource, agent_tasks.modelAlias, agent_tasks.effort,
|
|
260
262
|
agent_tasks.resolvedEffort, agent_tasks.profile, agent_tasks.resolvedProfile,
|
|
263
|
+
agent_tasks.modelGroup,
|
|
261
264
|
agent_tasks.provider, agent_tasks.requestedByUserId, agent_tasks.progress,
|
|
262
265
|
agent_tasks.createdAt, agent_tasks.lastUpdatedAt, agent_tasks.finishedAt,
|
|
263
266
|
agent_tasks.statusKind, agent_tasks.peakContextPercent`,
|
|
@@ -409,6 +412,7 @@ export function rowToAgentTask(row: AgentTaskRow): AgentTask {
|
|
|
409
412
|
: undefined,
|
|
410
413
|
profile: row.profile ?? undefined,
|
|
411
414
|
resolvedProfile: row.resolvedProfile ?? undefined,
|
|
415
|
+
modelGroup: row.modelGroup ?? undefined,
|
|
412
416
|
fallbackHops: parseFallbackHops(row.fallbackHops),
|
|
413
417
|
scheduleId: row.scheduleId ?? undefined,
|
|
414
418
|
workflowRunId: row.workflowRunId ?? undefined,
|
|
@@ -487,6 +491,7 @@ export function rowToAgentTaskSummary(row: AgentTaskSummaryRow): AgentTaskSummar
|
|
|
487
491
|
: undefined,
|
|
488
492
|
profile: row.profile ?? undefined,
|
|
489
493
|
resolvedProfile: row.resolvedProfile ?? undefined,
|
|
494
|
+
modelGroup: row.modelGroup ?? undefined,
|
|
490
495
|
provider: (row.provider as ProviderName | null) ?? undefined,
|
|
491
496
|
requestedByUserId: row.requestedByUserId ?? undefined,
|
|
492
497
|
progress: row.progress ?? undefined,
|
|
@@ -135,16 +135,20 @@ const WORKFLOW_RUN_STEP_SLIM_COLUMNS =
|
|
|
135
135
|
* nor parsed.
|
|
136
136
|
*/
|
|
137
137
|
/**
|
|
138
|
-
* The
|
|
139
|
-
*
|
|
140
|
-
*
|
|
138
|
+
* The principal decided when the run pinned its definition (migration 367, a
|
|
139
|
+
* JSON `WorkflowRunPrincipal`), plus the agent the server stamped when the run
|
|
140
|
+
* started (migration 247; null for webhook, event and older runs). Null
|
|
141
|
+
* `principal` means a run from before migration 367.
|
|
141
142
|
*/
|
|
142
|
-
export async function
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
export async function getWorkflowRunPrincipalRow(
|
|
144
|
+
runId: string,
|
|
145
|
+
): Promise<{ principal: string | null; triggeredByAgentId: string | null } | null> {
|
|
146
|
+
return (
|
|
147
|
+
(await getDbClient().get<{ principal: string | null; triggeredByAgentId: string | null }>(
|
|
148
|
+
"SELECT principal, triggeredByAgentId FROM workflow_runs WHERE id = ?",
|
|
149
|
+
[runId],
|
|
150
|
+
)) ?? null
|
|
146
151
|
);
|
|
147
|
-
return row?.triggeredByAgentId ?? null;
|
|
148
152
|
}
|
|
149
153
|
|
|
150
154
|
export async function getWorkflowRunSummary(id: string): Promise<WorkflowRunSummary | null> {
|
package/src/be/db.ts
CHANGED
|
@@ -3025,10 +3025,10 @@ export async function createTaskExtended(
|
|
|
3025
3025
|
vcsProvider, vcsRepo, vcsEventType, vcsNumber, vcsCommentId, vcsAuthor, vcsUrl,
|
|
3026
3026
|
vcsInstallationId, vcsNodeId,
|
|
3027
3027
|
agentmailInboxId, agentmailMessageId, agentmailThreadId,
|
|
3028
|
-
mentionMessageId, mentionChannelId, dir, parentTaskId, dispatchedByTaskId, model, modelTier, effort, profile, fallbackHops, scheduleId,
|
|
3028
|
+
mentionMessageId, mentionChannelId, dir, parentTaskId, dispatchedByTaskId, model, modelTier, effort, profile, modelGroup, fallbackHops, scheduleId,
|
|
3029
3029
|
workflowRunId, workflowRunStepId, outputSchema, followUpConfig, requestedByUserId, requestedByUserIdInherited, contextKey, routingAffinity, swarmVersion, createdAt, lastUpdatedAt, created_by, updated_by, isHumanFree,
|
|
3030
3030
|
sourceStepId, sourceScriptRunId
|
|
3031
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING *`,
|
|
3031
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING *`,
|
|
3032
3032
|
[
|
|
3033
3033
|
id,
|
|
3034
3034
|
insertKey,
|
|
@@ -3073,6 +3073,7 @@ export async function createTaskExtended(
|
|
|
3073
3073
|
options?.modelTier ?? null,
|
|
3074
3074
|
options?.effort ?? null,
|
|
3075
3075
|
options?.profile?.trim() || null,
|
|
3076
|
+
options?.modelGroup?.trim() || null,
|
|
3076
3077
|
options?.fallbackHops?.length ? JSON.stringify(options.fallbackHops) : null,
|
|
3077
3078
|
options?.scheduleId ?? null,
|
|
3078
3079
|
options?.workflowRunId ?? null,
|
|
@@ -6012,6 +6013,7 @@ type ScheduledTaskRow = {
|
|
|
6012
6013
|
model: string | null;
|
|
6013
6014
|
modelTier: string | null;
|
|
6014
6015
|
profile: string | null;
|
|
6016
|
+
modelGroup?: string | null;
|
|
6015
6017
|
scheduleType: string;
|
|
6016
6018
|
targetType: string;
|
|
6017
6019
|
workflowId: string | null;
|
|
@@ -6066,6 +6068,7 @@ function rowToScheduledTask(row: ScheduledTaskRow): ScheduledTask {
|
|
|
6066
6068
|
model: row.model ?? undefined,
|
|
6067
6069
|
modelTier: parseModelTier(row.modelTier) ?? undefined,
|
|
6068
6070
|
profile: row.profile ?? undefined,
|
|
6071
|
+
modelGroup: row.modelGroup ?? undefined,
|
|
6069
6072
|
scheduleType: row.scheduleType as "recurring" | "one_time",
|
|
6070
6073
|
targetType: row.targetType as "agent-task" | "workflow" | "script",
|
|
6071
6074
|
workflowId: row.workflowId ?? undefined,
|
|
@@ -6228,6 +6231,7 @@ export interface CreateScheduledTaskData {
|
|
|
6228
6231
|
model?: string;
|
|
6229
6232
|
modelTier?: ModelTier;
|
|
6230
6233
|
profile?: string;
|
|
6234
|
+
modelGroup?: string;
|
|
6231
6235
|
scheduleType?: "recurring" | "one_time";
|
|
6232
6236
|
targetType?: "agent-task" | "workflow" | "script";
|
|
6233
6237
|
workflowId?: string;
|
|
@@ -6248,11 +6252,11 @@ export async function createScheduledTask(data: CreateScheduledTaskData): Promis
|
|
|
6248
6252
|
id, "key", name, description, cronExpression, intervalMs, taskTemplate,
|
|
6249
6253
|
taskType, tags, priority, targetAgentId, enabled, nextRunAt,
|
|
6250
6254
|
createdByAgentId, parentTaskId, requestedDelayMs, requestedRunAt,
|
|
6251
|
-
timezone, model, modelTier, profile, scheduleType,
|
|
6255
|
+
timezone, model, modelTier, profile, modelGroup, scheduleType,
|
|
6252
6256
|
targetType, workflowId, scriptName, scriptArgs, params, requiredParams, requires,
|
|
6253
6257
|
createdAt, lastUpdatedAt,
|
|
6254
6258
|
created_by, updated_by, updatedByAgentId
|
|
6255
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING *`,
|
|
6259
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING *`,
|
|
6256
6260
|
[
|
|
6257
6261
|
id,
|
|
6258
6262
|
normalizeAssetKey(data.key ?? defaultAssetKey("schedule", id)),
|
|
@@ -6275,6 +6279,7 @@ export async function createScheduledTask(data: CreateScheduledTaskData): Promis
|
|
|
6275
6279
|
data.model ?? null,
|
|
6276
6280
|
data.modelTier ?? null,
|
|
6277
6281
|
data.profile ?? null,
|
|
6282
|
+
data.modelGroup ?? null,
|
|
6278
6283
|
data.scheduleType ?? "recurring",
|
|
6279
6284
|
data.targetType ?? "agent-task",
|
|
6280
6285
|
data.workflowId ?? null,
|
|
@@ -6316,6 +6321,7 @@ export interface UpdateScheduledTaskData {
|
|
|
6316
6321
|
model?: string | null;
|
|
6317
6322
|
modelTier?: ModelTier | null;
|
|
6318
6323
|
profile?: string | null;
|
|
6324
|
+
modelGroup?: string | null;
|
|
6319
6325
|
scheduleType?: "recurring" | "one_time";
|
|
6320
6326
|
targetType?: "agent-task" | "workflow" | "script";
|
|
6321
6327
|
workflowId?: string | null;
|
|
@@ -6421,6 +6427,10 @@ export async function updateScheduledTask(
|
|
|
6421
6427
|
updates.push("profile = ?");
|
|
6422
6428
|
params.push(data.profile);
|
|
6423
6429
|
}
|
|
6430
|
+
if (data.modelGroup !== undefined) {
|
|
6431
|
+
updates.push("modelGroup = ?");
|
|
6432
|
+
params.push(data.modelGroup);
|
|
6433
|
+
}
|
|
6424
6434
|
if (data.scheduleType !== undefined) {
|
|
6425
6435
|
updates.push("scheduleType = ?");
|
|
6426
6436
|
params.push(data.scheduleType);
|
|
@@ -7937,10 +7947,12 @@ export async function createWorkflowRun(data: {
|
|
|
7937
7947
|
triggeredByAgentId?: string;
|
|
7938
7948
|
/** The `workflow_run_definitions` row the run is pinned to (migration 283). */
|
|
7939
7949
|
definitionHash?: string;
|
|
7950
|
+
/** JSON `WorkflowRunPrincipal` decided from the pinned definition (migration 367). */
|
|
7951
|
+
principal?: string;
|
|
7940
7952
|
}): Promise<WorkflowRun> {
|
|
7941
7953
|
const now = new Date().toISOString();
|
|
7942
7954
|
const row = await getDbClient().get<WorkflowRunRow>(
|
|
7943
|
-
`INSERT INTO workflow_runs (id, workflowId, triggerType, startedAt, triggerData, created_by, parentStepId, parentStepAttempt, triggeredByAgentId, definitionHash, sourceStepId) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING *`,
|
|
7955
|
+
`INSERT INTO workflow_runs (id, workflowId, triggerType, startedAt, triggerData, created_by, parentStepId, parentStepAttempt, triggeredByAgentId, definitionHash, sourceStepId, principal) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING *`,
|
|
7944
7956
|
[
|
|
7945
7957
|
data.id,
|
|
7946
7958
|
data.workflowId,
|
|
@@ -7960,6 +7972,7 @@ export async function createWorkflowRun(data: {
|
|
|
7960
7972
|
(data.triggerType !== "api" && (data.triggerType ?? "manual") !== "manual")
|
|
7961
7973
|
? null
|
|
7962
7974
|
: (getCurrentRunProvenance()?.sourceStepId ?? null),
|
|
7975
|
+
data.principal ?? null,
|
|
7963
7976
|
],
|
|
7964
7977
|
);
|
|
7965
7978
|
if (!row) throw new Error("Failed to create workflow run");
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
-- The agent a run's swarm-script and sub-workflow nodes act as, decided once
|
|
2
|
+
-- from the definition the run pins (JSON of `WorkflowRunPrincipal`). An edit
|
|
3
|
+
-- or re-save of the live workflow after the run started cannot change it.
|
|
4
|
+
-- Runs created before this migration keep NULL and decide from the live row.
|
|
5
|
+
ALTER TABLE workflow_runs ADD COLUMN principal TEXT;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model group resolution (runbooks/model-tiers.md § Model groups). A group is
|
|
3
|
+
* an ordered list of profiles that may span harnesses. On one agent it means
|
|
4
|
+
* the first member that runs on the agent's harness and passes
|
|
5
|
+
* `checkProfileForAgent` there. Send-task, claim, the pool filters and the
|
|
6
|
+
* fallback hop all read the group through this module.
|
|
7
|
+
*/
|
|
8
|
+
import { getAgentById, getDbClient } from "./db";
|
|
9
|
+
import { checkProfileForAgent, type ProfileCheckOptions } from "./model-profile-check";
|
|
10
|
+
|
|
11
|
+
/** A member passed over, and why ("harness: runs on codex", "harness-credentials: ..."). */
|
|
12
|
+
export type GroupMemberSkip = { profile: string; reason: string };
|
|
13
|
+
|
|
14
|
+
export type GroupResolution =
|
|
15
|
+
/** No group has this name. */
|
|
16
|
+
| { kind: "missing" }
|
|
17
|
+
/**
|
|
18
|
+
* `member` is the first passing member, at `index` in the group order.
|
|
19
|
+
* `onHarness` lists every member on the agent's harness, in order.
|
|
20
|
+
*/
|
|
21
|
+
| {
|
|
22
|
+
kind: "resolved";
|
|
23
|
+
member: string;
|
|
24
|
+
index: number;
|
|
25
|
+
skipped: GroupMemberSkip[];
|
|
26
|
+
onHarness: string[];
|
|
27
|
+
}
|
|
28
|
+
/** The group exists but no member runs on the agent. */
|
|
29
|
+
| { kind: "none"; skipped: GroupMemberSkip[] };
|
|
30
|
+
|
|
31
|
+
/** The group's members in order, with each member's harness. Null when no group has the name. */
|
|
32
|
+
export async function modelGroupMemberHarnesses(
|
|
33
|
+
group: string,
|
|
34
|
+
): Promise<{ profile: string; harness: string }[] | null> {
|
|
35
|
+
const rows = await getDbClient().query<{ profile: string | null; harness: string | null }>(
|
|
36
|
+
`SELECT m.profileName AS profile, p.harness AS harness
|
|
37
|
+
FROM model_groups g
|
|
38
|
+
LEFT JOIN model_group_members m ON m.groupId = g.id
|
|
39
|
+
LEFT JOIN model_profiles p ON p.name = m.profileName
|
|
40
|
+
WHERE g.name = ?
|
|
41
|
+
ORDER BY m.position`,
|
|
42
|
+
[group.trim()],
|
|
43
|
+
);
|
|
44
|
+
if (rows.length === 0) return null;
|
|
45
|
+
return rows.flatMap((row) =>
|
|
46
|
+
row.profile && row.harness ? [{ profile: row.profile, harness: row.harness }] : [],
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** "check: detail" of the primary's first failing row. */
|
|
51
|
+
export function firstFailingCheck(
|
|
52
|
+
result: NonNullable<Awaited<ReturnType<typeof checkProfileForAgent>>>,
|
|
53
|
+
): string {
|
|
54
|
+
const row = result.profiles[0]?.checks.find((check) => check.state === "fail");
|
|
55
|
+
if (!row) return "failed the profile check";
|
|
56
|
+
return row.detail ? `${row.check}: ${row.detail}` : row.check;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* The member of `group` that `agentId` runs: the first one on the agent's
|
|
61
|
+
* harness that passes `checkProfileForAgent`. Members in `skip` (profiles the
|
|
62
|
+
* work already ran on) are passed over without a record; every other member
|
|
63
|
+
* passed over is listed in `skipped` with its reason. `startAfter` starts the
|
|
64
|
+
* walk after that member when the group still lists it (a fallback hop).
|
|
65
|
+
*/
|
|
66
|
+
export async function resolveGroupForAgent(
|
|
67
|
+
group: string,
|
|
68
|
+
agentId: string,
|
|
69
|
+
options: Pick<ProfileCheckOptions, "vcsRepo" | "includeRepoSecrets"> & {
|
|
70
|
+
skip?: ReadonlySet<string>;
|
|
71
|
+
startAfter?: string;
|
|
72
|
+
/** Pass over members on other harnesses without a record (a same-agent hop). */
|
|
73
|
+
sameHarnessOnly?: boolean;
|
|
74
|
+
} = {},
|
|
75
|
+
): Promise<GroupResolution> {
|
|
76
|
+
const members = await modelGroupMemberHarnesses(group);
|
|
77
|
+
if (!members) return { kind: "missing" };
|
|
78
|
+
const agent = await getAgentById(agentId);
|
|
79
|
+
const harness = agent?.harnessProvider ?? agent?.provider ?? null;
|
|
80
|
+
const skipped: GroupMemberSkip[] = [];
|
|
81
|
+
const from = options.startAfter
|
|
82
|
+
? members.findIndex((member) => member.profile === options.startAfter) + 1
|
|
83
|
+
: 0;
|
|
84
|
+
for (let index = from; index < members.length; index++) {
|
|
85
|
+
const member = members[index]!;
|
|
86
|
+
if (options.skip?.has(member.profile)) continue;
|
|
87
|
+
if (member.harness !== harness) {
|
|
88
|
+
if (options.sameHarnessOnly) continue;
|
|
89
|
+
skipped.push({ profile: member.profile, reason: `harness: runs on ${member.harness}` });
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
const result = await checkProfileForAgent(agentId, member.profile, {
|
|
93
|
+
vcsRepo: options.vcsRepo,
|
|
94
|
+
includeRepoSecrets: options.includeRepoSecrets,
|
|
95
|
+
fallbacks: false,
|
|
96
|
+
});
|
|
97
|
+
if (result?.ok) {
|
|
98
|
+
const onHarness = members.filter((m) => m.harness === harness).map((m) => m.profile);
|
|
99
|
+
return { kind: "resolved", member: member.profile, index, skipped, onHarness };
|
|
100
|
+
}
|
|
101
|
+
skipped.push({
|
|
102
|
+
profile: member.profile,
|
|
103
|
+
reason: result ? firstFailingCheck(result) : "not found",
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
return { kind: "none", skipped };
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** "a (reason), b (reason)" for a log line or an error. */
|
|
110
|
+
export function formatGroupSkips(skipped: GroupMemberSkip[]): string {
|
|
111
|
+
return skipped.map((skip) => `${skip.profile} (${skip.reason})`).join(", ");
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** Why no member of `group` runs on the agent, for a gate or a claim failure. */
|
|
115
|
+
export function groupUnavailableMessage(
|
|
116
|
+
group: string,
|
|
117
|
+
harness: string | null | undefined,
|
|
118
|
+
skipped: GroupMemberSkip[],
|
|
119
|
+
): string {
|
|
120
|
+
const where = harness ? `this ${harness} agent` : "this agent";
|
|
121
|
+
return `[model-group-unavailable] no member of "${group}" runs on ${where}${
|
|
122
|
+
skipped.length > 0 ? `: ${formatGroupSkips(skipped)}` : ""
|
|
123
|
+
}`;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** Whether `group` has a member on `harness`. A missing group, or no harness, answers true (claim decides). */
|
|
127
|
+
export async function groupHasMemberOnHarness(
|
|
128
|
+
group: string,
|
|
129
|
+
harness: string | null | undefined,
|
|
130
|
+
): Promise<boolean> {
|
|
131
|
+
if (!harness) return true;
|
|
132
|
+
const members = await modelGroupMemberHarnesses(group);
|
|
133
|
+
return !members || members.some((member) => member.harness === harness);
|
|
134
|
+
}
|