@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
|
@@ -2089,7 +2089,7 @@ describe("Slack renderer v2", () => {
|
|
|
2089
2089
|
expect(blocks.map((block) => block.elements.map((element) => element.text))).toEqual([
|
|
2090
2090
|
["Sources: <https://example.com/a|[1]> Cited"],
|
|
2091
2091
|
["General sources: <https://example.com/b|[2]> Whole answer"],
|
|
2092
|
-
["
|
|
2092
|
+
["Links: 🌐 <https://example.com/report.md|report.md>"],
|
|
2093
2093
|
[expect.stringContaining(ask.id.slice(0, 8))],
|
|
2094
2094
|
]);
|
|
2095
2095
|
} finally {
|
|
@@ -2098,6 +2098,48 @@ describe("Slack renderer v2", () => {
|
|
|
2098
2098
|
}
|
|
2099
2099
|
});
|
|
2100
2100
|
|
|
2101
|
+
test("outcome cards link bare URLs in the answer and show each URL once", async () => {
|
|
2102
|
+
const lead = await createAgent({ name: "Magic Link Lead", isLead: true, status: "idle" });
|
|
2103
|
+
const { channelId, threadTs } = uniqueSlackAddress("C_MAGIC_LINKS");
|
|
2104
|
+
const ask = await createTaskExtended("Magic links", {
|
|
2105
|
+
agentId: lead.id,
|
|
2106
|
+
source: "slack",
|
|
2107
|
+
slackChannelId: channelId,
|
|
2108
|
+
slackThreadTs: threadTs,
|
|
2109
|
+
contextKey: slackContextKey({ channelId, threadTs }),
|
|
2110
|
+
});
|
|
2111
|
+
await startTask(ask.id);
|
|
2112
|
+
await upsertTaskCitations(ask.id, [
|
|
2113
|
+
{ index: 1, kind: "url", ref: "https://github.com/o/r/pull/42", label: "The PR" },
|
|
2114
|
+
]);
|
|
2115
|
+
// The cited PR is the primary attachment: it shows as a source only.
|
|
2116
|
+
await insertTaskAttachment({
|
|
2117
|
+
taskId: ask.id,
|
|
2118
|
+
agentId: lead.id,
|
|
2119
|
+
kind: "url",
|
|
2120
|
+
name: "PR",
|
|
2121
|
+
url: "https://github.com/o/r/pull/42/",
|
|
2122
|
+
isPrimary: true,
|
|
2123
|
+
});
|
|
2124
|
+
await completeTask(
|
|
2125
|
+
ask.id,
|
|
2126
|
+
"Merged [citation:1]. Report: https://docs.example.test/a/b/report.md. Keep `https://code.example.test/x`, [docs](https://docs.example.test/d) and <https://slack.example.test/s|s>.",
|
|
2127
|
+
);
|
|
2128
|
+
await backdateLastUpdated([ask.id], 20);
|
|
2129
|
+
await processSlackRenderV2();
|
|
2130
|
+
|
|
2131
|
+
const started = calls.find((call) => call.method === "chat.startStream");
|
|
2132
|
+
expect(started?.payload.markdown_text).toBe(
|
|
2133
|
+
"✅ Merged <https://github.com/o/r/pull/42|[1]>. Report: <https://docs.example.test/a/b/report.md|docs.example.test/…/report.md>. Keep `https://code.example.test/x`, [docs](https://docs.example.test/d) and <https://slack.example.test/s|s>.",
|
|
2134
|
+
);
|
|
2135
|
+
const stopped = calls.find((call) => call.method === "chat.stopStream");
|
|
2136
|
+
const blocks = stopped?.payload.blocks as { type: string; elements: { text: string }[] }[];
|
|
2137
|
+
expect(blocks.map((block) => block.elements.map((element) => element.text))).toEqual([
|
|
2138
|
+
["Sources: <https://github.com/o/r/pull/42|[1]> The PR"],
|
|
2139
|
+
[expect.stringContaining(ask.id.slice(0, 8))],
|
|
2140
|
+
]);
|
|
2141
|
+
});
|
|
2142
|
+
|
|
2101
2143
|
test("the postMessage fallback keeps captions out of the notification text", async () => {
|
|
2102
2144
|
const lead = await createAgent({ name: "Fallback Lead", isLead: true, status: "idle" });
|
|
2103
2145
|
const { channelId, threadTs } = uniqueSlackAddress("C_CAPTION_FALLBACK");
|
|
@@ -2221,19 +2263,19 @@ describe("Slack renderer v2", () => {
|
|
|
2221
2263
|
label: "plain ASCII positive control",
|
|
2222
2264
|
attachment: { kind: "agent-fs", name: "report.txt", path: "/reports/report.txt" },
|
|
2223
2265
|
expected:
|
|
2224
|
-
"
|
|
2266
|
+
"Links: 📄 <https://files.example.test/file/~/org-1/drive-1/reports/report.txt|report.txt>",
|
|
2225
2267
|
},
|
|
2226
2268
|
{
|
|
2227
2269
|
label: "raw path spaces and parentheses",
|
|
2228
2270
|
attachment: { kind: "agent-fs", name: "final report", path: "/shared reports/final (v1).md" },
|
|
2229
2271
|
expected:
|
|
2230
|
-
"
|
|
2272
|
+
"Links: 📄 <https://files.example.test/file/~/org-1/drive-1/shared%20reports/final%20(v1).md|final report>",
|
|
2231
2273
|
},
|
|
2232
2274
|
{
|
|
2233
2275
|
label: "already encoded positive control",
|
|
2234
2276
|
attachment: { kind: "agent-fs", name: "report", path: "/reports/final%20%28v1%29.md" },
|
|
2235
2277
|
expected:
|
|
2236
|
-
"
|
|
2278
|
+
"Links: 📄 <https://files.example.test/file/~/org-1/drive-1/reports/final%20%28v1%29.md|report>",
|
|
2237
2279
|
},
|
|
2238
2280
|
{
|
|
2239
2281
|
label: "label delimiters, backslashes, and whitespace",
|
|
@@ -2242,12 +2284,12 @@ describe("Slack renderer v2", () => {
|
|
|
2242
2284
|
name: " \t[report] <final> & (copy)\\\r\n\t two ",
|
|
2243
2285
|
url: "https://example.test/report",
|
|
2244
2286
|
},
|
|
2245
|
-
expected: "
|
|
2287
|
+
expected: "Links: 🌐 <https://example.test/report|[report] <final> & (copy)\\ two>",
|
|
2246
2288
|
},
|
|
2247
2289
|
{
|
|
2248
2290
|
label: "URL positive control with an IPv6 host",
|
|
2249
2291
|
attachment: { kind: "url", name: "report", url: "http://[::1]/report.txt?q=a%20b&x=1#part" },
|
|
2250
|
-
expected: "
|
|
2292
|
+
expected: "Links: 🌐 <http://[::1]/report.txt?q=a%20b&x=1#part|report>",
|
|
2251
2293
|
},
|
|
2252
2294
|
{
|
|
2253
2295
|
label: "URL delimiters with existing escapes and query parameters",
|
|
@@ -2257,7 +2299,7 @@ describe("Slack renderer v2", () => {
|
|
|
2257
2299
|
url: "https://example.test/a%20b) [c]<(d)>|\\file?q=one two&x=1#part",
|
|
2258
2300
|
},
|
|
2259
2301
|
expected:
|
|
2260
|
-
"
|
|
2302
|
+
"Links: 🌐 <https://example.test/a%20b)%20[c]%3C(d)%3E%7C%5Cfile?q=one%20two&x=1#part|report>",
|
|
2261
2303
|
},
|
|
2262
2304
|
{
|
|
2263
2305
|
label: "non-HTTP fallback stays omitted",
|
|
@@ -2310,7 +2352,9 @@ describe("Slack renderer v2", () => {
|
|
|
2310
2352
|
const captions = (stopped?.payload.blocks as { type: string; elements: { text: string }[] }[])
|
|
2311
2353
|
.filter((block) => block.type === "context")
|
|
2312
2354
|
.map((block) => block.elements.map((element) => element.text).join(" "));
|
|
2313
|
-
expect(captions.filter((text) => text.startsWith("
|
|
2355
|
+
expect(captions.filter((text) => text.startsWith("Links:"))).toEqual(
|
|
2356
|
+
expected ? [expected] : [],
|
|
2357
|
+
);
|
|
2314
2358
|
} finally {
|
|
2315
2359
|
if (originalHost === undefined) delete process.env.AGENT_FS_LIVE_URL;
|
|
2316
2360
|
else process.env.AGENT_FS_LIVE_URL = originalHost;
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
initDb,
|
|
18
18
|
PINNED_WORKFLOW_KEYS,
|
|
19
19
|
pinWorkflowDefinition,
|
|
20
|
+
resolveApprovalRequest,
|
|
20
21
|
resolveWaitState,
|
|
21
22
|
toPinnedDefinition,
|
|
22
23
|
} from "../be/db";
|
|
@@ -396,6 +397,7 @@ describe("a run finishes on the definition it started with", () => {
|
|
|
396
397
|
const requestId = (registry.get("mock-hitl") as MockHitlExecutor).lastRequestId!;
|
|
397
398
|
|
|
398
399
|
await editTo(workflow.id, twoNode("B", hitlFirst));
|
|
400
|
+
await resolveApprovalRequest(requestId, { status: "approved", responses: { q1: true } });
|
|
399
401
|
workflowEventBus.emit("approval.resolved", {
|
|
400
402
|
requestId,
|
|
401
403
|
status: "approved",
|
|
@@ -129,6 +129,19 @@ const mockDeps: ExecutorDependencies = {
|
|
|
129
129
|
interpolate: (t: string) => t,
|
|
130
130
|
};
|
|
131
131
|
|
|
132
|
+
/** Store the answer on the request row, as the respond route does before it emits. */
|
|
133
|
+
async function storeAnswer(
|
|
134
|
+
requestId: string,
|
|
135
|
+
status: "approved" | "rejected" | "timeout" | "cancelled",
|
|
136
|
+
responses: Record<string, unknown> | null,
|
|
137
|
+
): Promise<void> {
|
|
138
|
+
if (status === "cancelled") {
|
|
139
|
+
await db.cancelApprovalRequestById(requestId, { reason: "test", resolvedBy: null });
|
|
140
|
+
} else {
|
|
141
|
+
await db.resolveApprovalRequest(requestId, { status, responses });
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
132
145
|
let workflowCounter = 0;
|
|
133
146
|
const createdWorkflowIds: string[] = [];
|
|
134
147
|
|
|
@@ -154,11 +167,21 @@ async function stepIsWaiting(runId: string, nodeId: string, notStepId?: string):
|
|
|
154
167
|
* Helper: creates a workflow with a HITL node that has port-based routing,
|
|
155
168
|
* starts it, waits for it to go async, then emits an approval event.
|
|
156
169
|
* Returns the run ID and step details for verification.
|
|
170
|
+
*
|
|
171
|
+
* `notify` sends a misleading approval.resolved for the step before the answer
|
|
172
|
+
* is stored: one naming its still-pending request ("pending"), or one naming a
|
|
173
|
+
* resolved request bound to another step ("foreign"), each carrying `status`.
|
|
174
|
+
* `eventStatus` makes the real event's payload disagree with the stored answer.
|
|
175
|
+
* The step must route only on the stored request bound to it.
|
|
157
176
|
*/
|
|
158
177
|
async function runHITLWorkflow(
|
|
159
178
|
approvalStatus: "approved" | "rejected" | "timeout" | "cancelled",
|
|
160
179
|
eventBus: InProcessEventBus,
|
|
161
180
|
registry: ExecutorRegistry,
|
|
181
|
+
opts: {
|
|
182
|
+
notify?: { request: "pending" | "foreign"; status: "approved" | "rejected" | "timeout" };
|
|
183
|
+
eventStatus?: "approved" | "rejected" | "timeout";
|
|
184
|
+
} = {},
|
|
162
185
|
) {
|
|
163
186
|
const def: WorkflowDefinition = {
|
|
164
187
|
nodes: [
|
|
@@ -196,11 +219,36 @@ async function runHITLWorkflow(
|
|
|
196
219
|
const requestId = hitlExecutor.lastRequestId!;
|
|
197
220
|
expect(requestId).toBeTruthy();
|
|
198
221
|
|
|
222
|
+
if (opts.notify) {
|
|
223
|
+
let notifiedId = requestId;
|
|
224
|
+
if (opts.notify.request === "foreign") {
|
|
225
|
+
notifiedId = crypto.randomUUID();
|
|
226
|
+
await db.createApprovalRequest({
|
|
227
|
+
id: notifiedId,
|
|
228
|
+
title: "Another step's card",
|
|
229
|
+
questions: [{ id: "q1", type: "approval", label: "Approve?", required: true }],
|
|
230
|
+
approvers: { policy: "any" },
|
|
231
|
+
workflowRunId: runId,
|
|
232
|
+
workflowRunStepId: steps.find((s) => s.nodeId === "start")!.id,
|
|
233
|
+
});
|
|
234
|
+
await storeAnswer(notifiedId, opts.notify.status, { q1: true });
|
|
235
|
+
}
|
|
236
|
+
eventBus.emit("approval.resolved", {
|
|
237
|
+
requestId: notifiedId,
|
|
238
|
+
status: opts.notify.status,
|
|
239
|
+
responses: { q1: true },
|
|
240
|
+
workflowRunId: runId,
|
|
241
|
+
workflowRunStepId: reviewStep!.id,
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
|
|
199
245
|
// Emit approval.resolved event — this triggers resumeFromApprovalResolution
|
|
246
|
+
await storeAnswer(requestId, approvalStatus, approvalStatus === "approved" ? { q1: true } : null);
|
|
247
|
+
const eventStatus = opts.eventStatus ?? approvalStatus;
|
|
200
248
|
eventBus.emit("approval.resolved", {
|
|
201
249
|
requestId,
|
|
202
|
-
status:
|
|
203
|
-
responses:
|
|
250
|
+
status: eventStatus,
|
|
251
|
+
responses: eventStatus === "approved" ? { q1: true } : null,
|
|
204
252
|
workflowRunId: runId,
|
|
205
253
|
workflowRunStepId: reviewStep!.id,
|
|
206
254
|
});
|
|
@@ -250,7 +298,10 @@ describe("HITL port-based routing", () => {
|
|
|
250
298
|
registry.register(new EchoExecutor({ ...mockDeps, eventBus }));
|
|
251
299
|
setupWorkflowResumeListener(eventBus, registry);
|
|
252
300
|
|
|
253
|
-
|
|
301
|
+
// A notification for the still-pending card must not route the step.
|
|
302
|
+
const { runId } = await runHITLWorkflow("approved", eventBus, registry, {
|
|
303
|
+
notify: { request: "pending", status: "rejected" },
|
|
304
|
+
});
|
|
254
305
|
|
|
255
306
|
const run = await getWorkflowRun(runId);
|
|
256
307
|
expect(run!.status).toBe("completed");
|
|
@@ -275,7 +326,10 @@ describe("HITL port-based routing", () => {
|
|
|
275
326
|
registry.register(new EchoExecutor({ ...mockDeps, eventBus }));
|
|
276
327
|
setupWorkflowResumeListener(eventBus, registry);
|
|
277
328
|
|
|
278
|
-
|
|
329
|
+
// The stored answer wins over an event payload that disagrees with it.
|
|
330
|
+
const { runId } = await runHITLWorkflow("rejected", eventBus, registry, {
|
|
331
|
+
eventStatus: "approved",
|
|
332
|
+
});
|
|
279
333
|
|
|
280
334
|
const run = await getWorkflowRun(runId);
|
|
281
335
|
expect(run!.status).toBe("completed");
|
|
@@ -291,6 +345,7 @@ describe("HITL port-based routing", () => {
|
|
|
291
345
|
// Should NOT have the approved or timeout paths
|
|
292
346
|
expect(stepNodeIds).not.toContain("deploy");
|
|
293
347
|
expect(stepNodeIds).not.toContain("notify-timeout");
|
|
348
|
+
expect(steps.find((s) => s.nodeId === "review")!.output).toMatchObject({ status: "rejected" });
|
|
294
349
|
});
|
|
295
350
|
|
|
296
351
|
test("cancelled → routes to no port; the step stays waiting", async () => {
|
|
@@ -321,7 +376,10 @@ describe("HITL port-based routing", () => {
|
|
|
321
376
|
registry.register(new EchoExecutor({ ...mockDeps, eventBus }));
|
|
322
377
|
setupWorkflowResumeListener(eventBus, registry);
|
|
323
378
|
|
|
324
|
-
|
|
379
|
+
// A resolved card bound to another step must not route this one.
|
|
380
|
+
const { runId } = await runHITLWorkflow("timeout", eventBus, registry, {
|
|
381
|
+
notify: { request: "foreign", status: "approved" },
|
|
382
|
+
});
|
|
325
383
|
|
|
326
384
|
const run = await getWorkflowRun(runId);
|
|
327
385
|
expect(run!.status).toBe("completed");
|
|
@@ -387,6 +445,7 @@ describe("HITL port-based routing", () => {
|
|
|
387
445
|
const requestId1 = hitlExecutor.lastRequestId!;
|
|
388
446
|
|
|
389
447
|
// REJECT — should loop back to generate-question
|
|
448
|
+
await storeAnswer(requestId1, "rejected", null);
|
|
390
449
|
eventBus.emit("approval.resolved", {
|
|
391
450
|
requestId: requestId1,
|
|
392
451
|
status: "rejected",
|
|
@@ -420,6 +479,7 @@ describe("HITL port-based routing", () => {
|
|
|
420
479
|
expect(requestId2).not.toBe(requestId1); // Different request
|
|
421
480
|
|
|
422
481
|
// APPROVE — should go to success
|
|
482
|
+
await storeAnswer(requestId2, "approved", { q1: true });
|
|
423
483
|
eventBus.emit("approval.resolved", {
|
|
424
484
|
requestId: requestId2,
|
|
425
485
|
status: "approved",
|
|
@@ -504,6 +564,7 @@ describe("HITL port-based routing", () => {
|
|
|
504
564
|
const requestId1 = hitlExecutor.lastRequestId!;
|
|
505
565
|
|
|
506
566
|
// REJECT — should loop back to generate-question (async)
|
|
567
|
+
await storeAnswer(requestId1, "rejected", null);
|
|
507
568
|
eventBus.emit("approval.resolved", {
|
|
508
569
|
requestId: requestId1,
|
|
509
570
|
status: "rejected",
|
|
@@ -551,6 +612,7 @@ describe("HITL port-based routing", () => {
|
|
|
551
612
|
expect(requestId2).not.toBe(requestId1);
|
|
552
613
|
|
|
553
614
|
// APPROVE — should go to success
|
|
615
|
+
await storeAnswer(requestId2, "approved", { q1: true });
|
|
554
616
|
eventBus.emit("approval.resolved", {
|
|
555
617
|
requestId: requestId2,
|
|
556
618
|
status: "approved",
|
|
@@ -14,6 +14,7 @@ import { runBootScrubSweep } from "../be/boot-scrub-sweep";
|
|
|
14
14
|
import { __resetEncryptionKeyForTests, encryptSecret, resolveEncryptionKey } from "../be/crypto";
|
|
15
15
|
import {
|
|
16
16
|
closeDb,
|
|
17
|
+
createApprovalRequest,
|
|
17
18
|
createUser,
|
|
18
19
|
createWaitState,
|
|
19
20
|
createWorkflow,
|
|
@@ -24,6 +25,7 @@ import {
|
|
|
24
25
|
getWorkflowRun,
|
|
25
26
|
getWorkflowRunStepsByRunId,
|
|
26
27
|
initDb,
|
|
28
|
+
resolveApprovalRequest,
|
|
27
29
|
updateWorkflowRun,
|
|
28
30
|
updateWorkflowRunStep,
|
|
29
31
|
} from "../be/db";
|
|
@@ -434,8 +436,18 @@ describe("a live resume with an unreadable sealed context fails the run", () =>
|
|
|
434
436
|
|
|
435
437
|
test("approval.resolved", async () => {
|
|
436
438
|
const { runId, stepId } = await parkedRunWithRotatedContext("review", "human-in-the-loop");
|
|
439
|
+
const requestId = crypto.randomUUID();
|
|
440
|
+
await createApprovalRequest({
|
|
441
|
+
id: requestId,
|
|
442
|
+
title: "Review",
|
|
443
|
+
questions: [{ id: "q1", type: "approval", label: "Approve?", required: true }],
|
|
444
|
+
approvers: { policy: "any" },
|
|
445
|
+
workflowRunId: runId,
|
|
446
|
+
workflowRunStepId: stepId,
|
|
447
|
+
});
|
|
448
|
+
await resolveApprovalRequest(requestId, { status: "approved", responses: {} });
|
|
437
449
|
eventBus.emit("approval.resolved", {
|
|
438
|
-
requestId
|
|
450
|
+
requestId,
|
|
439
451
|
status: "approved",
|
|
440
452
|
responses: {},
|
|
441
453
|
workflowRunId: runId,
|
|
@@ -459,6 +459,27 @@ describe("system-one-extraction on Cloudflare Clairic", () => {
|
|
|
459
459
|
],
|
|
460
460
|
[{ order_id: { type: "text", value: "A-88412", confidence: 1.5 } }, '"order_id".confidence'],
|
|
461
461
|
[{ order_id: { type: "text" } }, 'answer "order_id" is missing its value'],
|
|
462
|
+
// A null span means "not located" and is accepted; a malformed one is not.
|
|
463
|
+
[
|
|
464
|
+
{ order_id: { type: "text", value: "A-88412", span: [17, 10] } },
|
|
465
|
+
'"order_id".span must be [start, end] offsets',
|
|
466
|
+
],
|
|
467
|
+
[
|
|
468
|
+
{ tracking_number: { type: "text", value: null, span: [10] } },
|
|
469
|
+
'"tracking_number".span must be [start, end] offsets',
|
|
470
|
+
],
|
|
471
|
+
[
|
|
472
|
+
{ damage: { type: "list", value: ["dent", "scratch"], spans: [null, [9, 4]] } },
|
|
473
|
+
'"damage".spans must be a list of [start, end] offsets',
|
|
474
|
+
],
|
|
475
|
+
[
|
|
476
|
+
{ damage: { type: "list", value: ["dent"], spans: [[1.5, 4]] } },
|
|
477
|
+
'"damage".spans must be a list of [start, end] offsets',
|
|
478
|
+
],
|
|
479
|
+
[
|
|
480
|
+
{ damage: { type: "list", value: ["dent"], spans: "0-4" } },
|
|
481
|
+
'"damage".spans must be a list of [start, end] offsets',
|
|
482
|
+
],
|
|
462
483
|
[{ extra: { type: "text", value: "x" } }, "answer(s) for undeclared fields"],
|
|
463
484
|
];
|
|
464
485
|
for (const [answers, message] of cases) {
|
|
@@ -184,18 +184,18 @@ describe("matchesFilter — sandbox penetration (must all return false, never th
|
|
|
184
184
|
// ─── (d) Compile-time validation ───────────────────────────
|
|
185
185
|
|
|
186
186
|
describe("compileStringFilter — init-time validation", () => {
|
|
187
|
-
test("valid arrow-fn compiles cleanly", () => {
|
|
188
|
-
|
|
187
|
+
test("valid arrow-fn compiles cleanly", async () => {
|
|
188
|
+
await compileStringFilter("(p) => p.x === 1");
|
|
189
189
|
});
|
|
190
190
|
|
|
191
|
-
test("invalid arrow-fn syntax throws", () => {
|
|
192
|
-
expect(
|
|
193
|
-
expect(
|
|
191
|
+
test("invalid arrow-fn syntax throws", async () => {
|
|
192
|
+
await expect(compileStringFilter("(p) => {")).rejects.toThrow(/wait filter compile error/);
|
|
193
|
+
await expect(compileStringFilter("not-a-function")).rejects.toThrow();
|
|
194
194
|
});
|
|
195
195
|
|
|
196
|
-
test("filter source > 2KB rejected at compile time", () => {
|
|
196
|
+
test("filter source > 2KB rejected at compile time", async () => {
|
|
197
197
|
const huge = `(p) => ${"x".repeat(2050)} === 1`;
|
|
198
|
-
expect(
|
|
198
|
+
await expect(compileStringFilter(huge)).rejects.toThrow(/2KB/);
|
|
199
199
|
});
|
|
200
200
|
});
|
|
201
201
|
|
|
@@ -91,7 +91,12 @@ async function worktreeOfEndedTask(
|
|
|
91
91
|
return path;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
// Real-git fixture (bare origin + clone + push, ~9 git processes). Only the describes that
|
|
95
|
+
// run git opt in, so the pure config tests never wait on it; the generous hook timeout is for
|
|
96
|
+
// a loaded CI shard, where the default 5s killed the push mid-flight.
|
|
97
|
+
const GIT_FIXTURE_TIMEOUT_MS = 60_000;
|
|
98
|
+
|
|
99
|
+
async function setupRepo(): Promise<void> {
|
|
95
100
|
root = await realpath(await mkdtemp(join(tmpdir(), "worktree-reaper-")));
|
|
96
101
|
repo = join(root, "repo");
|
|
97
102
|
const origin = join(root, "origin.git");
|
|
@@ -110,11 +115,11 @@ beforeEach(async () => {
|
|
|
110
115
|
cwds = [];
|
|
111
116
|
clock = Date.now();
|
|
112
117
|
logs = [];
|
|
113
|
-
}
|
|
118
|
+
}
|
|
114
119
|
|
|
115
|
-
|
|
120
|
+
async function teardownRepo(): Promise<void> {
|
|
116
121
|
await rm(root, { recursive: true, force: true });
|
|
117
|
-
}
|
|
122
|
+
}
|
|
118
123
|
|
|
119
124
|
describe("resolveWorktreeReaperConfig", () => {
|
|
120
125
|
test("defaults to dry-run, 72h TTL, hourly sweeps", () => {
|
|
@@ -148,6 +153,9 @@ describe("resolveWorktreeReaperConfig", () => {
|
|
|
148
153
|
});
|
|
149
154
|
|
|
150
155
|
describe("WorktreeReaper decisions", () => {
|
|
156
|
+
beforeEach(setupRepo, GIT_FIXTURE_TIMEOUT_MS);
|
|
157
|
+
afterEach(teardownRepo);
|
|
158
|
+
|
|
151
159
|
test("removes a detached worktree when its only owner ended (rule 9)", async () => {
|
|
152
160
|
const r = reaper();
|
|
153
161
|
const path = await worktreeOfEndedTask(r, "review", "A");
|
|
@@ -262,6 +270,9 @@ describe("WorktreeReaper decisions", () => {
|
|
|
262
270
|
});
|
|
263
271
|
|
|
264
272
|
describe("WorktreeReaper slim, dry-run, ledger", () => {
|
|
273
|
+
beforeEach(setupRepo, GIT_FIXTURE_TIMEOUT_MS);
|
|
274
|
+
afterEach(teardownRepo);
|
|
275
|
+
|
|
265
276
|
test("slims only ignored node_modules of a held worktree past the TTL", async () => {
|
|
266
277
|
const r = reaper();
|
|
267
278
|
const path = await worktreeOfEndedTask(r, "held", "A");
|
|
@@ -238,4 +238,86 @@ describe("createX402Client spending reservations (real x402 core client)", () =>
|
|
|
238
238
|
expect(summary.todaySpent).toBe(5);
|
|
239
239
|
expect(summary.reserved).toBe(0);
|
|
240
240
|
});
|
|
241
|
+
|
|
242
|
+
// x402 v1 names the price `maxAmountRequired` and puts the URL on the requirements
|
|
243
|
+
const v1PaymentRequired = (maxAmountRequired?: string, extra: Record<string, unknown> = {}) =>
|
|
244
|
+
({
|
|
245
|
+
x402Version: 1,
|
|
246
|
+
accepts: [
|
|
247
|
+
{
|
|
248
|
+
scheme: "exact",
|
|
249
|
+
network: "base-sepolia",
|
|
250
|
+
...extra,
|
|
251
|
+
...(maxAmountRequired === undefined ? {} : { maxAmountRequired }),
|
|
252
|
+
resource: "https://paid.example/v1-resource",
|
|
253
|
+
description: "test",
|
|
254
|
+
mimeType: "application/json",
|
|
255
|
+
payTo: "0x4f27DC247a55EA5920F8311A25672Ed1B590792d",
|
|
256
|
+
maxTimeoutSeconds: 60,
|
|
257
|
+
asset: "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
|
|
258
|
+
extra: { name: "USDC", version: "2" },
|
|
259
|
+
},
|
|
260
|
+
],
|
|
261
|
+
}) as unknown as typeof paymentRequired;
|
|
262
|
+
|
|
263
|
+
test("v1: blocks a payment above the per-request limit", async () => {
|
|
264
|
+
const client = await createX402Client({ maxAutoApprove: 1, dailyLimit: 1 });
|
|
265
|
+
|
|
266
|
+
await expect(
|
|
267
|
+
client.x402Client.createPaymentPayload(v1PaymentRequired("5000000")),
|
|
268
|
+
).rejects.toThrow("exceeds per-request limit");
|
|
269
|
+
|
|
270
|
+
const summary = client.getSpendingSummary();
|
|
271
|
+
expect(summary.todaySpent).toBe(0);
|
|
272
|
+
expect(summary.todayCount).toBe(0);
|
|
273
|
+
expect(summary.reserved).toBe(0);
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
test("v1: limits the signed maxAmountRequired even when a decoy amount is present", async () => {
|
|
277
|
+
const client = await createX402Client({ maxAutoApprove: 1, dailyLimit: 1 });
|
|
278
|
+
|
|
279
|
+
await expect(
|
|
280
|
+
client.x402Client.createPaymentPayload(v1PaymentRequired("5000000", { amount: "0" })),
|
|
281
|
+
).rejects.toThrow("exceeds per-request limit");
|
|
282
|
+
|
|
283
|
+
// A v1 payload with only `amount` has nothing the v1 scheme signs against
|
|
284
|
+
await expect(
|
|
285
|
+
client.x402Client.createPaymentPayload(v1PaymentRequired(undefined, { amount: "1" })),
|
|
286
|
+
).rejects.toThrow("no parseable amount");
|
|
287
|
+
|
|
288
|
+
const summary = client.getSpendingSummary();
|
|
289
|
+
expect(summary.todaySpent).toBe(0);
|
|
290
|
+
expect(summary.todayCount).toBe(0);
|
|
291
|
+
expect(summary.reserved).toBe(0);
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
test("v1: records the signed amount and enforces the daily limit", async () => {
|
|
295
|
+
const client = await createX402Client({ maxAutoApprove: 5, dailyLimit: 5 });
|
|
296
|
+
|
|
297
|
+
await client.x402Client.createPaymentPayload(v1PaymentRequired("5000000"));
|
|
298
|
+
await expect(
|
|
299
|
+
client.x402Client.createPaymentPayload(v1PaymentRequired("5000000")),
|
|
300
|
+
).rejects.toThrow("would exceed daily limit");
|
|
301
|
+
|
|
302
|
+
const summary = client.getSpendingSummary();
|
|
303
|
+
expect(summary.todaySpent).toBe(5);
|
|
304
|
+
expect(summary.todayCount).toBe(1);
|
|
305
|
+
expect(client.spendingTracker.getTodayRecords()[0]?.url).toBe(
|
|
306
|
+
"https://paid.example/v1-resource",
|
|
307
|
+
);
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
test("blocks requirements with no parseable amount", async () => {
|
|
311
|
+
const client = await createX402Client({ maxAutoApprove: 5, dailyLimit: 10 });
|
|
312
|
+
|
|
313
|
+
for (const amount of [undefined, "", "abc", "1.5", "-5"]) {
|
|
314
|
+
await expect(
|
|
315
|
+
client.x402Client.createPaymentPayload(v1PaymentRequired(amount)),
|
|
316
|
+
).rejects.toThrow("no parseable amount");
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
const summary = client.getSpendingSummary();
|
|
320
|
+
expect(summary.todayCount).toBe(0);
|
|
321
|
+
expect(summary.reserved).toBe(0);
|
|
322
|
+
});
|
|
241
323
|
});
|
package/src/tools/memory-rate.ts
CHANGED
|
@@ -3,7 +3,7 @@ import * as z from "zod";
|
|
|
3
3
|
import { REFERENCES_SOURCE_MAX_LENGTH, sanitizeReferencesSource } from "@/be/memory/raters/types";
|
|
4
4
|
import { createToolRegistrar, swarmToolOutputSchema, toolErr, toolOk } from "@/tools/utils";
|
|
5
5
|
import { getApiKey } from "@/utils/api-key";
|
|
6
|
-
import {
|
|
6
|
+
import { getScriptApiBaseUrl } from "@/utils/constants";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Plan: thoughts/taras/plans/2026-05-05-memory-rater-v1.5/step-5.md §1
|
|
@@ -93,7 +93,7 @@ export const registerMemoryRateTool = (server: McpServer) => {
|
|
|
93
93
|
cleanedReferencesSource = cleaned;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
const apiUrl =
|
|
96
|
+
const apiUrl = getScriptApiBaseUrl();
|
|
97
97
|
const apiKey = getApiKey();
|
|
98
98
|
|
|
99
99
|
const event = {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import * as z from "zod";
|
|
3
|
-
import { deletePromptTemplate, getPromptTemplateById } from "@/be/db";
|
|
3
|
+
import { deletePromptTemplate, getAgentById, getPromptTemplateById } from "@/be/db";
|
|
4
|
+
import { can } from "@/rbac";
|
|
4
5
|
import { createToolRegistrar, swarmToolOutputSchema, toolErr, toolOk } from "@/tools/utils";
|
|
5
6
|
|
|
6
7
|
export const registerDeletePromptTemplateTool = (server: McpServer) => {
|
|
@@ -32,6 +33,26 @@ export const registerDeletePromptTemplateTool = (server: McpServer) => {
|
|
|
32
33
|
});
|
|
33
34
|
}
|
|
34
35
|
|
|
36
|
+
const agent = await getAgentById(requestInfo.agentId);
|
|
37
|
+
const decision = can({
|
|
38
|
+
principal: {
|
|
39
|
+
kind: "agent",
|
|
40
|
+
agentId: requestInfo.agentId,
|
|
41
|
+
isLead: agent?.isLead ?? false,
|
|
42
|
+
},
|
|
43
|
+
verb: "prompt-template.write",
|
|
44
|
+
resource: {
|
|
45
|
+
kind: "owned",
|
|
46
|
+
ownerAgentId: existing.scope === "agent" ? existing.scopeId : null,
|
|
47
|
+
},
|
|
48
|
+
source: "mcp",
|
|
49
|
+
});
|
|
50
|
+
if (!decision.allow) {
|
|
51
|
+
return toolErr("Only a lead can delete global or repo templates, or another agent's.", {
|
|
52
|
+
data: { yourAgentId: requestInfo.agentId },
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
35
56
|
const deleted = await deletePromptTemplate(id);
|
|
36
57
|
if (!deleted) {
|
|
37
58
|
return toolErr(`Failed to delete prompt template "${id}".`, {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import * as z from "zod";
|
|
3
|
-
import { getDbClient, upsertPromptTemplate } from "@/be/db";
|
|
3
|
+
import { getAgentById, getDbClient, upsertPromptTemplate } from "@/be/db";
|
|
4
|
+
import { can } from "@/rbac";
|
|
4
5
|
import { createToolRegistrar, swarmToolOutputSchema, toolErr, toolOk } from "@/tools/utils";
|
|
5
6
|
import { PromptTemplateScopeSchema, PromptTemplateStateSchema } from "@/types";
|
|
6
7
|
|
|
@@ -69,6 +70,19 @@ export const registerSetPromptTemplateTool = (server: McpServer) => {
|
|
|
69
70
|
});
|
|
70
71
|
}
|
|
71
72
|
|
|
73
|
+
const agent = await getAgentById(requestInfo.agentId);
|
|
74
|
+
const decision = can({
|
|
75
|
+
principal: { kind: "agent", agentId: requestInfo.agentId, isLead: agent?.isLead ?? false },
|
|
76
|
+
verb: "prompt-template.write",
|
|
77
|
+
resource: { kind: "owned", ownerAgentId: scope === "agent" ? scopeId : null },
|
|
78
|
+
source: "mcp",
|
|
79
|
+
});
|
|
80
|
+
if (!decision.allow) {
|
|
81
|
+
return toolErr("Only a lead can set global or repo templates, or another agent's.", {
|
|
82
|
+
data: { yourAgentId: requestInfo.agentId },
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
72
86
|
try {
|
|
73
87
|
// The sync helper stays on the raw handle for the boot seeder; on
|
|
74
88
|
// this request path, run it inside a client transaction so the write
|