@desplega.ai/agent-swarm 2.13.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-86f0sh6g.js → acp-targets-n7vm5atw.js} +10 -10
- package/dist/{actions-zv8vcxvr.js → actions-hq6wp9xv.js} +27 -27
- package/dist/{agent-fs-provision-jqshb33y.js → agent-fs-provision-y0qc1rdd.js} +4 -4
- package/dist/{amp-adapter-gt503ywc.js → amp-adapter-1qqs6h91.js} +3 -3
- package/dist/{app-6t4k5rh1.js → app-7m4z44rv.js} +10 -10
- package/dist/{approval-notifications-fcfw063h.js → approval-notifications-8sr41gjx.js} +11 -11
- package/dist/{assistant-9dzybh12.js → assistant-hkczwfv6.js} +28 -28
- package/dist/{boot-args-schema-xzfp2feg.js → boot-args-schema-8025snev.js} +1 -1
- package/dist/{boot-reembed-r88wngfg.js → boot-reembed-15m87nr1.js} +1 -1
- package/dist/{boot-reembed-3jz0p2jk.js → boot-reembed-4bbpxjh1.js} +1 -1
- package/dist/{boot-scrub-sweep-scrqhw48.js → boot-scrub-sweep-eajr97e9.js} +2 -2
- package/dist/{boot-seeds-vb2dcrrb.js → boot-seeds-9cwy39jx.js} +4 -4
- package/dist/{boxd-68n75y1s.js → boxd-hr8rsxzq.js} +1 -1
- package/dist/{claude-adapter-h3mp9hgs.js → claude-adapter-g61wa4rt.js} +9 -9
- package/dist/{claude-managed-adapter-kpbyj2vb.js → claude-managed-adapter-znkk0prm.js} +3 -3
- package/dist/{claude-managed-setup-0efr3wkg.js → claude-managed-setup-f1wndkr2.js} +2 -2
- package/dist/{claude-sdk-session-03dw669q.js → claude-sdk-session-687xzf21.js} +20763 -19381
- package/dist/{cli-gfcv679k.js → cli-04103ryh.js} +1 -1
- package/dist/{cli-hbq0kwxz.js → cli-0a336ze7.js} +4 -4
- package/dist/{cli-1v82d2w6.js → cli-0fx95c06.js} +4 -4
- package/dist/{cli-wxwv3t11.js → cli-0m77n7ej.js} +3 -3
- package/dist/{cli-j53hpbsm.js → cli-0xwb7zpt.js} +2 -2
- package/dist/{cli-0dg7ytxm.js → cli-13t0smbk.js} +917 -23
- package/dist/{cli-0pazkmd4.js → cli-1b5axkt1.js} +4 -4
- package/dist/{cli-6h88mn9q.js → cli-1carhg8g.js} +4 -4
- package/dist/{cli-hgsxnjyg.js → cli-1dr5at77.js} +10 -10
- package/dist/{cli-0jkenasr.js → cli-2v4xxnx2.js} +1 -1
- package/dist/{cli-dnh64e8e.js → cli-32xndx6b.js} +6 -6
- package/dist/{cli-hpb9x72z.js → cli-3m8vqehw.js} +9 -9
- package/dist/{cli-ercwc8xn.js → cli-3mf04tkh.js} +1 -1
- package/dist/{cli-7dbhnsj9.js → cli-3zyme1wt.js} +4 -4
- package/dist/{cli-s6zk31gr.js → cli-43dsqhcp.js} +4 -4
- package/dist/{cli-t35hx078.js → cli-4h90xaet.js} +2 -2
- package/dist/{cli-117g15t4.js → cli-4mj5g29m.js} +8 -8
- package/dist/{cli-47hz21se.js → cli-4tbvndmm.js} +4 -5
- package/dist/{cli-tn91wc6e.js → cli-50whymxq.js} +1 -1
- package/dist/{cli-js10kdk7.js → cli-5basv0e7.js} +19 -5
- package/dist/{cli-xfjn2kyq.js → cli-5v6b2am8.js} +5 -5
- package/dist/{cli-49f5jyhh.js → cli-6r1dwegd.js} +3 -3
- package/dist/{cli-kspxjftk.js → cli-7ewre3dm.js} +15 -6
- package/dist/{cli-n3qe7tyr.js → cli-84xtgbn6.js} +35 -2
- package/dist/{cli-w14j2z4k.js → cli-8cmjkbvj.js} +2 -2
- package/dist/{cli-2m6yaq6b.js → cli-8fj8yfmk.js} +1 -1
- package/dist/{cli-9m9kyw77.js → cli-8rbkw18r.js} +2 -2
- package/dist/{cli-x05p2d05.js → cli-9tevdxyf.js} +1 -1
- package/dist/{cli-f1952kjy.js → cli-9xx36trj.js} +4 -4
- package/dist/{cli-hc6e4tac.js → cli-a8ts6x1n.js} +6 -6
- package/dist/{cli-mh7pdxe0.js → cli-aebswqmz.js} +12 -12
- package/dist/{cli-ex1y88j3.js → cli-at67kvnp.js} +1 -1
- package/dist/{cli-b2jh3dyb.js → cli-bjmq14k9.js} +4 -4
- package/dist/{cli-mz34pxbk.js → cli-byxsctca.js} +11 -11
- package/dist/{cli-dka73bak.js → cli-c0tyzt73.js} +152 -12
- package/dist/{cli-wv20kbr3.js → cli-c8kqmzzf.js} +5 -5
- package/dist/{cli-qhhb30e8.js → cli-cd9acnvd.js} +9 -9
- package/dist/{cli-wndegmns.js → cli-cmgdptmx.js} +3 -3
- package/dist/{cli-1dbv9mj9.js → cli-cn6fpa1p.js} +1 -1
- package/dist/{cli-wrhbym01.js → cli-cp0m07wb.js} +6 -6
- package/dist/{cli-3p288654.js → cli-cpkxh68d.js} +2 -2
- package/dist/{cli-g6j6ac3h.js → cli-cqxwjb93.js} +2 -2
- package/dist/{cli-8hp56wat.js → cli-d2epqm0y.js} +1 -1
- package/dist/{cli-qm3ntjqs.js → cli-dd57p1gd.js} +13 -13
- package/dist/{cli-tstj6e8e.js → cli-fn8aj7gb.js} +250 -55
- package/dist/{cli-bpje8n65.js → cli-fp65jdp2.js} +31 -6
- package/dist/{cli-2skf1mdf.js → cli-gedf48yw.js} +4 -4
- package/dist/{cli-c8v2yvej.js → cli-gq6qhmrr.js} +2 -2
- package/dist/{cli-sq913bh1.js → cli-grcc2h2g.js} +8 -8
- package/dist/{cli-qec9bynj.js → cli-h03j6je3.js} +3 -3
- package/dist/{cli-mbwmqb5w.js → cli-h0ewec3d.js} +1 -1
- package/dist/{cli-jj3c5nyb.js → cli-h9bejmkf.js} +76 -39
- package/dist/{cli-ct8sz3np.js → cli-hs3mqswp.js} +6 -6
- package/dist/{cli-tdk7jtka.js → cli-hv3820ez.js} +1 -1
- package/dist/{cli-pqfecppn.js → cli-je587f74.js} +1 -1
- package/dist/{cli-y4a4458j.js → cli-jhtvt7gn.js} +3 -3
- package/dist/{cli-dkejt425.js → cli-mmw2sjaf.js} +7 -7
- package/dist/{cli-50w82h6m.js → cli-mwxez0pz.js} +1 -0
- package/dist/{cli-avxh26pd.js → cli-nk8swfpx.js} +4 -4
- package/dist/{cli-fhvk2nvp.js → cli-p7g7wd9n.js} +9 -9
- package/dist/{cli-bhgrhedp.js → cli-q8aq48v1.js} +1 -1
- package/dist/{cli-6a40p4kv.js → cli-qn79645p.js} +1 -1
- package/dist/{cli-nc6a8b5b.js → cli-qx1dwrr5.js} +2 -2
- package/dist/{cli-sdh61g52.js → cli-s6fhqbz1.js} +2 -2
- package/dist/{cli-eb279wn3.js → cli-sfajkbd7.js} +2 -2
- package/dist/{cli-z64t9pe6.js → cli-snypfjgj.js} +1 -1
- package/dist/{cli-ytc7fpza.js → cli-t25rq8mg.js} +4 -4
- package/dist/{cli-zqmmy073.js → cli-t90k0phh.js} +18 -18
- package/dist/{cli-fz9pcjsw.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-y518qkjg.js → cli-w24f3j49.js} +10 -10
- package/dist/{cli-yn4kt85g.js → cli-w41bvvms.js} +1 -1
- package/dist/{cli-9fsagra4.js → cli-w6c6dj91.js} +1 -1
- package/dist/{cli-kde4ky90.js → cli-x5yb8zc8.js} +2 -2
- package/dist/{cli-48nvk6sb.js → cli-xhkek467.js} +2 -2
- package/dist/{cli-avqkr20b.js → cli-y6qqbpwc.js} +2 -2
- package/dist/{cli-7wy8gbwb.js → cli-ya1cj689.js} +1 -1
- package/dist/{cli-prf7kz78.js → cli-yeh3g1q6.js} +603 -78
- package/dist/{cli-ajjvqhf3.js → cli-z6m6xzxt.js} +2 -2
- package/dist/{cli-2jk4s7z1.js → cli-zaate0rd.js} +3 -3
- package/dist/{cli-n85m2wkq.js → cli-zkbz8m2q.js} +3 -2
- package/dist/{cli-0b655smz.js → cli-zvpkrgsc.js} +5 -5
- package/dist/cli.js +27 -27
- package/dist/{codex-adapter-f3yp0kaj.js → codex-adapter-ysfg6ty3.js} +8 -8
- package/dist/{codex-hook-262cekfp.js → codex-hook-c0nvm30r.js} +2 -2
- package/dist/{codex-login-1ven7yje.js → codex-login-ven5cz5j.js} +1 -1
- package/dist/{codex-session-runner-ns4mv70p.js → codex-session-runner-823scr6g.js} +9 -9
- package/dist/{commands-5bzf2tfw.js → commands-5rbm07fz.js} +3 -3
- package/dist/{controller-5xt7kvfm.js → controller-wn3vd217.js} +3 -3
- package/dist/{controllers-connect-0gg13mzp.js → controllers-connect-34jzhfft.js} +28 -28
- package/dist/core-kdehq26g.js +42 -0
- package/dist/{cursor-adapter-p0c5zv6r.js → cursor-adapter-w1681kp1.js} +2 -2
- package/dist/{db-2s68ycq7.js → db-6bkgbfwk.js} +3 -3
- package/dist/{db-q7q639k5.js → db-hcj16x7z.js} +2 -2
- package/dist/{devin-adapter-t8d86q9x.js → devin-adapter-fs90ab4v.js} +1 -1
- package/dist/{dispatcher-j2y1q7ae.js → dispatcher-jgjqrfzv.js} +25 -25
- package/dist/{docker-1b41eysj.js → docker-1h33jvh9.js} +2 -2
- package/dist/{dsh-adapter-pgnkf4st.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-0kea97jf.js → easter-egg-3d-w17nsny6.js} +1 -1
- package/dist/{embedding-space-3n6mhhmy.js → embedding-space-v06fwy7b.js} +6 -6
- package/dist/{embeddings-jfmj6yme.js → embeddings-g50dxea4.js} +1 -1
- package/dist/{event-bus-v4ywhc2p.js → event-bus-08t2b4y2.js} +1 -1
- package/dist/{execute-tjrej979.js → execute-1n36haw1.js} +1 -1
- package/dist/{external-channel-jy8w2gg3.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-bpnncsec.js → hook-dqph1e05.js} +8 -8
- package/dist/{hook-fv1jwrv7.js → hook-m1m9dm6w.js} +6 -6
- package/dist/{http-bpa26czn.js → http-w0th1cz9.js} +160 -102
- package/dist/index-22khdtby.js +44 -0
- package/dist/{index-mpj0z9e0.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-w216g9y9.js → index-ffba0z8q.js} +35 -21
- package/dist/{index-s8re7mvq.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-52tgbhrw.js → index-pb03vans.js} +28 -28
- 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-d6z12s04.js → keepalive-2v06q2e8.js} +5 -4
- package/dist/lead-55z813ng.js +79 -0
- package/dist/{maintenance-7kac6g2g.js → maintenance-vx7vjhhy.js} +1 -1
- package/dist/{oauth-refresh-sweep-t1xjetbh.js → oauth-refresh-sweep-g06k4bza.js} +4 -3
- package/dist/{object-webhooks-6rdagg0r.js → object-webhooks-3dzdq4fm.js} +7 -7
- package/dist/{onboard-32y1cfxy.js → onboard-232pazny.js} +4 -4
- package/dist/{opencode-adapter-enp3v31n.js → opencode-adapter-t0paqbh8.js} +8 -8
- package/dist/{otel-impl-k0tm5ptj.js → otel-impl-kmpkyp4y.js} +2 -2
- package/dist/{pending-24zebgvs.js → pending-x0z3vx1x.js} +26 -26
- package/dist/{pi-mono-adapter-yj72xxxe.js → pi-mono-adapter-7pmypn6d.js} +17 -15
- package/dist/{pricing-refresh-cf25x38j.js → pricing-refresh-ytjmtyd7.js} +2 -2
- package/dist/{rbac-roles-0wydd22m.js → rbac-roles-fgm5mxr2.js} +3 -3
- package/dist/{rbac-roles-at6crb3r.js → rbac-roles-xyaxekh3.js} +2 -2
- package/dist/{render-v2-nvcw0jd7.js → render-v2-ws972g4r.js} +10 -10
- package/dist/{resume-y4w0k5v3.js → resume-m6mjzhkp.js} +13 -13
- package/dist/{runtime-vpe43hx0.js → runtime-zzpc0c8a.js} +1 -1
- package/dist/{session-access-gkyvnfye.js → session-access-vp35xs91.js} +5 -5
- package/dist/{session-source-backfill-3w2st4m2.js → session-source-backfill-p73e8zbe.js} +2 -2
- package/dist/{setup-axxvqtys.js → setup-r4kd7rxg.js} +1 -1
- package/dist/thread-buffer-cm2nzq6t.js +42 -0
- package/dist/{tree-visibility-y4fqvab5.js → tree-visibility-07h2tbs2.js} +2 -2
- package/dist/{user-merge-jobs-kcmwvrc6.js → user-merge-jobs-96vg9rpe.js} +3 -3
- package/dist/{virtual-modules-7d92dct1.js → virtual-modules-vgn3f2x4.js} +3 -3
- package/dist/{work-objects-f708e069.js → work-objects-74hbcx3e.js} +28 -28
- package/dist/worker-5pn2vzx6.js +79 -0
- package/dist/{worker-follow-up-0by8wztc.js → worker-follow-up-ezavwn5d.js} +25 -25
- package/dist/{x-3dtaf2r9.js → x-asbrnafg.js} +2 -2
- package/openapi.json +1793 -1622
- package/package.json +10 -10
- package/src/apps/catalog.generated.json +726 -0
- package/src/apps/definition.ts +24 -7
- package/src/apps/page-validator.ts +225 -3
- package/src/be/db.ts +38 -10
- package/src/be/mcp-proxy.ts +5 -4
- package/src/be/migrations/340_api_key_spend_cap.sql +5 -0
- package/src/be/schedules/validate.ts +26 -0
- package/src/be/swarm-config-guard.ts +4 -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/extensions/contract-types.generated.ts +1 -1
- package/src/http/agents.ts +4 -0
- package/src/http/api-keys.ts +27 -3
- package/src/http/pages-public.ts +40 -4
- package/src/http/pool-keys.ts +21 -2
- package/src/http/schedules.ts +28 -3
- package/src/http/script-connections.ts +12 -4
- package/src/http/script-runs.ts +12 -3
- package/src/http/tasks.ts +6 -10
- 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/session-templates.ts +1 -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/pi-mono-adapter.ts +4 -2
- package/src/providers/runtime-dependencies.ts +1 -1
- package/src/rbac/legacy-policy.ts +2 -0
- package/src/rbac/permissions.ts +5 -0
- package/src/scripts-runtime/types/swarm-extension.d.ts +7 -7
- package/src/slack/enrich.ts +14 -11
- package/src/tests/agents-list-model-display.test.ts +23 -0
- package/src/tests/apps-spike2.test.ts +35 -0
- package/src/tests/base-prompt.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/fake-dns.ts +47 -0
- package/src/tests/fixtures/base-prompt-baseline.json +12 -12
- 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-stall.test.ts +5 -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/pages-head-v2.test.ts +2 -1
- package/src/tests/script-connections-http.test.ts +8 -3
- package/src/tests/script-connections.test.ts +2 -0
- package/src/tests/slack-thread-participants.test.ts +14 -3
- 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/worktree-reaper.test.ts +424 -0
- package/src/tools/get-task-details.ts +247 -5
- package/src/tools/schedules/patch-schedule.ts +26 -1
- package/src/tools/schedules/update-schedule.ts +28 -2
- package/src/utils/credentials.ts +36 -1
- package/src/utils/egress-guard.ts +40 -10
- package/src/utils/error-tracker.ts +17 -0
- package/templates/skills/apps/SKILL.md +191 -2
- package/templates/skills/apps/content.md +191 -2
- package/templates/skills/boards-and-sheets/content.md +11 -0
- package/templates/skills/pages/content.md +11 -0
- package/templates/skills/swarm-docs/content.md +2 -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-cn53011z.js +0 -17
- package/dist/cli-pr0eze3x.js +0 -149
- package/dist/core-0fqtbrxa.js +0 -42
- package/dist/fx-adapter-k6w3jvz9.js +0 -20
- package/dist/grok-adapter-4q5tssw0.js +0 -20
- package/dist/handlers-qxgfvvsf.js +0 -41
- package/dist/heartbeat-6tr2w2da.js +0 -50
- package/dist/index-0mcxjdsa.js +0 -44
- package/dist/index-dz4q23ag.js +0 -40
- package/dist/index-s175jckx.js +0 -39
- package/dist/lead-p3hx7h35.js +0 -79
- package/dist/thread-buffer-rwa7d4dx.js +0 -42
- package/dist/worker-8rg9gz74.js +0 -79
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { afterAll, afterEach, beforeAll, describe, expect, test } from "bun:test";
|
|
2
|
+
import {
|
|
3
|
+
exchangeAuthorizationCode,
|
|
4
|
+
type OAuthProviderConfig,
|
|
5
|
+
performTokenRefreshRequest,
|
|
6
|
+
refreshTokenGrant,
|
|
7
|
+
} from "../oauth/wrapper";
|
|
8
|
+
import { setFakeDnsAnswer } from "./fake-dns";
|
|
9
|
+
|
|
10
|
+
// No lookup leaves the process: `auth.public.test` resolves to a public address
|
|
11
|
+
// (reserved test name), `rebind.public.test` to loopback.
|
|
12
|
+
setFakeDnsAnswer("rebind.public.test", ["127.0.0.1"]);
|
|
13
|
+
|
|
14
|
+
const originalFetch = globalThis.fetch;
|
|
15
|
+
const savedEnv = {
|
|
16
|
+
NODE_ENV: process.env.NODE_ENV,
|
|
17
|
+
ALLOW_PRIVATE_NETWORK_URLS: process.env.ALLOW_PRIVATE_NETWORK_URLS,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
type Seen = { host: string; hostname: string; body: string | null };
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* A fetch stand-in that records every request and answers from `route`.
|
|
24
|
+
* Requests are routed by the Host header (an address-pinned request keeps the
|
|
25
|
+
* original name there).
|
|
26
|
+
*/
|
|
27
|
+
function installFetch(route: (host: string) => Response): Seen[] {
|
|
28
|
+
const seen: Seen[] = [];
|
|
29
|
+
globalThis.fetch = (async (input: string | URL | Request, init?: RequestInit) => {
|
|
30
|
+
const url = new URL(
|
|
31
|
+
typeof input === "string" ? input : input instanceof URL ? input.href : input.url,
|
|
32
|
+
);
|
|
33
|
+
const host = new Headers(init?.headers).get("host") ?? url.host;
|
|
34
|
+
seen.push({
|
|
35
|
+
host,
|
|
36
|
+
hostname: url.hostname,
|
|
37
|
+
body: typeof init?.body === "string" ? init.body : null,
|
|
38
|
+
});
|
|
39
|
+
return route(host);
|
|
40
|
+
}) as typeof fetch;
|
|
41
|
+
return seen;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const isLoopback = (s: Seen) =>
|
|
45
|
+
s.hostname === "127.0.0.1" || s.host.startsWith("127.0.0.1") || s.host === "rebind.public.test";
|
|
46
|
+
|
|
47
|
+
const tokens = () => Response.json({ access_token: "new-access", token_type: "Bearer" });
|
|
48
|
+
|
|
49
|
+
function config(tokenUrl: string): OAuthProviderConfig {
|
|
50
|
+
return {
|
|
51
|
+
provider: "token-guard-test",
|
|
52
|
+
clientId: "client-id",
|
|
53
|
+
clientSecret: "client-secret-value",
|
|
54
|
+
authorizeUrl: "https://auth.public.test/authorize",
|
|
55
|
+
tokenUrl,
|
|
56
|
+
redirectUri: "https://swarm.public.test/callback",
|
|
57
|
+
scopes: [],
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const exchange = (tokenUrl: string) =>
|
|
62
|
+
exchangeAuthorizationCode(config(tokenUrl), {
|
|
63
|
+
code: "the-code",
|
|
64
|
+
codeVerifier: "the-verifier",
|
|
65
|
+
redirectUri: "https://swarm.public.test/callback",
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// The three requests that POST the client secret to the token endpoint.
|
|
69
|
+
const tokenRequests: Array<[string, (tokenUrl: string) => Promise<unknown>]> = [
|
|
70
|
+
["exchangeAuthorizationCode", exchange],
|
|
71
|
+
["refreshTokenGrant", (tokenUrl) => refreshTokenGrant(config(tokenUrl), "the-refresh-token")],
|
|
72
|
+
[
|
|
73
|
+
"performTokenRefreshRequest",
|
|
74
|
+
(tokenUrl) => performTokenRefreshRequest(config(tokenUrl), "the-refresh-token"),
|
|
75
|
+
],
|
|
76
|
+
];
|
|
77
|
+
|
|
78
|
+
beforeAll(() => {
|
|
79
|
+
process.env.NODE_ENV = "production";
|
|
80
|
+
delete process.env.ALLOW_PRIVATE_NETWORK_URLS;
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
afterEach(() => {
|
|
84
|
+
globalThis.fetch = originalFetch;
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
afterAll(() => {
|
|
88
|
+
for (const [key, value] of Object.entries(savedEnv)) {
|
|
89
|
+
if (value === undefined) delete process.env[key];
|
|
90
|
+
else process.env[key] = value;
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
describe.each(tokenRequests)("%s token endpoint request", (_name, send) => {
|
|
95
|
+
test("control: a public token endpoint receives the client secret", async () => {
|
|
96
|
+
const seen = installFetch(tokens);
|
|
97
|
+
await send("https://auth.public.test/token");
|
|
98
|
+
expect(seen).toHaveLength(1);
|
|
99
|
+
expect(seen[0]?.host).toBe("auth.public.test");
|
|
100
|
+
expect(seen[0]?.body).toContain("client_secret=client-secret-value");
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
test("does not send the client secret to a name that resolves to a loopback address", async () => {
|
|
104
|
+
const seen = installFetch(tokens);
|
|
105
|
+
await expect(send("https://rebind.public.test/token")).rejects.toThrow();
|
|
106
|
+
expect(seen.filter(isLoopback)).toEqual([]);
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
test("code exchange does not follow a redirect to a name that resolves to a loopback address", async () => {
|
|
111
|
+
const seen = installFetch((host) =>
|
|
112
|
+
host === "auth.public.test"
|
|
113
|
+
? new Response(null, {
|
|
114
|
+
status: 307,
|
|
115
|
+
headers: { location: "https://rebind.public.test/token" },
|
|
116
|
+
})
|
|
117
|
+
: tokens(),
|
|
118
|
+
);
|
|
119
|
+
await expect(exchange("https://auth.public.test/token")).rejects.toThrow();
|
|
120
|
+
expect(seen.filter(isLoopback)).toEqual([]);
|
|
121
|
+
});
|
|
@@ -162,8 +162,7 @@ describe("exchangeAuthorizationCode", () => {
|
|
|
162
162
|
redirectUri: testConfig.redirectUri,
|
|
163
163
|
});
|
|
164
164
|
const [, init] = fetchSpy.mock.calls[0] as [string, RequestInit];
|
|
165
|
-
|
|
166
|
-
expect(headers.Accept).toBe("application/json");
|
|
165
|
+
expect(new Headers(init.headers).get("accept")).toBe("application/json");
|
|
167
166
|
} finally {
|
|
168
167
|
fetchSpy.mockRestore();
|
|
169
168
|
}
|
|
@@ -457,7 +457,8 @@ describe("GET /p/:id serves the head of the page's design version", () => {
|
|
|
457
457
|
).text();
|
|
458
458
|
const id = await createPage("v1-page", { designVersion: 1 });
|
|
459
459
|
const page = await serve(id, `?${PAGE_THEME_PARAM}=github&${PAGE_MODE_PARAM}=dark`);
|
|
460
|
-
|
|
460
|
+
// The viewer meta for `<swarm-object>` follows the frozen head; the head itself is unchanged.
|
|
461
|
+
expect(page).toContain(`<head>${baseline}<meta name="swarm-viewer" content="guest"><script>`);
|
|
461
462
|
expect(page).toContain("--swarm-bg: #fbfbfa");
|
|
462
463
|
expect(page).not.toContain("@tailwindcss/browser");
|
|
463
464
|
expect(page).not.toContain(DARK_SCRIPT);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// Resolves the reserved example names these tests fetch, without real DNS.
|
|
2
|
+
import "./fake-dns";
|
|
1
3
|
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, test } from "bun:test";
|
|
2
4
|
import { unlink } from "node:fs/promises";
|
|
3
5
|
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
@@ -957,9 +959,12 @@ describe("/api/script-connections HTTP", () => {
|
|
|
957
959
|
const previousNodeEnv = process.env.NODE_ENV;
|
|
958
960
|
process.env.NODE_ENV = "production";
|
|
959
961
|
const requested: string[] = [];
|
|
960
|
-
globalThis.fetch = (async (input: RequestInfo | URL) => {
|
|
961
|
-
|
|
962
|
-
|
|
962
|
+
globalThis.fetch = (async (input: RequestInfo | URL, init?: RequestInit) => {
|
|
963
|
+
// A production request connects to the checked address; Host keeps the name.
|
|
964
|
+
const url = new URL(String(input));
|
|
965
|
+
const host = new Headers(init?.headers).get("host");
|
|
966
|
+
if (host) url.host = host;
|
|
967
|
+
requested.push(url.href);
|
|
963
968
|
return new Response(null, {
|
|
964
969
|
status: 302,
|
|
965
970
|
headers: { location: "http://127.0.0.1/.well-known/oauth-authorization-server" },
|
|
@@ -724,6 +724,8 @@ describe("script connections", () => {
|
|
|
724
724
|
markMigrationApplied(database, "337_favorites_session_hidden_key.sql");
|
|
725
725
|
// 338 alters scripts, workflows, scheduled_tasks and skills, none of which this fixture creates.
|
|
726
726
|
markMigrationApplied(database, "338_audit_agent_columns.sql");
|
|
727
|
+
// 340 alters api_key_status, which this migration-112-only fixture does not create.
|
|
728
|
+
markMigrationApplied(database, "340_api_key_spend_cap.sql");
|
|
727
729
|
|
|
728
730
|
const id = crypto.randomUUID();
|
|
729
731
|
const now = new Date().toISOString();
|
|
@@ -154,9 +154,13 @@ describe("resolveSlackParticipant", () => {
|
|
|
154
154
|
(await findUserByExternalId("slack", "U0OURS2"))?.id,
|
|
155
155
|
);
|
|
156
156
|
expect(await findUserByExternalId("slack", "U0OURS2")).not.toBeNull();
|
|
157
|
+
// Regression control: the sender from our own team stays internal.
|
|
158
|
+
expect(
|
|
159
|
+
(await resolveSlackParticipant(client, "U0OURS2", { ...ctx, userTeam: "T0OURS" })).trust,
|
|
160
|
+
).toBe("internal");
|
|
157
161
|
|
|
158
162
|
// auth.test failed: a sender carrying a team cannot be shown to be ours, so the
|
|
159
|
-
// email links nothing, even an existing user
|
|
163
|
+
// email links nothing, even an existing user, and grants no trust.
|
|
160
164
|
resetSlackTeamIdCacheForTesting();
|
|
161
165
|
authTest = async () => {
|
|
162
166
|
throw new Error("auth.test failed");
|
|
@@ -174,9 +178,16 @@ describe("resolveSlackParticipant", () => {
|
|
|
174
178
|
expect(await findUserByExternalId("slack", "U0NOAUTH")).toBeNull();
|
|
175
179
|
expect(
|
|
176
180
|
await resolveSlackParticipant(client, "U0NOAUTH", { ...ctx, userTeam: "T0OTHER" }),
|
|
177
|
-
).toEqual({ userId: undefined, trust: "
|
|
181
|
+
).toEqual({ userId: undefined, trust: "unknown" });
|
|
178
182
|
// Positive control: with no team on the event, the same email still links.
|
|
179
|
-
|
|
183
|
+
const noTeam = await resolveSlackParticipant(client, "U0NOAUTH", ctx);
|
|
184
|
+
expect(noTeam).toEqual({ userId: owner.id, trust: "internal" });
|
|
185
|
+
// An explicit audience still wins over the unknown team.
|
|
186
|
+
await makeUser("U0NOAUTHSET", "set@gmail.test", { metadata: { audience: "internal" } });
|
|
187
|
+
expect(
|
|
188
|
+
(await resolveSlackParticipant(client, "U0NOAUTHSET", { ...ctx, userTeam: "T0OTHER" }))
|
|
189
|
+
.trust,
|
|
190
|
+
).toBe("internal");
|
|
180
191
|
} finally {
|
|
181
192
|
authTest = async () => ourTeam;
|
|
182
193
|
resetSlackTeamIdCacheForTesting();
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import { KeySpendCapError, resolveCredentialPools } from "../utils/credentials";
|
|
3
|
+
|
|
4
|
+
const POOL = "sk-or-v1-aaaaa11111,sk-or-v1-bbbbb22222";
|
|
5
|
+
|
|
6
|
+
function pick(spendCappedIndices: number[], availableIndices: number[] = []) {
|
|
7
|
+
return resolveCredentialPools(
|
|
8
|
+
{ OPENROUTER_API_KEY: POOL },
|
|
9
|
+
{
|
|
10
|
+
provider: "pi",
|
|
11
|
+
enforceModelCapacity: true,
|
|
12
|
+
availableIndicesMap: { OPENROUTER_API_KEY: { availableIndices, spendCappedIndices } },
|
|
13
|
+
},
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
describe("resolveCredentialPools with spend-capped keys", () => {
|
|
18
|
+
test("every key capped fails the task before the CLI starts", async () => {
|
|
19
|
+
await expect(pick([0, 1])).rejects.toBeInstanceOf(KeySpendCapError);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test("the best-effort pick skips a capped key", async () => {
|
|
23
|
+
for (let i = 0; i < 20; i++) {
|
|
24
|
+
const [selection] = await pick([0]);
|
|
25
|
+
expect(selection?.index).toBe(1);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
test("an available key is drawn as before", async () => {
|
|
30
|
+
const [selection] = await pick([0], [1]);
|
|
31
|
+
expect(selection?.index).toBe(1);
|
|
32
|
+
expect(selection?.isRateLimitFallback).toBe(false);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import { classifyProviderErrorOf } from "../commands/provider-error-class";
|
|
3
|
+
import { classifyRateLimitOutcome, parseSpendCapMessage } from "../commands/rate-limit-outcome";
|
|
4
|
+
|
|
5
|
+
const NOW = Date.parse("2026-11-12T21:14:00Z");
|
|
6
|
+
/** The 31-day spend-cap horizon; spelled out so the test imports only worker-runtime code. */
|
|
7
|
+
const MAX_SPEND_CAP_HOLD_MS = 31 * 24 * 60 * 60 * 1000;
|
|
8
|
+
|
|
9
|
+
/** The body from the report, as the task failure carried it. */
|
|
10
|
+
const REPORTED =
|
|
11
|
+
'403 {"message":"Key limit exceeded (weekly limit)...","code":403,"metadata":{"limit_source":"openrouter_key_limit","scope":"key_limit","limit_usd":1,"spend_usd":1.07,"resets_at":"2026-11-16T00:00:00Z"}}';
|
|
12
|
+
|
|
13
|
+
/** The full OpenRouter body. Its remedy hint says "usage limit", which read as a 5-minute rate limit. */
|
|
14
|
+
const FULL =
|
|
15
|
+
'403: {"message":"Key limit exceeded (weekly limit). Manage it using https://openrouter.ai/workspaces/default/keys/abc. $1.07 of $1.00 used; resets 2026-11-16T00:00:00.000Z.","code":403,"metadata":{"limit_source":"openrouter_key_limit","remedy_hint":"Raise or remove this API key\'s usage limit at https://openrouter.ai/settings/keys, or use a key without a limit.","scope":"key_limit","limit_usd":1,"spend_usd":1.066227867,"resets_at":"2026-11-16T00:00:00.000Z"}}';
|
|
16
|
+
|
|
17
|
+
describe("OpenRouter spend caps", () => {
|
|
18
|
+
test("the reported 403 body is a spend cap held until resets_at", () => {
|
|
19
|
+
expect(parseSpendCapMessage(REPORTED)).toEqual({
|
|
20
|
+
limitUsd: 1,
|
|
21
|
+
spendUsd: 1.07,
|
|
22
|
+
resetsAt: "2026-11-16T00:00:00.000Z",
|
|
23
|
+
});
|
|
24
|
+
expect(classifyRateLimitOutcome({}, REPORTED, NOW)).toEqual({
|
|
25
|
+
kind: "key",
|
|
26
|
+
rateLimitedUntil: "2026-11-16T00:00:00.000Z",
|
|
27
|
+
spendCap: { limitUsd: 1, spendUsd: 1.07, resetsAt: "2026-11-16T00:00:00.000Z" },
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test("the full body with its 'usage limit' remedy hint is a spend cap, not a 5-minute rate limit", () => {
|
|
32
|
+
const outcome = classifyRateLimitOutcome({}, FULL, NOW);
|
|
33
|
+
expect(outcome.kind === "key" && outcome.rateLimitedUntil).toBe("2026-11-16T00:00:00.000Z");
|
|
34
|
+
expect(outcome.kind === "key" && outcome.spendCap?.spendUsd).toBe(1.066227867);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test("the message alone gives the amounts and the reset", () => {
|
|
38
|
+
expect(
|
|
39
|
+
parseSpendCapMessage("Key limit exceeded. $1.07 of $1.00 used; resets 2026-11-16T00:00:00Z."),
|
|
40
|
+
).toEqual({ limitUsd: 1, spendUsd: 1.07, resetsAt: "2026-11-16T00:00:00.000Z" });
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test("a 402 with no reset holds the key for the full spend-cap horizon", () => {
|
|
44
|
+
const text =
|
|
45
|
+
'402 {"error":{"message":"Insufficient credits. Add more using https://openrouter.ai/settings/credits","code":402}}';
|
|
46
|
+
const outcome = classifyRateLimitOutcome({}, text, NOW);
|
|
47
|
+
expect(outcome).toEqual({
|
|
48
|
+
kind: "key",
|
|
49
|
+
rateLimitedUntil: new Date(NOW + MAX_SPEND_CAP_HOLD_MS).toISOString(),
|
|
50
|
+
spendCap: { limitUsd: null, spendUsd: null, resetsAt: null },
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
test("a spend cap is the credits fallback class; a plain rate limit stays rate_limit", () => {
|
|
55
|
+
const pi = (text: string) =>
|
|
56
|
+
classifyProviderErrorOf({ exitCode: 1 }, text, "deepseek/deepseek-v4", undefined, NOW);
|
|
57
|
+
expect(pi(REPORTED)).toBe("credits");
|
|
58
|
+
expect(pi("429 Too Many Requests")).toBe("rate_limit");
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
test("ordinary rate limits and Codex credits are not spend caps", () => {
|
|
62
|
+
expect(parseSpendCapMessage("429 Too Many Requests")).toBeNull();
|
|
63
|
+
expect(parseSpendCapMessage("Claude usage limit reached")).toBeNull();
|
|
64
|
+
expect(parseSpendCapMessage("Your workspace is out of credits.")).toBeNull();
|
|
65
|
+
expect(parseSpendCapMessage("Fable 5.1 requires usage credits")).toBeNull();
|
|
66
|
+
});
|
|
67
|
+
});
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Subscription-first credential selection: one resolver reads each harness's
|
|
3
|
+
* `chatgptSubscriptionTrait`. A codex_oauth pool slot serves OpenAI models
|
|
4
|
+
* before OPENAI_API_KEY; with no slot the model keeps its API key.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { describe, expect, test } from "bun:test";
|
|
8
|
+
import { type CodexOAuthCredentialInfo, resolveSubscriptionFirst } from "../commands/runner";
|
|
9
|
+
import { resolveModel } from "../providers/pi-mono-adapter";
|
|
10
|
+
|
|
11
|
+
const slot: CodexOAuthCredentialInfo = {
|
|
12
|
+
selection: {
|
|
13
|
+
selected: "pool-slot-1",
|
|
14
|
+
index: 1,
|
|
15
|
+
total: 2,
|
|
16
|
+
keySuffix: "abcde",
|
|
17
|
+
keyType: "CODEX_OAUTH",
|
|
18
|
+
isRateLimitFallback: false,
|
|
19
|
+
},
|
|
20
|
+
isPoolBacked: true,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** A pool lookup that records each call's `poolOnly`. */
|
|
24
|
+
function pool(result: CodexOAuthCredentialInfo | null) {
|
|
25
|
+
const calls: boolean[] = [];
|
|
26
|
+
return {
|
|
27
|
+
calls,
|
|
28
|
+
resolve: async (poolOnly: boolean) => {
|
|
29
|
+
calls.push(poolOnly);
|
|
30
|
+
return result;
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
describe("pi (prefixed trait)", () => {
|
|
36
|
+
test("a slot moves a bare or openai/ GPT model onto openai-codex", async () => {
|
|
37
|
+
for (const model of ["gpt-5.6-luna", "openai/gpt-5.6-luna"]) {
|
|
38
|
+
const p = pool(slot);
|
|
39
|
+
expect(await resolveSubscriptionFirst("pi", model, p.resolve)).toEqual({
|
|
40
|
+
model: "openai-codex/gpt-5.6-luna",
|
|
41
|
+
oauthInfo: slot,
|
|
42
|
+
});
|
|
43
|
+
expect(p.calls).toEqual([true]);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test("no slot keeps the model, which then resolves to pi-ai's openai provider", async () => {
|
|
48
|
+
expect(await resolveSubscriptionFirst("pi", "gpt-5.6-luna", pool(null).resolve)).toEqual({
|
|
49
|
+
model: "gpt-5.6-luna",
|
|
50
|
+
oauthInfo: null,
|
|
51
|
+
});
|
|
52
|
+
// Bare ids used to stop at the first (anthropic) miss and run pi's default model.
|
|
53
|
+
expect(resolveModel("gpt-5.6-luna", {})?.provider).toBe("openai");
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
test("an explicit openai-codex model stays as is with or without a slot", async () => {
|
|
57
|
+
const model = "openai-codex/gpt-6.1-sol";
|
|
58
|
+
expect(await resolveSubscriptionFirst("pi", model, pool(slot).resolve)).toEqual({
|
|
59
|
+
model,
|
|
60
|
+
oauthInfo: slot,
|
|
61
|
+
});
|
|
62
|
+
expect(await resolveSubscriptionFirst("pi", model, pool(null).resolve)).toEqual({
|
|
63
|
+
model,
|
|
64
|
+
oauthInfo: null,
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
test("non-Codex-line models never touch the pool", async () => {
|
|
69
|
+
const p = pool(slot);
|
|
70
|
+
for (const model of [
|
|
71
|
+
"",
|
|
72
|
+
"sonnet",
|
|
73
|
+
"gpt-4o",
|
|
74
|
+
"openrouter/openai/gpt-5.6-luna",
|
|
75
|
+
"nan/gpt-5.6-luna",
|
|
76
|
+
]) {
|
|
77
|
+
expect(await resolveSubscriptionFirst("pi", model, p.resolve)).toEqual({
|
|
78
|
+
model,
|
|
79
|
+
oauthInfo: null,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
expect(p.calls).toEqual([]);
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
describe("codex (native trait)", () => {
|
|
87
|
+
test("a slot serves the model unchanged, auth.json fallback allowed", async () => {
|
|
88
|
+
const p = pool(slot);
|
|
89
|
+
expect(await resolveSubscriptionFirst("codex", "gpt-5.6-luna", p.resolve)).toEqual({
|
|
90
|
+
model: "gpt-5.6-luna",
|
|
91
|
+
oauthInfo: slot,
|
|
92
|
+
});
|
|
93
|
+
expect(p.calls).toEqual([false]);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
test("no slot keeps the model on OPENAI_API_KEY", async () => {
|
|
97
|
+
expect(await resolveSubscriptionFirst("codex", "gpt-5.6-luna", pool(null).resolve)).toEqual({
|
|
98
|
+
model: "gpt-5.6-luna",
|
|
99
|
+
oauthInfo: null,
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
describe("unsupported traits (opencode, claude)", () => {
|
|
105
|
+
test("OpenAI models keep their API key even when the pool has a slot", async () => {
|
|
106
|
+
for (const [harness, model] of [
|
|
107
|
+
["opencode", "openai/gpt-5.6-luna"],
|
|
108
|
+
["opencode", "gpt-5.6-luna"],
|
|
109
|
+
["claude", "sonnet"],
|
|
110
|
+
] as const) {
|
|
111
|
+
const p = pool(slot);
|
|
112
|
+
expect(await resolveSubscriptionFirst(harness, model, p.resolve)).toEqual({
|
|
113
|
+
model,
|
|
114
|
+
oauthInfo: null,
|
|
115
|
+
});
|
|
116
|
+
expect(p.calls).toEqual([]);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
});
|