@desplega.ai/agent-swarm 2.13.0 → 2.13.2
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/README.md +1 -1
- package/dist/acp-adapter-x1qqgzwx.js +17 -0
- package/dist/{acp-targets-86f0sh6g.js → acp-targets-mz8c5dnt.js} +10 -10
- package/dist/{actions-zv8vcxvr.js → actions-5ft3qp5a.js} +27 -27
- package/dist/{agent-fs-provision-jqshb33y.js → agent-fs-provision-6fgz7wvz.js} +4 -4
- package/dist/{amp-adapter-gt503ywc.js → amp-adapter-nthn8ezm.js} +3 -3
- package/dist/{app-6t4k5rh1.js → app-535m78qw.js} +10 -10
- package/dist/{approval-notifications-fcfw063h.js → approval-notifications-dewbk403.js} +11 -11
- package/dist/{assistant-9dzybh12.js → assistant-39zyabv2.js} +28 -28
- package/dist/{boot-args-schema-xzfp2feg.js → boot-args-schema-bqv5bf77.js} +1 -1
- package/dist/{boot-reembed-3jz0p2jk.js → boot-reembed-157c0gcz.js} +1 -1
- package/dist/{boot-reembed-r88wngfg.js → boot-reembed-fas7z3zn.js} +1 -1
- package/dist/{boot-scrub-sweep-scrqhw48.js → boot-scrub-sweep-tmec0be2.js} +2 -2
- package/dist/{boot-seeds-vb2dcrrb.js → boot-seeds-32zm50x2.js} +4 -4
- package/dist/{boxd-68n75y1s.js → boxd-hr8rsxzq.js} +1 -1
- package/dist/{claude-adapter-h3mp9hgs.js → claude-adapter-gwq7x2nj.js} +9 -9
- package/dist/{claude-managed-adapter-kpbyj2vb.js → claude-managed-adapter-rkvw6fvq.js} +4 -4
- package/dist/{claude-managed-setup-0efr3wkg.js → claude-managed-setup-0vgz4d1j.js} +6 -6
- package/dist/{claude-sdk-session-03dw669q.js → claude-sdk-session-5wbwxy8c.js} +20967 -19390
- package/dist/{cli-z64t9pe6.js → cli-0f7n3td3.js} +1 -1
- package/dist/{cli-j53hpbsm.js → cli-0xwb7zpt.js} +2 -2
- package/dist/{cli-wxwv3t11.js → cli-1f48qdnb.js} +55 -13
- package/dist/{cli-gfcv679k.js → cli-1gevjrc1.js} +1 -1
- package/dist/{cli-0jkenasr.js → cli-2v4xxnx2.js} +1 -1
- package/dist/{cli-hc6e4tac.js → cli-2wde56gv.js} +6 -6
- package/dist/{cli-mh7pdxe0.js → cli-31vt7baf.js} +17 -17
- package/dist/{cli-ercwc8xn.js → cli-3mf04tkh.js} +1 -1
- package/dist/{cli-s6zk31gr.js → cli-43dsqhcp.js} +4 -4
- package/dist/{cli-1dbv9mj9.js → cli-4djg31jh.js} +1 -1
- package/dist/{cli-tn91wc6e.js → cli-50whymxq.js} +1 -1
- package/dist/{cli-js10kdk7.js → cli-5basv0e7.js} +19 -5
- package/dist/{cli-b2jh3dyb.js → cli-5k1hvycs.js} +4 -4
- package/dist/{cli-dkejt425.js → cli-62fjschk.js} +7 -7
- package/dist/{cli-zqmmy073.js → cli-69eq6gdk.js} +18 -18
- package/dist/{cli-qm3ntjqs.js → cli-6rmryz03.js} +13 -13
- package/dist/{cli-mz34pxbk.js → cli-7m6bbtab.js} +11 -11
- package/dist/{cli-wv20kbr3.js → cli-8a4qg44m.js} +5 -5
- package/dist/{cli-2m6yaq6b.js → cli-8fj8yfmk.js} +1 -1
- package/dist/{cli-9m9kyw77.js → cli-8qvte9hn.js} +2 -2
- package/dist/{cli-x05p2d05.js → cli-9tevdxyf.js} +1 -1
- package/dist/{cli-qec9bynj.js → cli-a6rzw649.js} +3 -3
- package/dist/{cli-ex1y88j3.js → cli-at67kvnp.js} +1 -1
- package/dist/{cli-yn4kt85g.js → cli-b0kqw55g.js} +1 -1
- package/dist/{cli-n3qe7tyr.js → cli-b0m3bg0f.js} +134 -3
- package/dist/{cli-xfjn2kyq.js → cli-bp2rt28p.js} +9 -9
- package/dist/{cli-2jk4s7z1.js → cli-c9bwawf9.js} +3 -3
- package/dist/{cli-wndegmns.js → cli-cmgdptmx.js} +3 -3
- package/dist/{cli-3p288654.js → cli-cpkxh68d.js} +2 -2
- package/dist/{cli-117g15t4.js → cli-cs26ed89.js} +8 -8
- package/dist/{cli-prf7kz78.js → cli-d0jb2qnt.js} +603 -78
- package/dist/{cli-8hp56wat.js → cli-d2epqm0y.js} +1 -1
- package/dist/{cli-wrhbym01.js → cli-d528acsw.js} +6 -6
- package/dist/{cli-tstj6e8e.js → cli-dnvmwsvc.js} +310 -88
- package/dist/{cli-9fsagra4.js → cli-e87fg3en.js} +1 -1
- package/dist/{cli-jj3c5nyb.js → cli-erh1rgh4.js} +116 -56
- package/dist/{cli-f1952kjy.js → cli-ewb028rs.js} +4 -4
- package/dist/{cli-ct8sz3np.js → cli-f1sdh8ca.js} +6 -6
- package/dist/{cli-0b655smz.js → cli-fcwrd7bh.js} +5 -5
- package/dist/{cli-eb279wn3.js → cli-fgm2mad9.js} +2 -2
- package/dist/{cli-bpje8n65.js → cli-fp65jdp2.js} +31 -6
- package/dist/{cli-dnh64e8e.js → cli-g0b3ma7r.js} +7 -7
- package/dist/{cli-avxh26pd.js → cli-gc7jkf4a.js} +4 -4
- package/dist/{cli-2skf1mdf.js → cli-gedf48yw.js} +4 -4
- package/dist/{cli-ajjvqhf3.js → cli-getrvmtx.js} +27 -6
- package/dist/{cli-c8v2yvej.js → cli-gq6qhmrr.js} +2 -2
- package/dist/{cli-mbwmqb5w.js → cli-h0ewec3d.js} +1 -1
- package/dist/{cli-tdk7jtka.js → cli-hv3820ez.js} +1 -1
- package/dist/{cli-avqkr20b.js → cli-j2ybkdk2.js} +2 -2
- package/dist/{cli-pqfecppn.js → cli-je587f74.js} +1 -1
- package/dist/{cli-hgsxnjyg.js → cli-jkkcm72j.js} +13 -13
- package/dist/{cli-g6j6ac3h.js → cli-ka13xx6b.js} +2 -2
- package/dist/{cli-t35hx078.js → cli-m1wddksc.js} +2 -2
- package/dist/{cli-50w82h6m.js → cli-mwxez0pz.js} +1 -0
- package/dist/{cli-nc6a8b5b.js → cli-n14r8h4n.js} +2 -2
- package/dist/{cli-y4a4458j.js → cli-n46d87mj.js} +3 -3
- package/dist/{cli-0dg7ytxm.js → cli-nkfv398a.js} +1096 -75
- package/dist/{cli-fhvk2nvp.js → cli-nvqq3232.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-hbq0kwxz.js → cli-r4fphq38.js} +4 -4
- package/dist/{cli-47hz21se.js → cli-r8ddn0hf.js} +4 -5
- package/dist/{cli-hpb9x72z.js → cli-rvhaahfv.js} +9 -9
- package/dist/{cli-qhhb30e8.js → cli-s08zsqva.js} +9 -9
- package/dist/{cli-sdh61g52.js → cli-s6fhqbz1.js} +2 -2
- package/dist/{cli-y518qkjg.js → cli-sjk85d7v.js} +13 -12
- package/dist/{cli-ytc7fpza.js → cli-t25rq8mg.js} +4 -4
- package/dist/{cli-sq913bh1.js → cli-t9nxq30h.js} +8 -8
- package/dist/{cli-49f5jyhh.js → cli-tbdw3f92.js} +3 -3
- package/dist/{cli-1v82d2w6.js → cli-tceqvv6h.js} +4 -4
- package/dist/{cli-fz9pcjsw.js → cli-tgmate57.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-7dbhnsj9.js → cli-wdtqkqnq.js} +4 -4
- package/dist/{cli-kde4ky90.js → cli-x5yb8zc8.js} +2 -2
- package/dist/{cli-w14j2z4k.js → cli-x7aqhxj5.js} +2 -2
- package/dist/{cli-kspxjftk.js → cli-xerdrnqs.js} +15 -6
- package/dist/{cli-48nvk6sb.js → cli-xhkek467.js} +2 -2
- package/dist/{cli-dka73bak.js → cli-xysy1g8x.js} +152 -12
- package/dist/{cli-7wy8gbwb.js → cli-ya1cj689.js} +1 -1
- package/dist/{cli-n85m2wkq.js → cli-zkbz8m2q.js} +3 -2
- package/dist/{cli-0pazkmd4.js → cli-zm6bkx3e.js} +4 -4
- package/dist/{cli-6h88mn9q.js → cli-zqy28rwx.js} +4 -4
- package/dist/cli.js +30 -29
- package/dist/{codex-adapter-f3yp0kaj.js → codex-adapter-x25xfbnh.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-kn5xnrvp.js} +9 -9
- package/dist/{commands-5bzf2tfw.js → commands-8n59gxmy.js} +3 -3
- package/dist/{controller-5xt7kvfm.js → controller-wn3vd217.js} +3 -3
- package/dist/{controllers-connect-0gg13mzp.js → controllers-connect-09gvkrhc.js} +28 -28
- package/dist/core-2b8bv6ny.js +42 -0
- package/dist/{cursor-adapter-p0c5zv6r.js → cursor-adapter-w1681kp1.js} +2 -2
- package/dist/{db-2s68ycq7.js → db-e71keqxk.js} +3 -3
- package/dist/{db-q7q639k5.js → db-spg81qtr.js} +2 -2
- package/dist/{devin-adapter-t8d86q9x.js → devin-adapter-fs90ab4v.js} +1 -1
- package/dist/{dispatcher-j2y1q7ae.js → dispatcher-fr4vawwb.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-ac9tv9a6.js} +1 -1
- package/dist/{embedding-space-3n6mhhmy.js → embedding-space-an77f45k.js} +6 -6
- package/dist/{embeddings-jfmj6yme.js → embeddings-jkrehejr.js} +1 -1
- package/dist/{event-bus-v4ywhc2p.js → event-bus-08t2b4y2.js} +1 -1
- package/dist/{execute-tjrej979.js → execute-3mys4nta.js} +1 -1
- package/dist/{external-channel-jy8w2gg3.js → external-channel-s6zxpts9.js} +2 -2
- package/dist/fx-adapter-4yet1c4f.js +20 -0
- package/dist/grok-adapter-8ge6tw7m.js +20 -0
- package/dist/handlers-0r9evrdj.js +41 -0
- package/dist/heartbeat-jjpb44e5.js +50 -0
- package/dist/{hook-fv1jwrv7.js → hook-68gbs87k.js} +6 -6
- package/dist/{hook-bpnncsec.js → hook-y6n23zzj.js} +8 -8
- package/dist/{http-bpa26czn.js → http-8c6y008s.js} +404 -146
- package/dist/{index-w216g9y9.js → index-0vthtbc2.js} +38 -22
- package/dist/index-1v23363p.js +39 -0
- package/dist/index-30qw6vyw.js +44 -0
- package/dist/index-6bm3w6cn.js +40 -0
- package/dist/{index-s8re7mvq.js → index-6h3r0vpe.js} +1 -1
- package/dist/{index-620y7jzq.js → index-7dgxveck.js} +3 -3
- package/dist/{index-4k7m5dgj.js → index-maddg9ys.js} +143 -103
- package/dist/{index-0h6qd4p1.js → index-mbpxhc4w.js} +3 -4
- package/dist/index-rz8ve510.js +569 -0
- package/dist/{index-mpj0z9e0.js → index-we3nd2t0.js} +1 -1
- package/dist/{index-pe3d8jfy.js → index-whysn1wf.js} +1 -1
- package/dist/{index-52tgbhrw.js → index-xcw7hjt5.js} +28 -28
- package/dist/{index-8p0j4h4j.js → index-ym9fgxad.js} +94 -89
- package/dist/{k8s-fy8hbhkg.js → k8s-8326q0rq.js} +2 -2
- package/dist/{keepalive-d6z12s04.js → keepalive-7e9r5dvp.js} +5 -4
- package/dist/lead-3jpc7kcr.js +79 -0
- package/dist/{maintenance-7kac6g2g.js → maintenance-d3erjvcg.js} +1 -1
- package/dist/{oauth-refresh-sweep-t1xjetbh.js → oauth-refresh-sweep-0qh70988.js} +4 -3
- package/dist/{object-webhooks-6rdagg0r.js → object-webhooks-ac7v2q5p.js} +7 -7
- package/dist/{onboard-32y1cfxy.js → onboard-5yphtken.js} +4 -4
- package/dist/{opencode-adapter-enp3v31n.js → opencode-adapter-0xvyba4m.js} +8 -8
- package/dist/{otel-impl-k0tm5ptj.js → otel-impl-svqp691q.js} +2 -2
- package/dist/{pending-24zebgvs.js → pending-bn4xe5br.js} +26 -26
- package/dist/{pi-mono-adapter-yj72xxxe.js → pi-mono-adapter-763s8a3w.js} +20 -18
- package/dist/{pricing-refresh-cf25x38j.js → pricing-refresh-kfc215mf.js} +2 -2
- package/dist/{rbac-roles-0wydd22m.js → rbac-roles-3bznvkpt.js} +3 -3
- package/dist/{rbac-roles-at6crb3r.js → rbac-roles-6r4h2ghj.js} +2 -2
- package/dist/{render-v2-nvcw0jd7.js → render-v2-f3qedbpy.js} +10 -10
- package/dist/{resume-y4w0k5v3.js → resume-vcag4ann.js} +13 -13
- package/dist/{runtime-vpe43hx0.js → runtime-x0s55z2t.js} +1 -1
- package/dist/{session-access-gkyvnfye.js → session-access-nwzve8q2.js} +5 -5
- package/dist/{session-source-backfill-3w2st4m2.js → session-source-backfill-jpqfzmgz.js} +2 -2
- package/dist/{setup-axxvqtys.js → setup-d2smwaem.js} +1 -1
- package/dist/thread-buffer-8fc703jc.js +42 -0
- package/dist/{tree-visibility-y4fqvab5.js → tree-visibility-dwzc8en0.js} +2 -2
- package/dist/{user-merge-jobs-kcmwvrc6.js → user-merge-jobs-4ce7kma2.js} +3 -3
- package/dist/{virtual-modules-7d92dct1.js → virtual-modules-78a6yw71.js} +3 -3
- package/dist/{work-objects-f708e069.js → work-objects-m0w1e7q8.js} +28 -28
- package/dist/worker-3p2vq107.js +79 -0
- package/dist/{worker-follow-up-0by8wztc.js → worker-follow-up-e3t6f895.js} +25 -25
- package/dist/{x-3dtaf2r9.js → x-asbrnafg.js} +2 -2
- package/openapi.json +1795 -1623
- package/package.json +13 -12
- 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/migrations/341_user_token_expiry.sql +4 -0
- package/src/be/schedules/validate.ts +26 -0
- package/src/be/scripts/run-credential.ts +55 -1
- package/src/be/scripts/typecheck.ts +4 -4
- package/src/be/scripts/user-code-mode.ts +160 -0
- package/src/be/swarm-config-guard.ts +4 -0
- package/src/be/users.ts +48 -7
- 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-connection-proxy.ts +18 -6
- package/src/http/script-connections.ts +12 -4
- package/src/http/script-runs.ts +12 -3
- package/src/http/scripts.ts +2 -11
- package/src/http/tasks.ts +6 -10
- package/src/http/users.ts +1 -0
- package/src/integrations/chat-sdk/adapters.ts +29 -0
- package/src/integrations/chat-sdk/limits.ts +3 -0
- package/src/integrations/chat-sdk/rocketchat/README.md +8 -0
- package/src/integrations/chat-sdk/rocketchat/index.ts +790 -0
- package/src/integrations/chat-sdk/rocketchat/markdown.ts +210 -0
- package/src/integrations/chat-sdk/rocketchat/types.ts +249 -0
- package/src/integrations/chat-sdk/runtime.ts +11 -5
- package/src/integrations/chat-sdk/schema.ts +37 -3
- package/src/integrations/chat-sdk/status.ts +9 -0
- 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 +3 -0
- package/src/rbac/permissions.ts +9 -0
- package/src/scripts-runtime/executors/native.ts +225 -67
- package/src/scripts-runtime/mcp-client.ts +2 -1
- package/src/scripts-runtime/swarm-sdk.ts +2 -1
- package/src/scripts-runtime/types/stdlib.d.ts +4 -4
- package/src/scripts-runtime/types/swarm-extension.d.ts +7 -7
- package/src/scripts-runtime/types/swarm-sdk.d.ts +4 -4
- package/src/server-user.ts +98 -0
- 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/chat-sdk-rocketchat-vendored.test.ts +67 -0
- package/src/tests/chat-sdk-status-route.test.ts +13 -1
- package/src/tests/codex-app-server.test.ts +4 -6
- 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/mcp-user-route.test.ts +10 -1
- 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-mcp.test.ts +14 -10
- package/src/tests/script-connections-sql.test.ts +6 -2
- package/src/tests/script-connections.test.ts +4 -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/tools/script-common.ts +37 -22
- package/src/tools/script-query-types.ts +1 -1
- package/src/tools/script-run.ts +1 -1
- package/src/tools/script-search.ts +12 -10
- package/src/tools/utils.ts +7 -1
- 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/chat-sdk/content.md +2 -2
- package/templates/skills/pages/content.md +11 -0
- package/templates/skills/swarm-docs/content.md +4 -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
- /package/dist/{cli-m4ejz4nj.js → cli-cah298e5.js} +0 -0
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
assertUrlSafe,
|
|
11
11
|
EgressDeniedError,
|
|
12
12
|
createGuardedFetch,
|
|
13
|
+
createSsrfGuardedFetch,
|
|
13
14
|
init_egress_guard,
|
|
14
15
|
init_credential_broker,
|
|
15
16
|
encryptSecret,
|
|
@@ -556,7 +557,7 @@ import {
|
|
|
556
557
|
countScriptRunJournalSteps2,
|
|
557
558
|
countScriptRunJournalAgentTaskSteps2,
|
|
558
559
|
init_db4
|
|
559
|
-
} from "./cli-
|
|
560
|
+
} from "./cli-erh1rgh4.js";
|
|
560
561
|
import {
|
|
561
562
|
PRIMARY_ROLE_NAMES2,
|
|
562
563
|
OperatorGrantedTargetError2,
|
|
@@ -570,7 +571,7 @@ import {
|
|
|
570
571
|
assertNotLastAdmin2,
|
|
571
572
|
setUserRoles2,
|
|
572
573
|
init_rbac_roles
|
|
573
|
-
} from "./cli-
|
|
574
|
+
} from "./cli-n14r8h4n.js";
|
|
574
575
|
import {
|
|
575
576
|
MAX_MODEL_GROUP_MEMBERS,
|
|
576
577
|
listModelGroups,
|
|
@@ -580,19 +581,19 @@ import {
|
|
|
580
581
|
modelGroupReferences,
|
|
581
582
|
deleteModelGroup,
|
|
582
583
|
init_model_groups
|
|
583
|
-
} from "./cli-
|
|
584
|
+
} from "./cli-8qvte9hn.js";
|
|
584
585
|
import {
|
|
585
586
|
requestModelCatalogRefresh2,
|
|
586
587
|
init_pricing_refresh
|
|
587
|
-
} from "./cli-
|
|
588
|
+
} from "./cli-m1wddksc.js";
|
|
588
589
|
import {
|
|
589
590
|
workflowEventBus2,
|
|
590
591
|
init_event_bus
|
|
591
|
-
} from "./cli-
|
|
592
|
-
import"./cli-
|
|
593
|
-
import"./cli-
|
|
594
|
-
import"./cli-
|
|
595
|
-
import"./cli-
|
|
592
|
+
} from "./cli-vx9acp12.js";
|
|
593
|
+
import"./cli-ka13xx6b.js";
|
|
594
|
+
import"./cli-e87fg3en.js";
|
|
595
|
+
import"./cli-vr4eyq6p.js";
|
|
596
|
+
import"./cli-r8ddn0hf.js";
|
|
596
597
|
import {
|
|
597
598
|
require_dist4,
|
|
598
599
|
getSlackConnectionState,
|
|
@@ -630,7 +631,7 @@ import {
|
|
|
630
631
|
startSlackApp2,
|
|
631
632
|
stopSlackApp2,
|
|
632
633
|
init_app4
|
|
633
|
-
} from "./cli-
|
|
634
|
+
} from "./cli-69eq6gdk.js";
|
|
634
635
|
import {
|
|
635
636
|
AGENT_MAX_TASKS_CONFIG_KEY,
|
|
636
637
|
reconcileAgentMaxTasksPolicy,
|
|
@@ -659,12 +660,12 @@ import {
|
|
|
659
660
|
dispatchApprovalNotifications2,
|
|
660
661
|
createApprovalFollowUpTask2,
|
|
661
662
|
init_approval_notifications
|
|
662
|
-
} from "./cli-
|
|
663
|
+
} from "./cli-f1sdh8ca.js";
|
|
663
664
|
import {
|
|
664
665
|
retryFailedRun2,
|
|
665
666
|
cancelWorkflowRun2,
|
|
666
667
|
init_resume
|
|
667
|
-
} from "./cli-
|
|
668
|
+
} from "./cli-fcwrd7bh.js";
|
|
668
669
|
import {
|
|
669
670
|
safeParse,
|
|
670
671
|
getObjectShape,
|
|
@@ -1029,6 +1030,10 @@ import {
|
|
|
1029
1030
|
init_automatic_task_gate,
|
|
1030
1031
|
guardTerminalTaskResultWrite,
|
|
1031
1032
|
init_terminal_result_guard,
|
|
1033
|
+
scriptNameSchema,
|
|
1034
|
+
scriptToolOutputSchema,
|
|
1035
|
+
scriptsApiToolResult,
|
|
1036
|
+
init_script_common,
|
|
1032
1037
|
getTasksInputSchema,
|
|
1033
1038
|
getTasksOutputSchema,
|
|
1034
1039
|
getTasksHandler,
|
|
@@ -1103,7 +1108,15 @@ import {
|
|
|
1103
1108
|
init_events,
|
|
1104
1109
|
mergeScheduleTiming,
|
|
1105
1110
|
validateRecurringTiming,
|
|
1111
|
+
changesScheduleTarget,
|
|
1106
1112
|
init_validate,
|
|
1113
|
+
renderTypeBlobs,
|
|
1114
|
+
init_script_query_types,
|
|
1115
|
+
renderRunOutput,
|
|
1116
|
+
init_script_run,
|
|
1117
|
+
renderSearchResults,
|
|
1118
|
+
searchSuccessMessage,
|
|
1119
|
+
init_script_search,
|
|
1107
1120
|
followUpThreadForSourceTask,
|
|
1108
1121
|
evaluateFollowUpRedelegation,
|
|
1109
1122
|
init_follow_up_redelegation_guard,
|
|
@@ -1155,7 +1168,7 @@ import {
|
|
|
1155
1168
|
getEnabledCapabilities,
|
|
1156
1169
|
createServer,
|
|
1157
1170
|
init_server
|
|
1158
|
-
} from "./cli-
|
|
1171
|
+
} from "./cli-dnvmwsvc.js";
|
|
1159
1172
|
import {
|
|
1160
1173
|
getFileStorageProvider2,
|
|
1161
1174
|
init_registry2
|
|
@@ -1181,7 +1194,7 @@ import {
|
|
|
1181
1194
|
resolvePoolDelivery2,
|
|
1182
1195
|
createPoolAgent2,
|
|
1183
1196
|
init_db2
|
|
1184
|
-
} from "./cli-
|
|
1197
|
+
} from "./cli-tceqvv6h.js";
|
|
1185
1198
|
import {
|
|
1186
1199
|
duplicateGuardedQueryKey,
|
|
1187
1200
|
warnIfCorsAllowsAnyOrigin,
|
|
@@ -1232,7 +1245,7 @@ import {
|
|
|
1232
1245
|
describeRequestRoute,
|
|
1233
1246
|
route,
|
|
1234
1247
|
init_route_def
|
|
1235
|
-
} from "./cli-
|
|
1248
|
+
} from "./cli-2wde56gv.js";
|
|
1236
1249
|
import {
|
|
1237
1250
|
startPoolRouting,
|
|
1238
1251
|
stopPoolRouting,
|
|
@@ -1245,28 +1258,29 @@ import {
|
|
|
1245
1258
|
checkHeartbeatChecklist2,
|
|
1246
1259
|
runHeartbeatSweep2,
|
|
1247
1260
|
stopHeartbeat2
|
|
1248
|
-
} from "./cli-
|
|
1249
|
-
import"./cli-
|
|
1261
|
+
} from "./cli-31vt7baf.js";
|
|
1262
|
+
import"./cli-50whymxq.js";
|
|
1250
1263
|
import {
|
|
1251
1264
|
runtimeSupervisorStatus,
|
|
1252
1265
|
startRuntimeSupervisor,
|
|
1253
1266
|
stopRuntimeSupervisor
|
|
1254
|
-
} from "./cli-
|
|
1267
|
+
} from "./cli-7m6bbtab.js";
|
|
1255
1268
|
import {
|
|
1256
1269
|
TASK_TITLE_TIMEOUT_MS,
|
|
1257
1270
|
generateTaskTitle
|
|
1258
|
-
} from "./cli-
|
|
1271
|
+
} from "./cli-cmgdptmx.js";
|
|
1259
1272
|
import"./cli-ns59dc6r.js";
|
|
1260
1273
|
import {
|
|
1261
1274
|
ACP_TARGET_IDS
|
|
1262
|
-
} from "./cli-
|
|
1275
|
+
} from "./cli-hv3820ez.js";
|
|
1263
1276
|
import {
|
|
1264
1277
|
reasoningCapability,
|
|
1265
1278
|
supportedReasoningLevels
|
|
1266
|
-
} from "./cli-
|
|
1279
|
+
} from "./cli-vdfngx2g.js";
|
|
1267
1280
|
import {
|
|
1268
|
-
MAX_RATE_LIMIT_RESET_MS
|
|
1269
|
-
|
|
1281
|
+
MAX_RATE_LIMIT_RESET_MS,
|
|
1282
|
+
MAX_SPEND_CAP_HOLD_MS
|
|
1283
|
+
} from "./cli-zkbz8m2q.js";
|
|
1270
1284
|
import {
|
|
1271
1285
|
isLeadChannelMonitoringEnabled,
|
|
1272
1286
|
ORG_IDENTITY_KEYS,
|
|
@@ -1276,7 +1290,7 @@ import {
|
|
|
1276
1290
|
isUnknownModelError,
|
|
1277
1291
|
checkProviderPoolKey,
|
|
1278
1292
|
writeSkillsToFilesystem
|
|
1279
|
-
} from "./cli-
|
|
1293
|
+
} from "./cli-tgmate57.js";
|
|
1280
1294
|
import {
|
|
1281
1295
|
AgentFsRequestError2,
|
|
1282
1296
|
resolveAgentFsSharedContext2,
|
|
@@ -1287,16 +1301,16 @@ import {
|
|
|
1287
1301
|
agentFsRequest2,
|
|
1288
1302
|
resolveApiUrl2,
|
|
1289
1303
|
init_agent_fs_provision
|
|
1290
|
-
} from "./cli-
|
|
1304
|
+
} from "./cli-a6rzw649.js";
|
|
1291
1305
|
import {
|
|
1292
1306
|
Anthropic
|
|
1293
|
-
} from "./cli-
|
|
1307
|
+
} from "./cli-cah298e5.js";
|
|
1294
1308
|
import {
|
|
1295
1309
|
objectWebhookSecret2,
|
|
1296
1310
|
handleObjectWebhookEvent2,
|
|
1297
1311
|
init_object_webhooks
|
|
1298
|
-
} from "./cli-
|
|
1299
|
-
import"./cli-
|
|
1312
|
+
} from "./cli-r4fphq38.js";
|
|
1313
|
+
import"./cli-zqy28rwx.js";
|
|
1300
1314
|
import {
|
|
1301
1315
|
createUserMergeJob2,
|
|
1302
1316
|
getUserMergeJob2,
|
|
@@ -1305,7 +1319,7 @@ import {
|
|
|
1305
1319
|
findFailedUserMergeJob2,
|
|
1306
1320
|
requeueUserMergeJob2,
|
|
1307
1321
|
runUserMergeJobs2
|
|
1308
|
-
} from "./cli-
|
|
1322
|
+
} from "./cli-tbdw3f92.js";
|
|
1309
1323
|
import {
|
|
1310
1324
|
isCodexOAuthConfigKey
|
|
1311
1325
|
} from "./cli-j4bwnpkm.js";
|
|
@@ -1316,7 +1330,7 @@ import {
|
|
|
1316
1330
|
import {
|
|
1317
1331
|
runTaskUiAction,
|
|
1318
1332
|
init_actions
|
|
1319
|
-
} from "./cli-
|
|
1333
|
+
} from "./cli-n46d87mj.js";
|
|
1320
1334
|
import {
|
|
1321
1335
|
RATING_MODEL_MAX_LENGTH,
|
|
1322
1336
|
REFERENCES_SOURCE_MAX_LENGTH,
|
|
@@ -1387,6 +1401,7 @@ import {
|
|
|
1387
1401
|
checkImportAllowlist,
|
|
1388
1402
|
init_import_allowlist,
|
|
1389
1403
|
runScriptWithRunCredential,
|
|
1404
|
+
runScriptAsUserWithRunCredential,
|
|
1390
1405
|
init_run_credential,
|
|
1391
1406
|
extractScriptSignature,
|
|
1392
1407
|
init_extract_signature,
|
|
@@ -1411,7 +1426,7 @@ import {
|
|
|
1411
1426
|
init_typecheck,
|
|
1412
1427
|
parseSkillContent,
|
|
1413
1428
|
init_skill_parser
|
|
1414
|
-
} from "./cli-
|
|
1429
|
+
} from "./cli-nkfv398a.js";
|
|
1415
1430
|
import {
|
|
1416
1431
|
signalProcessGroup,
|
|
1417
1432
|
detachedProcessGroup,
|
|
@@ -1428,17 +1443,17 @@ import {
|
|
|
1428
1443
|
forceRefreshAuthorizationOrThrow,
|
|
1429
1444
|
forceRefreshTokenOrThrow,
|
|
1430
1445
|
init_ensure_token
|
|
1431
|
-
} from "./cli-
|
|
1446
|
+
} from "./cli-xerdrnqs.js";
|
|
1432
1447
|
import {
|
|
1433
1448
|
PRIMITIVE_KINDS,
|
|
1434
1449
|
ObjectsError,
|
|
1435
1450
|
recordObjectVersion,
|
|
1436
1451
|
init_objects
|
|
1437
|
-
} from "./cli-
|
|
1452
|
+
} from "./cli-wdtqkqnq.js";
|
|
1438
1453
|
import {
|
|
1439
1454
|
agentFsClientFor,
|
|
1440
1455
|
init_agent_fs_identity
|
|
1441
|
-
} from "./cli-
|
|
1456
|
+
} from "./cli-j2ybkdk2.js";
|
|
1442
1457
|
import {
|
|
1443
1458
|
FilesError,
|
|
1444
1459
|
normalizeFilesError,
|
|
@@ -1447,7 +1462,7 @@ import {
|
|
|
1447
1462
|
AgentFsProvider,
|
|
1448
1463
|
init_agent_fs_provider
|
|
1449
1464
|
} from "./cli-skd2c4ej.js";
|
|
1450
|
-
import"./cli-
|
|
1465
|
+
import"./cli-4djg31jh.js";
|
|
1451
1466
|
import {
|
|
1452
1467
|
automationIntegrationFixUrl,
|
|
1453
1468
|
preflightAutomation,
|
|
@@ -1469,7 +1484,7 @@ import {
|
|
|
1469
1484
|
definitionNodeIds,
|
|
1470
1485
|
validateDefinition,
|
|
1471
1486
|
init_definition2
|
|
1472
|
-
} from "./cli-
|
|
1487
|
+
} from "./cli-jkkcm72j.js";
|
|
1473
1488
|
import {
|
|
1474
1489
|
_fetchHolder,
|
|
1475
1490
|
CLIENT_ID,
|
|
@@ -1485,7 +1500,7 @@ import {
|
|
|
1485
1500
|
loadAllCodexOAuthSlots,
|
|
1486
1501
|
getValidCodexOAuth,
|
|
1487
1502
|
init_storage
|
|
1488
|
-
} from "./cli-
|
|
1503
|
+
} from "./cli-8fj8yfmk.js";
|
|
1489
1504
|
import {
|
|
1490
1505
|
isMultiRuntimeEnabled,
|
|
1491
1506
|
init_multi_runtime2
|
|
@@ -1497,11 +1512,11 @@ import {
|
|
|
1497
1512
|
import {
|
|
1498
1513
|
createRuntimeProvider,
|
|
1499
1514
|
init_runtime_providers
|
|
1500
|
-
} from "./cli-
|
|
1515
|
+
} from "./cli-43dsqhcp.js";
|
|
1501
1516
|
import {
|
|
1502
1517
|
require_content_type
|
|
1503
1518
|
} from "./cli-1jx0srjt.js";
|
|
1504
|
-
import"./cli-
|
|
1519
|
+
import"./cli-b0m3bg0f.js";
|
|
1505
1520
|
import {
|
|
1506
1521
|
hasSessionAccess,
|
|
1507
1522
|
getSessionRoot,
|
|
@@ -1511,7 +1526,7 @@ import {
|
|
|
1511
1526
|
toSessionSharesState,
|
|
1512
1527
|
setSessionShares,
|
|
1513
1528
|
init_session_shares
|
|
1514
|
-
} from "./cli-
|
|
1529
|
+
} from "./cli-b0kqw55g.js";
|
|
1515
1530
|
import {
|
|
1516
1531
|
isInvalidClientError,
|
|
1517
1532
|
publicEndpointSsrfOptions,
|
|
@@ -1529,7 +1544,7 @@ import {
|
|
|
1529
1544
|
revokeMcpToken,
|
|
1530
1545
|
computeExpiresAt,
|
|
1531
1546
|
init_mcp_wrapper
|
|
1532
|
-
} from "./cli-
|
|
1547
|
+
} from "./cli-xysy1g8x.js";
|
|
1533
1548
|
import"./cli-v41kn3cd.js";
|
|
1534
1549
|
import {
|
|
1535
1550
|
setBedrockProviderModule,
|
|
@@ -1569,7 +1584,7 @@ import {
|
|
|
1569
1584
|
revokeAllAgentSessionTokens,
|
|
1570
1585
|
fingerprintApiKey,
|
|
1571
1586
|
init_users
|
|
1572
|
-
} from "./cli-
|
|
1587
|
+
} from "./cli-getrvmtx.js";
|
|
1573
1588
|
import {
|
|
1574
1589
|
CORE_TOOLS,
|
|
1575
1590
|
init_tool_config
|
|
@@ -1582,7 +1597,7 @@ import {
|
|
|
1582
1597
|
providerAccountTelemetrySchema,
|
|
1583
1598
|
rateLimitReplacementSchema,
|
|
1584
1599
|
init_provider_account_telemetry
|
|
1585
|
-
} from "./cli-
|
|
1600
|
+
} from "./cli-ya1cj689.js";
|
|
1586
1601
|
import {
|
|
1587
1602
|
CODEX_AUTH_FAILURE_BENCH_THRESHOLD,
|
|
1588
1603
|
CODEX_AUTH_WATCH_NAMESPACE,
|
|
@@ -1597,7 +1612,7 @@ import {
|
|
|
1597
1612
|
IDENTITY_FIELD_BUDGETS,
|
|
1598
1613
|
IdentityFieldBudgetError,
|
|
1599
1614
|
init_identity_field_budget
|
|
1600
|
-
} from "./cli-
|
|
1615
|
+
} from "./cli-s6fhqbz1.js";
|
|
1601
1616
|
import {
|
|
1602
1617
|
getSlackConfiguration,
|
|
1603
1618
|
init_config4
|
|
@@ -1625,11 +1640,7 @@ import {
|
|
|
1625
1640
|
splitCredentialPool,
|
|
1626
1641
|
selectCredential,
|
|
1627
1642
|
init_credentials2
|
|
1628
|
-
} from "./cli-
|
|
1629
|
-
import {
|
|
1630
|
-
getOpenRouterAttributionHeaders,
|
|
1631
|
-
init_openrouter_base_url
|
|
1632
|
-
} from "./cli-dfyv0jdy.js";
|
|
1643
|
+
} from "./cli-5basv0e7.js";
|
|
1633
1644
|
import {
|
|
1634
1645
|
interpolate,
|
|
1635
1646
|
init_template2,
|
|
@@ -1639,7 +1650,11 @@ import {
|
|
|
1639
1650
|
resolveTemplate,
|
|
1640
1651
|
init_resolver,
|
|
1641
1652
|
init_session_templates
|
|
1642
|
-
} from "./cli-
|
|
1653
|
+
} from "./cli-mwxez0pz.js";
|
|
1654
|
+
import {
|
|
1655
|
+
getOpenRouterAttributionHeaders,
|
|
1656
|
+
init_openrouter_base_url
|
|
1657
|
+
} from "./cli-dfyv0jdy.js";
|
|
1643
1658
|
import {
|
|
1644
1659
|
ASSET_KEY_MAX_LENGTH,
|
|
1645
1660
|
AssetKeyError,
|
|
@@ -1867,7 +1882,7 @@ import {
|
|
|
1867
1882
|
import {
|
|
1868
1883
|
init_package,
|
|
1869
1884
|
package_default
|
|
1870
|
-
} from "./cli-
|
|
1885
|
+
} from "./cli-sjk85d7v.js";
|
|
1871
1886
|
import {
|
|
1872
1887
|
realtimeBus,
|
|
1873
1888
|
init_bus
|
|
@@ -1883,7 +1898,7 @@ import {
|
|
|
1883
1898
|
registerVolatileSecret,
|
|
1884
1899
|
registerEnvSecrets,
|
|
1885
1900
|
init_secret_scrubber
|
|
1886
|
-
} from "./cli-
|
|
1901
|
+
} from "./cli-fp65jdp2.js";
|
|
1887
1902
|
import {
|
|
1888
1903
|
__toESM
|
|
1889
1904
|
} from "./cli-242037k3.js";
|
|
@@ -8777,6 +8792,7 @@ async function handleAgentsRest(req, res, pathSegments, queryParams, myAgentId)
|
|
|
8777
8792
|
if (model !== undefined || profile === null) {
|
|
8778
8793
|
await deleteSwarmConfigByKey2("agent", parsed.params.id, MODEL_PROFILE_CONFIG_KEY);
|
|
8779
8794
|
} else if (profile !== undefined) {
|
|
8795
|
+
await deleteSwarmConfigByKey2("agent", parsed.params.id, "MODEL_OVERRIDE");
|
|
8780
8796
|
await upsertSwarmConfig2({
|
|
8781
8797
|
scope: "agent",
|
|
8782
8798
|
scopeId: parsed.params.id,
|
|
@@ -9394,6 +9410,11 @@ var reportUsage = route({
|
|
|
9394
9410
|
},
|
|
9395
9411
|
auth: { apiKey: true }
|
|
9396
9412
|
});
|
|
9413
|
+
var SpendCapSchema = object2({
|
|
9414
|
+
limitUsd: number2().nullable(),
|
|
9415
|
+
spendUsd: number2().nullable(),
|
|
9416
|
+
resetsAt: string2().datetime().nullable()
|
|
9417
|
+
});
|
|
9397
9418
|
var reportRateLimit = route({
|
|
9398
9419
|
method: "post",
|
|
9399
9420
|
path: "/api/keys/report-rate-limit",
|
|
@@ -9406,7 +9427,8 @@ var reportRateLimit = route({
|
|
|
9406
9427
|
keyIndex: number2().int().min(0),
|
|
9407
9428
|
rateLimitedUntil: string2().datetime(),
|
|
9408
9429
|
scope: string2().optional(),
|
|
9409
|
-
scopeId: string2().optional()
|
|
9430
|
+
scopeId: string2().optional(),
|
|
9431
|
+
spendCap: SpendCapSchema.optional()
|
|
9410
9432
|
}),
|
|
9411
9433
|
responses: {
|
|
9412
9434
|
200: { description: "Key marked as rate-limited", schema: successMessageSchema },
|
|
@@ -9625,6 +9647,7 @@ var getAvailable = route({
|
|
|
9625
9647
|
modelBlockedIndices: array2(number2().int()).optional(),
|
|
9626
9648
|
earliestModelResetAt: string2().nullable().optional(),
|
|
9627
9649
|
seatBlockedIndices: array2(number2().int()).optional(),
|
|
9650
|
+
spendCappedIndices: array2(number2().int()),
|
|
9628
9651
|
authFailureFence: number2().int()
|
|
9629
9652
|
})
|
|
9630
9653
|
},
|
|
@@ -9642,6 +9665,7 @@ var ApiKeyStatusSchema = object2({
|
|
|
9642
9665
|
scopeId: string2().nullable(),
|
|
9643
9666
|
status: string2(),
|
|
9644
9667
|
rateLimitedUntil: string2().nullable(),
|
|
9668
|
+
spendCap: SpendCapSchema.nullable(),
|
|
9645
9669
|
lastUsedAt: string2().nullable(),
|
|
9646
9670
|
lastRateLimitAt: string2().nullable(),
|
|
9647
9671
|
totalUsageCount: number2().int(),
|
|
@@ -9899,12 +9923,14 @@ async function handleApiKeys(req, res, pathSegments, queryParams) {
|
|
|
9899
9923
|
const parsed = await reportRateLimit.parse(req, res, pathSegments, queryParams);
|
|
9900
9924
|
if (!parsed)
|
|
9901
9925
|
return true;
|
|
9902
|
-
const { keyType, keySuffix, keyIndex,
|
|
9926
|
+
const { keyType, keySuffix, keyIndex, scope, scopeId, spendCap } = parsed.body;
|
|
9927
|
+
const holdUntilMs = Date.now() + (spendCap ? MAX_SPEND_CAP_HOLD_MS : MAX_RATE_LIMIT_RESET_MS);
|
|
9928
|
+
const rateLimitedUntil = new Date(Math.min(Date.parse(parsed.body.rateLimitedUntil), holdUntilMs)).toISOString();
|
|
9903
9929
|
try {
|
|
9904
|
-
await markKeyRateLimited2(keyType, keySuffix, keyIndex, rateLimitedUntil, scope, scopeId ?? null);
|
|
9930
|
+
await markKeyRateLimited2(keyType, keySuffix, keyIndex, rateLimitedUntil, scope, scopeId ?? null, spendCap ?? null);
|
|
9905
9931
|
reportRateLimit.respond(res, 200, {
|
|
9906
9932
|
success: true,
|
|
9907
|
-
message: `Key ...${keySuffix} marked as rate-limited until ${rateLimitedUntil}`
|
|
9933
|
+
message: `Key ...${keySuffix} marked as ${spendCap ? "spend-capped" : "rate-limited"} until ${rateLimitedUntil}`
|
|
9908
9934
|
});
|
|
9909
9935
|
} catch (err) {
|
|
9910
9936
|
jsonError(res, err instanceof Error ? err.message : "Failed to mark rate limit", 500);
|
|
@@ -9989,6 +10015,7 @@ async function handleApiKeys(req, res, pathSegments, queryParams) {
|
|
|
9989
10015
|
success: true,
|
|
9990
10016
|
availableIndices: result.availableIndices,
|
|
9991
10017
|
rejectedIndices: result.rejectedIndices,
|
|
10018
|
+
spendCappedIndices: result.spendCappedIndices,
|
|
9992
10019
|
totalKeys,
|
|
9993
10020
|
authFailureFence: result.authFailureFence,
|
|
9994
10021
|
...model !== undefined ? {
|
|
@@ -12352,6 +12379,7 @@ var DEFAULT_MODES = {
|
|
|
12352
12379
|
telegram: "webhook",
|
|
12353
12380
|
slack: "webhook"
|
|
12354
12381
|
};
|
|
12382
|
+
var ROCKETCHAT_NO_INSTANCE_URL = 'No instance URL. Set CHAT_SDK_API_URL_OVERRIDES to {"rocketchat":"https://chat.example.com"} in the deployment environment and restart the API.';
|
|
12355
12383
|
var NOT_RUNNING = "The adapter is starting, or the last configuration save is still applying. Refresh in a few seconds.";
|
|
12356
12384
|
var SLACK_CLASH_CAUSE = "the Slack adapter conflicts with the built-in Slack integration (set SLACK_DISABLE=true)";
|
|
12357
12385
|
var MAX_STATUS_ERROR_CHARS = 300;
|
|
@@ -12423,6 +12451,9 @@ async function getChatSdkStatus() {
|
|
|
12423
12451
|
} else if (config.enabled && configured) {
|
|
12424
12452
|
error = blockedCause ? `Not started: ${blockedCause}` : NOT_RUNNING;
|
|
12425
12453
|
}
|
|
12454
|
+
if (name === "rocketchat" && configured && enabled && resolveAdapterApiUrl(name) === "") {
|
|
12455
|
+
error = ROCKETCHAT_NO_INSTANCE_URL;
|
|
12456
|
+
}
|
|
12426
12457
|
return {
|
|
12427
12458
|
name,
|
|
12428
12459
|
configured,
|
|
@@ -15114,13 +15145,13 @@ declare module "swarm-extension" {
|
|
|
15114
15145
|
sourceAgentId?: string | undefined;
|
|
15115
15146
|
role?: string | undefined;
|
|
15116
15147
|
harnessProvider?:
|
|
15148
|
+
| "codex"
|
|
15117
15149
|
| "pi"
|
|
15150
|
+
| "opencode"
|
|
15118
15151
|
| "claude"
|
|
15119
15152
|
| "claude-managed"
|
|
15120
|
-
| "codex"
|
|
15121
15153
|
| "grok"
|
|
15122
15154
|
| "fx"
|
|
15123
|
-
| "opencode"
|
|
15124
15155
|
| "dsh"
|
|
15125
15156
|
| "cursor"
|
|
15126
15157
|
| "amp"
|
|
@@ -15282,13 +15313,13 @@ declare module "swarm-extension" {
|
|
|
15282
15313
|
requestedByUserId?: string | undefined;
|
|
15283
15314
|
swarmVersion?: string | undefined;
|
|
15284
15315
|
provider?:
|
|
15316
|
+
| "codex"
|
|
15285
15317
|
| "pi"
|
|
15318
|
+
| "opencode"
|
|
15286
15319
|
| "claude"
|
|
15287
15320
|
| "claude-managed"
|
|
15288
|
-
| "codex"
|
|
15289
15321
|
| "grok"
|
|
15290
15322
|
| "fx"
|
|
15291
|
-
| "opencode"
|
|
15292
15323
|
| "dsh"
|
|
15293
15324
|
| "cursor"
|
|
15294
15325
|
| "amp"
|
|
@@ -15305,13 +15336,13 @@ declare module "swarm-extension" {
|
|
|
15305
15336
|
sourceAgentId?: string | undefined;
|
|
15306
15337
|
role?: string | undefined;
|
|
15307
15338
|
harnessProvider?:
|
|
15339
|
+
| "codex"
|
|
15308
15340
|
| "pi"
|
|
15341
|
+
| "opencode"
|
|
15309
15342
|
| "claude"
|
|
15310
15343
|
| "claude-managed"
|
|
15311
|
-
| "codex"
|
|
15312
15344
|
| "grok"
|
|
15313
15345
|
| "fx"
|
|
15314
|
-
| "opencode"
|
|
15315
15346
|
| "dsh"
|
|
15316
15347
|
| "cursor"
|
|
15317
15348
|
| "amp"
|
|
@@ -15349,7 +15380,7 @@ declare module "swarm-extension" {
|
|
|
15349
15380
|
sourceTaskId: string | undefined;
|
|
15350
15381
|
auditSourceTaskId: string | undefined;
|
|
15351
15382
|
contextKey: string | undefined;
|
|
15352
|
-
callOrigin: "
|
|
15383
|
+
callOrigin: "native" | "mcp" | "extension" | "script-sdk";
|
|
15353
15384
|
harness?: string | undefined;
|
|
15354
15385
|
};
|
|
15355
15386
|
|
|
@@ -24776,11 +24807,148 @@ function registerUserEvents(server, user, tokenId, authorize) {
|
|
|
24776
24807
|
// src/server-user.ts
|
|
24777
24808
|
init_rbac_audit();
|
|
24778
24809
|
init_rbac_roles();
|
|
24810
|
+
|
|
24811
|
+
// src/be/scripts/user-code-mode.ts
|
|
24812
|
+
init_registry();
|
|
24813
|
+
init_secret_scrubber();
|
|
24814
|
+
init_db4();
|
|
24815
|
+
init_db3();
|
|
24816
|
+
init_embeddings();
|
|
24817
|
+
init_run_credential();
|
|
24818
|
+
|
|
24819
|
+
// src/be/scripts/source-secrets.ts
|
|
24820
|
+
init_secret_scrubber();
|
|
24821
|
+
function refuseSourceWithSecrets(source) {
|
|
24822
|
+
const { knownValues, gitleaksRules } = findSecretsIn(source);
|
|
24823
|
+
if (knownValues.length === 0 && gitleaksRules.length === 0)
|
|
24824
|
+
return null;
|
|
24825
|
+
const findings = [
|
|
24826
|
+
...knownValues.map((id) => ({ kind: "registered-secret", id })),
|
|
24827
|
+
...gitleaksRules.map((id) => ({ kind: "gitleaks-rule", id }))
|
|
24828
|
+
];
|
|
24829
|
+
const named = findings.map((f) => f.kind === "registered-secret" ? `registered secret ${f.id}` : `gitleaks rule ${f.id}`).join(", ");
|
|
24830
|
+
return {
|
|
24831
|
+
error: "source_contains_secret",
|
|
24832
|
+
message: `Script source contains a secret (${named}); nothing was saved or run. Source is stored and shown verbatim, so read secrets at run time instead: a credential binding (ctx.api.<slug> / ctx.mcp.<slug>) or ctx.swarm.config.get("<KEY>").`,
|
|
24833
|
+
findings
|
|
24834
|
+
};
|
|
24835
|
+
}
|
|
24836
|
+
|
|
24837
|
+
// src/be/scripts/user-code-mode.ts
|
|
24838
|
+
init_typecheck();
|
|
24839
|
+
var USER_SCRIPT_RUN_AGENT_ID = "user-mcp";
|
|
24840
|
+
function toScriptSearchResults(matches) {
|
|
24841
|
+
return matches.map(({ script, score }) => ({
|
|
24842
|
+
name: script.name,
|
|
24843
|
+
signature: JSON.parse(script.signatureJson),
|
|
24844
|
+
argsJsonSchema: script.argsJsonSchema ? JSON.parse(script.argsJsonSchema) : null,
|
|
24845
|
+
description: script.description,
|
|
24846
|
+
score
|
|
24847
|
+
}));
|
|
24848
|
+
}
|
|
24849
|
+
async function searchScriptsForUser(args) {
|
|
24850
|
+
const matches = await searchScripts2({ query: args.query, scope: "global", limit: args.limit });
|
|
24851
|
+
return { status: 200, body: { results: toScriptSearchResults(matches) } };
|
|
24852
|
+
}
|
|
24853
|
+
var EMPTY_API_TYPES = `export interface ScriptApiRegistry {}
|
|
24854
|
+
`;
|
|
24855
|
+
var EMPTY_MCP_TYPES = `export interface ScriptMcpRegistry {}
|
|
24856
|
+
`;
|
|
24857
|
+
async function scriptTypesForUser(name) {
|
|
24858
|
+
let script = null;
|
|
24859
|
+
if (name) {
|
|
24860
|
+
script = await getScript({ name, scope: "global" });
|
|
24861
|
+
if (!script)
|
|
24862
|
+
return { status: 404, body: { error: "Script not found" } };
|
|
24863
|
+
}
|
|
24864
|
+
const stdlibTypes = await scriptStdlibTypesWithGeneratedApis(EMPTY_API_TYPES, EMPTY_MCP_TYPES, "");
|
|
24865
|
+
if (!script)
|
|
24866
|
+
return { status: 200, body: { stdlibTypes } };
|
|
24867
|
+
return {
|
|
24868
|
+
status: 200,
|
|
24869
|
+
body: {
|
|
24870
|
+
signature: JSON.parse(script.signatureJson),
|
|
24871
|
+
argsJsonSchema: script.argsJsonSchema ? JSON.parse(script.argsJsonSchema) : null,
|
|
24872
|
+
stdlibTypes
|
|
24873
|
+
}
|
|
24874
|
+
};
|
|
24875
|
+
}
|
|
24876
|
+
async function runScriptForUser(args) {
|
|
24877
|
+
if (!args.name === !args.source) {
|
|
24878
|
+
return { status: 400, body: { error: "Pass exactly one of name or source" } };
|
|
24879
|
+
}
|
|
24880
|
+
let source = args.source;
|
|
24881
|
+
let fsMode = "none";
|
|
24882
|
+
let executor = null;
|
|
24883
|
+
if (args.name) {
|
|
24884
|
+
const script = await getScript({ name: args.name, scope: "global" });
|
|
24885
|
+
if (!script)
|
|
24886
|
+
return { status: 404, body: { error: "Script not found" } };
|
|
24887
|
+
({ source, fsMode, executor } = script);
|
|
24888
|
+
} else {
|
|
24889
|
+
const refusal = refuseSourceWithSecrets(source);
|
|
24890
|
+
if (refusal)
|
|
24891
|
+
return { status: 400, body: refusal };
|
|
24892
|
+
}
|
|
24893
|
+
if (fsMode === "workspace-rw") {
|
|
24894
|
+
return { status: 501, body: { error: "workspace-rw scripts are not supported in v1" } };
|
|
24895
|
+
}
|
|
24896
|
+
if (executor && !isExecutorAllowedByDeployment(executor)) {
|
|
24897
|
+
return {
|
|
24898
|
+
status: 400,
|
|
24899
|
+
body: {
|
|
24900
|
+
error: 'Executor "native" is not permitted when deployment SCRIPT_EXECUTOR="quickjs"'
|
|
24901
|
+
}
|
|
24902
|
+
};
|
|
24903
|
+
}
|
|
24904
|
+
const startedAt = new Date().toISOString();
|
|
24905
|
+
const output = await runScriptAsUserWithRunCredential({ source, args: args.args, fsMode, executor }, args.userId);
|
|
24906
|
+
const ok = output.exitCode === 0 && !output.error && !output.runtimeError;
|
|
24907
|
+
try {
|
|
24908
|
+
await recordInlineScriptRun2({
|
|
24909
|
+
id: crypto.randomUUID(),
|
|
24910
|
+
agentId: USER_SCRIPT_RUN_AGENT_ID,
|
|
24911
|
+
requestedByUserId: args.userId,
|
|
24912
|
+
createdBy: args.userId,
|
|
24913
|
+
source,
|
|
24914
|
+
args: scrubObject(args.args ?? null),
|
|
24915
|
+
scriptName: args.name ?? "(inline source)",
|
|
24916
|
+
status: ok ? "completed" : "failed",
|
|
24917
|
+
output: scrubObject(output.result),
|
|
24918
|
+
error: ok ? undefined : scrubSecrets([
|
|
24919
|
+
output.error,
|
|
24920
|
+
output.stderr || undefined,
|
|
24921
|
+
output.runtimeError ? `${output.runtimeError.name}: ${output.runtimeError.message}` : undefined
|
|
24922
|
+
].filter(Boolean).join(" — ") || `Script exited with code ${output.exitCode}`),
|
|
24923
|
+
startedAt,
|
|
24924
|
+
finishedAt: new Date().toISOString()
|
|
24925
|
+
});
|
|
24926
|
+
} catch {}
|
|
24927
|
+
return {
|
|
24928
|
+
status: 200,
|
|
24929
|
+
body: scrubObject({
|
|
24930
|
+
result: output.result,
|
|
24931
|
+
truncated: output.truncated,
|
|
24932
|
+
durationMs: output.durationMs,
|
|
24933
|
+
stdout: output.stdout,
|
|
24934
|
+
stderr: output.stderr,
|
|
24935
|
+
exitCode: output.exitCode,
|
|
24936
|
+
error: output.error,
|
|
24937
|
+
runtimeError: output.runtimeError
|
|
24938
|
+
})
|
|
24939
|
+
};
|
|
24940
|
+
}
|
|
24941
|
+
|
|
24942
|
+
// src/server-user.ts
|
|
24779
24943
|
init_mcp_limits();
|
|
24780
24944
|
init_rbac();
|
|
24781
24945
|
init_cancel_task();
|
|
24782
24946
|
init_get_task_details();
|
|
24783
24947
|
init_get_tasks();
|
|
24948
|
+
init_script_common();
|
|
24949
|
+
init_script_query_types();
|
|
24950
|
+
init_script_run();
|
|
24951
|
+
init_script_search();
|
|
24784
24952
|
init_send_task();
|
|
24785
24953
|
init_steer_task();
|
|
24786
24954
|
init_task_tool_ctx();
|
|
@@ -24796,6 +24964,11 @@ var userSendTaskInputSchema = object2({
|
|
|
24796
24964
|
modelTier: ModelTierSchema.optional().describe("Portable model tier: 'smol', 'regular', 'smart', or 'ultra'. Resolved by the assignee's harness/provider."),
|
|
24797
24965
|
outputSchema: record2(string2(), unknown()).optional().describe("Optional JSON Schema the assignee's final output must satisfy. store-progress rejects a completion that does not match. Supported keywords: type, required, properties, enum, const, items. An empty object {} means no schema.")
|
|
24798
24966
|
}).superRefine((data, ctx) => checkOutputSchemaShape(data.outputSchema, ctx));
|
|
24967
|
+
var USER_CODE_MODE_SCOPE = "Runs as you: the script's swarm calls carry your permissions, no agent's credentials or connections, and no task is created. Only global scripts are visible.";
|
|
24968
|
+
function codeModeResult(response, rendering) {
|
|
24969
|
+
const ok = response.status >= 200 && response.status < 300;
|
|
24970
|
+
return scriptsApiToolResult(response.body, { ok, status: response.status }, rendering);
|
|
24971
|
+
}
|
|
24799
24972
|
function permission(verb) {
|
|
24800
24973
|
return { permission: verb };
|
|
24801
24974
|
}
|
|
@@ -24900,6 +25073,68 @@ function createUserServer(user, tokenId) {
|
|
|
24900
25073
|
return denied;
|
|
24901
25074
|
return cancelTaskHandler(userCtx(user, info.sessionId), args);
|
|
24902
25075
|
});
|
|
25076
|
+
const scriptSearchConfig = {
|
|
25077
|
+
title: "Script Search",
|
|
25078
|
+
description: `Search the swarm's reusable TypeScript scripts by intent. ${USER_CODE_MODE_SCOPE}`,
|
|
25079
|
+
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
25080
|
+
rbac: permission("script.search"),
|
|
25081
|
+
inputSchema: object2({
|
|
25082
|
+
query: string2().default("").describe("What the script should do."),
|
|
25083
|
+
limit: number2().int().min(1).max(100).default(10).describe("Maximum results.")
|
|
25084
|
+
}),
|
|
25085
|
+
outputSchema: scriptToolOutputSchema
|
|
25086
|
+
};
|
|
25087
|
+
registerTool("script-search", scriptSearchConfig, async (args) => {
|
|
25088
|
+
const denied = await maybeDenyUserToolAdmission(user, "script-search", scriptSearchConfig);
|
|
25089
|
+
if (denied)
|
|
25090
|
+
return denied;
|
|
25091
|
+
return codeModeResult(await searchScriptsForUser(args), {
|
|
25092
|
+
successMessage: searchSuccessMessage,
|
|
25093
|
+
successDetails: renderSearchResults
|
|
25094
|
+
});
|
|
25095
|
+
});
|
|
25096
|
+
const scriptGetTypesConfig = {
|
|
25097
|
+
title: "Script Get Types",
|
|
25098
|
+
description: `Get the TypeScript declarations a script is written against: the \`swarm-sdk\` module (\`ScriptContext\`, \`ctx.swarm\`) and the \`stdlib\` module, about 12k tokens. Pass \`name\` to also get that script's signature and args schema. ${USER_CODE_MODE_SCOPE}`,
|
|
25099
|
+
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
25100
|
+
inputSchema: object2({
|
|
25101
|
+
name: scriptNameSchema.optional().describe("Optional global script name.")
|
|
25102
|
+
}),
|
|
25103
|
+
outputSchema: scriptToolOutputSchema
|
|
25104
|
+
};
|
|
25105
|
+
registerTool("script-get-types", scriptGetTypesConfig, async ({ name }) => {
|
|
25106
|
+
const denied = await maybeDenyUserToolAdmission(user, "script-get-types", scriptGetTypesConfig);
|
|
25107
|
+
if (denied)
|
|
25108
|
+
return denied;
|
|
25109
|
+
const response = await scriptTypesForUser(name);
|
|
25110
|
+
const { stdlibTypes: _types, ...small } = response.body;
|
|
25111
|
+
return codeModeResult({ status: response.status, body: small }, {
|
|
25112
|
+
successMessage: () => name ? `Type definitions for script \`${name}\` fetched.` : "Script type definitions fetched.",
|
|
25113
|
+
successDetails: () => renderTypeBlobs(response.body),
|
|
25114
|
+
uncappedDetails: true
|
|
25115
|
+
});
|
|
25116
|
+
});
|
|
25117
|
+
const scriptRunConfig = {
|
|
25118
|
+
title: "Script Run",
|
|
25119
|
+
description: `Run a global script by \`name\`, or inline TypeScript \`source\` that does \`export default async function (args, ctx)\`. Inline source is not typechecked or saved. ${USER_CODE_MODE_SCOPE}`,
|
|
25120
|
+
annotations: { openWorldHint: true },
|
|
25121
|
+
rbac: permission("script.run"),
|
|
25122
|
+
inputSchema: object2({
|
|
25123
|
+
name: scriptNameSchema.optional().describe("Global script to run."),
|
|
25124
|
+
source: string2().min(1).optional().describe("Inline TypeScript source to run."),
|
|
25125
|
+
args: unknown().optional().describe("JSON-serializable script arguments.")
|
|
25126
|
+
}),
|
|
25127
|
+
outputSchema: scriptToolOutputSchema
|
|
25128
|
+
};
|
|
25129
|
+
registerTool("script-run", scriptRunConfig, async (args) => {
|
|
25130
|
+
const denied = await maybeDenyUserToolAdmission(user, "script-run", scriptRunConfig);
|
|
25131
|
+
if (denied)
|
|
25132
|
+
return denied;
|
|
25133
|
+
return codeModeResult(await runScriptForUser({ userId: user.id, ...args }), {
|
|
25134
|
+
successMessage: () => "Script run completed.",
|
|
25135
|
+
successDetails: renderRunOutput
|
|
25136
|
+
});
|
|
25137
|
+
});
|
|
24903
25138
|
if (isSteeringEnabled2()) {
|
|
24904
25139
|
const steerTaskConfig = {
|
|
24905
25140
|
title: "Steer Task",
|
|
@@ -27933,8 +28168,10 @@ async function revokeLinearToken(accessToken) {
|
|
|
27933
28168
|
init_ensure_token();
|
|
27934
28169
|
|
|
27935
28170
|
// src/oauth/identity-capture.ts
|
|
28171
|
+
init_egress_guard();
|
|
27936
28172
|
init_secret_scrubber();
|
|
27937
28173
|
init_app_validation();
|
|
28174
|
+
init_mcp_wrapper();
|
|
27938
28175
|
var IDENTITY_FETCH_TIMEOUT_MS = 5000;
|
|
27939
28176
|
function pickString(value) {
|
|
27940
28177
|
return typeof value === "string" && value.length > 0 ? value : null;
|
|
@@ -27976,7 +28213,8 @@ async function captureIdentity(input) {
|
|
|
27976
28213
|
const controller = new AbortController;
|
|
27977
28214
|
const timer = setTimeout(() => controller.abort(), IDENTITY_FETCH_TIMEOUT_MS);
|
|
27978
28215
|
try {
|
|
27979
|
-
const
|
|
28216
|
+
const guardedFetch = createSsrfGuardedFetch(publicEndpointSsrfOptions());
|
|
28217
|
+
const response = await guardedFetch(input.userinfoUrl, {
|
|
27980
28218
|
headers: {
|
|
27981
28219
|
authorization: `Bearer ${input.accessToken}`,
|
|
27982
28220
|
accept: "application/json"
|
|
@@ -30021,7 +30259,6 @@ init_session_shares();
|
|
|
30021
30259
|
init_steering2();
|
|
30022
30260
|
init_task_citations2();
|
|
30023
30261
|
init_task_ui_spec();
|
|
30024
|
-
init_users();
|
|
30025
30262
|
init_rbac();
|
|
30026
30263
|
init_session_mirror();
|
|
30027
30264
|
init_context_key();
|
|
@@ -31241,11 +31478,7 @@ async function handleTasks(req, res, pathSegments, queryParams, myAgentId) {
|
|
|
31241
31478
|
jsonError(res, "Forbidden: caller cannot steer this task", 403);
|
|
31242
31479
|
return true;
|
|
31243
31480
|
}
|
|
31244
|
-
const
|
|
31245
|
-
let requestedByUserId = trustedUserId ?? undefined;
|
|
31246
|
-
if (process.env.TRUST_BODY_REQUESTED_BY_USER_ID !== "false" && !requestedByUserId && parsed.body.requestedByUserId) {
|
|
31247
|
-
requestedByUserId = (await findUserById(parsed.body.requestedByUserId))?.id;
|
|
31248
|
-
}
|
|
31481
|
+
const requestedByUserId = await resolveTaskRequester(req, myAgentId, parsed.body.requestedByUserId);
|
|
31249
31482
|
try {
|
|
31250
31483
|
const auth = getRequestAuth(req);
|
|
31251
31484
|
const createdByAgentId = !auth && myAgentId && await getAgentById2(myAgentId) ? myAgentId : undefined;
|
|
@@ -35039,16 +35272,35 @@ function getPageFrameAncestors() {
|
|
|
35039
35272
|
cachedFrameAncestors = { raw, origins };
|
|
35040
35273
|
return origins;
|
|
35041
35274
|
}
|
|
35275
|
+
function embedOrigins(appUrls) {
|
|
35276
|
+
const origins = new Set;
|
|
35277
|
+
for (const value of appUrls) {
|
|
35278
|
+
try {
|
|
35279
|
+
const url = new URL(value);
|
|
35280
|
+
if (url.protocol === "https:" || url.protocol === "http:")
|
|
35281
|
+
origins.add(url.origin);
|
|
35282
|
+
} catch {}
|
|
35283
|
+
}
|
|
35284
|
+
return Array.from(origins, (origin) => ` ${origin}`).join("");
|
|
35285
|
+
}
|
|
35286
|
+
function pageViewer(payload) {
|
|
35287
|
+
if (payload?.uid)
|
|
35288
|
+
return "user";
|
|
35289
|
+
if (payload?.op)
|
|
35290
|
+
return "operator";
|
|
35291
|
+
return "guest";
|
|
35292
|
+
}
|
|
35042
35293
|
function buildCsp(page) {
|
|
35043
35294
|
const configured = getConfiguredAppUrls();
|
|
35044
35295
|
const devFallbacks = getLocalDevAppOrigins();
|
|
35045
35296
|
const embedders = page.authMode === "public" ? getPageFrameAncestors() : [];
|
|
35046
35297
|
const ancestors = Array.from(new Set([...configured, ...devFallbacks, ...embedders]));
|
|
35298
|
+
const appOrigins = embedOrigins(configured);
|
|
35047
35299
|
return [
|
|
35048
35300
|
"default-src 'self'",
|
|
35049
|
-
|
|
35050
|
-
|
|
35051
|
-
|
|
35301
|
+
`script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdn.tailwindcss.com https://cdn.jsdelivr.net https://unpkg.com${appOrigins}`,
|
|
35302
|
+
`style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://cdn.tailwindcss.com https://cdn.jsdelivr.net https://unpkg.com${appOrigins}`,
|
|
35303
|
+
`font-src 'self' https://fonts.gstatic.com data:${appOrigins}`,
|
|
35052
35304
|
"img-src 'self' data: https:",
|
|
35053
35305
|
"media-src 'self' data: https: blob:",
|
|
35054
35306
|
"connect-src 'self'",
|
|
@@ -35243,7 +35495,7 @@ async function handlePagesPublic(req, res, pathSegments, queryParams) {
|
|
|
35243
35495
|
}
|
|
35244
35496
|
const feedback = isPageFeedbackRequested(queryParams);
|
|
35245
35497
|
const html = injectBrowserSdk(page.body, {
|
|
35246
|
-
head: pageHead(page, queryParams, wantsPrint)
|
|
35498
|
+
head: `${pageHead(page, queryParams, wantsPrint)}<meta name="swarm-viewer" content="${pageViewer(cookiePayload)}">`,
|
|
35247
35499
|
headFirst: feedback ? feedbackKeyGuardScript() : "",
|
|
35248
35500
|
standardsMode: page.designVersion !== 1
|
|
35249
35501
|
}) + (wantsPrint ? PRINT_AUTOTRIGGER_SCRIPT : "") + (feedback ? feedbackOverlayScripts(page.id) : "");
|
|
@@ -35939,14 +36191,21 @@ init_secret_scrubber();
|
|
|
35939
36191
|
init_core();
|
|
35940
36192
|
init_route_def();
|
|
35941
36193
|
init_utils2();
|
|
35942
|
-
var PoolKeyStatusSchema = _enum2([
|
|
36194
|
+
var PoolKeyStatusSchema = _enum2([
|
|
36195
|
+
"ok",
|
|
36196
|
+
"rejected",
|
|
36197
|
+
"rate_limited",
|
|
36198
|
+
"spend_capped",
|
|
36199
|
+
"unchecked"
|
|
36200
|
+
]);
|
|
35943
36201
|
var PoolKeySchema = object2({
|
|
35944
36202
|
index: number2().int().min(0),
|
|
35945
36203
|
suffix: string2(),
|
|
35946
36204
|
status: PoolKeyStatusSchema,
|
|
35947
36205
|
error: string2().nullable(),
|
|
35948
36206
|
checkedAt: string2().nullable(),
|
|
35949
|
-
rateLimitedUntil: string2().nullable()
|
|
36207
|
+
rateLimitedUntil: string2().nullable(),
|
|
36208
|
+
spendCap: SpendCapSchema.nullable()
|
|
35950
36209
|
});
|
|
35951
36210
|
var PoolKeysResponseSchema = object2({
|
|
35952
36211
|
key: string2(),
|
|
@@ -36041,13 +36300,15 @@ async function poolResponse(key) {
|
|
|
36041
36300
|
const row = statuses.find((status) => status.keySuffix === suffix);
|
|
36042
36301
|
const rejected = !!row?.lastValidationFailedAt;
|
|
36043
36302
|
const limited = row?.status === "rate_limited" && !!row.rateLimitedUntil && Date.parse(row.rateLimitedUntil) > Date.now();
|
|
36303
|
+
const spendCap = limited ? row?.spendCap ?? null : null;
|
|
36044
36304
|
return {
|
|
36045
36305
|
index,
|
|
36046
36306
|
suffix,
|
|
36047
|
-
status: rejected ? "rejected" : limited ? "rate_limited" : row ? "ok" : "unchecked",
|
|
36307
|
+
status: rejected ? "rejected" : spendCap ? "spend_capped" : limited ? "rate_limited" : row ? "ok" : "unchecked",
|
|
36048
36308
|
error: rejected ? scrubSecrets(row?.lastValidationError) || null : null,
|
|
36049
36309
|
checkedAt: rejected ? row.lastValidationFailedAt : row?.updatedAt ?? null,
|
|
36050
|
-
rateLimitedUntil: row?.rateLimitedUntil ?? null
|
|
36310
|
+
rateLimitedUntil: row?.rateLimitedUntil ?? null,
|
|
36311
|
+
spendCap
|
|
36051
36312
|
};
|
|
36052
36313
|
})
|
|
36053
36314
|
};
|
|
@@ -40784,7 +41045,7 @@ var updateSchedule = route({
|
|
|
40784
41045
|
responses: {
|
|
40785
41046
|
200: { description: "Schedule updated", schema: ScheduledTaskSchema.nullable() },
|
|
40786
41047
|
400: { description: "Validation error" },
|
|
40787
|
-
403: { description: "Deferral owned by another agent" },
|
|
41048
|
+
403: { description: "Deferral or target owned by another agent" },
|
|
40788
41049
|
404: { description: "Schedule not found" },
|
|
40789
41050
|
409: { description: "Duplicate name" }
|
|
40790
41051
|
}
|
|
@@ -40801,7 +41062,7 @@ var patchSchedule = route({
|
|
|
40801
41062
|
responses: {
|
|
40802
41063
|
200: { description: "Schedule patched", schema: ScheduledTaskSchema.nullable() },
|
|
40803
41064
|
400: { description: "Validation error" },
|
|
40804
|
-
403: { description: "Deferral owned by another agent" },
|
|
41065
|
+
403: { description: "Deferral or target owned by another agent" },
|
|
40805
41066
|
404: { description: "Schedule not found" },
|
|
40806
41067
|
409: { description: "Duplicate name" }
|
|
40807
41068
|
},
|
|
@@ -41105,6 +41366,18 @@ async function handleSchedules(req, res, pathSegments, queryParams, myAgentId) {
|
|
|
41105
41366
|
return true;
|
|
41106
41367
|
}
|
|
41107
41368
|
}
|
|
41369
|
+
if (changesScheduleTarget(existing, parsed.body)) {
|
|
41370
|
+
const principal = await agentFirstPrincipal(req, myAgentId);
|
|
41371
|
+
if (principal.kind === "agent" && !can({
|
|
41372
|
+
principal,
|
|
41373
|
+
verb: "schedule.target.update.any",
|
|
41374
|
+
resource: { kind: "owned", ownerAgentId: existing.createdByAgentId },
|
|
41375
|
+
source: "http"
|
|
41376
|
+
}).allow) {
|
|
41377
|
+
jsonError(res, `Schedule "${existing.name}" runs as the agent that created it. Only that agent or a lead can change its targetType, taskTemplate, workflowId, scriptName, scriptArgs or params.`, 403);
|
|
41378
|
+
return true;
|
|
41379
|
+
}
|
|
41380
|
+
}
|
|
41108
41381
|
const agentChanged = parsed.body.targetAgentId !== undefined && parsed.body.targetAgentId !== existing.targetAgentId;
|
|
41109
41382
|
const profileUpdate = await scheduleProfileUpdate(existing, parsed.body);
|
|
41110
41383
|
if (profileUpdate.error !== undefined) {
|
|
@@ -41336,13 +41609,19 @@ var sqlQueryRoute = route({
|
|
|
41336
41609
|
404: { description: "Script connection or agent not found" }
|
|
41337
41610
|
}
|
|
41338
41611
|
});
|
|
41339
|
-
function connectionScopeMatches(connection, agentId, syntheticPrincipal) {
|
|
41612
|
+
function connectionScopeMatches(connection, agentId, syntheticPrincipal, principal) {
|
|
41340
41613
|
if (connection.scope === "global")
|
|
41341
41614
|
return true;
|
|
41342
41615
|
if (connection.scope === "agent")
|
|
41343
41616
|
return !syntheticPrincipal && connection.scopeId === agentId;
|
|
41344
|
-
if (connection.scope === "repo")
|
|
41345
|
-
return
|
|
41617
|
+
if (connection.scope === "repo") {
|
|
41618
|
+
return !syntheticPrincipal && can({
|
|
41619
|
+
principal,
|
|
41620
|
+
verb: "config.read.secrets",
|
|
41621
|
+
resource: { kind: "none" },
|
|
41622
|
+
source: "http"
|
|
41623
|
+
}).allow;
|
|
41624
|
+
}
|
|
41346
41625
|
return false;
|
|
41347
41626
|
}
|
|
41348
41627
|
function isSyntheticScriptPrincipal(agentId) {
|
|
@@ -41365,8 +41644,9 @@ async function handleScriptConnectionProxy(req, res, pathSegments, queryParams,
|
|
|
41365
41644
|
jsonError(res, "Agent not found", 404);
|
|
41366
41645
|
return true;
|
|
41367
41646
|
}
|
|
41647
|
+
const principal = { kind: "agent", agentId, isLead: agent?.isLead ?? false };
|
|
41368
41648
|
const decision = can({
|
|
41369
|
-
principal
|
|
41649
|
+
principal,
|
|
41370
41650
|
verb: "script-connection.invoke",
|
|
41371
41651
|
resource: { kind: "none" },
|
|
41372
41652
|
source: "http"
|
|
@@ -41388,7 +41668,7 @@ async function handleScriptConnectionProxy(req, res, pathSegments, queryParams,
|
|
|
41388
41668
|
jsonError(res, `Script connection is not ${isSql ? "a SQL" : "an MCP"} connection`, 400);
|
|
41389
41669
|
return true;
|
|
41390
41670
|
}
|
|
41391
|
-
if (!connectionScopeMatches(connection, agentId, syntheticPrincipal)) {
|
|
41671
|
+
if (!connectionScopeMatches(connection, agentId, syntheticPrincipal, principal)) {
|
|
41392
41672
|
jsonError(res, "Script connection is not available to this agent", 403);
|
|
41393
41673
|
return true;
|
|
41394
41674
|
}
|
|
@@ -41435,6 +41715,7 @@ init_presets2();
|
|
|
41435
41715
|
init_wrapper();
|
|
41436
41716
|
init_credential_broker();
|
|
41437
41717
|
init_telemetry();
|
|
41718
|
+
init_egress_guard();
|
|
41438
41719
|
init_scoped_resource();
|
|
41439
41720
|
init_secret_scrubber();
|
|
41440
41721
|
init_route_def();
|
|
@@ -42442,7 +42723,7 @@ async function attemptRemoteRevocation(app, accessToken) {
|
|
|
42442
42723
|
const controller = new AbortController;
|
|
42443
42724
|
const timeout = setTimeout(() => controller.abort(), 5000);
|
|
42444
42725
|
try {
|
|
42445
|
-
await
|
|
42726
|
+
await createSsrfGuardedFetch(publicEndpointSsrfOptions())(revocationUrl, {
|
|
42446
42727
|
method: "POST",
|
|
42447
42728
|
headers,
|
|
42448
42729
|
body: body.toString(),
|
|
@@ -42468,9 +42749,10 @@ function oauthDiscoveryUrls(inputUrl) {
|
|
|
42468
42749
|
}
|
|
42469
42750
|
async function fetchJsonMetadata(url, signal) {
|
|
42470
42751
|
let current = assertUrlSafe(url, publicEndpointSsrfOptions());
|
|
42752
|
+
const guardedFetch = createSsrfGuardedFetch(publicEndpointSsrfOptions());
|
|
42471
42753
|
let response = null;
|
|
42472
42754
|
for (let hop = 0;hop <= 5; hop += 1) {
|
|
42473
|
-
response = await
|
|
42755
|
+
response = await guardedFetch(current, {
|
|
42474
42756
|
headers: { accept: "application/json" },
|
|
42475
42757
|
signal,
|
|
42476
42758
|
redirect: "manual"
|
|
@@ -42542,7 +42824,7 @@ async function discoverOAuthApp(url) {
|
|
|
42542
42824
|
function isUrlSafetyError(error) {
|
|
42543
42825
|
if (!(error instanceof Error))
|
|
42544
42826
|
return false;
|
|
42545
|
-
return error.message.startsWith("Refusing ") || error.message.startsWith("Invalid URL:") || error.message.startsWith("Missing hostname:");
|
|
42827
|
+
return error instanceof EgressDeniedError || error.message.startsWith("Refusing ") || error.message.startsWith("Invalid URL:") || error.message.startsWith("Missing hostname:");
|
|
42546
42828
|
}
|
|
42547
42829
|
function stringFromCatalogEntry(entry, keys) {
|
|
42548
42830
|
for (const key of keys) {
|
|
@@ -43320,26 +43602,6 @@ async function handleScriptConnections(req, res, pathSegments, queryParams, agen
|
|
|
43320
43602
|
init_zod();
|
|
43321
43603
|
init_db4();
|
|
43322
43604
|
init_model_validation2();
|
|
43323
|
-
|
|
43324
|
-
// src/be/scripts/source-secrets.ts
|
|
43325
|
-
init_secret_scrubber();
|
|
43326
|
-
function refuseSourceWithSecrets(source) {
|
|
43327
|
-
const { knownValues, gitleaksRules } = findSecretsIn(source);
|
|
43328
|
-
if (knownValues.length === 0 && gitleaksRules.length === 0)
|
|
43329
|
-
return null;
|
|
43330
|
-
const findings = [
|
|
43331
|
-
...knownValues.map((id) => ({ kind: "registered-secret", id })),
|
|
43332
|
-
...gitleaksRules.map((id) => ({ kind: "gitleaks-rule", id }))
|
|
43333
|
-
];
|
|
43334
|
-
const named = findings.map((f) => f.kind === "registered-secret" ? `registered secret ${f.id}` : `gitleaks rule ${f.id}`).join(", ");
|
|
43335
|
-
return {
|
|
43336
|
-
error: "source_contains_secret",
|
|
43337
|
-
message: `Script source contains a secret (${named}); nothing was saved or run. Source is stored and shown verbatim, so read secrets at run time instead: a credential binding (ctx.api.<slug> / ctx.mcp.<slug>) or ctx.swarm.config.get("<KEY>").`,
|
|
43338
|
-
findings
|
|
43339
|
-
};
|
|
43340
|
-
}
|
|
43341
|
-
|
|
43342
|
-
// src/http/script-runs.ts
|
|
43343
43605
|
init_rbac();
|
|
43344
43606
|
|
|
43345
43607
|
// src/script-workflows/label-lint.ts
|
|
@@ -43417,6 +43679,7 @@ init_constants3();
|
|
|
43417
43679
|
init_secret_scrubber();
|
|
43418
43680
|
init_raw_llm();
|
|
43419
43681
|
init_route_def();
|
|
43682
|
+
init_task_requester();
|
|
43420
43683
|
init_utils2();
|
|
43421
43684
|
var DEFAULT_SCRIPT_RUN_CONCURRENCY_CAP = 10;
|
|
43422
43685
|
var runIdParamsSchema = object2({ runId: string2().uuid() });
|
|
@@ -43752,6 +44015,7 @@ async function handleScriptRuns(req, res, pathSegments, queryParams, agentId) {
|
|
|
43752
44015
|
}
|
|
43753
44016
|
const cap = scriptRunConcurrencyCap();
|
|
43754
44017
|
const sourceTaskId = await resolveRunSourceTaskId(req, agent.id);
|
|
44018
|
+
const requestedByUserId = parsed.body.requestedByUserId ? await resolveTaskRequester(req, agent.id, parsed.body.requestedByUserId) : undefined;
|
|
43755
44019
|
const creation = await getDbClient2().transaction(async () => {
|
|
43756
44020
|
if (await countActiveScriptRuns2() >= cap)
|
|
43757
44021
|
return null;
|
|
@@ -43762,9 +44026,9 @@ async function handleScriptRuns(req, res, pathSegments, queryParams, agentId) {
|
|
|
43762
44026
|
args: parsed.body.args ?? null,
|
|
43763
44027
|
scriptName: parsed.body.scriptName,
|
|
43764
44028
|
idempotencyKey: parsed.body.idempotencyKey,
|
|
43765
|
-
requestedByUserId
|
|
44029
|
+
requestedByUserId,
|
|
43766
44030
|
sourceTaskId,
|
|
43767
|
-
createdBy:
|
|
44031
|
+
createdBy: requestedByUserId
|
|
43768
44032
|
});
|
|
43769
44033
|
});
|
|
43770
44034
|
if (!creation) {
|
|
@@ -43986,6 +44250,7 @@ async function handleScriptRuns(req, res, pathSegments, queryParams, agentId) {
|
|
|
43986
44250
|
return true;
|
|
43987
44251
|
}
|
|
43988
44252
|
const followUpThread = await followUpThreadForSourceTask(run.sourceTaskId);
|
|
44253
|
+
const stepRequester = parsed.body.requestedByUserId ? await resolveTaskRequester(req, agentId, parsed.body.requestedByUserId, null) : undefined;
|
|
43989
44254
|
let dispatched;
|
|
43990
44255
|
try {
|
|
43991
44256
|
dispatched = await getDbClient2().transaction(async () => {
|
|
@@ -44036,7 +44301,7 @@ async function handleScriptRuns(req, res, pathSegments, queryParams, agentId) {
|
|
|
44036
44301
|
vcsRepo: parsed.body.vcsRepo,
|
|
44037
44302
|
model: parsed.body.model,
|
|
44038
44303
|
parentTaskId: parsed.body.parentTaskId,
|
|
44039
|
-
requestedByUserId:
|
|
44304
|
+
requestedByUserId: stepRequester ?? run.requestedByUserId,
|
|
44040
44305
|
outputSchema: parsed.body.outputSchema,
|
|
44041
44306
|
contextKey
|
|
44042
44307
|
});
|
|
@@ -44109,9 +44374,9 @@ init_request_auth_context();
|
|
|
44109
44374
|
init_secret_scrubber();
|
|
44110
44375
|
init_route_def();
|
|
44111
44376
|
init_utils2();
|
|
44112
|
-
var
|
|
44377
|
+
var scriptNameSchema2 = string2().min(1).max(200);
|
|
44113
44378
|
var upsertBodySchema = object2({
|
|
44114
|
-
name:
|
|
44379
|
+
name: scriptNameSchema2,
|
|
44115
44380
|
source: string2().min(1),
|
|
44116
44381
|
description: string2().default(""),
|
|
44117
44382
|
intent: string2().default(""),
|
|
@@ -44120,7 +44385,7 @@ var upsertBodySchema = object2({
|
|
|
44120
44385
|
executor: ScriptExecutorNameSchema.nullable().optional()
|
|
44121
44386
|
});
|
|
44122
44387
|
var runBodySchema = object2({
|
|
44123
|
-
name:
|
|
44388
|
+
name: scriptNameSchema2.optional(),
|
|
44124
44389
|
source: string2().min(1).optional(),
|
|
44125
44390
|
args: unknown().optional(),
|
|
44126
44391
|
intent: string2().default(""),
|
|
@@ -44136,7 +44401,7 @@ var searchBodySchema = object2({
|
|
|
44136
44401
|
scope: ScriptScopeSchema.optional(),
|
|
44137
44402
|
limit: number2().int().min(1).max(100).default(10)
|
|
44138
44403
|
});
|
|
44139
|
-
var nameParamsSchema = object2({ name:
|
|
44404
|
+
var nameParamsSchema = object2({ name: scriptNameSchema2 });
|
|
44140
44405
|
var scopeQuerySchema = object2({ scope: ScriptScopeSchema.default("agent") });
|
|
44141
44406
|
var optionalScopeQuerySchema = object2({ scope: ScriptScopeSchema.optional() });
|
|
44142
44407
|
var idParamsSchema4 = object2({ id: string2().uuid() });
|
|
@@ -44780,15 +45045,7 @@ async function handleScripts(req, res, pathSegments, queryParams, agentId) {
|
|
|
44780
45045
|
scopeId: agent.id,
|
|
44781
45046
|
limit: parsed.body.limit
|
|
44782
45047
|
});
|
|
44783
|
-
searchRoute.respond(res, 200, {
|
|
44784
|
-
results: matches.map(({ script, score }) => ({
|
|
44785
|
-
name: script.name,
|
|
44786
|
-
signature: JSON.parse(script.signatureJson),
|
|
44787
|
-
argsJsonSchema: script.argsJsonSchema ? JSON.parse(script.argsJsonSchema) : null,
|
|
44788
|
-
description: script.description,
|
|
44789
|
-
score
|
|
44790
|
-
}))
|
|
44791
|
-
});
|
|
45048
|
+
searchRoute.respond(res, 200, { results: toScriptSearchResults(matches) });
|
|
44792
45049
|
return true;
|
|
44793
45050
|
}
|
|
44794
45051
|
if (listScriptsRoute.match(req.method, pathSegments)) {
|
|
@@ -50024,7 +50281,8 @@ var UNMAPPED_KINDS = [
|
|
|
50024
50281
|
"kapso",
|
|
50025
50282
|
"telegram",
|
|
50026
50283
|
"discord",
|
|
50027
|
-
"teams"
|
|
50284
|
+
"teams",
|
|
50285
|
+
"rocketchat"
|
|
50028
50286
|
];
|
|
50029
50287
|
async function collectUnmappedForKind(kind, limit) {
|
|
50030
50288
|
const namespace = `integration:unmapped:${kind}`;
|
|
@@ -53466,7 +53724,7 @@ var httpServer = createHttpServer(async (req, res) => {
|
|
|
53466
53724
|
});
|
|
53467
53725
|
});
|
|
53468
53726
|
var detachRealtime = attachRealtimeTransport(httpServer);
|
|
53469
|
-
var { attachControllerTransport } = await import("./controllers-connect-
|
|
53727
|
+
var { attachControllerTransport } = await import("./controllers-connect-09gvkrhc.js");
|
|
53470
53728
|
var detachControllers = attachControllerTransport(httpServer);
|
|
53471
53729
|
var stopWorkerNudges = startWorkerNudgeListener();
|
|
53472
53730
|
var taskAutoTitles = startTaskAutoTitleListener();
|
|
@@ -53497,7 +53755,7 @@ async function shutdown() {
|
|
|
53497
53755
|
sessionsProcessed: getServerSessionsProcessed()
|
|
53498
53756
|
});
|
|
53499
53757
|
if (hasCapability("scheduling")) {
|
|
53500
|
-
const { stopScheduler } = await import("./index-
|
|
53758
|
+
const { stopScheduler } = await import("./index-6bm3w6cn.js");
|
|
53501
53759
|
stopScheduler();
|
|
53502
53760
|
}
|
|
53503
53761
|
stopHeartbeat2();
|
|
@@ -53509,7 +53767,7 @@ async function shutdown() {
|
|
|
53509
53767
|
await stopSlackApp2();
|
|
53510
53768
|
await stopChatSdk();
|
|
53511
53769
|
if (!isEnvFlagEnabled("OAUTH_KEEPALIVE_DISABLE", false)) {
|
|
53512
|
-
const { stopOAuthKeepalive } = await import("./keepalive-
|
|
53770
|
+
const { stopOAuthKeepalive } = await import("./keepalive-7e9r5dvp.js");
|
|
53513
53771
|
await stopOAuthKeepalive();
|
|
53514
53772
|
}
|
|
53515
53773
|
stopOAuthPendingGc();
|
|
@@ -53599,21 +53857,21 @@ try {
|
|
|
53599
53857
|
console.warn("[startup] CAPABILITIES upgrade seed failed (non-fatal):", err);
|
|
53600
53858
|
}
|
|
53601
53859
|
try {
|
|
53602
|
-
const { ensurePricingSeeded } = await import("./boot-seeds-
|
|
53860
|
+
const { ensurePricingSeeded } = await import("./boot-seeds-32zm50x2.js");
|
|
53603
53861
|
ensurePricingSeeded();
|
|
53604
|
-
const { startPricingRefreshLoop } = await import("./pricing-refresh-
|
|
53862
|
+
const { startPricingRefreshLoop } = await import("./pricing-refresh-kfc215mf.js");
|
|
53605
53863
|
startPricingRefreshLoop();
|
|
53606
53864
|
} catch (err) {
|
|
53607
53865
|
console.error("[startup] Failed to seed pricing rows:", err);
|
|
53608
53866
|
}
|
|
53609
53867
|
try {
|
|
53610
|
-
const { ensureModelProfilesSeeded } = await import("./boot-seeds-
|
|
53868
|
+
const { ensureModelProfilesSeeded } = await import("./boot-seeds-32zm50x2.js");
|
|
53611
53869
|
await ensureModelProfilesSeeded();
|
|
53612
53870
|
} catch (err) {
|
|
53613
53871
|
console.error("[startup] Failed to seed model profiles:", err);
|
|
53614
53872
|
}
|
|
53615
53873
|
try {
|
|
53616
|
-
const { ensureRbacSeeded } = await import("./boot-seeds-
|
|
53874
|
+
const { ensureRbacSeeded } = await import("./boot-seeds-32zm50x2.js");
|
|
53617
53875
|
ensureRbacSeeded();
|
|
53618
53876
|
} catch (err) {
|
|
53619
53877
|
console.error("[startup] Failed to sync RBAC seed rows:", err);
|
|
@@ -53621,13 +53879,13 @@ try {
|
|
|
53621
53879
|
throw err;
|
|
53622
53880
|
}
|
|
53623
53881
|
try {
|
|
53624
|
-
const { runAllSeeders } = await import("./index-
|
|
53882
|
+
const { runAllSeeders } = await import("./index-0vthtbc2.js");
|
|
53625
53883
|
await runAllSeeders({ scriptEmbeddingMode: "skip" });
|
|
53626
53884
|
} catch (err) {
|
|
53627
53885
|
console.error("[startup] Failed to seed built-in entities:", err);
|
|
53628
53886
|
}
|
|
53629
53887
|
try {
|
|
53630
|
-
const { runImports } = await import("./index-
|
|
53888
|
+
const { runImports } = await import("./index-xcw7hjt5.js");
|
|
53631
53889
|
await runImports();
|
|
53632
53890
|
} catch (err) {
|
|
53633
53891
|
console.error("[startup] File import failed:", scrubSecrets(err instanceof Error ? err.message : String(err)));
|
|
@@ -53678,10 +53936,10 @@ httpServer.listen(port, async () => {
|
|
|
53678
53936
|
startChatSdk().catch((err) => {
|
|
53679
53937
|
console.error("[chat-sdk] Failed to start, continuing without Chat SDK:", scrubSecrets(err instanceof Error ? err.message : String(err)));
|
|
53680
53938
|
});
|
|
53681
|
-
import("./agent-fs-provision-
|
|
53939
|
+
import("./agent-fs-provision-6fgz7wvz.js").then(({ syncAgentFsOrgSwarmUrl }) => syncAgentFsOrgSwarmUrl(getConfiguredAppUrls()[0])).catch((err) => {
|
|
53682
53940
|
console.warn("[agent-fs] Failed to set the org swarm URL:", scrubSecrets(err instanceof Error ? err.message : String(err)));
|
|
53683
53941
|
});
|
|
53684
|
-
import("./object-webhooks-
|
|
53942
|
+
import("./object-webhooks-ac7v2q5p.js").then(({ ensureObjectWebhooksForKnownDrives }) => ensureObjectWebhooksForKnownDrives()).catch((err) => {
|
|
53685
53943
|
console.warn("[objects] agent-fs webhook boot check failed:", scrubSecrets(err instanceof Error ? err.message : String(err)));
|
|
53686
53944
|
});
|
|
53687
53945
|
startQueueStallAlarm();
|
|
@@ -53697,25 +53955,25 @@ httpServer.listen(port, async () => {
|
|
|
53697
53955
|
await initWorkflows2();
|
|
53698
53956
|
await startScriptRunSupervisor(getMcpBaseUrl());
|
|
53699
53957
|
if (hasCapability("scheduling")) {
|
|
53700
|
-
const { startScheduler } = await import("./index-
|
|
53701
|
-
const { getExecutorRegistry } = await import("./index-
|
|
53958
|
+
const { startScheduler } = await import("./index-6bm3w6cn.js");
|
|
53959
|
+
const { getExecutorRegistry } = await import("./index-30qw6vyw.js");
|
|
53702
53960
|
const intervalMs = Number(process.env.SCHEDULER_INTERVAL_MS) || 1e4;
|
|
53703
53961
|
startScheduler(getExecutorRegistry(), intervalMs, {
|
|
53704
53962
|
runId: globalState.__runId
|
|
53705
53963
|
});
|
|
53706
53964
|
}
|
|
53707
53965
|
if (!isEnvFlagEnabled("HEARTBEAT_DISABLE", false)) {
|
|
53708
|
-
const { parseHeartbeatIntervalMs, startHeartbeat } = await import("./index-
|
|
53966
|
+
const { parseHeartbeatIntervalMs, startHeartbeat } = await import("./index-1v23363p.js");
|
|
53709
53967
|
startHeartbeat(parseHeartbeatIntervalMs(process.env.HEARTBEAT_INTERVAL_MS));
|
|
53710
53968
|
}
|
|
53711
53969
|
startPoolRouting();
|
|
53712
53970
|
startRuntimeSupervisor();
|
|
53713
53971
|
if (!isEnvFlagEnabled("OAUTH_KEEPALIVE_DISABLE", false)) {
|
|
53714
|
-
const { startOAuthKeepalive } = await import("./keepalive-
|
|
53972
|
+
const { startOAuthKeepalive } = await import("./keepalive-7e9r5dvp.js");
|
|
53715
53973
|
startOAuthKeepalive();
|
|
53716
53974
|
}
|
|
53717
53975
|
if (!isEnvFlagEnabled("OAUTH_REFRESH_SWEEP_DISABLE", false)) {
|
|
53718
|
-
const { startOAuthRefreshSweep } = await import("./oauth-refresh-sweep-
|
|
53976
|
+
const { startOAuthRefreshSweep } = await import("./oauth-refresh-sweep-0qh70988.js");
|
|
53719
53977
|
startOAuthRefreshSweep();
|
|
53720
53978
|
}
|
|
53721
53979
|
startOAuthPendingGc();
|
|
@@ -53725,22 +53983,22 @@ httpServer.listen(port, async () => {
|
|
|
53725
53983
|
startSavingsRollup(savingsRollupSql);
|
|
53726
53984
|
startHumanFreeDrain();
|
|
53727
53985
|
startTaskSearchBackfill();
|
|
53728
|
-
import("./embedding-space-
|
|
53986
|
+
import("./embedding-space-an77f45k.js").then(({ runEmbeddingMaintenance, setDeploymentEnvReader }) => {
|
|
53729
53987
|
setDeploymentEnvReader(getDeploymentEnvValue2);
|
|
53730
53988
|
return runEmbeddingMaintenance({ backfill: true });
|
|
53731
53989
|
}).catch((err) => {
|
|
53732
53990
|
console.error("[embedding-space] startup maintenance failed (non-fatal):", err);
|
|
53733
53991
|
});
|
|
53734
|
-
import("./boot-args-schema-
|
|
53992
|
+
import("./boot-args-schema-bqv5bf77.js").then(({ runBootArgsSchemaBackfill }) => runBootArgsSchemaBackfill()).catch((err) => {
|
|
53735
53993
|
console.error("[boot-args-schema] startup backfill failed (non-fatal):", err);
|
|
53736
53994
|
});
|
|
53737
|
-
import("./boot-scrub-sweep-
|
|
53995
|
+
import("./boot-scrub-sweep-tmec0be2.js").then(({ runBootScrubSweep }) => runBootScrubSweep()).catch((err) => {
|
|
53738
53996
|
console.error("[boot-scrub-sweep] startup scrub failed (non-fatal):", err);
|
|
53739
53997
|
});
|
|
53740
|
-
import("./user-merge-jobs-
|
|
53998
|
+
import("./user-merge-jobs-4ce7kma2.js").then(({ resumeUserMergeJobs }) => resumeUserMergeJobs()).catch((err) => {
|
|
53741
53999
|
console.error("[user-merge] startup resume failed (non-fatal):", err);
|
|
53742
54000
|
});
|
|
53743
|
-
import("./session-source-backfill-
|
|
54001
|
+
import("./session-source-backfill-jpqfzmgz.js").then(({ runSessionSourceBackfill }) => runSessionSourceBackfill()).catch((err) => {
|
|
53744
54002
|
console.error("[session-source-backfill] startup run failed (non-fatal):", err);
|
|
53745
54003
|
});
|
|
53746
54004
|
}).on("error", (err) => {
|