@desplega.ai/agent-swarm 2.12.0 → 2.13.1
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-xtj40wd8.js +17 -0
- package/dist/{acp-targets-311gcyvw.js → acp-targets-n7vm5atw.js} +10 -9
- package/dist/{actions-c4chgxp6.js → actions-hq6wp9xv.js} +28 -27
- package/dist/{agent-fs-provision-0b9awm5n.js → agent-fs-provision-y0qc1rdd.js} +4 -4
- package/dist/{amp-adapter-r0veq6x5.js → amp-adapter-1qqs6h91.js} +3 -3
- package/dist/{app-hn5fftf5.js → app-7m4z44rv.js} +10 -8
- package/dist/{approval-notifications-3g6yc8nv.js → approval-notifications-8sr41gjx.js} +11 -10
- package/dist/{assistant-cpjgpjvp.js → assistant-hkczwfv6.js} +29 -28
- package/dist/{boot-args-schema-hce1av1h.js → boot-args-schema-8025snev.js} +1 -1
- package/dist/{boot-reembed-bztbxc4z.js → boot-reembed-15m87nr1.js} +5 -2
- package/dist/{boot-reembed-d7xcym0j.js → boot-reembed-4bbpxjh1.js} +1 -1
- package/dist/{boot-scrub-sweep-mkmm16gk.js → boot-scrub-sweep-eajr97e9.js} +2 -2
- package/dist/{boot-seeds-arrkbe8t.js → boot-seeds-9cwy39jx.js} +4 -4
- package/dist/{boxd-68n75y1s.js → boxd-hr8rsxzq.js} +1 -1
- package/dist/{claude-adapter-ykpyr5p8.js → claude-adapter-g61wa4rt.js} +9 -8
- package/dist/{claude-managed-adapter-ssg6z4bt.js → claude-managed-adapter-znkk0prm.js} +4 -4
- package/dist/{claude-managed-setup-trd59v7b.js → claude-managed-setup-f1wndkr2.js} +7 -7
- package/dist/{claude-sdk-session-yjcze0j1.js → claude-sdk-session-687xzf21.js} +20763 -19380
- package/dist/{cli-ya3kf4gs.js → cli-04103ryh.js} +1 -1
- package/dist/{cli-55tc8cj4.js → cli-0a336ze7.js} +5 -5
- package/dist/{cli-q8tc22bj.js → cli-0fx95c06.js} +5 -5
- package/dist/{cli-mq2fbgva.js → cli-0m77n7ej.js} +3 -3
- package/dist/{cli-7yn42w6m.js → cli-0xwb7zpt.js} +2 -2
- package/dist/{cli-mcymtvwn.js → cli-13t0smbk.js} +1000 -28
- package/dist/{cli-c7j31hq9.js → cli-1b5axkt1.js} +4 -4
- package/dist/{cli-yegz2g06.js → cli-1carhg8g.js} +4 -4
- package/dist/{cli-j5gtytvg.js → cli-1dr5at77.js} +15 -12
- package/dist/cli-2v4xxnx2.js +148 -0
- package/dist/{cli-sv2r3bw8.js → cli-32xndx6b.js} +7 -7
- package/dist/{cli-h70a2mxy.js → cli-3m8vqehw.js} +53 -13
- package/dist/{cli-ercwc8xn.js → cli-3mf04tkh.js} +1 -1
- package/dist/{cli-52nfye5j.js → cli-3zyme1wt.js} +24 -16
- package/dist/{cli-s6zk31gr.js → cli-43dsqhcp.js} +4 -4
- package/dist/{cli-b93d81yg.js → cli-4h90xaet.js} +2 -2
- package/dist/{cli-5tg94mdw.js → cli-4mj5g29m.js} +9 -12
- package/dist/{cli-47hz21se.js → cli-4tbvndmm.js} +4 -5
- package/dist/{cli-r0mz92by.js → cli-50whymxq.js} +2 -2
- package/dist/{cli-js10kdk7.js → cli-5basv0e7.js} +19 -5
- package/dist/{cli-krbcr00p.js → cli-5v6b2am8.js} +59 -5
- package/dist/{cli-en6dmkxd.js → cli-6r1dwegd.js} +3 -3
- package/dist/{cli-9qe5y107.js → cli-7ewre3dm.js} +15 -6
- package/dist/{cli-n3qe7tyr.js → cli-84xtgbn6.js} +35 -2
- package/dist/{cli-xm34qj8m.js → cli-8cmjkbvj.js} +2 -2
- package/dist/{cli-2m6yaq6b.js → cli-8fj8yfmk.js} +1 -1
- package/dist/{cli-nja15knq.js → cli-8rbkw18r.js} +3 -3
- package/dist/{cli-x05p2d05.js → cli-9tevdxyf.js} +1 -1
- package/dist/{cli-hhc47ack.js → cli-9xx36trj.js} +4 -4
- package/dist/{cli-39qm0rtm.js → cli-a8ts6x1n.js} +29 -150
- package/dist/{cli-bp6k9acz.js → cli-aebswqmz.js} +18 -18
- package/dist/{cli-ex1y88j3.js → cli-at67kvnp.js} +1 -1
- package/dist/{cli-q2dywc8h.js → cli-bjmq14k9.js} +4 -4
- package/dist/{cli-v9ya390t.js → cli-byxsctca.js} +12 -12
- package/dist/{cli-bz97ff9n.js → cli-c0tyzt73.js} +152 -12
- package/dist/{cli-fyaq4zdv.js → cli-c8kqmzzf.js} +9 -9
- package/dist/{cli-t75xngj1.js → cli-cd9acnvd.js} +12 -12
- package/dist/{cli-eqq0hwvx.js → cli-cmgdptmx.js} +3 -3
- package/dist/{cli-r14ac1y0.js → cli-cn6fpa1p.js} +1 -1
- package/dist/{cli-0k1a0sde.js → cli-cp0m07wb.js} +10 -10
- package/dist/{cli-3p288654.js → cli-cpkxh68d.js} +2 -2
- package/dist/{cli-fxd1mwtr.js → cli-cqxwjb93.js} +2 -2
- package/dist/{cli-8hp56wat.js → cli-d2epqm0y.js} +1 -1
- package/dist/{cli-73q4g5nx.js → cli-dd57p1gd.js} +21 -21
- package/dist/{cli-5z0g0e8v.js → cli-f8rcvf2x.js} +49 -13
- package/dist/{cli-wvjqaqcp.js → cli-fn8aj7gb.js} +1330 -249
- package/dist/{cli-bpje8n65.js → cli-fp65jdp2.js} +31 -6
- package/dist/{cli-0pp1yjg2.js → cli-gedf48yw.js} +11 -11
- package/dist/{cli-m5qtmrbc.js → cli-gq6qhmrr.js} +2 -2
- package/dist/{cli-5x03v6en.js → cli-grcc2h2g.js} +8 -8
- package/dist/{cli-01tvvtad.js → cli-h03j6je3.js} +4 -4
- package/dist/{cli-mbwmqb5w.js → cli-h0ewec3d.js} +1 -1
- package/dist/{cli-12vek61e.js → cli-h9bejmkf.js} +535 -146
- package/dist/{cli-gfy6hbd9.js → cli-hs3mqswp.js} +18 -11
- package/dist/{cli-tdk7jtka.js → cli-hv3820ez.js} +1 -1
- package/dist/{cli-pqfecppn.js → cli-je587f74.js} +1 -1
- package/dist/{cli-cjqyse9q.js → cli-jhtvt7gn.js} +3 -3
- package/dist/{cli-dkvtfgn4.js → cli-mmw2sjaf.js} +76 -17
- package/dist/{cli-2z2c4k6q.js → cli-mwxez0pz.js} +22 -0
- package/dist/{cli-yfpc6qy9.js → cli-nk8swfpx.js} +47 -16
- package/dist/{cli-eq4kew31.js → cli-p7g7wd9n.js} +26 -13
- package/dist/{cli-bhgrhedp.js → cli-q8aq48v1.js} +1 -1
- package/dist/{cli-dd2k2mcd.js → cli-qn79645p.js} +1 -1
- package/dist/{cli-ma9ys8rt.js → cli-qx1dwrr5.js} +7 -4
- package/dist/{cli-tm60vtax.js → cli-rfejbpe1.js} +1 -1
- package/dist/{cli-agjbj5x0.js → cli-s6fhqbz1.js} +38 -20
- package/dist/{cli-kwr5qv5g.js → cli-sfajkbd7.js} +2 -2
- package/dist/{cli-9y4tgrkf.js → cli-skd2c4ej.js} +2 -1
- package/dist/{cli-e8n0hdzd.js → cli-snypfjgj.js} +1 -1
- package/dist/{cli-n8f0fs3c.js → cli-t25rq8mg.js} +11 -11
- package/dist/{cli-72yms3ey.js → cli-t90k0phh.js} +201 -21
- package/dist/{cli-xf4z5bdn.js → cli-tzzas8rb.js} +4 -4
- package/dist/{cli-rtmqzat7.js → cli-vdfngx2g.js} +2 -2
- package/dist/{cli-9w8712tq.js → cli-vr4eyq6p.js} +43 -14
- package/dist/{cli-z4f346g5.js → cli-vx9acp12.js} +1 -1
- package/dist/{cli-2amwhyv2.js → cli-w24f3j49.js} +13 -11
- package/dist/cli-w41bvvms.js +148 -0
- package/dist/{cli-04zc3f7b.js → cli-w6c6dj91.js} +1 -1
- package/dist/{cli-fy4gb74g.js → cli-x5yb8zc8.js} +2 -2
- package/dist/{cli-2tw284hj.js → cli-xhkek467.js} +3 -3
- package/dist/{cli-5r95eqbh.js → cli-y260hgep.js} +1 -1
- package/dist/{cli-hbvgzjq4.js → cli-y6qqbpwc.js} +3 -3
- package/dist/{cli-7wy8gbwb.js → cli-ya1cj689.js} +1 -1
- package/dist/{cli-1htmtqc2.js → cli-yeh3g1q6.js} +620 -95
- package/dist/{cli-0vcqcwfn.js → cli-yfvhvw8m.js} +2 -0
- package/dist/{cli-k5jx8jya.js → cli-z6m6xzxt.js} +2 -2
- package/dist/{cli-pe3yxedk.js → cli-zaate0rd.js} +3 -3
- package/dist/{cli-n85m2wkq.js → cli-zkbz8m2q.js} +3 -2
- package/dist/{cli-e3ahxq5y.js → cli-zvpkrgsc.js} +6 -6
- package/dist/cli.js +30 -28
- package/dist/{codex-adapter-wc6e4wct.js → codex-adapter-ysfg6ty3.js} +8 -8
- package/dist/{codex-hook-aqtj17yr.js → codex-hook-c0nvm30r.js} +73 -2
- package/dist/{codex-login-1ven7yje.js → codex-login-ven5cz5j.js} +1 -1
- package/dist/{codex-session-runner-ppfgjd97.js → codex-session-runner-823scr6g.js} +9 -9
- package/dist/{commands-tsv2vx5b.js → commands-5rbm07fz.js} +3 -3
- package/dist/{controller-ye4sdwsy.js → controller-wn3vd217.js} +4 -4
- package/dist/{controllers-connect-zn4dg69h.js → controllers-connect-34jzhfft.js} +29 -28
- package/dist/core-kdehq26g.js +42 -0
- package/dist/{cursor-adapter-q2g9vwts.js → cursor-adapter-w1681kp1.js} +2 -2
- package/dist/{db-g111qn9j.js → db-6bkgbfwk.js} +3 -3
- package/dist/{db-3r1fyr2n.js → db-hcj16x7z.js} +4 -2
- package/dist/{devin-adapter-t8d86q9x.js → devin-adapter-fs90ab4v.js} +1 -1
- package/dist/{dispatcher-4q8s0mx8.js → dispatcher-jgjqrfzv.js} +28 -25
- package/dist/{docker-1b41eysj.js → docker-1h33jvh9.js} +2 -2
- package/dist/{dsh-adapter-mmcw1z5s.js → dsh-adapter-g9yqv09y.js} +2 -2
- package/dist/{e2b-xm60c8ad.js → e2b-jnk0yeva.js} +2 -2
- package/dist/{e2b-ew8c5j5v.js → e2b-y7e5kmzf.js} +2 -2
- package/dist/{easter-egg-3d-04ke6hcp.js → easter-egg-3d-w17nsny6.js} +1 -1
- package/dist/{embedding-space-kcdn52vz.js → embedding-space-v06fwy7b.js} +6 -6
- package/dist/{embeddings-jnzcd91a.js → embeddings-g50dxea4.js} +1 -1
- package/dist/{event-bus-v4ywhc2p.js → event-bus-08t2b4y2.js} +1 -1
- package/dist/{execute-74amghty.js → execute-1n36haw1.js} +1 -1
- package/dist/{external-channel-v9zgxnxz.js → external-channel-43tv8pg6.js} +2 -2
- package/dist/fx-adapter-bvh05t4a.js +20 -0
- package/dist/grok-adapter-my5j8mdf.js +20 -0
- package/dist/handlers-wyymeeqh.js +41 -0
- package/dist/heartbeat-sf3nk937.js +50 -0
- package/dist/{hook-p5reemds.js → hook-dqph1e05.js} +77 -18
- package/dist/{hook-k1h73zd7.js → hook-m1m9dm6w.js} +6 -5
- package/dist/{http-ms1z5xxy.js → http-w0th1cz9.js} +888 -226
- package/dist/index-22khdtby.js +44 -0
- package/dist/{index-76zzxtzf.js → index-c0e8en64.js} +1 -1
- package/dist/{index-620y7jzq.js → index-e8pz8qdg.js} +3 -3
- package/dist/{index-8p0j4h4j.js → index-ez823q84.js} +94 -89
- package/dist/{index-fbkqhvvj.js → index-ffba0z8q.js} +217 -165
- package/dist/{index-gjn6qfgn.js → index-gkpfgpg7.js} +1 -1
- package/dist/{index-4k7m5dgj.js → index-k8ajc0g0.js} +143 -103
- package/dist/index-np0582ac.js +40 -0
- package/dist/{index-kn63q1gr.js → index-pb03vans.js} +33 -32
- package/dist/index-vgkrj1jt.js +39 -0
- package/dist/{index-pe3d8jfy.js → index-whysn1wf.js} +1 -1
- package/dist/{index-0h6qd4p1.js → index-y4vd4mhn.js} +3 -4
- package/dist/{k8s-fy8hbhkg.js → k8s-8326q0rq.js} +2 -2
- package/dist/{keepalive-031js8jz.js → keepalive-2v06q2e8.js} +5 -4
- package/dist/lead-55z813ng.js +79 -0
- package/dist/{maintenance-sq9v3qx9.js → maintenance-vx7vjhhy.js} +1 -1
- package/dist/{oauth-refresh-sweep-zqmnyvs8.js → oauth-refresh-sweep-g06k4bza.js} +4 -3
- package/dist/{object-webhooks-r24wwb5y.js → object-webhooks-3dzdq4fm.js} +7 -7
- package/dist/{onboard-p25yhh7t.js → onboard-232pazny.js} +4 -4
- package/dist/{opencode-adapter-wcjc4zdk.js → opencode-adapter-t0paqbh8.js} +8 -7
- package/dist/{otel-impl-ff1gf20m.js → otel-impl-kmpkyp4y.js} +2 -2
- package/dist/{pending-hxj5yatb.js → pending-x0z3vx1x.js} +27 -26
- package/dist/{pi-mono-adapter-vkp4zz7p.js → pi-mono-adapter-7pmypn6d.js} +93 -22
- package/dist/{pricing-refresh-9w7gx41w.js → pricing-refresh-ytjmtyd7.js} +2 -2
- package/dist/{rbac-roles-84aw10nz.js → rbac-roles-fgm5mxr2.js} +3 -3
- package/dist/{rbac-roles-hz74vckp.js → rbac-roles-xyaxekh3.js} +7 -4
- package/dist/{registry-eeyx1201.js → registry-zv0zvxsx.js} +1 -1
- package/dist/{render-v2-nrdkg9gf.js → render-v2-ws972g4r.js} +12 -8
- package/dist/{resume-s6ey36rh.js → resume-m6mjzhkp.js} +13 -12
- package/dist/{runtime-x0b4pyam.js → runtime-zzpc0c8a.js} +1 -1
- package/dist/{session-access-xv49tk14.js → session-access-vp35xs91.js} +5 -4
- package/dist/{session-source-backfill-r5j988ah.js → session-source-backfill-p73e8zbe.js} +3 -3
- package/dist/{setup-mj0krk1p.js → setup-r4kd7rxg.js} +1 -1
- package/dist/thread-buffer-cm2nzq6t.js +42 -0
- package/dist/{tree-visibility-cbrsfaar.js → tree-visibility-07h2tbs2.js} +2 -2
- package/dist/{user-merge-jobs-f9d8nwnw.js → user-merge-jobs-96vg9rpe.js} +3 -3
- package/dist/{virtual-modules-ns0ryw05.js → virtual-modules-vgn3f2x4.js} +3 -3
- package/dist/{work-objects-pydhzast.js → work-objects-74hbcx3e.js} +31 -29
- package/dist/worker-5pn2vzx6.js +79 -0
- package/dist/{worker-follow-up-9z2xec5e.js → worker-follow-up-ezavwn5d.js} +26 -25
- package/dist/{x-3dtaf2r9.js → x-asbrnafg.js} +2 -2
- package/dist/xlsx-9acfmxr1.js +31534 -0
- package/openapi.json +2816 -1464
- package/package.json +13 -11
- package/src/agentmail/handlers.ts +26 -19
- package/src/apps/catalog.generated.json +757 -0
- package/src/apps/definition.ts +24 -7
- package/src/apps/page-validator.ts +225 -3
- package/src/apps/row-store.ts +37 -14
- package/src/azure-devops/handlers.ts +2 -0
- package/src/be/audit-user.ts +46 -6
- package/src/be/db/kv-windows.ts +22 -0
- package/src/be/db/session-moves.ts +3 -3
- package/src/be/db/session-tree.ts +52 -5
- package/src/be/db/skill-audit.ts +17 -0
- package/src/be/db/tasks/write.ts +18 -3
- package/src/be/db.ts +152 -33
- package/src/be/extensions/assets.ts +11 -7
- package/src/be/mcp-proxy.ts +5 -4
- package/src/be/memory/demotion-evidence.ts +2 -2
- package/src/be/memory/providers/sqlite-store.ts +151 -18
- package/src/be/memory/search-read-worker.ts +60 -0
- package/src/be/memory/search-reader.ts +223 -0
- package/src/be/migrations/337_favorites_session_hidden_key.sql +39 -0
- package/src/be/migrations/338_audit_agent_columns.sql +30 -0
- package/src/be/migrations/339_deferred_event_waits.sql +26 -0
- package/src/be/migrations/340_api_key_spend_cap.sql +5 -0
- package/src/be/model-tier-resolution.ts +18 -1
- package/src/be/multi-runtime.ts +17 -0
- package/src/be/primitives/object-embed.ts +250 -0
- package/src/be/primitives/objects.ts +29 -9
- package/src/be/primitives/sheets/service.ts +138 -6
- package/src/be/primitives/sheets/xlsx.ts +367 -0
- package/src/be/rbac-roles.ts +3 -0
- package/src/be/repo-checked-update.ts +4 -4
- package/src/be/repo-merge-policy.ts +26 -9
- package/src/be/schedules/validate.ts +26 -0
- package/src/be/scripts/boot-reembed.ts +6 -0
- package/src/be/scripts/db.ts +17 -5
- package/src/be/scripts/embeddings.ts +6 -0
- package/src/be/scripts/typecheck.ts +43 -2
- package/src/be/seed/schedules-seeder.ts +9 -1
- package/src/be/seed/workflows-seeder.ts +9 -1
- package/src/be/seed-scripts/index.ts +2 -0
- package/src/be/seed-skills/index.ts +12 -0
- package/src/be/swarm-config-guard.ts +5 -0
- package/src/be/unmapped-identities.ts +95 -1
- package/src/bitbucket/handlers.ts +2 -0
- package/src/commands/credential-outcome-report.ts +5 -2
- package/src/commands/onboard/agent-fs-version.ts +1 -1
- package/src/commands/provider-credentials.ts +19 -0
- package/src/commands/provider-error-class.ts +4 -1
- package/src/commands/rate-limit-outcome.ts +48 -3
- package/src/commands/runner.ts +113 -55
- package/src/commands/worktree-reaper.ts +600 -0
- package/src/event-waits/github.ts +43 -0
- package/src/event-waits/index.ts +29 -0
- package/src/event-waits/types.ts +51 -0
- package/src/extensions/contract-types.generated.ts +1 -1
- package/src/extensions/dispatcher.ts +9 -0
- package/src/fs/agent-fs-provider.ts +4 -1
- package/src/github/handlers.ts +3 -1
- package/src/github/pull-request-state.ts +34 -0
- package/src/gitlab/handlers.ts +12 -7
- package/src/hooks/codex-hook.ts +99 -1
- package/src/hooks/hook.ts +85 -11
- package/src/hooks/native-tool-hooks.ts +245 -0
- package/src/http/agents.ts +4 -0
- package/src/http/all-routes.ts +1 -0
- package/src/http/api-keys.ts +27 -3
- package/src/http/assets.ts +4 -3
- package/src/http/comb.ts +2 -2
- package/src/http/favorite-owner.ts +2 -2
- package/src/http/favorites.ts +3 -2
- package/src/http/fs.ts +13 -4
- package/src/http/index.ts +2 -0
- package/src/http/mcp-bridge.ts +4 -0
- package/src/http/objects.ts +265 -0
- package/src/http/pages-public.ts +40 -4
- package/src/http/pages.ts +3 -3
- package/src/http/poll.ts +43 -12
- package/src/http/pool-keys.ts +21 -2
- package/src/http/repos.ts +7 -6
- package/src/http/schedules.ts +38 -9
- package/src/http/script-connections.ts +14 -6
- package/src/http/script-runs.ts +12 -3
- package/src/http/scripts.ts +9 -0
- package/src/http/sessions.ts +30 -12
- package/src/http/skills.ts +17 -0
- package/src/http/task-requester.ts +2 -2
- package/src/http/tasks.ts +18 -12
- package/src/http/tool-hooks.ts +24 -2
- package/src/http/trackers/authorize-gate.ts +2 -2
- package/src/http/users.ts +136 -1
- package/src/http/workflow-events.ts +13 -0
- package/src/http/workflows.ts +21 -11
- package/src/linear/sync.ts +3 -1
- package/src/mcp-client/http-client.ts +3 -1
- package/src/oauth/identity-capture.ts +6 -1
- package/src/oauth/mcp-wrapper.ts +10 -3
- package/src/oauth/wrapper.ts +15 -3
- package/src/prompts/base-prompt.ts +35 -13
- package/src/prompts/session-templates.ts +26 -0
- package/src/providers/acp-targets.ts +2 -2
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/dsh-adapter.ts +1 -1
- package/src/providers/opencode-adapter.ts +1 -0
- package/src/providers/opencode-swarm-plugin.ts +50 -1
- package/src/providers/pi-mono-adapter.ts +143 -11
- package/src/providers/pi-mono-extension.ts +69 -0
- package/src/providers/runtime-dependencies.ts +1 -1
- package/src/rbac/legacy-policy.ts +5 -0
- package/src/rbac/permissions.ts +16 -1
- package/src/scheduler/deferred-task-waits.ts +170 -13
- package/src/scripts-runtime/executors/types.ts +5 -0
- package/src/scripts-runtime/loader.ts +8 -0
- package/src/scripts-runtime/mcp-client.ts +4 -0
- package/src/scripts-runtime/sdk-allowlist.ts +14 -1
- package/src/scripts-runtime/swarm-config.ts +8 -0
- package/src/scripts-runtime/swarm-sdk.ts +4 -0
- package/src/scripts-runtime/types/stdlib.d.ts +47 -4
- package/src/scripts-runtime/types/swarm-extension.d.ts +8 -7
- package/src/scripts-runtime/types/swarm-sdk.d.ts +47 -4
- package/src/server.ts +4 -0
- package/src/slack/enrich.ts +94 -31
- package/src/slack/handlers.test.ts +55 -2
- package/src/slack/handlers.ts +38 -3
- package/src/slack/render-v2.ts +19 -0
- package/src/slack/session-mirror.ts +208 -0
- package/src/slack/thread-participants.ts +0 -5
- package/src/slack/watcher.ts +3 -0
- package/src/slack/work-objects.test.ts +2 -1
- package/src/slack/work-objects.ts +7 -2
- package/src/tests/agentmail-filters.test.ts +4 -3
- package/src/tests/agents-list-model-display.test.ts +23 -0
- package/src/tests/apps-spike2.test.ts +35 -0
- package/src/tests/audit-agent-person.test.ts +825 -0
- package/src/tests/audit-updated-by.test.ts +19 -12
- package/src/tests/base-prompt.test.ts +1 -0
- package/src/tests/claude-hook-output.test.ts +107 -2
- package/src/tests/claude-managed-setup.test.ts +1 -1
- package/src/tests/codex-adapter.test.ts +6 -6
- package/src/tests/codex-gpt6-release.test.ts +4 -4
- package/src/tests/db-task-read-contract.test.ts +1 -0
- package/src/tests/db-task-write-contract.test.ts +1 -0
- package/src/tests/deploy-guard.test.ts +24 -0
- package/src/tests/dsh-adapter.test.ts +1 -1
- package/src/tests/ensure-token.test.ts +2 -2
- package/src/tests/entrypoint-repo-autoclone-args.test.ts +202 -0
- package/src/tests/extensions-catalog.test.ts +33 -25
- package/src/tests/fake-dns.ts +47 -0
- package/src/tests/fixtures/base-prompt-baseline.json +12 -12
- package/src/tests/fixtures/sheets/eocd-count-mismatch.xlsx +0 -0
- package/src/tests/fixtures/sheets/rich-budget.xlsx +0 -0
- package/src/tests/fixtures/sheets/tracker-export.xlsx +0 -0
- package/src/tests/kv-storage.test.ts +3 -0
- package/src/tests/latest-model-report.test.ts +138 -0
- package/src/tests/mcp-oauth-dcr-reuse.test.ts +5 -2
- package/src/tests/mcp-oauth-ensure-token.test.ts +3 -2
- package/src/tests/mcp-oauth-manual-client.test.ts +6 -1
- package/src/tests/mcp-oauth-wrapper.test.ts +20 -4
- package/src/tests/mcp-outbound-fetch-guard.test.ts +169 -0
- package/src/tests/mcp-server-ssrf.test.ts +2 -0
- package/src/tests/memory-search-reader.test.ts +258 -0
- package/src/tests/memory-search-stall.test.ts +202 -20
- package/src/tests/model-control.test.ts +4 -4
- package/src/tests/model-tier-resolution.test.ts +2 -2
- package/src/tests/multi-runtime-registration.test.ts +8 -2
- package/src/tests/native-tool-hooks.test.ts +188 -0
- package/src/tests/oauth-connection-fetch-guard.test.ts +162 -0
- package/src/tests/oauth-token-endpoint-fetch-guard.test.ts +121 -0
- package/src/tests/oauth-wrapper.test.ts +1 -2
- package/src/tests/opencode-swarm-plugin.test.ts +6 -1
- package/src/tests/pages-head-v2.test.ts +2 -1
- package/src/tests/pi-provider-runtime-keys.test.ts +163 -0
- package/src/tests/poll-probe-readonly.test.ts +108 -0
- package/src/tests/primitives-sheets-xlsx.test.ts +549 -0
- package/src/tests/prompt-template-session.test.ts +3 -2
- package/src/tests/rbac-roles.test.ts +3 -0
- package/src/tests/script-connections-http.test.ts +8 -3
- package/src/tests/script-connections.test.ts +6 -0
- package/src/tests/seed-model-profiles.test.ts +1 -1
- package/src/tests/sessions-tree.test.ts +10 -2
- package/src/tests/slack-thread-participants.test.ts +77 -4
- package/src/tests/spend-cap-credentials.test.ts +34 -0
- package/src/tests/spend-cap-outcome.test.ts +67 -0
- package/src/tests/subscription-first.test.ts +119 -0
- package/src/tests/tool-registrar-no-input.test.ts +1 -0
- package/src/tests/worktree-reaper.test.ts +424 -0
- package/src/tools/defer-task.ts +154 -12
- package/src/tools/get-task-details.ts +247 -5
- package/src/tools/objects.ts +10 -5
- package/src/tools/repos/update-repo.ts +6 -6
- package/src/tools/schedules/create-schedule.ts +1 -0
- package/src/tools/schedules/list-schedules.ts +3 -0
- package/src/tools/schedules/patch-schedule.ts +38 -4
- package/src/tools/schedules/update-schedule.ts +40 -5
- package/src/tools/sheets.ts +66 -0
- package/src/tools/skills/skill-create.ts +6 -0
- package/src/tools/skills/skill-install-remote.ts +6 -0
- package/src/tools/skills/skill-sync-remote.ts +9 -0
- package/src/tools/skills/skill-update.ts +9 -1
- package/src/tools/tool-config.ts +3 -1
- package/src/tools/utils.ts +15 -0
- package/src/tools/workflows/create-workflow.ts +9 -4
- package/src/tools/workflows/patch-workflow-node.ts +1 -1
- package/src/tools/workflows/patch-workflow.ts +5 -2
- package/src/tools/workflows/update-workflow.ts +13 -7
- package/src/types.ts +96 -12
- package/src/utils/credentials.ts +36 -1
- package/src/utils/egress-guard.ts +40 -10
- package/src/utils/error-tracker.ts +17 -0
- package/src/workflows/input.ts +12 -5
- package/src/workflows/patch-definition.ts +13 -5
- package/src/workflows/triggers.ts +11 -6
- package/src/workflows/version.ts +7 -1
- package/templates/skills/apps/SKILL.md +191 -2
- package/templates/skills/apps/content.md +191 -2
- package/templates/skills/boards-and-sheets/config.json +14 -0
- package/templates/skills/boards-and-sheets/content.md +174 -0
- package/templates/skills/pages/content.md +11 -0
- package/templates/skills/swarm-docs/content.md +11 -0
- package/templates/skills/swarm-scripts/SKILL.md +1 -0
- package/templates/skills/swarm-scripts/content.md +1 -0
- package/templates/workflows/ralph-loop/content.md +6 -6
- package/dist/acp-adapter-11m13kx4.js +0 -16
- package/dist/cli-pr0eze3x.js +0 -149
- package/dist/core-dxcy02sc.js +0 -41
- package/dist/fx-adapter-0ar6pqm3.js +0 -19
- package/dist/grok-adapter-t6m74fb1.js +0 -19
- package/dist/handlers-9kwcrc4k.js +0 -38
- package/dist/heartbeat-p8pk1msj.js +0 -49
- package/dist/index-23cdfzr6.js +0 -39
- package/dist/index-g7kkjs5b.js +0 -38
- package/dist/index-stk36pa5.js +0 -43
- package/dist/lead-mfggjtfk.js +0 -77
- package/dist/thread-buffer-temgaqsy.js +0 -41
- package/dist/worker-efcemc22.js +0 -77
- /package/dist/{cli-cah298e5.js → cli-m4ejz4nj.js} +0 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The idle-poll probe in GET /api/poll must stay SELECT-only, helper side
|
|
3
|
+
* effects included: a write inside its read-only transaction takes the SQLite
|
|
4
|
+
* write lock the probe exists to avoid. Read-only transactions run here under
|
|
5
|
+
* `PRAGMA query_only`, so a probe write fails (and a swallowed one is lost)
|
|
6
|
+
* instead of silently upgrading the lock.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { Database } from "bun:sqlite";
|
|
10
|
+
import { afterAll, beforeAll, expect, spyOn, test } from "bun:test";
|
|
11
|
+
import { unlink } from "node:fs/promises";
|
|
12
|
+
import { createServer as createHttpServer, type Server } from "node:http";
|
|
13
|
+
import { closeDb, createAgent, createTaskExtended, getDbClient, initDb } from "../be/db";
|
|
14
|
+
import { handlePoll } from "../http/poll";
|
|
15
|
+
import { getPathSegments, parseQueryParams } from "../http/utils";
|
|
16
|
+
import { listenOnFreePort } from "./test-net";
|
|
17
|
+
|
|
18
|
+
const TEST_DB_PATH = "./test-poll-probe-readonly.sqlite";
|
|
19
|
+
let server: Server;
|
|
20
|
+
let baseUrl = "";
|
|
21
|
+
|
|
22
|
+
async function removeDbFiles(path: string): Promise<void> {
|
|
23
|
+
for (const suffix of ["", "-wal", "-shm"]) {
|
|
24
|
+
await unlink(path + suffix).catch(() => {});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async function poll(agentId: string): Promise<{ status: number; body: { trigger?: unknown } }> {
|
|
29
|
+
const res = await fetch(`${baseUrl}/api/poll`, { headers: { "X-Agent-ID": agentId } });
|
|
30
|
+
return { status: res.status, body: (await res.json()) as { trigger?: unknown } };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
beforeAll(async () => {
|
|
34
|
+
await removeDbFiles(TEST_DB_PATH);
|
|
35
|
+
initDb(TEST_DB_PATH);
|
|
36
|
+
const client = getDbClient();
|
|
37
|
+
const transaction = client.transaction.bind(client);
|
|
38
|
+
spyOn(client, "transaction").mockImplementation((fn, opts) =>
|
|
39
|
+
opts?.readOnly
|
|
40
|
+
? transaction(async (tx) => {
|
|
41
|
+
await tx.run("PRAGMA query_only = ON");
|
|
42
|
+
try {
|
|
43
|
+
return await fn(tx);
|
|
44
|
+
} finally {
|
|
45
|
+
await tx.run("PRAGMA query_only = OFF");
|
|
46
|
+
}
|
|
47
|
+
}, opts)
|
|
48
|
+
: transaction(fn, opts),
|
|
49
|
+
);
|
|
50
|
+
server = createHttpServer(async (req, res) => {
|
|
51
|
+
const agentId = req.headers["x-agent-id"] as string | undefined;
|
|
52
|
+
const url = req.url ?? "";
|
|
53
|
+
if (await handlePoll(req, res, getPathSegments(url), parseQueryParams(url), agentId)) return;
|
|
54
|
+
res.writeHead(404).end();
|
|
55
|
+
});
|
|
56
|
+
baseUrl = `http://localhost:${await listenOnFreePort(server)}`;
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
afterAll(async () => {
|
|
60
|
+
await new Promise<void>((resolve) => server.close(() => resolve()));
|
|
61
|
+
closeDb();
|
|
62
|
+
await removeDbFiles(TEST_DB_PATH);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
test("an affinity-skipped pending task keeps the idle probe SELECT-only", async () => {
|
|
66
|
+
const agentId = crypto.randomUUID();
|
|
67
|
+
await createAgent({
|
|
68
|
+
id: agentId,
|
|
69
|
+
name: "probe-worker",
|
|
70
|
+
isLead: false,
|
|
71
|
+
status: "idle",
|
|
72
|
+
capabilities: [],
|
|
73
|
+
maxTasks: 2,
|
|
74
|
+
});
|
|
75
|
+
const task = await createTaskExtended("quarantined assignment", { agentId });
|
|
76
|
+
// A corrupt stored affinity: dispatch skips the task and logs why.
|
|
77
|
+
await getDbClient().run("UPDATE agent_tasks SET routingAffinity = ? WHERE id = ?", [
|
|
78
|
+
"{not-json",
|
|
79
|
+
task.id,
|
|
80
|
+
]);
|
|
81
|
+
const skipLogs = async () =>
|
|
82
|
+
(
|
|
83
|
+
await getDbClient().get<{ n: number }>(
|
|
84
|
+
"SELECT COUNT(*) AS n FROM agent_log WHERE eventType = 'task_dispatch_rejected_affinity' AND taskId = ?",
|
|
85
|
+
[task.id],
|
|
86
|
+
)
|
|
87
|
+
)?.n;
|
|
88
|
+
|
|
89
|
+
// Log due: the probe hands it to the write pass instead of writing it.
|
|
90
|
+
const first = await poll(agentId);
|
|
91
|
+
expect(first.status).toBe(200);
|
|
92
|
+
expect(first.body.trigger).toBeNull();
|
|
93
|
+
expect(await skipLogs()).toBe(1);
|
|
94
|
+
|
|
95
|
+
// Log in cooldown: nothing to write, so the poll answers while another
|
|
96
|
+
// connection holds the write lock.
|
|
97
|
+
const holder = new Database(TEST_DB_PATH);
|
|
98
|
+
holder.run("BEGIN IMMEDIATE");
|
|
99
|
+
try {
|
|
100
|
+
const second = await poll(agentId);
|
|
101
|
+
expect(second.status).toBe(200);
|
|
102
|
+
expect(second.body.trigger).toBeNull();
|
|
103
|
+
} finally {
|
|
104
|
+
holder.run("ROLLBACK");
|
|
105
|
+
holder.close();
|
|
106
|
+
}
|
|
107
|
+
expect(await skipLogs()).toBe(1);
|
|
108
|
+
}, 30_000);
|
|
@@ -0,0 +1,549 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import { deflateRawSync } from "node:zlib";
|
|
3
|
+
import * as XLSX from "xlsx";
|
|
4
|
+
import { ObjectsError } from "../be/primitives/objects";
|
|
5
|
+
import { sheetEngine } from "../be/primitives/sheets/engine";
|
|
6
|
+
import { MAX_CELLS, MAX_TABS, type SheetTab } from "../be/primitives/sheets/format";
|
|
7
|
+
import {
|
|
8
|
+
buildXlsx,
|
|
9
|
+
MAX_INFLATED_BYTES,
|
|
10
|
+
MAX_XLSX_BYTES,
|
|
11
|
+
parseXlsx,
|
|
12
|
+
} from "../be/primitives/sheets/xlsx";
|
|
13
|
+
|
|
14
|
+
const fixture = async (name: string) =>
|
|
15
|
+
new Uint8Array(
|
|
16
|
+
await Bun.file(new URL(`./fixtures/sheets/${name}`, import.meta.url)).arrayBuffer(),
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
const workbook = (tabs: Record<string, XLSX.WorkSheet>) => {
|
|
20
|
+
const wb = XLSX.utils.book_new();
|
|
21
|
+
for (const [name, ws] of Object.entries(tabs)) XLSX.utils.book_append_sheet(wb, ws, name);
|
|
22
|
+
return new Uint8Array(XLSX.write(wb, { type: "array", bookType: "xlsx" }));
|
|
23
|
+
};
|
|
24
|
+
const grid = (rows: number, cols: number) =>
|
|
25
|
+
XLSX.utils.aoa_to_sheet(
|
|
26
|
+
Array.from({ length: rows }, () => Array.from({ length: cols }, () => 1)),
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
/** Declare the uncompressed size of the zip part `name` in its central directory entry and its local header. */
|
|
30
|
+
function declareSize(bytes: Uint8Array, name: string, size: number): Uint8Array {
|
|
31
|
+
const out = new Uint8Array(bytes);
|
|
32
|
+
const view = new DataView(out.buffer);
|
|
33
|
+
for (let i = 0; i < out.length - 46; i++) {
|
|
34
|
+
if (view.getUint32(i, true) !== 0x02014b50) continue;
|
|
35
|
+
const nameLen = view.getUint16(i + 28, true);
|
|
36
|
+
if (new TextDecoder().decode(out.subarray(i + 46, i + 46 + nameLen)) === name) {
|
|
37
|
+
view.setUint32(i + 24, size, true);
|
|
38
|
+
view.setUint32(view.getUint32(i + 42, true) + 22, size, true);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return out;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
type ZipHeader = { method: number; csz: number; usz: number; name: string; extra: Uint8Array };
|
|
45
|
+
type ZipPart = {
|
|
46
|
+
name: string;
|
|
47
|
+
data: Uint8Array;
|
|
48
|
+
method?: 0 | 8;
|
|
49
|
+
usz?: number;
|
|
50
|
+
/** Header fields to write differently into the central directory entry or the local header. */
|
|
51
|
+
cd?: Partial<ZipHeader>;
|
|
52
|
+
local?: Partial<ZipHeader>;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/** A zip with every header field under the test's control, to build archives whose headers disagree. */
|
|
56
|
+
function zip(
|
|
57
|
+
parts: ZipPart[],
|
|
58
|
+
end: { disk?: number; entriesDisk?: number; entries?: number; gap?: number } = {},
|
|
59
|
+
): Uint8Array {
|
|
60
|
+
const chunks: Uint8Array[] = [];
|
|
61
|
+
const dir: Uint8Array[] = [];
|
|
62
|
+
let at = 0;
|
|
63
|
+
const push = (
|
|
64
|
+
to: Uint8Array[],
|
|
65
|
+
build: (view: DataView) => void,
|
|
66
|
+
size: number,
|
|
67
|
+
...tail: Uint8Array[]
|
|
68
|
+
) => {
|
|
69
|
+
const head = new Uint8Array(size);
|
|
70
|
+
build(new DataView(head.buffer));
|
|
71
|
+
to.push(head, ...tail);
|
|
72
|
+
return head.length + tail.reduce((n, t) => n + t.length, 0);
|
|
73
|
+
};
|
|
74
|
+
const text = (value: string) => new TextEncoder().encode(value);
|
|
75
|
+
for (const part of parts) {
|
|
76
|
+
const method = part.method ?? 8;
|
|
77
|
+
const body = method === 8 ? new Uint8Array(deflateRawSync(part.data)) : part.data;
|
|
78
|
+
const base: ZipHeader = {
|
|
79
|
+
method,
|
|
80
|
+
csz: body.length,
|
|
81
|
+
usz: part.usz ?? part.data.length,
|
|
82
|
+
name: part.name,
|
|
83
|
+
extra: new Uint8Array(),
|
|
84
|
+
};
|
|
85
|
+
const local = { ...base, ...part.local };
|
|
86
|
+
const cd = { ...base, ...part.cd };
|
|
87
|
+
const offset = at;
|
|
88
|
+
at += push(
|
|
89
|
+
chunks,
|
|
90
|
+
(v) => {
|
|
91
|
+
v.setUint32(0, 0x04034b50, true);
|
|
92
|
+
v.setUint16(8, local.method, true);
|
|
93
|
+
v.setUint32(18, local.csz, true);
|
|
94
|
+
v.setUint32(22, local.usz, true);
|
|
95
|
+
v.setUint16(26, text(local.name).length, true);
|
|
96
|
+
v.setUint16(28, local.extra.length, true);
|
|
97
|
+
},
|
|
98
|
+
30,
|
|
99
|
+
text(local.name),
|
|
100
|
+
local.extra,
|
|
101
|
+
body,
|
|
102
|
+
);
|
|
103
|
+
push(
|
|
104
|
+
dir,
|
|
105
|
+
(v) => {
|
|
106
|
+
v.setUint32(0, 0x02014b50, true);
|
|
107
|
+
v.setUint16(10, cd.method, true);
|
|
108
|
+
v.setUint32(20, cd.csz, true);
|
|
109
|
+
v.setUint32(24, cd.usz, true);
|
|
110
|
+
v.setUint16(28, text(cd.name).length, true);
|
|
111
|
+
v.setUint16(30, cd.extra.length, true);
|
|
112
|
+
v.setUint32(42, offset, true);
|
|
113
|
+
},
|
|
114
|
+
46,
|
|
115
|
+
text(cd.name),
|
|
116
|
+
cd.extra,
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
const dirSize = dir.reduce((n, d) => n + d.length, 0);
|
|
120
|
+
const gap = new Uint8Array(end.gap ?? 0);
|
|
121
|
+
push(
|
|
122
|
+
dir,
|
|
123
|
+
(v) => {
|
|
124
|
+
v.setUint32(0, 0x06054b50, true);
|
|
125
|
+
v.setUint16(4, end.disk ?? 0, true);
|
|
126
|
+
v.setUint16(8, end.entriesDisk ?? parts.length, true);
|
|
127
|
+
v.setUint16(10, end.entries ?? parts.length, true);
|
|
128
|
+
v.setUint32(12, dirSize, true);
|
|
129
|
+
v.setUint32(16, at, true);
|
|
130
|
+
},
|
|
131
|
+
22,
|
|
132
|
+
);
|
|
133
|
+
return new Uint8Array(
|
|
134
|
+
Buffer.concat([...chunks, ...dir.slice(0, -1), gap, dir.at(-1) as Uint8Array]),
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** Zip64 extra field: an 8-byte uncompressed size, then an 8-byte compressed size. */
|
|
139
|
+
const zip64Extra = (usz: number, csz: number) => {
|
|
140
|
+
const extra = new Uint8Array(20);
|
|
141
|
+
const view = new DataView(extra.buffer);
|
|
142
|
+
view.setUint16(0, 0x0001, true);
|
|
143
|
+
view.setUint16(2, 16, true);
|
|
144
|
+
view.setBigUint64(4, BigInt(usz), true);
|
|
145
|
+
view.setBigUint64(12, BigInt(csz), true);
|
|
146
|
+
return extra;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
/** Every formula cell of the xlsx with the result cached in the file. */
|
|
150
|
+
function cachedFormulas(bytes: Uint8Array): Map<string, number | string | boolean> {
|
|
151
|
+
const wb = XLSX.read(bytes, { type: "array", cellFormula: true });
|
|
152
|
+
const found = new Map<string, number | string | boolean>();
|
|
153
|
+
for (const name of wb.SheetNames) {
|
|
154
|
+
for (const [ref, cell] of Object.entries(wb.Sheets[name] ?? {})) {
|
|
155
|
+
if (!ref.startsWith("!") && (cell as XLSX.CellObject).f) {
|
|
156
|
+
found.set(`${name}!${ref}`, (cell as XLSX.CellObject).v as number | string | boolean);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return found;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
describe("parseXlsx", () => {
|
|
164
|
+
test("the tracker workbook: 120 of 120 recomputed formulas match the file's cached values", async () => {
|
|
165
|
+
const bytes = await fixture("tracker-export.xlsx");
|
|
166
|
+
const { tabs, dropped } = await parseXlsx(bytes);
|
|
167
|
+
expect(tabs.map((t) => t.name)).toEqual(["Tasks", "Summary"]);
|
|
168
|
+
expect(dropped).toEqual([]);
|
|
169
|
+
const cached = cachedFormulas(bytes);
|
|
170
|
+
expect(cached.size).toBe(120);
|
|
171
|
+
const { cells } = await sheetEngine().recalc(tabs, [], { maxCells: MAX_CELLS });
|
|
172
|
+
let matching = 0;
|
|
173
|
+
for (const [key, want] of cached) {
|
|
174
|
+
const [tab, ref] = key.split("!") as [string, string];
|
|
175
|
+
const cell = cells[tabs.findIndex((t) => t.name === tab)]?.[ref];
|
|
176
|
+
expect(cell?.f).toBeDefined();
|
|
177
|
+
const got = cell?.v;
|
|
178
|
+
const same =
|
|
179
|
+
typeof want === "number" && typeof got === "number"
|
|
180
|
+
? Math.abs(want - got) <= 1e-9 * Math.max(1, Math.abs(want))
|
|
181
|
+
: want === got;
|
|
182
|
+
if (same) matching++;
|
|
183
|
+
else console.log("mismatch", key, want, got);
|
|
184
|
+
}
|
|
185
|
+
expect(matching).toBe(120);
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
test("the rich workbook keeps formulas that have no cached value, formats, widths and merges, and names what it drops", async () => {
|
|
189
|
+
const { tabs, dropped } = await parseXlsx(await fixture("rich-budget.xlsx"));
|
|
190
|
+
const budget = tabs[0] as SheetTab;
|
|
191
|
+
// `<f>D3-C3</f><v />`: a formula with no cached value survives (sheetStubs).
|
|
192
|
+
expect(Object.values(budget.cells).filter((c) => c.f).length).toBe(14);
|
|
193
|
+
expect(budget.cells.E3?.f).toBe("=D3-C3");
|
|
194
|
+
expect(budget.cells.C3).toEqual({ v: 12000, nf: '"$"#,##0.00' });
|
|
195
|
+
expect(budget.merges).toEqual(["A1:E1"]);
|
|
196
|
+
expect(budget.colWidths).toEqual({ A: 132, C: 84 });
|
|
197
|
+
expect(tabs[1]?.cells.B3).toEqual({ v: "007", nf: "@" });
|
|
198
|
+
expect(dropped.sort()).toEqual(
|
|
199
|
+
[
|
|
200
|
+
"autofilter",
|
|
201
|
+
"cell styling (fills, bold, borders)",
|
|
202
|
+
"charts",
|
|
203
|
+
"comments",
|
|
204
|
+
"conditional formatting",
|
|
205
|
+
"data validation",
|
|
206
|
+
"defined names",
|
|
207
|
+
"frozen panes",
|
|
208
|
+
"hyperlinks",
|
|
209
|
+
].sort(),
|
|
210
|
+
);
|
|
211
|
+
// The engine accepts what the parser produced, including a `@` text format.
|
|
212
|
+
const { cells } = await sheetEngine().recalc(tabs, [], { maxCells: MAX_CELLS });
|
|
213
|
+
expect(cells[0]?.E3?.v).toBe(-750);
|
|
214
|
+
expect(cells[1]?.B3?.v).toBe("007");
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
describe("dropped-feature detection stays linear on a hostile archive", () => {
|
|
218
|
+
// Rebuild a workbook with `edit` applied to one part's text, through the header-exact zip helper.
|
|
219
|
+
const patched = (part: string, edit: (xml: string) => string): Uint8Array => {
|
|
220
|
+
const wb = XLSX.read(workbook({ Data: XLSX.utils.aoa_to_sheet([[42]]) }), {
|
|
221
|
+
type: "array",
|
|
222
|
+
bookFiles: true,
|
|
223
|
+
});
|
|
224
|
+
// `mt` marks the zip parts; the other entry is SheetJS's internal compound-file stub.
|
|
225
|
+
const parts = Object.entries(
|
|
226
|
+
(wb as { files: Record<string, { content: Uint8Array; mt?: unknown }> }).files,
|
|
227
|
+
).filter(([, file]) => file.mt);
|
|
228
|
+
return zip(
|
|
229
|
+
parts.map(([name, { content }]) => ({
|
|
230
|
+
name,
|
|
231
|
+
data:
|
|
232
|
+
name === part
|
|
233
|
+
? new TextEncoder().encode(edit(new TextDecoder().decode(content)))
|
|
234
|
+
: content,
|
|
235
|
+
})),
|
|
236
|
+
);
|
|
237
|
+
};
|
|
238
|
+
const SHEET = "xl/worksheets/sheet1.xml";
|
|
239
|
+
const STYLES = "xl/styles.xml";
|
|
240
|
+
const before = (tag: string, insert: string) => (xml: string) => xml.replace(tag, insert + tag);
|
|
241
|
+
// 32k tokens are 192 KB of XML: nowhere near any cap, and about 6 s on the old regexes.
|
|
242
|
+
const comment = (token: string) => `<!--${token.repeat(32_000)}-->`;
|
|
243
|
+
const timed = async (bytes: Uint8Array) => {
|
|
244
|
+
const start = performance.now();
|
|
245
|
+
const result = await parseXlsx(bytes);
|
|
246
|
+
return { ...result, ms: performance.now() - start };
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
test("32k unclosed <pane tokens in a comment parse in well under a second and still read the data", async () => {
|
|
250
|
+
const { tabs, dropped, ms } = await timed(
|
|
251
|
+
patched(SHEET, before("</worksheet>", comment("<pane "))),
|
|
252
|
+
);
|
|
253
|
+
expect(tabs[0]?.cells.A1).toEqual({ v: 42 });
|
|
254
|
+
expect(dropped).not.toContain("frozen panes");
|
|
255
|
+
expect(ms).toBeLessThan(1000);
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
test("32k unclosed <font> tokens in a comment parse in well under a second and still read the data", async () => {
|
|
259
|
+
const { tabs, dropped, ms } = await timed(
|
|
260
|
+
patched(STYLES, before("</styleSheet>", comment("<font>"))),
|
|
261
|
+
);
|
|
262
|
+
expect(tabs[0]?.cells.A1).toEqual({ v: 42 });
|
|
263
|
+
expect(dropped).not.toContain("cell styling (fills, bold, borders)");
|
|
264
|
+
expect(ms).toBeLessThan(1000);
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
test("a real frozen pane and a real bold font are still named after the hostile run", async () => {
|
|
268
|
+
const pane =
|
|
269
|
+
'<sheetViews><sheetView><pane state="frozen" ySplit="1"/></sheetView></sheetViews>';
|
|
270
|
+
const frozen = await timed(
|
|
271
|
+
patched(SHEET, before("</worksheet>", `${comment("<pane ")}${pane}`)),
|
|
272
|
+
);
|
|
273
|
+
expect(frozen.dropped).toContain("frozen panes");
|
|
274
|
+
expect(frozen.ms).toBeLessThan(1000);
|
|
275
|
+
const bold = await timed(
|
|
276
|
+
patched(STYLES, before("</styleSheet>", `${comment("<font>")}<font><b/></font>`)),
|
|
277
|
+
);
|
|
278
|
+
expect(bold.dropped).toContain("cell styling (fills, bold, borders)");
|
|
279
|
+
expect(bold.ms).toBeLessThan(1000);
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
test("a pane that is not frozen, and a font that is not bold, are not reported", async () => {
|
|
283
|
+
const plain = await parseXlsx(
|
|
284
|
+
patched(
|
|
285
|
+
SHEET,
|
|
286
|
+
before("</worksheet>", '<pane xSplit="1"/><pane ySplit="1" state="split"/>'),
|
|
287
|
+
),
|
|
288
|
+
);
|
|
289
|
+
expect(plain.dropped).not.toContain("frozen panes");
|
|
290
|
+
const font = await parseXlsx(
|
|
291
|
+
patched(STYLES, before("</styleSheet>", "<font><i/></font><font><sz/></font>")),
|
|
292
|
+
);
|
|
293
|
+
expect(font.dropped).not.toContain("cell styling (fills, bold, borders)");
|
|
294
|
+
});
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
test("strips the _xlws prefix Excel writes and keeps a multi-cell array formula as values", async () => {
|
|
298
|
+
const ws = XLSX.utils.aoa_to_sheet([[1, 2, 3]]);
|
|
299
|
+
ws.D1 = { t: "n", v: 6, f: "_xlfn.IFS(A1=1,B1+C1)+_xlfn._xlws.SORT(A1:C1)" };
|
|
300
|
+
ws.A3 = { t: "n", v: 7, f: "A1+6", F: "A3:A4" };
|
|
301
|
+
ws["!ref"] = "A1:D4";
|
|
302
|
+
const { tabs, dropped } = await parseXlsx(workbook({ Data: ws }));
|
|
303
|
+
expect(tabs[0]?.cells.D1?.f).toBe("=IFS(A1=1,B1+C1)+SORT(A1:C1)");
|
|
304
|
+
expect(tabs[0]?.cells.A3).toEqual({ v: 7 });
|
|
305
|
+
expect(dropped).toEqual(["array formulas (kept as values)"]);
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
test("strips the _xlfn and _xlws prefixes outside quotes only, so a string or sheet name that spells one survives", async () => {
|
|
309
|
+
const ws = XLSX.utils.aoa_to_sheet([[1]]);
|
|
310
|
+
ws.B1 = { t: "s", v: "x", f: 'IF(TRUE,"_xlfn.IFS(","_xlws.SORT(""_xlfn.")&\'_xlws.Tab\'!A1' };
|
|
311
|
+
ws["!ref"] = "A1:B1";
|
|
312
|
+
const { tabs } = await parseXlsx(workbook({ Data: ws }));
|
|
313
|
+
expect(tabs[0]?.cells.B1?.f).toBe(
|
|
314
|
+
'=IF(TRUE,"_xlfn.IFS(","_xlws.SORT(""_xlfn.")&\'_xlws.Tab\'!A1',
|
|
315
|
+
);
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
test("an error constant becomes text and is named", async () => {
|
|
319
|
+
const ws = XLSX.utils.aoa_to_sheet([[1]]);
|
|
320
|
+
ws.B1 = { t: "e", v: 42, w: "#N/A" };
|
|
321
|
+
ws["!ref"] = "A1:B1";
|
|
322
|
+
const { tabs, dropped } = await parseXlsx(workbook({ Data: ws }));
|
|
323
|
+
expect(tabs[0]?.cells.B1).toEqual({ v: "#N/A" });
|
|
324
|
+
expect(dropped).toContain("error constants (kept as text)");
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
test("refuses what is not an xlsx", async () => {
|
|
328
|
+
const reason = async (bytes: Uint8Array) =>
|
|
329
|
+
parseXlsx(bytes).then(
|
|
330
|
+
() => "accepted",
|
|
331
|
+
(error: unknown) => (error instanceof ObjectsError ? error.message : String(error)),
|
|
332
|
+
);
|
|
333
|
+
expect(await reason(new TextEncoder().encode("a,b\n1,2\n"))).toContain("not a zip");
|
|
334
|
+
expect(await reason(new Uint8Array())).toContain("not an xlsx");
|
|
335
|
+
const ods = new Uint8Array(
|
|
336
|
+
XLSX.write(
|
|
337
|
+
(() => {
|
|
338
|
+
const wb = XLSX.utils.book_new();
|
|
339
|
+
XLSX.utils.book_append_sheet(wb, grid(1, 1), "S");
|
|
340
|
+
return wb;
|
|
341
|
+
})(),
|
|
342
|
+
{ type: "array", bookType: "ods" },
|
|
343
|
+
),
|
|
344
|
+
);
|
|
345
|
+
expect(await reason(ods)).toContain("no xl/workbook.xml");
|
|
346
|
+
const good = await fixture("tracker-export.xlsx");
|
|
347
|
+
expect(await reason(good.subarray(0, good.length - 40))).toContain("not an xlsx");
|
|
348
|
+
});
|
|
349
|
+
|
|
350
|
+
test("refuses a zip bomb by its declared size, and a directory that lies about it", async () => {
|
|
351
|
+
const good = await fixture("tracker-export.xlsx");
|
|
352
|
+
const declared = declareSize(good, "xl/worksheets/sheet1.xml", MAX_INFLATED_BYTES + 1);
|
|
353
|
+
await expect(parseXlsx(declared)).rejects.toThrow("inflates to more than");
|
|
354
|
+
// Declares 10 bytes in both headers, the stream holds far more: the bounded inflate refuses before SheetJS runs.
|
|
355
|
+
const lying = declareSize(good, "xl/worksheets/sheet1.xml", 10);
|
|
356
|
+
await expect(parseXlsx(lying)).rejects.toThrow(/corrupt zip archive|does not match/);
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
test("refuses a 17 MiB part hidden behind mismatched end-of-directory counts (SheetJS reads the per-disk count)", async () => {
|
|
360
|
+
// tracker-export.xlsx with xl/workbook.xml first and a 17 MiB deflated padding.bin: per-disk count 12, total 1.
|
|
361
|
+
const bomb = await fixture("eocd-count-mismatch.xlsx");
|
|
362
|
+
expect(bomb.length).toBeLessThan(MAX_XLSX_BYTES);
|
|
363
|
+
await expect(parseXlsx(bomb)).rejects.toThrow("inconsistent or ZIP64 counts");
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
// Every way the archive can read differently to the checker and to SheetJS, which trusts the local
|
|
367
|
+
// headers, the per-disk entry count and ZIP64 extras. Each one must be refused before SheetJS runs.
|
|
368
|
+
const workbookXml = new TextEncoder().encode("<workbook/>");
|
|
369
|
+
const padding = new Uint8Array(MAX_INFLATED_BYTES + 1024 * 1024).fill(120);
|
|
370
|
+
const small = { name: "xl/workbook.xml", data: workbookXml };
|
|
371
|
+
const bombPart = { name: "padding.bin", data: padding };
|
|
372
|
+
const disagreements: [string, Uint8Array, string][] = [
|
|
373
|
+
[
|
|
374
|
+
"per-disk count above the total",
|
|
375
|
+
zip([small, bombPart], { entries: 1 }),
|
|
376
|
+
"inconsistent or ZIP64 counts",
|
|
377
|
+
],
|
|
378
|
+
[
|
|
379
|
+
"total count above the per-disk count",
|
|
380
|
+
zip([small, bombPart], { entriesDisk: 1 }),
|
|
381
|
+
"inconsistent or ZIP64 counts",
|
|
382
|
+
],
|
|
383
|
+
["a split-disk end record", zip([small], { disk: 1 }), "inconsistent or ZIP64 counts"],
|
|
384
|
+
[
|
|
385
|
+
"bytes between the directory and the end record",
|
|
386
|
+
zip([small], { gap: 8 }),
|
|
387
|
+
"does not end at the end record",
|
|
388
|
+
],
|
|
389
|
+
[
|
|
390
|
+
"local method deflate, directory says stored",
|
|
391
|
+
zip([
|
|
392
|
+
{
|
|
393
|
+
...small,
|
|
394
|
+
data: padding,
|
|
395
|
+
cd: { method: 0, usz: 100, csz: 100 },
|
|
396
|
+
local: { usz: 100, csz: 100 },
|
|
397
|
+
},
|
|
398
|
+
]),
|
|
399
|
+
"local header disagrees",
|
|
400
|
+
],
|
|
401
|
+
[
|
|
402
|
+
"local name differs from the directory name",
|
|
403
|
+
zip([{ ...small, local: { name: "xl/other.xml" } }]),
|
|
404
|
+
"local header disagrees",
|
|
405
|
+
],
|
|
406
|
+
[
|
|
407
|
+
"local uncompressed size, the buffer SheetJS allocates, above the directory's",
|
|
408
|
+
zip([{ ...small, local: { usz: 2 ** 31 } }]),
|
|
409
|
+
"local header disagrees",
|
|
410
|
+
],
|
|
411
|
+
[
|
|
412
|
+
"local compressed size above the directory's",
|
|
413
|
+
zip([{ ...small, local: { csz: 2 ** 31 } }]),
|
|
414
|
+
"local header disagrees",
|
|
415
|
+
],
|
|
416
|
+
[
|
|
417
|
+
"a ZIP64 extra field in the directory",
|
|
418
|
+
zip([{ ...small, cd: { extra: zip64Extra(2 ** 33, 1) } }]),
|
|
419
|
+
"ZIP64 sizes",
|
|
420
|
+
],
|
|
421
|
+
[
|
|
422
|
+
"a ZIP64 extra field in the local header",
|
|
423
|
+
zip([{ ...small, local: { extra: zip64Extra(2 ** 33, 1) } }]),
|
|
424
|
+
"local header disagrees",
|
|
425
|
+
],
|
|
426
|
+
];
|
|
427
|
+
test.each(disagreements)("refuses an archive with %s", async (_why, bytes, message) => {
|
|
428
|
+
await expect(parseXlsx(bytes)).rejects.toThrow(message);
|
|
429
|
+
});
|
|
430
|
+
|
|
431
|
+
test("the archive builder writes a zip the checker accepts when the headers agree", async () => {
|
|
432
|
+
// Control: the refusals above come from the disagreement, not from the builder's output.
|
|
433
|
+
await expect(parseXlsx(zip([small, bombPart]))).rejects.toThrow("inflates to more than");
|
|
434
|
+
const ok = zip([small, { name: "xl/media/a.png", data: padding.subarray(0, 100) }]);
|
|
435
|
+
const outcome = await parseXlsx(ok).then(
|
|
436
|
+
() => "accepted",
|
|
437
|
+
(error: Error) => error.message,
|
|
438
|
+
);
|
|
439
|
+
expect(outcome).not.toMatch(/disagrees|inconsistent|ZIP64|does not end/);
|
|
440
|
+
});
|
|
441
|
+
|
|
442
|
+
test("refuses over the tab and cell limits", async () => {
|
|
443
|
+
const tabs = Object.fromEntries(
|
|
444
|
+
Array.from({ length: MAX_TABS + 1 }, (_, i) => [`T${i + 1}`, grid(1, 1)]),
|
|
445
|
+
);
|
|
446
|
+
await expect(parseXlsx(workbook(tabs))).rejects.toThrow(`the limit is ${MAX_TABS}`);
|
|
447
|
+
await expect(parseXlsx(workbook({ Big: grid(501, 100) }))).rejects.toThrow(
|
|
448
|
+
`the limit is ${MAX_CELLS}`,
|
|
449
|
+
);
|
|
450
|
+
});
|
|
451
|
+
});
|
|
452
|
+
|
|
453
|
+
describe("buildXlsx", () => {
|
|
454
|
+
const tabs: SheetTab[] = [
|
|
455
|
+
{
|
|
456
|
+
name: "Data",
|
|
457
|
+
colWidths: { A: 120 },
|
|
458
|
+
merges: ["A1:B1"],
|
|
459
|
+
freezeRows: 1,
|
|
460
|
+
cells: {
|
|
461
|
+
A1: { v: "Title" },
|
|
462
|
+
A2: { v: 3, nf: "0.00" },
|
|
463
|
+
B2: { f: "=IFS(A2>1,A2*2,TRUE,0)", v: 6 },
|
|
464
|
+
C2: { f: "=1/0", v: "#DIV/0!", e: true },
|
|
465
|
+
D2: { f: "=SEQUENCE(2)", v: 1 },
|
|
466
|
+
D3: { v: 2, s: "D2" },
|
|
467
|
+
E2: { v: true },
|
|
468
|
+
},
|
|
469
|
+
},
|
|
470
|
+
{ name: "Empty", cells: {} },
|
|
471
|
+
];
|
|
472
|
+
|
|
473
|
+
test("writes values, cached results, formats, widths and merges, and names what it drops", async () => {
|
|
474
|
+
const { bytes, dropped } = await buildXlsx(tabs);
|
|
475
|
+
expect(dropped.sort()).toEqual([
|
|
476
|
+
"frozen panes",
|
|
477
|
+
"spilled array cells (written as values; the anchor keeps its formula)",
|
|
478
|
+
]);
|
|
479
|
+
const wb = XLSX.read(bytes, {
|
|
480
|
+
type: "array",
|
|
481
|
+
cellFormula: true,
|
|
482
|
+
cellNF: true,
|
|
483
|
+
cellStyles: true,
|
|
484
|
+
bookFiles: true,
|
|
485
|
+
});
|
|
486
|
+
expect(wb.SheetNames).toEqual(["Data", "Empty"]);
|
|
487
|
+
const ws = wb.Sheets.Data as XLSX.WorkSheet;
|
|
488
|
+
expect(ws.A2).toMatchObject({ t: "n", v: 3, z: "0.00" });
|
|
489
|
+
// Excel needs the prefix on functions newer than 2007, or it shows #NAME?.
|
|
490
|
+
const xml = String(
|
|
491
|
+
(wb as { files?: Record<string, { content: unknown }> }).files?.["xl/worksheets/sheet1.xml"]
|
|
492
|
+
?.content,
|
|
493
|
+
);
|
|
494
|
+
expect(xml).toContain("<f>_xlfn.IFS(A2>1,A2*2,TRUE,0)</f>");
|
|
495
|
+
expect(xml).toContain("<f>_xlfn.SEQUENCE(2)</f>");
|
|
496
|
+
expect(ws.B2?.v).toBe(6);
|
|
497
|
+
expect(ws.C2).toMatchObject({ t: "e", w: "#DIV/0!" });
|
|
498
|
+
expect(ws.D3).toMatchObject({ t: "n", v: 2 });
|
|
499
|
+
expect(ws.E2).toMatchObject({ t: "b", v: true });
|
|
500
|
+
expect(ws["!merges"]?.length).toBe(1);
|
|
501
|
+
expect(ws["!cols"]?.[0]?.wpx).toBe(120);
|
|
502
|
+
});
|
|
503
|
+
|
|
504
|
+
// A function name inside a string literal or a quoted sheet name is text, not a call: only real calls get the prefix.
|
|
505
|
+
test("prefixes function calls but never text inside string literals or quoted sheet names", async () => {
|
|
506
|
+
const formulas = {
|
|
507
|
+
A1: ['=IF(TRUE,"IFS(","SORT(")', "<f>IF(TRUE,"IFS(","SORT(")</f>"],
|
|
508
|
+
A2: [
|
|
509
|
+
'=IFS(TRUE,"IFS(")&SORT("a")',
|
|
510
|
+
"<f>_xlfn.IFS(TRUE,"IFS(")&_xlfn._xlws.SORT("a")</f>",
|
|
511
|
+
],
|
|
512
|
+
A3: [
|
|
513
|
+
'=IF(A1="say ""IFS("" now",SEQUENCE(2),"x")',
|
|
514
|
+
"<f>IF(A1="say ""IFS("" now",_xlfn.SEQUENCE(2),"x")</f>",
|
|
515
|
+
],
|
|
516
|
+
A4: [
|
|
517
|
+
"=SORT('SORT(''s'!A1:A3)",
|
|
518
|
+
"<f>_xlfn._xlws.SORT('SORT(''s'!A1:A3)</f>",
|
|
519
|
+
],
|
|
520
|
+
};
|
|
521
|
+
const cells = Object.fromEntries(
|
|
522
|
+
Object.entries(formulas).map(([ref, [f]]) => [ref, { f: f as string, v: "IFS(" }]),
|
|
523
|
+
);
|
|
524
|
+
const { bytes } = await buildXlsx([{ name: "Data", cells }]);
|
|
525
|
+
const wb = XLSX.read(bytes, { type: "array", bookFiles: true });
|
|
526
|
+
const xml = String(
|
|
527
|
+
(wb as { files?: Record<string, { content: unknown }> }).files?.["xl/worksheets/sheet1.xml"]
|
|
528
|
+
?.content,
|
|
529
|
+
);
|
|
530
|
+
for (const [, expected] of Object.values(formulas)) expect(xml).toContain(expected as string);
|
|
531
|
+
});
|
|
532
|
+
|
|
533
|
+
test("refuses a hand-edited tab name Excel forbids", async () => {
|
|
534
|
+
await expect(buildXlsx([{ name: "a:b", cells: {} }])).rejects.toThrow(
|
|
535
|
+
"cannot export tab 'a:b'",
|
|
536
|
+
);
|
|
537
|
+
});
|
|
538
|
+
|
|
539
|
+
test("parse reads back what build wrote", async () => {
|
|
540
|
+
const { bytes } = await buildXlsx(tabs);
|
|
541
|
+
const back = await parseXlsx(bytes);
|
|
542
|
+
expect(back.tabs.map((t) => t.name)).toEqual(["Data", "Empty"]);
|
|
543
|
+
const data = back.tabs[0] as SheetTab;
|
|
544
|
+
expect(data.cells.B2?.f).toBe("=IFS(A2>1,A2*2,TRUE,0)");
|
|
545
|
+
expect(data.cells.A2).toEqual({ v: 3, nf: "0.00" });
|
|
546
|
+
expect(data.colWidths).toEqual({ A: 120 });
|
|
547
|
+
expect(data.merges).toEqual(["A1:B1"]);
|
|
548
|
+
});
|
|
549
|
+
});
|
|
@@ -33,6 +33,7 @@ const SYSTEM_TEMPLATES = [
|
|
|
33
33
|
"system.agent.outputs",
|
|
34
34
|
"system.agent.outputs.no_agent_fs",
|
|
35
35
|
"system.agent.repository",
|
|
36
|
+
"system.agent.repository.merge_policy",
|
|
36
37
|
"system.agent.role",
|
|
37
38
|
"system.agent.scripts_only_mode",
|
|
38
39
|
"system.agent.scripts_only_mode.slack",
|
|
@@ -125,11 +126,11 @@ describe("Session templates: registration", () => {
|
|
|
125
126
|
expect(sessionSystemEventTypes("session")).toEqual([...SESSION_TEMPLATES].sort());
|
|
126
127
|
});
|
|
127
128
|
|
|
128
|
-
test("registers
|
|
129
|
+
test("registers 40 system and session templates in total", () => {
|
|
129
130
|
const all = getAllTemplateDefinitions();
|
|
130
131
|
const sessionSystem = all.filter((d) => d.category === "system" || d.category === "session");
|
|
131
132
|
// 34 system blocks + 5 session composites.
|
|
132
|
-
expect(sessionSystem.length).toBe(
|
|
133
|
+
expect(sessionSystem.length).toBe(40);
|
|
133
134
|
});
|
|
134
135
|
|
|
135
136
|
test("drops the v1 blocks that prompt v2 deleted", () => {
|