@desplega.ai/agent-swarm 2.13.5 → 2.14.0
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-99n6z9ky.js +17 -0
- package/dist/{acp-targets-w8dbs4nr.js → acp-targets-23exz4z4.js} +10 -10
- package/dist/{actions-8zrcbjrx.js → actions-zcr25x27.js} +60 -39
- package/dist/{agent-fs-provision-cbt2ttds.js → agent-fs-provision-7fa9e12e.js} +4 -4
- package/dist/{amp-adapter-8x6zp8w4.js → amp-adapter-s7ytmv6b.js} +3 -3
- package/dist/{app-zfa9dwjw.js → app-5d3sz1hy.js} +7 -7
- package/dist/{approval-notifications-rv92zmza.js → approval-notifications-7qgkzkzx.js} +8 -8
- package/dist/{assistant-q7s7rm1q.js → assistant-p2yvhc3j.js} +37 -32
- package/dist/{boot-args-schema-g27kpzr1.js → boot-args-schema-ry6cb0p7.js} +1 -1
- package/dist/{boot-reembed-1mjs52nt.js → boot-reembed-2hkm3vz2.js} +1 -1
- package/dist/{boot-reembed-m62dpdkg.js → boot-reembed-c9643ms3.js} +1 -1
- package/dist/{boot-scrub-sweep-ss1vcamw.js → boot-scrub-sweep-3ycxr51t.js} +2 -2
- package/dist/{boot-seeds-hwnvgbb3.js → boot-seeds-2hzvvzg0.js} +4 -4
- package/dist/{boxd-y0szhp0g.js → boxd-9py3x0jb.js} +2 -2
- package/dist/{claude-adapter-0rjmbhjk.js → claude-adapter-dnkww93e.js} +9 -9
- package/dist/{claude-managed-adapter-6k032agg.js → claude-managed-adapter-yk0cr5x6.js} +4 -4
- package/dist/{claude-managed-setup-6czvve8q.js → claude-managed-setup-4byxpp47.js} +5 -5
- package/dist/{claude-sdk-session-pr0znb81.js → claude-sdk-session-4wf3dbvs.js} +12467 -12285
- package/dist/{cli-t0n9svkb.js → cli-096aftq6.js} +12 -7
- package/dist/{cli-2wzkvfgm.js → cli-0e914dp9.js} +3 -3
- package/dist/{cli-vcpyttcw.js → cli-0h6m6z5g.js} +1 -1
- package/dist/{cli-q41qar56.js → cli-0k7ppk9k.js} +130 -8
- package/dist/{cli-ks06cd0n.js → cli-1nfabrt4.js} +8 -8
- package/dist/{cli-ebpq3c5z.js → cli-2414h5r9.js} +8 -8
- package/dist/{cli-nrt048ys.js → cli-24wervhz.js} +37 -0
- package/dist/{cli-pedm2kht.js → cli-2ayk9gn8.js} +2 -2
- package/dist/{cli-kr0jpw9c.js → cli-2ckwgs7q.js} +1 -1
- package/dist/{cli-evy3egte.js → cli-2savn6mm.js} +11 -100
- package/dist/{cli-n79j1vxc.js → cli-2zjxake1.js} +4 -4
- package/dist/{cli-z3x7h79n.js → cli-37p61fcg.js} +9 -9
- package/dist/{cli-2vp0z049.js → cli-39t9d248.js} +1 -1
- package/dist/{cli-sa02jsqt.js → cli-3mhdmcd4.js} +1 -1
- package/dist/{cli-34fygf87.js → cli-3wsabyt0.js} +2 -2
- package/dist/{cli-grbngev5.js → cli-466jjrwe.js} +11 -2
- package/dist/{cli-zxa1vmx7.js → cli-6ajyhxh7.js} +2 -2
- package/dist/{cli-bvamr9g0.js → cli-6yy4fepf.js} +4 -4
- package/dist/{cli-3vw6dd4g.js → cli-73rmgm45.js} +2 -2
- package/dist/{cli-8b4rpnwj.js → cli-7ca8hczj.js} +1 -1
- package/dist/{cli-0h8skzss.js → cli-7g5qj2ca.js} +4 -3
- package/dist/{cli-srre41gb.js → cli-7w1fs01q.js} +2 -2
- package/dist/{cli-tgc1kgg3.js → cli-84wxwt3z.js} +1 -1
- package/dist/{cli-4gaf3tx5.js → cli-84xn7bgz.js} +1 -1
- package/dist/{cli-s8dhq7rj.js → cli-879txsac.js} +5 -5
- package/dist/{cli-9n6g14vs.js → cli-8vbxjzk0.js} +3 -3
- package/dist/{cli-cmbb2t8a.js → cli-91amj3md.js} +2 -2
- package/dist/{cli-ewk3sg68.js → cli-930zbczq.js} +3 -3
- package/dist/{cli-6msnpj1z.js → cli-9fwznq4p.js} +10 -10
- package/dist/{cli-qmx8bnt4.js → cli-9j1t3kf6.js} +2 -2
- package/dist/{cli-t879ww0y.js → cli-9j47sgzy.js} +2 -2
- package/dist/{cli-0qt3epg4.js → cli-ad00h1st.js} +7 -7
- package/dist/{cli-avax5mp9.js → cli-adzmmcvf.js} +19 -7
- package/dist/{cli-ffn0a515.js → cli-ayxxkk3p.js} +68 -25
- package/dist/{cli-4vynxtrb.js → cli-bqfx72e6.js} +10 -3
- package/dist/{cli-887vhew6.js → cli-cbg0j1yt.js} +2716 -2643
- package/dist/{cli-fw67mnyc.js → cli-cg1q8ymp.js} +1 -1
- package/dist/{cli-he5nxaa8.js → cli-dw9rtjm3.js} +1 -1
- package/dist/{cli-emdfd8fh.js → cli-dy754erz.js} +9 -1
- package/dist/{cli-3860pmrq.js → cli-edxfzgah.js} +4 -4
- package/dist/{cli-v09eza21.js → cli-ejnhs815.js} +15 -15
- package/dist/{cli-k0nebh10.js → cli-enavhq6r.js} +1 -1
- package/dist/{cli-b42yfn17.js → cli-f2rwt43y.js} +13 -13
- package/dist/{cli-tvyt8w6n.js → cli-f9g96z28.js} +8 -8
- package/dist/{cli-zbbtp02a.js → cli-fww016hh.js} +457 -70
- package/dist/{cli-vbge4rsp.js → cli-g6a696c0.js} +4 -4
- package/dist/{cli-z1vam71h.js → cli-gc6b94tj.js} +2 -2
- package/dist/{cli-5tq15aa7.js → cli-gcyws2bp.js} +2 -2
- package/dist/{cli-srktrbby.js → cli-hzhv7yac.js} +1 -1
- package/dist/{cli-cp163xga.js → cli-jcnc5ret.js} +44 -32
- package/dist/{cli-j69pzrrz.js → cli-jgq9xptq.js} +5 -5
- package/dist/{cli-kwj3131p.js → cli-jwnac23b.js} +1 -1
- package/dist/{cli-wzecestt.js → cli-kc7vd07m.js} +616 -289
- package/dist/{cli-8pd1t17c.js → cli-kg63yp1r.js} +14 -14
- package/dist/{cli-zzq96q57.js → cli-krk8y8c7.js} +727 -139
- package/dist/{cli-5web09sb.js → cli-m0ea8ggd.js} +8 -10
- package/dist/{cli-qrvk9nka.js → cli-md4tn21h.js} +13 -13
- package/dist/{cli-1jq2em7b.js → cli-mv8ft7b0.js} +10 -9
- package/dist/{cli-ryem5cfq.js → cli-mw1tmn3x.js} +217 -27
- package/dist/{cli-abby987g.js → cli-njvpngc6.js} +3 -3
- package/dist/{cli-55h8m1x3.js → cli-phe2vcw5.js} +6 -6
- package/dist/{cli-prz1p3ft.js → cli-pq0kv31y.js} +5 -5
- package/dist/{cli-q1h041y8.js → cli-q457ga28.js} +6 -6
- package/dist/{cli-z40t85ms.js → cli-q5n3deaf.js} +1 -1
- package/dist/{cli-7ypg8hka.js → cli-qkbevqer.js} +3 -3
- package/dist/{cli-f9xw9pr4.js → cli-qrwjk4xy.js} +5 -5
- package/dist/{cli-kezzteka.js → cli-r04ve9xw.js} +1 -1
- package/dist/{cli-zntvmqmm.js → cli-r495stwd.js} +2 -2
- package/dist/{cli-1kvcsd2f.js → cli-r9d2tya0.js} +71 -3
- package/dist/{cli-ybte1fqc.js → cli-rp1n2xpd.js} +1 -1
- package/dist/{cli-sejvnjvw.js → cli-rs1rzwp4.js} +1 -1
- package/dist/{cli-94mxerrp.js → cli-rzbsh6bw.js} +1 -1
- package/dist/{cli-94gx6ze9.js → cli-s4pccby1.js} +1 -1
- package/dist/{cli-hd5bm1e1.js → cli-shyhb4t5.js} +10 -10
- package/dist/{cli-r3dxpmyt.js → cli-srq69pn1.js} +1 -1
- package/dist/{cli-7r9tvk8v.js → cli-tc165vrb.js} +8 -3
- package/dist/{cli-ced4azn1.js → cli-v4z5v3jd.js} +298 -80
- package/dist/{cli-ehg90jd1.js → cli-vxmmttmt.js} +55 -50
- package/dist/{cli-tt7dkwjj.js → cli-w4bvtxet.js} +7 -7
- package/dist/{cli-x2adbg4j.js → cli-wd7b5hgc.js} +1 -1
- package/dist/{cli-htb5bpz2.js → cli-wvbaq052.js} +1 -1
- package/dist/{cli-ywy8yz6t.js → cli-wvgg7r4j.js} +2 -2
- package/dist/{cli-19d6v8er.js → cli-wym6rxgt.js} +165 -6
- package/dist/{cli-f7b9nyvk.js → cli-yd7e590v.js} +12 -12
- package/dist/{cli-69zzpjgh.js → cli-yjb3cddd.js} +1 -1
- package/dist/{cli-5n9w2xzx.js → cli-z8t4485r.js} +2 -2
- package/dist/{cli-jdq3jmny.js → cli-ze1ndjs4.js} +4 -6
- package/dist/cli.js +28 -28
- package/dist/{codex-adapter-bn7eaxk5.js → codex-adapter-eq61radw.js} +8 -8
- package/dist/{codex-hook-nnmezjg9.js → codex-hook-8nmepvz6.js} +3 -3
- package/dist/{codex-login-ktfg1cxk.js → codex-login-vbd9707w.js} +1 -1
- package/dist/{codex-session-runner-j1e9hffc.js → codex-session-runner-rfx355h4.js} +9 -9
- package/dist/{commands-amhpafrr.js → commands-d1z0sx62.js} +3 -3
- package/dist/{controller-tw7g10j2.js → controller-9hz6d8x3.js} +4 -4
- package/dist/{controllers-connect-2ssqz7f4.js → controllers-connect-tz07d2xr.js} +24 -25
- package/dist/core-dynsv289.js +41 -0
- package/dist/{cursor-adapter-d6knjmwa.js → cursor-adapter-ef22ze3j.js} +2 -2
- package/dist/{db-fd6xxm77.js → db-gd81d68c.js} +3 -3
- package/dist/{db-sc59379z.js → db-vrckks6q.js} +4 -2
- package/dist/{devin-adapter-3bp6rape.js → devin-adapter-kdt6a2bh.js} +1 -1
- package/dist/{dispatcher-a2gdqz8c.js → dispatcher-76as8w2t.js} +21 -22
- package/dist/{docker-a59g3ebm.js → docker-51ta7jsh.js} +2 -2
- package/dist/dsh-adapter-ypfvcdyz.js +11 -0
- package/dist/{e2b-cn7cvjqy.js → e2b-05kn3kpq.js} +16 -5
- package/dist/{e2b-qnxyfea6.js → e2b-dm9r8hpy.js} +3 -3
- package/dist/{easter-egg-3d-a0pphy71.js → easter-egg-3d-sg21j15g.js} +1 -1
- package/dist/{embedding-space-qepzrach.js → embedding-space-zsdw37bb.js} +13 -23
- package/dist/{embeddings-d7vr881x.js → embeddings-p4e3e1m6.js} +1 -1
- package/dist/{event-bus-7gbsr0g4.js → event-bus-tvf2grf4.js} +1 -1
- package/dist/{execute-6afts2bn.js → execute-nztd0af0.js} +1 -1
- package/dist/{external-channel-881zq1x4.js → external-channel-717yzn4d.js} +2 -2
- package/dist/fx-adapter-9k0hptnz.js +20 -0
- package/dist/grok-adapter-skdj2pce.js +20 -0
- package/dist/handlers-5btjqkz6.js +39 -0
- package/dist/{heartbeat-4c022m6a.js → heartbeat-vfb1gy84.js} +24 -25
- package/dist/{hook-a7eh6zty.js → hook-ctz0xmp3.js} +11 -11
- package/dist/{hook-4k84x499.js → hook-eh52p7yd.js} +6 -6
- package/dist/{http-6aw5wanc.js → http-zregegrx.js} +784 -166
- package/dist/{index-xhad0n8m.js → index-5kx15d19.js} +1 -1
- package/dist/index-7w8p6em0.js +41 -0
- package/dist/index-evay0xyk.js +17 -0
- package/dist/{index-yq9hhhhy.js → index-fdym6ryb.js} +25 -26
- package/dist/{index-3j803vnb.js → index-mtnbhe12.js} +20533 -19786
- package/dist/index-vz4semsx.js +38 -0
- package/dist/{index-z2g9469g.js → index-x9qf8dg7.js} +108 -28
- package/dist/index-y3s0xp2v.js +43 -0
- package/dist/{k8s-36gfn847.js → k8s-ejkk0aw7.js} +2 -2
- package/dist/{keepalive-zhbmztqw.js → keepalive-zdqay870.js} +4 -5
- package/dist/lead-6cscw8a5.js +82 -0
- package/dist/{maintenance-rsp0591h.js → maintenance-t5ndg11m.js} +1 -1
- package/dist/{node-rxte5hc6.js → node-jkdd5w7m.js} +1 -1
- package/dist/{oauth-refresh-sweep-w3cqmxq7.js → oauth-refresh-sweep-y9zyd7t6.js} +3 -4
- package/dist/{object-webhooks-331hay92.js → object-webhooks-mkca91s0.js} +7 -7
- package/dist/{onboard-n2w80m2n.js → onboard-ss995244.js} +11 -9
- package/dist/{opencode-adapter-z98127cz.js → opencode-adapter-mwpz0278.js} +8 -8
- package/dist/{otel-impl-xsk35tvf.js → otel-impl-6n6vva3x.js} +2 -2
- package/dist/{pending-2e6trkxd.js → pending-2sxh1t6j.js} +22 -23
- package/dist/{pi-mono-adapter-wh6yndtm.js → pi-mono-adapter-sfb7zy43.js} +13 -13
- package/dist/{pricing-refresh-9355dj1t.js → pricing-refresh-h79bg4cf.js} +2 -2
- package/dist/{rbac-roles-8eajw4s6.js → rbac-roles-ckq0czp4.js} +2 -2
- package/dist/{rbac-roles-58y3m912.js → rbac-roles-jg2e260w.js} +3 -3
- package/dist/{render-v2-7gskkmd4.js → render-v2-ymbshmn0.js} +7 -7
- package/dist/{resume-0drnmpja.js → resume-jdhnt4jk.js} +10 -10
- package/dist/{runtime-d2tcmqte.js → runtime-y28jhhnf.js} +1 -1
- package/dist/{session-access-0ztys6bd.js → session-access-k4ta5hvp.js} +5 -5
- package/dist/{session-source-backfill-cdm5s046.js → session-source-backfill-528j4s8j.js} +3 -3
- package/dist/{setup-pqwb9tcc.js → setup-d6pj82fr.js} +15 -6
- package/dist/thread-buffer-9w6x5zec.js +40 -0
- package/dist/{tree-visibility-rwz67mje.js → tree-visibility-kjxv3nxk.js} +2 -2
- package/dist/{user-merge-jobs-mxrhamwt.js → user-merge-jobs-rabbncf6.js} +3 -3
- package/dist/{virtual-modules-71y1gsmg.js → virtual-modules-22k51txd.js} +3 -3
- package/dist/{work-objects-3k4ykt9j.js → work-objects-xtjbar3r.js} +26 -30
- package/dist/{worker-follow-up-y0h64xpr.js → worker-follow-up-fg48vk6d.js} +21 -22
- package/dist/worker-g4aj93dt.js +82 -0
- package/dist/{x-d27jj7z7.js → x-vfsqypht.js} +2 -2
- package/openapi.json +247 -20
- package/package.json +10 -10
- package/src/apps/definition.ts +76 -24
- package/src/apps/row-store.ts +67 -0
- package/src/apps/script-types.ts +131 -21
- package/src/apps/store.ts +4 -1
- package/src/be/db/script-runs.ts +33 -0
- package/src/be/db/slack-card-groups.ts +147 -0
- package/src/be/db/slack-trees.ts +26 -0
- package/src/be/db/task-idempotency.ts +63 -0
- package/src/be/db/tasks/read.ts +2 -0
- package/src/be/db/tasks/write.ts +4 -2
- package/src/be/db/workflow-idempotency.ts +6 -1
- package/src/be/db/workflows/read.ts +79 -0
- package/src/be/db.ts +51 -147
- package/src/be/improvements.ts +24 -2
- package/src/be/mcp-proxy.ts +45 -11
- package/src/be/memory/embedding-space.ts +10 -20
- package/src/be/memory/index.ts +35 -0
- package/src/be/memory/providers/openai-embedding.ts +10 -0
- package/src/be/migrations/348_task_deferred_until.sql +4 -0
- package/src/be/migrations/354_durable_objects.sql +9 -0
- package/src/be/migrations/356_slack_outcome_card_groups.sql +14 -0
- package/src/be/migrations/357_task_idempotency_keys.sql +27 -0
- package/src/be/migrations/362_favorites_app.sql +36 -0
- package/src/be/repo-checked-update.ts +58 -5
- package/src/be/requester-timezone.ts +10 -0
- package/src/be/script-connections.ts +5 -1
- package/src/be/script-credential-broker.ts +29 -2
- package/src/be/scripts/durable.ts +204 -0
- package/src/be/scripts/extract-schema.ts +29 -4
- package/src/be/scripts/run-credential.ts +1 -8
- package/src/be/scripts/typecheck.ts +32 -7
- package/src/be/seed-scripts/catalog/memory-eval.ts +11 -2
- package/src/be/seed-scripts/catalog/tool-usage.ts +27 -8
- package/src/be/swarm-config-guard.ts +87 -7
- package/src/be/users.ts +33 -12
- package/src/comb/review-batch.ts +16 -5
- package/src/commands/context-preamble.ts +237 -0
- package/src/commands/e2b.ts +14 -0
- package/src/commands/entrypoint-mcp-config.ts +231 -0
- package/src/commands/onboard/agent-fs-version.ts +1 -1
- package/src/commands/onboard/compose-generator.ts +2 -1
- package/src/commands/onboard/env-generator.ts +16 -7
- package/src/commands/runner.ts +23 -7
- package/src/commands/setup.tsx +17 -3
- package/src/extensions/contract-types.generated.ts +1 -1
- package/src/hooks/hook.ts +8 -2
- package/src/hooks/native-tool-hooks.ts +4 -2
- package/src/http/apps.ts +82 -42
- package/src/http/comb.ts +21 -5
- package/src/http/config.ts +8 -4
- package/src/http/heartbeat.ts +5 -0
- package/src/http/index.ts +12 -6
- package/src/http/kv.ts +7 -5
- package/src/http/mcp-oauth.ts +16 -0
- package/src/http/mcp-servers.ts +43 -3
- package/src/http/memory.ts +28 -1
- package/src/http/metrics.ts +11 -4
- package/src/http/onboarding.ts +12 -1
- package/src/http/repos.ts +27 -11
- package/src/http/request-principal.ts +27 -1
- package/src/http/schedules.ts +36 -8
- package/src/http/script-connection-proxy.ts +3 -1
- package/src/http/script-runs.ts +21 -10
- package/src/http/scripts.ts +177 -26
- package/src/http/session-cost-recompute.ts +9 -4
- package/src/http/skills.ts +70 -0
- package/src/http/status.ts +2 -0
- package/src/http/tasks.ts +92 -14
- package/src/http/trackers/jira.ts +18 -3
- package/src/http/trackers/linear.ts +3 -0
- package/src/kv-limits.ts +2 -0
- package/src/kv-reserved-namespaces.ts +25 -2
- package/src/prompts/session-templates.ts +49 -0
- package/src/prompts/session-turns.ts +30 -0
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/claude-managed-adapter.ts +14 -0
- package/src/providers/claude-sdk-session.ts +14 -1
- package/src/providers/cursor-adapter.ts +1 -1
- package/src/providers/dsh-adapter.ts +1 -1
- package/src/providers/opencode-adapter.ts +3 -5
- package/src/providers/runtime-dependencies.ts +11 -8
- package/src/rbac/legacy-policy.ts +7 -0
- package/src/rbac/permissions.ts +27 -0
- package/src/scheduler/scheduler.ts +36 -18
- package/src/script-workflows/executor.ts +37 -8
- package/src/script-workflows/supervisor.ts +14 -0
- package/src/scripts-runtime/ctx.ts +5 -1
- package/src/scripts-runtime/durable-object-base.ts +19 -0
- package/src/scripts-runtime/eval-harness.ts +46 -1
- package/src/scripts-runtime/executors/native.ts +13 -1
- package/src/scripts-runtime/executors/quickjs-bundle.ts +20 -1
- package/src/scripts-runtime/executors/quickjs-prelude.ts +40 -1
- package/src/scripts-runtime/executors/quickjs-runner.ts +26 -3
- package/src/scripts-runtime/executors/quickjs-worker.ts +2 -1
- package/src/scripts-runtime/executors/types.ts +26 -0
- package/src/scripts-runtime/extract-signature.ts +96 -1
- package/src/scripts-runtime/loader.ts +11 -5
- package/src/scripts-runtime/mcp-client.ts +1 -1
- package/src/scripts-runtime/sdk-allowlist.ts +1 -0
- package/src/scripts-runtime/swarm-config.ts +7 -0
- package/src/scripts-runtime/swarm-sdk.ts +4 -1
- package/src/scripts-runtime/types/stdlib.d.ts +19 -0
- package/src/scripts-runtime/types/swarm-extension.d.ts +1 -0
- package/src/scripts-runtime/types/swarm-sdk.d.ts +19 -0
- package/src/slack/actions.ts +24 -0
- package/src/slack/assistant.ts +8 -0
- package/src/slack/blocks.ts +35 -0
- package/src/slack/channel-activity.ts +7 -0
- package/src/slack/enrich.ts +46 -54
- package/src/slack/files.ts +173 -23
- package/src/slack/handlers.test.ts +17 -19
- package/src/slack/handlers.ts +15 -14
- package/src/slack/render-v2.ts +264 -19
- package/src/slack/responses.ts +61 -5
- package/src/slack/session-mirror.ts +10 -5
- package/src/slack/task-output.ts +25 -14
- package/src/slack/templates.ts +9 -0
- package/src/slack/thread-participants.ts +64 -24
- package/src/slack/watcher.ts +4 -4
- package/src/slack/work-objects.ts +1 -1
- package/src/stdio.ts +5 -0
- package/src/tests/agents-list-model-display.test.ts +4 -0
- package/src/tests/apps-script-types.test.ts +63 -16
- package/src/tests/apps-sort-order.test.ts +87 -0
- package/src/tests/bedrock-model-groups.test.ts +4 -0
- package/src/tests/channel-activity.test.ts +9 -0
- package/src/tests/chatgpt-subscription-model-groups.test.ts +4 -0
- package/src/tests/claude-hook-output.test.ts +2 -0
- package/src/tests/claude-managed-adapter.test.ts +15 -3
- package/src/tests/claude-sdk-stderr.test.ts +28 -0
- package/src/tests/codex-gpt6-release.test.ts +4 -0
- package/src/tests/comb-review-batch.test.ts +17 -4
- package/src/tests/comb-status.test.ts +1 -0
- package/src/tests/db-client.test.ts +11 -5
- package/src/tests/db-task-read-contract.test.ts +1 -0
- package/src/tests/db-task-write-contract.test.ts +2 -2
- package/src/tests/defer-task.test.ts +23 -1
- package/src/tests/dsh-adapter.test.ts +1 -1
- package/src/tests/e2b-dispatch.test.ts +13 -1
- package/src/tests/entrypoint-mcp-config.test.ts +642 -0
- package/src/tests/fixtures/onboard/content.env.txt +2 -2
- package/src/tests/fixtures/onboard/dev.env.txt +2 -2
- package/src/tests/fixtures/onboard/full-all.env.txt +2 -2
- package/src/tests/fixtures/onboard/full.env.txt +2 -2
- package/src/tests/fixtures/onboard/research.env.txt +2 -2
- package/src/tests/fixtures/onboard/solo.env.txt +2 -2
- package/src/tests/fixtures/runner-missing-dependency.ts +2 -1
- package/src/tests/fx-adapter.test.ts +4 -5
- package/src/tests/hook-mcp-config-precedence.test.ts +59 -0
- package/src/tests/hook-ping-me-order.test.ts +1 -0
- package/src/tests/hook-runtime-close.test.ts +1 -0
- package/src/tests/improvements-payload.test.ts +2 -2
- package/src/tests/model-groups-live-catalog.test.ts +4 -0
- package/src/tests/oauth-credential-bindings.test.ts +8 -3
- package/src/tests/oauth-refresh-failure.test.ts +15 -3
- package/src/tests/onboard-env.test.ts +1 -1
- package/src/tests/openai-compatible-providers.test.ts +5 -0
- package/src/tests/openapi-route-headers.test.ts +2 -1
- package/src/tests/opus-5-5-registry.test.ts +4 -0
- package/src/tests/provider-runtime-dependencies.test.ts +26 -15
- package/src/tests/routing-affinity-inventory.test.ts +11 -0
- package/src/tests/runner-context-preamble.test.ts +202 -0
- package/src/tests/runner-repo-clone-args.test.ts +116 -0
- package/src/tests/scheduler-occurrence.test.ts +60 -9
- package/src/tests/script-connections-mcp.test.ts +6 -3
- package/src/tests/script-connections.test.ts +4 -0
- package/src/tests/scripts-namespaces.test.ts +3 -1
- package/src/tests/secret-scrubber.test.ts +8 -2
- package/src/tests/session-cost-recompute-unit.test.ts +39 -0
- package/src/tests/session-costs-recompute-all-providers.test.ts +6 -3
- package/src/tests/session-route-posture.test.ts +7 -1
- package/src/tests/slack-file-tools-attachments.test.ts +14 -9
- package/src/tests/slack-identity-resolution.test.ts +10 -3
- package/src/tests/slack-inline-output.test.ts +10 -8
- package/src/tests/slack-render-v2.test.ts +9 -4
- package/src/tests/slack-steering.test.ts +8 -2
- package/src/tests/slack-thread-participants.test.ts +11 -1
- package/src/tests/sonnet-5-5-registry.test.ts +4 -0
- package/src/tests/swarm-config-encryption.test.ts +5 -8
- package/src/tests/ui-spec-script-actions-config.test.ts +7 -3
- package/src/tests/workflow-triggers-v2.test.ts +35 -11
- package/src/tools/app-patch.ts +6 -2
- package/src/tools/app-upsert.ts +8 -4
- package/src/tools/defer-task.ts +17 -77
- package/src/tools/kv/kv-get.ts +2 -0
- package/src/tools/kv/kv-list.ts +11 -5
- package/src/tools/kv/kv-set.ts +1 -3
- package/src/tools/repos/update-repo.ts +37 -19
- package/src/tools/schedules/run-schedule-now.ts +21 -1
- package/src/tools/script-apis.ts +9 -4
- package/src/tools/script-common.ts +2 -2
- package/src/tools/script-run.ts +8 -0
- package/src/tools/script-upsert.ts +1 -1
- package/src/tools/slack-download-file.ts +15 -12
- package/src/tools/slack-post.ts +7 -1
- package/src/tools/slack-read.ts +3 -1
- package/src/tools/slack-reply.ts +16 -0
- package/src/tools/slack-start-thread.ts +8 -1
- package/src/tools/slack-upload-file.ts +99 -96
- package/src/tools/swarm-config/set-config.ts +3 -1
- package/src/tools/swarm-x.ts +0 -2
- package/src/tools/utils.ts +3 -0
- package/src/types.ts +8 -2
- package/src/utils/constants.ts +20 -0
- package/src/utils/deferral-time.ts +61 -0
- package/src/utils/request-auth-context.ts +15 -16
- package/src/utils/secret-scrubber.ts +1 -1
- package/src/workflows/engine.ts +6 -11
- package/src/workflows/executors/swarm-script.ts +0 -2
- package/src/workflows/foreach-driver.ts +6 -12
- package/src/workflows/input.ts +24 -1
- package/src/workflows/node-timeout.ts +18 -0
- package/src/workflows/retry-poller.ts +2 -1
- package/src/workflows/triggers.ts +21 -11
- package/src/x/composio.ts +10 -1
- package/templates/skills/apps/SKILL.md +4 -2
- package/templates/skills/apps/content.md +4 -2
- package/templates/skills/code-quality/content.md +4 -4
- package/templates/skills/scheduled-task-resilience/SKILL.md +2 -0
- package/templates/skills/scheduled-task-resilience/content.md +2 -0
- package/templates/skills/swarm-docs/content.md +7 -0
- package/templates/skills/swarm-scripts/SKILL.md +44 -0
- package/templates/skills/swarm-scripts/content.md +44 -0
- package/dist/acp-adapter-tbt61zkm.js +0 -17
- package/dist/cli-b9ygp1kz.js +0 -459
- package/dist/cli-kj0hyr43.js +0 -51
- package/dist/cli-m8f4379k.js +0 -173
- package/dist/core-bwp98v4w.js +0 -42
- package/dist/dsh-adapter-43ygwqn7.js +0 -9
- package/dist/fx-adapter-cr2hq17y.js +0 -20
- package/dist/grok-adapter-ayddnbsc.js +0 -20
- package/dist/handlers-7ghs84x2.js +0 -41
- package/dist/index-dtt0d634.js +0 -44
- package/dist/index-hmszyqkk.js +0 -42
- package/dist/index-j6rm1rtn.js +0 -39
- package/dist/index-rwwhsmjg.js +0 -13
- package/dist/lead-g2j4q39z.js +0 -83
- package/dist/thread-buffer-epx3san4.js +0 -42
- package/dist/worker-09gqn9xy.js +0 -83
|
@@ -92,6 +92,11 @@ export async function buildSlackThreadSnapshot(
|
|
|
92
92
|
}
|
|
93
93
|
const isBot = (m: ThreadMessage) =>
|
|
94
94
|
m.user === botUserId || m.bot_id !== undefined || m.subtype === "bot_message";
|
|
95
|
+
// Only this swarm's own posts render as `[Agent]`; any other bot or app is untrusted.
|
|
96
|
+
const ownBotId = messages.some((m) => m.bot_id !== undefined) ? await getOwnBotId(client) : null;
|
|
97
|
+
const isOwnBot = (m: ThreadMessage) =>
|
|
98
|
+
(botUserId !== undefined && m.user === botUserId) ||
|
|
99
|
+
(ownBotId !== null && m.bot_id === ownBotId);
|
|
95
100
|
|
|
96
101
|
// Latest message per human, newest first: the order of non-batch participants.
|
|
97
102
|
const latest = new Map<string, { text: string; userTeam?: string }>();
|
|
@@ -116,15 +121,16 @@ export async function buildSlackThreadSnapshot(
|
|
|
116
121
|
]),
|
|
117
122
|
].filter((id) => id !== botUserId);
|
|
118
123
|
const listed = ordered.slice(0, SLACK_PARTICIPANT_CAP);
|
|
124
|
+
const resolve = (slackUserId: string) =>
|
|
125
|
+
resolveSlackParticipant(client, slackUserId, {
|
|
126
|
+
sampleEventType: opts.sampleEventType,
|
|
127
|
+
sampleContext: latest.get(slackUserId)?.text ?? "",
|
|
128
|
+
userTeam: latest.get(slackUserId)?.userTeam,
|
|
129
|
+
});
|
|
119
130
|
|
|
120
|
-
// shortcut: people past the cap are not resolved, so their trust is unknown to the "untrusted present" rule; resolve them too if the cap ever hides one.
|
|
121
131
|
const people: TaskSlackParticipant[] = await Promise.all(
|
|
122
132
|
listed.map(async (slackUserId) => {
|
|
123
|
-
const resolution = await
|
|
124
|
-
sampleEventType: opts.sampleEventType,
|
|
125
|
-
sampleContext: latest.get(slackUserId)?.text ?? "",
|
|
126
|
-
userTeam: latest.get(slackUserId)?.userTeam,
|
|
127
|
-
});
|
|
133
|
+
const resolution = await resolve(slackUserId);
|
|
128
134
|
return {
|
|
129
135
|
slackUserId,
|
|
130
136
|
...(resolution.userId && { userId: resolution.userId }),
|
|
@@ -136,46 +142,80 @@ export async function buildSlackThreadSnapshot(
|
|
|
136
142
|
}),
|
|
137
143
|
);
|
|
138
144
|
const trust = new Map(people.map((person) => [person.slackUserId, person.trust]));
|
|
145
|
+
// The cap limits the listed people only. Every sender and every author in the
|
|
146
|
+
// rendered context still gets a trust level, so a label is never dropped.
|
|
147
|
+
const window = contextWindow(messages, opts.excludeTs);
|
|
148
|
+
const unlisted = [
|
|
149
|
+
...new Set([
|
|
150
|
+
...senders.map((sender) => sender.userId),
|
|
151
|
+
...window.filter((m) => !isBot(m) && m.user).map((m) => m.user as string),
|
|
152
|
+
]),
|
|
153
|
+
].filter((id) => id !== botUserId && !trust.has(id));
|
|
154
|
+
for (const [slackUserId, resolution] of await Promise.all(
|
|
155
|
+
unlisted.map(async (id) => [id, await resolve(id)] as const),
|
|
156
|
+
)) {
|
|
157
|
+
trust.set(slackUserId, resolution.trust);
|
|
158
|
+
}
|
|
139
159
|
const newestPerson = people[0];
|
|
140
160
|
|
|
141
161
|
return {
|
|
142
|
-
threadContext: await renderThreadContext(
|
|
162
|
+
threadContext: await renderThreadContext(window, isBot, isOwnBot, botUserId, trust),
|
|
143
163
|
participants: { people, more: ordered.length - listed.length },
|
|
144
164
|
trust,
|
|
145
165
|
newest: { userId: newestPerson?.userId, trust: newestPerson?.trust ?? "unknown" },
|
|
146
166
|
};
|
|
147
167
|
}
|
|
148
168
|
|
|
169
|
+
/** Bot id of this swarm's own app (`auth.test`), cached per process once known. */
|
|
170
|
+
let cachedOwnBotId: string | undefined;
|
|
171
|
+
async function getOwnBotId(client: WebClient): Promise<string | null> {
|
|
172
|
+
if (cachedOwnBotId) return cachedOwnBotId;
|
|
173
|
+
try {
|
|
174
|
+
cachedOwnBotId = ((await client.auth.test()).bot_id as string | undefined) || undefined;
|
|
175
|
+
} catch (error) {
|
|
176
|
+
console.error("[Slack] auth.test failed while reading the bot id:", error);
|
|
177
|
+
}
|
|
178
|
+
return cachedOwnBotId ?? null;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/** The messages `<thread_context>` shows: the root plus the newest replies. */
|
|
182
|
+
function contextWindow(messages: ThreadMessage[], excludeTs: ReadonlySet<string>): ThreadMessage[] {
|
|
183
|
+
const previous = messages.filter(
|
|
184
|
+
(m) => !(m.ts && excludeTs.has(m.ts)) && extractSlackMessageText(m) !== "",
|
|
185
|
+
);
|
|
186
|
+
// conversations.replies is oldest first: keep the root and the newest replies.
|
|
187
|
+
return previous.length > THREAD_CONTEXT_MESSAGES
|
|
188
|
+
? [previous[0]!, ...previous.slice(-(THREAD_CONTEXT_MESSAGES - 1))]
|
|
189
|
+
: previous;
|
|
190
|
+
}
|
|
191
|
+
|
|
149
192
|
async function renderThreadContext(
|
|
150
|
-
|
|
151
|
-
excludeTs: ReadonlySet<string>,
|
|
193
|
+
window: ThreadMessage[],
|
|
152
194
|
isBot: (m: ThreadMessage) => boolean,
|
|
195
|
+
isOwnBot: (m: ThreadMessage) => boolean,
|
|
153
196
|
botUserId: string | undefined,
|
|
154
197
|
trust: ReadonlyMap<string, SlackParticipantTrust>,
|
|
155
198
|
): Promise<string> {
|
|
156
|
-
|
|
157
|
-
(m) => !(m.ts && excludeTs.has(m.ts)) && extractSlackMessageText(m) !== "",
|
|
158
|
-
);
|
|
159
|
-
if (previous.length === 0) return "";
|
|
160
|
-
// conversations.replies is oldest first: keep the root and the newest replies.
|
|
161
|
-
const window =
|
|
162
|
-
previous.length > THREAD_CONTEXT_MESSAGES
|
|
163
|
-
? [previous[0]!, ...previous.slice(-(THREAD_CONTEXT_MESSAGES - 1))]
|
|
164
|
-
: previous;
|
|
199
|
+
if (window.length === 0) return "";
|
|
165
200
|
|
|
166
201
|
// Author identity comes from the identity primitive (resolved name or the
|
|
167
202
|
// UNKNOWN sentinel), never a raw Slack display name.
|
|
203
|
+
let otherBot = false;
|
|
168
204
|
const lines = window.map((m) => {
|
|
169
205
|
const text = extractSlackMessageText(m);
|
|
170
|
-
if (isBot(m))
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
206
|
+
if (isBot(m)) {
|
|
207
|
+
const short = text.length > 500 ? `${text.slice(0, 500)}...` : text;
|
|
208
|
+
if (isOwnBot(m)) return formatAuthoredMessage("[Agent]", short);
|
|
209
|
+
otherBot = true;
|
|
210
|
+
const label = resolveTemplate("slack.message.thread_context_other_bot", {
|
|
211
|
+
bot_id: m.bot_id ?? m.user ?? "unknown",
|
|
212
|
+
}).text;
|
|
213
|
+
return formatAuthoredMessage(label, short);
|
|
214
|
+
}
|
|
175
215
|
return formatAuthoredMessage(m.user ? `<@${m.user}>` : "Unknown", text);
|
|
176
216
|
});
|
|
177
217
|
let body = await rewriteSlackMentions(lines.join("\n"), botUserId, trust);
|
|
178
|
-
if ([...trust.values()].some(isUntrusted)) {
|
|
218
|
+
if (otherBot || [...trust.values()].some(isUntrusted)) {
|
|
179
219
|
body = `${resolveTemplate("slack.message.thread_context_untrusted", {}).text}\n${body}`;
|
|
180
220
|
}
|
|
181
221
|
return resolveTemplate("slack.message.thread_context", { thread_messages: body }).text;
|
package/src/slack/watcher.ts
CHANGED
|
@@ -181,7 +181,7 @@ export async function buildTreeNodes(tree: TreeMessageState): Promise<TreeNode[]
|
|
|
181
181
|
progress: child.progress ?? undefined,
|
|
182
182
|
duration: childDuration,
|
|
183
183
|
slackReplySent: child.slackReplySent,
|
|
184
|
-
output: slackTaskOutput(child),
|
|
184
|
+
output: await slackTaskOutput(child),
|
|
185
185
|
failureReason: child.failureReason ?? undefined,
|
|
186
186
|
attachments: childAttachments,
|
|
187
187
|
steered: childSteered,
|
|
@@ -204,7 +204,7 @@ export async function buildTreeNodes(tree: TreeMessageState): Promise<TreeNode[]
|
|
|
204
204
|
progress: task.progress ?? undefined,
|
|
205
205
|
duration,
|
|
206
206
|
slackReplySent: task.slackReplySent,
|
|
207
|
-
output: slackTaskOutput(task),
|
|
207
|
+
output: await slackTaskOutput(task),
|
|
208
208
|
failureReason: task.failureReason ?? undefined,
|
|
209
209
|
attachments: rootAttachments,
|
|
210
210
|
steered: rootSteered,
|
|
@@ -342,7 +342,7 @@ export async function processTreeMessages(): Promise<void> {
|
|
|
342
342
|
let outputDeliverySucceeded = true;
|
|
343
343
|
for (const node of nodes.flatMap((root) => [root, ...root.children])) {
|
|
344
344
|
const task = await getTaskById(node.taskId);
|
|
345
|
-
if (!task || !shouldPostInlineCompletionOutput(task)) continue;
|
|
345
|
+
if (!task || !(await shouldPostInlineCompletionOutput(task))) continue;
|
|
346
346
|
|
|
347
347
|
const sent = await sendInlineTaskOutput(task);
|
|
348
348
|
if (sent) {
|
|
@@ -567,7 +567,7 @@ export async function processPendingSlackRelays(now = Date.now()): Promise<void>
|
|
|
567
567
|
// separately; cleanupCompletedTree acknowledges the durable obligation
|
|
568
568
|
// after the final tree update succeeds.
|
|
569
569
|
if (taskToTree.has(task.id)) {
|
|
570
|
-
if (!shouldPostInlineCompletionOutput(task)) {
|
|
570
|
+
if (!(await shouldPostInlineCompletionOutput(task))) {
|
|
571
571
|
notifiedCompletions.set(task.id, now);
|
|
572
572
|
continue;
|
|
573
573
|
}
|
|
@@ -50,7 +50,7 @@ async function getDetails(event: DetailsEvent, client: WebClient): Promise<Detai
|
|
|
50
50
|
if (task.slackChannelId !== event.channel) return { error: { status: "restricted" } };
|
|
51
51
|
|
|
52
52
|
const agent = task.agentId ? await getAgentById(task.agentId) : null;
|
|
53
|
-
const prose = slackTaskOutput(task) || task.failureReason || task.progress;
|
|
53
|
+
const prose = (await slackTaskOutput(task)) || task.failureReason || task.progress;
|
|
54
54
|
// The card text joins the prose before truncate(), so the 2800 cap still holds.
|
|
55
55
|
const result = prose ? await withUiSpecFallback(task.id, prose) : prose;
|
|
56
56
|
return {
|
package/src/stdio.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
2
2
|
import { createServer } from "@/server";
|
|
3
3
|
import { closeDb } from "./be/db";
|
|
4
|
+
import { setDeploymentEnvReader } from "./be/memory";
|
|
4
5
|
import {
|
|
5
6
|
enqueueAuditRow,
|
|
6
7
|
flushAuditBuffer,
|
|
@@ -9,12 +10,16 @@ import {
|
|
|
9
10
|
stopAuditGc,
|
|
10
11
|
stopAuditWriter,
|
|
11
12
|
} from "./be/rbac-audit";
|
|
13
|
+
import { getDeploymentEnvValue } from "./http/core";
|
|
12
14
|
import { clearAuditSink, setAuditSink } from "./rbac";
|
|
13
15
|
|
|
14
16
|
async function main() {
|
|
15
17
|
// createServer() initializes the DB, so this standalone stdio transport OWNS
|
|
16
18
|
// the database and serves the same gated tools as src/http — wire the RBAC
|
|
17
19
|
// permission-audit sink here too (DES-445 Phase 6; plan "stdio blind spot").
|
|
20
|
+
// Before any embed: the embedding provider exempts only the deployment env's
|
|
21
|
+
// base URL from the SSRF check (same as src/http/index.ts).
|
|
22
|
+
setDeploymentEnvReader(getDeploymentEnvValue);
|
|
18
23
|
const server = await createServer();
|
|
19
24
|
setAuditSink(enqueueAuditRow);
|
|
20
25
|
startAuditWriter();
|
|
@@ -4,6 +4,10 @@ import {
|
|
|
4
4
|
getAgentModelDisplay,
|
|
5
5
|
getAgentModelPresentation,
|
|
6
6
|
} from "../../apps/ui/src/lib/agents-list-model-display";
|
|
7
|
+
import { loadModelsSnapshot } from "../../apps/ui/src/lib/models-snapshot";
|
|
8
|
+
|
|
9
|
+
// The UI loads the models.dev snapshot lazily; these assertions read it.
|
|
10
|
+
await loadModelsSnapshot();
|
|
7
11
|
|
|
8
12
|
const liveCatalog: LiveModelsCatalog = {
|
|
9
13
|
openrouter: {
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { afterAll, beforeAll, beforeEach, describe, expect, test } from "bun:test";
|
|
2
2
|
import { unlink } from "node:fs/promises";
|
|
3
3
|
import ts from "typescript";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
getScriptAppTypes,
|
|
6
|
+
MAX_APP_TYPES_BYTES,
|
|
7
|
+
MAX_APP_TYPES_BYTES_PER_APP,
|
|
8
|
+
renderAppTypes,
|
|
9
|
+
renderAppTypesReport,
|
|
10
|
+
scriptAppTypesWarnings,
|
|
11
|
+
} from "../apps/script-types";
|
|
5
12
|
import { type AppRecord, createApp } from "../apps/store";
|
|
6
13
|
import { closeDb, getDbClient, initDb } from "../be/db";
|
|
7
14
|
|
|
@@ -32,6 +39,21 @@ function app(
|
|
|
32
39
|
};
|
|
33
40
|
}
|
|
34
41
|
|
|
42
|
+
/** Default-cap max-size models (50) with 40-character column names; 400 columns overflows one app's budget. */
|
|
43
|
+
function maxSizeDefinition(columns: number) {
|
|
44
|
+
const columnDefs = Object.fromEntries(
|
|
45
|
+
Array.from({ length: columns }, (_, index) => [
|
|
46
|
+
`c${String(index).padStart(39, "0")}`,
|
|
47
|
+
{ kind: "string" },
|
|
48
|
+
]),
|
|
49
|
+
);
|
|
50
|
+
return {
|
|
51
|
+
models: Object.fromEntries(
|
|
52
|
+
Array.from({ length: 50 }, (_, index) => [`model${index}`, { columns: columnDefs }]),
|
|
53
|
+
),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
35
57
|
function issueDefinition() {
|
|
36
58
|
return {
|
|
37
59
|
models: {
|
|
@@ -209,36 +231,61 @@ describe("renderAppTypes", () => {
|
|
|
209
231
|
});
|
|
210
232
|
|
|
211
233
|
test("keeps oldest apps first and omits whole later apps within the byte budget", () => {
|
|
212
|
-
const
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
234
|
+
const maxSize = maxSizeDefinition(200);
|
|
235
|
+
const report = renderAppTypesReport([
|
|
236
|
+
app("Huge", maxSizeDefinition(400)),
|
|
237
|
+
...["First", "Second", "Third", "Fourth", "Fifth", "Sixth", "Seventh", "Eighth"].map((name) =>
|
|
238
|
+
app(name, maxSize),
|
|
216
239
|
),
|
|
217
|
-
};
|
|
218
|
-
const rendered = renderAppTypes([
|
|
219
|
-
app("First", definition),
|
|
220
|
-
app("Second", definition),
|
|
221
|
-
app("Third", definition),
|
|
222
|
-
app("Fourth", definition),
|
|
223
240
|
]);
|
|
241
|
+
const rendered = report.source;
|
|
224
242
|
|
|
225
243
|
expect(new TextEncoder().encode(rendered).byteLength).toBeLessThanOrEqual(MAX_APP_TYPES_BYTES);
|
|
244
|
+
// A max-size app at the default caps keeps its types; one past the per-app budget does not.
|
|
226
245
|
expect(rendered).toContain("namespace App_First");
|
|
246
|
+
expect(rendered).toContain("namespace App_Seventh");
|
|
247
|
+
expect(rendered).not.toContain("namespace App_Huge");
|
|
227
248
|
expect(rendered).toContain("omitted (type budget)");
|
|
228
|
-
expect(rendered).toContain("
|
|
249
|
+
expect(rendered).toContain("Huge (Huge-id), Eighth (Eighth-id)");
|
|
229
250
|
expect(rendered).toContain("call app-get for their shape");
|
|
251
|
+
expect(report.omitted.map(({ id, budget }) => ({ id, budget }))).toEqual([
|
|
252
|
+
{ id: "Huge-id", budget: "per-app" },
|
|
253
|
+
{ id: "Eighth-id", budget: "total" },
|
|
254
|
+
]);
|
|
255
|
+
expect(report.omitted[0]!.bytes).toBeGreaterThan(MAX_APP_TYPES_BYTES_PER_APP);
|
|
256
|
+
|
|
257
|
+
const warnings = scriptAppTypesWarnings(
|
|
258
|
+
'ctx.swarm.app_query({ appId: "Eighth-id", query: "q" }); type T = App_Huge.Model0;',
|
|
259
|
+
report.omitted,
|
|
260
|
+
);
|
|
261
|
+
expect(warnings).toHaveLength(2);
|
|
262
|
+
expect(warnings[0]).toContain('App "Huge" (Huge-id) has no generated script types');
|
|
263
|
+
expect(warnings[0]).toContain("per-app budget");
|
|
264
|
+
expect(warnings[1]).toContain("swarm-wide budget");
|
|
265
|
+
expect(scriptAppTypesWarnings("App_Huge_2 First-id", report.omitted)).toEqual([]);
|
|
266
|
+
|
|
267
|
+
// A script's typecheck renders only the apps it names, so other apps cost it nothing.
|
|
268
|
+
const selected = renderAppTypesReport(
|
|
269
|
+
[app("First", maxSize), app("Eighth", issueDefinition())],
|
|
270
|
+
(candidate) => candidate.id === "Eighth-id",
|
|
271
|
+
).source;
|
|
272
|
+
expect(selected).toContain("namespace App_Eighth");
|
|
273
|
+
expect(selected).not.toContain("namespace App_First");
|
|
274
|
+
expect(selected).toContain("SwarmAppQueryResult");
|
|
230
275
|
});
|
|
231
276
|
|
|
232
277
|
test("stays within the byte budget even when metadata alone is pathological", () => {
|
|
233
|
-
const
|
|
278
|
+
const small = {
|
|
234
279
|
models: { issue: { columns: { title: { kind: "string" } } } },
|
|
235
280
|
queries: Object.fromEntries(
|
|
236
281
|
Array.from({ length: 45 }, (_, index) => [`query${index}`, { model: "issue" }]),
|
|
237
282
|
),
|
|
238
283
|
};
|
|
239
|
-
const
|
|
240
|
-
|
|
241
|
-
|
|
284
|
+
const maxSize = maxSizeDefinition(200);
|
|
285
|
+
const manyOmitted = renderAppTypes([
|
|
286
|
+
...Array.from({ length: 7 }, (_, index) => app(`Big${index}`, maxSize)),
|
|
287
|
+
...Array.from({ length: 40 }, (_, index) => app(`Bulk${index}`, small)),
|
|
288
|
+
]);
|
|
242
289
|
expect(new TextEncoder().encode(manyOmitted).byteLength).toBeLessThanOrEqual(
|
|
243
290
|
MAX_APP_TYPES_BYTES,
|
|
244
291
|
);
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { describe, expect, spyOn, test } from "bun:test";
|
|
2
|
+
import type { AppRow } from "../apps/row-store";
|
|
3
|
+
import { sortRowsByColumn } from "../http/apps";
|
|
4
|
+
|
|
5
|
+
// Reference copy of the pre-change comparator (Date.parse per comparison).
|
|
6
|
+
function oldCompare(left: unknown, right: unknown, direction: "asc" | "desc", dateValues: boolean) {
|
|
7
|
+
if (left === right) return 0;
|
|
8
|
+
if (left === undefined || left === null) return 1;
|
|
9
|
+
if (right === undefined || right === null) return -1;
|
|
10
|
+
let result: number;
|
|
11
|
+
if (dateValues && typeof left === "string" && typeof right === "string") {
|
|
12
|
+
result = Date.parse(left) - Date.parse(right);
|
|
13
|
+
} else if (typeof left === "number" && typeof right === "number") {
|
|
14
|
+
result = left - right;
|
|
15
|
+
} else if (typeof left === "boolean" && typeof right === "boolean") {
|
|
16
|
+
result = Number(left) - Number(right);
|
|
17
|
+
} else {
|
|
18
|
+
result = String(left).localeCompare(String(right));
|
|
19
|
+
}
|
|
20
|
+
return direction === "asc" ? result : -result;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function seededRows(n: number): AppRow[] {
|
|
24
|
+
let seed = 42;
|
|
25
|
+
const rand = () => {
|
|
26
|
+
seed = (seed * 1664525 + 1013904223) % 4294967296;
|
|
27
|
+
return seed / 4294967296;
|
|
28
|
+
};
|
|
29
|
+
const pool: unknown[] = [
|
|
30
|
+
null,
|
|
31
|
+
undefined,
|
|
32
|
+
"not a date",
|
|
33
|
+
7,
|
|
34
|
+
true,
|
|
35
|
+
false,
|
|
36
|
+
"2026-01-01T00:00:00.000Z",
|
|
37
|
+
"2026-01-01T00:00:00Z", // same instant, different string
|
|
38
|
+
];
|
|
39
|
+
return Array.from({ length: n }, (_, i) => {
|
|
40
|
+
const r = rand();
|
|
41
|
+
const value =
|
|
42
|
+
r < 0.5
|
|
43
|
+
? new Date(1_700_000_000_000 + Math.floor(rand() * 40) * 3_600_000).toISOString()
|
|
44
|
+
: pool[Math.floor(rand() * pool.length)];
|
|
45
|
+
const row: AppRow = { id: String(i) };
|
|
46
|
+
if (value !== undefined) row.at = value as never;
|
|
47
|
+
return row;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
describe("sortRowsByColumn", () => {
|
|
52
|
+
for (const dir of ["asc", "desc"] as const) {
|
|
53
|
+
for (const dateValues of [true, false]) {
|
|
54
|
+
test(`matches the old comparator order (${dir}, dateValues=${dateValues})`, () => {
|
|
55
|
+
const rows = seededRows(500);
|
|
56
|
+
const expected = [...rows].sort((a, b) => oldCompare(a.at, b.at, dir, dateValues));
|
|
57
|
+
const actual = sortRowsByColumn(rows, "at", dir, dateValues);
|
|
58
|
+
expect(actual.map((r) => r.id)).toEqual(expected.map((r) => r.id));
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
test("does not mutate its input and keeps ties stable", () => {
|
|
64
|
+
const rows: AppRow[] = [
|
|
65
|
+
{ id: "a", at: "2026-01-01T00:00:00Z" },
|
|
66
|
+
{ id: "b", at: "2026-01-01T00:00:00.000Z" },
|
|
67
|
+
{ id: "c", at: "2025-01-01T00:00:00Z" },
|
|
68
|
+
];
|
|
69
|
+
const sorted = sortRowsByColumn(rows, "at", "asc", true);
|
|
70
|
+
expect(sorted.map((r) => r.id)).toEqual(["c", "a", "b"]);
|
|
71
|
+
expect(rows.map((r) => r.id)).toEqual(["a", "b", "c"]);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
test("parses each date once, not per comparison", () => {
|
|
75
|
+
const rows = seededRows(5000).map((r, i) => ({
|
|
76
|
+
id: r.id,
|
|
77
|
+
at: new Date(1_700_000_000_000 + ((i * 7919) % 5000) * 60_000).toISOString(),
|
|
78
|
+
}));
|
|
79
|
+
const spy = spyOn(Date, "parse");
|
|
80
|
+
try {
|
|
81
|
+
sortRowsByColumn(rows, "at", "desc", true);
|
|
82
|
+
expect(spy.mock.calls.length).toBe(rows.length);
|
|
83
|
+
} finally {
|
|
84
|
+
spy.mockRestore();
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
});
|
|
@@ -16,6 +16,10 @@ import {
|
|
|
16
16
|
type LiveBedrockStatus,
|
|
17
17
|
modelGroupsForHarness,
|
|
18
18
|
} from "../../apps/ui/src/lib/agent-runtime-models";
|
|
19
|
+
import { loadModelsSnapshot } from "../../apps/ui/src/lib/models-snapshot";
|
|
20
|
+
|
|
21
|
+
// The UI loads the models.dev snapshot lazily; these assertions read it.
|
|
22
|
+
await loadModelsSnapshot();
|
|
19
23
|
|
|
20
24
|
describe("modelGroupsForHarness — Bedrock group for pi harness", () => {
|
|
21
25
|
const configs = undefined;
|
|
@@ -300,6 +300,15 @@ describe("Channel Activity — fetchChannelActivity", () => {
|
|
|
300
300
|
expect(texts).not.toContain("Own bot msg");
|
|
301
301
|
expect(texts).not.toContain("Thread reply");
|
|
302
302
|
expect(texts).not.toContain("No user");
|
|
303
|
+
|
|
304
|
+
// With a sender allowlist, only listed users reach the lead.
|
|
305
|
+
process.env.SLACK_ALLOWED_USER_IDS = "U333";
|
|
306
|
+
try {
|
|
307
|
+
const filtered = await fetchChannelActivity(cursors, ["C001"]);
|
|
308
|
+
expect(filtered.messages.map((m) => m.text)).toEqual(["Thread parent"]);
|
|
309
|
+
} finally {
|
|
310
|
+
delete process.env.SLACK_ALLOWED_USER_IDS;
|
|
311
|
+
}
|
|
303
312
|
});
|
|
304
313
|
|
|
305
314
|
test("allowedChannelIds restricts which channels are processed", async () => {
|
|
@@ -12,6 +12,10 @@ import {
|
|
|
12
12
|
findKnownModel,
|
|
13
13
|
modelGroupsForHarness,
|
|
14
14
|
} from "../../apps/ui/src/lib/agent-runtime-models";
|
|
15
|
+
import { loadModelsSnapshot } from "../../apps/ui/src/lib/models-snapshot";
|
|
16
|
+
|
|
17
|
+
// The UI loads the models.dev snapshot lazily; these assertions read it.
|
|
18
|
+
await loadModelsSnapshot();
|
|
15
19
|
|
|
16
20
|
function configRow(key: string, value: string): SwarmConfig {
|
|
17
21
|
return { key, value } as SwarmConfig;
|
|
@@ -108,6 +108,8 @@ async function runHook(
|
|
|
108
108
|
const env: Record<string, string | undefined> = {
|
|
109
109
|
...process.env,
|
|
110
110
|
CLAUDE_PROJECT_DIR: projectDir,
|
|
111
|
+
// A worker container's /workspace/.mcp.json would otherwise win over the fake API.
|
|
112
|
+
HOOK_WORKSPACE_DIR: projectDir,
|
|
111
113
|
TASK_FILE: taskFile,
|
|
112
114
|
CONTEXT_BOUND_NOTE_TOKENS: undefined,
|
|
113
115
|
...extraEnv,
|
|
@@ -815,16 +815,28 @@ describe("ClaudeManagedAdapter (Phase 4) — repo provisioning + cost data", ()
|
|
|
815
815
|
delete process.env.MANAGED_MCP_VAULT_ID;
|
|
816
816
|
});
|
|
817
817
|
|
|
818
|
-
test("normalizeRepoUrl:
|
|
818
|
+
test("normalizeRepoUrl: accepts github.com URLs and owner/repo shorthand, refuses other URLs", () => {
|
|
819
819
|
expect(normalizeRepoUrl("https://github.com/desplega-ai/agent-swarm")).toBe(
|
|
820
820
|
"https://github.com/desplega-ai/agent-swarm",
|
|
821
821
|
);
|
|
822
|
+
expect(normalizeRepoUrl("https://github.com/desplega-ai/agent-swarm.git")).toBe(
|
|
823
|
+
"https://github.com/desplega-ai/agent-swarm.git",
|
|
824
|
+
);
|
|
822
825
|
expect(normalizeRepoUrl("desplega-ai/agent-swarm")).toBe(
|
|
823
826
|
"https://github.com/desplega-ai/agent-swarm",
|
|
824
827
|
);
|
|
825
|
-
|
|
828
|
+
for (const url of [
|
|
826
829
|
"http://gitlab.example.com/foo/bar",
|
|
827
|
-
|
|
830
|
+
"https://gitlab.example.com/foo/bar",
|
|
831
|
+
"http://github.com/foo/bar",
|
|
832
|
+
"https://github.com@example.com/foo/bar",
|
|
833
|
+
"https://user:pass@github.com/foo/bar",
|
|
834
|
+
"https://github.com:8443/foo/bar",
|
|
835
|
+
"https://github.com/foo",
|
|
836
|
+
"https://github.com/foo/bar/tree/main",
|
|
837
|
+
]) {
|
|
838
|
+
expect(() => normalizeRepoUrl(url)).toThrow("https://github.com/<owner>/<repo>");
|
|
839
|
+
}
|
|
828
840
|
});
|
|
829
841
|
|
|
830
842
|
test("createSession includes resources[github_repository] when config.vcsRepo is set", async () => {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import { spawnClaudeSdkProcess } from "../providers/claude-sdk-session";
|
|
4
|
+
|
|
5
|
+
describe("Claude SDK stderr forwarding", () => {
|
|
6
|
+
test("forwards whole lines when a write splits a line, then the unterminated tail", async () => {
|
|
7
|
+
const received: string[] = [];
|
|
8
|
+
const proc = spawnClaudeSdkProcess(
|
|
9
|
+
{
|
|
10
|
+
command: "/bin/sh",
|
|
11
|
+
args: [
|
|
12
|
+
"-c",
|
|
13
|
+
"printf 'token=abc' >&2; sleep 0.2; printf 'def\\nnext\\n' >&2; printf tail >&2",
|
|
14
|
+
],
|
|
15
|
+
cwd: tmpdir(),
|
|
16
|
+
env: { PATH: process.env.PATH ?? "/usr/bin:/bin" },
|
|
17
|
+
signal: new AbortController().signal,
|
|
18
|
+
},
|
|
19
|
+
[],
|
|
20
|
+
[],
|
|
21
|
+
[],
|
|
22
|
+
(text) => received.push(text),
|
|
23
|
+
);
|
|
24
|
+
await proc.exited;
|
|
25
|
+
await proc.stderrDone;
|
|
26
|
+
expect(received).toEqual(["token=abcdef\nnext\n", "tail"]);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { describe, expect, test } from "bun:test";
|
|
2
2
|
import { modelGroupsForHarness } from "../../apps/ui/src/lib/agent-runtime-models";
|
|
3
|
+
import { loadModelsSnapshot } from "../../apps/ui/src/lib/models-snapshot";
|
|
3
4
|
import { buildModelsCatalog } from "../be/models-catalog";
|
|
4
5
|
import cache from "../be/modelsdev-cache.json";
|
|
5
6
|
import { buildModelsDevSeedRows } from "../be/seed-pricing";
|
|
@@ -12,6 +13,9 @@ import {
|
|
|
12
13
|
} from "../providers/codex-models";
|
|
13
14
|
import { applyReasoningEffort, reasoningCapability } from "../providers/reasoning-effort";
|
|
14
15
|
|
|
16
|
+
// The UI loads the models.dev snapshot lazily; these assertions read it.
|
|
17
|
+
await loadModelsSnapshot();
|
|
18
|
+
|
|
15
19
|
const releases = [
|
|
16
20
|
{ id: "gpt-6-sol", label: "GPT-6 Sol", input: 2, output: 10, read: 0.2, write: 2.5 },
|
|
17
21
|
{ id: "gpt-6-luna", label: "GPT-6 Luna", input: 0.1, output: 0.5, read: 0.01, write: 0.125 },
|
|
@@ -844,16 +844,29 @@ describe("POST /api/comb/review-batches", () => {
|
|
|
844
844
|
expect(COMB_NOTE_MAX).toBe(REVIEW_NOTE_MAX);
|
|
845
845
|
});
|
|
846
846
|
|
|
847
|
-
test("
|
|
847
|
+
test("keeps a follow-up on the parent agent and answers 409 on a repeat", async () => {
|
|
848
848
|
const ids = [fake.add({ body: "@swarm a" }).id, fake.add({ body: "@swarm b" }).id];
|
|
849
849
|
|
|
850
|
-
const
|
|
850
|
+
const worker = await createAgent({ name: "review-author", status: "idle" });
|
|
851
|
+
await db.updateAgentProfile(worker.id, { capabilities: ["review"] });
|
|
852
|
+
const parent = await createTaskWithSiblingAwareness("Write a review", {
|
|
853
|
+
agentId: worker.id,
|
|
854
|
+
routingAffinity: { capabilities: ["review"] },
|
|
855
|
+
});
|
|
856
|
+
const input = { ...batch(ids, "/comb-qa/"), parentTaskId: parent.id };
|
|
857
|
+
const other = await createAgent({ name: "other-worker", status: "idle" });
|
|
858
|
+
expect((await post(input, { "X-Agent-ID": other.id })).status).toBe(403);
|
|
859
|
+
const created = await post(input);
|
|
851
860
|
expect(created.status).toBe(201);
|
|
852
861
|
const result = (await created.json()) as ReviewBatchResult;
|
|
853
862
|
expect(result.sent).toEqual(ids);
|
|
854
|
-
|
|
863
|
+
const child = await getTaskById(result.taskId as string);
|
|
864
|
+
expect(child?.task).toContain("Scope: /comb-qa/ (");
|
|
865
|
+
expect(child?.parentTaskId).toBe(parent.id);
|
|
866
|
+
expect(child?.agentId).toBe(worker.id);
|
|
867
|
+
expect(child?.routingAffinity?.capabilities).toEqual([]);
|
|
855
868
|
|
|
856
|
-
const again = await
|
|
869
|
+
const again = await post(input);
|
|
857
870
|
expect(again.status).toBe(409);
|
|
858
871
|
expect(((await again.json()) as { skipped: unknown[] }).skipped).toEqual(
|
|
859
872
|
ids.map((id) => ({ id, reason: "already-sent", taskId: result.taskId })),
|
|
@@ -40,22 +40,28 @@ describe("db-client basics", () => {
|
|
|
40
40
|
// cannot begin executing until it commits. Wall time around the call
|
|
41
41
|
// therefore includes that queueing — which is what made a caller-side
|
|
42
42
|
// measurement report a responsive process as stalled for multiple seconds.
|
|
43
|
+
let holderDoneAt = 0;
|
|
43
44
|
const holding = client.transaction(async (tx) => {
|
|
44
45
|
await tx.run("INSERT INTO items (name) VALUES (?)", ["holder"]);
|
|
45
46
|
await Bun.sleep(250);
|
|
47
|
+
holderDoneAt = performance.now();
|
|
46
48
|
});
|
|
47
49
|
const startedAt = performance.now();
|
|
48
50
|
const timed = await client.runTimed("INSERT INTO items (name) VALUES (?)", ["queued"]);
|
|
49
|
-
const
|
|
51
|
+
const endedAt = performance.now();
|
|
50
52
|
await holding;
|
|
51
53
|
|
|
52
54
|
expect(timed.changes).toBe(1);
|
|
53
55
|
// It really did wait out the holder...
|
|
54
|
-
expect(
|
|
55
|
-
// ...but only the driver call itself is charged to the statement.
|
|
56
|
-
//
|
|
56
|
+
expect(endedAt - startedAt).toBeGreaterThan(200);
|
|
57
|
+
// ...but only the driver call itself is charged to the statement. The
|
|
58
|
+
// driver call cannot start before the holder's callback returns, so it
|
|
59
|
+
// fits inside [holderDoneAt, endedAt]; charging the queueing would exceed
|
|
60
|
+
// that window by the ~250ms wait. Not an absolute bound: a GC pause or a
|
|
61
|
+
// starved CI runner can make one INSERT take tens of ms.
|
|
62
|
+
expect(holderDoneAt).toBeGreaterThan(startedAt);
|
|
57
63
|
expect(timed.executionMs).toBeGreaterThan(0);
|
|
58
|
-
expect(timed.executionMs).
|
|
64
|
+
expect(timed.executionMs).toBeLessThanOrEqual(endedAt - holderDoneAt);
|
|
59
65
|
});
|
|
60
66
|
|
|
61
67
|
test("get supports RETURNING", async () => {
|
|
@@ -448,6 +448,7 @@ value:getWorkflowRunStep
|
|
|
448
448
|
value:getWorkflowRunStepsByRunId
|
|
449
449
|
value:getWorkflowVersion
|
|
450
450
|
value:getWorkflowVersions
|
|
451
|
+
value:getWorkflowsByEventName
|
|
451
452
|
value:getWorkflowsByScheduleId
|
|
452
453
|
value:giveUpStaleChatRelays
|
|
453
454
|
value:hasBudgetRefusalNotificationToday
|
|
@@ -471,6 +471,7 @@ value:getWorkflowRunStep
|
|
|
471
471
|
value:getWorkflowRunStepsByRunId
|
|
472
472
|
value:getWorkflowVersion
|
|
473
473
|
value:getWorkflowVersions
|
|
474
|
+
value:getWorkflowsByEventName
|
|
474
475
|
value:getWorkflowsByScheduleId
|
|
475
476
|
value:giveUpStaleChatRelays
|
|
476
477
|
value:hasBudgetRefusalNotificationToday
|
|
@@ -1173,8 +1174,7 @@ upsertSkillFile
|
|
|
1173
1174
|
upsertSkillFileUnchecked
|
|
1174
1175
|
upsertSkillFiles
|
|
1175
1176
|
upsertSwarmConfig
|
|
1176
|
-
withFavoriteFlags
|
|
1177
|
-
writeEnvFile`.split("\n");
|
|
1177
|
+
withFavoriteFlags`.split("\n");
|
|
1178
1178
|
|
|
1179
1179
|
test("complete facade, selected public bindings and internal-only manifest remain exact", async () => {
|
|
1180
1180
|
const facade = await Bun.file(new URL("../be/db.ts", import.meta.url)).text();
|