@desplega.ai/agent-swarm 2.13.5 → 2.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/acp-adapter-99n6z9ky.js +17 -0
- package/dist/{acp-targets-w8dbs4nr.js → acp-targets-23exz4z4.js} +10 -10
- package/dist/{actions-8zrcbjrx.js → actions-zcr25x27.js} +60 -39
- package/dist/{agent-fs-provision-cbt2ttds.js → agent-fs-provision-7fa9e12e.js} +4 -4
- package/dist/{amp-adapter-8x6zp8w4.js → amp-adapter-s7ytmv6b.js} +3 -3
- package/dist/{app-zfa9dwjw.js → app-5d3sz1hy.js} +7 -7
- package/dist/{approval-notifications-rv92zmza.js → approval-notifications-7qgkzkzx.js} +8 -8
- package/dist/{assistant-q7s7rm1q.js → assistant-p2yvhc3j.js} +37 -32
- package/dist/{boot-args-schema-g27kpzr1.js → boot-args-schema-ry6cb0p7.js} +1 -1
- package/dist/{boot-reembed-1mjs52nt.js → boot-reembed-2hkm3vz2.js} +1 -1
- package/dist/{boot-reembed-m62dpdkg.js → boot-reembed-c9643ms3.js} +1 -1
- package/dist/{boot-scrub-sweep-ss1vcamw.js → boot-scrub-sweep-3ycxr51t.js} +2 -2
- package/dist/{boot-seeds-hwnvgbb3.js → boot-seeds-2hzvvzg0.js} +4 -4
- package/dist/{boxd-y0szhp0g.js → boxd-9py3x0jb.js} +2 -2
- package/dist/{claude-adapter-0rjmbhjk.js → claude-adapter-dnkww93e.js} +9 -9
- package/dist/{claude-managed-adapter-6k032agg.js → claude-managed-adapter-yk0cr5x6.js} +4 -4
- package/dist/{claude-managed-setup-6czvve8q.js → claude-managed-setup-4byxpp47.js} +5 -5
- package/dist/{claude-sdk-session-pr0znb81.js → claude-sdk-session-4wf3dbvs.js} +12467 -12285
- package/dist/{cli-t0n9svkb.js → cli-096aftq6.js} +12 -7
- package/dist/{cli-2wzkvfgm.js → cli-0e914dp9.js} +3 -3
- package/dist/{cli-vcpyttcw.js → cli-0h6m6z5g.js} +1 -1
- package/dist/{cli-q41qar56.js → cli-0k7ppk9k.js} +130 -8
- package/dist/{cli-ks06cd0n.js → cli-1nfabrt4.js} +8 -8
- package/dist/{cli-ebpq3c5z.js → cli-2414h5r9.js} +8 -8
- package/dist/{cli-nrt048ys.js → cli-24wervhz.js} +37 -0
- package/dist/{cli-pedm2kht.js → cli-2ayk9gn8.js} +2 -2
- package/dist/{cli-kr0jpw9c.js → cli-2ckwgs7q.js} +1 -1
- package/dist/{cli-evy3egte.js → cli-2savn6mm.js} +11 -100
- package/dist/{cli-n79j1vxc.js → cli-2zjxake1.js} +4 -4
- package/dist/{cli-z3x7h79n.js → cli-37p61fcg.js} +9 -9
- package/dist/{cli-2vp0z049.js → cli-39t9d248.js} +1 -1
- package/dist/{cli-sa02jsqt.js → cli-3mhdmcd4.js} +1 -1
- package/dist/{cli-34fygf87.js → cli-3wsabyt0.js} +2 -2
- package/dist/{cli-grbngev5.js → cli-466jjrwe.js} +11 -2
- package/dist/{cli-zxa1vmx7.js → cli-6ajyhxh7.js} +2 -2
- package/dist/{cli-bvamr9g0.js → cli-6yy4fepf.js} +4 -4
- package/dist/{cli-3vw6dd4g.js → cli-73rmgm45.js} +2 -2
- package/dist/{cli-8b4rpnwj.js → cli-7ca8hczj.js} +1 -1
- package/dist/{cli-0h8skzss.js → cli-7g5qj2ca.js} +4 -3
- package/dist/{cli-srre41gb.js → cli-7w1fs01q.js} +2 -2
- package/dist/{cli-tgc1kgg3.js → cli-84wxwt3z.js} +1 -1
- package/dist/{cli-4gaf3tx5.js → cli-84xn7bgz.js} +1 -1
- package/dist/{cli-s8dhq7rj.js → cli-879txsac.js} +5 -5
- package/dist/{cli-9n6g14vs.js → cli-8vbxjzk0.js} +3 -3
- package/dist/{cli-cmbb2t8a.js → cli-91amj3md.js} +2 -2
- package/dist/{cli-ewk3sg68.js → cli-930zbczq.js} +3 -3
- package/dist/{cli-6msnpj1z.js → cli-9fwznq4p.js} +10 -10
- package/dist/{cli-qmx8bnt4.js → cli-9j1t3kf6.js} +2 -2
- package/dist/{cli-t879ww0y.js → cli-9j47sgzy.js} +2 -2
- package/dist/{cli-0qt3epg4.js → cli-ad00h1st.js} +7 -7
- package/dist/{cli-avax5mp9.js → cli-adzmmcvf.js} +19 -7
- package/dist/{cli-ffn0a515.js → cli-ayxxkk3p.js} +68 -25
- package/dist/{cli-4vynxtrb.js → cli-bqfx72e6.js} +10 -3
- package/dist/{cli-887vhew6.js → cli-cbg0j1yt.js} +2716 -2643
- package/dist/{cli-fw67mnyc.js → cli-cg1q8ymp.js} +1 -1
- package/dist/{cli-he5nxaa8.js → cli-dw9rtjm3.js} +1 -1
- package/dist/{cli-emdfd8fh.js → cli-dy754erz.js} +9 -1
- package/dist/{cli-3860pmrq.js → cli-edxfzgah.js} +4 -4
- package/dist/{cli-v09eza21.js → cli-ejnhs815.js} +15 -15
- package/dist/{cli-k0nebh10.js → cli-enavhq6r.js} +1 -1
- package/dist/{cli-b42yfn17.js → cli-f2rwt43y.js} +13 -13
- package/dist/{cli-tvyt8w6n.js → cli-f9g96z28.js} +8 -8
- package/dist/{cli-zbbtp02a.js → cli-fww016hh.js} +457 -70
- package/dist/{cli-vbge4rsp.js → cli-g6a696c0.js} +4 -4
- package/dist/{cli-z1vam71h.js → cli-gc6b94tj.js} +2 -2
- package/dist/{cli-5tq15aa7.js → cli-gcyws2bp.js} +2 -2
- package/dist/{cli-srktrbby.js → cli-hzhv7yac.js} +1 -1
- package/dist/{cli-cp163xga.js → cli-jcnc5ret.js} +44 -32
- package/dist/{cli-j69pzrrz.js → cli-jgq9xptq.js} +5 -5
- package/dist/{cli-kwj3131p.js → cli-jwnac23b.js} +1 -1
- package/dist/{cli-wzecestt.js → cli-kc7vd07m.js} +616 -289
- package/dist/{cli-8pd1t17c.js → cli-kg63yp1r.js} +14 -14
- package/dist/{cli-zzq96q57.js → cli-krk8y8c7.js} +727 -139
- package/dist/{cli-5web09sb.js → cli-m0ea8ggd.js} +8 -10
- package/dist/{cli-qrvk9nka.js → cli-md4tn21h.js} +13 -13
- package/dist/{cli-1jq2em7b.js → cli-mv8ft7b0.js} +10 -9
- package/dist/{cli-ryem5cfq.js → cli-mw1tmn3x.js} +217 -27
- package/dist/{cli-abby987g.js → cli-njvpngc6.js} +3 -3
- package/dist/{cli-55h8m1x3.js → cli-phe2vcw5.js} +6 -6
- package/dist/{cli-prz1p3ft.js → cli-pq0kv31y.js} +5 -5
- package/dist/{cli-q1h041y8.js → cli-q457ga28.js} +6 -6
- package/dist/{cli-z40t85ms.js → cli-q5n3deaf.js} +1 -1
- package/dist/{cli-7ypg8hka.js → cli-qkbevqer.js} +3 -3
- package/dist/{cli-f9xw9pr4.js → cli-qrwjk4xy.js} +5 -5
- package/dist/{cli-kezzteka.js → cli-r04ve9xw.js} +1 -1
- package/dist/{cli-zntvmqmm.js → cli-r495stwd.js} +2 -2
- package/dist/{cli-1kvcsd2f.js → cli-r9d2tya0.js} +71 -3
- package/dist/{cli-ybte1fqc.js → cli-rp1n2xpd.js} +1 -1
- package/dist/{cli-sejvnjvw.js → cli-rs1rzwp4.js} +1 -1
- package/dist/{cli-94mxerrp.js → cli-rzbsh6bw.js} +1 -1
- package/dist/{cli-94gx6ze9.js → cli-s4pccby1.js} +1 -1
- package/dist/{cli-hd5bm1e1.js → cli-shyhb4t5.js} +10 -10
- package/dist/{cli-r3dxpmyt.js → cli-srq69pn1.js} +1 -1
- package/dist/{cli-7r9tvk8v.js → cli-tc165vrb.js} +8 -3
- package/dist/{cli-ced4azn1.js → cli-v4z5v3jd.js} +298 -80
- package/dist/{cli-ehg90jd1.js → cli-vxmmttmt.js} +55 -50
- package/dist/{cli-tt7dkwjj.js → cli-w4bvtxet.js} +7 -7
- package/dist/{cli-x2adbg4j.js → cli-wd7b5hgc.js} +1 -1
- package/dist/{cli-htb5bpz2.js → cli-wvbaq052.js} +1 -1
- package/dist/{cli-ywy8yz6t.js → cli-wvgg7r4j.js} +2 -2
- package/dist/{cli-19d6v8er.js → cli-wym6rxgt.js} +165 -6
- package/dist/{cli-f7b9nyvk.js → cli-yd7e590v.js} +12 -12
- package/dist/{cli-69zzpjgh.js → cli-yjb3cddd.js} +1 -1
- package/dist/{cli-5n9w2xzx.js → cli-z8t4485r.js} +2 -2
- package/dist/{cli-jdq3jmny.js → cli-ze1ndjs4.js} +4 -6
- package/dist/cli.js +28 -28
- package/dist/{codex-adapter-bn7eaxk5.js → codex-adapter-eq61radw.js} +8 -8
- package/dist/{codex-hook-nnmezjg9.js → codex-hook-8nmepvz6.js} +3 -3
- package/dist/{codex-login-ktfg1cxk.js → codex-login-vbd9707w.js} +1 -1
- package/dist/{codex-session-runner-j1e9hffc.js → codex-session-runner-rfx355h4.js} +9 -9
- package/dist/{commands-amhpafrr.js → commands-d1z0sx62.js} +3 -3
- package/dist/{controller-tw7g10j2.js → controller-9hz6d8x3.js} +4 -4
- package/dist/{controllers-connect-2ssqz7f4.js → controllers-connect-tz07d2xr.js} +24 -25
- package/dist/core-dynsv289.js +41 -0
- package/dist/{cursor-adapter-d6knjmwa.js → cursor-adapter-ef22ze3j.js} +2 -2
- package/dist/{db-fd6xxm77.js → db-gd81d68c.js} +3 -3
- package/dist/{db-sc59379z.js → db-vrckks6q.js} +4 -2
- package/dist/{devin-adapter-3bp6rape.js → devin-adapter-kdt6a2bh.js} +1 -1
- package/dist/{dispatcher-a2gdqz8c.js → dispatcher-76as8w2t.js} +21 -22
- package/dist/{docker-a59g3ebm.js → docker-51ta7jsh.js} +2 -2
- package/dist/dsh-adapter-ypfvcdyz.js +11 -0
- package/dist/{e2b-cn7cvjqy.js → e2b-05kn3kpq.js} +16 -5
- package/dist/{e2b-qnxyfea6.js → e2b-dm9r8hpy.js} +3 -3
- package/dist/{easter-egg-3d-a0pphy71.js → easter-egg-3d-sg21j15g.js} +1 -1
- package/dist/{embedding-space-qepzrach.js → embedding-space-zsdw37bb.js} +13 -23
- package/dist/{embeddings-d7vr881x.js → embeddings-p4e3e1m6.js} +1 -1
- package/dist/{event-bus-7gbsr0g4.js → event-bus-tvf2grf4.js} +1 -1
- package/dist/{execute-6afts2bn.js → execute-nztd0af0.js} +1 -1
- package/dist/{external-channel-881zq1x4.js → external-channel-717yzn4d.js} +2 -2
- package/dist/fx-adapter-9k0hptnz.js +20 -0
- package/dist/grok-adapter-skdj2pce.js +20 -0
- package/dist/handlers-5btjqkz6.js +39 -0
- package/dist/{heartbeat-4c022m6a.js → heartbeat-vfb1gy84.js} +24 -25
- package/dist/{hook-a7eh6zty.js → hook-ctz0xmp3.js} +11 -11
- package/dist/{hook-4k84x499.js → hook-eh52p7yd.js} +6 -6
- package/dist/{http-6aw5wanc.js → http-zregegrx.js} +784 -166
- package/dist/{index-xhad0n8m.js → index-5kx15d19.js} +1 -1
- package/dist/index-7w8p6em0.js +41 -0
- package/dist/index-evay0xyk.js +17 -0
- package/dist/{index-yq9hhhhy.js → index-fdym6ryb.js} +25 -26
- package/dist/{index-3j803vnb.js → index-mtnbhe12.js} +20533 -19786
- package/dist/index-vz4semsx.js +38 -0
- package/dist/{index-z2g9469g.js → index-x9qf8dg7.js} +108 -28
- package/dist/index-y3s0xp2v.js +43 -0
- package/dist/{k8s-36gfn847.js → k8s-ejkk0aw7.js} +2 -2
- package/dist/{keepalive-zhbmztqw.js → keepalive-zdqay870.js} +4 -5
- package/dist/lead-6cscw8a5.js +82 -0
- package/dist/{maintenance-rsp0591h.js → maintenance-t5ndg11m.js} +1 -1
- package/dist/{node-rxte5hc6.js → node-jkdd5w7m.js} +1 -1
- package/dist/{oauth-refresh-sweep-w3cqmxq7.js → oauth-refresh-sweep-y9zyd7t6.js} +3 -4
- package/dist/{object-webhooks-331hay92.js → object-webhooks-mkca91s0.js} +7 -7
- package/dist/{onboard-n2w80m2n.js → onboard-ss995244.js} +11 -9
- package/dist/{opencode-adapter-z98127cz.js → opencode-adapter-mwpz0278.js} +8 -8
- package/dist/{otel-impl-xsk35tvf.js → otel-impl-6n6vva3x.js} +2 -2
- package/dist/{pending-2e6trkxd.js → pending-2sxh1t6j.js} +22 -23
- package/dist/{pi-mono-adapter-wh6yndtm.js → pi-mono-adapter-sfb7zy43.js} +13 -13
- package/dist/{pricing-refresh-9355dj1t.js → pricing-refresh-h79bg4cf.js} +2 -2
- package/dist/{rbac-roles-8eajw4s6.js → rbac-roles-ckq0czp4.js} +2 -2
- package/dist/{rbac-roles-58y3m912.js → rbac-roles-jg2e260w.js} +3 -3
- package/dist/{render-v2-7gskkmd4.js → render-v2-ymbshmn0.js} +7 -7
- package/dist/{resume-0drnmpja.js → resume-jdhnt4jk.js} +10 -10
- package/dist/{runtime-d2tcmqte.js → runtime-y28jhhnf.js} +1 -1
- package/dist/{session-access-0ztys6bd.js → session-access-k4ta5hvp.js} +5 -5
- package/dist/{session-source-backfill-cdm5s046.js → session-source-backfill-528j4s8j.js} +3 -3
- package/dist/{setup-pqwb9tcc.js → setup-d6pj82fr.js} +15 -6
- package/dist/thread-buffer-9w6x5zec.js +40 -0
- package/dist/{tree-visibility-rwz67mje.js → tree-visibility-kjxv3nxk.js} +2 -2
- package/dist/{user-merge-jobs-mxrhamwt.js → user-merge-jobs-rabbncf6.js} +3 -3
- package/dist/{virtual-modules-71y1gsmg.js → virtual-modules-22k51txd.js} +3 -3
- package/dist/{work-objects-3k4ykt9j.js → work-objects-xtjbar3r.js} +26 -30
- package/dist/{worker-follow-up-y0h64xpr.js → worker-follow-up-fg48vk6d.js} +21 -22
- package/dist/worker-g4aj93dt.js +82 -0
- package/dist/{x-d27jj7z7.js → x-vfsqypht.js} +2 -2
- package/openapi.json +247 -20
- package/package.json +10 -10
- package/src/apps/definition.ts +76 -24
- package/src/apps/row-store.ts +67 -0
- package/src/apps/script-types.ts +131 -21
- package/src/apps/store.ts +4 -1
- package/src/be/db/script-runs.ts +33 -0
- package/src/be/db/slack-card-groups.ts +147 -0
- package/src/be/db/slack-trees.ts +26 -0
- package/src/be/db/task-idempotency.ts +63 -0
- package/src/be/db/tasks/read.ts +2 -0
- package/src/be/db/tasks/write.ts +4 -2
- package/src/be/db/workflow-idempotency.ts +6 -1
- package/src/be/db/workflows/read.ts +79 -0
- package/src/be/db.ts +51 -147
- package/src/be/improvements.ts +24 -2
- package/src/be/mcp-proxy.ts +45 -11
- package/src/be/memory/embedding-space.ts +10 -20
- package/src/be/memory/index.ts +35 -0
- package/src/be/memory/providers/openai-embedding.ts +10 -0
- package/src/be/migrations/348_task_deferred_until.sql +4 -0
- package/src/be/migrations/354_durable_objects.sql +9 -0
- package/src/be/migrations/356_slack_outcome_card_groups.sql +14 -0
- package/src/be/migrations/357_task_idempotency_keys.sql +27 -0
- package/src/be/migrations/362_favorites_app.sql +36 -0
- package/src/be/repo-checked-update.ts +58 -5
- package/src/be/requester-timezone.ts +10 -0
- package/src/be/script-connections.ts +5 -1
- package/src/be/script-credential-broker.ts +29 -2
- package/src/be/scripts/durable.ts +204 -0
- package/src/be/scripts/extract-schema.ts +29 -4
- package/src/be/scripts/run-credential.ts +1 -8
- package/src/be/scripts/typecheck.ts +32 -7
- package/src/be/seed-scripts/catalog/memory-eval.ts +11 -2
- package/src/be/seed-scripts/catalog/tool-usage.ts +27 -8
- package/src/be/swarm-config-guard.ts +87 -7
- package/src/be/users.ts +33 -12
- package/src/comb/review-batch.ts +16 -5
- package/src/commands/context-preamble.ts +237 -0
- package/src/commands/e2b.ts +14 -0
- package/src/commands/entrypoint-mcp-config.ts +231 -0
- package/src/commands/onboard/agent-fs-version.ts +1 -1
- package/src/commands/onboard/compose-generator.ts +2 -1
- package/src/commands/onboard/env-generator.ts +16 -7
- package/src/commands/runner.ts +23 -7
- package/src/commands/setup.tsx +17 -3
- package/src/extensions/contract-types.generated.ts +1 -1
- package/src/hooks/hook.ts +8 -2
- package/src/hooks/native-tool-hooks.ts +4 -2
- package/src/http/apps.ts +82 -42
- package/src/http/comb.ts +21 -5
- package/src/http/config.ts +8 -4
- package/src/http/heartbeat.ts +5 -0
- package/src/http/index.ts +12 -6
- package/src/http/kv.ts +7 -5
- package/src/http/mcp-oauth.ts +16 -0
- package/src/http/mcp-servers.ts +43 -3
- package/src/http/memory.ts +28 -1
- package/src/http/metrics.ts +11 -4
- package/src/http/onboarding.ts +12 -1
- package/src/http/repos.ts +27 -11
- package/src/http/request-principal.ts +27 -1
- package/src/http/schedules.ts +36 -8
- package/src/http/script-connection-proxy.ts +3 -1
- package/src/http/script-runs.ts +21 -10
- package/src/http/scripts.ts +177 -26
- package/src/http/session-cost-recompute.ts +9 -4
- package/src/http/skills.ts +70 -0
- package/src/http/status.ts +2 -0
- package/src/http/tasks.ts +92 -14
- package/src/http/trackers/jira.ts +18 -3
- package/src/http/trackers/linear.ts +3 -0
- package/src/kv-limits.ts +2 -0
- package/src/kv-reserved-namespaces.ts +25 -2
- package/src/prompts/session-templates.ts +49 -0
- package/src/prompts/session-turns.ts +30 -0
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/claude-managed-adapter.ts +14 -0
- package/src/providers/claude-sdk-session.ts +14 -1
- package/src/providers/cursor-adapter.ts +1 -1
- package/src/providers/dsh-adapter.ts +1 -1
- package/src/providers/opencode-adapter.ts +3 -5
- package/src/providers/runtime-dependencies.ts +11 -8
- package/src/rbac/legacy-policy.ts +7 -0
- package/src/rbac/permissions.ts +27 -0
- package/src/scheduler/scheduler.ts +36 -18
- package/src/script-workflows/executor.ts +37 -8
- package/src/script-workflows/supervisor.ts +14 -0
- package/src/scripts-runtime/ctx.ts +5 -1
- package/src/scripts-runtime/durable-object-base.ts +19 -0
- package/src/scripts-runtime/eval-harness.ts +46 -1
- package/src/scripts-runtime/executors/native.ts +13 -1
- package/src/scripts-runtime/executors/quickjs-bundle.ts +20 -1
- package/src/scripts-runtime/executors/quickjs-prelude.ts +40 -1
- package/src/scripts-runtime/executors/quickjs-runner.ts +26 -3
- package/src/scripts-runtime/executors/quickjs-worker.ts +2 -1
- package/src/scripts-runtime/executors/types.ts +26 -0
- package/src/scripts-runtime/extract-signature.ts +96 -1
- package/src/scripts-runtime/loader.ts +11 -5
- package/src/scripts-runtime/mcp-client.ts +1 -1
- package/src/scripts-runtime/sdk-allowlist.ts +1 -0
- package/src/scripts-runtime/swarm-config.ts +7 -0
- package/src/scripts-runtime/swarm-sdk.ts +4 -1
- package/src/scripts-runtime/types/stdlib.d.ts +19 -0
- package/src/scripts-runtime/types/swarm-extension.d.ts +1 -0
- package/src/scripts-runtime/types/swarm-sdk.d.ts +19 -0
- package/src/slack/actions.ts +24 -0
- package/src/slack/assistant.ts +8 -0
- package/src/slack/blocks.ts +35 -0
- package/src/slack/channel-activity.ts +7 -0
- package/src/slack/enrich.ts +46 -54
- package/src/slack/files.ts +173 -23
- package/src/slack/handlers.test.ts +17 -19
- package/src/slack/handlers.ts +15 -14
- package/src/slack/render-v2.ts +264 -19
- package/src/slack/responses.ts +61 -5
- package/src/slack/session-mirror.ts +10 -5
- package/src/slack/task-output.ts +25 -14
- package/src/slack/templates.ts +9 -0
- package/src/slack/thread-participants.ts +64 -24
- package/src/slack/watcher.ts +4 -4
- package/src/slack/work-objects.ts +1 -1
- package/src/stdio.ts +5 -0
- package/src/tests/agents-list-model-display.test.ts +4 -0
- package/src/tests/apps-script-types.test.ts +63 -16
- package/src/tests/apps-sort-order.test.ts +87 -0
- package/src/tests/bedrock-model-groups.test.ts +4 -0
- package/src/tests/channel-activity.test.ts +9 -0
- package/src/tests/chatgpt-subscription-model-groups.test.ts +4 -0
- package/src/tests/claude-hook-output.test.ts +2 -0
- package/src/tests/claude-managed-adapter.test.ts +15 -3
- package/src/tests/claude-sdk-stderr.test.ts +28 -0
- package/src/tests/codex-gpt6-release.test.ts +4 -0
- package/src/tests/comb-review-batch.test.ts +17 -4
- package/src/tests/comb-status.test.ts +1 -0
- package/src/tests/db-client.test.ts +11 -5
- package/src/tests/db-task-read-contract.test.ts +1 -0
- package/src/tests/db-task-write-contract.test.ts +2 -2
- package/src/tests/defer-task.test.ts +23 -1
- package/src/tests/dsh-adapter.test.ts +1 -1
- package/src/tests/e2b-dispatch.test.ts +13 -1
- package/src/tests/entrypoint-mcp-config.test.ts +642 -0
- package/src/tests/fixtures/onboard/content.env.txt +2 -2
- package/src/tests/fixtures/onboard/dev.env.txt +2 -2
- package/src/tests/fixtures/onboard/full-all.env.txt +2 -2
- package/src/tests/fixtures/onboard/full.env.txt +2 -2
- package/src/tests/fixtures/onboard/research.env.txt +2 -2
- package/src/tests/fixtures/onboard/solo.env.txt +2 -2
- package/src/tests/fixtures/runner-missing-dependency.ts +2 -1
- package/src/tests/fx-adapter.test.ts +4 -5
- package/src/tests/hook-mcp-config-precedence.test.ts +59 -0
- package/src/tests/hook-ping-me-order.test.ts +1 -0
- package/src/tests/hook-runtime-close.test.ts +1 -0
- package/src/tests/improvements-payload.test.ts +2 -2
- package/src/tests/model-groups-live-catalog.test.ts +4 -0
- package/src/tests/oauth-credential-bindings.test.ts +8 -3
- package/src/tests/oauth-refresh-failure.test.ts +15 -3
- package/src/tests/onboard-env.test.ts +1 -1
- package/src/tests/openai-compatible-providers.test.ts +5 -0
- package/src/tests/openapi-route-headers.test.ts +2 -1
- package/src/tests/opus-5-5-registry.test.ts +4 -0
- package/src/tests/provider-runtime-dependencies.test.ts +26 -15
- package/src/tests/routing-affinity-inventory.test.ts +11 -0
- package/src/tests/runner-context-preamble.test.ts +202 -0
- package/src/tests/runner-repo-clone-args.test.ts +116 -0
- package/src/tests/scheduler-occurrence.test.ts +60 -9
- package/src/tests/script-connections-mcp.test.ts +6 -3
- package/src/tests/script-connections.test.ts +4 -0
- package/src/tests/scripts-namespaces.test.ts +3 -1
- package/src/tests/secret-scrubber.test.ts +8 -2
- package/src/tests/session-cost-recompute-unit.test.ts +39 -0
- package/src/tests/session-costs-recompute-all-providers.test.ts +6 -3
- package/src/tests/session-route-posture.test.ts +7 -1
- package/src/tests/slack-file-tools-attachments.test.ts +14 -9
- package/src/tests/slack-identity-resolution.test.ts +10 -3
- package/src/tests/slack-inline-output.test.ts +10 -8
- package/src/tests/slack-render-v2.test.ts +9 -4
- package/src/tests/slack-steering.test.ts +8 -2
- package/src/tests/slack-thread-participants.test.ts +11 -1
- package/src/tests/sonnet-5-5-registry.test.ts +4 -0
- package/src/tests/swarm-config-encryption.test.ts +5 -8
- package/src/tests/ui-spec-script-actions-config.test.ts +7 -3
- package/src/tests/workflow-triggers-v2.test.ts +35 -11
- package/src/tools/app-patch.ts +6 -2
- package/src/tools/app-upsert.ts +8 -4
- package/src/tools/defer-task.ts +17 -77
- package/src/tools/kv/kv-get.ts +2 -0
- package/src/tools/kv/kv-list.ts +11 -5
- package/src/tools/kv/kv-set.ts +1 -3
- package/src/tools/repos/update-repo.ts +37 -19
- package/src/tools/schedules/run-schedule-now.ts +21 -1
- package/src/tools/script-apis.ts +9 -4
- package/src/tools/script-common.ts +2 -2
- package/src/tools/script-run.ts +8 -0
- package/src/tools/script-upsert.ts +1 -1
- package/src/tools/slack-download-file.ts +15 -12
- package/src/tools/slack-post.ts +7 -1
- package/src/tools/slack-read.ts +3 -1
- package/src/tools/slack-reply.ts +16 -0
- package/src/tools/slack-start-thread.ts +8 -1
- package/src/tools/slack-upload-file.ts +99 -96
- package/src/tools/swarm-config/set-config.ts +3 -1
- package/src/tools/swarm-x.ts +0 -2
- package/src/tools/utils.ts +3 -0
- package/src/types.ts +8 -2
- package/src/utils/constants.ts +20 -0
- package/src/utils/deferral-time.ts +61 -0
- package/src/utils/request-auth-context.ts +15 -16
- package/src/utils/secret-scrubber.ts +1 -1
- package/src/workflows/engine.ts +6 -11
- package/src/workflows/executors/swarm-script.ts +0 -2
- package/src/workflows/foreach-driver.ts +6 -12
- package/src/workflows/input.ts +24 -1
- package/src/workflows/node-timeout.ts +18 -0
- package/src/workflows/retry-poller.ts +2 -1
- package/src/workflows/triggers.ts +21 -11
- package/src/x/composio.ts +10 -1
- package/templates/skills/apps/SKILL.md +4 -2
- package/templates/skills/apps/content.md +4 -2
- package/templates/skills/code-quality/content.md +4 -4
- package/templates/skills/scheduled-task-resilience/SKILL.md +2 -0
- package/templates/skills/scheduled-task-resilience/content.md +2 -0
- package/templates/skills/swarm-docs/content.md +7 -0
- package/templates/skills/swarm-scripts/SKILL.md +44 -0
- package/templates/skills/swarm-scripts/content.md +44 -0
- package/dist/acp-adapter-tbt61zkm.js +0 -17
- package/dist/cli-b9ygp1kz.js +0 -459
- package/dist/cli-kj0hyr43.js +0 -51
- package/dist/cli-m8f4379k.js +0 -173
- package/dist/core-bwp98v4w.js +0 -42
- package/dist/dsh-adapter-43ygwqn7.js +0 -9
- package/dist/fx-adapter-cr2hq17y.js +0 -20
- package/dist/grok-adapter-ayddnbsc.js +0 -20
- package/dist/handlers-7ghs84x2.js +0 -41
- package/dist/index-dtt0d634.js +0 -44
- package/dist/index-hmszyqkk.js +0 -42
- package/dist/index-j6rm1rtn.js +0 -39
- package/dist/index-rwwhsmjg.js +0 -13
- package/dist/lead-g2j4q39z.js +0 -83
- package/dist/thread-buffer-epx3san4.js +0 -42
- package/dist/worker-09gqn9xy.js +0 -83
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
ampPinCatalogError,
|
|
4
4
|
ampModelError,
|
|
5
5
|
init_amp_models
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-wvbaq052.js";
|
|
7
7
|
import {
|
|
8
8
|
ALL_TOOLS,
|
|
9
9
|
init_tool_config
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
applyProviderQuotaReport,
|
|
15
15
|
scrubProviderQuotaReport,
|
|
16
16
|
init_provider_account_telemetry
|
|
17
|
-
} from "./cli-
|
|
17
|
+
} from "./cli-cg1q8ymp.js";
|
|
18
18
|
import {
|
|
19
19
|
CODEX_AUTH_FAILURE_BENCH_THRESHOLD,
|
|
20
20
|
CODEX_AUTH_FAILURE_BENCH_MS,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
init_identity_field_budget,
|
|
43
43
|
contentSha256,
|
|
44
44
|
init_profile_sync
|
|
45
|
-
} from "./cli-
|
|
45
|
+
} from "./cli-wym6rxgt.js";
|
|
46
46
|
import {
|
|
47
47
|
isSlackConfigured,
|
|
48
48
|
init_config5
|
|
@@ -74,7 +74,7 @@ import {
|
|
|
74
74
|
splitCredentialPool,
|
|
75
75
|
selectCredential,
|
|
76
76
|
init_credentials2
|
|
77
|
-
} from "./cli-
|
|
77
|
+
} from "./cli-wd7b5hgc.js";
|
|
78
78
|
import {
|
|
79
79
|
registerTemplate,
|
|
80
80
|
getAllTemplateDefinitions,
|
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
configureDbResolver,
|
|
83
83
|
init_resolver,
|
|
84
84
|
init_session_templates
|
|
85
|
-
} from "./cli-
|
|
85
|
+
} from "./cli-24wervhz.js";
|
|
86
86
|
import {
|
|
87
87
|
getOpenRouterAttributionHeaders,
|
|
88
88
|
init_openrouter_base_url
|
|
@@ -127,12 +127,12 @@ import {
|
|
|
127
127
|
SUPERSEDED_WORKFLOW_TASK_REASON,
|
|
128
128
|
PageThemeTokensSchema,
|
|
129
129
|
init_types5
|
|
130
|
-
} from "./cli-
|
|
130
|
+
} from "./cli-tc165vrb.js";
|
|
131
131
|
import {
|
|
132
132
|
setRuntimeModelCatalog,
|
|
133
133
|
runtimeHarnessSections,
|
|
134
134
|
init_runtime_model_catalog
|
|
135
|
-
} from "./cli-
|
|
135
|
+
} from "./cli-7ca8hczj.js";
|
|
136
136
|
import {
|
|
137
137
|
init_zod
|
|
138
138
|
} from "./cli-96234j5w.js";
|
|
@@ -160,9 +160,10 @@ import {
|
|
|
160
160
|
import {
|
|
161
161
|
init_package,
|
|
162
162
|
package_default
|
|
163
|
-
} from "./cli-
|
|
163
|
+
} from "./cli-shyhb4t5.js";
|
|
164
164
|
import {
|
|
165
165
|
getNodeEnv,
|
|
166
|
+
isDevOrTestNodeEnv,
|
|
166
167
|
init_node_env
|
|
167
168
|
} from "./cli-rgeadyvq.js";
|
|
168
169
|
import {
|
|
@@ -191,7 +192,7 @@ import {
|
|
|
191
192
|
registerVolatileSecret,
|
|
192
193
|
registerSensitiveKeyName,
|
|
193
194
|
init_secret_scrubber
|
|
194
|
-
} from "./cli-
|
|
195
|
+
} from "./cli-r9d2tya0.js";
|
|
195
196
|
import {
|
|
196
197
|
__toCommonJS,
|
|
197
198
|
__commonJS,
|
|
@@ -5317,9 +5318,8 @@ function getCurrentRunProvenance() {
|
|
|
5317
5318
|
const auth = getCurrentRequestAuth();
|
|
5318
5319
|
if (auth?.kind !== "agent")
|
|
5319
5320
|
return null;
|
|
5320
|
-
const sourceStepId = auth
|
|
5321
|
-
|
|
5322
|
-
return sourceStepId || sourceScriptRunId ? { sourceStepId, sourceScriptRunId } : null;
|
|
5321
|
+
const { sourceStepId, sourceScriptRunId, objectChain, depth } = auth;
|
|
5322
|
+
return sourceStepId || sourceScriptRunId || objectChain !== undefined || depth ? { sourceStepId, sourceScriptRunId, objectChain, depth } : null;
|
|
5323
5323
|
}
|
|
5324
5324
|
var requestAuth, authStorage;
|
|
5325
5325
|
var init_request_auth_context = __esm(() => {
|
|
@@ -5751,7 +5751,7 @@ var init_telemetry = __esm(() => {
|
|
|
5751
5751
|
// src/telemetry-identity.ts
|
|
5752
5752
|
async function loadUserRole(userId) {
|
|
5753
5753
|
try {
|
|
5754
|
-
const { getUserGrant } = await import("./rbac-roles-
|
|
5754
|
+
const { getUserGrant } = await import("./rbac-roles-jg2e260w.js");
|
|
5755
5755
|
const grant = await getUserGrant(userId);
|
|
5756
5756
|
const role = grant.grantsAll ? "admin" : "member";
|
|
5757
5757
|
const user = await getDbClient2().get("SELECT json_extract(metadata, '$.jobFunction') AS jobFunction FROM users WHERE id = ? AND json_valid(metadata)", [userId]);
|
|
@@ -6639,7 +6639,7 @@ function scheduleApprovalCardUpdates(approvals) {
|
|
|
6639
6639
|
const posted = approvals.filter((approval) => approval.notificationChannels?.some((n) => n.channel === "slack" && n.messageTs));
|
|
6640
6640
|
if (posted.length === 0)
|
|
6641
6641
|
return;
|
|
6642
|
-
getDbClient2().afterCommit(() => import("./approval-notifications-
|
|
6642
|
+
getDbClient2().afterCommit(() => import("./approval-notifications-7qgkzkzx.js").then(({ updateResolvedApprovalCards }) => updateResolvedApprovalCards(posted)).catch((err) => console.error("[HITL] Slack card update not run:", scrubSecrets(err instanceof Error ? err.message : String(err)))));
|
|
6643
6643
|
}
|
|
6644
6644
|
var init_approvals = __esm(() => {
|
|
6645
6645
|
init_secret_scrubber();
|
|
@@ -6966,8 +6966,12 @@ var init_legacy_policy = __esm(() => {
|
|
|
6966
6966
|
"memory.write.consolidated": leadOnly,
|
|
6967
6967
|
"memory.read.any": leadOrOperatorOrUser,
|
|
6968
6968
|
"memory.delete.any": memoryDelete,
|
|
6969
|
+
"memory.reembed": leadOrOperatorOrUser,
|
|
6969
6970
|
"channel.delete": leadOnly,
|
|
6970
6971
|
"repo.merge-policy.write": leadOrOperatorOrUser,
|
|
6972
|
+
"repo.exec-config.write": leadOrOperatorOrUser,
|
|
6973
|
+
"repo.delete": leadOrOperatorOrUser,
|
|
6974
|
+
"heartbeat.trigger": leadOrOperatorOrUser,
|
|
6971
6975
|
"integration.kapso.manage": leadOnly,
|
|
6972
6976
|
"integration.chat.manage": leadOnly,
|
|
6973
6977
|
"integration.chat.post": leadOnly,
|
|
@@ -7009,6 +7013,7 @@ var init_legacy_policy = __esm(() => {
|
|
|
7009
7013
|
"mcp-server.stdio.write": leadOrOperatorOrUser,
|
|
7010
7014
|
"mcp-server.read.secrets": leadOnly,
|
|
7011
7015
|
"mcp-oauth.authorize.any": anyAuthenticated,
|
|
7016
|
+
"mcp-oauth.manage": leadOrOperatorOrUser,
|
|
7012
7017
|
"kv.write.any": leadOrOwnNamespace,
|
|
7013
7018
|
"comb.presence": operatorOrUser,
|
|
7014
7019
|
"fs.join.own": anyAuthenticated,
|
|
@@ -7030,6 +7035,7 @@ var init_legacy_policy = __esm(() => {
|
|
|
7030
7035
|
"script.api.delete": leadOnly,
|
|
7031
7036
|
"schedule.deferral.update.any": leadOrResourceOwner,
|
|
7032
7037
|
"schedule.target.update.any": leadOrResourceOwner,
|
|
7038
|
+
"schedule.run.any": leadOrResourceOwner,
|
|
7033
7039
|
"runtime_pool.write": operatorOrUser,
|
|
7034
7040
|
"runtime_pool.bind": leadOrOperatorOrUser,
|
|
7035
7041
|
"runtime_controller.write": operatorOrUser,
|
|
@@ -7197,6 +7203,10 @@ var init_permissions = __esm(() => {
|
|
|
7197
7203
|
description: "List every agent's memories, beyond the caller's own and swarm-scoped entries (lead, operator, or user).",
|
|
7198
7204
|
namespace: "memory"
|
|
7199
7205
|
},
|
|
7206
|
+
"memory.reembed": {
|
|
7207
|
+
description: "Start a background re-embed of stored memories (lead, operator, or user), all agents' or one agent's.",
|
|
7208
|
+
namespace: "memory"
|
|
7209
|
+
},
|
|
7200
7210
|
"memory.delete.any": {
|
|
7201
7211
|
description: "Delete a memory entry: own agent-scoped entries; swarm-scoped entries as lead, operator, or user; any entry as operator or user.",
|
|
7202
7212
|
namespace: "memory"
|
|
@@ -7209,6 +7219,18 @@ var init_permissions = __esm(() => {
|
|
|
7209
7219
|
description: "Change a repo's merge policy (the allowMerge guideline or the mergePolicy record), which tells agents whether they may merge a PR themselves and which PRs the swarm may auto-merge.",
|
|
7210
7220
|
namespace: "repo"
|
|
7211
7221
|
},
|
|
7222
|
+
"repo.exec-config.write": {
|
|
7223
|
+
description: "Change a repo's url, clonePath or hooks, or create a repo with hooks enabled. Workers clone the url into clonePath and run the hook install there.",
|
|
7224
|
+
namespace: "repo"
|
|
7225
|
+
},
|
|
7226
|
+
"repo.delete": {
|
|
7227
|
+
description: "Delete a repo record and the guidelines and merge policy it holds.",
|
|
7228
|
+
namespace: "repo"
|
|
7229
|
+
},
|
|
7230
|
+
"heartbeat.trigger": {
|
|
7231
|
+
description: "Run the heartbeat sweep or the heartbeat checklist check on demand.",
|
|
7232
|
+
namespace: "heartbeat"
|
|
7233
|
+
},
|
|
7212
7234
|
"integration.kapso.manage": {
|
|
7213
7235
|
description: "Register or unregister a Kapso inbound number.",
|
|
7214
7236
|
namespace: "integration"
|
|
@@ -7373,6 +7395,10 @@ var init_permissions = __esm(() => {
|
|
|
7373
7395
|
description: "Start an MCP-server OAuth authorize flow for a caller-supplied user scope.",
|
|
7374
7396
|
namespace: "mcp-oauth"
|
|
7375
7397
|
},
|
|
7398
|
+
"mcp-oauth.manage": {
|
|
7399
|
+
description: "Refresh or revoke an MCP server's OAuth token, or register its OAuth client by hand.",
|
|
7400
|
+
namespace: "mcp-oauth"
|
|
7401
|
+
},
|
|
7376
7402
|
"kv.write.any": {
|
|
7377
7403
|
description: "Write another agent's task:agent: KV namespace, or a lead-only family (usecase:*).",
|
|
7378
7404
|
namespace: "kv"
|
|
@@ -7457,6 +7483,10 @@ var init_permissions = __esm(() => {
|
|
|
7457
7483
|
description: "Change what a schedule the caller did not create runs (its target, task template, workflow, script, script args or params).",
|
|
7458
7484
|
namespace: "schedule"
|
|
7459
7485
|
},
|
|
7486
|
+
"schedule.run.any": {
|
|
7487
|
+
description: "Run a schedule the caller did not create now, as its creator.",
|
|
7488
|
+
namespace: "schedule"
|
|
7489
|
+
},
|
|
7460
7490
|
"runtime_pool.write": {
|
|
7461
7491
|
description: "Create, update, or delete runtime pools (image, provider kind, placement).",
|
|
7462
7492
|
namespace: "runtime_pool"
|
|
@@ -9606,6 +9636,7 @@ function rowToAgentTask(row) {
|
|
|
9606
9636
|
progress: row.progress ?? undefined,
|
|
9607
9637
|
wasPaused: !!row.was_paused,
|
|
9608
9638
|
deferredAt: row.deferredAt ?? undefined,
|
|
9639
|
+
deferredUntil: row.deferredUntil ?? undefined,
|
|
9609
9640
|
credentialKeySuffix: row.credentialKeySuffix ?? undefined,
|
|
9610
9641
|
credentialKeyType: row.credentialKeyType ?? undefined,
|
|
9611
9642
|
requestedByUserId: row.requestedByUserId ?? undefined,
|
|
@@ -11787,6 +11818,17 @@ async function slackThreadHasBotReplySince(channelId, threadTs, since, taskId) {
|
|
|
11787
11818
|
) AS found`, [channelId, threadTs, since, taskId]);
|
|
11788
11819
|
return !!row?.found;
|
|
11789
11820
|
}
|
|
11821
|
+
async function slackThreadHasAgentReplyOnTasksSince(channelId, threadTs, since, agentId, taskIds) {
|
|
11822
|
+
if (taskIds.length === 0)
|
|
11823
|
+
return false;
|
|
11824
|
+
const row = await getDbClient2().get(`SELECT EXISTS (
|
|
11825
|
+
SELECT 1 FROM slack_messages reply
|
|
11826
|
+
WHERE reply.channel_id = ? AND reply.thread_ts = ? AND reply.created_at >= ?
|
|
11827
|
+
AND reply.kind = 'agent' AND reply.created_by = ?
|
|
11828
|
+
AND reply.task_id IN (${taskIds.map(() => "?").join(", ")})
|
|
11829
|
+
) AS found`, [channelId, threadTs, since, agentId, ...taskIds]);
|
|
11830
|
+
return !!row?.found;
|
|
11831
|
+
}
|
|
11790
11832
|
function slackOutcomeWindowParams(window2) {
|
|
11791
11833
|
return [window2.finishedAfter, Number(window2.delegationEnabled), window2.closureActiveAfter];
|
|
11792
11834
|
}
|
|
@@ -12509,7 +12551,7 @@ async function completeTask2(id, output, options) {
|
|
|
12509
12551
|
}
|
|
12510
12552
|
}
|
|
12511
12553
|
if (completed && options?.deferredAt) {
|
|
12512
|
-
completed = await getDbClient2().get("UPDATE agent_tasks SET deferredAt = ?, lastUpdatedAt = strftime('%Y-%m-%dT%H:%M:%fZ', 'now') WHERE id = ? RETURNING *", [options.deferredAt, id]);
|
|
12554
|
+
completed = await getDbClient2().get("UPDATE agent_tasks SET deferredAt = ?, deferredUntil = ?, lastUpdatedAt = strftime('%Y-%m-%dT%H:%M:%fZ', 'now') WHERE id = ? RETURNING *", [options.deferredAt, options.deferredUntil ?? null, id]);
|
|
12513
12555
|
}
|
|
12514
12556
|
if (completed) {
|
|
12515
12557
|
await dependencies3.reconcileTaskPullRequestAttachments(id, completed.agentId, [
|
|
@@ -12539,7 +12581,7 @@ async function completeTask2(id, output, options) {
|
|
|
12539
12581
|
});
|
|
12540
12582
|
} catch {}
|
|
12541
12583
|
getDbClient2().afterCommit(() => {
|
|
12542
|
-
import("./event-bus-
|
|
12584
|
+
import("./event-bus-tvf2grf4.js").then(({ workflowEventBus }) => {
|
|
12543
12585
|
workflowEventBus.emit("task.completed", {
|
|
12544
12586
|
taskId: id,
|
|
12545
12587
|
previousStatus: oldTask.status,
|
|
@@ -12596,7 +12638,7 @@ async function failTask2(id, reason, opts = {}) {
|
|
|
12596
12638
|
});
|
|
12597
12639
|
} catch {}
|
|
12598
12640
|
getDbClient2().afterCommit(() => {
|
|
12599
|
-
import("./event-bus-
|
|
12641
|
+
import("./event-bus-tvf2grf4.js").then(({ workflowEventBus }) => {
|
|
12600
12642
|
workflowEventBus.emit("task.failed", {
|
|
12601
12643
|
taskId: id,
|
|
12602
12644
|
previousStatus: oldTask.status,
|
|
@@ -12679,7 +12721,7 @@ async function cancelTask2(id, reason, options = {}) {
|
|
|
12679
12721
|
});
|
|
12680
12722
|
} catch {}
|
|
12681
12723
|
getDbClient2().afterCommit(() => {
|
|
12682
|
-
import("./event-bus-
|
|
12724
|
+
import("./event-bus-tvf2grf4.js").then(({ workflowEventBus }) => {
|
|
12683
12725
|
workflowEventBus.emit("task.cancelled", {
|
|
12684
12726
|
taskId: id,
|
|
12685
12727
|
previousStatus: oldTask.status,
|
|
@@ -12692,7 +12734,7 @@ async function cancelTask2(id, reason, options = {}) {
|
|
|
12692
12734
|
if (row.source === "schedule" && row.taskType === "deferred" && row.parentTaskId) {
|
|
12693
12735
|
getDbClient2().afterCommit(async () => {
|
|
12694
12736
|
try {
|
|
12695
|
-
const { createWorkerTaskFollowUp } = await import("./worker-follow-up-
|
|
12737
|
+
const { createWorkerTaskFollowUp } = await import("./worker-follow-up-fg48vk6d.js");
|
|
12696
12738
|
await createWorkerTaskFollowUp({
|
|
12697
12739
|
task: rowToAgentTask(row),
|
|
12698
12740
|
status: "failed",
|
|
@@ -12741,7 +12783,7 @@ async function skipTask2(id, reason, opts = {}) {
|
|
|
12741
12783
|
});
|
|
12742
12784
|
} catch {}
|
|
12743
12785
|
getDbClient2().afterCommit(() => {
|
|
12744
|
-
import("./event-bus-
|
|
12786
|
+
import("./event-bus-tvf2grf4.js").then(({ workflowEventBus }) => {
|
|
12745
12787
|
workflowEventBus.emit("task.skipped", {
|
|
12746
12788
|
taskId: id,
|
|
12747
12789
|
failureReason: skipReason,
|
|
@@ -12800,7 +12842,7 @@ async function supersedeTask2(id, args) {
|
|
|
12800
12842
|
});
|
|
12801
12843
|
} catch {}
|
|
12802
12844
|
getDbClient2().afterCommit(() => {
|
|
12803
|
-
import("./event-bus-
|
|
12845
|
+
import("./event-bus-tvf2grf4.js").then(({ workflowEventBus }) => {
|
|
12804
12846
|
workflowEventBus.emit("task.superseded", {
|
|
12805
12847
|
taskId: id,
|
|
12806
12848
|
reason: args.reason,
|
|
@@ -13036,7 +13078,7 @@ async function updateTaskProgress2(id, progress) {
|
|
|
13036
13078
|
});
|
|
13037
13079
|
} catch {}
|
|
13038
13080
|
getDbClient2().afterCommit(() => {
|
|
13039
|
-
import("./event-bus-
|
|
13081
|
+
import("./event-bus-tvf2grf4.js").then(({ workflowEventBus }) => {
|
|
13040
13082
|
workflowEventBus.emit("task.progress", {
|
|
13041
13083
|
taskId: id,
|
|
13042
13084
|
progress: scrubbedProgress,
|
|
@@ -13135,6 +13177,9 @@ function sortKeys(value) {
|
|
|
13135
13177
|
return Object.fromEntries(Object.entries(value).filter(([, nested]) => nested !== undefined).sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0).map(([key, nested]) => [key, sortKeys(nested)]));
|
|
13136
13178
|
}
|
|
13137
13179
|
function workflowRequestFingerprint(operation, body) {
|
|
13180
|
+
return requestFingerprint(operation, body);
|
|
13181
|
+
}
|
|
13182
|
+
function requestFingerprint(operation, body) {
|
|
13138
13183
|
return sha256(`${operation}
|
|
13139
13184
|
${JSON.stringify(sortKeys(body ?? null))}`);
|
|
13140
13185
|
}
|
|
@@ -13620,7 +13665,7 @@ function emitRunFinished(runId, workflowId, status) {
|
|
|
13620
13665
|
}
|
|
13621
13666
|
function emitBusEventAfterCommit(event, payload) {
|
|
13622
13667
|
getDbClient2().afterCommit(() => {
|
|
13623
|
-
import("./event-bus-
|
|
13668
|
+
import("./event-bus-tvf2grf4.js").then(({ workflowEventBus }) => {
|
|
13624
13669
|
workflowEventBus.emit(event, payload);
|
|
13625
13670
|
}).catch((err) => console.error(`[db] ${event} event not emitted:`, scrubSecrets(err instanceof Error ? err.message : String(err))));
|
|
13626
13671
|
});
|
|
@@ -13708,6 +13753,49 @@ var init_workflow_runs = __esm(() => {
|
|
|
13708
13753
|
};
|
|
13709
13754
|
});
|
|
13710
13755
|
|
|
13756
|
+
// src/be/db/workflows/read.ts
|
|
13757
|
+
function rowToWorkflow(row) {
|
|
13758
|
+
return {
|
|
13759
|
+
id: row.id,
|
|
13760
|
+
key: row.key,
|
|
13761
|
+
name: row.name,
|
|
13762
|
+
description: row.description ?? undefined,
|
|
13763
|
+
enabled: row.enabled === 1,
|
|
13764
|
+
definition: JSON.parse(row.definition),
|
|
13765
|
+
triggers: JSON.parse(row.triggers),
|
|
13766
|
+
cooldown: row.cooldown ? JSON.parse(row.cooldown) : undefined,
|
|
13767
|
+
input: row.input ? JSON.parse(row.input) : undefined,
|
|
13768
|
+
triggerSchema: row.triggerSchema ? JSON.parse(row.triggerSchema) : undefined,
|
|
13769
|
+
params: JSON.parse(row.params),
|
|
13770
|
+
requiredParams: JSON.parse(row.requiredParams),
|
|
13771
|
+
requires: JSON.parse(row.requires),
|
|
13772
|
+
dir: row.dir ?? undefined,
|
|
13773
|
+
vcsRepo: row.vcs_repo ?? undefined,
|
|
13774
|
+
createdByAgentId: row.createdByAgentId ?? undefined,
|
|
13775
|
+
updatedByAgentId: row.updatedByAgentId ?? undefined,
|
|
13776
|
+
createdAt: normalizeDateRequired(row.createdAt),
|
|
13777
|
+
lastUpdatedAt: normalizeDateRequired(row.lastUpdatedAt),
|
|
13778
|
+
createdBy: row.created_by ?? undefined,
|
|
13779
|
+
updatedBy: row.updated_by ?? undefined
|
|
13780
|
+
};
|
|
13781
|
+
}
|
|
13782
|
+
async function getWorkflowsByEventName2(eventName) {
|
|
13783
|
+
const rows = await getDbClient2().query(`SELECT w.* FROM workflows w
|
|
13784
|
+
WHERE w.enabled = 1
|
|
13785
|
+
AND EXISTS (
|
|
13786
|
+
SELECT 1 FROM json_each(w.triggers) AS t
|
|
13787
|
+
WHERE t.type = 'object'
|
|
13788
|
+
AND json_extract(t.value, '$.type') = 'event'
|
|
13789
|
+
AND json_extract(t.value, '$.eventName') = ?
|
|
13790
|
+
)
|
|
13791
|
+
ORDER BY w.lastUpdatedAt DESC`, [eventName]);
|
|
13792
|
+
return rows.map(rowToWorkflow);
|
|
13793
|
+
}
|
|
13794
|
+
var init_read2 = __esm(() => {
|
|
13795
|
+
init_date_utils();
|
|
13796
|
+
init_runtime2();
|
|
13797
|
+
});
|
|
13798
|
+
|
|
13711
13799
|
// src/integrations/chat-sdk/schema.ts
|
|
13712
13800
|
function forbiddenKeyIssues(value, ctx) {
|
|
13713
13801
|
for (const key of FORBIDDEN_ADAPTER_KEYS) {
|
|
@@ -14081,6 +14169,53 @@ function isApiDrainingResponse(response) {
|
|
|
14081
14169
|
var API_DRAINING_HEADER = "X-Swarm-Draining", API_DRAIN_MAX_MS_LIMIT = 120000;
|
|
14082
14170
|
var init_api_drain2 = () => {};
|
|
14083
14171
|
|
|
14172
|
+
// src/utils/deferral-time.ts
|
|
14173
|
+
function isValidTimezone(zone) {
|
|
14174
|
+
if (typeof zone !== "string" || !zone)
|
|
14175
|
+
return false;
|
|
14176
|
+
try {
|
|
14177
|
+
new Intl.DateTimeFormat("en-US", { timeZone: zone });
|
|
14178
|
+
return true;
|
|
14179
|
+
} catch {
|
|
14180
|
+
return false;
|
|
14181
|
+
}
|
|
14182
|
+
}
|
|
14183
|
+
function partsInTz(date, tz) {
|
|
14184
|
+
const fmt = new Intl.DateTimeFormat("en-US", {
|
|
14185
|
+
timeZone: tz,
|
|
14186
|
+
year: "numeric",
|
|
14187
|
+
month: "2-digit",
|
|
14188
|
+
day: "2-digit",
|
|
14189
|
+
hour: "2-digit",
|
|
14190
|
+
minute: "2-digit",
|
|
14191
|
+
timeZoneName: "short",
|
|
14192
|
+
hourCycle: "h23"
|
|
14193
|
+
});
|
|
14194
|
+
const parts = Object.fromEntries(fmt.formatToParts(date).map((p) => [p.type, p.value]));
|
|
14195
|
+
return {
|
|
14196
|
+
year: parts.year,
|
|
14197
|
+
month: parts.month,
|
|
14198
|
+
day: parts.day,
|
|
14199
|
+
hour: parts.hour,
|
|
14200
|
+
minute: parts.minute,
|
|
14201
|
+
abbreviation: parts.timeZoneName
|
|
14202
|
+
};
|
|
14203
|
+
}
|
|
14204
|
+
function formatDeferralDateTime(target, now, tz, labelZone = false) {
|
|
14205
|
+
const zone = isValidTimezone(tz) ? tz : "UTC";
|
|
14206
|
+
const t = partsInTz(target, zone);
|
|
14207
|
+
const time = `${t.hour}:${t.minute}${labelZone ? ` ${t.abbreviation}` : ""}`;
|
|
14208
|
+
const n = partsInTz(now, zone);
|
|
14209
|
+
if (t.year === n.year && t.month === n.month && t.day === n.day)
|
|
14210
|
+
return { date: "today", time };
|
|
14211
|
+
const tm = partsInTz(new Date(now.getTime() + 86400000), zone);
|
|
14212
|
+
if (t.year === tm.year && t.month === tm.month && t.day === tm.day) {
|
|
14213
|
+
return { date: "tomorrow", time };
|
|
14214
|
+
}
|
|
14215
|
+
return { date: `${t.month}-${t.day}`, time };
|
|
14216
|
+
}
|
|
14217
|
+
var init_deferral_time = () => {};
|
|
14218
|
+
|
|
14084
14219
|
// src/utils/enabled-tools.ts
|
|
14085
14220
|
function parseEnabledTools(value) {
|
|
14086
14221
|
if (value === undefined)
|
|
@@ -14145,6 +14280,14 @@ var init_task_tool_manifest = __esm(() => {
|
|
|
14145
14280
|
function teamsSdkEnvKeysSql() {
|
|
14146
14281
|
return TEAMS_SDK_ENV_KEYS.map((key) => `'${key}'`).join(", ");
|
|
14147
14282
|
}
|
|
14283
|
+
function isApiProcessControlEnvKey(key) {
|
|
14284
|
+
const name = key.toUpperCase();
|
|
14285
|
+
return API_PROCESS_CONTROL_ENV_KEYS.has(name) || API_PROCESS_CONTROL_ENV_PREFIXES.some((prefix) => name.startsWith(prefix));
|
|
14286
|
+
}
|
|
14287
|
+
function invalidConfigKeyError(key) {
|
|
14288
|
+
return ["=", "\x00", "\r", `
|
|
14289
|
+
`].some((char) => key.includes(char)) ? `Invalid config key '${JSON.stringify(key).slice(1, -1)}' (must not contain '=', NUL, CR or LF)` : null;
|
|
14290
|
+
}
|
|
14148
14291
|
function isApiOnlyConfigKey(key) {
|
|
14149
14292
|
return API_ONLY_CONFIG_KEYS.has(key);
|
|
14150
14293
|
}
|
|
@@ -14160,7 +14303,7 @@ function isHumanOnlyConfigKey(key) {
|
|
|
14160
14303
|
return HUMAN_ONLY_CONFIG_KEYS.has(key.toUpperCase());
|
|
14161
14304
|
}
|
|
14162
14305
|
function humanOnlyConfigKeyError(key) {
|
|
14163
|
-
return `
|
|
14306
|
+
return `Changing key '${key}' requires a user token or dashboard user session. With RBAC enabled, the user must be an admin. Agents and the shared API key cannot change it.`;
|
|
14164
14307
|
}
|
|
14165
14308
|
function humanOnlyConfigKeyPageError(key) {
|
|
14166
14309
|
return `Key '${key}' cannot be changed from a page session. Change it from the dashboard or with a user token.`;
|
|
@@ -14283,6 +14426,16 @@ function validateDockerPidsLimit(value) {
|
|
|
14283
14426
|
const limit = value.trim();
|
|
14284
14427
|
return !limit || /^[1-9]\d*$/.test(limit) && Number.isSafeInteger(Number(limit)) ? null : "Invalid DOCKER_PIDS_LIMIT (must be a positive integer, or empty)";
|
|
14285
14428
|
}
|
|
14429
|
+
function validateWorkflowInputEnvAllowlist(value) {
|
|
14430
|
+
if (typeof value !== "string")
|
|
14431
|
+
return "WORKFLOW_INPUT_ENV_ALLOWLIST must be a string";
|
|
14432
|
+
for (const name of value.split(",").map((part) => part.trim())) {
|
|
14433
|
+
if (name !== "" && !/^[A-Za-z_][A-Za-z0-9_]*$/.test(name)) {
|
|
14434
|
+
return `WORKFLOW_INPUT_ENV_ALLOWLIST: "${name}" is not an env var name (use comma-separated NAME values)`;
|
|
14435
|
+
}
|
|
14436
|
+
}
|
|
14437
|
+
return null;
|
|
14438
|
+
}
|
|
14286
14439
|
function validateConfigValue(key, value) {
|
|
14287
14440
|
if (isTierConfigKey(key))
|
|
14288
14441
|
return validateTierConfigValue(key.toUpperCase(), value);
|
|
@@ -14295,6 +14448,9 @@ function validateConfigEntry(entry) {
|
|
|
14295
14448
|
if ((entry.scope === "agent" || entry.scope === "repo") && !entry.scopeId) {
|
|
14296
14449
|
return "Agent/repo scope requires scopeId";
|
|
14297
14450
|
}
|
|
14451
|
+
const keyError = invalidConfigKeyError(entry.key);
|
|
14452
|
+
if (keyError)
|
|
14453
|
+
return keyError;
|
|
14298
14454
|
if (isReservedConfigKey(entry.key))
|
|
14299
14455
|
return reservedKeyError(entry.key).message;
|
|
14300
14456
|
if (isInternalConfigKey(entry.key))
|
|
@@ -14304,7 +14460,7 @@ function validateConfigEntry(entry) {
|
|
|
14304
14460
|
function validateExportToEnv(key, exportToEnv) {
|
|
14305
14461
|
return exportToEnv === true && isEnvExportRestrictedKey(key) ? envExportRestrictedError(key) : null;
|
|
14306
14462
|
}
|
|
14307
|
-
var TEAMS_SDK_ENV_KEYS, RESERVED_KEYS, API_ONLY_CONFIG_KEYS, INTERNAL_CONFIG_KEYS, HUMAN_ONLY_CONFIG_KEYS, BOOLEAN_LITERALS, MAX_DB_RETENTION_DAYS = 1e6, DB_RETENTION_TUNING_BOUNDS, APPS_JSON_COLUMN_MAX_BYTES_BOUNDS, CODEX_OAUTH_KEEP_WARM_MAX_AGE_HOURS_BOUNDS, SCHEDULER_INTERVAL_MS_BOUNDS, SYSTEM_ONE_DEFAULT_PROVIDER_OPTIONS, SYSTEM_ONE_EXTRACT_DEFAULT_PROVIDER_OPTIONS, validateControllerTokenTtlDays, validateControllerGraceSec, VALIDATED_KEYS;
|
|
14463
|
+
var TEAMS_SDK_ENV_KEYS, RESERVED_KEYS, API_PROCESS_CONTROL_ENV_KEYS, API_PROCESS_CONTROL_ENV_PREFIXES, API_ONLY_CONFIG_KEYS, INTERNAL_CONFIG_KEYS, HUMAN_ONLY_CONFIG_KEYS, BOOLEAN_LITERALS, MAX_DB_RETENTION_DAYS = 1e6, DB_RETENTION_TUNING_BOUNDS, APPS_JSON_COLUMN_MAX_BYTES_BOUNDS, APPS_DEFINITION_LIMIT_BOUNDS, CODEX_OAUTH_KEEP_WARM_MAX_AGE_HOURS_BOUNDS, SCHEDULER_INTERVAL_MS_BOUNDS, SYSTEM_ONE_DEFAULT_PROVIDER_OPTIONS, SYSTEM_ONE_EXTRACT_DEFAULT_PROVIDER_OPTIONS, validateControllerTokenTtlDays, validateControllerGraceSec, VALIDATED_KEYS;
|
|
14308
14464
|
var init_swarm_config_guard = __esm(() => {
|
|
14309
14465
|
init_schema();
|
|
14310
14466
|
init_telemetry_ranking();
|
|
@@ -14315,6 +14471,7 @@ var init_swarm_config_guard = __esm(() => {
|
|
|
14315
14471
|
init_api_drain2();
|
|
14316
14472
|
init_company_profile();
|
|
14317
14473
|
init_config_env_export();
|
|
14474
|
+
init_deferral_time();
|
|
14318
14475
|
init_egress_guard();
|
|
14319
14476
|
init_enabled_tools();
|
|
14320
14477
|
init_follow_up_gate_schedule_ids();
|
|
@@ -14343,8 +14500,23 @@ var init_swarm_config_guard = __esm(() => {
|
|
|
14343
14500
|
"GITHUB_URL",
|
|
14344
14501
|
"GITHUB_API_URL",
|
|
14345
14502
|
"GITHUB_APP_INSTALLATION_ID",
|
|
14346
|
-
"GITHUB_APP_REPO_OWNERS"
|
|
14503
|
+
"GITHUB_APP_REPO_OWNERS",
|
|
14504
|
+
"OPENCODE_SDK_PATH",
|
|
14505
|
+
"SCRIPT_API_BASE_URL"
|
|
14506
|
+
]);
|
|
14507
|
+
API_PROCESS_CONTROL_ENV_KEYS = new Set([
|
|
14508
|
+
"PATH",
|
|
14509
|
+
"HOME",
|
|
14510
|
+
"SHELL",
|
|
14511
|
+
"ENV",
|
|
14512
|
+
"NODE_ENV",
|
|
14513
|
+
"NODE_OPTIONS",
|
|
14514
|
+
"NODE_PATH",
|
|
14515
|
+
"BUN_OPTIONS",
|
|
14516
|
+
"GCONV_PATH",
|
|
14517
|
+
"GLIBC_TUNABLES"
|
|
14347
14518
|
]);
|
|
14519
|
+
API_PROCESS_CONTROL_ENV_PREFIXES = ["LD_", "DYLD_", "BASH_", "BUN_INSPECT"];
|
|
14348
14520
|
API_ONLY_CONFIG_KEYS = new Set([
|
|
14349
14521
|
"API_AGENT_FS_API_KEY",
|
|
14350
14522
|
"SLACK_SIGNING_SECRET",
|
|
@@ -14355,7 +14527,10 @@ var init_swarm_config_guard = __esm(() => {
|
|
|
14355
14527
|
"runtime_owner_id",
|
|
14356
14528
|
TELEMETRY_RANKING_KEY
|
|
14357
14529
|
]);
|
|
14358
|
-
HUMAN_ONLY_CONFIG_KEYS = new Set([
|
|
14530
|
+
HUMAN_ONLY_CONFIG_KEYS = new Set([
|
|
14531
|
+
UI_SPEC_SCRIPT_ACTIONS_KEY,
|
|
14532
|
+
"WORKFLOW_INPUT_ENV_ALLOWLIST"
|
|
14533
|
+
]);
|
|
14359
14534
|
BOOLEAN_LITERALS = ["true", "false", "1", "0"];
|
|
14360
14535
|
DB_RETENTION_TUNING_BOUNDS = {
|
|
14361
14536
|
DB_RETENTION_TICK_BUDGET_MS: { min: 1000, max: 300000 },
|
|
@@ -14363,6 +14538,7 @@ var init_swarm_config_guard = __esm(() => {
|
|
|
14363
14538
|
DB_RETENTION_MAX_STATEMENT_MS: { min: 25, max: 5000 }
|
|
14364
14539
|
};
|
|
14365
14540
|
APPS_JSON_COLUMN_MAX_BYTES_BOUNDS = { min: 1024, max: 16777216 };
|
|
14541
|
+
APPS_DEFINITION_LIMIT_BOUNDS = { min: 1, max: 1000 };
|
|
14366
14542
|
CODEX_OAUTH_KEEP_WARM_MAX_AGE_HOURS_BOUNDS = { min: 1, max: 216 };
|
|
14367
14543
|
SCHEDULER_INTERVAL_MS_BOUNDS = { min: 1, max: 2147483647 };
|
|
14368
14544
|
SYSTEM_ONE_DEFAULT_PROVIDER_OPTIONS = [
|
|
@@ -14376,6 +14552,8 @@ var init_swarm_config_guard = __esm(() => {
|
|
|
14376
14552
|
validateControllerTokenTtlDays = boundedIntegerValidators(["RUNTIME_CONTROLLER_TOKEN_TTL_DAYS"], 1, 3650).RUNTIME_CONTROLLER_TOKEN_TTL_DAYS;
|
|
14377
14553
|
validateControllerGraceSec = boundedIntegerValidators(["RUNTIME_CONTROLLER_GRACE_SEC"], 0, 86400).RUNTIME_CONTROLLER_GRACE_SEC;
|
|
14378
14554
|
VALIDATED_KEYS = {
|
|
14555
|
+
SLACK_DEFAULT_TIMEZONE: (value) => isValidTimezone(value) ? null : "SLACK_DEFAULT_TIMEZONE must be a valid IANA timezone",
|
|
14556
|
+
WORKFLOW_INPUT_ENV_ALLOWLIST: validateWorkflowInputEnvAllowlist,
|
|
14379
14557
|
[UI_SPEC_SCRIPT_ACTIONS_KEY]: validateScriptActionAllowlist,
|
|
14380
14558
|
...booleanValidators(["RUNTIME_POOLS_ENABLED", "DOCKER_HARDENED"]),
|
|
14381
14559
|
DOCKER_RUNTIME: validateDockerRuntime,
|
|
@@ -14622,6 +14800,7 @@ var init_swarm_config_guard = __esm(() => {
|
|
|
14622
14800
|
], 1),
|
|
14623
14801
|
...boundedIntegerValidatorsFor(DB_RETENTION_TUNING_BOUNDS),
|
|
14624
14802
|
...boundedIntegerValidators(["APPS_JSON_COLUMN_MAX_BYTES"], APPS_JSON_COLUMN_MAX_BYTES_BOUNDS.min, APPS_JSON_COLUMN_MAX_BYTES_BOUNDS.max),
|
|
14803
|
+
...boundedIntegerValidators(["APPS_MAX_MODELS", "APPS_MAX_COLUMNS_PER_MODEL", "APPS_MAX_ACTIONS"], APPS_DEFINITION_LIMIT_BOUNDS.min, APPS_DEFINITION_LIMIT_BOUNDS.max),
|
|
14625
14804
|
...boundedIntegerValidators(["SCHEDULER_INTERVAL_MS"], SCHEDULER_INTERVAL_MS_BOUNDS.min, SCHEDULER_INTERVAL_MS_BOUNDS.max),
|
|
14626
14805
|
...enumValidator("WORKTREE_REAPER_MODE", ["off", "dry-run", "on"]),
|
|
14627
14806
|
...boundedIntegerValidators(["WORKTREE_TTL_HOURS"], 1, 2160),
|
|
@@ -23204,6 +23383,443 @@ var init_openai2 = __esm(() => {
|
|
|
23204
23383
|
init_azure();
|
|
23205
23384
|
});
|
|
23206
23385
|
|
|
23386
|
+
// node_modules/oauth4webapi/build/index.js
|
|
23387
|
+
function CodedTypeError(message, code, cause) {
|
|
23388
|
+
const err = new TypeError(message, { cause });
|
|
23389
|
+
Object.assign(err, { code });
|
|
23390
|
+
return err;
|
|
23391
|
+
}
|
|
23392
|
+
function buf(input) {
|
|
23393
|
+
if (typeof input === "string") {
|
|
23394
|
+
return encoder.encode(input);
|
|
23395
|
+
}
|
|
23396
|
+
return decoder.decode(input);
|
|
23397
|
+
}
|
|
23398
|
+
function b64u(input) {
|
|
23399
|
+
if (typeof input === "string") {
|
|
23400
|
+
return decodeBase64Url(input);
|
|
23401
|
+
}
|
|
23402
|
+
return encodeBase64Url(input);
|
|
23403
|
+
}
|
|
23404
|
+
function OPE(message, code, cause) {
|
|
23405
|
+
return new OperationProcessingError(message, { code, cause });
|
|
23406
|
+
}
|
|
23407
|
+
function assertString(input, it, code, cause) {
|
|
23408
|
+
try {
|
|
23409
|
+
if (typeof input !== "string") {
|
|
23410
|
+
throw CodedTypeError(`${it} must be a string`, ERR_INVALID_ARG_TYPE, cause);
|
|
23411
|
+
}
|
|
23412
|
+
if (input.length === 0) {
|
|
23413
|
+
throw CodedTypeError(`${it} must not be empty`, ERR_INVALID_ARG_VALUE, cause);
|
|
23414
|
+
}
|
|
23415
|
+
} catch (err) {
|
|
23416
|
+
if (code) {
|
|
23417
|
+
throw OPE(err.message, code, cause);
|
|
23418
|
+
}
|
|
23419
|
+
throw err;
|
|
23420
|
+
}
|
|
23421
|
+
}
|
|
23422
|
+
function randomBytes5() {
|
|
23423
|
+
return b64u(crypto.getRandomValues(new Uint8Array(32)));
|
|
23424
|
+
}
|
|
23425
|
+
function generateRandomCodeVerifier() {
|
|
23426
|
+
return randomBytes5();
|
|
23427
|
+
}
|
|
23428
|
+
function generateRandomState() {
|
|
23429
|
+
return randomBytes5();
|
|
23430
|
+
}
|
|
23431
|
+
async function calculatePKCECodeChallenge(codeVerifier) {
|
|
23432
|
+
assertString(codeVerifier, "codeVerifier");
|
|
23433
|
+
return b64u(await crypto.subtle.digest("SHA-256", buf(codeVerifier)));
|
|
23434
|
+
}
|
|
23435
|
+
var USER_AGENT, ERR_INVALID_ARG_VALUE = "ERR_INVALID_ARG_VALUE", ERR_INVALID_ARG_TYPE = "ERR_INVALID_ARG_TYPE", allowInsecureRequests, clockSkew, clockTolerance, customFetch, modifyAssertion, jweDecrypt, jwksCache, encoder, decoder, encodeBase64Url, decodeBase64Url, OperationProcessingError, URLParse, tokenMatch = "[a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+", token68Match = "[a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2}", quotedMatch = '"((?:[^"\\\\]|\\\\[\\s\\S])*)"', quotedParamMatcher, paramMatcher, schemeRE, quotedParamRE, unquotedParamRE, token68ParamRE, skipSubjectCheck, idTokenClaims, jwtRefs, branded, nopkce, expectNoNonce, skipAuthTimeCheck, skipStateCheck, expectNoState, _nodiscoverycheck, _expectedIssuer;
|
|
23436
|
+
var init_build = __esm(() => {
|
|
23437
|
+
if (typeof navigator === "undefined" || !navigator.userAgent?.startsWith?.("Mozilla/5.0 ")) {
|
|
23438
|
+
const NAME = "oauth4webapi";
|
|
23439
|
+
const VERSION = "v3.8.5";
|
|
23440
|
+
USER_AGENT = `${NAME}/${VERSION}`;
|
|
23441
|
+
}
|
|
23442
|
+
allowInsecureRequests = Symbol();
|
|
23443
|
+
clockSkew = Symbol();
|
|
23444
|
+
clockTolerance = Symbol();
|
|
23445
|
+
customFetch = Symbol();
|
|
23446
|
+
modifyAssertion = Symbol();
|
|
23447
|
+
jweDecrypt = Symbol();
|
|
23448
|
+
jwksCache = Symbol();
|
|
23449
|
+
encoder = new TextEncoder;
|
|
23450
|
+
decoder = new TextDecoder;
|
|
23451
|
+
if (Uint8Array.prototype.toBase64) {
|
|
23452
|
+
encodeBase64Url = (input) => {
|
|
23453
|
+
if (input instanceof ArrayBuffer) {
|
|
23454
|
+
input = new Uint8Array(input);
|
|
23455
|
+
}
|
|
23456
|
+
return input.toBase64({ alphabet: "base64url", omitPadding: true });
|
|
23457
|
+
};
|
|
23458
|
+
} else {
|
|
23459
|
+
const CHUNK_SIZE = 32768;
|
|
23460
|
+
encodeBase64Url = (input) => {
|
|
23461
|
+
if (input instanceof ArrayBuffer) {
|
|
23462
|
+
input = new Uint8Array(input);
|
|
23463
|
+
}
|
|
23464
|
+
const arr = [];
|
|
23465
|
+
for (let i = 0;i < input.byteLength; i += CHUNK_SIZE) {
|
|
23466
|
+
arr.push(String.fromCharCode.apply(null, input.subarray(i, i + CHUNK_SIZE)));
|
|
23467
|
+
}
|
|
23468
|
+
return btoa(arr.join("")).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
23469
|
+
};
|
|
23470
|
+
}
|
|
23471
|
+
if (Uint8Array.fromBase64) {
|
|
23472
|
+
decodeBase64Url = (input) => {
|
|
23473
|
+
try {
|
|
23474
|
+
return Uint8Array.fromBase64(input, { alphabet: "base64url" });
|
|
23475
|
+
} catch (cause) {
|
|
23476
|
+
throw CodedTypeError("The input to be decoded is not correctly encoded.", ERR_INVALID_ARG_VALUE, cause);
|
|
23477
|
+
}
|
|
23478
|
+
};
|
|
23479
|
+
} else {
|
|
23480
|
+
decodeBase64Url = (input) => {
|
|
23481
|
+
try {
|
|
23482
|
+
const binary = atob(input.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, ""));
|
|
23483
|
+
const bytes = new Uint8Array(binary.length);
|
|
23484
|
+
for (let i = 0;i < binary.length; i++) {
|
|
23485
|
+
bytes[i] = binary.charCodeAt(i);
|
|
23486
|
+
}
|
|
23487
|
+
return bytes;
|
|
23488
|
+
} catch (cause) {
|
|
23489
|
+
throw CodedTypeError("The input to be decoded is not correctly encoded.", ERR_INVALID_ARG_VALUE, cause);
|
|
23490
|
+
}
|
|
23491
|
+
};
|
|
23492
|
+
}
|
|
23493
|
+
OperationProcessingError = class OperationProcessingError extends Error {
|
|
23494
|
+
code;
|
|
23495
|
+
constructor(message, options) {
|
|
23496
|
+
super(message, options);
|
|
23497
|
+
this.name = this.constructor.name;
|
|
23498
|
+
if (options?.code) {
|
|
23499
|
+
this.code = options?.code;
|
|
23500
|
+
}
|
|
23501
|
+
Error.captureStackTrace?.(this, this.constructor);
|
|
23502
|
+
}
|
|
23503
|
+
};
|
|
23504
|
+
URLParse = URL.parse ? (url, base) => URL.parse(url, base) : (url, base) => {
|
|
23505
|
+
try {
|
|
23506
|
+
return new URL(url, base);
|
|
23507
|
+
} catch {
|
|
23508
|
+
return null;
|
|
23509
|
+
}
|
|
23510
|
+
};
|
|
23511
|
+
quotedParamMatcher = "(" + tokenMatch + ")\\s*=\\s*" + quotedMatch;
|
|
23512
|
+
paramMatcher = "(" + tokenMatch + ")\\s*=\\s*(" + tokenMatch + ")";
|
|
23513
|
+
schemeRE = new RegExp("^[,\\s]*(" + tokenMatch + ")");
|
|
23514
|
+
quotedParamRE = new RegExp("^[,\\s]*" + quotedParamMatcher + "[,\\s]*(.*)");
|
|
23515
|
+
unquotedParamRE = new RegExp("^[,\\s]*" + paramMatcher + "[,\\s]*(.*)");
|
|
23516
|
+
token68ParamRE = new RegExp("^(" + token68Match + ")(?:$|[,\\s])(.*)");
|
|
23517
|
+
skipSubjectCheck = Symbol();
|
|
23518
|
+
idTokenClaims = new WeakMap;
|
|
23519
|
+
jwtRefs = new WeakMap;
|
|
23520
|
+
branded = new WeakSet;
|
|
23521
|
+
nopkce = Symbol();
|
|
23522
|
+
expectNoNonce = Symbol();
|
|
23523
|
+
skipAuthTimeCheck = Symbol();
|
|
23524
|
+
skipStateCheck = Symbol();
|
|
23525
|
+
expectNoState = Symbol();
|
|
23526
|
+
_nodiscoverycheck = Symbol();
|
|
23527
|
+
_expectedIssuer = Symbol();
|
|
23528
|
+
});
|
|
23529
|
+
|
|
23530
|
+
// src/oauth/mcp-wrapper.ts
|
|
23531
|
+
function isInvalidClientError(message) {
|
|
23532
|
+
return /invalid_client\b/i.test(message);
|
|
23533
|
+
}
|
|
23534
|
+
function publicEndpointSsrfOptions() {
|
|
23535
|
+
const dev = isDevOrTestNodeEnv() || process.env.ALLOW_PRIVATE_NETWORK_URLS === "true";
|
|
23536
|
+
return {
|
|
23537
|
+
allowPrivateHosts: dev,
|
|
23538
|
+
allowInsecure: dev
|
|
23539
|
+
};
|
|
23540
|
+
}
|
|
23541
|
+
function mcpOAuthSsrfOptions() {
|
|
23542
|
+
return {
|
|
23543
|
+
allowPrivateHosts: isEnvFlagEnabled("MCP_OAUTH_ALLOW_PRIVATE_HOSTS", false),
|
|
23544
|
+
allowInsecure: isDevOrTestNodeEnv()
|
|
23545
|
+
};
|
|
23546
|
+
}
|
|
23547
|
+
async function safeFetch(url, init, timeoutMs = DEFAULT_FETCH_TIMEOUT_MS) {
|
|
23548
|
+
return createSsrfGuardedFetch(mcpOAuthSsrfOptions())(url, {
|
|
23549
|
+
...init,
|
|
23550
|
+
signal: init?.signal ?? AbortSignal.timeout(timeoutMs)
|
|
23551
|
+
});
|
|
23552
|
+
}
|
|
23553
|
+
async function discoverProtectedResourceMetadata(resourceUrl) {
|
|
23554
|
+
const base = new URL(resourceUrl);
|
|
23555
|
+
const wellKnown = new URL("/.well-known/oauth-protected-resource", base).toString();
|
|
23556
|
+
try {
|
|
23557
|
+
const res = await safeFetch(wellKnown, {
|
|
23558
|
+
headers: { Accept: "application/json" }
|
|
23559
|
+
});
|
|
23560
|
+
if (res.ok) {
|
|
23561
|
+
return await res.json();
|
|
23562
|
+
}
|
|
23563
|
+
} catch {}
|
|
23564
|
+
try {
|
|
23565
|
+
const probe = await safeFetch(resourceUrl, { method: "HEAD" });
|
|
23566
|
+
const wwwAuth = probe.headers.get("www-authenticate");
|
|
23567
|
+
if (wwwAuth) {
|
|
23568
|
+
const match = /resource_metadata="([^"]+)"/i.exec(wwwAuth);
|
|
23569
|
+
if (match) {
|
|
23570
|
+
const metaRes = await safeFetch(match[1], {
|
|
23571
|
+
headers: { Accept: "application/json" }
|
|
23572
|
+
});
|
|
23573
|
+
if (metaRes.ok) {
|
|
23574
|
+
return await metaRes.json();
|
|
23575
|
+
}
|
|
23576
|
+
}
|
|
23577
|
+
}
|
|
23578
|
+
} catch {}
|
|
23579
|
+
return null;
|
|
23580
|
+
}
|
|
23581
|
+
async function discoverAuthorizationServerMetadata(issuer) {
|
|
23582
|
+
const issuerUrl = new URL(issuer);
|
|
23583
|
+
const candidates = [
|
|
23584
|
+
new URL("/.well-known/oauth-authorization-server", issuerUrl).toString(),
|
|
23585
|
+
new URL("/.well-known/openid-configuration", issuerUrl).toString()
|
|
23586
|
+
];
|
|
23587
|
+
let lastError = null;
|
|
23588
|
+
for (const candidate of candidates) {
|
|
23589
|
+
try {
|
|
23590
|
+
const res = await safeFetch(candidate, {
|
|
23591
|
+
headers: { Accept: "application/json" }
|
|
23592
|
+
});
|
|
23593
|
+
if (res.ok) {
|
|
23594
|
+
return await res.json();
|
|
23595
|
+
}
|
|
23596
|
+
lastError = new Error(`Metadata fetch ${candidate} → ${res.status}`);
|
|
23597
|
+
} catch (err) {
|
|
23598
|
+
lastError = err instanceof Error ? err : new Error(String(err));
|
|
23599
|
+
}
|
|
23600
|
+
}
|
|
23601
|
+
throw lastError ?? new Error(`Authorization server metadata not found at ${issuer}`);
|
|
23602
|
+
}
|
|
23603
|
+
function normalizeTokenEndpointAuthMethod(value) {
|
|
23604
|
+
return KNOWN_TOKEN_ENDPOINT_AUTH_METHODS.includes(value ?? "") ? value : DEFAULT_TOKEN_ENDPOINT_AUTH_METHOD;
|
|
23605
|
+
}
|
|
23606
|
+
function resolveAdvertisedTokenEndpointAuthMethod(value, source) {
|
|
23607
|
+
if (value == null || value === "")
|
|
23608
|
+
return DEFAULT_TOKEN_ENDPOINT_AUTH_METHOD;
|
|
23609
|
+
if (!KNOWN_TOKEN_ENDPOINT_AUTH_METHODS.includes(value)) {
|
|
23610
|
+
throw new UnsupportedTokenEndpointAuthMethodError(value, source);
|
|
23611
|
+
}
|
|
23612
|
+
return value;
|
|
23613
|
+
}
|
|
23614
|
+
function authMethodForStoredClient(value) {
|
|
23615
|
+
if (value == null || value === "")
|
|
23616
|
+
return "client_secret_post";
|
|
23617
|
+
return normalizeTokenEndpointAuthMethod(value);
|
|
23618
|
+
}
|
|
23619
|
+
function selectDcrTokenEndpointAuthMethod(supportedMethods) {
|
|
23620
|
+
if (!supportedMethods || supportedMethods.length === 0) {
|
|
23621
|
+
return DEFAULT_TOKEN_ENDPOINT_AUTH_METHOD;
|
|
23622
|
+
}
|
|
23623
|
+
for (const method of KNOWN_TOKEN_ENDPOINT_AUTH_METHODS) {
|
|
23624
|
+
if (supportedMethods.includes(method))
|
|
23625
|
+
return method;
|
|
23626
|
+
}
|
|
23627
|
+
throw new UnsupportedTokenEndpointAuthMethodError(supportedMethods.join(", "), "advertises only");
|
|
23628
|
+
}
|
|
23629
|
+
function formUrlEncodeComponent(value) {
|
|
23630
|
+
return new URLSearchParams({ v: value }).toString().slice(2);
|
|
23631
|
+
}
|
|
23632
|
+
function redactSentCredentials(text, sent) {
|
|
23633
|
+
let out = scrubSecrets(text);
|
|
23634
|
+
for (const value of sent) {
|
|
23635
|
+
if (!value)
|
|
23636
|
+
continue;
|
|
23637
|
+
for (const shape of new Set([value, formUrlEncodeComponent(value)])) {
|
|
23638
|
+
out = out.split(shape).join("[REDACTED]");
|
|
23639
|
+
}
|
|
23640
|
+
}
|
|
23641
|
+
return out;
|
|
23642
|
+
}
|
|
23643
|
+
function applyClientAuthentication(method, clientId, clientSecret, body, headers) {
|
|
23644
|
+
if (method === "client_secret_basic" && clientSecret) {
|
|
23645
|
+
const encodedSecret = formUrlEncodeComponent(clientSecret);
|
|
23646
|
+
const credentials = `${formUrlEncodeComponent(clientId)}:${encodedSecret}`;
|
|
23647
|
+
const encoded = Buffer.from(credentials).toString("base64");
|
|
23648
|
+
registerVolatileSecret(encoded, "mcp_oauth_basic_credential");
|
|
23649
|
+
headers.Authorization = `Basic ${encoded}`;
|
|
23650
|
+
return [clientSecret, encodedSecret, encoded, credentials];
|
|
23651
|
+
}
|
|
23652
|
+
body.set("client_id", clientId);
|
|
23653
|
+
if (method === "client_secret_post" && clientSecret) {
|
|
23654
|
+
body.set("client_secret", clientSecret);
|
|
23655
|
+
return [clientSecret, formUrlEncodeComponent(clientSecret)];
|
|
23656
|
+
}
|
|
23657
|
+
return [];
|
|
23658
|
+
}
|
|
23659
|
+
async function registerClient(registrationEndpoint, req) {
|
|
23660
|
+
const res = await safeFetch(registrationEndpoint, {
|
|
23661
|
+
method: "POST",
|
|
23662
|
+
headers: {
|
|
23663
|
+
"Content-Type": "application/json",
|
|
23664
|
+
Accept: "application/json"
|
|
23665
|
+
},
|
|
23666
|
+
body: JSON.stringify(req)
|
|
23667
|
+
});
|
|
23668
|
+
if (!res.ok) {
|
|
23669
|
+
const body = await res.text().catch(() => "");
|
|
23670
|
+
throw new Error(`Dynamic client registration failed (${res.status}): ${body}`);
|
|
23671
|
+
}
|
|
23672
|
+
return await res.json();
|
|
23673
|
+
}
|
|
23674
|
+
async function buildAuthorizeUrl(input) {
|
|
23675
|
+
const state = input.state ?? generateRandomState();
|
|
23676
|
+
const codeVerifier = generateRandomCodeVerifier();
|
|
23677
|
+
const codeChallenge = await calculatePKCECodeChallenge(codeVerifier);
|
|
23678
|
+
const url = new URL(input.authorizeUrl);
|
|
23679
|
+
url.searchParams.set("response_type", "code");
|
|
23680
|
+
url.searchParams.set("client_id", input.clientId);
|
|
23681
|
+
url.searchParams.set("redirect_uri", input.redirectUri);
|
|
23682
|
+
if (input.scopes.length > 0) {
|
|
23683
|
+
url.searchParams.set("scope", input.scopes.join(" "));
|
|
23684
|
+
}
|
|
23685
|
+
url.searchParams.set("state", state);
|
|
23686
|
+
url.searchParams.set("code_challenge", codeChallenge);
|
|
23687
|
+
url.searchParams.set("code_challenge_method", "S256");
|
|
23688
|
+
url.searchParams.set("resource", input.resource);
|
|
23689
|
+
if (input.extraParams) {
|
|
23690
|
+
const RESERVED = new Set([
|
|
23691
|
+
"response_type",
|
|
23692
|
+
"client_id",
|
|
23693
|
+
"redirect_uri",
|
|
23694
|
+
"scope",
|
|
23695
|
+
"state",
|
|
23696
|
+
"code_challenge",
|
|
23697
|
+
"code_challenge_method",
|
|
23698
|
+
"resource"
|
|
23699
|
+
]);
|
|
23700
|
+
for (const [k, v] of Object.entries(input.extraParams)) {
|
|
23701
|
+
if (RESERVED.has(k.toLowerCase())) {
|
|
23702
|
+
console.warn(`[mcp-oauth] extraParams key "${k}" is reserved and skipped`);
|
|
23703
|
+
continue;
|
|
23704
|
+
}
|
|
23705
|
+
url.searchParams.set(k, v);
|
|
23706
|
+
}
|
|
23707
|
+
}
|
|
23708
|
+
return { url: url.toString(), state, codeVerifier, codeChallenge };
|
|
23709
|
+
}
|
|
23710
|
+
async function exchangeCodeForTokens(input) {
|
|
23711
|
+
if (input.clientSecret)
|
|
23712
|
+
registerVolatileSecret(input.clientSecret, "mcp_oauth_client_secret");
|
|
23713
|
+
const method = normalizeTokenEndpointAuthMethod(input.tokenEndpointAuthMethod);
|
|
23714
|
+
const body = new URLSearchParams({
|
|
23715
|
+
grant_type: "authorization_code",
|
|
23716
|
+
code: input.code,
|
|
23717
|
+
redirect_uri: input.redirectUri,
|
|
23718
|
+
code_verifier: input.codeVerifier,
|
|
23719
|
+
resource: input.resource
|
|
23720
|
+
});
|
|
23721
|
+
const headers = {
|
|
23722
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
23723
|
+
Accept: "application/json"
|
|
23724
|
+
};
|
|
23725
|
+
const sentCredentials = applyClientAuthentication(method, input.clientId, input.clientSecret, body, headers);
|
|
23726
|
+
const res = await safeFetch(input.tokenUrl, {
|
|
23727
|
+
method: "POST",
|
|
23728
|
+
headers,
|
|
23729
|
+
body: body.toString()
|
|
23730
|
+
});
|
|
23731
|
+
if (!res.ok) {
|
|
23732
|
+
const text = await res.text().catch(() => "");
|
|
23733
|
+
throw new Error(`Token exchange failed (${res.status}): ${redactSentCredentials(text, [
|
|
23734
|
+
...sentCredentials,
|
|
23735
|
+
input.code,
|
|
23736
|
+
input.codeVerifier
|
|
23737
|
+
])}`);
|
|
23738
|
+
}
|
|
23739
|
+
return await res.json();
|
|
23740
|
+
}
|
|
23741
|
+
async function refreshMcpToken(input) {
|
|
23742
|
+
if (input.clientSecret)
|
|
23743
|
+
registerVolatileSecret(input.clientSecret, "mcp_oauth_client_secret");
|
|
23744
|
+
registerVolatileSecret(input.refreshToken, "mcp_oauth_refresh_token");
|
|
23745
|
+
const method = normalizeTokenEndpointAuthMethod(input.tokenEndpointAuthMethod);
|
|
23746
|
+
const body = new URLSearchParams({
|
|
23747
|
+
grant_type: "refresh_token",
|
|
23748
|
+
refresh_token: input.refreshToken,
|
|
23749
|
+
resource: input.resource
|
|
23750
|
+
});
|
|
23751
|
+
if (input.scopes && input.scopes.length > 0)
|
|
23752
|
+
body.set("scope", input.scopes.join(" "));
|
|
23753
|
+
const headers = {
|
|
23754
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
23755
|
+
Accept: "application/json"
|
|
23756
|
+
};
|
|
23757
|
+
const sentCredentials = applyClientAuthentication(method, input.clientId, input.clientSecret, body, headers);
|
|
23758
|
+
const res = await safeFetch(input.tokenUrl, {
|
|
23759
|
+
method: "POST",
|
|
23760
|
+
headers,
|
|
23761
|
+
body: body.toString()
|
|
23762
|
+
});
|
|
23763
|
+
if (!res.ok) {
|
|
23764
|
+
const text = await res.text().catch(() => "");
|
|
23765
|
+
throw new Error(`Token refresh failed (${res.status}): ${redactSentCredentials(text, [
|
|
23766
|
+
...sentCredentials,
|
|
23767
|
+
input.refreshToken
|
|
23768
|
+
])}`);
|
|
23769
|
+
}
|
|
23770
|
+
return await res.json();
|
|
23771
|
+
}
|
|
23772
|
+
async function revokeMcpToken(input) {
|
|
23773
|
+
if (input.clientSecret)
|
|
23774
|
+
registerVolatileSecret(input.clientSecret, "mcp_oauth_client_secret");
|
|
23775
|
+
registerVolatileSecret(input.token, "mcp_oauth_revoked_token");
|
|
23776
|
+
const method = normalizeTokenEndpointAuthMethod(input.tokenEndpointAuthMethod);
|
|
23777
|
+
const body = new URLSearchParams({ token: input.token });
|
|
23778
|
+
if (input.tokenTypeHint)
|
|
23779
|
+
body.set("token_type_hint", input.tokenTypeHint);
|
|
23780
|
+
const headers = {
|
|
23781
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
23782
|
+
Accept: "application/json"
|
|
23783
|
+
};
|
|
23784
|
+
const sentCredentials = applyClientAuthentication(method, input.clientId, input.clientSecret, body, headers);
|
|
23785
|
+
const res = await safeFetch(input.revocationUrl, {
|
|
23786
|
+
method: "POST",
|
|
23787
|
+
headers,
|
|
23788
|
+
body: body.toString()
|
|
23789
|
+
});
|
|
23790
|
+
if (!res.ok && res.status !== 200 && res.status !== 204) {
|
|
23791
|
+
const text = await res.text().catch(() => "");
|
|
23792
|
+
throw new Error(`Token revocation failed (${res.status}): ${redactSentCredentials(text, [
|
|
23793
|
+
...sentCredentials,
|
|
23794
|
+
input.token
|
|
23795
|
+
])}`);
|
|
23796
|
+
}
|
|
23797
|
+
}
|
|
23798
|
+
function computeExpiresAt(expiresInSeconds) {
|
|
23799
|
+
if (!expiresInSeconds || expiresInSeconds <= 0)
|
|
23800
|
+
return null;
|
|
23801
|
+
return new Date(Date.now() + expiresInSeconds * 1000).toISOString();
|
|
23802
|
+
}
|
|
23803
|
+
var DEFAULT_FETCH_TIMEOUT_MS = 15000, KNOWN_TOKEN_ENDPOINT_AUTH_METHODS, DEFAULT_TOKEN_ENDPOINT_AUTH_METHOD = "client_secret_basic", UnsupportedTokenEndpointAuthMethodError;
|
|
23804
|
+
var init_mcp_wrapper = __esm(() => {
|
|
23805
|
+
init_build();
|
|
23806
|
+
init_egress_guard();
|
|
23807
|
+
init_env_flag();
|
|
23808
|
+
init_node_env();
|
|
23809
|
+
init_secret_scrubber();
|
|
23810
|
+
KNOWN_TOKEN_ENDPOINT_AUTH_METHODS = [
|
|
23811
|
+
"client_secret_basic",
|
|
23812
|
+
"client_secret_post",
|
|
23813
|
+
"none"
|
|
23814
|
+
];
|
|
23815
|
+
UnsupportedTokenEndpointAuthMethodError = class UnsupportedTokenEndpointAuthMethodError extends Error {
|
|
23816
|
+
constructor(value, source) {
|
|
23817
|
+
super(`Authorization server ${source} token_endpoint_auth_method "${value}", which agent-swarm cannot perform. ` + `Supported methods: ${KNOWN_TOKEN_ENDPOINT_AUTH_METHODS.join(", ")}. ` + `Register a client manually via POST /api/mcp-oauth/:id/manual-client with a supported method.`);
|
|
23818
|
+
this.name = "UnsupportedTokenEndpointAuthMethodError";
|
|
23819
|
+
}
|
|
23820
|
+
};
|
|
23821
|
+
});
|
|
23822
|
+
|
|
23207
23823
|
// src/be/memory/constants.ts
|
|
23208
23824
|
function numEnv(key, fallback) {
|
|
23209
23825
|
const val = process.env[key];
|
|
@@ -23279,7 +23895,7 @@ function noteEmbeddingSuccess() {
|
|
|
23279
23895
|
const report = (what) => (err) => {
|
|
23280
23896
|
console.error(`[memory] ${what} backfill after embeddings recovered failed:`, err.message);
|
|
23281
23897
|
};
|
|
23282
|
-
backfill2 = import("./embedding-space-
|
|
23898
|
+
backfill2 = import("./embedding-space-zsdw37bb.js").then(({ runEmbeddingMaintenance }) => runEmbeddingMaintenance({ backfill: true })).catch(report("Embedding")).finally(() => {
|
|
23283
23899
|
backfill2 = null;
|
|
23284
23900
|
});
|
|
23285
23901
|
}
|
|
@@ -23370,10 +23986,12 @@ class OpenAIEmbeddingProvider {
|
|
|
23370
23986
|
return null;
|
|
23371
23987
|
if (!this.client) {
|
|
23372
23988
|
const baseURL = this.baseURL;
|
|
23989
|
+
const endpoint = embeddingEndpoint2(baseURL ?? null);
|
|
23373
23990
|
this.client = new OpenAI2({
|
|
23374
23991
|
baseURL,
|
|
23375
23992
|
apiKey: this.apiKey,
|
|
23376
|
-
defaultHeaders: getOpenRouterAttributionHeaders(baseURL ?? "")
|
|
23993
|
+
defaultHeaders: getOpenRouterAttributionHeaders(baseURL ?? ""),
|
|
23994
|
+
fetch: endpoint && !endpoint.fromDeployment ? createSsrfGuardedFetch(publicEndpointSsrfOptions()) : undefined
|
|
23377
23995
|
});
|
|
23378
23996
|
}
|
|
23379
23997
|
return this.client;
|
|
@@ -23482,10 +24100,13 @@ class OpenAIEmbeddingProvider {
|
|
|
23482
24100
|
var MAX_EMBEDDING_INPUT_CHARS = 24000, MIN_EMBEDDING_INPUT_CHARS = 1000, MAX_BATCH_REQUEST_CHARS = 200000;
|
|
23483
24101
|
var init_openai_embedding = __esm(() => {
|
|
23484
24102
|
init_openai2();
|
|
24103
|
+
init_mcp_wrapper();
|
|
23485
24104
|
init_credentials2();
|
|
24105
|
+
init_egress_guard();
|
|
23486
24106
|
init_openrouter_base_url();
|
|
23487
24107
|
init_constants2();
|
|
23488
24108
|
init_embedding_recovery();
|
|
24109
|
+
init_memory();
|
|
23489
24110
|
});
|
|
23490
24111
|
|
|
23491
24112
|
// src/be/memory/key-paths.ts
|
|
@@ -23995,7 +24616,7 @@ function applyEditMode(mode, currentContent, fields) {
|
|
|
23995
24616
|
}
|
|
23996
24617
|
return currentContent.slice(0, first) + fields.newString + currentContent.slice(first + fields.oldString.length);
|
|
23997
24618
|
}
|
|
23998
|
-
function
|
|
24619
|
+
function computeExpiresAt2(source, key) {
|
|
23999
24620
|
const ttlDays = isLearningKey(key) ? LEARNING_TTL_DAYS : TTL_DEFAULTS[tierSource(source, key)];
|
|
24000
24621
|
if (ttlDays == null)
|
|
24001
24622
|
return null;
|
|
@@ -24224,7 +24845,7 @@ class SqliteMemoryStore {
|
|
|
24224
24845
|
const id = crypto.randomUUID();
|
|
24225
24846
|
const now = new Date().toISOString();
|
|
24226
24847
|
const key = input.key ?? `${input.scope}/${input.source}/${id}`;
|
|
24227
|
-
const expiresAt =
|
|
24848
|
+
const expiresAt = computeExpiresAt2(input.source, key);
|
|
24228
24849
|
const name = scrubSecrets(input.name);
|
|
24229
24850
|
const content = scrubSecrets(input.content);
|
|
24230
24851
|
const summary = input.summary == null ? null : scrubSecrets(input.summary);
|
|
@@ -24750,7 +25371,7 @@ class SqliteMemoryStore {
|
|
|
24750
25371
|
throw new Error(`key "${input.newKey}" is already used in this scope`);
|
|
24751
25372
|
}
|
|
24752
25373
|
const resetExpiry = moving && (isLongtermKey(input.newKey) || isLearningKey(row.key) !== isLearningKey(input.newKey));
|
|
24753
|
-
const expiresAt = resetExpiry ?
|
|
25374
|
+
const expiresAt = resetExpiry ? computeExpiresAt2(row.source, input.newKey) : row.expiresAt;
|
|
24754
25375
|
const now = new Date().toISOString();
|
|
24755
25376
|
const versionIntent = moving ? `${input.intent} [key ${row.key ?? "(none)"} -> ${input.newKey}]` : input.intent;
|
|
24756
25377
|
let nextVersion = previousVersion + 1;
|
|
@@ -25174,7 +25795,27 @@ function getMemoryStore2() {
|
|
|
25174
25795
|
}
|
|
25175
25796
|
return memoryStore;
|
|
25176
25797
|
}
|
|
25177
|
-
|
|
25798
|
+
function setDeploymentEnvReader2(read) {
|
|
25799
|
+
readDeploymentEnv = read;
|
|
25800
|
+
}
|
|
25801
|
+
function embeddingEndpoint2(embeddingBaseUrl = process.env.EMBEDDING_API_BASE_URL || null) {
|
|
25802
|
+
if (embeddingBaseUrl) {
|
|
25803
|
+
return {
|
|
25804
|
+
baseUrl: embeddingBaseUrl,
|
|
25805
|
+
fromDeployment: embeddingBaseUrl === readDeploymentEnv("EMBEDDING_API_BASE_URL")
|
|
25806
|
+
};
|
|
25807
|
+
}
|
|
25808
|
+
const openAiBaseUrl = process.env.OPENAI_BASE_URL;
|
|
25809
|
+
if (!openAiBaseUrl)
|
|
25810
|
+
return null;
|
|
25811
|
+
return {
|
|
25812
|
+
baseUrl: openAiBaseUrl,
|
|
25813
|
+
fromDeployment: openAiBaseUrl === readDeploymentEnv("OPENAI_BASE_URL")
|
|
25814
|
+
};
|
|
25815
|
+
}
|
|
25816
|
+
var embeddingProvider = null, memoryStore = null, readDeploymentEnv = () => {
|
|
25817
|
+
return;
|
|
25818
|
+
};
|
|
25178
25819
|
var init_memory = () => {};
|
|
25179
25820
|
|
|
25180
25821
|
// src/be/scripts/embeddings.ts
|
|
@@ -25848,7 +26489,7 @@ async function loadSecretRegistry() {
|
|
|
25848
26489
|
result.failed += 1;
|
|
25849
26490
|
}
|
|
25850
26491
|
try {
|
|
25851
|
-
const { loadRuntimeControllerSecrets } = await import("./db-
|
|
26492
|
+
const { loadRuntimeControllerSecrets } = await import("./db-gd81d68c.js");
|
|
25852
26493
|
const loaded = await loadRuntimeControllerSecrets();
|
|
25853
26494
|
result.runtimeController = loaded.count;
|
|
25854
26495
|
result.failed += loaded.failed;
|
|
@@ -26009,7 +26650,7 @@ async function requestSteering(args) {
|
|
|
26009
26650
|
}
|
|
26010
26651
|
const requestedMode = args.mode ?? "queue";
|
|
26011
26652
|
const onUnsupported = args.onUnsupported ?? "degrade";
|
|
26012
|
-
const { dispatchPre, extensionIdForAgent } = await import("./dispatcher-
|
|
26653
|
+
const { dispatchPre, extensionIdForAgent } = await import("./dispatcher-76as8w2t.js");
|
|
26013
26654
|
const preSteer = await dispatchPre("pre.task.steer", {
|
|
26014
26655
|
task,
|
|
26015
26656
|
message: args.message,
|
|
@@ -26218,6 +26859,24 @@ async function setScriptRunFollowUpGuard2(runId, decision) {
|
|
|
26218
26859
|
runId
|
|
26219
26860
|
]);
|
|
26220
26861
|
}
|
|
26862
|
+
function scriptRunFilterSql(opts) {
|
|
26863
|
+
const conditions = [];
|
|
26864
|
+
const params = [];
|
|
26865
|
+
const columns = [
|
|
26866
|
+
["status", opts?.status],
|
|
26867
|
+
["agentId", opts?.agentId],
|
|
26868
|
+
["scriptName", opts?.scriptName],
|
|
26869
|
+
["objectScriptId", opts?.objectScriptId],
|
|
26870
|
+
["objectId", opts?.objectId]
|
|
26871
|
+
];
|
|
26872
|
+
for (const [column, value] of columns) {
|
|
26873
|
+
if (!value)
|
|
26874
|
+
continue;
|
|
26875
|
+
conditions.push(`${column} = ?`);
|
|
26876
|
+
params.push(value);
|
|
26877
|
+
}
|
|
26878
|
+
return { conditions, params };
|
|
26879
|
+
}
|
|
26221
26880
|
var init_script_runs = __esm(() => {
|
|
26222
26881
|
init_sealed_json();
|
|
26223
26882
|
init_runtime2();
|
|
@@ -26583,6 +27242,7 @@ __export(exports_db, {
|
|
|
26583
27242
|
getWorkflowRunStepsByRunId: () => getWorkflowRunStepsByRunId2,
|
|
26584
27243
|
getWorkflowVersion: () => getWorkflowVersion2,
|
|
26585
27244
|
getWorkflowVersions: () => getWorkflowVersions2,
|
|
27245
|
+
getWorkflowsByEventName: () => getWorkflowsByEventName2,
|
|
26586
27246
|
getWorkflowsByScheduleId: () => getWorkflowsByScheduleId2,
|
|
26587
27247
|
giveUpStaleChatRelays: () => giveUpStaleChatRelays2,
|
|
26588
27248
|
hasBudgetRefusalNotificationToday: () => hasBudgetRefusalNotificationToday2,
|
|
@@ -28254,7 +28914,7 @@ async function createTaskExtended2(task, options) {
|
|
|
28254
28914
|
priority: row.priority
|
|
28255
28915
|
}, (task) => task !== null, row.requestedByUserId);
|
|
28256
28916
|
getDbClient2().afterCommit(() => {
|
|
28257
|
-
import("./event-bus-
|
|
28917
|
+
import("./event-bus-tvf2grf4.js").then(({ workflowEventBus }) => {
|
|
28258
28918
|
workflowEventBus.emit("task.created", {
|
|
28259
28919
|
taskId: row.id,
|
|
28260
28920
|
task: row.task,
|
|
@@ -28336,7 +28996,7 @@ async function releaseTask2(taskId, wakeSnapshot) {
|
|
|
28336
28996
|
} catch {}
|
|
28337
28997
|
if (isRuntimePoolsEnabled() && !wakeSnapshot)
|
|
28338
28998
|
getDbClient2().afterCommit(() => {
|
|
28339
|
-
import("./event-bus-
|
|
28999
|
+
import("./event-bus-tvf2grf4.js").then(({ workflowEventBus }) => workflowEventBus.emit("task.unassigned", { taskId })).catch((error) => console.error("[db] Routing event failed:", scrubSecrets(String(error))));
|
|
28340
29000
|
});
|
|
28341
29001
|
}
|
|
28342
29002
|
return row ? rowToAgentTask(row) : null;
|
|
@@ -28406,7 +29066,7 @@ async function rejectTask2(taskId, agentId, reason) {
|
|
|
28406
29066
|
} catch {}
|
|
28407
29067
|
if (isRuntimePoolsEnabled())
|
|
28408
29068
|
getDbClient2().afterCommit(() => {
|
|
28409
|
-
import("./event-bus-
|
|
29069
|
+
import("./event-bus-tvf2grf4.js").then(({ workflowEventBus }) => workflowEventBus.emit("task.unassigned", { taskId })).catch((error) => console.error("[db] Routing event failed:", scrubSecrets(String(error))));
|
|
28410
29070
|
});
|
|
28411
29071
|
}
|
|
28412
29072
|
return row ? rowToAgentTask(row) : null;
|
|
@@ -30069,7 +30729,7 @@ async function deleteScheduledTask2(id) {
|
|
|
30069
30729
|
const parent = await getTaskById2(deferred.parentTaskId);
|
|
30070
30730
|
if (!parent?.deferredAt)
|
|
30071
30731
|
return;
|
|
30072
|
-
const { createWorkerTaskFollowUp } = await import("./worker-follow-up-
|
|
30732
|
+
const { createWorkerTaskFollowUp } = await import("./worker-follow-up-fg48vk6d.js");
|
|
30073
30733
|
await createWorkerTaskFollowUp({
|
|
30074
30734
|
task: parent,
|
|
30075
30735
|
status: "failed",
|
|
@@ -30173,39 +30833,6 @@ function autoEncryptLegacyPlaintextSecrets2(database, dbPath, options = {}) {
|
|
|
30173
30833
|
function maskSecrets2(configs) {
|
|
30174
30834
|
return configs.map((c) => c.isSecret ? { ...c, value: MASKED_SECRET_VALUE } : c);
|
|
30175
30835
|
}
|
|
30176
|
-
function writeEnvFile(configs) {
|
|
30177
|
-
const { readFileSync, writeFileSync } = __require("node:fs");
|
|
30178
|
-
const byPath = new Map;
|
|
30179
|
-
for (const config of configs) {
|
|
30180
|
-
if (!config.envPath)
|
|
30181
|
-
continue;
|
|
30182
|
-
const existing = byPath.get(config.envPath) ?? [];
|
|
30183
|
-
existing.push(config);
|
|
30184
|
-
byPath.set(config.envPath, existing);
|
|
30185
|
-
}
|
|
30186
|
-
for (const [envPath, entries] of byPath) {
|
|
30187
|
-
let lines = [];
|
|
30188
|
-
try {
|
|
30189
|
-
const content = readFileSync(envPath, "utf-8");
|
|
30190
|
-
lines = content.split(`
|
|
30191
|
-
`);
|
|
30192
|
-
} catch {}
|
|
30193
|
-
for (const entry of entries) {
|
|
30194
|
-
const prefix = `${entry.key}=`;
|
|
30195
|
-
const lineIndex = lines.findIndex((l) => l.startsWith(prefix));
|
|
30196
|
-
const newLine = `${entry.key}=${entry.value}`;
|
|
30197
|
-
if (lineIndex >= 0) {
|
|
30198
|
-
lines[lineIndex] = newLine;
|
|
30199
|
-
} else {
|
|
30200
|
-
lines.push(newLine);
|
|
30201
|
-
}
|
|
30202
|
-
}
|
|
30203
|
-
const output = `${lines.filter((l) => l !== "").join(`
|
|
30204
|
-
`)}
|
|
30205
|
-
`;
|
|
30206
|
-
writeFileSync(envPath, output, "utf-8");
|
|
30207
|
-
}
|
|
30208
|
-
}
|
|
30209
30836
|
async function getSwarmConfigs2(filters) {
|
|
30210
30837
|
const conditions = [];
|
|
30211
30838
|
const params = [];
|
|
@@ -30231,7 +30858,7 @@ async function getInjectableGlobalConfigs2() {
|
|
|
30231
30858
|
WHERE scope = 'global'
|
|
30232
30859
|
AND UPPER(key) NOT IN ('API_KEY', 'SECRETS_ENCRYPTION_KEY', 'CORS_ALLOW_ANY_ORIGIN', 'EXTENSION_ALLOW_LEAD_ACTIVATION', 'CHAT_SDK_API_URL_OVERRIDES', ${teamsSdkEnvKeysSql()})
|
|
30233
30860
|
ORDER BY key ASC`);
|
|
30234
|
-
return rows.filter((row) => !isInternalConfigKey(row.key)).map(rowToSwarmConfig);
|
|
30861
|
+
return rows.filter((row) => !isInternalConfigKey(row.key) && !isApiProcessControlEnvKey(row.key) && !invalidConfigKeyError(row.key)).map(rowToSwarmConfig);
|
|
30235
30862
|
}
|
|
30236
30863
|
async function getSwarmConfigById2(id) {
|
|
30237
30864
|
const row = await getDbClient2().get("SELECT * FROM swarm_config WHERE id = ?", [
|
|
@@ -30253,6 +30880,9 @@ async function getSwarmConfigLookupById2(id) {
|
|
|
30253
30880
|
};
|
|
30254
30881
|
}
|
|
30255
30882
|
async function upsertSwarmConfig2(data) {
|
|
30883
|
+
const keyError = invalidConfigKeyError(data.key);
|
|
30884
|
+
if (keyError)
|
|
30885
|
+
throw new Error(keyError);
|
|
30256
30886
|
if (isReservedConfigKey(data.key)) {
|
|
30257
30887
|
throw reservedKeyError(data.key);
|
|
30258
30888
|
}
|
|
@@ -30304,13 +30934,6 @@ async function upsertSwarmConfig2(data) {
|
|
|
30304
30934
|
if (!row)
|
|
30305
30935
|
throw new Error("Failed to upsert swarm config");
|
|
30306
30936
|
const config = rowToSwarmConfig(row);
|
|
30307
|
-
if (config.envPath) {
|
|
30308
|
-
try {
|
|
30309
|
-
writeEnvFile([config]);
|
|
30310
|
-
} catch (e) {
|
|
30311
|
-
console.error(`Failed to write env file ${config.envPath}:`, e);
|
|
30312
|
-
}
|
|
30313
|
-
}
|
|
30314
30937
|
if (config.isSecret) {
|
|
30315
30938
|
registerStoredSecret(config.value, configSecretName(config.key));
|
|
30316
30939
|
registerSensitiveKeyName(config.key);
|
|
@@ -30658,31 +31281,6 @@ async function getRecentFailedCount2(hours = 24) {
|
|
|
30658
31281
|
WHERE status = 'failed' AND finishedAt > ?`, [since]);
|
|
30659
31282
|
return row?.count ?? 0;
|
|
30660
31283
|
}
|
|
30661
|
-
function rowToWorkflow(row) {
|
|
30662
|
-
return {
|
|
30663
|
-
id: row.id,
|
|
30664
|
-
key: row.key,
|
|
30665
|
-
name: row.name,
|
|
30666
|
-
description: row.description ?? undefined,
|
|
30667
|
-
enabled: row.enabled === 1,
|
|
30668
|
-
definition: JSON.parse(row.definition),
|
|
30669
|
-
triggers: JSON.parse(row.triggers),
|
|
30670
|
-
cooldown: row.cooldown ? JSON.parse(row.cooldown) : undefined,
|
|
30671
|
-
input: row.input ? JSON.parse(row.input) : undefined,
|
|
30672
|
-
triggerSchema: row.triggerSchema ? JSON.parse(row.triggerSchema) : undefined,
|
|
30673
|
-
params: JSON.parse(row.params),
|
|
30674
|
-
requiredParams: JSON.parse(row.requiredParams),
|
|
30675
|
-
requires: JSON.parse(row.requires),
|
|
30676
|
-
dir: row.dir ?? undefined,
|
|
30677
|
-
vcsRepo: row.vcs_repo ?? undefined,
|
|
30678
|
-
createdByAgentId: row.createdByAgentId ?? undefined,
|
|
30679
|
-
updatedByAgentId: row.updatedByAgentId ?? undefined,
|
|
30680
|
-
createdAt: normalizeDateRequired(row.createdAt),
|
|
30681
|
-
lastUpdatedAt: normalizeDateRequired(row.lastUpdatedAt),
|
|
30682
|
-
createdBy: row.created_by ?? undefined,
|
|
30683
|
-
updatedBy: row.updated_by ?? undefined
|
|
30684
|
-
};
|
|
30685
|
-
}
|
|
30686
31284
|
async function createWorkflow2(data, source) {
|
|
30687
31285
|
const id = crypto.randomUUID();
|
|
30688
31286
|
const row = await getDbClient2().get(`INSERT INTO workflows (id, "key", name, description, definition, triggers, cooldown, input, triggerSchema, params, requiredParams, requires, dir, vcs_repo, createdByAgentId, updatedByAgentId, created_by, updated_by, enabled)
|
|
@@ -34154,6 +34752,9 @@ function parseJsonColumn(value) {
|
|
|
34154
34752
|
}
|
|
34155
34753
|
function rowToScriptRun(row) {
|
|
34156
34754
|
return {
|
|
34755
|
+
objectScriptId: row.objectScriptId ?? undefined,
|
|
34756
|
+
objectId: row.objectId == null ? undefined : scrubSecrets(row.objectId),
|
|
34757
|
+
objectMethod: row.objectMethod ?? undefined,
|
|
34157
34758
|
id: row.id,
|
|
34158
34759
|
agentId: row.agentId,
|
|
34159
34760
|
scriptName: row.scriptName ?? undefined,
|
|
@@ -34174,6 +34775,9 @@ function rowToScriptRun(row) {
|
|
|
34174
34775
|
}
|
|
34175
34776
|
function rowToScriptRunListItem(row) {
|
|
34176
34777
|
return {
|
|
34778
|
+
objectScriptId: row.objectScriptId ?? undefined,
|
|
34779
|
+
objectId: row.objectId == null ? undefined : scrubSecrets(row.objectId),
|
|
34780
|
+
objectMethod: row.objectMethod ?? undefined,
|
|
34177
34781
|
id: row.id,
|
|
34178
34782
|
agentId: row.agentId,
|
|
34179
34783
|
scriptName: row.scriptName ?? undefined,
|
|
@@ -34229,8 +34833,8 @@ async function recordInlineScriptRun2(data) {
|
|
|
34229
34833
|
const row = await client.get(`INSERT INTO script_runs
|
|
34230
34834
|
(id, agentId, scriptName, source, sourceHash, args, kind, status, output, error,
|
|
34231
34835
|
startedAt, finishedAt, requestedByUserId, created_by, updated_by, apiEndpointId,
|
|
34232
|
-
sourceStepId, parentScriptRunId)
|
|
34233
|
-
VALUES (?, ?, ?, '', ?, ?, 'inline', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
34836
|
+
sourceStepId, parentScriptRunId, objectScriptId, objectId, objectMethod)
|
|
34837
|
+
VALUES (?, ?, ?, '', ?, ?, 'inline', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
34234
34838
|
RETURNING *`, [
|
|
34235
34839
|
data.id,
|
|
34236
34840
|
data.agentId,
|
|
@@ -34247,7 +34851,10 @@ async function recordInlineScriptRun2(data) {
|
|
|
34247
34851
|
data.createdBy ?? null,
|
|
34248
34852
|
data.apiEndpointId ?? null,
|
|
34249
34853
|
provenance?.sourceStepId ?? null,
|
|
34250
|
-
provenance?.sourceScriptRunId ?? null
|
|
34854
|
+
provenance?.sourceScriptRunId ?? null,
|
|
34855
|
+
data.objectScriptId ?? null,
|
|
34856
|
+
data.objectId ?? null,
|
|
34857
|
+
data.objectMethod ?? null
|
|
34251
34858
|
]);
|
|
34252
34859
|
if (!row)
|
|
34253
34860
|
throw new Error("Failed to record inline script run");
|
|
@@ -34263,20 +34870,8 @@ async function getScriptRunByIdempotencyKey2(idempotencyKey) {
|
|
|
34263
34870
|
return row ? rowToScriptRun(row) : null;
|
|
34264
34871
|
}
|
|
34265
34872
|
async function listScriptRuns2(opts) {
|
|
34266
|
-
const conditions =
|
|
34267
|
-
const params = [];
|
|
34268
|
-
if (opts?.status) {
|
|
34269
|
-
conditions.push("status = ?");
|
|
34270
|
-
params.push(opts.status);
|
|
34271
|
-
}
|
|
34272
|
-
if (opts?.agentId) {
|
|
34273
|
-
conditions.push("agentId = ?");
|
|
34274
|
-
params.push(opts.agentId);
|
|
34275
|
-
}
|
|
34276
|
-
if (opts?.scriptName) {
|
|
34277
|
-
conditions.push("scriptName = ?");
|
|
34278
|
-
params.push(opts.scriptName);
|
|
34279
|
-
}
|
|
34873
|
+
const { conditions, params: filterParams } = scriptRunFilterSql(opts);
|
|
34874
|
+
const params = [...filterParams];
|
|
34280
34875
|
const limit = opts?.limit ?? 50;
|
|
34281
34876
|
const offset = opts?.offset ?? 0;
|
|
34282
34877
|
params.push(limit, offset);
|
|
@@ -34293,27 +34888,17 @@ async function listScriptRuns2(opts) {
|
|
|
34293
34888
|
error,
|
|
34294
34889
|
last_heartbeat_at,
|
|
34295
34890
|
idempotencyKey,
|
|
34296
|
-
requestedByUserId
|
|
34891
|
+
requestedByUserId,
|
|
34892
|
+
objectScriptId,
|
|
34893
|
+
objectId,
|
|
34894
|
+
objectMethod
|
|
34297
34895
|
FROM script_runs ${where}
|
|
34298
34896
|
ORDER BY startedAt DESC
|
|
34299
34897
|
LIMIT ? OFFSET ?`, params);
|
|
34300
34898
|
return rows.map(rowToScriptRunListItem);
|
|
34301
34899
|
}
|
|
34302
34900
|
async function countScriptRuns2(opts) {
|
|
34303
|
-
const conditions =
|
|
34304
|
-
const params = [];
|
|
34305
|
-
if (opts?.status) {
|
|
34306
|
-
conditions.push("status = ?");
|
|
34307
|
-
params.push(opts.status);
|
|
34308
|
-
}
|
|
34309
|
-
if (opts?.agentId) {
|
|
34310
|
-
conditions.push("agentId = ?");
|
|
34311
|
-
params.push(opts.agentId);
|
|
34312
|
-
}
|
|
34313
|
-
if (opts?.scriptName) {
|
|
34314
|
-
conditions.push("scriptName = ?");
|
|
34315
|
-
params.push(opts.scriptName);
|
|
34316
|
-
}
|
|
34901
|
+
const { conditions, params } = scriptRunFilterSql(opts);
|
|
34317
34902
|
const where = conditions.length > 0 ? `WHERE ${conditions.join(" AND ")}` : "";
|
|
34318
34903
|
const row = await getDbClient2().get(`SELECT COUNT(*) AS count FROM script_runs ${where}`, params);
|
|
34319
34904
|
return row?.count ?? 0;
|
|
@@ -34491,6 +35076,7 @@ var init_db4 = __esm(() => {
|
|
|
34491
35076
|
init_workflow_idempotency();
|
|
34492
35077
|
init_workflow_run_definitions();
|
|
34493
35078
|
init_workflow_runs();
|
|
35079
|
+
init_read2();
|
|
34494
35080
|
init_scrub_json();
|
|
34495
35081
|
init_sealed_json();
|
|
34496
35082
|
init_secret_registry();
|
|
@@ -34504,9 +35090,11 @@ var init_db4 = __esm(() => {
|
|
|
34504
35090
|
init_approvals();
|
|
34505
35091
|
init_context_versions();
|
|
34506
35092
|
init_script_runs();
|
|
35093
|
+
init_script_runs();
|
|
34507
35094
|
init_session_moves();
|
|
34508
35095
|
init_skill_audit();
|
|
34509
35096
|
init_workflow_run_definitions();
|
|
35097
|
+
init_read2();
|
|
34510
35098
|
init_runtime2();
|
|
34511
35099
|
init_read();
|
|
34512
35100
|
init_write();
|
|
@@ -34514,7 +35102,7 @@ var init_db4 = __esm(() => {
|
|
|
34514
35102
|
configureAgentDependencies({
|
|
34515
35103
|
createLogEntry: (entry) => createLogEntry2(entry),
|
|
34516
35104
|
installSystemDefaultSkillsForAgent: (agentId) => installSystemDefaultSkillsForAgent2(agentId),
|
|
34517
|
-
resolvePendingImportAssignments: async (agent) => (await import("./pending-
|
|
35105
|
+
resolvePendingImportAssignments: async (agent) => (await import("./pending-2sxh1t6j.js")).resolvePendingImportAssignments(agent)
|
|
34518
35106
|
});
|
|
34519
35107
|
configureTaskWriteDependencies({
|
|
34520
35108
|
createLogEntry: (...args) => createLogEntry2(...args),
|
|
@@ -34564,4 +35152,4 @@ var init_db4 = __esm(() => {
|
|
|
34564
35152
|
};
|
|
34565
35153
|
});
|
|
34566
35154
|
|
|
34567
|
-
export { auditAssetKeys, init_asset_key_audit, CredentialBindingSchema, placeholderForConfigKey, CredentialBroker, defaultCredentialBindings, isPrivateAddress, assertUrlSafe, EgressDeniedError, createGuardedFetch, createSsrfGuardedFetch, parseEgressAllowlist, init_egress_guard, init_credential_broker, encryptSecret, decryptSecret, init_secrets_cipher, getEncryptionKey, init_key_bootstrap, init_crypto, withLoopPath, bindLoopPath, startEventLoopLagProbe, stopEventLoopLagProbe, init_event_loop_lag, DbTransactionDeadlineError, isInTransaction, init_db_client, breaksJsonValidity, scrubJsonValue, foldHexCopies, init_scrub_json, sealJson, openSealedJson, init_sealed_json, getPromptTemplateDefaultDrift, init_default_drift, init_templates2, init_templates3, wasDbCreatedThisBoot, isSqliteVecAvailable2, resolveSqliteVecExtensionPath2, __resetSqliteVecExtensionPathCacheForTests2, initDb2, getDb2, closeDb2, getDbClient2, init_runtime2, SessionCostConflictError2, insertSessionCost2, slackContextKey, chatSdkContextKey, chatThreadOfContextKey, agentmailContextKey, githubContextKey, gitlabContextKey, azureDevOpsContextKey, azureDevOpsWorkItemContextKey, bitbucketContextKey, linearContextKey, buildJiraContextKey, scheduleContextKey, workflowContextKey, agentContextKey, pageContextKey, APP_SESSION_KEY_PATTERN, appSessionContextKey, init_context_key, sessionSourceKey, sourceOfKey, SOURCE_GROUPS_READ_ONLY, sourceMoveError, init_source_key, TaskCreationBlockedError, TaskRoutingAuthorizationError, init_errors2, checkSlackRoutingCoherence, init_slack_routing, init_catalog, catalog_default, COMPANY_TEAM_SIZES, COMPANY_USE_CASES, USER_FUNCTIONS, reportedUseCase, reportedUserFunction, init_company_profile, mapTriggerSurface, init_telemetry_context, TELEMETRY_PROXY_ORIGIN, normalizeOrgWebsite, orgLogoUrl, isFilledOrgLogoUrl, init_org_website, beginRequestAuthScope, setRequestAuth, getRequestAuth, getCurrentRequestAuth, runWithoutRequestAuth, authUserId, authUser, isOperatorAuth, getCurrentRequestUserId, getCurrentRunProvenance, init_request_auth_context, setTelemetryIngestObserver, isTelemetryEnabled, _resolveIntegrationType, _resolveIntegrationProvider, initTelemetry, setTelemetryRoleResolver, setTelemetryFunctionResolver, isTelemetryReady, track, trackRelayed, telemetry, emitIntegrationConnected, init_telemetry, isRbacEnabled, decideAdmission, decideToolAdmission, grantLeadEquivalence, revokeLeadEquivalence, init_elevated_agents, LEGACY_RULES, setAuditSink, clearAuditSink, can, init_can, PermissionVerbSchema, init_rbac, randomChars, init_short_id, CHAT_SDK_ADAPTER_NAMES, CHAT_SDK_ADAPTER_SCHEMAS, ChatSdkAdaptersDraftSchema, firstIssueText, isAdapterEntryEnabled, init_schema, TELEMETRY_RANKING_KEY, PUBLIC_RANKING_ENABLED_KEY, RANKING_CATEGORIES, readTelemetryRanking, rankingFormSchema, buildListing, init_telemetry_ranking, resolveQuickJSPoolSize, init_quickjs_pool_config, SLACK_REACTION_DEFAULTS, SLACK_REACTION_CONFIG_KEYS, reactionName, isSlackIconConfigKey, reactionStatusIcon, iconPrefix, completedStatusIcon, init_reaction_shortcode, UI_SPEC_SCRIPT_ACTIONS_KEY, parseScriptActionAllowlist, init_script_allowlist, API_DRAINING_HEADER, API_DRAIN_MAX_MS_LIMIT, isApiDrainingResponse, init_api_drain2, isEnvExportRestrictedKey, init_config_env_export, parseEnabledTools, init_enabled_tools, parseFollowUpGateScheduleIds, isFollowUpGateScheduleId, init_follow_up_gate_schedule_ids, parseTaskToolManifest, CHAT_TASK_ONLY_TOOLS, isChatSdkTask, selectTaskTools, init_task_tool_manifest, tierConfigKey, init_model_tier_keys, isApiOnlyConfigKey, isInternalConfigKey, internalConfigKeyError, isHumanOnlyConfigKey, humanOnlyConfigKeyError, humanOnlyConfigKeyPageError, isReservedConfigKey, reservedKeyError, MAX_DB_RETENTION_DAYS, DB_RETENTION_TUNING_BOUNDS, APPS_JSON_COLUMN_MAX_BYTES_BOUNDS, CODEX_OAUTH_KEEP_WARM_MAX_AGE_HOURS_BOUNDS, SCHEDULER_INTERVAL_MS_BOUNDS, validateRuntimeTokenTtlHours, validateControllerTokenTtlDays, validateControllerGraceSec, validateConfigValue, validateConfigEntry, validateExportToEnv, init_swarm_config_guard, cachedUserRole, cachedUserFunction, invalidateTelemetryUserRole, configureOrgDomainPersistence, recomputeOrgDomain, scheduleOrgDomainRecompute, init_telemetry_identity, resolveTriggerSurface, emitTaskTelemetry, init_telemetry_trigger, MASKED_SECRET_VALUE, init_config_secrets, HeartbeatExpiryError, init_heartbeat_expiry, isEffectiveOutputSchema, init_output_schema, isRuntimePoolsEnabled, init_runtime_pools_flag, normalizeDate, normalizeDateRequired, init_date_utils, rowToAgent, updateAgentCredentialState2, updateAgentCredentialMissing2, AgentDeletedError2, isAgentDeleted2, createAgent2, getAgentById2, EXTENSION_AGENT_ROLE2, NOT_EXTENSION_AGENT_SQL2, isExtensionAgent2, extensionAgentAssignmentError2, ReservedAgentRoleError2, reservedRoleViolation2, ExtensionAgentAssignmentError2, getAllAgents2, getAgentStatusCounts2, getLeadAgent2, updateAgentStatus2, updateAgentMaxTasks2, updateAgentProvider2, setAgentHarnessProvider2, updateAgentCredStatus2, listAgentsWithCredStatusByProvider2, getAgentHarnessProviders2, updateAgentActivity2, MAX_EMPTY_POLLS2, incrementEmptyPollCount2, resetEmptyPollCount2, shouldBlockPolling2, deleteAgent2, getActiveTaskCount2, hasCapacity2, getRemainingCapacity2, updateAgentStatusFromCapacity2, isPoolAffinityEnforcementEnabled2, buildRoutingAffinityFromAgent2, isAgentEligibleForTask2, getAgentDailyTaskCounts2, init_agents, closeSlackTreeIfSettled, getSlackThreadsOfTasks, slackThreadHasBotReplySince, slackThreadHasOutcomeWork, observeSlackTreeVisibility, getSlackProcessingThreads, init_slack_trees, WorkflowReplayStateError, init_workflow_replay, getWorkflowRunTriggeredByAgentId, getWorkflowRunSummary, getWorkflowRunStepsSlimByRunId, WORKFLOW_RUN_TREE_MAX_DEPTH, WorkflowRunTreeError, getRunLineageBlock, getWorkflowRunTreeIds, getWorkflowRunStatus, getOpenWorkflowTreeTaskIds, getTaskIdsWithDependents, workflowRunTreeHasOpenWork, getWorkflowRunTree, cancelOpenWorkflowTreeSteps, disarmWorkflowTreeRetries, cancelLiveWorkflowTreeRuns, getChildWorkflowRunId, isParentStepAttemptCurrent, getRunningSubWorkflowSteps, getWorkflowRunParent, getWorkflowRunLineage, getSettledChildRunParentSteps, emitRunFinished, createForeachChildSteps, createForeachAttemptSteps, init_workflow_runs, OpenAI2, init_openai2, LEARNING_TTL_DAYS, LEARNING_DUPLICATE_MIN_SIMILARITY, CANDIDATE_SET_MULTIPLIER, isGraphExpansionEnabled, EMBEDDING_DIMENSIONS, init_constants2, LONGTERM_ROOT, LEARNINGS_ROOT, MEMORY_KEY_PATTERN, MEMORY_KEY_PATTERN_MESSAGE, MEMORY_KEY_MAX_LENGTH, isLongtermKey, longtermKeyError, isConsolidatedKey, consolidatedKeyMessage, resolveStoreKey, init_key_paths, computeScore, rerank, init_reranker, isReviewTaskId, dropReviewTaskCompletions, init_review_recall_filter, searchMemoryCandidates, init_search_candidates, memorySearchReader, init_search_reader, rowToCandidate, init_sqlite_store, getEmbeddingProvider2, resetEmbeddingProvider2, getMemoryStore2, init_memory, embeddingProvider2, computeScriptEmbedding2, writeScriptEmbedding2, embedScript2, searchScripts2, reembedAllScripts2, init_embeddings, upsertScriptByName, getScript, getGlobalScriptContentHashes, getScriptById, getScriptVersion, listScripts, listScriptVersions, deleteScript, touchScratchScriptLastUsed, restoreScratchScriptLastUsedIfUnchanged, createScriptApi, listScriptApisForScript, getScriptApiById, getScriptApiSecret, updateScriptApi, rotateScriptApiSecret, deleteScriptApi, recordScriptApiUsage, init_db3, oauthSecretName, registerStoredSecret, loadSecretRegistry, init_secret_registry, getDefaultAuthorizationIdForProvider, getOAuthApp, getOAuthAppById, getOAuthAppIdByProvider, createOAuthApp, updateOAuthAppById, upsertOAuthApp, listAuthorizationsForApp, getAuthorizationById, upsertAuthorization, updateAuthorizationTokens, updateAuthorizationIdentity, deleteAuthorizationById, deleteAuthorizationsForApp, createOAuthPending, consumeOAuthPending, gcOAuthPending, markAuthorizationRefreshFailed, hasOAuthTokens, getOAuthTokens, listAuthorizationSweepRows, listKeepAliveAuthorizations, deleteOAuthTokens, acquireOAuthRefreshLock, releaseOAuthRefreshLock, init_oauth, normalizeVcsRepo, vcsRepoName, vcsRepoUrlMatches, init_vcs_repo_match, taskModelPin, resumedTaskModelSelection, init_model_pin, normalizeModelKey, init_pricing_normalize, buildModelsDevSeedRows, seedPricingFromModelsDev, init_seed_pricing, buildCatalogEntries, replaceModelCatalog, touchModelCatalogCheckedAt, countModelCatalog, getModelCatalogMeta, updateModelCatalogMeta, upsertModelCatalogOverlay, deleteModelCatalogOverlay, expireMatchedOverlays, applyOverlayPricingRows, reloadModelsCatalog, loadModelsCatalog, init_model_catalog_store, listHarnessModelSupport, recordHarnessModelSupport, agentRanModel, getAgentHarnessCliVersion, setAgentHarnessCliVersion, init_harness_model_support, sanitizeModelTierOverrides, parseModelTierOverridesHeader, modelTierOverridesDiffer, setAgentModelTierOverrides, previewModelTiers, recordClaimModelResolution, init_model_tier_resolution, harnessModelErrorFor, poolTaskRunsOnHarness, explicitModelError, explicitModelErrorForAgent, init_model_validation2, runtimeReadsRepoSecrets, configPools, checkProfileForAgent, formatProfileCheckFailures, init_model_profile_check, startTaskSearchBackfill, stopTaskSearchBackfill, init_search_index, rowToAgentTask, getTaskById2, getChildTasks2, TASK_LINEAGE_LIMITS2, getTaskLineage2, hasNonTerminalResumeChild2, SUPERSEDED_RESUME_REPAIR_WINDOW_MS2, getSupersededTasksWithoutResume2, getSupersededTasksWithUnsettledDependents2, hasNonTerminalRerouteDecisionChild2, getTasksByAgentId2, getTasksDispatchedFrom2, getAgentCurrentTask2, getTasksByStatus2, findTaskByVcs2, findActiveTasksByVcs2, findTaskByGitHub2, readableSessionCondition, getAllTasks2, getTasksCount2, getTaskStats2, getCompletedSlackTasks2, getPendingSlackRelayTasks2, markSlackRelayAttempted2, markSlackRelayDelivered2, markFinalizedSlackRelaysDelivered2, getPendingChatRelayTasks2, giveUpStaleChatRelays2, markChatRelayAttempted2, recordChatRelayError2, markChatRelayDelivered2, markChatRelayGivenUp2, getRecentlyFinishedWorkerTasks2, markTasksNotified2, resetTasksNotified2, getInProgressSlackTasks2, getSlackTasksMissingTree2, getInProgressTasksByContextKey2, isLinearTrackerContextKey2, findExistingLinearTrackerContextWork2, getLatestTaskByContextKey2, getLatestScriptRunStepTaskByContextKey2, getAgentWorkingOnThread2, getLatestActiveTaskInThread2, getLatestLeadTaskInThread2, getAgentWorkingOnContextKey2, getLatestTaskByContextKeyPrefix2, getLatestActiveTaskByContextKey2, getLatestLeadTaskByContextKey2, getFirstTaskInThread2, getMostRecentTaskInThread2, findCompletedTasksInThread2, findRecentFailedTaskInThread2, countAgentDispatchesInThread2, findRecentCancelledTaskInThread2, init_read, MODEL_PROFILE_CONFIG_KEY, hasUnreadableCredentialAllowlist, listModelProfiles, getModelProfileByName, createModelProfile, updateModelProfile, TASK_HOLDS_PROFILE_SQL, repairWindowStart, modelProfileReferences, modelProfileRefError, isModelNameTakenError, deleteModelProfile, MAX_MODEL_PROFILE_FALLBACKS, modelProfileFallbacksError, taskProfileError, scheduleProfileUpdate, init_model_profiles, SESSION_ACTIVITY_REFRESH_MIN_INTERVAL_MS2, refreshActiveSessionOnActivity2, getActiveSessionById, init_active_sessions, STEERING_MOVED_ERROR, SteeringRequestError, SteeringBlockedError, isSteeringEnabled, getTaskSteeringFields, getTaskSteeringFieldsForTasks, promotePendingSteeringForTask, markSteeringUndeliverable, carryUnhandledSteering, requestSteering, init_steering2, onTaskStarted, init_task_lifecycle_events, listApprovalRequestSummaries2, getPendingApprovalVoteState2, recordApprovalVotes2, getPendingApprovalsForTasks2, approvalCancellationNotificationKey, listUndeliveredCancelledApprovalRequestIds, init_approvals, computeContentHash2, createContextVersion2, getLatestContextVersion2, getContextVersion2, getContextVersionHistory2, AssetKeyMovesBlockedError2, assertAssetKeyMovesAllowed2, moveTaskChainKeyInTx2, moveSessionChains, moveKeyFavorites, listPrefixRoots, listSharedPrefixRoots, init_session_moves, getSessionGroupKey, sessionSummaryQuery, getSessionReadState, getSessionTree, triageSessionList, init_session_tree, setHumanFreeQueueListener, reclassifyTaskHumanFree, drainHumanFreeReclassifyQueue, init_human_free, channelTopic, addWorkerSubscription, removeWorkerSubscription, listSubscribedWorkerAgents, init_channels, publishWorkerNudge, init_worker_nudges, createTask2, getPendingTaskForAgent2, assignUnassignedTaskPending2, startTask2, updateTaskClaudeSessionId2, recordTaskProviderIfUnset2, updateTaskTitle2, updateTaskTags2, setTaskTitleIfUnset2, completeTask2, failTask2, overwriteTerminalTaskResultText2, cancelTask2, skipTask2, supersedeTask2, markWorkflowStepTaskSuperseded2, settleSupersededTaskDependents2, backfillSupersedeTaskResumeTaskId2, pauseTask2, resumeTask2, getPausedTasksForAgent2, getOrphanedInProgressTasksForAgent2, resetOrphanedInProgressTasksForAgent2, getRecentlyCancelledTasksForAgent2, deleteTask2, updateTaskProgress2, init_write, quoteSqlIdentifier, USER_REFERENCE_COLUMNS_SQL, userReferenceRewriteSql, WORKFLOW_CONTEXT_REQUESTER_SQL, init_user_references, IdempotencyKeyTakenError, workflowRequestFingerprint, findAcceptedWorkflowOperation, assertWorkflowIdempotencyKeyUnused, recordAcceptedWorkflowOperation, init_workflow_idempotency, PINNED_WORKFLOW_KEYS2, toPinnedDefinition2, pinWorkflowDefinition2, getRunWorkflow2, deleteOrphanedRunDefinitions, init_workflow_run_definitions, recordKeySeatMismatch2, recordKeyValidation2, retirePoolKeyStatus, init_api_keys, getScriptRunExecutionArgs2, getScriptRunFollowUpGuard2, setScriptRunFollowUpGuard2, setSkillUpdatedBy2, literalPrefixPattern2, getSlackRenderV2ActivatedAt2, ensureSlackRenderV2Activation2, getSlackDelegationActivatedAt2, ensureSlackDelegationActivation2, isPendingSlackMessage2, isSettledSlackMessage2, recordSlackMessage2, reserveSlackMessage2, bindSlackMessageTimestamp2, updateSlackMessageRecord2, markSlackTreeRendered2, deleteSlackMessageRecord2, getSlackTreeMessage2, getSlackTreeMessageByThread2, getSlackOutcomeMessage2, getResolvableDeferralOutcomes2, markSlackDeferralResolved2, noteSlackOutcomeDeliveryFailure2, abandonSlackOutcomeDelivery2, getSlackTreeMessages2, getSlackMessageByChannelTs2, getSlackTasksInThread2, listSlackThreadsAwaitingHuman2, isSlackThreadAwaitingHuman2, markTaskSlackReplySent2, setSlackMessageTracking2, updateTaskVcs2, insertTaskAttachment2, recordTaskPullRequestAttachments2, getAssetKeyMappingByProvider2, upsertAssetKeyMapping2, getAssetKeyMapping2, listAssetSummaries2, moveAssetKey2, deleteTaskAttachment2, replaceTaskAttachment2, getTaskAttachments2, createSteeringMessage2, getSteeringMessagesForTask2, getSteeringMessageById2, getPendingSteeringForTask2, getPendingSteeringForAgent2, markSteeringDelivered2, markSteeringHandled2, markSteeringPromoted2, cancelPendingSteeringForTask2, hasPendingSteering2, getAgentWithTasks2, getAllAgentsWithTasks2, createLogEntry2, getLogsByAgentId2, getLogsByTaskId2, getLogsByTaskIdAndEventType2, getLogsByTaskIdChronological2, getLogsByEventType2, getAllLogs2, findRecentSimilarTasks2, createTaskExtended2, claimTask2, releaseTask2, acceptTask2, rejectTask2, moveTaskToBacklog2, moveTaskFromBacklog2, promoteDraftTask2, refreshDraftTaskLease2, promoteAbandonedDraftTasks2, releaseStaleReviewingTasks2, releaseStaleOfferedTasksForOfflineAgents2, getOfferedTasksForAgent2, claimOfferedTask2, getUnassignedTasksCount2, getUnassignedTaskIds2, getUnassignedTaskIdsForAgent2, checkDependencies2, getDependentTasks2, cascadeFailDependents2, updateAgentProfile2, updateAgentName2, createChannel2, getMessageById2, getChannelById2, getChannelByName2, getAllChannels2, deleteChannel2, postMessage2, getChannelMessages2, updateReadState2, getLastReadAt2, getUnreadMessages2, getMentionsForAgent2, getInboxSummary2, claimMentions2, releaseMentionProcessing2, releaseStaleMentionProcessing2, createService2, getServiceById2, getServiceByAgentAndName2, getServicesByAgentId2, getAllServices2, updateServiceStatus2, deleteService2, upsertService2, deleteServicesByAgentId2, createSessionLogs2, getSessionLogsByTaskId2, getSessionLogsBySession2, createSessionCost2, getSessionCostsByTaskId2, getSessionCostsByAgentId2, getAllSessionCosts2, getSessionCostsFiltered2, UNATTRIBUTED_USER_ID2, getSessionCostSummary2, getAttributionByPerson2, getDashboardCostSummary2, createInboxMessage2, getInboxMessageById2, getUnreadInboxMessages2, claimInboxMessages2, markInboxMessageRead2, markInboxMessageResponded2, markInboxMessageDelegated2, releaseStaleProcessingInbox2, getConcurrentContext2, getScheduledTasks2, getScheduledTaskById2, getScheduledTaskByName2, createScheduledTask2, updateScheduledTask2, deleteScheduledTask2, getDueScheduledTasks2, autoEncryptLegacyPlaintextSecrets2, maskSecrets2, getSwarmConfigs2, getInjectableGlobalConfigs2, getSwarmConfigById2, getSwarmConfigLookupById2, upsertSwarmConfig2, emitBuiltInIntegrationConnectedOnce2, deleteSwarmConfig2, deleteSwarmConfigByKey2, getResolvedConfig2, getSwarmRepos2, getSwarmRepoById2, getSwarmRepoByName2, getSwarmRepoByUrl2, createSwarmRepo2, updateSwarmRepo2, deleteSwarmRepo2, getAgentMailInboxMapping2, getAgentMailInboxMappingsByAgent2, getAllAgentMailInboxMappings2, createAgentMailInboxMapping2, deleteAgentMailInboxMapping2, findTaskByAgentMailThread2, insertActiveSession2, deleteActiveSession2, deleteActiveSessionById2, getActiveSessions2, heartbeatActiveSession2, cleanupStaleSessions2, cleanupAgentSessions2, updateActiveSessionProviderSessionId2, getActiveSessionForTask2, reassociateSessionLogs2, getStalledInProgressTasks2, getStalePinnedResumes2, failPendingResumeIfUnclaimed2, getIdleWorkersWithCapacity2, getUnassignedPoolTasks2, getStaleUnassignedAffinityTasks2, getRecentFailedTasks2, getRecentCompletedCount2, getRecentFailedCount2, createWorkflow2, getWorkflow2, listWorkflows2, updateWorkflow2, deleteWorkflow2, getWorkflowsByScheduleId2, createWorkflowRun2, getWorkflowRun2, updateWorkflowRun2, listWorkflowRuns2, countWorkflowRuns2, listWorkflowRunsPage2, createWorkflowRunStep2, getWorkflowRunStep2, updateWorkflowRunStep2, getWorkflowRunStepsByRunId2, getStuckWorkflowRuns2, getLastSuccessfulRun2, getLastRunStart2, getRetryableSteps2, getCompletedStepNodeIds2, getTaskByWorkflowRunStepId2, detachTaskFromWorkflowRunStep2, getStepByIdempotencyKey2, getStepCountForNode2, getLatestStepForNode2, getCurrentStepForNode2, createWorkflowVersion2, getWorkflowVersions2, getWorkflowVersion2, createAppVersion2, getAppVersions2, getAppVersion2, createPage2, getPage2, getPageBySlug2, getLatestPageBySlug2, listPagesByAgent2, listAllPages2, countAllPages2, countPagesByAgent2, updatePage2, deletePage2, incrementPageViewCount2, createPageVersion2, getPageVersions2, getPageVersion2, createMetric2, getMetric2, getMetricBySlug2, listMetricsByAgent2, listAllMetrics2, countAllMetrics2, countMetricsByAgent2, updateMetric2, deleteMetric2, createMetricVersion2, getMetricVersions2, getMetricVersion2, getPromptTemplates2, getPromptTemplateById2, upsertPromptTemplate2, deletePromptTemplate2, resetPromptTemplateToDefault2, getPromptTemplateHistory2, resolvePromptTemplate2, checkoutPromptTemplate2, getAllChannelActivityCursors2, getChannelActivityCursor2, upsertChannelActivityCursor2, createApprovalRequest2, getApprovalRequestById2, resolveApprovalRequest2, cancelApprovalRequestById2, cancelPendingApprovalRequestsForRun2, listCancelledApprovalRequestsForRun2, listCancelledApprovalRequestsForStep2, claimApprovalCancellationNotification2, completeApprovalCancellationNotificationClaim2, releaseApprovalCancellationNotificationClaim2, updateApprovalRequestNotifications2, listApprovalRequests2, getStuckApprovalRuns2, getApprovalRequestByStepId2, getExpiredPendingApprovals2, getStaleApprovalRequests2, createWaitState2, getWaitStateById2, getWaitStateByStepId2, getDueWaitStates2, getPendingEventWaitNames2, getPendingWaitsByEvent2, resolveWaitState2, getStuckWaitRuns2, SKILL_FILE_LIMITS2, normalizeSkillFilePath2, createSkill2, updateSkill2, listSkillFileManifest2, getSkillFiles2, getSkillFile2, upsertSkillFile2, upsertSkillFiles2, deleteSkillFile2, deleteSkill2, getSkillById2, getSkillByName2, listSkills2, searchSkills2, installSkill2, getSystemDefaultSkills2, installSystemDefaultSkillsForAgent2, uninstallSkill2, getAgentSkills2, toggleAgentSkill2, createMcpServer2, emitMcpServerConnectedTelemetry2, updateMcpServer2, deleteMcpServer2, getMcpServerById2, getMcpServerByName2, listMcpServers2, installMcpServer2, uninstallMcpServer2, getAgentMcpServers2, createContextSnapshot2, getContextSnapshotsByTaskId2, getContextSnapshotsBySessionId2, getContextSummaryByTaskId2, getAvailableKeyIndices2, recordKeyUsage2, setApiKeyPlan2, markKeyRateLimited2, recordKeyAuthFailure2, recordKeyRateLimitWindows2, setApiKeyName2, clearKeyRateLimit2, getKeyStatuses2, getKeyCostSummary2, getUserById2, getAllUsers2, createUser2, updateUser2, deleteUser2, listInboxState2, upsertInboxState2, listFavorites2, listUserFavorites2, getFavoriteItemIdSet2, setFavorite2, setUserFavorite2, withFavoriteFlags2, listTaskTemplates2, getRootTaskChain2, listRecentSessions2, countSessions2, getBudget2, getBudgets2, upsertBudget2, deleteBudget2, getAllPricingRows2, getPricingRows2, getActivePricingRow2, insertPricingRow2, deletePricingRow2, getDailySpendForAgent2, getDailySpendGlobal2, getDailySpendForUser2, recordBudgetRefusalNotification2, getBudgetRefusalNotification2, getRecentBudgetRefusalNotifications2, hasBudgetRefusalNotificationToday2, setBudgetRefusalFollowUpTaskId2, getLiveAgentCounts2, getReadyAgentCounts2, getInstanceActivity2, getSwarmMetrics2, hasFirstCompletedTask2, getKv2, sweepExpiredKv2, sweepExpiredKvPrefix2, upsertKv2, claimKv2, deleteKv2, KvTypeCollisionError2, incrKv2, kvPrefixUpperBound2, listKv2, countKv2, createScriptRun2, recordInlineScriptRun2, getScriptRun2, getScriptRunByIdempotencyKey2, listScriptRuns2, countScriptRuns2, countActiveScriptRuns2, updateScriptRun2, updateScriptRunIfNotTerminal2, updateScriptRunIfRunning2, getRunningScriptRuns2, getScriptRunJournalStep2, upsertScriptRunJournalStep2, listScriptRunJournalSteps2, countScriptRunJournalSteps2, countScriptRunJournalAgentTaskSteps2, exports_db, init_db4 };
|
|
35155
|
+
export { auditAssetKeys, init_asset_key_audit, CredentialBindingSchema, placeholderForConfigKey, CredentialBroker, defaultCredentialBindings, isPrivateAddress, assertUrlSafe, EgressDeniedError, createGuardedFetch, createSsrfGuardedFetch, parseEgressAllowlist, init_egress_guard, init_credential_broker, encryptSecret, decryptSecret, init_secrets_cipher, getEncryptionKey, init_key_bootstrap, init_crypto, withLoopPath, bindLoopPath, startEventLoopLagProbe, stopEventLoopLagProbe, init_event_loop_lag, DbTransactionDeadlineError, isInTransaction, init_db_client, breaksJsonValidity, scrubJsonValue, foldHexCopies, init_scrub_json, sealJson, openSealedJson, init_sealed_json, getPromptTemplateDefaultDrift, init_default_drift, init_templates2, init_templates3, wasDbCreatedThisBoot, isSqliteVecAvailable2, resolveSqliteVecExtensionPath2, __resetSqliteVecExtensionPathCacheForTests2, initDb2, getDb2, closeDb2, getDbClient2, init_runtime2, SessionCostConflictError2, insertSessionCost2, slackContextKey, chatSdkContextKey, chatThreadOfContextKey, agentmailContextKey, githubContextKey, gitlabContextKey, azureDevOpsContextKey, azureDevOpsWorkItemContextKey, bitbucketContextKey, linearContextKey, buildJiraContextKey, scheduleContextKey, workflowContextKey, agentContextKey, pageContextKey, APP_SESSION_KEY_PATTERN, appSessionContextKey, init_context_key, sessionSourceKey, sourceOfKey, SOURCE_GROUPS_READ_ONLY, sourceMoveError, init_source_key, TaskCreationBlockedError, TaskRoutingAuthorizationError, init_errors2, checkSlackRoutingCoherence, init_slack_routing, init_catalog, catalog_default, COMPANY_TEAM_SIZES, COMPANY_USE_CASES, USER_FUNCTIONS, reportedUseCase, reportedUserFunction, init_company_profile, mapTriggerSurface, init_telemetry_context, TELEMETRY_PROXY_ORIGIN, normalizeOrgWebsite, orgLogoUrl, isFilledOrgLogoUrl, init_org_website, beginRequestAuthScope, setRequestAuth, getRequestAuth, getCurrentRequestAuth, runWithoutRequestAuth, authUserId, authUser, isOperatorAuth, getCurrentRequestUserId, getCurrentRunProvenance, init_request_auth_context, setTelemetryIngestObserver, isTelemetryEnabled, _resolveIntegrationType, _resolveIntegrationProvider, initTelemetry, setTelemetryRoleResolver, setTelemetryFunctionResolver, isTelemetryReady, track, trackRelayed, telemetry, emitIntegrationConnected, init_telemetry, isRbacEnabled, decideAdmission, decideToolAdmission, grantLeadEquivalence, revokeLeadEquivalence, init_elevated_agents, LEGACY_RULES, setAuditSink, clearAuditSink, can, init_can, PermissionVerbSchema, init_rbac, randomChars, init_short_id, CHAT_SDK_ADAPTER_NAMES, CHAT_SDK_ADAPTER_SCHEMAS, ChatSdkAdaptersDraftSchema, firstIssueText, isAdapterEntryEnabled, init_schema, TELEMETRY_RANKING_KEY, PUBLIC_RANKING_ENABLED_KEY, RANKING_CATEGORIES, readTelemetryRanking, rankingFormSchema, buildListing, init_telemetry_ranking, resolveQuickJSPoolSize, init_quickjs_pool_config, SLACK_REACTION_DEFAULTS, SLACK_REACTION_CONFIG_KEYS, reactionName, isSlackIconConfigKey, reactionStatusIcon, iconPrefix, completedStatusIcon, init_reaction_shortcode, UI_SPEC_SCRIPT_ACTIONS_KEY, parseScriptActionAllowlist, init_script_allowlist, API_DRAINING_HEADER, API_DRAIN_MAX_MS_LIMIT, isApiDrainingResponse, init_api_drain2, isEnvExportRestrictedKey, init_config_env_export, isValidTimezone, formatDeferralDateTime, init_deferral_time, parseEnabledTools, init_enabled_tools, parseFollowUpGateScheduleIds, isFollowUpGateScheduleId, init_follow_up_gate_schedule_ids, parseTaskToolManifest, CHAT_TASK_ONLY_TOOLS, isChatSdkTask, selectTaskTools, init_task_tool_manifest, tierConfigKey, init_model_tier_keys, isApiOnlyConfigKey, isInternalConfigKey, internalConfigKeyError, isHumanOnlyConfigKey, humanOnlyConfigKeyError, humanOnlyConfigKeyPageError, isReservedConfigKey, reservedKeyError, MAX_DB_RETENTION_DAYS, DB_RETENTION_TUNING_BOUNDS, APPS_JSON_COLUMN_MAX_BYTES_BOUNDS, APPS_DEFINITION_LIMIT_BOUNDS, CODEX_OAUTH_KEEP_WARM_MAX_AGE_HOURS_BOUNDS, SCHEDULER_INTERVAL_MS_BOUNDS, validateRuntimeTokenTtlHours, validateControllerTokenTtlDays, validateControllerGraceSec, validateConfigValue, validateConfigEntry, validateExportToEnv, init_swarm_config_guard, cachedUserRole, cachedUserFunction, invalidateTelemetryUserRole, configureOrgDomainPersistence, recomputeOrgDomain, scheduleOrgDomainRecompute, init_telemetry_identity, resolveTriggerSurface, emitTaskTelemetry, init_telemetry_trigger, MASKED_SECRET_VALUE, init_config_secrets, HeartbeatExpiryError, init_heartbeat_expiry, isEffectiveOutputSchema, init_output_schema, isRuntimePoolsEnabled, init_runtime_pools_flag, normalizeDate, normalizeDateRequired, init_date_utils, rowToAgent, updateAgentCredentialState2, updateAgentCredentialMissing2, AgentDeletedError2, isAgentDeleted2, createAgent2, getAgentById2, EXTENSION_AGENT_ROLE2, NOT_EXTENSION_AGENT_SQL2, isExtensionAgent2, extensionAgentAssignmentError2, ReservedAgentRoleError2, reservedRoleViolation2, ExtensionAgentAssignmentError2, getAllAgents2, getAgentStatusCounts2, getLeadAgent2, updateAgentStatus2, updateAgentMaxTasks2, updateAgentProvider2, setAgentHarnessProvider2, updateAgentCredStatus2, listAgentsWithCredStatusByProvider2, getAgentHarnessProviders2, updateAgentActivity2, MAX_EMPTY_POLLS2, incrementEmptyPollCount2, resetEmptyPollCount2, shouldBlockPolling2, deleteAgent2, getActiveTaskCount2, hasCapacity2, getRemainingCapacity2, updateAgentStatusFromCapacity2, isPoolAffinityEnforcementEnabled2, buildRoutingAffinityFromAgent2, isAgentEligibleForTask2, getAgentDailyTaskCounts2, init_agents, closeSlackTreeIfSettled, getSlackThreadsOfTasks, slackThreadHasBotReplySince, slackThreadHasAgentReplyOnTasksSince, slackThreadHasOutcomeWork, observeSlackTreeVisibility, getSlackProcessingThreads, init_slack_trees, WorkflowReplayStateError, init_workflow_replay, getWorkflowRunTriggeredByAgentId, getWorkflowRunSummary, getWorkflowRunStepsSlimByRunId, WORKFLOW_RUN_TREE_MAX_DEPTH, WorkflowRunTreeError, getRunLineageBlock, getWorkflowRunTreeIds, getWorkflowRunStatus, getOpenWorkflowTreeTaskIds, getTaskIdsWithDependents, workflowRunTreeHasOpenWork, getWorkflowRunTree, cancelOpenWorkflowTreeSteps, disarmWorkflowTreeRetries, cancelLiveWorkflowTreeRuns, getChildWorkflowRunId, isParentStepAttemptCurrent, getRunningSubWorkflowSteps, getWorkflowRunParent, getWorkflowRunLineage, getSettledChildRunParentSteps, emitRunFinished, createForeachChildSteps, createForeachAttemptSteps, init_workflow_runs, OpenAI2, init_openai2, generateRandomCodeVerifier, generateRandomState, calculatePKCECodeChallenge, init_build, isInvalidClientError, publicEndpointSsrfOptions, mcpOAuthSsrfOptions, discoverProtectedResourceMetadata, discoverAuthorizationServerMetadata, normalizeTokenEndpointAuthMethod, resolveAdvertisedTokenEndpointAuthMethod, authMethodForStoredClient, selectDcrTokenEndpointAuthMethod, registerClient, buildAuthorizeUrl, exchangeCodeForTokens, refreshMcpToken, revokeMcpToken, computeExpiresAt, init_mcp_wrapper, LEARNING_TTL_DAYS, LEARNING_DUPLICATE_MIN_SIMILARITY, CANDIDATE_SET_MULTIPLIER, isGraphExpansionEnabled, EMBEDDING_DIMENSIONS, init_constants2, LONGTERM_ROOT, LEARNINGS_ROOT, MEMORY_KEY_PATTERN, MEMORY_KEY_PATTERN_MESSAGE, MEMORY_KEY_MAX_LENGTH, isLongtermKey, longtermKeyError, isConsolidatedKey, consolidatedKeyMessage, resolveStoreKey, init_key_paths, computeScore, rerank, init_reranker, isReviewTaskId, dropReviewTaskCompletions, init_review_recall_filter, searchMemoryCandidates, init_search_candidates, memorySearchReader, init_search_reader, rowToCandidate, init_sqlite_store, getEmbeddingProvider2, resetEmbeddingProvider2, getMemoryStore2, setDeploymentEnvReader2, embeddingEndpoint2, init_memory, embeddingProvider2, computeScriptEmbedding2, writeScriptEmbedding2, embedScript2, searchScripts2, reembedAllScripts2, init_embeddings, upsertScriptByName, getScript, getGlobalScriptContentHashes, getScriptById, getScriptVersion, listScripts, listScriptVersions, deleteScript, touchScratchScriptLastUsed, restoreScratchScriptLastUsedIfUnchanged, createScriptApi, listScriptApisForScript, getScriptApiById, getScriptApiSecret, updateScriptApi, rotateScriptApiSecret, deleteScriptApi, recordScriptApiUsage, init_db3, oauthSecretName, registerStoredSecret, loadSecretRegistry, init_secret_registry, getDefaultAuthorizationIdForProvider, getOAuthApp, getOAuthAppById, getOAuthAppIdByProvider, createOAuthApp, updateOAuthAppById, upsertOAuthApp, listAuthorizationsForApp, getAuthorizationById, upsertAuthorization, updateAuthorizationTokens, updateAuthorizationIdentity, deleteAuthorizationById, deleteAuthorizationsForApp, createOAuthPending, consumeOAuthPending, gcOAuthPending, markAuthorizationRefreshFailed, hasOAuthTokens, getOAuthTokens, listAuthorizationSweepRows, listKeepAliveAuthorizations, deleteOAuthTokens, acquireOAuthRefreshLock, releaseOAuthRefreshLock, init_oauth, normalizeVcsRepo, vcsRepoName, vcsRepoUrlMatches, init_vcs_repo_match, taskModelPin, resumedTaskModelSelection, init_model_pin, normalizeModelKey, init_pricing_normalize, buildModelsDevSeedRows, seedPricingFromModelsDev, init_seed_pricing, buildCatalogEntries, replaceModelCatalog, touchModelCatalogCheckedAt, countModelCatalog, getModelCatalogMeta, updateModelCatalogMeta, upsertModelCatalogOverlay, deleteModelCatalogOverlay, expireMatchedOverlays, applyOverlayPricingRows, reloadModelsCatalog, loadModelsCatalog, init_model_catalog_store, listHarnessModelSupport, recordHarnessModelSupport, agentRanModel, getAgentHarnessCliVersion, setAgentHarnessCliVersion, init_harness_model_support, sanitizeModelTierOverrides, parseModelTierOverridesHeader, modelTierOverridesDiffer, setAgentModelTierOverrides, previewModelTiers, recordClaimModelResolution, init_model_tier_resolution, harnessModelErrorFor, poolTaskRunsOnHarness, explicitModelError, explicitModelErrorForAgent, init_model_validation2, runtimeReadsRepoSecrets, vcsRepoId, configPools, checkProfileForAgent, formatProfileCheckFailures, init_model_profile_check, startTaskSearchBackfill, stopTaskSearchBackfill, init_search_index, rowToAgentTask, getTaskById2, getChildTasks2, TASK_LINEAGE_LIMITS2, getTaskLineage2, hasNonTerminalResumeChild2, SUPERSEDED_RESUME_REPAIR_WINDOW_MS2, getSupersededTasksWithoutResume2, getSupersededTasksWithUnsettledDependents2, hasNonTerminalRerouteDecisionChild2, getTasksByAgentId2, getTasksDispatchedFrom2, getAgentCurrentTask2, getTasksByStatus2, findTaskByVcs2, findActiveTasksByVcs2, findTaskByGitHub2, readableSessionCondition, getAllTasks2, getTasksCount2, getTaskStats2, getCompletedSlackTasks2, getPendingSlackRelayTasks2, markSlackRelayAttempted2, markSlackRelayDelivered2, markFinalizedSlackRelaysDelivered2, getPendingChatRelayTasks2, giveUpStaleChatRelays2, markChatRelayAttempted2, recordChatRelayError2, markChatRelayDelivered2, markChatRelayGivenUp2, getRecentlyFinishedWorkerTasks2, markTasksNotified2, resetTasksNotified2, getInProgressSlackTasks2, getSlackTasksMissingTree2, getInProgressTasksByContextKey2, isLinearTrackerContextKey2, findExistingLinearTrackerContextWork2, getLatestTaskByContextKey2, getLatestScriptRunStepTaskByContextKey2, getAgentWorkingOnThread2, getLatestActiveTaskInThread2, getLatestLeadTaskInThread2, getAgentWorkingOnContextKey2, getLatestTaskByContextKeyPrefix2, getLatestActiveTaskByContextKey2, getLatestLeadTaskByContextKey2, getFirstTaskInThread2, getMostRecentTaskInThread2, findCompletedTasksInThread2, findRecentFailedTaskInThread2, countAgentDispatchesInThread2, findRecentCancelledTaskInThread2, init_read, MODEL_PROFILE_CONFIG_KEY, hasUnreadableCredentialAllowlist, listModelProfiles, getModelProfileByName, createModelProfile, updateModelProfile, TASK_HOLDS_PROFILE_SQL, repairWindowStart, modelProfileReferences, modelProfileRefError, isModelNameTakenError, deleteModelProfile, MAX_MODEL_PROFILE_FALLBACKS, modelProfileFallbacksError, taskProfileError, scheduleProfileUpdate, init_model_profiles, SESSION_ACTIVITY_REFRESH_MIN_INTERVAL_MS2, refreshActiveSessionOnActivity2, getActiveSessionById, init_active_sessions, STEERING_MOVED_ERROR, SteeringRequestError, SteeringBlockedError, isSteeringEnabled, getTaskSteeringFields, getTaskSteeringFieldsForTasks, promotePendingSteeringForTask, markSteeringUndeliverable, carryUnhandledSteering, requestSteering, init_steering2, onTaskStarted, init_task_lifecycle_events, listApprovalRequestSummaries2, getPendingApprovalVoteState2, recordApprovalVotes2, getPendingApprovalsForTasks2, approvalCancellationNotificationKey, listUndeliveredCancelledApprovalRequestIds, init_approvals, computeContentHash2, createContextVersion2, getLatestContextVersion2, getContextVersion2, getContextVersionHistory2, AssetKeyMovesBlockedError2, assertAssetKeyMovesAllowed2, moveTaskChainKeyInTx2, moveSessionChains, moveKeyFavorites, listPrefixRoots, listSharedPrefixRoots, init_session_moves, getSessionGroupKey, sessionSummaryQuery, getSessionReadState, getSessionTree, triageSessionList, init_session_tree, setHumanFreeQueueListener, reclassifyTaskHumanFree, drainHumanFreeReclassifyQueue, init_human_free, channelTopic, addWorkerSubscription, removeWorkerSubscription, listSubscribedWorkerAgents, init_channels, publishWorkerNudge, init_worker_nudges, createTask2, getPendingTaskForAgent2, assignUnassignedTaskPending2, startTask2, updateTaskClaudeSessionId2, recordTaskProviderIfUnset2, updateTaskTitle2, updateTaskTags2, setTaskTitleIfUnset2, completeTask2, failTask2, overwriteTerminalTaskResultText2, cancelTask2, skipTask2, supersedeTask2, markWorkflowStepTaskSuperseded2, settleSupersededTaskDependents2, backfillSupersedeTaskResumeTaskId2, pauseTask2, resumeTask2, getPausedTasksForAgent2, getOrphanedInProgressTasksForAgent2, resetOrphanedInProgressTasksForAgent2, getRecentlyCancelledTasksForAgent2, deleteTask2, updateTaskProgress2, init_write, quoteSqlIdentifier, USER_REFERENCE_COLUMNS_SQL, userReferenceRewriteSql, WORKFLOW_CONTEXT_REQUESTER_SQL, init_user_references, IdempotencyKeyTakenError, sha256, workflowRequestFingerprint, requestFingerprint, findAcceptedWorkflowOperation, assertWorkflowIdempotencyKeyUnused, recordAcceptedWorkflowOperation, init_workflow_idempotency, PINNED_WORKFLOW_KEYS2, toPinnedDefinition2, pinWorkflowDefinition2, getRunWorkflow2, deleteOrphanedRunDefinitions, init_workflow_run_definitions, getWorkflowsByEventName2, recordKeySeatMismatch2, recordKeyValidation2, retirePoolKeyStatus, init_api_keys, getScriptRunExecutionArgs2, getScriptRunFollowUpGuard2, setScriptRunFollowUpGuard2, setSkillUpdatedBy2, literalPrefixPattern2, getSlackRenderV2ActivatedAt2, ensureSlackRenderV2Activation2, getSlackDelegationActivatedAt2, ensureSlackDelegationActivation2, isPendingSlackMessage2, isSettledSlackMessage2, recordSlackMessage2, reserveSlackMessage2, bindSlackMessageTimestamp2, updateSlackMessageRecord2, markSlackTreeRendered2, deleteSlackMessageRecord2, getSlackTreeMessage2, getSlackTreeMessageByThread2, getSlackOutcomeMessage2, getResolvableDeferralOutcomes2, markSlackDeferralResolved2, noteSlackOutcomeDeliveryFailure2, abandonSlackOutcomeDelivery2, getSlackTreeMessages2, getSlackMessageByChannelTs2, getSlackTasksInThread2, listSlackThreadsAwaitingHuman2, isSlackThreadAwaitingHuman2, markTaskSlackReplySent2, setSlackMessageTracking2, updateTaskVcs2, insertTaskAttachment2, recordTaskPullRequestAttachments2, getAssetKeyMappingByProvider2, upsertAssetKeyMapping2, getAssetKeyMapping2, listAssetSummaries2, moveAssetKey2, deleteTaskAttachment2, replaceTaskAttachment2, getTaskAttachments2, createSteeringMessage2, getSteeringMessagesForTask2, getSteeringMessageById2, getPendingSteeringForTask2, getPendingSteeringForAgent2, markSteeringDelivered2, markSteeringHandled2, markSteeringPromoted2, cancelPendingSteeringForTask2, hasPendingSteering2, getAgentWithTasks2, getAllAgentsWithTasks2, createLogEntry2, getLogsByAgentId2, getLogsByTaskId2, getLogsByTaskIdAndEventType2, getLogsByTaskIdChronological2, getLogsByEventType2, getAllLogs2, findRecentSimilarTasks2, createTaskExtended2, claimTask2, releaseTask2, acceptTask2, rejectTask2, moveTaskToBacklog2, moveTaskFromBacklog2, promoteDraftTask2, refreshDraftTaskLease2, promoteAbandonedDraftTasks2, releaseStaleReviewingTasks2, releaseStaleOfferedTasksForOfflineAgents2, getOfferedTasksForAgent2, claimOfferedTask2, getUnassignedTasksCount2, getUnassignedTaskIds2, getUnassignedTaskIdsForAgent2, checkDependencies2, getDependentTasks2, cascadeFailDependents2, updateAgentProfile2, updateAgentName2, createChannel2, getMessageById2, getChannelById2, getChannelByName2, getAllChannels2, deleteChannel2, postMessage2, getChannelMessages2, updateReadState2, getLastReadAt2, getUnreadMessages2, getMentionsForAgent2, getInboxSummary2, claimMentions2, releaseMentionProcessing2, releaseStaleMentionProcessing2, createService2, getServiceById2, getServiceByAgentAndName2, getServicesByAgentId2, getAllServices2, updateServiceStatus2, deleteService2, upsertService2, deleteServicesByAgentId2, createSessionLogs2, getSessionLogsByTaskId2, getSessionLogsBySession2, createSessionCost2, getSessionCostsByTaskId2, getSessionCostsByAgentId2, getAllSessionCosts2, getSessionCostsFiltered2, UNATTRIBUTED_USER_ID2, getSessionCostSummary2, getAttributionByPerson2, getDashboardCostSummary2, createInboxMessage2, getInboxMessageById2, getUnreadInboxMessages2, claimInboxMessages2, markInboxMessageRead2, markInboxMessageResponded2, markInboxMessageDelegated2, releaseStaleProcessingInbox2, getConcurrentContext2, getScheduledTasks2, getScheduledTaskById2, getScheduledTaskByName2, createScheduledTask2, updateScheduledTask2, deleteScheduledTask2, getDueScheduledTasks2, autoEncryptLegacyPlaintextSecrets2, maskSecrets2, getSwarmConfigs2, getInjectableGlobalConfigs2, getSwarmConfigById2, getSwarmConfigLookupById2, upsertSwarmConfig2, emitBuiltInIntegrationConnectedOnce2, deleteSwarmConfig2, deleteSwarmConfigByKey2, getResolvedConfig2, getSwarmRepos2, getSwarmRepoById2, getSwarmRepoByName2, getSwarmRepoByUrl2, createSwarmRepo2, updateSwarmRepo2, deleteSwarmRepo2, getAgentMailInboxMapping2, getAgentMailInboxMappingsByAgent2, getAllAgentMailInboxMappings2, createAgentMailInboxMapping2, deleteAgentMailInboxMapping2, findTaskByAgentMailThread2, insertActiveSession2, deleteActiveSession2, deleteActiveSessionById2, getActiveSessions2, heartbeatActiveSession2, cleanupStaleSessions2, cleanupAgentSessions2, updateActiveSessionProviderSessionId2, getActiveSessionForTask2, reassociateSessionLogs2, getStalledInProgressTasks2, getStalePinnedResumes2, failPendingResumeIfUnclaimed2, getIdleWorkersWithCapacity2, getUnassignedPoolTasks2, getStaleUnassignedAffinityTasks2, getRecentFailedTasks2, getRecentCompletedCount2, getRecentFailedCount2, createWorkflow2, getWorkflow2, listWorkflows2, updateWorkflow2, deleteWorkflow2, getWorkflowsByScheduleId2, createWorkflowRun2, getWorkflowRun2, updateWorkflowRun2, listWorkflowRuns2, countWorkflowRuns2, listWorkflowRunsPage2, createWorkflowRunStep2, getWorkflowRunStep2, updateWorkflowRunStep2, getWorkflowRunStepsByRunId2, getStuckWorkflowRuns2, getLastSuccessfulRun2, getLastRunStart2, getRetryableSteps2, getCompletedStepNodeIds2, getTaskByWorkflowRunStepId2, detachTaskFromWorkflowRunStep2, getStepByIdempotencyKey2, getStepCountForNode2, getLatestStepForNode2, getCurrentStepForNode2, createWorkflowVersion2, getWorkflowVersions2, getWorkflowVersion2, createAppVersion2, getAppVersions2, getAppVersion2, createPage2, getPage2, getPageBySlug2, getLatestPageBySlug2, listPagesByAgent2, listAllPages2, countAllPages2, countPagesByAgent2, updatePage2, deletePage2, incrementPageViewCount2, createPageVersion2, getPageVersions2, getPageVersion2, createMetric2, getMetric2, getMetricBySlug2, listMetricsByAgent2, listAllMetrics2, countAllMetrics2, countMetricsByAgent2, updateMetric2, deleteMetric2, createMetricVersion2, getMetricVersions2, getMetricVersion2, getPromptTemplates2, getPromptTemplateById2, upsertPromptTemplate2, deletePromptTemplate2, resetPromptTemplateToDefault2, getPromptTemplateHistory2, resolvePromptTemplate2, checkoutPromptTemplate2, getAllChannelActivityCursors2, getChannelActivityCursor2, upsertChannelActivityCursor2, createApprovalRequest2, getApprovalRequestById2, resolveApprovalRequest2, cancelApprovalRequestById2, cancelPendingApprovalRequestsForRun2, listCancelledApprovalRequestsForRun2, listCancelledApprovalRequestsForStep2, claimApprovalCancellationNotification2, completeApprovalCancellationNotificationClaim2, releaseApprovalCancellationNotificationClaim2, updateApprovalRequestNotifications2, listApprovalRequests2, getStuckApprovalRuns2, getApprovalRequestByStepId2, getExpiredPendingApprovals2, getStaleApprovalRequests2, createWaitState2, getWaitStateById2, getWaitStateByStepId2, getDueWaitStates2, getPendingEventWaitNames2, getPendingWaitsByEvent2, resolveWaitState2, getStuckWaitRuns2, SKILL_FILE_LIMITS2, normalizeSkillFilePath2, createSkill2, updateSkill2, listSkillFileManifest2, getSkillFiles2, getSkillFile2, upsertSkillFile2, upsertSkillFiles2, deleteSkillFile2, deleteSkill2, getSkillById2, getSkillByName2, listSkills2, searchSkills2, installSkill2, getSystemDefaultSkills2, installSystemDefaultSkillsForAgent2, uninstallSkill2, getAgentSkills2, toggleAgentSkill2, createMcpServer2, emitMcpServerConnectedTelemetry2, updateMcpServer2, deleteMcpServer2, getMcpServerById2, getMcpServerByName2, listMcpServers2, installMcpServer2, uninstallMcpServer2, getAgentMcpServers2, createContextSnapshot2, getContextSnapshotsByTaskId2, getContextSnapshotsBySessionId2, getContextSummaryByTaskId2, getAvailableKeyIndices2, recordKeyUsage2, setApiKeyPlan2, markKeyRateLimited2, recordKeyAuthFailure2, recordKeyRateLimitWindows2, setApiKeyName2, clearKeyRateLimit2, getKeyStatuses2, getKeyCostSummary2, getUserById2, getAllUsers2, createUser2, updateUser2, deleteUser2, listInboxState2, upsertInboxState2, listFavorites2, listUserFavorites2, getFavoriteItemIdSet2, setFavorite2, setUserFavorite2, withFavoriteFlags2, listTaskTemplates2, getRootTaskChain2, listRecentSessions2, countSessions2, getBudget2, getBudgets2, upsertBudget2, deleteBudget2, getAllPricingRows2, getPricingRows2, getActivePricingRow2, insertPricingRow2, deletePricingRow2, getDailySpendForAgent2, getDailySpendGlobal2, getDailySpendForUser2, recordBudgetRefusalNotification2, getBudgetRefusalNotification2, getRecentBudgetRefusalNotifications2, hasBudgetRefusalNotificationToday2, setBudgetRefusalFollowUpTaskId2, getLiveAgentCounts2, getReadyAgentCounts2, getInstanceActivity2, getSwarmMetrics2, hasFirstCompletedTask2, getKv2, sweepExpiredKv2, sweepExpiredKvPrefix2, upsertKv2, claimKv2, deleteKv2, KvTypeCollisionError2, incrKv2, kvPrefixUpperBound2, listKv2, countKv2, createScriptRun2, recordInlineScriptRun2, getScriptRun2, getScriptRunByIdempotencyKey2, listScriptRuns2, countScriptRuns2, countActiveScriptRuns2, updateScriptRun2, updateScriptRunIfNotTerminal2, updateScriptRunIfRunning2, getRunningScriptRuns2, getScriptRunJournalStep2, upsertScriptRunJournalStep2, listScriptRunJournalSteps2, countScriptRunJournalSteps2, countScriptRunJournalAgentTaskSteps2, exports_db, init_db4 };
|