@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
|
@@ -56,8 +56,12 @@ import { GITLEAKS_RULES } from "./secret-rules.generated";
|
|
|
56
56
|
* URL-decoded and URL-encoded forms.
|
|
57
57
|
* v14 = pass 1 also matches a known value URL-encoded as stored, so a value
|
|
58
58
|
* with a literal `%` is redacted in its `%25` form.
|
|
59
|
+
* v15 = gitleaks rules also end on `.`, `,`, `:`, `)`, `]`, `}`, `>`, `|`,
|
|
60
|
+
* `/`, `&`, `?` and `#`; pass 2 adds Stripe webhook, Groq, Tavily,
|
|
61
|
+
* LangSmith, CircleCI, Google `AQ.`, HubSpot, New Relic and Sentry DSN
|
|
62
|
+
* shapes; pass 4 redacts a PEM private key cut off before its END line.
|
|
59
63
|
*/
|
|
60
|
-
export const SCRUBBER_RULES_VERSION =
|
|
64
|
+
export const SCRUBBER_RULES_VERSION = 15;
|
|
61
65
|
|
|
62
66
|
/** Env-var names that are always considered secrets, even without suffix hints. */
|
|
63
67
|
const SENSITIVE_KEY_EXACT = new Set<string>([
|
|
@@ -479,6 +483,17 @@ const URL_USERINFO_RE =
|
|
|
479
483
|
const PEM_RE =
|
|
480
484
|
/(-----BEGIN [A-Z0-9 ]{0,32}PRIVATE KEY(?: BLOCK)?-----)((?:(?!-----)[\s\S]){1,16384})(-----END [A-Z0-9 ]{0,32}PRIVATE KEY(?: BLOCK)?-----)/g;
|
|
481
485
|
const PEM_MARKER = "[REDACTED:private_key]";
|
|
486
|
+
/**
|
|
487
|
+
* A PEM private key cut off before its END line (`head`, an output cap, a
|
|
488
|
+
* truncated JSON string such as a GCP service-account `private_key`). The body
|
|
489
|
+
* is base64 runs of 16+ characters split by whitespace or `\n` escapes (raw or
|
|
490
|
+
* escaped again); prose after the cut is shorter, so it survives. Runs after
|
|
491
|
+
* `PEM_RE`, so a complete block keeps its END armor, and the marker after
|
|
492
|
+
* BEGIN stops a second match. Each run needs a separator before the next, so
|
|
493
|
+
* the walk is linear.
|
|
494
|
+
*/
|
|
495
|
+
const PEM_TRUNCATED_RE =
|
|
496
|
+
/(-----BEGIN [A-Z0-9 ]{0,32}PRIVATE KEY(?: BLOCK)?-----)(?:\s|\\+[nr])*[A-Za-z0-9+/=]{16,}(?:(?:\s|\\+[nr])+[A-Za-z0-9+/=]{16,})*/g;
|
|
482
497
|
|
|
483
498
|
/**
|
|
484
499
|
* Pass 4: credentials identified by their context (a sensitive JSON/YAML
|
|
@@ -492,6 +507,7 @@ function scrubKeyContext(text: string): string {
|
|
|
492
507
|
out = out.replace(PEM_RE, (match, begin: string, body: string, end: string) =>
|
|
493
508
|
body === PEM_MARKER ? match : `${begin}${PEM_MARKER}${end}`,
|
|
494
509
|
);
|
|
510
|
+
out = out.replace(PEM_TRUNCATED_RE, (_match, begin: string) => `${begin}${PEM_MARKER}`);
|
|
495
511
|
}
|
|
496
512
|
if (/authorization|x-api-key/i.test(out)) {
|
|
497
513
|
out = out.replace(AUTH_HEADER_RE, redactHeader).replace(API_KEY_HEADER_RE, redactHeader);
|
|
@@ -715,6 +731,67 @@ const TOKEN_REGEXES: ReadonlyArray<{ name: string; lits: string[]; re: RegExp }>
|
|
|
715
731
|
"g",
|
|
716
732
|
),
|
|
717
733
|
},
|
|
734
|
+
// Shapes below follow svn-arv/redacted's engine.yml (MIT): none of them has
|
|
735
|
+
// a gitleaks rule, or its gitleaks rule needs the vendor name nearby.
|
|
736
|
+
// Stripe webhook signing secrets
|
|
737
|
+
{
|
|
738
|
+
name: "stripe_webhook_secret",
|
|
739
|
+
lits: ["whsec_"],
|
|
740
|
+
re: new RegExp(String.raw`${TB}whsec_[A-Za-z0-9]{24,}\b`, "g"),
|
|
741
|
+
},
|
|
742
|
+
// Groq API keys
|
|
743
|
+
{
|
|
744
|
+
name: "groq_key",
|
|
745
|
+
lits: ["gsk_"],
|
|
746
|
+
re: new RegExp(String.raw`${TB}gsk_[A-Za-z0-9]{40,}\b`, "g"),
|
|
747
|
+
},
|
|
748
|
+
// Tavily API keys (`tvly-` and `tvly-dev-`)
|
|
749
|
+
{
|
|
750
|
+
name: "tavily_key",
|
|
751
|
+
lits: ["tvly-"],
|
|
752
|
+
re: new RegExp(String.raw`${TB}tvly-(?:dev-)?[A-Za-z0-9]{24,}\b`, "g"),
|
|
753
|
+
},
|
|
754
|
+
// LangSmith personal tokens and service keys
|
|
755
|
+
{
|
|
756
|
+
name: "langsmith_key",
|
|
757
|
+
lits: ["lsv2_pt_", "lsv2_sk_"],
|
|
758
|
+
re: new RegExp(String.raw`${TB}lsv2_(?:pt|sk)_[A-Za-z0-9]{24,}_[A-Za-z0-9]{8,}\b`, "g"),
|
|
759
|
+
},
|
|
760
|
+
// CircleCI personal API tokens
|
|
761
|
+
{
|
|
762
|
+
name: "circleci_token",
|
|
763
|
+
lits: ["CCIPAT_"],
|
|
764
|
+
re: new RegExp(String.raw`${TB}CCIPAT_[A-Za-z0-9_]{20,}\b`, "g"),
|
|
765
|
+
},
|
|
766
|
+
// Google API keys in the newer `AQ.` form (Gemini); the dot defeats the generic rules.
|
|
767
|
+
{
|
|
768
|
+
name: "google_api_key_v2",
|
|
769
|
+
lits: ["AQ."],
|
|
770
|
+
re: new RegExp(String.raw`${TB}AQ\.[A-Za-z0-9_-]{40,}(?!\w)`, "g"),
|
|
771
|
+
},
|
|
772
|
+
// HubSpot private-app tokens: pat-<region>-<uuid>. gitleaks only matches near "hubspot".
|
|
773
|
+
{
|
|
774
|
+
name: "hubspot_key",
|
|
775
|
+
lits: ["pat-"],
|
|
776
|
+
re: new RegExp(
|
|
777
|
+
String.raw`${TB}pat-[a-z0-9]{2,3}-[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}(?!\w)`,
|
|
778
|
+
"g",
|
|
779
|
+
),
|
|
780
|
+
},
|
|
781
|
+
// New Relic user API keys. gitleaks only matches near "newrelic".
|
|
782
|
+
{
|
|
783
|
+
name: "newrelic_key",
|
|
784
|
+
lits: ["NRAK-"],
|
|
785
|
+
re: new RegExp(String.raw`${TB}NRAK-[A-Za-z0-9]{20,}\b`, "g"),
|
|
786
|
+
},
|
|
787
|
+
// Sentry DSNs: the public key and the ingest host go, the scheme and the
|
|
788
|
+
// project id stay. The key is semi-public (it ships in browser bundles), but
|
|
789
|
+
// it lets anyone post events to the project.
|
|
790
|
+
{
|
|
791
|
+
name: "sentry_dsn",
|
|
792
|
+
lits: ["sentry.io"],
|
|
793
|
+
re: /(?<=:\/\/)[a-f0-9]{32}@[a-z0-9-]{1,63}\.ingest\.(?:[a-z]{2,8}\.)?sentry\.io(?=\/\d)/g,
|
|
794
|
+
},
|
|
718
795
|
];
|
|
719
796
|
|
|
720
797
|
/**
|
|
@@ -1206,8 +1283,14 @@ function scrubWithMatcher(text: string, matcher: KnownValueMatcher): ScrubbedTex
|
|
|
1206
1283
|
// Pass 2: structural patterns (catches secrets we never saw in env, e.g.
|
|
1207
1284
|
// a token pasted into a tool_result by the operator or fetched from a
|
|
1208
1285
|
// third-party API during a task).
|
|
1286
|
+
// A rule runs only when one of its literals occurs: every match holds one,
|
|
1287
|
+
// in the regex's own case unless it is case-insensitive (the corpus test
|
|
1288
|
+
// checks both), so a skipped rule could not have matched.
|
|
1209
1289
|
const vendorSpans: VendorSpanCache = { spans: null };
|
|
1210
|
-
for (const { name, re } of TOKEN_REGEXES)
|
|
1290
|
+
for (const { name, re, lits } of TOKEN_REGEXES) {
|
|
1291
|
+
if (!re.ignoreCase && !lits.some((lit) => out.includes(lit))) continue;
|
|
1292
|
+
out = applyTokenRegex(out, name, re, vendorSpans);
|
|
1293
|
+
}
|
|
1211
1294
|
|
|
1212
1295
|
// Passes 3 and 4: values of sensitive `KEY=value` assignments (env dumps,
|
|
1213
1296
|
// .env files, shell traces), including ones too short for pass 1, and
|
|
@@ -1437,6 +1520,7 @@ export function scrubberRulesFingerprint(): string {
|
|
|
1437
1520
|
CURL_USER_RE,
|
|
1438
1521
|
URL_USERINFO_RE,
|
|
1439
1522
|
PEM_RE,
|
|
1523
|
+
PEM_TRUNCATED_RE,
|
|
1440
1524
|
].map((re) => re.source),
|
|
1441
1525
|
]),
|
|
1442
1526
|
);
|
|
@@ -1491,7 +1575,12 @@ export function findSecretsIn(text: string): SecretFindings {
|
|
|
1491
1575
|
return { knownValues: [...knownValues].sort(), gitleaksRules: [...gitleaksRules].sort() };
|
|
1492
1576
|
}
|
|
1493
1577
|
|
|
1494
|
-
export function scrubObject<T>(
|
|
1578
|
+
export function scrubObject<T>(
|
|
1579
|
+
value: T,
|
|
1580
|
+
seen = new WeakSet<object>(),
|
|
1581
|
+
// Rows of one result repeat the same keys: scrub each distinct key once per call.
|
|
1582
|
+
keyCache = new Map<string, string>(),
|
|
1583
|
+
): T {
|
|
1495
1584
|
if (value === null || value === undefined) return value;
|
|
1496
1585
|
if (typeof value === "string") return scrubSecrets(value) as T;
|
|
1497
1586
|
if (typeof value !== "object") return value;
|
|
@@ -1502,12 +1591,29 @@ export function scrubObject<T>(value: T, seen = new WeakSet<object>()): T {
|
|
|
1502
1591
|
seen.add(value);
|
|
1503
1592
|
|
|
1504
1593
|
if (Array.isArray(value)) {
|
|
1505
|
-
return value.map((item) => scrubObject(item, seen)) as T;
|
|
1594
|
+
return value.map((item) => scrubObject(item, seen, keyCache)) as T;
|
|
1506
1595
|
}
|
|
1507
1596
|
|
|
1597
|
+
// Keys are scrubbed too: a map keyed by a token leaks it as a key. Two keys
|
|
1598
|
+
// can redact to the same marker, so a clash gets a `#<n>` suffix instead of
|
|
1599
|
+
// overwriting the earlier entry. `nextSuffix` remembers the next free `n`
|
|
1600
|
+
// per marker, so N colliding keys cost O(N) probes, not O(N^2).
|
|
1508
1601
|
const out: Record<string, unknown> = {};
|
|
1602
|
+
const nextSuffix = new Map<string, number>();
|
|
1509
1603
|
for (const [key, child] of Object.entries(value as Record<string, unknown>)) {
|
|
1510
|
-
|
|
1604
|
+
let scrubbed = keyCache.get(key);
|
|
1605
|
+
if (scrubbed === undefined) {
|
|
1606
|
+
scrubbed = scrubSecrets(key);
|
|
1607
|
+
keyCache.set(key, scrubbed);
|
|
1608
|
+
}
|
|
1609
|
+
let outKey = scrubbed;
|
|
1610
|
+
if (Object.hasOwn(out, outKey)) {
|
|
1611
|
+
let n = nextSuffix.get(scrubbed) ?? 2;
|
|
1612
|
+
for (outKey = `${scrubbed}#${n}`; Object.hasOwn(out, outKey); outKey = `${scrubbed}#${n}`)
|
|
1613
|
+
n++;
|
|
1614
|
+
nextSuffix.set(scrubbed, n + 1);
|
|
1615
|
+
}
|
|
1616
|
+
out[outKey] = scrubObject(child, seen, keyCache);
|
|
1511
1617
|
}
|
|
1512
1618
|
return out as T;
|
|
1513
1619
|
}
|
package/src/vcs/azure-devops.ts
CHANGED
|
@@ -3,8 +3,29 @@
|
|
|
3
3
|
* the worker (no DB imports).
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* True when the URL's host is Azure Repos: `dev.azure.com`,
|
|
8
|
+
* `ssh.dev.azure.com`, or a legacy `*.visualstudio.com` host. Only the host
|
|
9
|
+
* counts, so a `dev.azure.com` path segment on another host is not Azure.
|
|
10
|
+
*/
|
|
6
11
|
export function isAzureDevOpsUrl(url: string): boolean {
|
|
7
|
-
|
|
12
|
+
const trimmed = url.trim();
|
|
13
|
+
// SCP-style SSH: user@host:path
|
|
14
|
+
const scp = trimmed.match(/^[^@/\s:]+@([^:/\s]+):/);
|
|
15
|
+
if (scp) return isAzureDevOpsHost(scp[1] as string);
|
|
16
|
+
try {
|
|
17
|
+
return isAzureDevOpsHost(new URL(trimmed).hostname);
|
|
18
|
+
} catch {
|
|
19
|
+
// Scheme-less `dev.azure.com/org/project`
|
|
20
|
+
return /^(?:ssh\.)?dev\.azure\.com(\/|$)|^[\w.-]+\.visualstudio\.com(\/|$)/i.test(trimmed);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function isAzureDevOpsHost(hostname: string): boolean {
|
|
25
|
+
const host = hostname.toLowerCase();
|
|
26
|
+
return (
|
|
27
|
+
host === "dev.azure.com" || host === "ssh.dev.azure.com" || host.endsWith(".visualstudio.com")
|
|
28
|
+
);
|
|
8
29
|
}
|
|
9
30
|
|
|
10
31
|
/**
|
package/src/vcs/index.ts
CHANGED
|
@@ -29,6 +29,8 @@ export function detectVcsProvider(url: string): VcsProvider | null {
|
|
|
29
29
|
?.toLowerCase();
|
|
30
30
|
}
|
|
31
31
|
if (hostname?.startsWith("gitlab.")) return "gitlab";
|
|
32
|
-
|
|
32
|
+
// Host only: a `github.com` path segment on another host is not GitHub.
|
|
33
|
+
if (hostname === "github.com" || hostname === "www.github.com") return "github";
|
|
34
|
+
if (/^[\w.-]+\/[\w.-]+$/.test(url)) return "github";
|
|
33
35
|
return null;
|
|
34
36
|
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which approval requests a chat button can answer, and the answer a button
|
|
3
|
+
* maps to. Chat cards (Slack, Chat SDK) share this so every channel offers the
|
|
4
|
+
* same choices and stores the same response the dashboard would.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export interface ApprovalQuestionLike {
|
|
8
|
+
id?: string;
|
|
9
|
+
type?: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
multiline?: boolean;
|
|
12
|
+
options?: ReadonlyArray<{ value: string; label: string }>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface InlineApprovalQuestion {
|
|
16
|
+
id: string;
|
|
17
|
+
type: "approval" | "boolean" | "single-select" | "text";
|
|
18
|
+
label: string;
|
|
19
|
+
options: ReadonlyArray<{ value: string; label: string }>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Single-select questions with more options than this go to the dashboard. */
|
|
23
|
+
export const INLINE_MAX_OPTIONS = 5;
|
|
24
|
+
|
|
25
|
+
/** Longest one-line text answer a chat modal accepts. */
|
|
26
|
+
export const INLINE_TEXT_MAX_LENGTH = 500;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The one question a chat button can answer, or null when the request needs
|
|
30
|
+
* the dashboard: several questions, multi-select, config, multiline text, or a
|
|
31
|
+
* single-select with no options or more than `INLINE_MAX_OPTIONS`.
|
|
32
|
+
*/
|
|
33
|
+
export function inlineApprovalQuestion(
|
|
34
|
+
questions: ReadonlyArray<ApprovalQuestionLike> | null | undefined,
|
|
35
|
+
): InlineApprovalQuestion | null {
|
|
36
|
+
// shortcut: one question per inline card; several simple questions could share one Slack modal later.
|
|
37
|
+
if (!questions || questions.length !== 1) return null;
|
|
38
|
+
const [q] = questions;
|
|
39
|
+
if (!q?.id) return null;
|
|
40
|
+
const base = { id: q.id, label: q.label ?? "", options: q.options ?? [] };
|
|
41
|
+
switch (q.type) {
|
|
42
|
+
case "approval":
|
|
43
|
+
case "boolean":
|
|
44
|
+
return { ...base, type: q.type };
|
|
45
|
+
case "single-select":
|
|
46
|
+
return base.options.length > 0 && base.options.length <= INLINE_MAX_OPTIONS
|
|
47
|
+
? { ...base, type: q.type }
|
|
48
|
+
: null;
|
|
49
|
+
case "text":
|
|
50
|
+
return q.multiline ? null : { ...base, type: q.type };
|
|
51
|
+
default:
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* A button's choice: `y` / `n` for approval and boolean questions, the option
|
|
58
|
+
* index for single-select, `t` for text. Short on purpose: Telegram callback
|
|
59
|
+
* data is capped at 64 bytes.
|
|
60
|
+
*/
|
|
61
|
+
export interface InlineChoice {
|
|
62
|
+
/** Label and style of the button. */
|
|
63
|
+
label: string;
|
|
64
|
+
choice: string;
|
|
65
|
+
style?: "primary" | "danger";
|
|
66
|
+
/** The button collects text first (Deny reason, text answer) where the channel has modals. */
|
|
67
|
+
needsText?: "optional" | "required";
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function inlineApprovalChoices(question: InlineApprovalQuestion): InlineChoice[] {
|
|
71
|
+
switch (question.type) {
|
|
72
|
+
case "approval":
|
|
73
|
+
return [
|
|
74
|
+
{ label: "Approve", choice: "y", style: "primary" },
|
|
75
|
+
{ label: "Deny", choice: "n", style: "danger", needsText: "optional" },
|
|
76
|
+
];
|
|
77
|
+
case "boolean":
|
|
78
|
+
return [
|
|
79
|
+
{ label: "Yes", choice: "y" },
|
|
80
|
+
{ label: "No", choice: "n" },
|
|
81
|
+
];
|
|
82
|
+
case "single-select":
|
|
83
|
+
return question.options.map((option, index) => ({
|
|
84
|
+
label: option.label || option.value,
|
|
85
|
+
choice: String(index),
|
|
86
|
+
}));
|
|
87
|
+
case "text":
|
|
88
|
+
return [{ label: "Answer", choice: "t", needsText: "required" }];
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* The respond-route `responses` for a choice, or null for a choice this
|
|
94
|
+
* question does not offer (a forged or stale button).
|
|
95
|
+
*/
|
|
96
|
+
export function inlineApprovalResponses(
|
|
97
|
+
question: InlineApprovalQuestion,
|
|
98
|
+
choice: string,
|
|
99
|
+
text?: string,
|
|
100
|
+
): Record<string, unknown> | null {
|
|
101
|
+
const trimmed = (text ?? "").trim().slice(0, INLINE_TEXT_MAX_LENGTH);
|
|
102
|
+
let answer: unknown;
|
|
103
|
+
switch (question.type) {
|
|
104
|
+
case "approval":
|
|
105
|
+
if (choice === "y") answer = { approved: true };
|
|
106
|
+
else if (choice === "n")
|
|
107
|
+
answer = trimmed ? { approved: false, comment: trimmed } : { approved: false };
|
|
108
|
+
break;
|
|
109
|
+
case "boolean":
|
|
110
|
+
if (choice === "y" || choice === "n") answer = choice === "y";
|
|
111
|
+
break;
|
|
112
|
+
case "single-select": {
|
|
113
|
+
const option = /^\d+$/.test(choice) ? question.options[Number(choice)] : undefined;
|
|
114
|
+
answer = option?.value;
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
case "text":
|
|
118
|
+
if (choice === "t" && trimmed) answer = trimmed;
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
return answer === undefined ? null : { [question.id]: answer };
|
|
122
|
+
}
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
import { approvalCancellationNotificationKey } from "../be/db/approvals";
|
|
16
16
|
import { resolveTemplate } from "../prompts/resolver";
|
|
17
17
|
import { getSlackApp } from "../slack/app";
|
|
18
|
+
import { buildApprovalAnswerButtons } from "../slack/approval-buttons";
|
|
18
19
|
import { isSlackUserId, resolveSlackConversationId } from "../slack/dm";
|
|
19
20
|
import {
|
|
20
21
|
externalChannelToolError,
|
|
@@ -24,6 +25,7 @@ import {
|
|
|
24
25
|
import { TERMINAL_TASK_STATUSES } from "../types";
|
|
25
26
|
import { getAppUrl } from "../utils/constants";
|
|
26
27
|
import { scrubSecrets } from "../utils/secret-scrubber";
|
|
28
|
+
import type { ApprovalQuestionLike } from "./approval-inline";
|
|
27
29
|
|
|
28
30
|
/** Slack Block Kit caps a section block's text at 3000 characters. */
|
|
29
31
|
const SLACK_SECTION_TEXT_LIMIT = 3000;
|
|
@@ -80,7 +82,7 @@ export interface ApprovalNotificationChannel {
|
|
|
80
82
|
export interface ApprovalNotificationsInput {
|
|
81
83
|
requestId: string;
|
|
82
84
|
title: string;
|
|
83
|
-
questions: ReadonlyArray<
|
|
85
|
+
questions: ReadonlyArray<ApprovalQuestionLike>;
|
|
84
86
|
timeoutSeconds?: number;
|
|
85
87
|
notifications: ReadonlyArray<ApprovalNotificationChannel>;
|
|
86
88
|
}
|
|
@@ -142,6 +144,7 @@ export async function dispatchApprovalNotifications(
|
|
|
142
144
|
}
|
|
143
145
|
|
|
144
146
|
const questionsText = buildSlackQuestionsSummary(questions);
|
|
147
|
+
const answerButtons = buildApprovalAnswerButtons(requestId, questions);
|
|
145
148
|
|
|
146
149
|
// The deadline is a caption under the button, not part of the ask.
|
|
147
150
|
const timeoutCaption =
|
|
@@ -177,11 +180,13 @@ export async function dispatchApprovalNotifications(
|
|
|
177
180
|
{
|
|
178
181
|
type: "actions",
|
|
179
182
|
elements: [
|
|
183
|
+
...answerButtons,
|
|
180
184
|
{
|
|
181
185
|
type: "button",
|
|
182
186
|
text: { type: "plain_text", text: "Review & Respond" },
|
|
183
187
|
url: approvalUrl,
|
|
184
|
-
|
|
188
|
+
// With inline buttons, Approve is the primary action.
|
|
189
|
+
...(answerButtons.length === 0 ? { style: "primary" } : {}),
|
|
185
190
|
},
|
|
186
191
|
],
|
|
187
192
|
},
|
package/src/workflows/engine.ts
CHANGED
|
@@ -910,11 +910,12 @@ async function executeStep(
|
|
|
910
910
|
if (current && (current.status !== "running" || executingSteps.has(current.id))) {
|
|
911
911
|
return { current };
|
|
912
912
|
}
|
|
913
|
-
// An orphaned `sub-workflow` row is this same invocation:
|
|
914
|
-
// current predecessor completions, so it is not a new loop
|
|
915
|
-
// Re-enter it under its step id, key and retry count, so the
|
|
916
|
-
// reconnects to the child it already started
|
|
917
|
-
|
|
913
|
+
// An orphaned `sub-workflow` or `agent-task` row is this same invocation:
|
|
914
|
+
// it covers the current predecessor completions, so it is not a new loop
|
|
915
|
+
// iteration. Re-enter it under its step id, key and retry count, so the
|
|
916
|
+
// executor reconnects to the child run or task it already started (a
|
|
917
|
+
// crash between the insert and the step parking) instead of a second one.
|
|
918
|
+
if (current && (node.type === "sub-workflow" || node.type === "agent-task")) {
|
|
918
919
|
claimedStepId = current.id;
|
|
919
920
|
executingSteps.add(current.id);
|
|
920
921
|
return {
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
RoutingReasonSchema,
|
|
13
13
|
splitLegacyModelAlias,
|
|
14
14
|
} from "../../types";
|
|
15
|
+
import { getNodeEnv } from "../../utils/node-env";
|
|
15
16
|
import type { ExecutorResult } from "./base";
|
|
16
17
|
import { BaseExecutor } from "./base";
|
|
17
18
|
|
|
@@ -166,6 +167,7 @@ export class AgentTaskExecutor extends BaseExecutor<
|
|
|
166
167
|
if (modelProfileRefError(error) !== "missing") throw error;
|
|
167
168
|
return { status: "failed", error: `Unknown model profile "${config.profile}".` };
|
|
168
169
|
}
|
|
170
|
+
crashAfterTaskInsertForTest(preCreate.description);
|
|
169
171
|
|
|
170
172
|
// 4. Return async result — engine will pause the workflow
|
|
171
173
|
return {
|
|
@@ -176,3 +178,15 @@ export class AgentTaskExecutor extends BaseExecutor<
|
|
|
176
178
|
} as ExecutorResult<AgentTaskOutput>;
|
|
177
179
|
}
|
|
178
180
|
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Test-only crash point: kill the API between the task insert and the step
|
|
184
|
+
* parking, the window a real crash can hit. Fires only under NODE_ENV=test
|
|
185
|
+
* for a task whose text contains E2E_CRASH_AFTER_WORKFLOW_TASK_INSERT. The
|
|
186
|
+
* e2e scenario workflow-agent-task-crash-window sets it for one restart.
|
|
187
|
+
*/
|
|
188
|
+
function crashAfterTaskInsertForTest(description: string): void {
|
|
189
|
+
if (getNodeEnv() !== "test") return;
|
|
190
|
+
const marker = process.env.E2E_CRASH_AFTER_WORKFLOW_TASK_INSERT;
|
|
191
|
+
if (marker && description.includes(marker)) process.kill(process.pid, "SIGKILL");
|
|
192
|
+
}
|
|
@@ -73,6 +73,11 @@ interface SystemOneServiceBase {
|
|
|
73
73
|
readonly defaultModel?: string;
|
|
74
74
|
/** When set, the only model ids the node may use (checked at save and at run). */
|
|
75
75
|
readonly allowedModels?: readonly string[];
|
|
76
|
+
/**
|
|
77
|
+
* Other model ids verified on this host, listed in the dashboard and docs. Not
|
|
78
|
+
* enforced: a host without `allowedModels` sends any id as written.
|
|
79
|
+
*/
|
|
80
|
+
readonly knownModels?: readonly string[];
|
|
76
81
|
}
|
|
77
82
|
|
|
78
83
|
export interface SystemOneDecideService extends SystemOneServiceBase {
|
|
@@ -151,6 +156,22 @@ async function readFirstGlobalConfig(
|
|
|
151
156
|
return undefined;
|
|
152
157
|
}
|
|
153
158
|
|
|
159
|
+
/** OpenRouter decision models besides Jev (`GET /api/v1/models?output_modalities=decisions`). */
|
|
160
|
+
const OPENROUTER_DECISION_MODELS = [
|
|
161
|
+
"~perplexity/pplx-decider-latest",
|
|
162
|
+
"~perplexity/pplx-decider-flash-latest",
|
|
163
|
+
"perplexity/pplx-decider-v1.3:free",
|
|
164
|
+
"perplexity/pplx-decider-flash-v1.3:free",
|
|
165
|
+
"liquid/d1.1",
|
|
166
|
+
"liquid/d1-ultra",
|
|
167
|
+
"google/gemini-decision-1",
|
|
168
|
+
"morph/reflex",
|
|
169
|
+
"baseten/joey-1",
|
|
170
|
+
"baseten/elephant-1",
|
|
171
|
+
"baseten/mammoth-1",
|
|
172
|
+
"respan/span-02",
|
|
173
|
+
] as const;
|
|
174
|
+
|
|
154
175
|
/** Every Workers AI model is reached at the same account-scoped route; only the model differs. */
|
|
155
176
|
const CLOUDFLARE_ENDPOINT: SystemOneBuiltEndpoint = {
|
|
156
177
|
configKey: CLOUDFLARE_ACCOUNT_KEY,
|
|
@@ -216,6 +237,8 @@ export const SYSTEM_ONE_HOSTS = {
|
|
|
216
237
|
decide: {
|
|
217
238
|
endpoint: "https://openrouter.ai/api/alpha/decisions",
|
|
218
239
|
defaultModel: "~typesafe/jev-latest",
|
|
240
|
+
// Decision models of other makers on the same route and wire, live-probed 2026-11-16.
|
|
241
|
+
knownModels: OPENROUTER_DECISION_MODELS,
|
|
219
242
|
confidenceField: "confidence",
|
|
220
243
|
},
|
|
221
244
|
},
|
package/src/workflows/resume.ts
CHANGED
|
@@ -764,7 +764,10 @@ export async function cancelWorkflowRunRows(
|
|
|
764
764
|
const withDependents =
|
|
765
765
|
openTaskIds.length > 0 ? await getTaskIdsWithDependents() : new Set<string>();
|
|
766
766
|
for (const taskId of openTaskIds) {
|
|
767
|
-
await cancelTask(taskId, cancelReason, {
|
|
767
|
+
await cancelTask(taskId, cancelReason, {
|
|
768
|
+
cascadeDependents: withDependents.has(taskId),
|
|
769
|
+
statusKind: "workflow",
|
|
770
|
+
});
|
|
768
771
|
}
|
|
769
772
|
await cancelOpenWorkflowTreeSteps(runIds, cancelReason, now);
|
|
770
773
|
await disarmWorkflowTreeRetries(runIds, now);
|
|
@@ -871,7 +874,7 @@ export async function cancelWorkflowRunStep(
|
|
|
871
874
|
}
|
|
872
875
|
|
|
873
876
|
const task = await getTaskByWorkflowRunStepId(stepId);
|
|
874
|
-
if (task) await cancelTask(task.id, reason);
|
|
877
|
+
if (task) await cancelTask(task.id, reason, { statusKind: "workflow" });
|
|
875
878
|
await updateWorkflowRunStep(stepId, {
|
|
876
879
|
status: "cancelled",
|
|
877
880
|
error: reason,
|
|
@@ -7,6 +7,8 @@ description: Build and iterate on schema-backed Swarm Apps with live models, nam
|
|
|
7
7
|
|
|
8
8
|
Swarm Apps are persistent, agent-authored internal applications: a schema-backed row store, named queries, custom script/task actions, and a validated json-render interface served at `/apps/<id>`. Use an app when people need to view and change live records; use `create_page` for a static snapshot.
|
|
9
9
|
|
|
10
|
+
**When to use a sheet or board instead:** a tracker or grid people keep editing, with no queries or actions, is a sheet. A plan, diagram or map to think through is a board. Both are editable agent-fs files; see the `boards-and-sheets` skill. To show one inside an app, use the `ObjectEmbed` component (section "Embed a sheet or board").
|
|
11
|
+
|
|
10
12
|
> **Capability gate**: app tools are available when the server's `CAPABILITIES` includes `pages` (for example `CAPABILITIES=core,task-pool,pages`). There is no separate `apps` capability. If these tools are absent from your MCP list, this is why.
|
|
11
13
|
|
|
12
14
|
## Tools and iteration loop
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Swarm Apps are persistent, agent-authored internal applications: a schema-backed row store, named queries, custom script/task actions, and a validated json-render interface served at `/apps/<id>`. Use an app when people need to view and change live records; use `create_page` for a static snapshot.
|
|
4
4
|
|
|
5
|
+
**When to use a sheet or board instead:** a tracker or grid people keep editing, with no queries or actions, is a sheet. A plan, diagram or map to think through is a board. Both are editable agent-fs files; see the `boards-and-sheets` skill. To show one inside an app, use the `ObjectEmbed` component (section "Embed a sheet or board").
|
|
6
|
+
|
|
5
7
|
> **Capability gate**: app tools are available when the server's `CAPABILITIES` includes `pages` (for example `CAPABILITIES=core,task-pool,pages`). There is no separate `apps` capability. If these tools are absent from your MCP list, this is why.
|
|
6
8
|
|
|
7
9
|
## Tools and iteration loop
|
|
@@ -10,6 +10,8 @@ Sheets are spreadsheets with live formulas. Boards are Excalidraw diagrams. Both
|
|
|
10
10
|
| A diagram or plan someone will move around (flow, architecture, rollout, mind map) | a board (`ctx.boards`) |
|
|
11
11
|
| A static table the reader only reads once | a Markdown table in your reply or report |
|
|
12
12
|
| A person asked for an Excel file, or sent one | a sheet, plus `importXlsx` / `exportXlsx` |
|
|
13
|
+
| A designed report or snapshot to share by URL | a page (the `pages` skill); embed the sheet or board in it |
|
|
14
|
+
| Records with queries, filters or action buttons | an app (the `apps` skill); embed the sheet or board in it |
|
|
13
15
|
|
|
14
16
|
## How to call
|
|
15
17
|
|
|
@@ -20,7 +22,7 @@ The `sheet-*` and `board-*` MCP tools are off in the agent tool list. Call them
|
|
|
20
22
|
- Identify a file by `id` (from `create` or `list`) or by `path`.
|
|
21
23
|
- Writes check the file version and re-apply on a concurrent edit (other cells or elements merge; the same cell or element is last writer wins). After 4 conflicting attempts the call throws "retry".
|
|
22
24
|
- `create` and `importXlsx` are create-only: they refuse when the path exists. Read or update the existing file instead.
|
|
23
|
-
- Every returned `object` carries `link`, the
|
|
25
|
+
- Every returned `object` carries `link`, the dashboard link to the file, where it opens as the editable board or sheet (the agent-fs live app when no dashboard is configured). Hand that link to the person.
|
|
24
26
|
|
|
25
27
|
## Where to put files
|
|
26
28
|
|
|
@@ -160,7 +162,7 @@ export default async function (args, ctx) {
|
|
|
160
162
|
|
|
161
163
|
## Embed in an app or a page
|
|
162
164
|
|
|
163
|
-
An app shows a live, editable sheet or board with `{ "type": "ObjectEmbed", "props": { "objectId": "<object id>" } }`. A page shows it with this snippet, where `${APP_URL}` is the dashboard origin:
|
|
165
|
+
An app (the `apps` skill) shows a live, editable sheet or board with `{ "type": "ObjectEmbed", "props": { "objectId": "<object id>" } }`. A page (the `pages` skill) shows it with this snippet, where `${APP_URL}` is the dashboard origin:
|
|
164
166
|
|
|
165
167
|
```html
|
|
166
168
|
<script type="module" src="${APP_URL}/embed/v1/swarm-object.js"></script>
|
|
@@ -27,6 +27,13 @@ every page should use.
|
|
|
27
27
|
Rule of thumb: if the content is a snapshot (you can write the full HTML/JSON
|
|
28
28
|
in a single call), use pages. If it needs stored data and actions, use apps.
|
|
29
29
|
|
|
30
|
+
### When to use a sheet or board instead
|
|
31
|
+
|
|
32
|
+
A tracker or grid people keep editing (budget, comparison, status list) is a
|
|
33
|
+
sheet. A plan, diagram or map to think through is a board. Both are editable
|
|
34
|
+
agent-fs files; see the `boards-and-sheets` skill. To show one inside a page,
|
|
35
|
+
embed it with `<swarm-object>` (section below).
|
|
36
|
+
|
|
30
37
|
Do **not** use pages for:
|
|
31
38
|
|
|
32
39
|
- In-flight progress notes: use `store-progress.progress`
|
|
@@ -362,12 +369,38 @@ color literals.
|
|
|
362
369
|
The API picks the preset of a designVersion 2 page in this order:
|
|
363
370
|
|
|
364
371
|
1. The page's `theme`, when it is set.
|
|
365
|
-
2. The
|
|
366
|
-
3.
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
`
|
|
372
|
+
2. The org design system's base preset, when the org has one (see below).
|
|
373
|
+
3. The viewer's dashboard preset, when the page opens inside the dashboard.
|
|
374
|
+
4. `hive`.
|
|
375
|
+
|
|
376
|
+
Then the org design system tokens apply on top of the preset, and the page's
|
|
377
|
+
`themeTokens` on top of those. A page with its own `theme` ignores the org
|
|
378
|
+
design system completely: its tokens, fonts and mode lock. The mode (light or
|
|
379
|
+
dark) comes from the viewer unless the design system locks it.
|
|
380
|
+
`create_page`, `POST /api/pages`, and `PUT /api/pages/:id` accept both fields.
|
|
381
|
+
|
|
382
|
+
### The org design system: ask once
|
|
383
|
+
|
|
384
|
+
One design system per org restyles every page without a `theme`. Read it with
|
|
385
|
+
`design-system-get`. Its `status` is `none`, `declined`, `active` or `invalid`.
|
|
386
|
+
|
|
387
|
+
When `create_page` says the org has no design system yet, ship the page as it
|
|
388
|
+
is and ask the requester once, in the same reply that hands over the page:
|
|
389
|
+
"Want every page in your brand? Send a site URL, a preset name or a CSS
|
|
390
|
+
variable block." Then:
|
|
391
|
+
|
|
392
|
+
1. Run the `design-system-seed` script with one of `url`, `preset` or `css`
|
|
393
|
+
(plus `logo` and `mode` if they gave them). It publishes a preview page and
|
|
394
|
+
saves nothing.
|
|
395
|
+
2. Send the preview link. Save only after the requester says yes: run the
|
|
396
|
+
script again with `save: true`, or call `design-system-set` with its
|
|
397
|
+
`saveInput`.
|
|
398
|
+
3. If they say no, call `design-system-set` with `status: "declined"`. Nobody
|
|
399
|
+
asks again.
|
|
400
|
+
|
|
401
|
+
Never set the design system without the requester's yes, and never ask when
|
|
402
|
+
the status is `declined` or `active`. The `design-system` KV namespace is
|
|
403
|
+
reserved: write it only through `design-system-set` or `PUT /api/design-system`.
|
|
371
404
|
|
|
372
405
|
### `theme`: a preset id
|
|
373
406
|
|
|
@@ -465,8 +498,8 @@ To use another font, load it from Google Fonts in your page `<head>`. Then set
|
|
|
465
498
|
|
|
466
499
|
## Dark mode
|
|
467
500
|
|
|
468
|
-
Inside the dashboard, a designVersion 2 page follows the viewer's mode
|
|
469
|
-
mode, the injected head adds the `dark` class to `<html>`, and the tokens
|
|
501
|
+
Inside the dashboard, a designVersion 2 page follows the viewer's mode, unless
|
|
502
|
+
the org design system locks `mode` to `light` or `dark`. In dark mode, the injected head adds the `dark` class to `<html>`, and the tokens
|
|
470
503
|
switch to their dark values. A page built on tokens needs no extra dark-mode
|
|
471
504
|
code.
|
|
472
505
|
|