@desplega.ai/agent-swarm 2.13.4 → 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-zrk9k0n7.js → acp-targets-23exz4z4.js} +10 -10
- package/dist/{actions-acqqj9jn.js → actions-zcr25x27.js} +61 -40
- package/dist/{agent-fs-provision-zmaykqnd.js → agent-fs-provision-7fa9e12e.js} +4 -4
- package/dist/{amp-adapter-a7ts8tmw.js → amp-adapter-s7ytmv6b.js} +3 -3
- package/dist/{anthropic-messages-88b7s3n9.js → anthropic-messages-vdd1zmha.js} +10 -10
- package/dist/{app-tmwa442h.js → app-5d3sz1hy.js} +7 -7
- package/dist/{approval-notifications-6psaaaye.js → approval-notifications-7qgkzkzx.js} +8 -8
- package/dist/{assistant-564v6emv.js → assistant-p2yvhc3j.js} +37 -32
- package/dist/{boot-args-schema-n099e0f2.js → boot-args-schema-ry6cb0p7.js} +1 -1
- package/dist/{boot-reembed-epvg4fp9.js → boot-reembed-2hkm3vz2.js} +1 -1
- package/dist/{boot-reembed-chx66qfk.js → boot-reembed-c9643ms3.js} +1 -1
- package/dist/{boot-scrub-sweep-dhkfp0a7.js → boot-scrub-sweep-3ycxr51t.js} +2 -2
- package/dist/{boot-seeds-m74fc07r.js → boot-seeds-2hzvvzg0.js} +4 -4
- package/dist/{boxd-451q55ys.js → boxd-9py3x0jb.js} +2 -2
- package/dist/{claude-adapter-hw63yj3j.js → claude-adapter-dnkww93e.js} +9 -9
- package/dist/{claude-managed-adapter-z5s7fx6p.js → claude-managed-adapter-yk0cr5x6.js} +4 -4
- package/dist/{claude-managed-setup-wee1762m.js → claude-managed-setup-4byxpp47.js} +5 -5
- package/dist/{claude-sdk-session-cktyqkpk.js → claude-sdk-session-4wf3dbvs.js} +13163 -12195
- package/dist/{cli-5rxsb3wq.js → cli-096aftq6.js} +12 -7
- package/dist/{cli-5rgm8p39.js → cli-0e914dp9.js} +3 -3
- package/dist/{cli-bzcwwebm.js → cli-0h6m6z5g.js} +1 -1
- package/dist/{cli-cah298e5.js → cli-0k7ppk9k.js} +231 -124
- package/dist/{cli-ja450998.js → cli-1nfabrt4.js} +8 -8
- package/dist/{cli-jzerrzgc.js → cli-2414h5r9.js} +8 -8
- package/dist/{cli-b768ek79.js → cli-24wervhz.js} +38 -0
- package/dist/{cli-93n305hm.js → cli-2ayk9gn8.js} +2 -2
- package/dist/{cli-kr0jpw9c.js → cli-2ckwgs7q.js} +1 -1
- package/dist/{cli-d5pc8ep0.js → cli-2savn6mm.js} +11 -100
- package/dist/{cli-jbrc98qb.js → cli-2zjxake1.js} +4 -4
- package/dist/{cli-4q2c8rxw.js → cli-37p61fcg.js} +15 -9
- package/dist/{cli-2vp0z049.js → cli-39t9d248.js} +1 -1
- package/dist/{cli-sa02jsqt.js → cli-3mhdmcd4.js} +1 -1
- package/dist/{cli-x2cem5vy.js → cli-3wsabyt0.js} +2 -2
- package/dist/{cli-dqgnbnxs.js → cli-466jjrwe.js} +16 -2
- package/dist/{cli-zhwjdhjr.js → cli-6ajyhxh7.js} +2 -2
- package/dist/{cli-3bxrrh53.js → cli-6yy4fepf.js} +4 -4
- package/dist/{cli-hhtbandk.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-m1sns1da.js → cli-7w1fs01q.js} +2 -2
- package/dist/{cli-xwsm6xkr.js → cli-84wxwt3z.js} +1 -1
- package/dist/{cli-qzz6tz8s.js → cli-84xn7bgz.js} +1 -1
- package/dist/{cli-49aq3cyn.js → cli-879txsac.js} +5 -5
- package/dist/{cli-bv4vvnmg.js → cli-8vbxjzk0.js} +3 -3
- package/dist/{cli-7by7vp6m.js → cli-91amj3md.js} +3 -3
- package/dist/{cli-60dwk8tx.js → cli-930zbczq.js} +3 -3
- package/dist/{cli-7g3fg4gf.js → cli-9fwznq4p.js} +10 -10
- package/dist/{cli-4pbwg7sn.js → cli-9j1t3kf6.js} +2 -2
- package/dist/{cli-tzw1jr2t.js → cli-9j47sgzy.js} +2 -2
- package/dist/{cli-0fgvnb0x.js → cli-ad00h1st.js} +7 -7
- package/dist/{cli-kj84fqxz.js → cli-adzmmcvf.js} +19 -7
- package/dist/{cli-3tzmh38q.js → cli-ayxxkk3p.js} +68 -25
- package/dist/{cli-4vynxtrb.js → cli-bqfx72e6.js} +10 -3
- package/dist/{cli-8cas2xvp.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-jg5txpm6.js → cli-dy754erz.js} +83 -1
- package/dist/{cli-tsc3pdfd.js → cli-edxfzgah.js} +4 -4
- package/dist/{cli-hyqksecw.js → cli-ejnhs815.js} +15 -15
- package/dist/{cli-k0nebh10.js → cli-enavhq6r.js} +1 -1
- package/dist/{cli-ea7nz50q.js → cli-f2rwt43y.js} +14 -14
- package/dist/{cli-zjdhrzm0.js → cli-f9g96z28.js} +8 -8
- package/dist/{cli-rmgvwcmy.js → cli-fww016hh.js} +534 -70
- package/dist/{cli-rv3y60bt.js → cli-g6a696c0.js} +4 -4
- package/dist/{cli-z1vam71h.js → cli-gc6b94tj.js} +2 -2
- package/dist/{cli-p436yrzp.js → cli-gcyws2bp.js} +2 -2
- package/dist/{cli-srktrbby.js → cli-hzhv7yac.js} +1 -1
- package/dist/{cli-0p76my9q.js → cli-jcnc5ret.js} +44 -32
- package/dist/{cli-tr19nyn9.js → cli-jgq9xptq.js} +7 -7
- package/dist/{cli-pz1dp12c.js → cli-jwnac23b.js} +1 -1
- package/dist/{cli-904wk98s.js → cli-kc7vd07m.js} +917 -350
- package/dist/{cli-t0jmkcah.js → cli-kg63yp1r.js} +14 -14
- package/dist/{cli-ts5yv7dn.js → cli-krk8y8c7.js} +835 -157
- package/dist/{cli-jyhbvdga.js → cli-m0ea8ggd.js} +8 -10
- package/dist/{cli-944w9wb4.js → cli-md4tn21h.js} +20 -15
- package/dist/{cli-zexwhj3f.js → cli-mv8ft7b0.js} +10 -9
- package/dist/{cli-phdzn699.js → cli-mw1tmn3x.js} +217 -27
- package/dist/{cli-5ashycw3.js → cli-njvpngc6.js} +3 -3
- package/dist/{cli-9ah37a8a.js → cli-phe2vcw5.js} +10 -7
- package/dist/{cli-eds5xnsz.js → cli-phmy14hb.js} +2 -2
- package/dist/{cli-n1kjs58m.js → cli-pq0kv31y.js} +5 -5
- package/dist/{cli-pz1nq5xm.js → cli-q457ga28.js} +6 -6
- package/dist/{cli-s33bzmk0.js → cli-q5n3deaf.js} +1 -1
- package/dist/{cli-4fpa0zns.js → cli-qkbevqer.js} +3 -3
- package/dist/{cli-29h5239w.js → cli-qrwjk4xy.js} +5 -5
- package/dist/{cli-kezzteka.js → cli-r04ve9xw.js} +1 -1
- package/dist/{cli-3xqad83h.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-fkpnx3vf.js → cli-rs1rzwp4.js} +3 -2
- package/dist/{cli-h9d3sdnc.js → cli-rzbsh6bw.js} +1 -1
- package/dist/{cli-94gx6ze9.js → cli-s4pccby1.js} +1 -1
- package/dist/{cli-cq4am6vg.js → cli-shyhb4t5.js} +10 -10
- package/dist/{cli-gtj12v95.js → cli-srq69pn1.js} +1 -1
- package/dist/{cli-azj9t1f9.js → cli-tc165vrb.js} +48 -5
- package/dist/{cli-gse7bp3z.js → cli-v4z5v3jd.js} +300 -81
- package/dist/{cli-p3knvk62.js → cli-vxmmttmt.js} +132 -53
- package/dist/{cli-404am6f3.js → cli-w4bvtxet.js} +7 -7
- package/dist/{cli-gkv0r2hq.js → cli-wd7b5hgc.js} +71 -9
- package/dist/{cli-akm6y2a8.js → cli-wvbaq052.js} +1 -1
- package/dist/{cli-ywy8yz6t.js → cli-wvgg7r4j.js} +2 -2
- package/dist/{cli-ka48vpev.js → cli-wym6rxgt.js} +165 -6
- package/dist/{cli-nc4pbwmp.js → cli-yd7e590v.js} +12 -12
- package/dist/{cli-3zrwrnz7.js → cli-yjb3cddd.js} +1 -1
- package/dist/{cli-7gbff32z.js → cli-z8t4485r.js} +2 -2
- package/dist/{cli-hdhpdrka.js → cli-ze1ndjs4.js} +4 -6
- package/dist/{cli-50wa8k4h.js → cli-zy9bb22b.js} +1 -2
- package/dist/cli.js +28 -28
- package/dist/{codex-adapter-2fs2c0n6.js → codex-adapter-eq61radw.js} +8 -8
- package/dist/{codex-hook-jxjv6dy5.js → codex-hook-8nmepvz6.js} +3 -3
- package/dist/{codex-login-ktfg1cxk.js → codex-login-vbd9707w.js} +1 -1
- package/dist/{codex-session-runner-r55tmx4c.js → codex-session-runner-rfx355h4.js} +9 -9
- package/dist/{commands-0mxdy9x8.js → commands-d1z0sx62.js} +3 -3
- package/dist/{controller-g3vkfhr4.js → controller-9hz6d8x3.js} +4 -4
- package/dist/{controllers-connect-4wdmncqt.js → controllers-connect-tz07d2xr.js} +24 -25
- package/dist/core-dynsv289.js +41 -0
- package/dist/{cursor-adapter-t9qb96q2.js → cursor-adapter-ef22ze3j.js} +2 -2
- package/dist/{db-487vvyv9.js → db-gd81d68c.js} +3 -3
- package/dist/{db-76p7w3gr.js → db-vrckks6q.js} +4 -2
- package/dist/{devin-adapter-3bp6rape.js → devin-adapter-kdt6a2bh.js} +1 -1
- package/dist/{dispatcher-64rp6w67.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-dc8f6ctq.js → e2b-05kn3kpq.js} +16 -5
- package/dist/{e2b-3ykbe805.js → e2b-dm9r8hpy.js} +3 -3
- package/dist/{easter-egg-3d-jrrwyf55.js → easter-egg-3d-sg21j15g.js} +1 -1
- package/dist/{embedding-space-001hhhpk.js → embedding-space-zsdw37bb.js} +13 -23
- package/dist/{embeddings-esj19cnw.js → embeddings-p4e3e1m6.js} +1 -1
- package/dist/{event-bus-7gbsr0g4.js → event-bus-tvf2grf4.js} +1 -1
- package/dist/{execute-301hkxqg.js → execute-nztd0af0.js} +1 -1
- package/dist/{external-channel-w10e2j05.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-tbrj7vhq.js → heartbeat-vfb1gy84.js} +24 -25
- package/dist/{hook-tx917rqw.js → hook-ctz0xmp3.js} +11 -11
- package/dist/{hook-3am1sq68.js → hook-eh52p7yd.js} +6 -6
- package/dist/{http-3rmemtqy.js → http-zregegrx.js} +902 -198
- package/dist/{index-s7xtvc0f.js → index-5kx15d19.js} +1 -1
- package/dist/index-7w8p6em0.js +41 -0
- package/dist/index-evay0xyk.js +17 -0
- package/dist/{index-2jw11t8s.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-gfnq66t1.js → index-x9qf8dg7.js} +294 -29
- package/dist/index-y3s0xp2v.js +43 -0
- package/dist/{k8s-36gfn847.js → k8s-ejkk0aw7.js} +2 -2
- package/dist/{keepalive-9px3t7qj.js → keepalive-zdqay870.js} +4 -5
- package/dist/lead-6cscw8a5.js +82 -0
- package/dist/{maintenance-vwqjwst6.js → maintenance-t5ndg11m.js} +1 -1
- package/dist/{node-2wfcey7d.js → node-0as4n1ef.js} +3 -3
- package/dist/{node-zd6shky9.js → node-dhxbt01p.js} +3 -3
- package/dist/{node-z67yjre7.js → node-jkdd5w7m.js} +290 -70
- package/dist/{node-hjn5n1yp.js → node-t0ct2zpw.js} +3 -5
- package/dist/{oauth-refresh-sweep-yqry3wn4.js → oauth-refresh-sweep-y9zyd7t6.js} +3 -4
- package/dist/{object-webhooks-8s1wtths.js → object-webhooks-mkca91s0.js} +7 -7
- package/dist/{onboard-hb8czx0p.js → onboard-ss995244.js} +11 -9
- package/dist/{opencode-adapter-djd6m6dk.js → opencode-adapter-mwpz0278.js} +8 -8
- package/dist/{otel-impl-2ymwyczz.js → otel-impl-6n6vva3x.js} +2 -2
- package/dist/{pending-nxavtvx7.js → pending-2sxh1t6j.js} +22 -23
- package/dist/{pi-mono-adapter-d2cpmcy4.js → pi-mono-adapter-sfb7zy43.js} +13 -13
- package/dist/{pricing-refresh-1yz8jkqv.js → pricing-refresh-h79bg4cf.js} +2 -2
- package/dist/{rbac-roles-7s6m31xw.js → rbac-roles-ckq0czp4.js} +2 -2
- package/dist/{rbac-roles-dbpx0x9v.js → rbac-roles-jg2e260w.js} +3 -3
- package/dist/{render-v2-7y20rjrn.js → render-v2-ymbshmn0.js} +7 -7
- package/dist/{resume-wz546x47.js → resume-jdhnt4jk.js} +10 -10
- package/dist/{runtime-cb5bd9tz.js → runtime-y28jhhnf.js} +1 -1
- package/dist/{session-access-4vcft8kq.js → session-access-k4ta5hvp.js} +5 -5
- package/dist/{session-source-backfill-57b50tpw.js → session-source-backfill-528j4s8j.js} +3 -3
- package/dist/{setup-e1tevjyj.js → setup-d6pj82fr.js} +15 -6
- package/dist/thread-buffer-9w6x5zec.js +40 -0
- package/dist/{tree-visibility-07wf1nct.js → tree-visibility-kjxv3nxk.js} +2 -2
- package/dist/{user-merge-jobs-n20qpv6s.js → user-merge-jobs-rabbncf6.js} +3 -3
- package/dist/{virtual-modules-6fxmn1yv.js → virtual-modules-22k51txd.js} +3 -3
- package/dist/{work-objects-eg7y48pe.js → work-objects-xtjbar3r.js} +26 -30
- package/dist/{worker-follow-up-jnvnnf2b.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 +633 -25
- 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/apps/sync.ts +20 -5
- package/src/azure-devops/boards-sync.ts +1 -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 +38 -1
- package/src/be/db/task-idempotency.ts +63 -0
- package/src/be/db/tasks/read.ts +27 -1
- package/src/be/db/tasks/write.ts +51 -14
- package/src/be/db/users/avatar.ts +12 -0
- package/src/be/db/workflow-idempotency.ts +6 -1
- package/src/be/db/workflows/read.ts +79 -0
- package/src/be/db.ts +129 -152
- 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/344_user_avatar.sql +4 -0
- package/src/be/migrations/345_task_status_kind.sql +6 -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/primitives/object-embed.ts +2 -2
- package/src/be/primitives/objects.ts +2 -2
- package/src/be/repo-checked-update.ts +58 -5
- package/src/be/requester-timezone.ts +10 -0
- package/src/be/runtime-pools/supervisor.ts +1 -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 +33 -8
- 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 +91 -7
- package/src/be/users.ts +33 -12
- package/src/bitbucket/handlers.ts +1 -1
- package/src/comb/review-batch.ts +16 -5
- package/src/commands/context-preamble.ts +237 -0
- package/src/commands/credential-outcome-report.ts +96 -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 +72 -10
- package/src/commands/setup.tsx +17 -3
- package/src/event-waits/github.ts +39 -6
- package/src/event-waits/index.ts +4 -2
- package/src/event-waits/types.ts +10 -3
- package/src/extensions/contract-types.generated.ts +1 -1
- package/src/github/app.ts +177 -13
- package/src/github/handlers.ts +7 -2
- package/src/github/pull-request-state.ts +100 -11
- package/src/gitlab/handlers.ts +2 -2
- package/src/heartbeat/heartbeat.ts +6 -1
- package/src/hooks/hook.ts +8 -2
- package/src/hooks/native-tool-hooks.ts +4 -2
- package/src/http/api-keys.ts +26 -0
- package/src/http/apps.ts +82 -42
- package/src/http/asset-key-write.ts +45 -0
- package/src/http/assets.ts +4 -3
- package/src/http/comb.ts +21 -5
- package/src/http/config.ts +8 -4
- package/src/http/github-token.ts +27 -6
- 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/pages.ts +4 -10
- package/src/http/repos.ts +27 -11
- package/src/http/request-principal.ts +27 -1
- package/src/http/schedules.ts +42 -14
- 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/sessions.ts +7 -2
- package/src/http/skills.ts +70 -0
- package/src/http/status.ts +2 -0
- package/src/http/tasks.ts +115 -19
- package/src/http/trackers/jira.ts +18 -3
- package/src/http/trackers/linear.ts +3 -0
- package/src/http/users.ts +5 -0
- package/src/http/webhooks.ts +19 -1
- package/src/http/workflows.ts +5 -10
- package/src/integrations/chat-sdk/commands.ts +3 -1
- package/src/jira/sync.ts +1 -1
- package/src/kv-limits.ts +2 -0
- package/src/kv-reserved-namespaces.ts +25 -2
- package/src/linear/sync.ts +5 -3
- package/src/prompts/session-templates.ts +50 -0
- package/src/prompts/session-turns.ts +30 -0
- package/src/providers/acp-targets.ts +2 -2
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/claude-adapter.ts +5 -0
- package/src/providers/claude-managed-adapter.ts +14 -0
- package/src/providers/claude-sdk-session.ts +19 -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/deferred-task-waits.ts +74 -13
- 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 +12 -2
- package/src/scripts-runtime/types/stdlib.d.ts +27 -1
- package/src/scripts-runtime/types/swarm-extension.d.ts +20 -2
- package/src/scripts-runtime/types/swarm-sdk.d.ts +27 -1
- package/src/slack/actions.ts +25 -1
- 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 +403 -17
- 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/api-drain-worker-e2e.test.ts +0 -2
- package/src/tests/approval-auto-cancellation-migration.test.ts +8 -19
- package/src/tests/approval-card-resolution.test.ts +2 -17
- package/src/tests/approval-requests-notifications.test.ts +41 -27
- package/src/tests/approval-requests.test.ts +137 -369
- package/src/tests/apps-script-types.test.ts +63 -16
- package/src/tests/apps-sort-order.test.ts +87 -0
- package/src/tests/apps-sync-engine.test.ts +5 -3
- package/src/tests/apps-table-filters-migration.test.ts +44 -25
- package/src/tests/bedrock-model-groups.test.ts +4 -0
- package/src/tests/bitbucket-handlers.test.ts +2 -0
- package/src/tests/channel-activity.test.ts +9 -0
- package/src/tests/chat-sdk-commands.test.ts +1 -0
- package/src/tests/chatgpt-subscription-model-groups.test.ts +4 -0
- package/src/tests/claude-adapter.test.ts +35 -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-adapter.test.ts +3 -92
- package/src/tests/codex-gpt6-release.test.ts +4 -9
- package/src/tests/codex-oauth-credential-info.test.ts +35 -18
- package/src/tests/codex-oauth.test.ts +0 -6
- package/src/tests/codex-pool.test.ts +5 -214
- package/src/tests/codex-rate-limit-parse.test.ts +0 -7
- package/src/tests/codex-swarm-events.test.ts +11 -54
- package/src/tests/comb-review-batch.test.ts +17 -4
- package/src/tests/comb-status.test.ts +1 -0
- package/src/tests/db-client-busy-retry.test.ts +49 -16
- 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 +24 -1
- package/src/tests/dsh-adapter.test.ts +1 -1
- package/src/tests/e2b-dispatch.test.ts +13 -1
- package/src/tests/e2e-shards.test.ts +9 -9
- package/src/tests/enabled-tools.test.ts +0 -2
- package/src/tests/entrypoint-mcp-config.test.ts +642 -0
- package/src/tests/fixtures/base-prompt-baseline.json +6 -6
- 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/github-app-worker-auth-helper.test.ts +147 -1
- package/src/tests/gitlab-handlers.test.ts +2 -0
- package/src/tests/heartbeat-jev-gate.test.ts +9 -241
- package/src/tests/heartbeat-reroute-decision.test.ts +2 -0
- package/src/tests/heartbeat-supersede-resume.test.ts +2 -0
- package/src/tests/heartbeat.test.ts +1 -0
- 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/key-usage-selection.test.ts +302 -0
- package/src/tests/memory-e2e.test.ts +34 -103
- package/src/tests/memory-key-paths.test.ts +5 -0
- package/src/tests/memory-rater-llm.test.ts +33 -149
- package/src/tests/memory-store.test.ts +24 -125
- package/src/tests/memory.test.ts +31 -100
- package/src/tests/merge-gate-detect-changes.test.ts +108 -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/otel-service-name.test.ts +0 -9
- package/src/tests/otel-session-cost-metrics.test.ts +1 -38
- package/src/tests/pool-session-logs.test.ts +8 -42
- package/src/tests/pre-push-affected-tests.test.ts +106 -0
- package/src/tests/prompt-template-session.test.ts +3 -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-api-drain.test.ts +2 -17
- package/src/tests/runner-context-preamble.test.ts +202 -0
- package/src/tests/runner-repo-clone-args.test.ts +116 -0
- package/src/tests/runner-terminal-window-report.test.ts +132 -0
- package/src/tests/runtime-supervisor-failures.test.ts +1 -0
- package/src/tests/sandboxed-process.test.ts +26 -21
- package/src/tests/schedule-http-triage-tools.test.ts +12 -9
- package/src/tests/scheduled-tasks.test.ts +14 -51
- 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/script-executor-conformance.test.ts +4 -48
- package/src/tests/script-executor-quickjs-pool.test.ts +9 -7
- package/src/tests/script-native-startup.test.ts +21 -25
- package/src/tests/scripts-namespaces.test.ts +3 -1
- package/src/tests/secret-rules.test.ts +4 -2
- 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-logs.test.ts +1 -260
- 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 +14 -152
- 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/task-cascade-fail.test.ts +1 -0
- package/src/tests/task-supersede-resume.test.ts +1 -0
- package/src/tests/test-proc.ts +5 -2
- package/src/tests/ui-spec-script-actions-config.test.ts +7 -3
- package/src/tests/window-stream-reporter.test.ts +122 -0
- package/src/tests/workflow-agent-task-retry.test.ts +1 -3
- package/src/tests/workflow-cascade-cancel.test.ts +1 -0
- package/src/tests/workflow-retry-v2.test.ts +34 -43
- package/src/tests/workflow-retry-validation.test.ts +8 -48
- package/src/tests/workflow-triggers-v2.test.ts +35 -11
- package/src/tests/worktree-reaper.test.ts +2 -2
- package/src/tools/app-patch.ts +6 -2
- package/src/tools/app-upsert.ts +8 -4
- package/src/tools/cancel-task.ts +2 -2
- package/src/tools/defer-task.ts +24 -79
- package/src/tools/get-task-details.ts +8 -4
- package/src/tools/get-tasks.ts +13 -2
- 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/manage-user.ts +9 -0
- 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/store-progress.ts +5 -3
- 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 +101 -2
- package/src/utils/constants.ts +32 -0
- package/src/utils/credentials.ts +42 -5
- package/src/utils/deferral-time.ts +61 -0
- package/src/utils/error-tracker.ts +6 -0
- package/src/utils/key-usage.ts +114 -0
- package/src/utils/request-auth-context.ts +15 -16
- package/src/utils/sandboxed-process.ts +1 -0
- 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/resume.ts +5 -2
- 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 +6 -2
- package/templates/skills/apps/content.md +6 -2
- package/templates/skills/boards-and-sheets/content.md +4 -2
- package/templates/skills/code-quality/content.md +4 -4
- package/templates/skills/pages/content.md +7 -0
- 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 +8 -0
- package/templates/skills/swarm-scripts/SKILL.md +45 -0
- package/templates/skills/swarm-scripts/content.md +45 -0
- package/dist/acp-adapter-mr4temec.js +0 -17
- package/dist/cli-1vmhnncj.js +0 -173
- package/dist/cli-kj0hyr43.js +0 -51
- package/dist/cli-ysv0k1we.js +0 -459
- package/dist/core-gsvj5f3z.js +0 -42
- package/dist/dsh-adapter-8abzqk5c.js +0 -9
- package/dist/fx-adapter-4sjrbdne.js +0 -20
- package/dist/grok-adapter-3a0ezfee.js +0 -20
- package/dist/handlers-ef3k11hb.js +0 -41
- package/dist/index-aetfyx6p.js +0 -13
- package/dist/index-e6bq0exk.js +0 -42
- package/dist/index-hf2k1vge.js +0 -39
- package/dist/index-taxmejj3.js +0 -44
- package/dist/lead-5vt6f174.js +0 -83
- package/dist/thread-buffer-686pa1p1.js +0 -42
- package/dist/worker-4vp616ms.js +0 -83
- package/src/tests/apps-table-selection-migration.test.ts +0 -95
- package/src/tests/extensions-example-heartbeat-remediate.test.ts +0 -69
- package/src/tests/extensions-example-rewrite-and-suppress.test.ts +0 -70
|
@@ -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
|
|
@@ -64,13 +64,17 @@ import {
|
|
|
64
64
|
import {
|
|
65
65
|
activeModelBlock,
|
|
66
66
|
init_model_rate_limit_windows,
|
|
67
|
+
CREDENTIAL_SELECTION_STRATEGIES,
|
|
68
|
+
keyUsageFromWindows,
|
|
69
|
+
keyPaceFromWindows,
|
|
70
|
+
init_key_usage,
|
|
67
71
|
getModelAwareCredentialVars,
|
|
68
72
|
deriveProviderFromKeyType,
|
|
69
73
|
keySuffix,
|
|
70
74
|
splitCredentialPool,
|
|
71
75
|
selectCredential,
|
|
72
76
|
init_credentials2
|
|
73
|
-
} from "./cli-
|
|
77
|
+
} from "./cli-wd7b5hgc.js";
|
|
74
78
|
import {
|
|
75
79
|
registerTemplate,
|
|
76
80
|
getAllTemplateDefinitions,
|
|
@@ -78,7 +82,7 @@ import {
|
|
|
78
82
|
configureDbResolver,
|
|
79
83
|
init_resolver,
|
|
80
84
|
init_session_templates
|
|
81
|
-
} from "./cli-
|
|
85
|
+
} from "./cli-24wervhz.js";
|
|
82
86
|
import {
|
|
83
87
|
getOpenRouterAttributionHeaders,
|
|
84
88
|
init_openrouter_base_url
|
|
@@ -103,6 +107,8 @@ import {
|
|
|
103
107
|
parseModelTier,
|
|
104
108
|
TERMINAL_TASK_STATUSES,
|
|
105
109
|
isTerminalTaskStatus,
|
|
110
|
+
TaskStatusKindSchema,
|
|
111
|
+
isTaskStatusKindFor,
|
|
106
112
|
OPEN_TASK_STATUSES,
|
|
107
113
|
ProviderNameSchema,
|
|
108
114
|
ModelProfileCredentialsSchema,
|
|
@@ -114,18 +120,19 @@ import {
|
|
|
114
120
|
CreateTaskOptionsSchema,
|
|
115
121
|
SERVER_GENERATED_ATTACHMENT_CAPABILITY,
|
|
116
122
|
AgentAvatarSchema,
|
|
123
|
+
UserAvatarSchema,
|
|
117
124
|
AgentSlackIconSchema,
|
|
118
125
|
VersionableFieldSchema,
|
|
119
126
|
SessionCostModelBreakdownSchema,
|
|
120
127
|
SUPERSEDED_WORKFLOW_TASK_REASON,
|
|
121
128
|
PageThemeTokensSchema,
|
|
122
129
|
init_types5
|
|
123
|
-
} from "./cli-
|
|
130
|
+
} from "./cli-tc165vrb.js";
|
|
124
131
|
import {
|
|
125
132
|
setRuntimeModelCatalog,
|
|
126
133
|
runtimeHarnessSections,
|
|
127
134
|
init_runtime_model_catalog
|
|
128
|
-
} from "./cli-
|
|
135
|
+
} from "./cli-7ca8hczj.js";
|
|
129
136
|
import {
|
|
130
137
|
init_zod
|
|
131
138
|
} from "./cli-96234j5w.js";
|
|
@@ -153,9 +160,10 @@ import {
|
|
|
153
160
|
import {
|
|
154
161
|
init_package,
|
|
155
162
|
package_default
|
|
156
|
-
} from "./cli-
|
|
163
|
+
} from "./cli-shyhb4t5.js";
|
|
157
164
|
import {
|
|
158
165
|
getNodeEnv,
|
|
166
|
+
isDevOrTestNodeEnv,
|
|
159
167
|
init_node_env
|
|
160
168
|
} from "./cli-rgeadyvq.js";
|
|
161
169
|
import {
|
|
@@ -184,7 +192,7 @@ import {
|
|
|
184
192
|
registerVolatileSecret,
|
|
185
193
|
registerSensitiveKeyName,
|
|
186
194
|
init_secret_scrubber
|
|
187
|
-
} from "./cli-
|
|
195
|
+
} from "./cli-r9d2tya0.js";
|
|
188
196
|
import {
|
|
189
197
|
__toCommonJS,
|
|
190
198
|
__commonJS,
|
|
@@ -5310,9 +5318,8 @@ function getCurrentRunProvenance() {
|
|
|
5310
5318
|
const auth = getCurrentRequestAuth();
|
|
5311
5319
|
if (auth?.kind !== "agent")
|
|
5312
5320
|
return null;
|
|
5313
|
-
const sourceStepId = auth
|
|
5314
|
-
|
|
5315
|
-
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;
|
|
5316
5323
|
}
|
|
5317
5324
|
var requestAuth, authStorage;
|
|
5318
5325
|
var init_request_auth_context = __esm(() => {
|
|
@@ -5744,7 +5751,7 @@ var init_telemetry = __esm(() => {
|
|
|
5744
5751
|
// src/telemetry-identity.ts
|
|
5745
5752
|
async function loadUserRole(userId) {
|
|
5746
5753
|
try {
|
|
5747
|
-
const { getUserGrant } = await import("./rbac-roles-
|
|
5754
|
+
const { getUserGrant } = await import("./rbac-roles-jg2e260w.js");
|
|
5748
5755
|
const grant = await getUserGrant(userId);
|
|
5749
5756
|
const role = grant.grantsAll ? "admin" : "member";
|
|
5750
5757
|
const user = await getDbClient2().get("SELECT json_extract(metadata, '$.jobFunction') AS jobFunction FROM users WHERE id = ? AND json_valid(metadata)", [userId]);
|
|
@@ -6632,7 +6639,7 @@ function scheduleApprovalCardUpdates(approvals) {
|
|
|
6632
6639
|
const posted = approvals.filter((approval) => approval.notificationChannels?.some((n) => n.channel === "slack" && n.messageTs));
|
|
6633
6640
|
if (posted.length === 0)
|
|
6634
6641
|
return;
|
|
6635
|
-
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)))));
|
|
6636
6643
|
}
|
|
6637
6644
|
var init_approvals = __esm(() => {
|
|
6638
6645
|
init_secret_scrubber();
|
|
@@ -6959,8 +6966,12 @@ var init_legacy_policy = __esm(() => {
|
|
|
6959
6966
|
"memory.write.consolidated": leadOnly,
|
|
6960
6967
|
"memory.read.any": leadOrOperatorOrUser,
|
|
6961
6968
|
"memory.delete.any": memoryDelete,
|
|
6969
|
+
"memory.reembed": leadOrOperatorOrUser,
|
|
6962
6970
|
"channel.delete": leadOnly,
|
|
6963
6971
|
"repo.merge-policy.write": leadOrOperatorOrUser,
|
|
6972
|
+
"repo.exec-config.write": leadOrOperatorOrUser,
|
|
6973
|
+
"repo.delete": leadOrOperatorOrUser,
|
|
6974
|
+
"heartbeat.trigger": leadOrOperatorOrUser,
|
|
6964
6975
|
"integration.kapso.manage": leadOnly,
|
|
6965
6976
|
"integration.chat.manage": leadOnly,
|
|
6966
6977
|
"integration.chat.post": leadOnly,
|
|
@@ -7002,6 +7013,7 @@ var init_legacy_policy = __esm(() => {
|
|
|
7002
7013
|
"mcp-server.stdio.write": leadOrOperatorOrUser,
|
|
7003
7014
|
"mcp-server.read.secrets": leadOnly,
|
|
7004
7015
|
"mcp-oauth.authorize.any": anyAuthenticated,
|
|
7016
|
+
"mcp-oauth.manage": leadOrOperatorOrUser,
|
|
7005
7017
|
"kv.write.any": leadOrOwnNamespace,
|
|
7006
7018
|
"comb.presence": operatorOrUser,
|
|
7007
7019
|
"fs.join.own": anyAuthenticated,
|
|
@@ -7023,6 +7035,7 @@ var init_legacy_policy = __esm(() => {
|
|
|
7023
7035
|
"script.api.delete": leadOnly,
|
|
7024
7036
|
"schedule.deferral.update.any": leadOrResourceOwner,
|
|
7025
7037
|
"schedule.target.update.any": leadOrResourceOwner,
|
|
7038
|
+
"schedule.run.any": leadOrResourceOwner,
|
|
7026
7039
|
"runtime_pool.write": operatorOrUser,
|
|
7027
7040
|
"runtime_pool.bind": leadOrOperatorOrUser,
|
|
7028
7041
|
"runtime_controller.write": operatorOrUser,
|
|
@@ -7190,6 +7203,10 @@ var init_permissions = __esm(() => {
|
|
|
7190
7203
|
description: "List every agent's memories, beyond the caller's own and swarm-scoped entries (lead, operator, or user).",
|
|
7191
7204
|
namespace: "memory"
|
|
7192
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
|
+
},
|
|
7193
7210
|
"memory.delete.any": {
|
|
7194
7211
|
description: "Delete a memory entry: own agent-scoped entries; swarm-scoped entries as lead, operator, or user; any entry as operator or user.",
|
|
7195
7212
|
namespace: "memory"
|
|
@@ -7202,6 +7219,18 @@ var init_permissions = __esm(() => {
|
|
|
7202
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.",
|
|
7203
7220
|
namespace: "repo"
|
|
7204
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
|
+
},
|
|
7205
7234
|
"integration.kapso.manage": {
|
|
7206
7235
|
description: "Register or unregister a Kapso inbound number.",
|
|
7207
7236
|
namespace: "integration"
|
|
@@ -7366,6 +7395,10 @@ var init_permissions = __esm(() => {
|
|
|
7366
7395
|
description: "Start an MCP-server OAuth authorize flow for a caller-supplied user scope.",
|
|
7367
7396
|
namespace: "mcp-oauth"
|
|
7368
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
|
+
},
|
|
7369
7402
|
"kv.write.any": {
|
|
7370
7403
|
description: "Write another agent's task:agent: KV namespace, or a lead-only family (usecase:*).",
|
|
7371
7404
|
namespace: "kv"
|
|
@@ -7450,6 +7483,10 @@ var init_permissions = __esm(() => {
|
|
|
7450
7483
|
description: "Change what a schedule the caller did not create runs (its target, task template, workflow, script, script args or params).",
|
|
7451
7484
|
namespace: "schedule"
|
|
7452
7485
|
},
|
|
7486
|
+
"schedule.run.any": {
|
|
7487
|
+
description: "Run a schedule the caller did not create now, as its creator.",
|
|
7488
|
+
namespace: "schedule"
|
|
7489
|
+
},
|
|
7453
7490
|
"runtime_pool.write": {
|
|
7454
7491
|
description: "Create, update, or delete runtime pools (image, provider kind, placement).",
|
|
7455
7492
|
namespace: "runtime_pool"
|
|
@@ -9461,6 +9498,10 @@ function taskPreview(task) {
|
|
|
9461
9498
|
const text = task instanceof Uint8Array ? taskPreviewDecoder.decode(task) : skipSiblingBlock(task ?? "");
|
|
9462
9499
|
return dependencies2.previewText(text, TASK_PREVIEW_LENGTH);
|
|
9463
9500
|
}
|
|
9501
|
+
function parseStatusKind(value) {
|
|
9502
|
+
const parsed = TaskStatusKindSchema.safeParse(value);
|
|
9503
|
+
return parsed.success ? parsed.data : undefined;
|
|
9504
|
+
}
|
|
9464
9505
|
function parseFallbackHops(value) {
|
|
9465
9506
|
if (!value)
|
|
9466
9507
|
return;
|
|
@@ -9590,10 +9631,12 @@ function rowToAgentTask(row) {
|
|
|
9590
9631
|
finishedAt: row.finishedAt ?? undefined,
|
|
9591
9632
|
notifiedAt: row.notifiedAt ?? undefined,
|
|
9592
9633
|
failureReason: row.failureReason ?? undefined,
|
|
9634
|
+
statusKind: parseStatusKind(row.statusKind),
|
|
9593
9635
|
output: row.output ?? undefined,
|
|
9594
9636
|
progress: row.progress ?? undefined,
|
|
9595
9637
|
wasPaused: !!row.was_paused,
|
|
9596
9638
|
deferredAt: row.deferredAt ?? undefined,
|
|
9639
|
+
deferredUntil: row.deferredUntil ?? undefined,
|
|
9597
9640
|
credentialKeySuffix: row.credentialKeySuffix ?? undefined,
|
|
9598
9641
|
credentialKeyType: row.credentialKeyType ?? undefined,
|
|
9599
9642
|
requestedByUserId: row.requestedByUserId ?? undefined,
|
|
@@ -9640,6 +9683,7 @@ function rowToAgentTaskSummary(row) {
|
|
|
9640
9683
|
createdAt: row.createdAt,
|
|
9641
9684
|
lastUpdatedAt: row.lastUpdatedAt,
|
|
9642
9685
|
finishedAt: row.finishedAt ?? undefined,
|
|
9686
|
+
statusKind: parseStatusKind(row.statusKind),
|
|
9643
9687
|
peakContextPercent: row.peakContextPercent ?? undefined,
|
|
9644
9688
|
totalCostUsd: row.totalCostUsd ?? undefined
|
|
9645
9689
|
};
|
|
@@ -9878,6 +9922,10 @@ async function getAllTasks2(filters, opts) {
|
|
|
9878
9922
|
params.push(filters.status);
|
|
9879
9923
|
}
|
|
9880
9924
|
}
|
|
9925
|
+
if (filters?.statusKind) {
|
|
9926
|
+
conditions.push("statusKind = ?");
|
|
9927
|
+
params.push(filters.statusKind);
|
|
9928
|
+
}
|
|
9881
9929
|
if (filters?.agentId) {
|
|
9882
9930
|
conditions.push("agentId = ?");
|
|
9883
9931
|
params.push(filters.agentId);
|
|
@@ -10006,6 +10054,10 @@ async function getTasksCount2(filters) {
|
|
|
10006
10054
|
params.push(filters.status);
|
|
10007
10055
|
}
|
|
10008
10056
|
}
|
|
10057
|
+
if (filters?.statusKind) {
|
|
10058
|
+
conditions.push("statusKind = ?");
|
|
10059
|
+
params.push(filters.statusKind);
|
|
10060
|
+
}
|
|
10009
10061
|
if (filters?.agentId) {
|
|
10010
10062
|
conditions.push("agentId = ?");
|
|
10011
10063
|
params.push(filters.agentId);
|
|
@@ -10603,7 +10655,7 @@ var init_read = __esm(() => {
|
|
|
10603
10655
|
agent_tasks.resolvedEffort, agent_tasks.profile, agent_tasks.resolvedProfile,
|
|
10604
10656
|
agent_tasks.provider, agent_tasks.requestedByUserId, agent_tasks.progress,
|
|
10605
10657
|
agent_tasks.createdAt, agent_tasks.lastUpdatedAt, agent_tasks.finishedAt,
|
|
10606
|
-
agent_tasks.peakContextPercent`,
|
|
10658
|
+
agent_tasks.statusKind, agent_tasks.peakContextPercent`,
|
|
10607
10659
|
timeline: `agent_tasks.id, agent_tasks.agentId, agent_tasks.parentTaskId, ${TASK_PREVIEW_SQL},
|
|
10608
10660
|
agent_tasks.title, agent_tasks.status, agent_tasks.createdAt, agent_tasks.lastUpdatedAt,
|
|
10609
10661
|
agent_tasks.finishedAt, agent_tasks.peakContextTokens`
|
|
@@ -11766,6 +11818,17 @@ async function slackThreadHasBotReplySince(channelId, threadTs, since, taskId) {
|
|
|
11766
11818
|
) AS found`, [channelId, threadTs, since, taskId]);
|
|
11767
11819
|
return !!row?.found;
|
|
11768
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
|
+
}
|
|
11769
11832
|
function slackOutcomeWindowParams(window2) {
|
|
11770
11833
|
return [window2.finishedAfter, Number(window2.delegationEnabled), window2.closureActiveAfter];
|
|
11771
11834
|
}
|
|
@@ -11774,7 +11837,7 @@ async function slackThreadHasOutcomeWork(thread, window2) {
|
|
|
11774
11837
|
SELECT 1 FROM agent_tasks task, slack_render_v2_state state
|
|
11775
11838
|
WHERE state.id = 1
|
|
11776
11839
|
AND task.slackChannelId = ? AND task.slackThreadTs = ?
|
|
11777
|
-
AND task.source = 'slack'
|
|
11840
|
+
AND (task.source = 'slack' OR ${SLACK_LEAD_FOLLOW_UP_SQL})
|
|
11778
11841
|
AND task.createdAt >= state.activated_at
|
|
11779
11842
|
AND task.status IN ('completed', 'failed', 'cancelled')
|
|
11780
11843
|
AND ${SLACK_OUTCOME_WINDOW_SQL}
|
|
@@ -11845,6 +11908,7 @@ async function getSlackProcessingThreads(delegationEnabled, treesEnabled, window
|
|
|
11845
11908
|
(task.createdAt >= state.activated_at
|
|
11846
11909
|
AND (task.source = 'slack'
|
|
11847
11910
|
OR (task.source = 'schedule' AND task.taskType = 'deferred')
|
|
11911
|
+
OR ${SLACK_LEAD_FOLLOW_UP_SQL}
|
|
11848
11912
|
OR (? = 1 AND task.parentTaskId IS NOT NULL AND task.createdAt >= state.delegation_activated_at
|
|
11849
11913
|
AND task.status IN ('completed', 'failed') AND task.slackReplySent = 0
|
|
11850
11914
|
AND COALESCE(task.taskType, '') NOT IN ('follow-up', 'reroute-decision')))
|
|
@@ -11886,7 +11950,10 @@ var SLACK_TREE_VISIBLE_SQL = `(COALESCE(state.task_tree_enabled, 1) = 1 AND (
|
|
|
11886
11950
|
AND (visible_task.status NOT IN ('completed', 'failed', 'cancelled', 'superseded', 'skipped')
|
|
11887
11951
|
OR visible_task.finishedAt > state.task_tree_enabled_at)
|
|
11888
11952
|
)
|
|
11889
|
-
))`, SLACK_TREE_NEEDS_RENDER_SQL, THREAD_LOOKUP_CHUNK = 500,
|
|
11953
|
+
))`, SLACK_TREE_NEEDS_RENDER_SQL, THREAD_LOOKUP_CHUNK = 500, SLACK_LEAD_FOLLOW_UP_SQL = `(task.source = 'system'
|
|
11954
|
+
AND task.taskType IN ('follow-up', 'resume') AND task.slackReplySent = 0
|
|
11955
|
+
AND task.status IN ('completed', 'failed', 'cancelled')
|
|
11956
|
+
AND EXISTS (SELECT 1 FROM agents lead WHERE lead.id = task.agentId AND lead.isLead = 1))`, SLACK_OUTCOME_WINDOW_SQL = `(COALESCE(task.finishedAt, task.lastUpdatedAt) >= ?
|
|
11890
11957
|
OR (? = 1 AND task.source = 'slack' AND task.createdAt >= state.delegation_activated_at
|
|
11891
11958
|
AND EXISTS (SELECT 1 FROM agent_tasks recent
|
|
11892
11959
|
WHERE recent.slackChannelId = task.slackChannelId AND recent.slackThreadTs = task.slackThreadTs
|
|
@@ -12466,8 +12533,8 @@ async function completeTask2(id, output, options) {
|
|
|
12466
12533
|
const scrubbedOutput = output ? scrubSecrets(output) : output;
|
|
12467
12534
|
const row = await getDbClient2().transaction(async () => {
|
|
12468
12535
|
const finishedAt = new Date().toISOString();
|
|
12469
|
-
let completed = await getDbClient2().get(`UPDATE agent_tasks SET status = ?, finishedAt = ?, lastUpdatedAt = strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
|
|
12470
|
-
WHERE id = ? AND status NOT IN ('completed', 'failed', 'cancelled', 'superseded', 'skipped') RETURNING *`, ["completed", finishedAt, id]);
|
|
12536
|
+
let completed = await getDbClient2().get(`UPDATE agent_tasks SET status = ?, statusKind = ?, finishedAt = ?, lastUpdatedAt = strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
|
|
12537
|
+
WHERE id = ? AND status NOT IN ('completed', 'failed', 'cancelled', 'superseded', 'skipped') RETURNING *`, ["completed", options?.statusKind ?? null, finishedAt, id]);
|
|
12471
12538
|
if (!completed)
|
|
12472
12539
|
return null;
|
|
12473
12540
|
if (scrubbedOutput) {
|
|
@@ -12484,7 +12551,7 @@ async function completeTask2(id, output, options) {
|
|
|
12484
12551
|
}
|
|
12485
12552
|
}
|
|
12486
12553
|
if (completed && options?.deferredAt) {
|
|
12487
|
-
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]);
|
|
12488
12555
|
}
|
|
12489
12556
|
if (completed) {
|
|
12490
12557
|
await dependencies3.reconcileTaskPullRequestAttachments(id, completed.agentId, [
|
|
@@ -12514,7 +12581,7 @@ async function completeTask2(id, output, options) {
|
|
|
12514
12581
|
});
|
|
12515
12582
|
} catch {}
|
|
12516
12583
|
getDbClient2().afterCommit(() => {
|
|
12517
|
-
import("./event-bus-
|
|
12584
|
+
import("./event-bus-tvf2grf4.js").then(({ workflowEventBus }) => {
|
|
12518
12585
|
workflowEventBus.emit("task.completed", {
|
|
12519
12586
|
taskId: id,
|
|
12520
12587
|
previousStatus: oldTask.status,
|
|
@@ -12542,9 +12609,10 @@ async function failTask2(id, reason, opts = {}) {
|
|
|
12542
12609
|
}
|
|
12543
12610
|
const finishedAt = new Date().toISOString();
|
|
12544
12611
|
const scrubbedReason = scrubSecrets(reason);
|
|
12545
|
-
const row = await getDbClient2().get(`UPDATE agent_tasks SET status = 'failed', failureReason = ?, finishedAt = ?, lastUpdatedAt = strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
|
|
12612
|
+
const row = await getDbClient2().get(`UPDATE agent_tasks SET status = 'failed', statusKind = ?, failureReason = ?, finishedAt = ?, lastUpdatedAt = strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
|
|
12546
12613
|
WHERE id = ? AND status NOT IN ('completed', 'failed', 'cancelled', 'superseded', 'skipped')
|
|
12547
12614
|
AND (? IS NULL OR lastUpdatedAt = ?) RETURNING *`, [
|
|
12615
|
+
opts.statusKind ?? null,
|
|
12548
12616
|
scrubbedReason,
|
|
12549
12617
|
finishedAt,
|
|
12550
12618
|
id,
|
|
@@ -12570,7 +12638,7 @@ async function failTask2(id, reason, opts = {}) {
|
|
|
12570
12638
|
});
|
|
12571
12639
|
} catch {}
|
|
12572
12640
|
getDbClient2().afterCommit(() => {
|
|
12573
|
-
import("./event-bus-
|
|
12641
|
+
import("./event-bus-tvf2grf4.js").then(({ workflowEventBus }) => {
|
|
12574
12642
|
workflowEventBus.emit("task.failed", {
|
|
12575
12643
|
taskId: id,
|
|
12576
12644
|
previousStatus: oldTask.status,
|
|
@@ -12625,8 +12693,8 @@ async function cancelTask2(id, reason, options = {}) {
|
|
|
12625
12693
|
}
|
|
12626
12694
|
const finishedAt = new Date().toISOString();
|
|
12627
12695
|
const cancelReason = scrubSecrets(reason ?? "Cancelled by user");
|
|
12628
|
-
const row = await getDbClient2().get(`UPDATE agent_tasks SET status = 'cancelled', failureReason = ?, finishedAt = ?, lastUpdatedAt = strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
|
|
12629
|
-
WHERE id = ? AND status NOT IN ('completed', 'failed', 'cancelled', 'superseded', 'skipped') RETURNING *`, [cancelReason, finishedAt, id]);
|
|
12696
|
+
const row = await getDbClient2().get(`UPDATE agent_tasks SET status = 'cancelled', statusKind = ?, failureReason = ?, finishedAt = ?, lastUpdatedAt = strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
|
|
12697
|
+
WHERE id = ? AND status NOT IN ('completed', 'failed', 'cancelled', 'superseded', 'skipped') RETURNING *`, [options.statusKind ?? null, cancelReason, finishedAt, id]);
|
|
12630
12698
|
if (row && oldTask) {
|
|
12631
12699
|
const recipients = new Set([row.agentId, row.offeredTo]);
|
|
12632
12700
|
getDbClient2().afterCommit(() => {
|
|
@@ -12653,7 +12721,7 @@ async function cancelTask2(id, reason, options = {}) {
|
|
|
12653
12721
|
});
|
|
12654
12722
|
} catch {}
|
|
12655
12723
|
getDbClient2().afterCommit(() => {
|
|
12656
|
-
import("./event-bus-
|
|
12724
|
+
import("./event-bus-tvf2grf4.js").then(({ workflowEventBus }) => {
|
|
12657
12725
|
workflowEventBus.emit("task.cancelled", {
|
|
12658
12726
|
taskId: id,
|
|
12659
12727
|
previousStatus: oldTask.status,
|
|
@@ -12666,7 +12734,7 @@ async function cancelTask2(id, reason, options = {}) {
|
|
|
12666
12734
|
if (row.source === "schedule" && row.taskType === "deferred" && row.parentTaskId) {
|
|
12667
12735
|
getDbClient2().afterCommit(async () => {
|
|
12668
12736
|
try {
|
|
12669
|
-
const { createWorkerTaskFollowUp } = await import("./worker-follow-up-
|
|
12737
|
+
const { createWorkerTaskFollowUp } = await import("./worker-follow-up-fg48vk6d.js");
|
|
12670
12738
|
await createWorkerTaskFollowUp({
|
|
12671
12739
|
task: rowToAgentTask(row),
|
|
12672
12740
|
status: "failed",
|
|
@@ -12692,7 +12760,7 @@ async function cancelTask2(id, reason, options = {}) {
|
|
|
12692
12760
|
}
|
|
12693
12761
|
return row ? rowToAgentTask(row) : null;
|
|
12694
12762
|
}
|
|
12695
|
-
async function skipTask2(id, reason) {
|
|
12763
|
+
async function skipTask2(id, reason, opts = {}) {
|
|
12696
12764
|
const oldTask = await getTaskById2(id);
|
|
12697
12765
|
if (!oldTask)
|
|
12698
12766
|
return null;
|
|
@@ -12700,8 +12768,8 @@ async function skipTask2(id, reason) {
|
|
|
12700
12768
|
return null;
|
|
12701
12769
|
const finishedAt = new Date().toISOString();
|
|
12702
12770
|
const skipReason = scrubSecrets(reason);
|
|
12703
|
-
const row = await getDbClient2().get(`UPDATE agent_tasks SET status = 'skipped', failureReason = ?, finishedAt = ?, lastUpdatedAt = strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
|
|
12704
|
-
WHERE id = ? AND status NOT IN ('completed', 'failed', 'cancelled', 'superseded', 'skipped') RETURNING *`, [skipReason, finishedAt, id]);
|
|
12771
|
+
const row = await getDbClient2().get(`UPDATE agent_tasks SET status = 'skipped', statusKind = ?, failureReason = ?, finishedAt = ?, lastUpdatedAt = strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
|
|
12772
|
+
WHERE id = ? AND status NOT IN ('completed', 'failed', 'cancelled', 'superseded', 'skipped') RETURNING *`, [opts.statusKind ?? null, skipReason, finishedAt, id]);
|
|
12705
12773
|
if (!row)
|
|
12706
12774
|
return null;
|
|
12707
12775
|
try {
|
|
@@ -12715,7 +12783,7 @@ async function skipTask2(id, reason) {
|
|
|
12715
12783
|
});
|
|
12716
12784
|
} catch {}
|
|
12717
12785
|
getDbClient2().afterCommit(() => {
|
|
12718
|
-
import("./event-bus-
|
|
12786
|
+
import("./event-bus-tvf2grf4.js").then(({ workflowEventBus }) => {
|
|
12719
12787
|
workflowEventBus.emit("task.skipped", {
|
|
12720
12788
|
taskId: id,
|
|
12721
12789
|
failureReason: skipReason,
|
|
@@ -12742,11 +12810,18 @@ async function supersedeTask2(id, args) {
|
|
|
12742
12810
|
const finishedAt = new Date().toISOString();
|
|
12743
12811
|
const row = await getDbClient2().get(`UPDATE agent_tasks
|
|
12744
12812
|
SET status = 'superseded',
|
|
12813
|
+
statusKind = ?,
|
|
12745
12814
|
finishedAt = ?,
|
|
12746
12815
|
lastUpdatedAt = strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
|
|
12747
12816
|
WHERE id = ? AND status NOT IN ('completed', 'failed', 'cancelled', 'superseded', 'skipped')
|
|
12748
12817
|
AND (? IS NULL OR lastUpdatedAt = ?)
|
|
12749
|
-
RETURNING *`, [
|
|
12818
|
+
RETURNING *`, [
|
|
12819
|
+
args.statusKind ?? (isTaskStatusKindFor("superseded", args.reason) ? args.reason : null),
|
|
12820
|
+
finishedAt,
|
|
12821
|
+
id,
|
|
12822
|
+
args.expectedLastUpdatedAt ?? null,
|
|
12823
|
+
args.expectedLastUpdatedAt ?? null
|
|
12824
|
+
]);
|
|
12750
12825
|
if (row && oldTask) {
|
|
12751
12826
|
dependencies3.emitTaskLifecycleTelemetryAfterCommit("superseded", {
|
|
12752
12827
|
taskId: id,
|
|
@@ -12767,7 +12842,7 @@ async function supersedeTask2(id, args) {
|
|
|
12767
12842
|
});
|
|
12768
12843
|
} catch {}
|
|
12769
12844
|
getDbClient2().afterCommit(() => {
|
|
12770
|
-
import("./event-bus-
|
|
12845
|
+
import("./event-bus-tvf2grf4.js").then(({ workflowEventBus }) => {
|
|
12771
12846
|
workflowEventBus.emit("task.superseded", {
|
|
12772
12847
|
taskId: id,
|
|
12773
12848
|
reason: args.reason,
|
|
@@ -12786,6 +12861,7 @@ async function supersedeTask2(id, args) {
|
|
|
12786
12861
|
async function markWorkflowStepTaskSuperseded2(id) {
|
|
12787
12862
|
const row = await getDbClient2().get(`UPDATE agent_tasks
|
|
12788
12863
|
SET status = 'superseded',
|
|
12864
|
+
statusKind = 'workflow_retry',
|
|
12789
12865
|
lastUpdatedAt = strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
|
|
12790
12866
|
WHERE id = ? AND status = 'failed' AND failureReason = ?
|
|
12791
12867
|
RETURNING *`, [id, SUPERSEDED_WORKFLOW_TASK_REASON]);
|
|
@@ -13002,7 +13078,7 @@ async function updateTaskProgress2(id, progress) {
|
|
|
13002
13078
|
});
|
|
13003
13079
|
} catch {}
|
|
13004
13080
|
getDbClient2().afterCommit(() => {
|
|
13005
|
-
import("./event-bus-
|
|
13081
|
+
import("./event-bus-tvf2grf4.js").then(({ workflowEventBus }) => {
|
|
13006
13082
|
workflowEventBus.emit("task.progress", {
|
|
13007
13083
|
taskId: id,
|
|
13008
13084
|
progress: scrubbedProgress,
|
|
@@ -13072,6 +13148,21 @@ var init_user_references = __esm(() => {
|
|
|
13072
13148
|
WHERE ${WORKFLOW_CONTEXT_REQUESTER_SQL} = ?`;
|
|
13073
13149
|
});
|
|
13074
13150
|
|
|
13151
|
+
// src/be/db/users/avatar.ts
|
|
13152
|
+
function parseUserAvatar(raw) {
|
|
13153
|
+
if (!raw)
|
|
13154
|
+
return null;
|
|
13155
|
+
try {
|
|
13156
|
+
const parsed = UserAvatarSchema.safeParse(JSON.parse(raw));
|
|
13157
|
+
return parsed.success ? parsed.data : null;
|
|
13158
|
+
} catch {
|
|
13159
|
+
return null;
|
|
13160
|
+
}
|
|
13161
|
+
}
|
|
13162
|
+
var init_avatar = __esm(() => {
|
|
13163
|
+
init_types5();
|
|
13164
|
+
});
|
|
13165
|
+
|
|
13075
13166
|
// src/be/db/workflow-idempotency.ts
|
|
13076
13167
|
function sha256(text) {
|
|
13077
13168
|
const hasher = new Bun.CryptoHasher("sha256");
|
|
@@ -13086,6 +13177,9 @@ function sortKeys(value) {
|
|
|
13086
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)]));
|
|
13087
13178
|
}
|
|
13088
13179
|
function workflowRequestFingerprint(operation, body) {
|
|
13180
|
+
return requestFingerprint(operation, body);
|
|
13181
|
+
}
|
|
13182
|
+
function requestFingerprint(operation, body) {
|
|
13089
13183
|
return sha256(`${operation}
|
|
13090
13184
|
${JSON.stringify(sortKeys(body ?? null))}`);
|
|
13091
13185
|
}
|
|
@@ -13571,7 +13665,7 @@ function emitRunFinished(runId, workflowId, status) {
|
|
|
13571
13665
|
}
|
|
13572
13666
|
function emitBusEventAfterCommit(event, payload) {
|
|
13573
13667
|
getDbClient2().afterCommit(() => {
|
|
13574
|
-
import("./event-bus-
|
|
13668
|
+
import("./event-bus-tvf2grf4.js").then(({ workflowEventBus }) => {
|
|
13575
13669
|
workflowEventBus.emit(event, payload);
|
|
13576
13670
|
}).catch((err) => console.error(`[db] ${event} event not emitted:`, scrubSecrets(err instanceof Error ? err.message : String(err))));
|
|
13577
13671
|
});
|
|
@@ -13659,6 +13753,49 @@ var init_workflow_runs = __esm(() => {
|
|
|
13659
13753
|
};
|
|
13660
13754
|
});
|
|
13661
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
|
+
|
|
13662
13799
|
// src/integrations/chat-sdk/schema.ts
|
|
13663
13800
|
function forbiddenKeyIssues(value, ctx) {
|
|
13664
13801
|
for (const key of FORBIDDEN_ADAPTER_KEYS) {
|
|
@@ -14032,6 +14169,53 @@ function isApiDrainingResponse(response) {
|
|
|
14032
14169
|
var API_DRAINING_HEADER = "X-Swarm-Draining", API_DRAIN_MAX_MS_LIMIT = 120000;
|
|
14033
14170
|
var init_api_drain2 = () => {};
|
|
14034
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
|
+
|
|
14035
14219
|
// src/utils/enabled-tools.ts
|
|
14036
14220
|
function parseEnabledTools(value) {
|
|
14037
14221
|
if (value === undefined)
|
|
@@ -14096,6 +14280,14 @@ var init_task_tool_manifest = __esm(() => {
|
|
|
14096
14280
|
function teamsSdkEnvKeysSql() {
|
|
14097
14281
|
return TEAMS_SDK_ENV_KEYS.map((key) => `'${key}'`).join(", ");
|
|
14098
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
|
+
}
|
|
14099
14291
|
function isApiOnlyConfigKey(key) {
|
|
14100
14292
|
return API_ONLY_CONFIG_KEYS.has(key);
|
|
14101
14293
|
}
|
|
@@ -14111,7 +14303,7 @@ function isHumanOnlyConfigKey(key) {
|
|
|
14111
14303
|
return HUMAN_ONLY_CONFIG_KEYS.has(key.toUpperCase());
|
|
14112
14304
|
}
|
|
14113
14305
|
function humanOnlyConfigKeyError(key) {
|
|
14114
|
-
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.`;
|
|
14115
14307
|
}
|
|
14116
14308
|
function humanOnlyConfigKeyPageError(key) {
|
|
14117
14309
|
return `Key '${key}' cannot be changed from a page session. Change it from the dashboard or with a user token.`;
|
|
@@ -14234,6 +14426,16 @@ function validateDockerPidsLimit(value) {
|
|
|
14234
14426
|
const limit = value.trim();
|
|
14235
14427
|
return !limit || /^[1-9]\d*$/.test(limit) && Number.isSafeInteger(Number(limit)) ? null : "Invalid DOCKER_PIDS_LIMIT (must be a positive integer, or empty)";
|
|
14236
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
|
+
}
|
|
14237
14439
|
function validateConfigValue(key, value) {
|
|
14238
14440
|
if (isTierConfigKey(key))
|
|
14239
14441
|
return validateTierConfigValue(key.toUpperCase(), value);
|
|
@@ -14246,6 +14448,9 @@ function validateConfigEntry(entry) {
|
|
|
14246
14448
|
if ((entry.scope === "agent" || entry.scope === "repo") && !entry.scopeId) {
|
|
14247
14449
|
return "Agent/repo scope requires scopeId";
|
|
14248
14450
|
}
|
|
14451
|
+
const keyError = invalidConfigKeyError(entry.key);
|
|
14452
|
+
if (keyError)
|
|
14453
|
+
return keyError;
|
|
14249
14454
|
if (isReservedConfigKey(entry.key))
|
|
14250
14455
|
return reservedKeyError(entry.key).message;
|
|
14251
14456
|
if (isInternalConfigKey(entry.key))
|
|
@@ -14255,7 +14460,7 @@ function validateConfigEntry(entry) {
|
|
|
14255
14460
|
function validateExportToEnv(key, exportToEnv) {
|
|
14256
14461
|
return exportToEnv === true && isEnvExportRestrictedKey(key) ? envExportRestrictedError(key) : null;
|
|
14257
14462
|
}
|
|
14258
|
-
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;
|
|
14259
14464
|
var init_swarm_config_guard = __esm(() => {
|
|
14260
14465
|
init_schema();
|
|
14261
14466
|
init_telemetry_ranking();
|
|
@@ -14266,10 +14471,12 @@ var init_swarm_config_guard = __esm(() => {
|
|
|
14266
14471
|
init_api_drain2();
|
|
14267
14472
|
init_company_profile();
|
|
14268
14473
|
init_config_env_export();
|
|
14474
|
+
init_deferral_time();
|
|
14269
14475
|
init_egress_guard();
|
|
14270
14476
|
init_enabled_tools();
|
|
14271
14477
|
init_follow_up_gate_schedule_ids();
|
|
14272
14478
|
init_models2();
|
|
14479
|
+
init_key_usage();
|
|
14273
14480
|
init_org_website();
|
|
14274
14481
|
init_task_tool_manifest();
|
|
14275
14482
|
init_model_tier_keys();
|
|
@@ -14292,8 +14499,24 @@ var init_swarm_config_guard = __esm(() => {
|
|
|
14292
14499
|
"CLOUDFLARE_API_BASE_URL",
|
|
14293
14500
|
"GITHUB_URL",
|
|
14294
14501
|
"GITHUB_API_URL",
|
|
14295
|
-
"GITHUB_APP_INSTALLATION_ID"
|
|
14502
|
+
"GITHUB_APP_INSTALLATION_ID",
|
|
14503
|
+
"GITHUB_APP_REPO_OWNERS",
|
|
14504
|
+
"OPENCODE_SDK_PATH",
|
|
14505
|
+
"SCRIPT_API_BASE_URL"
|
|
14296
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"
|
|
14518
|
+
]);
|
|
14519
|
+
API_PROCESS_CONTROL_ENV_PREFIXES = ["LD_", "DYLD_", "BASH_", "BUN_INSPECT"];
|
|
14297
14520
|
API_ONLY_CONFIG_KEYS = new Set([
|
|
14298
14521
|
"API_AGENT_FS_API_KEY",
|
|
14299
14522
|
"SLACK_SIGNING_SECRET",
|
|
@@ -14304,7 +14527,10 @@ var init_swarm_config_guard = __esm(() => {
|
|
|
14304
14527
|
"runtime_owner_id",
|
|
14305
14528
|
TELEMETRY_RANKING_KEY
|
|
14306
14529
|
]);
|
|
14307
|
-
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
|
+
]);
|
|
14308
14534
|
BOOLEAN_LITERALS = ["true", "false", "1", "0"];
|
|
14309
14535
|
DB_RETENTION_TUNING_BOUNDS = {
|
|
14310
14536
|
DB_RETENTION_TICK_BUDGET_MS: { min: 1000, max: 300000 },
|
|
@@ -14312,6 +14538,7 @@ var init_swarm_config_guard = __esm(() => {
|
|
|
14312
14538
|
DB_RETENTION_MAX_STATEMENT_MS: { min: 25, max: 5000 }
|
|
14313
14539
|
};
|
|
14314
14540
|
APPS_JSON_COLUMN_MAX_BYTES_BOUNDS = { min: 1024, max: 16777216 };
|
|
14541
|
+
APPS_DEFINITION_LIMIT_BOUNDS = { min: 1, max: 1000 };
|
|
14315
14542
|
CODEX_OAUTH_KEEP_WARM_MAX_AGE_HOURS_BOUNDS = { min: 1, max: 216 };
|
|
14316
14543
|
SCHEDULER_INTERVAL_MS_BOUNDS = { min: 1, max: 2147483647 };
|
|
14317
14544
|
SYSTEM_ONE_DEFAULT_PROVIDER_OPTIONS = [
|
|
@@ -14325,6 +14552,8 @@ var init_swarm_config_guard = __esm(() => {
|
|
|
14325
14552
|
validateControllerTokenTtlDays = boundedIntegerValidators(["RUNTIME_CONTROLLER_TOKEN_TTL_DAYS"], 1, 3650).RUNTIME_CONTROLLER_TOKEN_TTL_DAYS;
|
|
14326
14553
|
validateControllerGraceSec = boundedIntegerValidators(["RUNTIME_CONTROLLER_GRACE_SEC"], 0, 86400).RUNTIME_CONTROLLER_GRACE_SEC;
|
|
14327
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,
|
|
14328
14557
|
[UI_SPEC_SCRIPT_ACTIONS_KEY]: validateScriptActionAllowlist,
|
|
14329
14558
|
...booleanValidators(["RUNTIME_POOLS_ENABLED", "DOCKER_HARDENED"]),
|
|
14330
14559
|
DOCKER_RUNTIME: validateDockerRuntime,
|
|
@@ -14421,6 +14650,7 @@ var init_swarm_config_guard = __esm(() => {
|
|
|
14421
14650
|
...booleanValidators(["SCRIPT_EGRESS_ALLOW_PRIVATE"]),
|
|
14422
14651
|
SCRIPT_EGRESS_ALLOWLIST: (value) => typeof value === "string" ? validateEgressAllowlist(value) : "Invalid SCRIPT_EGRESS_ALLOWLIST",
|
|
14423
14652
|
...enumValidator("MODEL_WINDOW_EXHAUSTED_POLICY", ["fail", "fallback"]),
|
|
14653
|
+
...enumValidator("CREDENTIAL_SELECTION_STRATEGY", [...CREDENTIAL_SELECTION_STRATEGIES]),
|
|
14424
14654
|
...enumValidator("HEARTBEAT_CHECKLIST_GATE_MODE", ["shadow", "enforce"]),
|
|
14425
14655
|
...enumValidator("FOLLOW_UP_GATE_MODE", ["off", "shadow"]),
|
|
14426
14656
|
FOLLOW_UP_GATE_SCHEDULE_IDS: (value) => {
|
|
@@ -14570,6 +14800,7 @@ var init_swarm_config_guard = __esm(() => {
|
|
|
14570
14800
|
], 1),
|
|
14571
14801
|
...boundedIntegerValidatorsFor(DB_RETENTION_TUNING_BOUNDS),
|
|
14572
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),
|
|
14573
14804
|
...boundedIntegerValidators(["SCHEDULER_INTERVAL_MS"], SCHEDULER_INTERVAL_MS_BOUNDS.min, SCHEDULER_INTERVAL_MS_BOUNDS.max),
|
|
14574
14805
|
...enumValidator("WORKTREE_REAPER_MODE", ["off", "dry-run", "on"]),
|
|
14575
14806
|
...boundedIntegerValidators(["WORKTREE_TTL_HOURS"], 1, 2160),
|
|
@@ -23152,6 +23383,443 @@ var init_openai2 = __esm(() => {
|
|
|
23152
23383
|
init_azure();
|
|
23153
23384
|
});
|
|
23154
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
|
+
|
|
23155
23823
|
// src/be/memory/constants.ts
|
|
23156
23824
|
function numEnv(key, fallback) {
|
|
23157
23825
|
const val = process.env[key];
|
|
@@ -23227,7 +23895,7 @@ function noteEmbeddingSuccess() {
|
|
|
23227
23895
|
const report = (what) => (err) => {
|
|
23228
23896
|
console.error(`[memory] ${what} backfill after embeddings recovered failed:`, err.message);
|
|
23229
23897
|
};
|
|
23230
|
-
backfill2 = import("./embedding-space-
|
|
23898
|
+
backfill2 = import("./embedding-space-zsdw37bb.js").then(({ runEmbeddingMaintenance }) => runEmbeddingMaintenance({ backfill: true })).catch(report("Embedding")).finally(() => {
|
|
23231
23899
|
backfill2 = null;
|
|
23232
23900
|
});
|
|
23233
23901
|
}
|
|
@@ -23318,10 +23986,12 @@ class OpenAIEmbeddingProvider {
|
|
|
23318
23986
|
return null;
|
|
23319
23987
|
if (!this.client) {
|
|
23320
23988
|
const baseURL = this.baseURL;
|
|
23989
|
+
const endpoint = embeddingEndpoint2(baseURL ?? null);
|
|
23321
23990
|
this.client = new OpenAI2({
|
|
23322
23991
|
baseURL,
|
|
23323
23992
|
apiKey: this.apiKey,
|
|
23324
|
-
defaultHeaders: getOpenRouterAttributionHeaders(baseURL ?? "")
|
|
23993
|
+
defaultHeaders: getOpenRouterAttributionHeaders(baseURL ?? ""),
|
|
23994
|
+
fetch: endpoint && !endpoint.fromDeployment ? createSsrfGuardedFetch(publicEndpointSsrfOptions()) : undefined
|
|
23325
23995
|
});
|
|
23326
23996
|
}
|
|
23327
23997
|
return this.client;
|
|
@@ -23430,10 +24100,13 @@ class OpenAIEmbeddingProvider {
|
|
|
23430
24100
|
var MAX_EMBEDDING_INPUT_CHARS = 24000, MIN_EMBEDDING_INPUT_CHARS = 1000, MAX_BATCH_REQUEST_CHARS = 200000;
|
|
23431
24101
|
var init_openai_embedding = __esm(() => {
|
|
23432
24102
|
init_openai2();
|
|
24103
|
+
init_mcp_wrapper();
|
|
23433
24104
|
init_credentials2();
|
|
24105
|
+
init_egress_guard();
|
|
23434
24106
|
init_openrouter_base_url();
|
|
23435
24107
|
init_constants2();
|
|
23436
24108
|
init_embedding_recovery();
|
|
24109
|
+
init_memory();
|
|
23437
24110
|
});
|
|
23438
24111
|
|
|
23439
24112
|
// src/be/memory/key-paths.ts
|
|
@@ -23943,7 +24616,7 @@ function applyEditMode(mode, currentContent, fields) {
|
|
|
23943
24616
|
}
|
|
23944
24617
|
return currentContent.slice(0, first) + fields.newString + currentContent.slice(first + fields.oldString.length);
|
|
23945
24618
|
}
|
|
23946
|
-
function
|
|
24619
|
+
function computeExpiresAt2(source, key) {
|
|
23947
24620
|
const ttlDays = isLearningKey(key) ? LEARNING_TTL_DAYS : TTL_DEFAULTS[tierSource(source, key)];
|
|
23948
24621
|
if (ttlDays == null)
|
|
23949
24622
|
return null;
|
|
@@ -24172,7 +24845,7 @@ class SqliteMemoryStore {
|
|
|
24172
24845
|
const id = crypto.randomUUID();
|
|
24173
24846
|
const now = new Date().toISOString();
|
|
24174
24847
|
const key = input.key ?? `${input.scope}/${input.source}/${id}`;
|
|
24175
|
-
const expiresAt =
|
|
24848
|
+
const expiresAt = computeExpiresAt2(input.source, key);
|
|
24176
24849
|
const name = scrubSecrets(input.name);
|
|
24177
24850
|
const content = scrubSecrets(input.content);
|
|
24178
24851
|
const summary = input.summary == null ? null : scrubSecrets(input.summary);
|
|
@@ -24698,7 +25371,7 @@ class SqliteMemoryStore {
|
|
|
24698
25371
|
throw new Error(`key "${input.newKey}" is already used in this scope`);
|
|
24699
25372
|
}
|
|
24700
25373
|
const resetExpiry = moving && (isLongtermKey(input.newKey) || isLearningKey(row.key) !== isLearningKey(input.newKey));
|
|
24701
|
-
const expiresAt = resetExpiry ?
|
|
25374
|
+
const expiresAt = resetExpiry ? computeExpiresAt2(row.source, input.newKey) : row.expiresAt;
|
|
24702
25375
|
const now = new Date().toISOString();
|
|
24703
25376
|
const versionIntent = moving ? `${input.intent} [key ${row.key ?? "(none)"} -> ${input.newKey}]` : input.intent;
|
|
24704
25377
|
let nextVersion = previousVersion + 1;
|
|
@@ -25122,7 +25795,27 @@ function getMemoryStore2() {
|
|
|
25122
25795
|
}
|
|
25123
25796
|
return memoryStore;
|
|
25124
25797
|
}
|
|
25125
|
-
|
|
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
|
+
};
|
|
25126
25819
|
var init_memory = () => {};
|
|
25127
25820
|
|
|
25128
25821
|
// src/be/scripts/embeddings.ts
|
|
@@ -25796,7 +26489,7 @@ async function loadSecretRegistry() {
|
|
|
25796
26489
|
result.failed += 1;
|
|
25797
26490
|
}
|
|
25798
26491
|
try {
|
|
25799
|
-
const { loadRuntimeControllerSecrets } = await import("./db-
|
|
26492
|
+
const { loadRuntimeControllerSecrets } = await import("./db-gd81d68c.js");
|
|
25800
26493
|
const loaded = await loadRuntimeControllerSecrets();
|
|
25801
26494
|
result.runtimeController = loaded.count;
|
|
25802
26495
|
result.failed += loaded.failed;
|
|
@@ -25957,7 +26650,7 @@ async function requestSteering(args) {
|
|
|
25957
26650
|
}
|
|
25958
26651
|
const requestedMode = args.mode ?? "queue";
|
|
25959
26652
|
const onUnsupported = args.onUnsupported ?? "degrade";
|
|
25960
|
-
const { dispatchPre, extensionIdForAgent } = await import("./dispatcher-
|
|
26653
|
+
const { dispatchPre, extensionIdForAgent } = await import("./dispatcher-76as8w2t.js");
|
|
25961
26654
|
const preSteer = await dispatchPre("pre.task.steer", {
|
|
25962
26655
|
task,
|
|
25963
26656
|
message: args.message,
|
|
@@ -26166,6 +26859,24 @@ async function setScriptRunFollowUpGuard2(runId, decision) {
|
|
|
26166
26859
|
runId
|
|
26167
26860
|
]);
|
|
26168
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
|
+
}
|
|
26169
26880
|
var init_script_runs = __esm(() => {
|
|
26170
26881
|
init_sealed_json();
|
|
26171
26882
|
init_runtime2();
|
|
@@ -26531,6 +27242,7 @@ __export(exports_db, {
|
|
|
26531
27242
|
getWorkflowRunStepsByRunId: () => getWorkflowRunStepsByRunId2,
|
|
26532
27243
|
getWorkflowVersion: () => getWorkflowVersion2,
|
|
26533
27244
|
getWorkflowVersions: () => getWorkflowVersions2,
|
|
27245
|
+
getWorkflowsByEventName: () => getWorkflowsByEventName2,
|
|
26534
27246
|
getWorkflowsByScheduleId: () => getWorkflowsByScheduleId2,
|
|
26535
27247
|
giveUpStaleChatRelays: () => giveUpStaleChatRelays2,
|
|
26536
27248
|
hasBudgetRefusalNotificationToday: () => hasBudgetRefusalNotificationToday2,
|
|
@@ -28202,7 +28914,7 @@ async function createTaskExtended2(task, options) {
|
|
|
28202
28914
|
priority: row.priority
|
|
28203
28915
|
}, (task) => task !== null, row.requestedByUserId);
|
|
28204
28916
|
getDbClient2().afterCommit(() => {
|
|
28205
|
-
import("./event-bus-
|
|
28917
|
+
import("./event-bus-tvf2grf4.js").then(({ workflowEventBus }) => {
|
|
28206
28918
|
workflowEventBus.emit("task.created", {
|
|
28207
28919
|
taskId: row.id,
|
|
28208
28920
|
task: row.task,
|
|
@@ -28284,7 +28996,7 @@ async function releaseTask2(taskId, wakeSnapshot) {
|
|
|
28284
28996
|
} catch {}
|
|
28285
28997
|
if (isRuntimePoolsEnabled() && !wakeSnapshot)
|
|
28286
28998
|
getDbClient2().afterCommit(() => {
|
|
28287
|
-
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))));
|
|
28288
29000
|
});
|
|
28289
29001
|
}
|
|
28290
29002
|
return row ? rowToAgentTask(row) : null;
|
|
@@ -28354,7 +29066,7 @@ async function rejectTask2(taskId, agentId, reason) {
|
|
|
28354
29066
|
} catch {}
|
|
28355
29067
|
if (isRuntimePoolsEnabled())
|
|
28356
29068
|
getDbClient2().afterCommit(() => {
|
|
28357
|
-
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))));
|
|
28358
29070
|
});
|
|
28359
29071
|
}
|
|
28360
29072
|
return row ? rowToAgentTask(row) : null;
|
|
@@ -28579,7 +29291,7 @@ async function cascadeFailDependents2(parentId, parentStatus, visited) {
|
|
|
28579
29291
|
if (seen.has(dep.id))
|
|
28580
29292
|
continue;
|
|
28581
29293
|
const reason = `Blocked dependency ${parentId.slice(0, 8)} was ${parentStatus}`;
|
|
28582
|
-
const failed = await failTask2(dep.id, reason);
|
|
29294
|
+
const failed = await failTask2(dep.id, reason, { statusKind: "cascade" });
|
|
28583
29295
|
if (failed) {
|
|
28584
29296
|
results.push({
|
|
28585
29297
|
taskId: failed.id,
|
|
@@ -30017,7 +30729,7 @@ async function deleteScheduledTask2(id) {
|
|
|
30017
30729
|
const parent = await getTaskById2(deferred.parentTaskId);
|
|
30018
30730
|
if (!parent?.deferredAt)
|
|
30019
30731
|
return;
|
|
30020
|
-
const { createWorkerTaskFollowUp } = await import("./worker-follow-up-
|
|
30732
|
+
const { createWorkerTaskFollowUp } = await import("./worker-follow-up-fg48vk6d.js");
|
|
30021
30733
|
await createWorkerTaskFollowUp({
|
|
30022
30734
|
task: parent,
|
|
30023
30735
|
status: "failed",
|
|
@@ -30121,39 +30833,6 @@ function autoEncryptLegacyPlaintextSecrets2(database, dbPath, options = {}) {
|
|
|
30121
30833
|
function maskSecrets2(configs) {
|
|
30122
30834
|
return configs.map((c) => c.isSecret ? { ...c, value: MASKED_SECRET_VALUE } : c);
|
|
30123
30835
|
}
|
|
30124
|
-
function writeEnvFile(configs) {
|
|
30125
|
-
const { readFileSync, writeFileSync } = __require("node:fs");
|
|
30126
|
-
const byPath = new Map;
|
|
30127
|
-
for (const config of configs) {
|
|
30128
|
-
if (!config.envPath)
|
|
30129
|
-
continue;
|
|
30130
|
-
const existing = byPath.get(config.envPath) ?? [];
|
|
30131
|
-
existing.push(config);
|
|
30132
|
-
byPath.set(config.envPath, existing);
|
|
30133
|
-
}
|
|
30134
|
-
for (const [envPath, entries] of byPath) {
|
|
30135
|
-
let lines = [];
|
|
30136
|
-
try {
|
|
30137
|
-
const content = readFileSync(envPath, "utf-8");
|
|
30138
|
-
lines = content.split(`
|
|
30139
|
-
`);
|
|
30140
|
-
} catch {}
|
|
30141
|
-
for (const entry of entries) {
|
|
30142
|
-
const prefix = `${entry.key}=`;
|
|
30143
|
-
const lineIndex = lines.findIndex((l) => l.startsWith(prefix));
|
|
30144
|
-
const newLine = `${entry.key}=${entry.value}`;
|
|
30145
|
-
if (lineIndex >= 0) {
|
|
30146
|
-
lines[lineIndex] = newLine;
|
|
30147
|
-
} else {
|
|
30148
|
-
lines.push(newLine);
|
|
30149
|
-
}
|
|
30150
|
-
}
|
|
30151
|
-
const output = `${lines.filter((l) => l !== "").join(`
|
|
30152
|
-
`)}
|
|
30153
|
-
`;
|
|
30154
|
-
writeFileSync(envPath, output, "utf-8");
|
|
30155
|
-
}
|
|
30156
|
-
}
|
|
30157
30836
|
async function getSwarmConfigs2(filters) {
|
|
30158
30837
|
const conditions = [];
|
|
30159
30838
|
const params = [];
|
|
@@ -30179,7 +30858,7 @@ async function getInjectableGlobalConfigs2() {
|
|
|
30179
30858
|
WHERE scope = 'global'
|
|
30180
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()})
|
|
30181
30860
|
ORDER BY key ASC`);
|
|
30182
|
-
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);
|
|
30183
30862
|
}
|
|
30184
30863
|
async function getSwarmConfigById2(id) {
|
|
30185
30864
|
const row = await getDbClient2().get("SELECT * FROM swarm_config WHERE id = ?", [
|
|
@@ -30201,6 +30880,9 @@ async function getSwarmConfigLookupById2(id) {
|
|
|
30201
30880
|
};
|
|
30202
30881
|
}
|
|
30203
30882
|
async function upsertSwarmConfig2(data) {
|
|
30883
|
+
const keyError = invalidConfigKeyError(data.key);
|
|
30884
|
+
if (keyError)
|
|
30885
|
+
throw new Error(keyError);
|
|
30204
30886
|
if (isReservedConfigKey(data.key)) {
|
|
30205
30887
|
throw reservedKeyError(data.key);
|
|
30206
30888
|
}
|
|
@@ -30252,13 +30934,6 @@ async function upsertSwarmConfig2(data) {
|
|
|
30252
30934
|
if (!row)
|
|
30253
30935
|
throw new Error("Failed to upsert swarm config");
|
|
30254
30936
|
const config = rowToSwarmConfig(row);
|
|
30255
|
-
if (config.envPath) {
|
|
30256
|
-
try {
|
|
30257
|
-
writeEnvFile([config]);
|
|
30258
|
-
} catch (e) {
|
|
30259
|
-
console.error(`Failed to write env file ${config.envPath}:`, e);
|
|
30260
|
-
}
|
|
30261
|
-
}
|
|
30262
30937
|
if (config.isSecret) {
|
|
30263
30938
|
registerStoredSecret(config.value, configSecretName(config.key));
|
|
30264
30939
|
registerSensitiveKeyName(config.key);
|
|
@@ -30546,8 +31221,8 @@ async function getStalePinnedResumes2(graceMin) {
|
|
|
30546
31221
|
async function failPendingResumeIfUnclaimed2(taskId, status, failureReason) {
|
|
30547
31222
|
const now = new Date().toISOString();
|
|
30548
31223
|
const scrubbedReason = scrubSecrets(failureReason);
|
|
30549
|
-
const row = await getDbClient2().get(`UPDATE agent_tasks SET status = ?, failureReason = ?, finishedAt = ?, lastUpdatedAt = ?
|
|
30550
|
-
WHERE id = ? AND status = 'pending' RETURNING *`, [status, scrubbedReason, now, now, taskId]);
|
|
31224
|
+
const row = await getDbClient2().get(`UPDATE agent_tasks SET status = ?, statusKind = ?, failureReason = ?, finishedAt = ?, lastUpdatedAt = ?
|
|
31225
|
+
WHERE id = ? AND status = 'pending' RETURNING *`, [status, status === "failed" ? "error" : "system", scrubbedReason, now, now, taskId]);
|
|
30551
31226
|
if (row) {
|
|
30552
31227
|
try {
|
|
30553
31228
|
await createLogEntry2({
|
|
@@ -30606,31 +31281,6 @@ async function getRecentFailedCount2(hours = 24) {
|
|
|
30606
31281
|
WHERE status = 'failed' AND finishedAt > ?`, [since]);
|
|
30607
31282
|
return row?.count ?? 0;
|
|
30608
31283
|
}
|
|
30609
|
-
function rowToWorkflow(row) {
|
|
30610
|
-
return {
|
|
30611
|
-
id: row.id,
|
|
30612
|
-
key: row.key,
|
|
30613
|
-
name: row.name,
|
|
30614
|
-
description: row.description ?? undefined,
|
|
30615
|
-
enabled: row.enabled === 1,
|
|
30616
|
-
definition: JSON.parse(row.definition),
|
|
30617
|
-
triggers: JSON.parse(row.triggers),
|
|
30618
|
-
cooldown: row.cooldown ? JSON.parse(row.cooldown) : undefined,
|
|
30619
|
-
input: row.input ? JSON.parse(row.input) : undefined,
|
|
30620
|
-
triggerSchema: row.triggerSchema ? JSON.parse(row.triggerSchema) : undefined,
|
|
30621
|
-
params: JSON.parse(row.params),
|
|
30622
|
-
requiredParams: JSON.parse(row.requiredParams),
|
|
30623
|
-
requires: JSON.parse(row.requires),
|
|
30624
|
-
dir: row.dir ?? undefined,
|
|
30625
|
-
vcsRepo: row.vcs_repo ?? undefined,
|
|
30626
|
-
createdByAgentId: row.createdByAgentId ?? undefined,
|
|
30627
|
-
updatedByAgentId: row.updatedByAgentId ?? undefined,
|
|
30628
|
-
createdAt: normalizeDateRequired(row.createdAt),
|
|
30629
|
-
lastUpdatedAt: normalizeDateRequired(row.lastUpdatedAt),
|
|
30630
|
-
createdBy: row.created_by ?? undefined,
|
|
30631
|
-
updatedBy: row.updated_by ?? undefined
|
|
30632
|
-
};
|
|
30633
|
-
}
|
|
30634
31284
|
async function createWorkflow2(data, source) {
|
|
30635
31285
|
const id = crypto.randomUUID();
|
|
30636
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)
|
|
@@ -33000,6 +33650,33 @@ async function getAvailableKeyIndices2(keyType, totalKeys, scope = "global", sco
|
|
|
33000
33650
|
continue;
|
|
33001
33651
|
availableIndices.push(i);
|
|
33002
33652
|
}
|
|
33653
|
+
const keyUsage = new Array(totalKeys).fill(0);
|
|
33654
|
+
const keyPace = new Array(totalKeys).fill(undefined);
|
|
33655
|
+
for (const row of rows) {
|
|
33656
|
+
const windows = parseRateLimitWindowsJson(row.rateLimitWindows);
|
|
33657
|
+
const usage = keyUsageFromWindows(windows, nowMs);
|
|
33658
|
+
const pace = keyPaceFromWindows(windows, nowMs, modelFamily);
|
|
33659
|
+
for (const i of positionsOf(row)) {
|
|
33660
|
+
if (i < 0 || i >= totalKeys)
|
|
33661
|
+
continue;
|
|
33662
|
+
keyUsage[i] = Math.max(keyUsage[i], usage);
|
|
33663
|
+
if (pace !== undefined)
|
|
33664
|
+
keyPace[i] = Math.max(keyPace[i] ?? Number.NEGATIVE_INFINITY, pace);
|
|
33665
|
+
}
|
|
33666
|
+
}
|
|
33667
|
+
const suffixAt = (i) => suffixes ? suffixes[i] : rows.find((r) => r.keyIndex === i && r.scope === scope && r.scopeId === effectiveScopeId)?.keySuffix;
|
|
33668
|
+
const positionSuffixes = Array.from({ length: totalKeys }, (_, i) => suffixAt(i));
|
|
33669
|
+
const distinctSuffixes = [...new Set(positionSuffixes.filter((s) => !!s))];
|
|
33670
|
+
const sessionsBySuffix = new Map;
|
|
33671
|
+
if (distinctSuffixes.length > 0) {
|
|
33672
|
+
const counts = await client.query(`SELECT credentialKeySuffix AS suffix, COUNT(*) AS n FROM agent_tasks
|
|
33673
|
+
WHERE status = 'in_progress' AND credentialKeyType = ?
|
|
33674
|
+
AND credentialKeySuffix IN (${distinctSuffixes.map(() => "?").join(", ")})
|
|
33675
|
+
GROUP BY credentialKeySuffix`, [keyType, ...distinctSuffixes]);
|
|
33676
|
+
for (const { suffix, n } of counts)
|
|
33677
|
+
sessionsBySuffix.set(suffix, n);
|
|
33678
|
+
}
|
|
33679
|
+
const activeSessions = positionSuffixes.map((s) => s ? sessionsBySuffix.get(s) ?? 0 : 0);
|
|
33003
33680
|
return {
|
|
33004
33681
|
availableIndices,
|
|
33005
33682
|
rejectedIndices,
|
|
@@ -33007,7 +33684,10 @@ async function getAvailableKeyIndices2(keyType, totalKeys, scope = "global", sco
|
|
|
33007
33684
|
seatBlockedIndices,
|
|
33008
33685
|
spendCappedIndices,
|
|
33009
33686
|
earliestModelResetAt: earliestModelResetsAtSec !== undefined ? new Date(earliestModelResetsAtSec * 1000).toISOString() : null,
|
|
33010
|
-
authFailureFence: Math.max(0, ...rows.map((r) => r.authFailureSeq))
|
|
33687
|
+
authFailureFence: Math.max(0, ...rows.map((r) => r.authFailureSeq)),
|
|
33688
|
+
keyUsage,
|
|
33689
|
+
keyPace: keyPace.map((pace) => pace ?? 0),
|
|
33690
|
+
activeSessions
|
|
33011
33691
|
};
|
|
33012
33692
|
}
|
|
33013
33693
|
async function recordKeyUsage2(keyType, keySuffix, keyIndex, taskId, scope = "global", scopeId = null, plan = null, planRaw) {
|
|
@@ -33250,6 +33930,7 @@ function rowToUser(row) {
|
|
|
33250
33930
|
dailyBudgetUsd: row.dailyBudgetUsd ?? null,
|
|
33251
33931
|
status: row.status ?? "active",
|
|
33252
33932
|
...row.mergedIntoUserId ? { mergedIntoUserId: row.mergedIntoUserId } : {},
|
|
33933
|
+
avatar: parseUserAvatar(row.avatar),
|
|
33253
33934
|
createdAt: row.createdAt,
|
|
33254
33935
|
lastUpdatedAt: row.lastUpdatedAt
|
|
33255
33936
|
};
|
|
@@ -33265,8 +33946,8 @@ async function getAllUsers2() {
|
|
|
33265
33946
|
async function createUser2(data) {
|
|
33266
33947
|
const id = crypto.randomUUID().replace(/-/g, "");
|
|
33267
33948
|
const now = new Date().toISOString();
|
|
33268
|
-
const row = await getDbClient2().get(`INSERT INTO users (id, name, email, role, notes, emailAliases, preferredChannel, timezone, metadata, dailyBudgetUsd, status, createdAt, lastUpdatedAt)
|
|
33269
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING *`, [
|
|
33949
|
+
const row = await getDbClient2().get(`INSERT INTO users (id, name, email, role, notes, emailAliases, preferredChannel, timezone, metadata, dailyBudgetUsd, status, avatar, createdAt, lastUpdatedAt)
|
|
33950
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING *`, [
|
|
33270
33951
|
id,
|
|
33271
33952
|
data.name,
|
|
33272
33953
|
data.email ?? null,
|
|
@@ -33278,6 +33959,7 @@ async function createUser2(data) {
|
|
|
33278
33959
|
data.metadata !== undefined ? JSON.stringify(data.metadata) : null,
|
|
33279
33960
|
data.dailyBudgetUsd ?? null,
|
|
33280
33961
|
data.status ?? "active",
|
|
33962
|
+
data.avatar ? JSON.stringify(data.avatar) : null,
|
|
33281
33963
|
now,
|
|
33282
33964
|
now
|
|
33283
33965
|
]);
|
|
@@ -33329,6 +34011,10 @@ async function updateUser2(id, data) {
|
|
|
33329
34011
|
sets.push("status = ?");
|
|
33330
34012
|
params.push(data.status);
|
|
33331
34013
|
}
|
|
34014
|
+
if (data.avatar !== undefined) {
|
|
34015
|
+
sets.push("avatar = ?");
|
|
34016
|
+
params.push(data.avatar === null ? null : JSON.stringify(data.avatar));
|
|
34017
|
+
}
|
|
33332
34018
|
if (sets.length === 0)
|
|
33333
34019
|
return getUserById2(id);
|
|
33334
34020
|
sets.push("lastUpdatedAt = ?");
|
|
@@ -34066,6 +34752,9 @@ function parseJsonColumn(value) {
|
|
|
34066
34752
|
}
|
|
34067
34753
|
function rowToScriptRun(row) {
|
|
34068
34754
|
return {
|
|
34755
|
+
objectScriptId: row.objectScriptId ?? undefined,
|
|
34756
|
+
objectId: row.objectId == null ? undefined : scrubSecrets(row.objectId),
|
|
34757
|
+
objectMethod: row.objectMethod ?? undefined,
|
|
34069
34758
|
id: row.id,
|
|
34070
34759
|
agentId: row.agentId,
|
|
34071
34760
|
scriptName: row.scriptName ?? undefined,
|
|
@@ -34086,6 +34775,9 @@ function rowToScriptRun(row) {
|
|
|
34086
34775
|
}
|
|
34087
34776
|
function rowToScriptRunListItem(row) {
|
|
34088
34777
|
return {
|
|
34778
|
+
objectScriptId: row.objectScriptId ?? undefined,
|
|
34779
|
+
objectId: row.objectId == null ? undefined : scrubSecrets(row.objectId),
|
|
34780
|
+
objectMethod: row.objectMethod ?? undefined,
|
|
34089
34781
|
id: row.id,
|
|
34090
34782
|
agentId: row.agentId,
|
|
34091
34783
|
scriptName: row.scriptName ?? undefined,
|
|
@@ -34141,8 +34833,8 @@ async function recordInlineScriptRun2(data) {
|
|
|
34141
34833
|
const row = await client.get(`INSERT INTO script_runs
|
|
34142
34834
|
(id, agentId, scriptName, source, sourceHash, args, kind, status, output, error,
|
|
34143
34835
|
startedAt, finishedAt, requestedByUserId, created_by, updated_by, apiEndpointId,
|
|
34144
|
-
sourceStepId, parentScriptRunId)
|
|
34145
|
-
VALUES (?, ?, ?, '', ?, ?, 'inline', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
34836
|
+
sourceStepId, parentScriptRunId, objectScriptId, objectId, objectMethod)
|
|
34837
|
+
VALUES (?, ?, ?, '', ?, ?, 'inline', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
34146
34838
|
RETURNING *`, [
|
|
34147
34839
|
data.id,
|
|
34148
34840
|
data.agentId,
|
|
@@ -34159,7 +34851,10 @@ async function recordInlineScriptRun2(data) {
|
|
|
34159
34851
|
data.createdBy ?? null,
|
|
34160
34852
|
data.apiEndpointId ?? null,
|
|
34161
34853
|
provenance?.sourceStepId ?? null,
|
|
34162
|
-
provenance?.sourceScriptRunId ?? null
|
|
34854
|
+
provenance?.sourceScriptRunId ?? null,
|
|
34855
|
+
data.objectScriptId ?? null,
|
|
34856
|
+
data.objectId ?? null,
|
|
34857
|
+
data.objectMethod ?? null
|
|
34163
34858
|
]);
|
|
34164
34859
|
if (!row)
|
|
34165
34860
|
throw new Error("Failed to record inline script run");
|
|
@@ -34175,20 +34870,8 @@ async function getScriptRunByIdempotencyKey2(idempotencyKey) {
|
|
|
34175
34870
|
return row ? rowToScriptRun(row) : null;
|
|
34176
34871
|
}
|
|
34177
34872
|
async function listScriptRuns2(opts) {
|
|
34178
|
-
const conditions =
|
|
34179
|
-
const params = [];
|
|
34180
|
-
if (opts?.status) {
|
|
34181
|
-
conditions.push("status = ?");
|
|
34182
|
-
params.push(opts.status);
|
|
34183
|
-
}
|
|
34184
|
-
if (opts?.agentId) {
|
|
34185
|
-
conditions.push("agentId = ?");
|
|
34186
|
-
params.push(opts.agentId);
|
|
34187
|
-
}
|
|
34188
|
-
if (opts?.scriptName) {
|
|
34189
|
-
conditions.push("scriptName = ?");
|
|
34190
|
-
params.push(opts.scriptName);
|
|
34191
|
-
}
|
|
34873
|
+
const { conditions, params: filterParams } = scriptRunFilterSql(opts);
|
|
34874
|
+
const params = [...filterParams];
|
|
34192
34875
|
const limit = opts?.limit ?? 50;
|
|
34193
34876
|
const offset = opts?.offset ?? 0;
|
|
34194
34877
|
params.push(limit, offset);
|
|
@@ -34205,27 +34888,17 @@ async function listScriptRuns2(opts) {
|
|
|
34205
34888
|
error,
|
|
34206
34889
|
last_heartbeat_at,
|
|
34207
34890
|
idempotencyKey,
|
|
34208
|
-
requestedByUserId
|
|
34891
|
+
requestedByUserId,
|
|
34892
|
+
objectScriptId,
|
|
34893
|
+
objectId,
|
|
34894
|
+
objectMethod
|
|
34209
34895
|
FROM script_runs ${where}
|
|
34210
34896
|
ORDER BY startedAt DESC
|
|
34211
34897
|
LIMIT ? OFFSET ?`, params);
|
|
34212
34898
|
return rows.map(rowToScriptRunListItem);
|
|
34213
34899
|
}
|
|
34214
34900
|
async function countScriptRuns2(opts) {
|
|
34215
|
-
const conditions =
|
|
34216
|
-
const params = [];
|
|
34217
|
-
if (opts?.status) {
|
|
34218
|
-
conditions.push("status = ?");
|
|
34219
|
-
params.push(opts.status);
|
|
34220
|
-
}
|
|
34221
|
-
if (opts?.agentId) {
|
|
34222
|
-
conditions.push("agentId = ?");
|
|
34223
|
-
params.push(opts.agentId);
|
|
34224
|
-
}
|
|
34225
|
-
if (opts?.scriptName) {
|
|
34226
|
-
conditions.push("scriptName = ?");
|
|
34227
|
-
params.push(opts.scriptName);
|
|
34228
|
-
}
|
|
34901
|
+
const { conditions, params } = scriptRunFilterSql(opts);
|
|
34229
34902
|
const where = conditions.length > 0 ? `WHERE ${conditions.join(" AND ")}` : "";
|
|
34230
34903
|
const row = await getDbClient2().get(`SELECT COUNT(*) AS count FROM script_runs ${where}`, params);
|
|
34231
34904
|
return row?.count ?? 0;
|
|
@@ -34369,6 +35042,7 @@ var init_db4 = __esm(() => {
|
|
|
34369
35042
|
init_github_pull_request();
|
|
34370
35043
|
init_heartbeat_expiry();
|
|
34371
35044
|
init_identity_field_budget();
|
|
35045
|
+
init_key_usage();
|
|
34372
35046
|
init_model_rate_limit_windows();
|
|
34373
35047
|
init_output_schema();
|
|
34374
35048
|
init_provider_account_telemetry();
|
|
@@ -34398,9 +35072,11 @@ var init_db4 = __esm(() => {
|
|
|
34398
35072
|
init_read();
|
|
34399
35073
|
init_write();
|
|
34400
35074
|
init_user_references();
|
|
35075
|
+
init_avatar();
|
|
34401
35076
|
init_workflow_idempotency();
|
|
34402
35077
|
init_workflow_run_definitions();
|
|
34403
35078
|
init_workflow_runs();
|
|
35079
|
+
init_read2();
|
|
34404
35080
|
init_scrub_json();
|
|
34405
35081
|
init_sealed_json();
|
|
34406
35082
|
init_secret_registry();
|
|
@@ -34414,9 +35090,11 @@ var init_db4 = __esm(() => {
|
|
|
34414
35090
|
init_approvals();
|
|
34415
35091
|
init_context_versions();
|
|
34416
35092
|
init_script_runs();
|
|
35093
|
+
init_script_runs();
|
|
34417
35094
|
init_session_moves();
|
|
34418
35095
|
init_skill_audit();
|
|
34419
35096
|
init_workflow_run_definitions();
|
|
35097
|
+
init_read2();
|
|
34420
35098
|
init_runtime2();
|
|
34421
35099
|
init_read();
|
|
34422
35100
|
init_write();
|
|
@@ -34424,7 +35102,7 @@ var init_db4 = __esm(() => {
|
|
|
34424
35102
|
configureAgentDependencies({
|
|
34425
35103
|
createLogEntry: (entry) => createLogEntry2(entry),
|
|
34426
35104
|
installSystemDefaultSkillsForAgent: (agentId) => installSystemDefaultSkillsForAgent2(agentId),
|
|
34427
|
-
resolvePendingImportAssignments: async (agent) => (await import("./pending-
|
|
35105
|
+
resolvePendingImportAssignments: async (agent) => (await import("./pending-2sxh1t6j.js")).resolvePendingImportAssignments(agent)
|
|
34428
35106
|
});
|
|
34429
35107
|
configureTaskWriteDependencies({
|
|
34430
35108
|
createLogEntry: (...args) => createLogEntry2(...args),
|
|
@@ -34474,4 +35152,4 @@ var init_db4 = __esm(() => {
|
|
|
34474
35152
|
};
|
|
34475
35153
|
});
|
|
34476
35154
|
|
|
34477
|
-
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 };
|