@desplega.ai/agent-swarm 2.13.3 → 2.13.5
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-tbt61zkm.js +17 -0
- package/dist/{acp-targets-k8xs4tj8.js → acp-targets-w8dbs4nr.js} +10 -10
- package/dist/{actions-pg5fxjer.js → actions-8zrcbjrx.js} +237 -27
- package/dist/{agent-fs-provision-vbk3fppw.js → agent-fs-provision-cbt2ttds.js} +4 -4
- package/dist/{amp-adapter-adbhxsz9.js → amp-adapter-8x6zp8w4.js} +3 -3
- package/dist/{anthropic-messages-88b7s3n9.js → anthropic-messages-vdd1zmha.js} +10 -10
- package/dist/{app-b267ggx1.js → app-zfa9dwjw.js} +7 -7
- package/dist/{approval-notifications-evc1a9z5.js → approval-notifications-rv92zmza.js} +8 -8
- package/dist/{assistant-wgz2ab84.js → assistant-q7s7rm1q.js} +25 -25
- package/dist/{boot-args-schema-6tpk28j4.js → boot-args-schema-g27kpzr1.js} +1 -1
- package/dist/{boot-reembed-r1zyvefv.js → boot-reembed-1mjs52nt.js} +1 -1
- package/dist/{boot-reembed-ankp369c.js → boot-reembed-m62dpdkg.js} +1 -1
- package/dist/{boot-scrub-sweep-cgb6r5bd.js → boot-scrub-sweep-ss1vcamw.js} +2 -2
- package/dist/{boot-seeds-bjceqg7b.js → boot-seeds-hwnvgbb3.js} +4 -4
- package/dist/{boxd-hr8rsxzq.js → boxd-y0szhp0g.js} +2 -2
- package/dist/{claude-adapter-knztdnff.js → claude-adapter-0rjmbhjk.js} +9 -9
- package/dist/{claude-managed-adapter-qwejzqkk.js → claude-managed-adapter-6k032agg.js} +4 -4
- package/dist/{claude-managed-setup-0vgz4d1j.js → claude-managed-setup-6czvve8q.js} +5 -5
- package/dist/{claude-sdk-session-c3g6dv0g.js → claude-sdk-session-pr0znb81.js} +12671 -11885
- package/dist/{cli-2v4xxnx2.js → cli-0h8skzss.js} +1 -1
- package/dist/{cli-7fa6yv98.js → cli-0qt3epg4.js} +7 -7
- package/dist/{cli-aytna2fm.js → cli-19d6v8er.js} +7 -7
- package/dist/{cli-8m6gqnf1.js → cli-1jq2em7b.js} +4 -4
- package/dist/{cli-fp65jdp2.js → cli-1kvcsd2f.js} +219 -155
- package/dist/{cli-8fj8yfmk.js → cli-2vp0z049.js} +1 -1
- package/dist/{cli-61p7ty8d.js → cli-2wzkvfgm.js} +3 -3
- package/dist/{cli-tjf1bh1v.js → cli-34fygf87.js} +6 -4
- package/dist/{cli-czeh7x13.js → cli-3860pmrq.js} +4 -4
- package/dist/{cli-dq30fq3q.js → cli-3vw6dd4g.js} +2 -2
- package/dist/{cli-4dyhzhpx.js → cli-4gaf3tx5.js} +1 -1
- package/dist/{cli-3mf04tkh.js → cli-4vynxtrb.js} +1 -1
- package/dist/{cli-hpxcfvdm.js → cli-55h8m1x3.js} +10 -7
- package/dist/{cli-hxj888w3.js → cli-5n9w2xzx.js} +2 -2
- package/dist/{cli-50whymxq.js → cli-5tq15aa7.js} +2 -2
- package/dist/{cli-8sayvj48.js → cli-5web09sb.js} +3 -3
- package/dist/{cli-gc715jrc.js → cli-69zzpjgh.js} +1 -1
- package/dist/{cli-vgh5adn9.js → cli-6msnpj1z.js} +8 -8
- package/dist/{cli-f8rcvf2x.js → cli-7r9tvk8v.js} +76 -3
- package/dist/{cli-fbmgpt72.js → cli-7ypg8hka.js} +3 -3
- package/dist/{cli-xc8m5cjn.js → cli-887vhew6.js} +3 -3
- package/dist/{cli-q8aq48v1.js → cli-8b4rpnwj.js} +1 -1
- package/dist/{cli-pzsedyb0.js → cli-8pd1t17c.js} +14 -14
- package/dist/{cli-je587f74.js → cli-94gx6ze9.js} +1 -1
- package/dist/{cli-h9d3sdnc.js → cli-94mxerrp.js} +1 -1
- package/dist/{cli-ef590376.js → cli-9n6g14vs.js} +3 -3
- package/dist/{cli-80d5g0fa.js → cli-abby987g.js} +3 -3
- package/dist/{cli-grk77aen.js → cli-avax5mp9.js} +2 -2
- package/dist/{cli-hd2a204w.js → cli-b42yfn17.js} +14 -14
- package/dist/{cli-gkjw33x5.js → cli-b9ygp1kz.js} +2 -2
- package/dist/{cli-bh53ppqm.js → cli-bvamr9g0.js} +4 -4
- package/dist/{cli-ka4tqjzd.js → cli-ced4azn1.js} +15 -12
- package/dist/{cli-v1v49t36.js → cli-cmbb2t8a.js} +3 -3
- package/dist/{cli-hhb8kbwd.js → cli-cp163xga.js} +31 -16
- package/dist/{cli-55fqpd9q.js → cli-ebpq3c5z.js} +8 -8
- package/dist/{cli-9gmkw6xn.js → cli-ehg90jd1.js} +128 -48
- package/dist/{cli-jg5txpm6.js → cli-emdfd8fh.js} +75 -1
- package/dist/{cli-gxqwm3k3.js → cli-evy3egte.js} +104 -10
- package/dist/{cli-a21cwm89.js → cli-ewk3sg68.js} +3 -3
- package/dist/{cli-syqcny89.js → cli-f7b9nyvk.js} +9 -9
- package/dist/{cli-268b3dgn.js → cli-f9xw9pr4.js} +5 -5
- package/dist/{cli-61fzwtjk.js → cli-ffn0a515.js} +9 -9
- package/dist/{cli-ya1cj689.js → cli-fw67mnyc.js} +1 -1
- package/dist/{cli-dqgnbnxs.js → cli-grbngev5.js} +6 -1
- package/dist/{cli-sy2ge2ye.js → cli-hd5bm1e1.js} +4 -4
- package/dist/{cli-rfejbpe1.js → cli-htb5bpz2.js} +1 -1
- package/dist/{cli-w24741sm.js → cli-j69pzrrz.js} +7 -7
- package/dist/{cli-g4dhd3pr.js → cli-jdq3jmny.js} +6 -23
- package/dist/{cli-hv3820ez.js → cli-k0nebh10.js} +1 -1
- package/dist/{cli-d2epqm0y.js → cli-kezzteka.js} +1 -1
- package/dist/{cli-h0ewec3d.js → cli-kr0jpw9c.js} +1 -1
- package/dist/{cli-t25rq8mg.js → cli-ks06cd0n.js} +40 -11
- package/dist/{cli-1gnf5c7x.js → cli-kwj3131p.js} +1 -1
- package/dist/{cli-wtffytm8.js → cli-m8f4379k.js} +3 -3
- package/dist/{cli-43dsqhcp.js → cli-n79j1vxc.js} +4 -4
- package/dist/{cli-b768ek79.js → cli-nrt048ys.js} +1 -0
- package/dist/{cli-h3drhntp.js → cli-pedm2kht.js} +2 -2
- package/dist/{cli-eds5xnsz.js → cli-phmy14hb.js} +2 -2
- package/dist/{cli-7kv5d674.js → cli-prz1p3ft.js} +5 -5
- package/dist/{cli-nbawx3s0.js → cli-q1h041y8.js} +6 -6
- package/dist/{cli-cah298e5.js → cli-q41qar56.js} +104 -119
- package/dist/{cli-kwm1bek7.js → cli-qmx8bnt4.js} +2 -2
- package/dist/{cli-1wew39p0.js → cli-qrvk9nka.js} +28 -19
- package/dist/{cli-v8rpjrnx.js → cli-r3dxpmyt.js} +1 -1
- package/dist/{cli-0j4qmc80.js → cli-ryem5cfq.js} +8 -8
- package/dist/{cli-8pnawt98.js → cli-s8dhq7rj.js} +5 -5
- package/dist/{cli-zkbz8m2q.js → cli-sejvnjvw.js} +3 -2
- package/dist/{cli-at67kvnp.js → cli-srktrbby.js} +1 -1
- package/dist/{cli-wsnradtk.js → cli-srre41gb.js} +2 -2
- package/dist/{cli-r6xnchva.js → cli-t0n9svkb.js} +7 -7
- package/dist/{cli-y0q92v4r.js → cli-t879ww0y.js} +2 -2
- package/dist/{cli-eetzmsy5.js → cli-t9pzz2eq.js} +2 -2
- package/dist/{cli-xwsm6xkr.js → cli-tgc1kgg3.js} +1 -1
- package/dist/{cli-dw43pnzp.js → cli-tt7dkwjj.js} +7 -7
- package/dist/{cli-y754psdt.js → cli-tvyt8w6n.js} +5 -5
- package/dist/cli-v09eza21.js +1907 -0
- package/dist/{cli-mgr3gatr.js → cli-vbge4rsp.js} +4 -4
- package/dist/{cli-ppf9ap9n.js → cli-vcpyttcw.js} +1 -1
- package/dist/{cli-1606qw3n.js → cli-wzecestt.js} +1100 -432
- package/dist/{cli-5basv0e7.js → cli-x2adbg4j.js} +71 -9
- package/dist/{cli-vx9acp12.js → cli-ybte1fqc.js} +1 -1
- package/dist/{cli-vdfngx2g.js → cli-ywy8yz6t.js} +2 -2
- package/dist/{cli-cpkxh68d.js → cli-z1vam71h.js} +2 -2
- package/dist/{cli-djwt4mtn.js → cli-z3x7h79n.js} +15 -9
- package/dist/cli-z40t85ms.js +27 -0
- package/dist/{cli-ea367bdn.js → cli-zbbtp02a.js} +104 -27
- package/dist/{cli-88np9va3.js → cli-zntvmqmm.js} +2 -2
- package/dist/{cli-snwz16eg.js → cli-zxa1vmx7.js} +2 -2
- package/dist/{cli-50wa8k4h.js → cli-zy9bb22b.js} +1 -2
- package/dist/{cli-e4gx499y.js → cli-zzq96q57.js} +273 -106
- package/dist/cli.js +21 -21
- package/dist/{codex-adapter-493vb8cv.js → codex-adapter-bn7eaxk5.js} +8 -8
- package/dist/{codex-hook-ej8hn6z5.js → codex-hook-nnmezjg9.js} +3 -3
- package/dist/{codex-login-ven5cz5j.js → codex-login-ktfg1cxk.js} +1 -1
- package/dist/{codex-session-runner-ps5m4z1g.js → codex-session-runner-j1e9hffc.js} +9 -9
- package/dist/{commands-shktk0b8.js → commands-amhpafrr.js} +3 -3
- package/dist/{controller-wn3vd217.js → controller-tw7g10j2.js} +4 -4
- package/dist/{controllers-connect-yft057ws.js → controllers-connect-2ssqz7f4.js} +25 -25
- package/dist/core-bwp98v4w.js +42 -0
- package/dist/{cursor-adapter-8fpm4dng.js → cursor-adapter-d6knjmwa.js} +2 -2
- package/dist/{db-0ezhdhz5.js → db-fd6xxm77.js} +3 -3
- package/dist/{db-84pz2w5c.js → db-sc59379z.js} +2 -2
- package/dist/{devin-adapter-fs90ab4v.js → devin-adapter-3bp6rape.js} +1 -1
- package/dist/{dispatcher-h2rz69f6.js → dispatcher-a2gdqz8c.js} +22 -22
- package/dist/{docker-1h33jvh9.js → docker-a59g3ebm.js} +2 -2
- package/dist/{dsh-adapter-g9yqv09y.js → dsh-adapter-43ygwqn7.js} +2 -2
- package/dist/{e2b-jnk0yeva.js → e2b-cn7cvjqy.js} +3 -3
- package/dist/{e2b-y7e5kmzf.js → e2b-qnxyfea6.js} +3 -3
- package/dist/{easter-egg-3d-m41ad78v.js → easter-egg-3d-a0pphy71.js} +1 -1
- package/dist/{embedding-space-yam9zwzj.js → embedding-space-qepzrach.js} +6 -6
- package/dist/{embeddings-g2be0y8q.js → embeddings-d7vr881x.js} +1 -1
- package/dist/{event-bus-08t2b4y2.js → event-bus-7gbsr0g4.js} +1 -1
- package/dist/{execute-hhdejgzf.js → execute-6afts2bn.js} +1 -1
- package/dist/{external-channel-kjt2yzfj.js → external-channel-881zq1x4.js} +2 -2
- package/dist/fx-adapter-cr2hq17y.js +20 -0
- package/dist/grok-adapter-ayddnbsc.js +20 -0
- package/dist/handlers-7ghs84x2.js +41 -0
- package/dist/{heartbeat-2e5jdexj.js → heartbeat-4c022m6a.js} +25 -25
- package/dist/{hook-acg9saz7.js → hook-4k84x499.js} +6 -6
- package/dist/{hook-34s8cmgn.js → hook-a7eh6zty.js} +9 -9
- package/dist/{http-ra2zr2f8.js → http-6aw5wanc.js} +456 -1864
- package/dist/{index-mbpxhc4w.js → index-126v2d0t.js} +1 -4
- package/dist/index-dtt0d634.js +44 -0
- package/dist/index-hmszyqkk.js +42 -0
- package/dist/index-j6rm1rtn.js +39 -0
- package/dist/{index-9q42cr54.js → index-rwwhsmjg.js} +1 -1
- package/dist/{index-93bw5wds.js → index-xhad0n8m.js} +1 -1
- package/dist/{index-2z1z7qx6.js → index-yq9hhhhy.js} +26 -26
- package/dist/{index-9r4j0a60.js → index-z2g9469g.js} +410 -27
- package/dist/{k8s-8326q0rq.js → k8s-36gfn847.js} +2 -2
- package/dist/{keepalive-vjnnqbkm.js → keepalive-zhbmztqw.js} +5 -5
- package/dist/lead-g2j4q39z.js +83 -0
- package/dist/{maintenance-px2g599e.js → maintenance-rsp0591h.js} +1 -1
- package/dist/{node-2wfcey7d.js → node-0as4n1ef.js} +3 -3
- package/dist/{node-zd6shky9.js → node-dhxbt01p.js} +3 -3
- package/dist/{node-z67yjre7.js → node-rxte5hc6.js} +290 -70
- package/dist/{node-hjn5n1yp.js → node-t0ct2zpw.js} +3 -5
- package/dist/{oauth-refresh-sweep-nkykf09m.js → oauth-refresh-sweep-w3cqmxq7.js} +4 -4
- package/dist/{object-webhooks-gt9xnq21.js → object-webhooks-331hay92.js} +7 -7
- package/dist/{onboard-1f134p65.js → onboard-n2w80m2n.js} +7 -7
- package/dist/{opencode-adapter-94976yab.js → opencode-adapter-z98127cz.js} +8 -8
- package/dist/{otel-impl-5d4p2fqs.js → otel-impl-xsk35tvf.js} +2 -2
- package/dist/{pending-vkk0vx6n.js → pending-2e6trkxd.js} +23 -23
- package/dist/{pi-mono-adapter-cyzdv5er.js → pi-mono-adapter-wh6yndtm.js} +13 -13
- package/dist/{pricing-refresh-jtmjwss9.js → pricing-refresh-9355dj1t.js} +2 -2
- package/dist/{rbac-roles-yd1fgpsn.js → rbac-roles-58y3m912.js} +3 -3
- package/dist/{rbac-roles-1fvmdyeb.js → rbac-roles-8eajw4s6.js} +6 -4
- package/dist/{render-v2-kb5s3vx4.js → render-v2-7gskkmd4.js} +7 -7
- package/dist/{resume-z1vs44n5.js → resume-0drnmpja.js} +10 -10
- package/dist/{runtime-gk6ct7r7.js → runtime-d2tcmqte.js} +1 -1
- package/dist/{session-access-nz6nre4d.js → session-access-0ztys6bd.js} +5 -5
- package/dist/{session-source-backfill-wb60zjkd.js → session-source-backfill-cdm5s046.js} +3 -3
- package/dist/{setup-2x8g8j4s.js → setup-pqwb9tcc.js} +1 -1
- package/dist/thread-buffer-epx3san4.js +42 -0
- package/dist/{tree-visibility-ts3z30kw.js → tree-visibility-rwz67mje.js} +2 -2
- package/dist/{user-merge-jobs-zetg26e0.js → user-merge-jobs-mxrhamwt.js} +3 -3
- package/dist/{virtual-modules-674fka8x.js → virtual-modules-71y1gsmg.js} +3 -3
- package/dist/{work-objects-w52yyjxm.js → work-objects-3k4ykt9j.js} +25 -25
- package/dist/worker-09gqn9xy.js +83 -0
- package/dist/{worker-follow-up-dyfxyjbj.js → worker-follow-up-y0h64xpr.js} +22 -22
- package/dist/{x-asbrnafg.js → x-d27jj7z7.js} +2 -2
- package/openapi.json +861 -33
- package/package.json +4 -4
- package/src/apps/sync.ts +20 -5
- package/src/azure-devops/boards-sync.ts +1 -1
- package/src/be/db/approvals.ts +2 -0
- package/src/be/db/runtime.ts +5 -0
- package/src/be/db/script-run-sources.ts +17 -0
- package/src/be/db/slack-trees.ts +12 -1
- package/src/be/db/tasks/read.ts +25 -1
- package/src/be/db/tasks/write.ts +47 -12
- package/src/be/db/users/avatar.ts +12 -0
- package/src/be/db-retention.ts +1 -1
- package/src/be/db.ts +149 -67
- package/src/be/design-system.ts +63 -0
- package/src/be/migrations/342_script_run_sources.sql +20 -0
- package/src/be/migrations/344_user_avatar.sql +4 -0
- package/src/be/migrations/345_task_status_kind.sql +6 -0
- package/src/be/migrations/runner.ts +8 -0
- package/src/be/migrations/script-run-sources.ts +51 -0
- package/src/be/primitives/object-embed.ts +2 -2
- package/src/be/primitives/objects.ts +2 -2
- package/src/be/rbac-roles.ts +2 -0
- package/src/be/runtime-pools/supervisor.ts +1 -0
- package/src/be/scripts/typecheck.ts +5 -3
- package/src/be/seed-scripts/catalog/design-system-seed.ts +158 -0
- package/src/be/seed-scripts/index.ts +9 -0
- package/src/be/swarm-config-guard.ts +25 -1
- package/src/bitbucket/handlers.ts +1 -1
- package/src/commands/credential-outcome-report.ts +96 -0
- package/src/commands/onboard/agent-fs-version.ts +1 -1
- package/src/commands/runner.ts +49 -3
- package/src/event-waits/github.ts +39 -6
- package/src/event-waits/index.ts +4 -2
- package/src/event-waits/types.ts +10 -3
- package/src/extensions/contract-types.generated.ts +1 -1
- package/src/github/app.ts +177 -13
- package/src/github/handlers.ts +7 -2
- package/src/github/pull-request-state.ts +100 -11
- package/src/gitlab/handlers.ts +2 -2
- package/src/heartbeat/heartbeat.ts +24 -5
- package/src/http/all-routes.ts +1 -0
- package/src/http/api-keys.ts +26 -0
- package/src/http/approval-chat-answer.ts +99 -0
- package/src/http/approval-requests.ts +280 -225
- package/src/http/asset-key-write.ts +45 -0
- package/src/http/assets.ts +4 -3
- package/src/http/design-system.ts +103 -0
- package/src/http/github-token.ts +27 -6
- package/src/http/index.ts +10 -6
- package/src/http/pages-public.ts +25 -10
- package/src/http/pages.ts +21 -10
- package/src/http/person-responder.ts +28 -0
- package/src/http/schedules.ts +6 -6
- package/src/http/sessions.ts +7 -2
- package/src/http/tasks.ts +23 -5
- package/src/http/users.ts +5 -0
- package/src/http/webhooks.ts +19 -1
- package/src/http/workflows.ts +5 -10
- package/src/integrations/chat-sdk/adapters.ts +33 -3
- package/src/integrations/chat-sdk/commands.ts +3 -1
- package/src/integrations/chat-sdk/inbound.ts +6 -18
- package/src/integrations/chat-sdk/mentions.ts +188 -0
- package/src/integrations/chat-sdk/outbound.ts +20 -3
- package/src/integrations/chat-sdk/router.ts +8 -0
- package/src/integrations/chat-sdk/telegram-thread.ts +12 -0
- package/src/jira/adf.ts +35 -9
- package/src/jira/sync.ts +1 -1
- package/src/kv-reserved-namespaces.ts +5 -0
- package/src/linear/sync.ts +5 -3
- package/src/pages/page-head.ts +11 -1
- package/src/prompts/session-templates.ts +1 -0
- package/src/providers/acp-targets.ts +2 -2
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/claude-adapter.ts +5 -0
- package/src/providers/claude-sdk-session.ts +5 -0
- package/src/providers/dsh-adapter.ts +48 -13
- package/src/providers/runtime-dependencies.ts +1 -1
- package/src/rbac/legacy-policy.ts +4 -0
- package/src/rbac/permissions.ts +8 -0
- package/src/scheduler/deferred-task-waits.ts +74 -13
- package/src/scheduler/index.ts +1 -0
- package/src/scheduler/scheduler.test.ts +32 -1
- package/src/scheduler/scheduler.ts +24 -1
- package/src/script-workflows/executor.ts +6 -0
- package/src/script-workflows/supervisor.ts +2 -1
- package/src/scripts-runtime/sdk-allowlist.ts +2 -0
- package/src/scripts-runtime/swarm-sdk.ts +20 -24
- package/src/scripts-runtime/types/stdlib.d.ts +12 -2
- package/src/scripts-runtime/types/swarm-extension.d.ts +19 -2
- package/src/scripts-runtime/types/swarm-sdk.d.ts +12 -2
- package/src/server.ts +2 -0
- package/src/slack/actions.ts +4 -1
- package/src/slack/approval-actions.ts +148 -0
- package/src/slack/approval-buttons.ts +28 -0
- package/src/slack/render-v2.ts +148 -7
- package/src/tests/api-drain-worker-e2e.test.ts +0 -2
- package/src/tests/approval-auto-cancellation-migration.test.ts +8 -19
- package/src/tests/approval-card-resolution.test.ts +2 -17
- package/src/tests/approval-requests-notifications.test.ts +41 -27
- package/src/tests/approval-requests.test.ts +137 -369
- package/src/tests/apps-sync-engine.test.ts +5 -3
- package/src/tests/apps-table-filters-migration.test.ts +44 -25
- package/src/tests/bitbucket-handlers.test.ts +2 -0
- package/src/tests/chat-sdk-commands.test.ts +1 -0
- package/src/tests/chat-sdk-mentions.test.ts +183 -0
- package/src/tests/claude-adapter.test.ts +35 -0
- package/src/tests/codex-adapter.test.ts +3 -92
- package/src/tests/codex-gpt6-release.test.ts +0 -9
- package/src/tests/codex-oauth-credential-info.test.ts +35 -18
- package/src/tests/codex-oauth.test.ts +0 -6
- package/src/tests/codex-pool.test.ts +5 -214
- package/src/tests/codex-rate-limit-parse.test.ts +0 -7
- package/src/tests/codex-swarm-events.test.ts +11 -54
- package/src/tests/create-page-tool.test.ts +5 -0
- package/src/tests/db-client-busy-retry.test.ts +49 -16
- package/src/tests/defer-task.test.ts +1 -0
- package/src/tests/dsh-adapter.test.ts +53 -1
- package/src/tests/e2e-shards.test.ts +9 -9
- package/src/tests/enabled-tools.test.ts +0 -2
- package/src/tests/fixtures/base-prompt-baseline.json +6 -6
- package/src/tests/fixtures/compiled-source-schema-boot.ts +24 -0
- package/src/tests/fixtures/secret-corpus.ts +43 -1
- package/src/tests/github-app-worker-auth-helper.test.ts +147 -1
- package/src/tests/gitlab-handlers.test.ts +2 -0
- package/src/tests/heartbeat-jev-gate.test.ts +9 -241
- package/src/tests/heartbeat-reroute-decision.test.ts +2 -0
- package/src/tests/heartbeat-stall-thresholds.test.ts +174 -0
- package/src/tests/heartbeat-supersede-resume.test.ts +2 -0
- package/src/tests/heartbeat.test.ts +1 -0
- package/src/tests/jira-adf.test.ts +42 -2
- package/src/tests/key-usage-selection.test.ts +302 -0
- package/src/tests/memory-e2e.test.ts +34 -103
- package/src/tests/memory-key-paths.test.ts +5 -0
- package/src/tests/memory-rater-llm.test.ts +33 -149
- package/src/tests/memory-store.test.ts +24 -125
- package/src/tests/memory.test.ts +31 -100
- package/src/tests/merge-gate-detect-changes.test.ts +314 -16
- package/src/tests/migration-342-script-run-sources.test.ts +196 -0
- package/src/tests/migration-bunfs-compat.test.ts +129 -9
- package/src/tests/otel-service-name.test.ts +0 -9
- package/src/tests/otel-session-cost-metrics.test.ts +1 -38
- package/src/tests/pool-session-logs.test.ts +8 -42
- package/src/tests/pre-push-affected-tests.test.ts +106 -0
- package/src/tests/prompt-template-session.test.ts +3 -0
- package/src/tests/rbac-e2e-helpers.test.ts +10 -4
- package/src/tests/rbac-e2e-helpers.ts +13 -4
- package/src/tests/rbac-roles.test.ts +2 -0
- package/src/tests/runner-api-drain.test.ts +2 -17
- package/src/tests/runner-terminal-window-report.test.ts +132 -0
- package/src/tests/runtime-e2b-pools.test.ts +7 -1
- package/src/tests/runtime-supervisor-failures.test.ts +1 -0
- package/src/tests/sandboxed-process.test.ts +26 -21
- package/src/tests/schedule-http-triage-tools.test.ts +12 -9
- package/src/tests/schedule-target-type.test.ts +4 -1
- package/src/tests/scheduled-tasks.test.ts +14 -51
- package/src/tests/script-connections.test.ts +2 -0
- package/src/tests/script-executor-conformance.test.ts +4 -48
- package/src/tests/script-executor-quickjs-pool.test.ts +9 -7
- package/src/tests/script-native-startup.test.ts +21 -25
- package/src/tests/script-runs-retention.test.ts +43 -16
- package/src/tests/script-workflows-runtime-e2e.test.ts +56 -22
- package/src/tests/scripts-http.test.ts +9 -3
- package/src/tests/sdk-allowlist.test.ts +26 -13
- package/src/tests/sdk-store-progress-skipped.test.ts +12 -5
- package/src/tests/secret-rules.test.ts +38 -2
- package/src/tests/secret-scrub-gate.test.ts +7 -0
- package/src/tests/secret-scrubber.test.ts +62 -2
- package/src/tests/seed-scripts.test.ts +2 -2
- package/src/tests/session-logs.test.ts +1 -260
- package/src/tests/slack-render-v2.test.ts +5 -148
- package/src/tests/system-one-hosts-ui-mirror.test.ts +1 -0
- package/src/tests/task-cascade-fail.test.ts +1 -0
- package/src/tests/task-supersede-resume.test.ts +1 -0
- package/src/tests/test-proc.ts +5 -2
- package/src/tests/vcs-azure-devops.test.ts +10 -0
- package/src/tests/vcs-provider.test.ts +8 -0
- package/src/tests/window-stream-reporter.test.ts +122 -0
- package/src/tests/workflow-agent-task-retry.test.ts +1 -3
- package/src/tests/workflow-cascade-cancel.test.ts +1 -0
- package/src/tests/workflow-retry-v2.test.ts +34 -43
- package/src/tests/workflow-retry-validation.test.ts +8 -48
- package/src/tests/worktree-reaper.test.ts +2 -2
- package/src/themes/design-system.ts +163 -0
- package/src/themes/page-theme.ts +28 -19
- package/src/tools/cancel-task.ts +2 -2
- package/src/tools/chat-post.ts +7 -3
- package/src/tools/create-page.ts +3 -0
- package/src/tools/defer-task.ts +7 -2
- package/src/tools/design-system.ts +102 -0
- package/src/tools/get-task-details.ts +8 -4
- package/src/tools/get-tasks.ts +13 -2
- package/src/tools/manage-user.ts +9 -0
- package/src/tools/mcp-servers/mcp-server-get.ts +1 -1
- package/src/tools/mcp-servers/mcp-server-list.ts +1 -1
- package/src/tools/register-chat-channel.ts +11 -2
- package/src/tools/skills/skill-get-file.ts +1 -1
- package/src/tools/skills/skill-get.ts +1 -1
- package/src/tools/skills/skill-list.ts +1 -1
- package/src/tools/skills/skill-search.ts +1 -1
- package/src/tools/store-progress.ts +5 -3
- package/src/tools/utils.ts +49 -4
- package/src/tools/workflows/get-workflow-run.ts +1 -1
- package/src/tools/workflows/get-workflow.ts +1 -1
- package/src/tools/workflows/list-workflow-runs.ts +1 -1
- package/src/tools/workflows/list-workflows.ts +1 -1
- package/src/types.ts +158 -0
- package/src/utils/constants.ts +12 -0
- package/src/utils/credentials.ts +42 -5
- package/src/utils/error-tracker.ts +6 -0
- package/src/utils/key-usage.ts +114 -0
- package/src/utils/sandboxed-process.ts +1 -0
- package/src/utils/secret-rules.generated.ts +149 -149
- package/src/utils/secret-scrubber.ts +111 -5
- package/src/vcs/azure-devops.ts +22 -1
- package/src/vcs/index.ts +3 -1
- package/src/workflows/approval-inline.ts +122 -0
- package/src/workflows/approval-notifications.ts +7 -2
- package/src/workflows/engine.ts +6 -5
- package/src/workflows/executors/agent-task.ts +14 -0
- package/src/workflows/executors/system-one-providers.ts +23 -0
- package/src/workflows/resume.ts +5 -2
- package/templates/skills/apps/SKILL.md +2 -0
- package/templates/skills/apps/content.md +2 -0
- package/templates/skills/boards-and-sheets/content.md +4 -2
- package/templates/skills/pages/content.md +41 -8
- package/templates/skills/swarm-docs/content.md +6 -0
- package/templates/skills/swarm-scripts/SKILL.md +1 -0
- package/templates/skills/swarm-scripts/content.md +1 -0
- package/templates/skills/workflow-iterate/content.md +1 -1
- package/dist/acp-adapter-t2q6nsqv.js +0 -17
- package/dist/cli-kh973792.js +0 -98
- package/dist/core-nheayfgm.js +0 -42
- package/dist/fx-adapter-8g7xsp8q.js +0 -20
- package/dist/grok-adapter-ztk2zkz1.js +0 -20
- package/dist/handlers-9ywssz71.js +0 -41
- package/dist/index-6mgbdtv1.js +0 -44
- package/dist/index-hqdsn2t2.js +0 -39
- package/dist/index-st231bqv.js +0 -40
- package/dist/lead-mk0xkth2.js +0 -82
- package/dist/thread-buffer-d50rqpev.js +0 -42
- package/dist/worker-662x1vse.js +0 -82
- package/src/tests/apps-table-selection-migration.test.ts +0 -95
- package/src/tests/extensions-example-heartbeat-remediate.test.ts +0 -69
- package/src/tests/extensions-example-rewrite-and-suppress.test.ts +0 -70
package/src/tools/defer-task.ts
CHANGED
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
type ExternalEventAdapter,
|
|
21
21
|
getExternalEventAdapter,
|
|
22
22
|
matchKeyOf,
|
|
23
|
+
toConfirmResult,
|
|
23
24
|
} from "@/event-waits";
|
|
24
25
|
import {
|
|
25
26
|
MAX_PENDING_EVENT_WAITS_PER_AGENT,
|
|
@@ -77,8 +78,11 @@ async function admitExternalWait(
|
|
|
77
78
|
}
|
|
78
79
|
if (adapter.confirm) {
|
|
79
80
|
try {
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
const already = toConfirmResult(await adapter.confirm(event, match));
|
|
82
|
+
if (already.happened) {
|
|
83
|
+
return {
|
|
84
|
+
error: `${target} already happened${already.detail ? ` (${already.detail})` : ""}; read its result instead of deferring.`,
|
|
85
|
+
};
|
|
82
86
|
}
|
|
83
87
|
} catch (error) {
|
|
84
88
|
return {
|
|
@@ -544,6 +548,7 @@ export const registerDeferTaskTool = (server: McpServer) => {
|
|
|
544
548
|
const completed = await completeTask(taskId, terminalOutput, {
|
|
545
549
|
addTags: ["deferred"],
|
|
546
550
|
deferredAt: new Date().toISOString(),
|
|
551
|
+
statusKind: "deferred",
|
|
547
552
|
});
|
|
548
553
|
if (!completed) {
|
|
549
554
|
// Another writer terminally completed/failed/cancelled this task
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `design-system-get` / `design-system-set`: the org design system that
|
|
3
|
+
* restyles every designVersion 2 page without its own `theme`
|
|
4
|
+
* (src/themes/design-system.ts). `design-system-set` is the only agent-facing
|
|
5
|
+
* writer, so every value passes the theme importer's checks.
|
|
6
|
+
*/
|
|
7
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
8
|
+
import * as z from "zod";
|
|
9
|
+
import { resolveTaskAuditUserId } from "@/be/audit-user";
|
|
10
|
+
import { getAgentById } from "@/be/db";
|
|
11
|
+
import { getDesignSystem, saveDesignSystem } from "@/be/design-system";
|
|
12
|
+
import { can } from "@/rbac";
|
|
13
|
+
import { buildDesignSystem, DesignSystemError } from "@/themes/design-system";
|
|
14
|
+
import { createToolRegistrar, swarmToolOutputSchema, toolErr, toolOk } from "@/tools/utils";
|
|
15
|
+
import { DesignSystemInputSchema } from "@/types";
|
|
16
|
+
|
|
17
|
+
const outputSchema = swarmToolOutputSchema({
|
|
18
|
+
status: z.string().optional(),
|
|
19
|
+
designSystem: z.unknown().optional(),
|
|
20
|
+
previous: z.unknown().optional(),
|
|
21
|
+
invalidReason: z.string().optional(),
|
|
22
|
+
ignoredTokens: z.array(z.string()).optional(),
|
|
23
|
+
saved: z.boolean().optional(),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export const registerDesignSystemTools = (server: McpServer) => {
|
|
27
|
+
const register = createToolRegistrar(server);
|
|
28
|
+
|
|
29
|
+
register(
|
|
30
|
+
"design-system-get",
|
|
31
|
+
{
|
|
32
|
+
title: "Get the org design system",
|
|
33
|
+
description:
|
|
34
|
+
'Returns the org design system that restyles every HTML page without its own theme. status is "none" (nobody asked yet), "declined" (the requester said no; do not ask again), "active", or "invalid" (the stored record fails validation and pages ignore it). previous is the value the last design-system-set replaced, for a one-step undo.',
|
|
35
|
+
annotations: { readOnlyHint: true },
|
|
36
|
+
inputSchema: z.object({}),
|
|
37
|
+
outputSchema,
|
|
38
|
+
},
|
|
39
|
+
async () => {
|
|
40
|
+
const { current, previous } = await getDesignSystem();
|
|
41
|
+
return toolOk(`Design system status: ${current.status}.`, {
|
|
42
|
+
data: {
|
|
43
|
+
status: current.status,
|
|
44
|
+
...("record" in current ? { designSystem: current.record } : {}),
|
|
45
|
+
...("reason" in current ? { invalidReason: current.reason } : {}),
|
|
46
|
+
...("record" in previous ? { previous: previous.record } : {}),
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
register(
|
|
53
|
+
"design-system-set",
|
|
54
|
+
{
|
|
55
|
+
title: "Set the org design system",
|
|
56
|
+
description:
|
|
57
|
+
'Saves the org design system: a base preset plus token overrides, fonts, logo, mode lock and chart palette. Every HTML page without its own theme picks it up on its next view. Save only what the requester approved, after they saw a preview (the design-system-seed script builds one). To record a "no", pass status "declined". dryRun: true validates and returns the normalized record without saving. The replaced value is kept as previous (see design-system-get).',
|
|
58
|
+
annotations: { destructiveHint: false },
|
|
59
|
+
rbac: { permission: "design-system.write" },
|
|
60
|
+
inputSchema: DesignSystemInputSchema.extend({
|
|
61
|
+
dryRun: z
|
|
62
|
+
.boolean()
|
|
63
|
+
.optional()
|
|
64
|
+
.describe("Validate and return the normalized record without saving."),
|
|
65
|
+
}),
|
|
66
|
+
outputSchema,
|
|
67
|
+
},
|
|
68
|
+
async ({ dryRun, ...input }, requestInfo) => {
|
|
69
|
+
if (!requestInfo.agentId) return toolErr('Agent ID not found. Set the "X-Agent-ID" header.');
|
|
70
|
+
const agent = await getAgentById(requestInfo.agentId);
|
|
71
|
+
const decision = can({
|
|
72
|
+
principal: { kind: "agent", agentId: requestInfo.agentId, isLead: agent?.isLead ?? false },
|
|
73
|
+
verb: "design-system.write",
|
|
74
|
+
source: "mcp",
|
|
75
|
+
});
|
|
76
|
+
if (!decision.allow) return toolErr(decision.reason);
|
|
77
|
+
|
|
78
|
+
const userId = await resolveTaskAuditUserId(requestInfo.sourceTaskId, requestInfo.agentId);
|
|
79
|
+
let built: ReturnType<typeof buildDesignSystem>;
|
|
80
|
+
try {
|
|
81
|
+
built = buildDesignSystem(input, { userId, agentId: requestInfo.agentId });
|
|
82
|
+
} catch (err) {
|
|
83
|
+
if (err instanceof DesignSystemError) return toolErr(err.message);
|
|
84
|
+
throw err;
|
|
85
|
+
}
|
|
86
|
+
if (!dryRun) await saveDesignSystem(built.record);
|
|
87
|
+
const { record, ignored } = built;
|
|
88
|
+
return toolOk(
|
|
89
|
+
`${dryRun ? "Validated" : "Saved"} ${record.status} design system (basePreset=${record.basePreset}, mode=${record.mode}).` +
|
|
90
|
+
(ignored.length > 0 ? ` Ignored tokens: ${ignored.join(", ")}.` : ""),
|
|
91
|
+
{
|
|
92
|
+
data: {
|
|
93
|
+
status: record.status,
|
|
94
|
+
designSystem: record,
|
|
95
|
+
saved: !dryRun,
|
|
96
|
+
...(ignored.length > 0 ? { ignoredTokens: ignored } : {}),
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
);
|
|
100
|
+
},
|
|
101
|
+
);
|
|
102
|
+
};
|
|
@@ -77,6 +77,7 @@ export const looseAgentTaskOutputSchema = z.looseObject({
|
|
|
77
77
|
lastUpdatedAt: z.string().optional(),
|
|
78
78
|
finishedAt: z.string().optional(),
|
|
79
79
|
notifiedAt: z.string().optional(),
|
|
80
|
+
statusKind: z.string().optional(),
|
|
80
81
|
failureReason: z.string().optional(),
|
|
81
82
|
output: z.string().optional(),
|
|
82
83
|
progress: z.string().optional(),
|
|
@@ -468,10 +469,13 @@ export async function getTaskDetailsHandler(
|
|
|
468
469
|
? ` Fitted to the size budget; include ${JSON.stringify(reducedParts)} for the rest.`
|
|
469
470
|
: "";
|
|
470
471
|
|
|
471
|
-
return toolOk(
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
472
|
+
return toolOk(
|
|
473
|
+
`Task "${taskId}" (${task.status}${task.statusKind ? `, ${task.statusKind}` : ""}) details retrieved.${fitNote}`,
|
|
474
|
+
{
|
|
475
|
+
details: JSON.stringify(data),
|
|
476
|
+
data,
|
|
477
|
+
},
|
|
478
|
+
);
|
|
475
479
|
}
|
|
476
480
|
|
|
477
481
|
export const registerGetTaskDetailsTool = (server: McpServer) => {
|
package/src/tools/get-tasks.ts
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
toolOk,
|
|
10
10
|
} from "@/tools/utils";
|
|
11
11
|
import type { AgentTask, AgentTaskSummary } from "@/types";
|
|
12
|
-
import { AgentTaskStatusSchema, AssetKeySchema } from "@/types";
|
|
12
|
+
import { AgentTaskStatusSchema, AssetKeySchema, TaskStatusKindSchema } from "@/types";
|
|
13
13
|
|
|
14
14
|
const TaskSummarySchema = z.looseObject({
|
|
15
15
|
id: z.string().optional(),
|
|
@@ -20,6 +20,8 @@ const TaskSummarySchema = z.looseObject({
|
|
|
20
20
|
task: z.string().optional(),
|
|
21
21
|
taskPreview: z.string().optional(),
|
|
22
22
|
status: AgentTaskStatusSchema.optional(),
|
|
23
|
+
// Plain string, not the enum: a kind added later must not fail validation.
|
|
24
|
+
statusKind: z.string().optional(),
|
|
23
25
|
taskType: z.string().optional(),
|
|
24
26
|
tags: z.array(z.string()).optional(),
|
|
25
27
|
priority: z.number().optional(),
|
|
@@ -35,6 +37,10 @@ export const getTasksInputSchema = z.object({
|
|
|
35
37
|
status: AgentTaskStatusSchema.optional().describe(
|
|
36
38
|
"Filter by task status (unassigned, offered, pending, in_progress, completed, failed).",
|
|
37
39
|
),
|
|
40
|
+
statusKind: TaskStatusKindSchema.optional().describe(
|
|
41
|
+
// Static text: scripts/generate-mcp-docs.ts resolves only literal interpolations.
|
|
42
|
+
"Filter by why the task ended. Pair with status, e.g. status 'failed' + statusKind 'error' (crash, rate limit, exit code) vs 'agent' (the agent chose to fail).",
|
|
43
|
+
),
|
|
38
44
|
mineOnly: z.boolean().optional().describe("Only return tasks assigned to you."),
|
|
39
45
|
unassigned: z.boolean().optional().describe("Only return unassigned tasks in the pool."),
|
|
40
46
|
offeredToMe: z
|
|
@@ -108,6 +114,7 @@ function renderTaskSummaries(
|
|
|
108
114
|
task?: string;
|
|
109
115
|
taskPreview?: string;
|
|
110
116
|
status?: string;
|
|
117
|
+
statusKind?: string;
|
|
111
118
|
priority?: number;
|
|
112
119
|
}>,
|
|
113
120
|
): string {
|
|
@@ -118,7 +125,7 @@ function renderTaskSummaries(
|
|
|
118
125
|
const rows = tasks.map((task) => {
|
|
119
126
|
const cells = [
|
|
120
127
|
task.id,
|
|
121
|
-
task.status,
|
|
128
|
+
task.statusKind ? `${task.status} (${task.statusKind})` : task.status,
|
|
122
129
|
task.priority,
|
|
123
130
|
task.agentId,
|
|
124
131
|
task.taskPreview ?? task.task,
|
|
@@ -132,6 +139,7 @@ export async function getTasksHandler(
|
|
|
132
139
|
ctx: ToolCtx,
|
|
133
140
|
{
|
|
134
141
|
status,
|
|
142
|
+
statusKind,
|
|
135
143
|
mineOnly,
|
|
136
144
|
unassigned,
|
|
137
145
|
offeredToMe,
|
|
@@ -154,6 +162,7 @@ export async function getTasksHandler(
|
|
|
154
162
|
// agent-specific shortcuts like mineOnly/offeredToMe.
|
|
155
163
|
const taskFilters = {
|
|
156
164
|
status,
|
|
165
|
+
statusKind,
|
|
157
166
|
agentId: ctx.kind === "owner" && mineOnly ? (agentId ?? undefined) : undefined,
|
|
158
167
|
unassigned: ctx.kind === "owner" ? unassigned : undefined,
|
|
159
168
|
offeredTo: ctx.kind === "owner" && offeredToMe ? (agentId ?? undefined) : undefined,
|
|
@@ -182,6 +191,7 @@ export async function getTasksHandler(
|
|
|
182
191
|
agentId: t.agentId,
|
|
183
192
|
...(includeFull ? { task: t.task } : { taskPreview: t.task }),
|
|
184
193
|
status: t.status,
|
|
194
|
+
statusKind: t.statusKind,
|
|
185
195
|
taskType: t.taskType,
|
|
186
196
|
tags: t.tags,
|
|
187
197
|
priority: t.priority,
|
|
@@ -196,6 +206,7 @@ export async function getTasksHandler(
|
|
|
196
206
|
// Build filter description for message
|
|
197
207
|
const filters: string[] = [];
|
|
198
208
|
if (status) filters.push(`status='${status}'`);
|
|
209
|
+
if (statusKind) filters.push(`statusKind='${statusKind}'`);
|
|
199
210
|
if (ctx.kind === "owner" && mineOnly) filters.push("mine only");
|
|
200
211
|
if (ctx.kind === "owner" && unassigned) filters.push("unassigned");
|
|
201
212
|
if (ctx.kind === "owner" && offeredToMe) filters.push("offered to me");
|
package/src/tools/manage-user.ts
CHANGED
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
} from "@/be/users";
|
|
20
20
|
import { can } from "@/rbac";
|
|
21
21
|
import { createToolRegistrar, swarmToolOutputSchema, toolErr, toolOk } from "@/tools/utils";
|
|
22
|
+
import { UserAvatarSchema } from "@/types";
|
|
22
23
|
|
|
23
24
|
// Loose mirror of UserSchema for tool output: every field optional, no
|
|
24
25
|
// datetime format pins.
|
|
@@ -34,6 +35,7 @@ const userOutputShape = z.looseObject({
|
|
|
34
35
|
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
35
36
|
dailyBudgetUsd: z.number().nullable().optional(),
|
|
36
37
|
status: z.enum(["invited", "active", "suspended"]).optional(),
|
|
38
|
+
avatar: z.looseObject({}).nullable().optional(),
|
|
37
39
|
createdAt: z.string().optional(),
|
|
38
40
|
lastUpdatedAt: z.string().optional(),
|
|
39
41
|
});
|
|
@@ -84,6 +86,11 @@ const InputSchema = z.object({
|
|
|
84
86
|
.nullable()
|
|
85
87
|
.optional()
|
|
86
88
|
.describe("Free-form JSON metadata (null clears the field)"),
|
|
89
|
+
avatar: UserAvatarSchema.nullable()
|
|
90
|
+
.optional()
|
|
91
|
+
.describe(
|
|
92
|
+
"Custom avatar, one of: { type: 'lucide', icon: '<kebab-case-lucide-name>', color?: '#RRGGBB' }; { type: 'url', url: 'https://…' } (https image, no credentials); { type: 'agent-fs', path: '/users/<id>/avatar.png', orgId?, driveId? } (an image in agent-fs; pass both IDs or neither for the swarm drive). Pass null to reset to initials.",
|
|
93
|
+
),
|
|
87
94
|
comms: z
|
|
88
95
|
.object({
|
|
89
96
|
tone: z.string().nullable().optional(),
|
|
@@ -206,6 +213,7 @@ export const registerManageUserTool = (server: McpServer) => {
|
|
|
206
213
|
timezone: input.timezone,
|
|
207
214
|
dailyBudgetUsd: input.dailyBudgetUsd ?? undefined,
|
|
208
215
|
status: input.status,
|
|
216
|
+
avatar: input.avatar,
|
|
209
217
|
metadata,
|
|
210
218
|
});
|
|
211
219
|
for (const ident of input.identities ?? []) {
|
|
@@ -268,6 +276,7 @@ export const registerManageUserTool = (server: McpServer) => {
|
|
|
268
276
|
timezone: input.timezone,
|
|
269
277
|
dailyBudgetUsd: input.dailyBudgetUsd,
|
|
270
278
|
status: input.status,
|
|
279
|
+
avatar: input.avatar,
|
|
271
280
|
metadata,
|
|
272
281
|
});
|
|
273
282
|
if (!updated) return null;
|
|
@@ -8,7 +8,7 @@ export const registerMcpServerGetTool = (server: McpServer) => {
|
|
|
8
8
|
"mcp-server-get",
|
|
9
9
|
{
|
|
10
10
|
title: "Get MCP Server",
|
|
11
|
-
annotations: {
|
|
11
|
+
annotations: { readOnlyHint: true },
|
|
12
12
|
description:
|
|
13
13
|
"Get MCP server details by ID or name. Name resolution uses scope cascade: agent > swarm > global.",
|
|
14
14
|
inputSchema: z.object({
|
|
@@ -25,7 +25,7 @@ export const registerMcpServerListTool = (server: McpServer) => {
|
|
|
25
25
|
"mcp-server-list",
|
|
26
26
|
{
|
|
27
27
|
title: "List MCP Servers",
|
|
28
|
-
annotations: {
|
|
28
|
+
annotations: { readOnlyHint: true },
|
|
29
29
|
description:
|
|
30
30
|
"List MCP servers with optional filters. Use installedOnly to see servers installed for the calling agent.",
|
|
31
31
|
inputSchema: z.object({
|
|
@@ -39,7 +39,7 @@ export const registerRegisterChatChannelTool = (server: McpServer) => {
|
|
|
39
39
|
title: "Route a chat channel to an agent or workflow",
|
|
40
40
|
annotations: { idempotentHint: true },
|
|
41
41
|
description:
|
|
42
|
-
"Lead-only. Route every swarm-addressed message from one Chat SDK channel (a Telegram group, Slack channel, Discord channel or Teams chat) to a fixed agent or workflow instead of the lead. Give exactly one of agentId or workflowId. A swarm#<agentId> token in a message still wins over the mapping. Remove it with unregister-chat-channel.",
|
|
42
|
+
"Lead-only. Route every swarm-addressed message from one Chat SDK channel (a Telegram group, Slack channel, Discord channel or Teams chat) to a fixed agent or workflow instead of the lead. Give exactly one of agentId or workflowId. For Telegram, defaultThreadId sets the topic used by channel-only chat-post calls. Re-registering replaces the mapping; omit defaultThreadId to clear it. A swarm#<agentId> token in a message still wins over the mapping. Remove it with unregister-chat-channel.",
|
|
43
43
|
inputSchema: z.object({
|
|
44
44
|
adapter: z.enum(CHAT_SDK_ADAPTER_NAMES).describe("Chat SDK adapter name."),
|
|
45
45
|
channelId: z
|
|
@@ -52,6 +52,13 @@ export const registerRegisterChatChannelTool = (server: McpServer) => {
|
|
|
52
52
|
.optional()
|
|
53
53
|
.describe("Workflow whose webhook trigger receives the channel's messages."),
|
|
54
54
|
name: z.string().max(200).optional().describe("Display name for the mapping."),
|
|
55
|
+
defaultThreadId: z
|
|
56
|
+
.string()
|
|
57
|
+
.min(1)
|
|
58
|
+
.optional()
|
|
59
|
+
.describe(
|
|
60
|
+
"Telegram topic used when chat-post gives only channelId, such as telegram:-100123:42. Must belong to this channel. Explicit threadId and chat-reply ignore this default.",
|
|
61
|
+
),
|
|
55
62
|
}),
|
|
56
63
|
outputSchema: swarmToolOutputSchema({
|
|
57
64
|
yourAgentId: z.string().optional(),
|
|
@@ -60,13 +67,14 @@ export const registerRegisterChatChannelTool = (server: McpServer) => {
|
|
|
60
67
|
.looseObject({
|
|
61
68
|
agentId: z.string().optional(),
|
|
62
69
|
workflowId: z.string().optional(),
|
|
70
|
+
defaultThreadId: z.string().optional(),
|
|
63
71
|
name: z.string().optional(),
|
|
64
72
|
createdAt: z.string().optional(),
|
|
65
73
|
})
|
|
66
74
|
.optional(),
|
|
67
75
|
}),
|
|
68
76
|
},
|
|
69
|
-
async ({ adapter, channelId, agentId, workflowId, name }, requestInfo) => {
|
|
77
|
+
async ({ adapter, channelId, agentId, workflowId, name, defaultThreadId }, requestInfo) => {
|
|
70
78
|
const data = { yourAgentId: requestInfo.agentId };
|
|
71
79
|
try {
|
|
72
80
|
if (!(await canManageChatChannels(requestInfo))) {
|
|
@@ -87,6 +95,7 @@ export const registerRegisterChatChannelTool = (server: McpServer) => {
|
|
|
87
95
|
...(agentId ? { agentId } : {}),
|
|
88
96
|
...(workflowId ? { workflowId } : {}),
|
|
89
97
|
...(name ? { name } : {}),
|
|
98
|
+
...(defaultThreadId ? { defaultThreadId } : {}),
|
|
90
99
|
createdAt: new Date().toISOString(),
|
|
91
100
|
};
|
|
92
101
|
const key = await putChatChannelMapping(adapter, channelId, mapping);
|
|
@@ -8,7 +8,7 @@ export const registerSkillGetFileTool = (server: McpServer) => {
|
|
|
8
8
|
"skill-get-file",
|
|
9
9
|
{
|
|
10
10
|
title: "Get Skill File",
|
|
11
|
-
annotations: {
|
|
11
|
+
annotations: { readOnlyHint: true },
|
|
12
12
|
description:
|
|
13
13
|
"Fetch a bundled reference file from a complex skill by skillId and relative path. Use this when the file is not available on disk.",
|
|
14
14
|
inputSchema: z.object({
|
|
@@ -9,7 +9,7 @@ export const registerSkillGetTool = (server: McpServer) => {
|
|
|
9
9
|
"skill-get",
|
|
10
10
|
{
|
|
11
11
|
title: "Get Skill",
|
|
12
|
-
annotations: {
|
|
12
|
+
annotations: { readOnlyHint: true },
|
|
13
13
|
description:
|
|
14
14
|
"Get full skill content by ID or name. Name resolution checks agent scope first, then swarm, then global. In swarm scope the ownerless skill wins, then your own, then the only agent-owned one; when several other agents own that name, it errors with their IDs: pass skillId instead.",
|
|
15
15
|
inputSchema: z.object({
|
|
@@ -21,7 +21,7 @@ export const registerSkillListTool = (server: McpServer) => {
|
|
|
21
21
|
"skill-list",
|
|
22
22
|
{
|
|
23
23
|
title: "List Skills",
|
|
24
|
-
annotations: {
|
|
24
|
+
annotations: { readOnlyHint: true },
|
|
25
25
|
description: "List available skills with optional filters.",
|
|
26
26
|
inputSchema: z.object({
|
|
27
27
|
type: z.enum(["remote", "personal"]).optional().describe("Filter by type"),
|
|
@@ -21,7 +21,7 @@ export const registerSkillSearchTool = (server: McpServer) => {
|
|
|
21
21
|
"skill-search",
|
|
22
22
|
{
|
|
23
23
|
title: "Search Skills",
|
|
24
|
-
annotations: {
|
|
24
|
+
annotations: { readOnlyHint: true },
|
|
25
25
|
description: "Search skills by keyword (name and description).",
|
|
26
26
|
inputSchema: z.object({
|
|
27
27
|
query: z.string().min(1).describe("Search query"),
|
|
@@ -671,7 +671,7 @@ export const registerStoreProgressTool = (server: McpServer) => {
|
|
|
671
671
|
|
|
672
672
|
// Handle status change
|
|
673
673
|
if (status === "completed") {
|
|
674
|
-
const result = await completeTask(taskId, output);
|
|
674
|
+
const result = await completeTask(taskId, output, { statusKind: "agent" });
|
|
675
675
|
if (result && uiSpecToStore) await upsertTaskUiSpec(taskId, uiSpecToStore);
|
|
676
676
|
if (result) {
|
|
677
677
|
updatedTask = result;
|
|
@@ -704,7 +704,9 @@ export const registerStoreProgressTool = (server: McpServer) => {
|
|
|
704
704
|
}
|
|
705
705
|
}
|
|
706
706
|
} else if (status === "failed") {
|
|
707
|
-
const result = await failTask(taskId, failureReason ?? "Unknown failure"
|
|
707
|
+
const result = await failTask(taskId, failureReason ?? "Unknown failure", {
|
|
708
|
+
statusKind: "agent",
|
|
709
|
+
});
|
|
708
710
|
if (result) {
|
|
709
711
|
updatedTask = result;
|
|
710
712
|
|
|
@@ -735,7 +737,7 @@ export const registerStoreProgressTool = (server: McpServer) => {
|
|
|
735
737
|
}
|
|
736
738
|
}
|
|
737
739
|
} else if (status === "skipped") {
|
|
738
|
-
const result = await skipTask(taskId, skipReason
|
|
740
|
+
const result = await skipTask(taskId, skipReason!, { statusKind: "agent" });
|
|
739
741
|
if (result) {
|
|
740
742
|
updatedTask = result;
|
|
741
743
|
if (existingTask.agentId) {
|
package/src/tools/utils.ts
CHANGED
|
@@ -18,7 +18,7 @@ import type {
|
|
|
18
18
|
ToolAnnotations,
|
|
19
19
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
20
20
|
import * as z from "zod";
|
|
21
|
-
import { upsertKv } from "../be/db";
|
|
21
|
+
import { getDbClient, upsertKv } from "../be/db";
|
|
22
22
|
import { bindLoopPath } from "../be/event-loop-lag";
|
|
23
23
|
import { MCP_OVERFLOW_NAMESPACE, mcpOverflowNamespace } from "../kv-overflow";
|
|
24
24
|
import { joinKvPath, type KvShapeEntry, splitKvPath, summarizeKvShape } from "../kv-view";
|
|
@@ -26,7 +26,12 @@ import { withSpan } from "../otel";
|
|
|
26
26
|
import { COLOR_LITERAL_THRESHOLD } from "../pages/color-literals";
|
|
27
27
|
import type { PermissionVerb } from "../rbac/permissions";
|
|
28
28
|
import { SCRIPT_LONG_TIMEOUT_HINT_MS } from "../scripts-runtime/executors/types";
|
|
29
|
-
import {
|
|
29
|
+
import {
|
|
30
|
+
DEFAULT_MODEL_TIER_MAP,
|
|
31
|
+
isTerminalTaskStatus,
|
|
32
|
+
type ModelTier,
|
|
33
|
+
type ProviderName,
|
|
34
|
+
} from "../types";
|
|
30
35
|
import { scrubObject, scrubSecrets } from "../utils/secret-scrubber";
|
|
31
36
|
|
|
32
37
|
type Meta = RequestHandlerExtra<ServerRequest, ServerNotification>;
|
|
@@ -400,10 +405,14 @@ const createPageNudge = (r: SwarmToolResult): string | undefined => {
|
|
|
400
405
|
usesDesignSystem?: unknown;
|
|
401
406
|
lightOnlyColors?: unknown;
|
|
402
407
|
colorLiteralCount?: unknown;
|
|
408
|
+
designSystemStatus?: unknown;
|
|
403
409
|
}
|
|
404
410
|
| undefined;
|
|
405
411
|
const count = data?.colorLiteralCount;
|
|
406
412
|
const sentences = [
|
|
413
|
+
data?.designSystemStatus === "none"
|
|
414
|
+
? "This org has no design system yet, so the page uses the default look. Ask the requester once for a site URL, a preset or a CSS block, build a preview with the design-system-seed script, and save it with design-system-set after they approve; if they say no, call design-system-set with status declined so nobody asks again."
|
|
415
|
+
: undefined,
|
|
407
416
|
data?.designVersion === 1 && data.usesDesignSystem === true
|
|
408
417
|
? "This page is on designVersion 1 (the original look), so design system classes, tokens and themes have no effect. Pass designVersion: 2."
|
|
409
418
|
: undefined,
|
|
@@ -1114,6 +1123,38 @@ async function applyPreToolCall(
|
|
|
1114
1123
|
};
|
|
1115
1124
|
}
|
|
1116
1125
|
|
|
1126
|
+
/** Tools a session may still call after its task reached a terminal status. */
|
|
1127
|
+
const TERMINAL_TASK_EXEMPT_TOOLS = new Set(["store-progress"]);
|
|
1128
|
+
|
|
1129
|
+
/**
|
|
1130
|
+
* Refuse a write from a session whose task already ended. A superseded or
|
|
1131
|
+
* cancelled task's harness can keep running until the worker kills it, and its
|
|
1132
|
+
* late `slack-reply` / `send-task` calls would act for a task the swarm
|
|
1133
|
+
* already moved past. Read-only is the registrar's `readOnlyHint: true`; a
|
|
1134
|
+
* tool without that annotation counts as a write. Scripts and extensions are
|
|
1135
|
+
* not agent sessions and skip the check.
|
|
1136
|
+
*/
|
|
1137
|
+
async function refuseWriteForTerminalTask(
|
|
1138
|
+
name: string,
|
|
1139
|
+
annotations: ToolAnnotations | undefined,
|
|
1140
|
+
requestInfo: RequestInfo,
|
|
1141
|
+
): Promise<SwarmToolResult | undefined> {
|
|
1142
|
+
if (requestInfo.callOrigin !== "mcp" || !requestInfo.sourceTaskId) return undefined;
|
|
1143
|
+
if (annotations?.readOnlyHint === true || TERMINAL_TASK_EXEMPT_TOOLS.has(name)) return undefined;
|
|
1144
|
+
const row = await getDbClient().get<{ status: string }>(
|
|
1145
|
+
"SELECT status FROM agent_tasks WHERE id = ?",
|
|
1146
|
+
[requestInfo.sourceTaskId],
|
|
1147
|
+
);
|
|
1148
|
+
if (!row || !isTerminalTaskStatus(row.status)) return undefined;
|
|
1149
|
+
return toolErr(
|
|
1150
|
+
`Task ${requestInfo.sourceTaskId} is ${row.status}, so this session can no longer call ${name}. Stop working on it.`,
|
|
1151
|
+
{
|
|
1152
|
+
details:
|
|
1153
|
+
"Only store-progress and read-only tools still work for a finished task. Any new work belongs to a new task.",
|
|
1154
|
+
},
|
|
1155
|
+
);
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1117
1158
|
function dispatchPostToolCall(
|
|
1118
1159
|
dispatcher: ExtensionDispatcher | undefined,
|
|
1119
1160
|
name: string,
|
|
@@ -1170,7 +1211,9 @@ export const createToolRegistrar = (server: McpServer) => {
|
|
|
1170
1211
|
async (span) => {
|
|
1171
1212
|
const pre = await applyPreToolCall(name, {}, requestInfo);
|
|
1172
1213
|
let durationMs = 0;
|
|
1173
|
-
let outcome =
|
|
1214
|
+
let outcome =
|
|
1215
|
+
pre.blocked ??
|
|
1216
|
+
(await refuseWriteForTerminalTask(name, config.annotations, requestInfo));
|
|
1174
1217
|
if (!outcome) {
|
|
1175
1218
|
const startedAt = Date.now();
|
|
1176
1219
|
try {
|
|
@@ -1210,7 +1253,9 @@ export const createToolRegistrar = (server: McpServer) => {
|
|
|
1210
1253
|
const pre = await applyPreToolCall(name, args, requestInfo, config.inputSchema);
|
|
1211
1254
|
const effectiveArgs = pre.args as InferInput<InputArgs>;
|
|
1212
1255
|
let durationMs = 0;
|
|
1213
|
-
let outcome =
|
|
1256
|
+
let outcome =
|
|
1257
|
+
pre.blocked ??
|
|
1258
|
+
(await refuseWriteForTerminalTask(name, config.annotations, requestInfo));
|
|
1214
1259
|
if (!outcome) {
|
|
1215
1260
|
const startedAt = Date.now();
|
|
1216
1261
|
try {
|
|
@@ -43,7 +43,7 @@ export const registerGetWorkflowRunTool = (server: McpServer) => {
|
|
|
43
43
|
"get-workflow-run",
|
|
44
44
|
{
|
|
45
45
|
title: "Get Workflow Run",
|
|
46
|
-
annotations: {
|
|
46
|
+
annotations: { readOnlyHint: true },
|
|
47
47
|
description: "Get details of a workflow run by ID, including all steps and their statuses.",
|
|
48
48
|
inputSchema: z.object({
|
|
49
49
|
id: z.string().uuid().describe("Workflow run ID"),
|
|
@@ -9,7 +9,7 @@ export const registerGetWorkflowTool = (server: McpServer) => {
|
|
|
9
9
|
"get-workflow",
|
|
10
10
|
{
|
|
11
11
|
title: "Get Workflow",
|
|
12
|
-
annotations: {
|
|
12
|
+
annotations: { readOnlyHint: true },
|
|
13
13
|
description:
|
|
14
14
|
"Get a workflow by ID, including its definition, triggers, cooldown, input, and auto-generated edges for UI rendering.",
|
|
15
15
|
inputSchema: z.object({
|
|
@@ -102,7 +102,7 @@ export const registerListWorkflowRunsTool = (server: McpServer) => {
|
|
|
102
102
|
"list-workflow-runs",
|
|
103
103
|
{
|
|
104
104
|
title: "List Workflow Runs",
|
|
105
|
-
annotations: {
|
|
105
|
+
annotations: { readOnlyHint: true },
|
|
106
106
|
description:
|
|
107
107
|
"List execution runs for a workflow with offset pagination (default 20, max 100), optionally filtered by status. Returns SLIM rows WITHOUT the full `context` or trigger data — each row carries a bounded `triggerDataSummary` instead. To inspect a run's context and steps, call `get-workflow-run` by id, or pass `includeContext: true` here.",
|
|
108
108
|
inputSchema: listWorkflowRunsInputSchema,
|
|
@@ -9,7 +9,7 @@ export const registerListWorkflowsTool = (server: McpServer) => {
|
|
|
9
9
|
"list-workflows",
|
|
10
10
|
{
|
|
11
11
|
title: "List Workflows",
|
|
12
|
-
annotations: {
|
|
12
|
+
annotations: { readOnlyHint: true },
|
|
13
13
|
description:
|
|
14
14
|
"List all automation workflows, optionally filtered by enabled status. Returns SLIM rows WITHOUT the full `definition` (DAG) — each row carries a `nodeCount` instead. To inspect or patch a workflow's nodes/triggers, call `get-workflow` by id, or pass `includeFull: true` here.",
|
|
15
15
|
inputSchema: z.object({
|