@desplega.ai/agent-swarm 2.4.5 → 2.5.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/README.md +4 -2
- package/dist/{acp-adapter-2wdkktv6.js → acp-adapter-11gp67nr.js} +8 -6
- package/dist/{actions-c40ebcm4.js → actions-8p2kze8j.js} +23 -21
- package/dist/{amp-adapter-wb67m95z.js → amp-adapter-z4qvhacj.js} +2 -2
- package/dist/{anthropic-messages-g6pqmqk4.js → anthropic-messages-txs190dd.js} +17 -20
- package/dist/{app-353vre8g.js → app-0qp0a2gk.js} +3 -3
- package/dist/{assistant-sj1njh23.js → assistant-jedd3ktm.js} +24 -22
- package/dist/{azure-openai-responses-9dbmj346.js → azure-openai-responses-9kfwhmn7.js} +18 -13
- package/dist/{boot-reembed-qdkvxeem.js → boot-reembed-4xwq5tg0.js} +1 -1
- package/dist/{boot-reembed-b9c3az3c.js → boot-reembed-n4wq5dd2.js} +1 -1
- package/dist/{boot-scrub-sweep-m3wh8eks.js → boot-scrub-sweep-69h90xcq.js} +4 -4
- package/dist/{boot-seeds-j2273s54.js → boot-seeds-3vn0m9sg.js} +4 -4
- package/dist/{claude-adapter-m7q0a085.js → claude-adapter-221mvad5.js} +8 -6
- package/dist/{claude-managed-adapter-5ptb6tzs.js → claude-managed-adapter-gt6pa35d.js} +2 -2
- package/dist/{claude-managed-setup-smrqk5j5.js → claude-managed-setup-c3hp36ph.js} +4 -4
- package/dist/{claude-sdk-session-38xnz21e.js → claude-sdk-session-8thjsk5e.js} +9012 -8928
- package/dist/{cli-b9fcxxev.js → cli-007cnhm1.js} +50 -4
- package/dist/{cli-j4rqdf2n.js → cli-03vpq45j.js} +2 -2
- package/dist/{cli-dk44dxec.js → cli-0y6f0ckq.js} +1 -1
- package/dist/{cli-kpw04va0.js → cli-0z3vjrpm.js} +1 -1
- package/dist/{cli-94gwyg7m.js → cli-179xcyky.js} +9 -9
- package/dist/{cli-3r8samv3.js → cli-1f0gp9vz.js} +3 -2
- package/dist/{cli-4zfqgjc5.js → cli-1pr672hz.js} +2 -2
- package/dist/{cli-0bqteszy.js → cli-2nf3b08t.js} +328 -25
- package/dist/{cli-43x64hv3.js → cli-36j4jnk3.js} +4 -4
- package/dist/{cli-k8g16gz3.js → cli-3qv8naq8.js} +115 -119
- package/dist/cli-3zwye9sn.js +1193 -0
- package/dist/{cli-60cgh1rv.js → cli-459fk97x.js} +7 -7
- package/dist/{cli-v8fjakwf.js → cli-4w24f7z3.js} +1 -1
- package/dist/{cli-n72rg53p.js → cli-5kzk3472.js} +812 -418
- package/dist/{cli-h7gc0b4r.js → cli-5m84zd2k.js} +55 -18
- package/dist/{cli-j99azg3g.js → cli-5rvg1ddk.js} +5 -5
- package/dist/{cli-dvkmp9bt.js → cli-6ctwrf1z.js} +20 -10
- package/dist/{cli-848hxdwj.js → cli-6rg2jn2y.js} +2 -1
- package/dist/{cli-fv5hepyy.js → cli-7bwtc6yx.js} +3 -3
- package/dist/{cli-ms85309d.js → cli-7g40g8hq.js} +11 -11
- package/dist/{cli-xpa64rek.js → cli-92mqenkc.js} +2362 -159
- package/dist/{cli-018r4jq6.js → cli-9ce2xw98.js} +8 -8
- package/dist/{cli-1syn2xy1.js → cli-bgdtv62r.js} +32 -18
- package/dist/{cli-wxbn3yfx.js → cli-cz5nmdxt.js} +2 -2
- package/dist/{cli-wt645v7q.js → cli-dabehxhp.js} +1 -1
- package/dist/{cli-vfha21c9.js → cli-e5bxnjps.js} +2 -2
- package/dist/{cli-wt0jf9hm.js → cli-fcc5qe3f.js} +553 -193
- package/dist/{cli-ftc1g5tj.js → cli-fes51ya2.js} +3 -3
- package/dist/{cli-3a45zcgm.js → cli-ftmq4nvk.js} +2 -2
- package/dist/{cli-37j04k05.js → cli-fy1jyyym.js} +13 -13
- package/dist/{cli-s95dknxh.js → cli-g1cw7xtt.js} +1 -1
- package/dist/{cli-74c1wpm0.js → cli-gpv60278.js} +1 -1
- package/dist/{cli-pemywhfq.js → cli-ha9rmwgq.js} +2 -1
- package/dist/{cli-g35m2xwm.js → cli-j1eghqfm.js} +2 -2
- package/dist/{cli-qfxc84gh.js → cli-jpxsrxcb.js} +1 -1
- package/dist/{cli-ejs3m1sx.js → cli-kxpfx2xr.js} +1 -1
- package/dist/{cli-p14m2cnp.js → cli-mbfj11fq.js} +1 -1
- package/dist/{cli-pnp2j5zg.js → cli-mmhj8vd7.js} +2 -2
- package/dist/{cli-xf234ws8.js → cli-n4c8e3s5.js} +2 -0
- package/dist/{cli-f01h25yt.js → cli-n6kmqngw.js} +2 -2
- package/dist/{cli-v0yrfmdh.js → cli-nnvjb17s.js} +3 -3
- package/dist/{cli-1dmcq2eh.js → cli-nzfnt2gs.js} +1 -1
- package/dist/{cli-625tb7aq.js → cli-p859hcc8.js} +2 -2
- package/dist/{cli-smvcw9z5.js → cli-pasyvjmm.js} +1 -1
- package/dist/cli-pkaqk57w.js +128 -0
- package/dist/{cli-8nyhf7za.js → cli-qqzmjxkf.js} +129 -105
- package/dist/{cli-9yqgm9nd.js → cli-r25qpaxt.js} +161 -63
- package/dist/{cli-eww120g8.js → cli-rh5smt8t.js} +18 -4
- package/dist/{cli-qwkcwjdn.js → cli-rycdaj0a.js} +1 -1
- package/dist/{cli-a92r1127.js → cli-s4sntwt4.js} +2 -2
- package/dist/{cli-be2161h1.js → cli-segs7hx9.js} +6 -6
- package/dist/{cli-36ckw0wx.js → cli-stxdrqs2.js} +2 -2
- package/dist/{cli-z7d29rw9.js → cli-sy8f9705.js} +4 -4
- package/dist/{cli-1m17dc9d.js → cli-ta8bd7th.js} +2 -2
- package/dist/{cli-st8aw1m6.js → cli-we0ra057.js} +4 -4
- package/dist/{cli-7c9qs530.js → cli-x21dqn18.js} +5 -5
- package/dist/{cli-1sp861s4.js → cli-x6vf4sad.js} +11 -11
- package/dist/{cli-d2mb5s8a.js → cli-x77gen2p.js} +680 -440
- package/dist/{cli-tw4p90jb.js → cli-xawhpgc9.js} +5 -5
- package/dist/{cli-f0g3pgvf.js → cli-xd4eqtr2.js} +2 -2
- package/dist/{cli-1f3qzw6y.js → cli-xt768r5m.js} +2 -2
- package/dist/{cli-cxxe61f6.js → cli-y4x8ww6s.js} +2 -2
- package/dist/{cli-bnes4z6b.js → cli-y9jvxfhk.js} +3 -3
- package/dist/{cli-qwhy2qma.js → cli-z63a269p.js} +2 -2
- package/dist/{cli-sm8rses9.js → cli-zfdp01hn.js} +8 -5
- package/dist/cli.js +29 -27
- package/dist/{cloudflare-workers-ai-system-one-ch2wxfcp.js → cloudflare-workers-ai-system-one-43v9qkjk.js} +7 -2
- package/dist/{codex-adapter-tn6k5mkg.js → codex-adapter-tcg1q3jk.js} +6 -4
- package/dist/{codex-login-m819c41r.js → codex-login-rn7c5gxt.js} +1 -1
- package/dist/{codex-session-runner-7vjt7jbw.js → codex-session-runner-xfx4wd9x.js} +7 -5
- package/dist/{commands-t7rz9146.js → commands-ew83nj70.js} +2 -2
- package/dist/{controller-m2jasma5.js → controller-gnq1k1mf.js} +4 -4
- package/dist/{controllers-connect-9ftpex99.js → controllers-connect-tw1dan9r.js} +25 -23
- package/dist/{cursor-adapter-mjv79e4z.js → cursor-adapter-yq5xgfcg.js} +1 -1
- package/dist/{db-6sfrn9g3.js → db-7gbc53fd.js} +14 -2
- package/dist/{db-rn673r06.js → db-t86xrnes.js} +3 -3
- package/dist/{devin-adapter-zgqadvnm.js → devin-adapter-4ycy4vrf.js} +1 -1
- package/dist/{dispatcher-c155xz0p.js → dispatcher-64bdyhps.js} +22 -20
- package/dist/{docker-fkgtr75t.js → docker-nfy2gc8t.js} +2 -2
- package/dist/{dsh-adapter-3mmszc1x.js → dsh-adapter-tvhc4k2d.js} +1 -1
- package/dist/{e2b-16d6ch39.js → e2b-9gkdhm3c.js} +2 -2
- package/dist/{e2b-zn0b4w5w.js → e2b-cjtf8k1z.js} +2 -2
- package/dist/{easter-egg-3d-5cgynaja.js → easter-egg-3d-e4qv8dxj.js} +1 -1
- package/dist/{event-bus-9vpk8gmq.js → event-bus-3z78ep5n.js} +1 -1
- package/dist/{execute-t4e6m3rw.js → execute-0xpz8950.js} +85 -23
- package/dist/{external-channel-35k6tkv8.js → external-channel-e9nw24zv.js} +2 -2
- package/dist/{google-generative-ai-bmq8gkf3.js → google-generative-ai-mk9vcpe1.js} +15 -15
- package/dist/{google-vertex-b1rvp52s.js → google-vertex-q580kz8k.js} +20 -20
- package/dist/{grok-adapter-tfrq7tg1.js → grok-adapter-v82srhrx.js} +9 -7
- package/dist/handlers-c9ajzhbn.js +41 -0
- package/dist/{heartbeat-dyg4npkp.js → heartbeat-2vqs1319.js} +25 -23
- package/dist/{hook-x26b31bg.js → hook-01nk13wx.js} +7 -5
- package/dist/{hook-drspbwpe.js → hook-jzpheegg.js} +9 -7
- package/dist/{http-pk972xyw.js → http-fc1k6ec8.js} +544 -76
- package/dist/index-07ef7nkm.js +42 -0
- package/dist/{index-g6tbb6ve.js → index-31ceyf42.js} +1 -1
- package/dist/index-7yts8n9s.js +43 -0
- package/dist/index-q3t40ryv.js +46 -0
- package/dist/{index-arytgj5q.js → index-sepja052.js} +1 -1
- package/dist/{index-jwxkkex2.js → index-zdycv3ja.js} +13 -11
- package/dist/{index-g216q6jr.js → index-zsyx51ap.js} +1 -4
- package/dist/{keepalive-7yrng7px.js → keepalive-5nh2rhmr.js} +4 -4
- package/dist/lead-aayq64jn.js +79 -0
- package/dist/{llama-cpp-classify-vv43gswy.js → llama-cpp-classify-ee7vmd7q.js} +4 -1
- package/dist/{maintenance-e6cemdqt.js → maintenance-hjhzdt3k.js} +1 -1
- package/dist/{mistral-conversations-1medfwv7.js → mistral-conversations-sd0xf1tn.js} +13 -13
- package/dist/{node-de6akczr.js → node-jzjj7r9x.js} +1 -1
- package/dist/{oauth-refresh-sweep-yw3xdbcj.js → oauth-refresh-sweep-y3n1knmd.js} +3 -3
- package/dist/{onboard-0a9y5yrc.js → onboard-1zq3m7db.js} +2 -2
- package/dist/{openai-codex-responses-de9pvs4d.js → openai-codex-responses-79s8xnbh.js} +29 -23
- package/dist/{openai-completions-mtqge3nf.js → openai-completions-tdbyts0x.js} +21 -20
- package/dist/{openai-decisions-ygk4kkxd.js → openai-decisions-bqhnjyfz.js} +2 -1
- package/dist/{openai-responses-dkyng71g.js → openai-responses-dm3t5vqp.js} +26 -17
- package/dist/{opencode-adapter-x4tqzhkh.js → opencode-adapter-e56086m1.js} +7 -5
- package/dist/{openrouter-images-wvv7camj.js → openrouter-images-ssttr1y4.js} +6 -3
- package/dist/{otel-impl-trjpkfb7.js → otel-impl-h9yyza47.js} +2 -2
- package/dist/{pi-messages-nhh1pkz2.js → pi-messages-3nf8bq1a.js} +6 -4
- package/dist/{pi-mono-adapter-mcfkn9vf.js → pi-mono-adapter-tzps8f38.js} +9 -37
- package/dist/{pricing-refresh-d2b5my0y.js → pricing-refresh-nevhat8h.js} +3 -3
- package/dist/{rbac-roles-nxh5ahwk.js → rbac-roles-4y6ngvzq.js} +1 -1
- package/dist/{rbac-roles-hey3yv9d.js → rbac-roles-exbg8xb6.js} +2 -2
- package/dist/{render-v2-rr3p2atg.js → render-v2-cfsh13z3.js} +3 -3
- package/dist/{resume-2efkf1s1.js → resume-5s2t0dbs.js} +10 -8
- package/dist/{runtime-xe3aqy4x.js → runtime-bt5pkpm1.js} +1 -1
- package/dist/{session-access-s2mttxpw.js → session-access-dnbyp3cn.js} +6 -4
- package/dist/{setup-vypma5yt.js → setup-1wj1y77j.js} +1 -1
- package/dist/{typesafe-system-one-2hgpayzy.js → typesafe-system-one-bre38hvs.js} +4 -2
- package/dist/{virtual-modules-4r3zkc20.js → virtual-modules-mnfbh5mr.js} +8 -2
- package/dist/{work-objects-rvhckdkp.js → work-objects-7mg6216g.js} +25 -23
- package/dist/worker-nwb789mg.js +79 -0
- package/dist/{x-y45mthwn.js → x-pbpezr0s.js} +2 -2
- package/openapi.json +785 -5
- package/package.json +9 -9
- package/src/assets/key.ts +17 -0
- package/src/azure-devops/handlers.ts +1 -1
- package/src/be/db/approvals.ts +18 -0
- package/src/be/db/session-moves.ts +164 -0
- package/src/be/db/session-tree.ts +384 -0
- package/src/be/db/tasks/read.ts +40 -4
- package/src/be/db/workflow-runs.ts +96 -0
- package/src/be/db.ts +80 -236
- package/src/be/onboarding.ts +3 -0
- package/src/be/skill-sync.ts +43 -2
- package/src/be/swarm-config-guard.ts +1 -0
- package/src/bitbucket/api.ts +81 -0
- package/src/bitbucket/auth.ts +64 -0
- package/src/bitbucket/handlers.ts +434 -0
- package/src/bitbucket/index.ts +28 -0
- package/src/bitbucket/templates.ts +134 -0
- package/src/bitbucket/types.ts +65 -0
- package/src/commands/runner.ts +55 -3
- package/src/e2b/env.ts +1 -0
- package/src/extensions/contract-types.generated.ts +1 -1
- package/src/extensions/contract.ts +2 -2
- package/src/extensions/post-bridge.ts +1 -0
- package/src/github/handlers.ts +6 -6
- package/src/gitlab/handlers.ts +5 -5
- package/src/http/assets.ts +14 -2
- package/src/http/core.ts +12 -0
- package/src/http/index.ts +4 -0
- package/src/http/onboarding.ts +1 -0
- package/src/http/sessions.ts +366 -12
- package/src/http/skills.ts +48 -1
- package/src/http/tasks.ts +1 -1
- package/src/http/users.ts +1 -0
- package/src/http/webhooks.ts +141 -0
- package/src/integrations/chat-sdk/adapters.ts +19 -3
- package/src/integrations/chat-sdk/facts.ts +30 -12
- package/src/integrations/chat-sdk/outbound.ts +38 -1
- package/src/providers/acp-targets.ts +1 -1
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/pi-mono-adapter.ts +5 -53
- package/src/scripts-runtime/types/swarm-extension.d.ts +6 -4
- package/src/slack/handlers.test.ts +158 -0
- package/src/slack/handlers.ts +19 -28
- package/src/tasks/context-key.ts +61 -1
- package/src/tests/bitbucket-auth.test.ts +156 -0
- package/src/tests/bitbucket-handlers.test.ts +425 -0
- package/src/tests/bitbucket-webhook.test.ts +220 -0
- package/src/tests/chat-sdk-inbound.test.ts +39 -0
- package/src/tests/chat-sdk-telegram-markdown.test.ts +92 -0
- package/src/tests/context-key.test.ts +50 -0
- package/src/tests/core-auth.test.ts +5 -0
- package/src/tests/db-task-read-contract.test.ts +7 -0
- package/src/tests/db-task-write-contract.test.ts +6 -0
- package/src/tests/docs-index-footprint.test.js +3 -3
- package/src/tests/fixtures/bitbucket/pullrequest-comment-created-inline.json +174 -0
- package/src/tests/fixtures/bitbucket/pullrequest-comment-created.json +170 -0
- package/src/tests/fixtures/bitbucket/pullrequest-created-mention.json +132 -0
- package/src/tests/fixtures/bitbucket/pullrequest-created-reviewer.json +140 -0
- package/src/tests/fixtures/bitbucket/pullrequest-fulfilled.json +134 -0
- package/src/tests/fixtures/bitbucket/pullrequest-rejected.json +133 -0
- package/src/tests/generate-mcp-docs.test.ts +101 -0
- package/src/tests/gitlab-handlers.test.ts +3 -3
- package/src/tests/gitlab-vcs-db.test.ts +4 -4
- package/src/tests/integration-disable-flags.test.ts +36 -0
- package/src/tests/mcp-tools.test.ts +1 -1
- package/src/tests/onboarding.test.ts +12 -0
- package/src/tests/pi-codemode.test.ts +8 -2
- package/src/tests/preload-env.test.ts +57 -0
- package/src/tests/preload.ts +21 -0
- package/src/tests/prompt-template-remaining.test.ts +38 -0
- package/src/tests/run-root-coverage.test.ts +39 -0
- package/src/tests/runner-bitbucket-vcs.test.ts +191 -0
- package/src/tests/runner-skills-refresh.test.ts +58 -0
- package/src/tests/secret-scrubber.test.ts +15 -0
- package/src/tests/sessions-move.test.ts +576 -0
- package/src/tests/sessions-tree.test.ts +493 -0
- package/src/tests/skill-files-http.test.ts +50 -0
- package/src/tests/skills-bundle.test.ts +99 -0
- package/src/tests/swarm-config-export-to-env.test.ts +2 -1
- package/src/tests/vcs-bitbucket.test.ts +91 -0
- package/src/tests/vcs-provider-isolation.test.ts +123 -0
- package/src/tests/vcs-provider.test.ts +16 -1
- package/src/tests/vcs-tracking.test.ts +3 -3
- package/src/tests/workflow-foreach-bodies.test.ts +637 -0
- package/src/tests/workflow-foreach-concurrency.test.ts +342 -0
- package/src/tests/workflow-foreach-retry.test.ts +537 -0
- package/src/tests/workflow-foreach.test.ts +44 -23
- package/src/tests/workflow-step-claims.test.ts +6 -6
- package/src/tests/workflow-tla-races.test.ts +2 -2
- package/src/tools/script-delete.ts +1 -1
- package/src/tools/workflows/create-workflow.ts +5 -3
- package/src/types.ts +3 -2
- package/src/utils/config-env-export.ts +1 -0
- package/src/utils/secret-scrubber.ts +4 -0
- package/src/utils/skills-refresh.ts +83 -43
- package/src/vcs/bitbucket.ts +58 -0
- package/src/vcs/index.ts +2 -0
- package/src/vcs/types.ts +2 -2
- package/src/workflows/approval-resolution.ts +4 -1
- package/src/workflows/checkpoint.ts +9 -1
- package/src/workflows/constants.ts +3 -0
- package/src/workflows/definition.ts +48 -17
- package/src/workflows/engine.ts +25 -15
- package/src/workflows/executors/foreach.ts +45 -99
- package/src/workflows/foreach-body.ts +146 -0
- package/src/workflows/foreach-driver.ts +552 -0
- package/src/workflows/foreach-join.ts +206 -7
- package/src/workflows/node-timeout.ts +21 -0
- package/src/workflows/recovery.ts +68 -3
- package/src/workflows/resume.ts +221 -43
- package/src/workflows/retry-poller.ts +39 -24
- package/src/workflows/step-input.ts +59 -0
- package/src/workflows/task-step-routing.ts +114 -56
- package/templates/skills/slack-interaction/content.md +5 -0
- package/templates/skills/work-on-task/SKILL.md +1 -1
- package/templates/skills/work-on-task/content.md +1 -1
- package/dist/cli-9hstj09h.js +0 -2657
- package/dist/cli-yw91rnmw.js +0 -13
- package/dist/handlers-7gw64dxw.js +0 -39
- package/dist/index-bgdyvcnv.js +0 -40
- package/dist/index-gabbcdn2.js +0 -43
- package/dist/index-tfb26zhy.js +0 -41
- package/dist/lead-7e02z839.js +0 -77
- package/dist/worker-5snytpbd.js +0 -77
|
@@ -5,6 +5,9 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
normalizeAssetKey,
|
|
7
7
|
defaultAssetKey,
|
|
8
|
+
keyPrefixRange,
|
|
9
|
+
SESSION_LEAF_KINDS,
|
|
10
|
+
sessionGroupKey,
|
|
8
11
|
parseAssetKey,
|
|
9
12
|
isCanonicalAssetKey,
|
|
10
13
|
init_key,
|
|
@@ -23,7 +26,7 @@ import {
|
|
|
23
26
|
VersionableFieldSchema,
|
|
24
27
|
SessionCostModelBreakdownSchema,
|
|
25
28
|
init_types
|
|
26
|
-
} from "./cli-
|
|
29
|
+
} from "./cli-rh5smt8t.js";
|
|
27
30
|
import {
|
|
28
31
|
generateDefaultClaudeMd2,
|
|
29
32
|
generateDefaultSoulMd2,
|
|
@@ -37,7 +40,7 @@ import {
|
|
|
37
40
|
init_identity_field_budget,
|
|
38
41
|
contentSha256,
|
|
39
42
|
init_profile_sync
|
|
40
|
-
} from "./cli-
|
|
43
|
+
} from "./cli-gpv60278.js";
|
|
41
44
|
import {
|
|
42
45
|
isSlackConfigured,
|
|
43
46
|
init_config
|
|
@@ -106,7 +109,7 @@ import {
|
|
|
106
109
|
import {
|
|
107
110
|
init_package,
|
|
108
111
|
package_default
|
|
109
|
-
} from "./cli-
|
|
112
|
+
} from "./cli-179xcyky.js";
|
|
110
113
|
import {
|
|
111
114
|
realtimeBus,
|
|
112
115
|
init_bus
|
|
@@ -121,7 +124,7 @@ import {
|
|
|
121
124
|
registerVolatileSecret,
|
|
122
125
|
registerSensitiveKeyName,
|
|
123
126
|
init_secret_scrubber
|
|
124
|
-
} from "./cli-
|
|
127
|
+
} from "./cli-n4c8e3s5.js";
|
|
125
128
|
import {
|
|
126
129
|
isAlias,
|
|
127
130
|
parseAlias,
|
|
@@ -220,6 +223,21 @@ function azureDevOpsWorkItemContextKey(input) {
|
|
|
220
223
|
}
|
|
221
224
|
return ["task", "trackers", "azure-devops", organization, "workitem", workItemId].join(SEPARATOR);
|
|
222
225
|
}
|
|
226
|
+
function bitbucketContextKey({
|
|
227
|
+
repoUuid,
|
|
228
|
+
pullRequestId
|
|
229
|
+
}) {
|
|
230
|
+
const rawUuid = typeof repoUuid === "string" ? repoUuid.trim().replace(/^\{|\}$/g, "") : repoUuid;
|
|
231
|
+
const uuid = assertSafePart(rawUuid, "repoUuid").toLowerCase();
|
|
232
|
+
if (/[{}]/.test(uuid)) {
|
|
233
|
+
throw new Error(`context-key: bitbucket "repoUuid" has unbalanced braces (got ${JSON.stringify(repoUuid)})`);
|
|
234
|
+
}
|
|
235
|
+
const id = assertSafePart(pullRequestId, "pullRequestId");
|
|
236
|
+
if (!/^\d+$/.test(id)) {
|
|
237
|
+
throw new Error(`context-key: bitbucket "pullRequestId" must be a positive integer (got ${JSON.stringify(id)})`);
|
|
238
|
+
}
|
|
239
|
+
return ["task", "trackers", "bitbucket", uuid, "pr", id].join(SEPARATOR);
|
|
240
|
+
}
|
|
223
241
|
function linearContextKey(input) {
|
|
224
242
|
const issueIdentifier = assertSafePart(input.issueIdentifier, "issueIdentifier");
|
|
225
243
|
return ["task", "trackers", "linear", issueIdentifier].join(SEPARATOR);
|
|
@@ -363,6 +381,21 @@ function parseContextKey(key) {
|
|
|
363
381
|
parts: { repositoryId: parts[3], kind: "pr", pullRequestId }
|
|
364
382
|
};
|
|
365
383
|
}
|
|
384
|
+
if (subFamily === "bitbucket") {
|
|
385
|
+
if (parts.length !== 6 || parts[4] !== "pr" || !parts[3]) {
|
|
386
|
+
throw new Error(`context-key: malformed bitbucket key: ${JSON.stringify(key)}`);
|
|
387
|
+
}
|
|
388
|
+
const idStr = parts[5];
|
|
389
|
+
const pullRequestId = Number.parseInt(idStr, 10);
|
|
390
|
+
if (!/^\d+$/.test(idStr) || !Number.isFinite(pullRequestId)) {
|
|
391
|
+
throw new Error(`context-key: malformed bitbucket pullRequestId "${idStr}": ${JSON.stringify(key)}`);
|
|
392
|
+
}
|
|
393
|
+
return {
|
|
394
|
+
family: "trackers",
|
|
395
|
+
subFamily: "bitbucket",
|
|
396
|
+
parts: { repoUuid: parts[3], kind: "pr", pullRequestId }
|
|
397
|
+
};
|
|
398
|
+
}
|
|
366
399
|
if (subFamily === "linear") {
|
|
367
400
|
if (parts.length !== 4) {
|
|
368
401
|
throw new Error(`context-key: malformed linear key: ${JSON.stringify(key)}`);
|
|
@@ -4838,7 +4871,7 @@ var init_runtime = __esm(() => {
|
|
|
4838
4871
|
// src/telemetry-identity.ts
|
|
4839
4872
|
async function loadUserRole(userId) {
|
|
4840
4873
|
try {
|
|
4841
|
-
const { getUserGrant } = await import("./rbac-roles-
|
|
4874
|
+
const { getUserGrant } = await import("./rbac-roles-exbg8xb6.js");
|
|
4842
4875
|
const grant = await getUserGrant(userId);
|
|
4843
4876
|
const role = grant.grantsAll ? "admin" : "member";
|
|
4844
4877
|
const user = await getDbClient2().get("SELECT json_extract(metadata, '$.jobFunction') AS jobFunction FROM users WHERE id = ? AND json_valid(metadata)", [userId]);
|
|
@@ -5048,6 +5081,7 @@ var init_config_env_export = __esm(() => {
|
|
|
5048
5081
|
"JIRA_CLIENT_SECRET",
|
|
5049
5082
|
"JIRA_WEBHOOK_TOKEN",
|
|
5050
5083
|
"AZURE_DEVOPS_WEBHOOK_SECRET",
|
|
5084
|
+
"BITBUCKET_WEBHOOK_SECRET",
|
|
5051
5085
|
"AGENTMAIL_WEBHOOK_SECRET",
|
|
5052
5086
|
"API_AGENT_FS_API_KEY",
|
|
5053
5087
|
"TRANSCRIPTION_API_KEY"
|
|
@@ -5584,6 +5618,13 @@ function scrubApprovalVotesJson(approvals) {
|
|
|
5584
5618
|
return scrubbed;
|
|
5585
5619
|
return JSON.stringify(scrubObject(approvals));
|
|
5586
5620
|
}
|
|
5621
|
+
async function getPendingApprovalsForTasks2(taskIds) {
|
|
5622
|
+
if (!taskIds.length)
|
|
5623
|
+
return [];
|
|
5624
|
+
return getDbClient2().query(`SELECT id, status, sourceTaskId, title FROM approval_requests
|
|
5625
|
+
WHERE sourceTaskId IN (${taskIds.map(() => "?").join(",")}) AND status = 'pending'
|
|
5626
|
+
ORDER BY createdAt, id`, taskIds);
|
|
5627
|
+
}
|
|
5587
5628
|
var init_approvals = __esm(() => {
|
|
5588
5629
|
init_secret_scrubber();
|
|
5589
5630
|
init_date_utils();
|
|
@@ -5978,14 +6019,23 @@ async function getTasksByStatus2(status) {
|
|
|
5978
6019
|
const rows = await getDbClient2().query("SELECT * FROM agent_tasks WHERE status = ? ORDER BY createdAt DESC", [status]);
|
|
5979
6020
|
return rows.map(rowToAgentTask);
|
|
5980
6021
|
}
|
|
5981
|
-
async function findTaskByVcs2(vcsRepo, vcsNumber) {
|
|
6022
|
+
async function findTaskByVcs2(vcsRepo, vcsNumber, vcsProvider) {
|
|
6023
|
+
const providerClause = vcsProvider === "github" ? "(vcsProvider = ? OR vcsProvider IS NULL)" : "vcsProvider = ?";
|
|
5982
6024
|
const row = await getDbClient2().get(`SELECT * FROM agent_tasks
|
|
5983
|
-
WHERE vcsRepo = ? AND vcsNumber = ?
|
|
6025
|
+
WHERE vcsRepo = ? AND vcsNumber = ? AND ${providerClause}
|
|
5984
6026
|
AND status NOT IN ('completed', 'failed', 'cancelled', 'superseded')
|
|
5985
6027
|
ORDER BY createdAt DESC
|
|
5986
|
-
LIMIT 1`, [vcsRepo, vcsNumber]);
|
|
6028
|
+
LIMIT 1`, [vcsRepo, vcsNumber, vcsProvider]);
|
|
5987
6029
|
return row ? rowToAgentTask(row) : null;
|
|
5988
6030
|
}
|
|
6031
|
+
async function findActiveTasksByVcs2(vcsRepo, vcsNumber, vcsProvider) {
|
|
6032
|
+
const providerClause = vcsProvider === "github" ? "(vcsProvider = ? OR vcsProvider IS NULL)" : "vcsProvider = ?";
|
|
6033
|
+
const rows = await getDbClient2().query(`SELECT * FROM agent_tasks
|
|
6034
|
+
WHERE vcsRepo = ? AND vcsNumber = ? AND ${providerClause}
|
|
6035
|
+
AND status NOT IN ('completed', 'failed', 'cancelled', 'superseded')
|
|
6036
|
+
ORDER BY createdAt DESC`, [vcsRepo, vcsNumber, vcsProvider]);
|
|
6037
|
+
return rows.map(rowToAgentTask);
|
|
6038
|
+
}
|
|
5989
6039
|
function readableSessionCondition(userId, taskIdColumn = "agent_tasks.id", opts = {}) {
|
|
5990
6040
|
const otherOwner = userId ? "r.requestedByUserId IS NOT NULL AND r.requestedByUserId != ?" : "r.requestedByUserId IS NOT NULL";
|
|
5991
6041
|
const shareMatch = userId ? "(s.userId IS NULL OR s.userId = ?)" : "s.userId IS NULL";
|
|
@@ -6835,6 +6885,385 @@ function sessionViewerCondition(viewer) {
|
|
|
6835
6885
|
}
|
|
6836
6886
|
var init_session_visibility = () => {};
|
|
6837
6887
|
|
|
6888
|
+
// src/be/db/session-moves.ts
|
|
6889
|
+
function configureSessionMoveDependencies(value) {
|
|
6890
|
+
insertAssetKeyHistory = value.insertAssetKeyHistory;
|
|
6891
|
+
auditAssetKeys2 = value.auditAssetKeys;
|
|
6892
|
+
}
|
|
6893
|
+
async function assertAssetKeyMovesAllowed2() {
|
|
6894
|
+
const audit = await getDbClient2().transaction(async () => auditAssetKeys2(), {
|
|
6895
|
+
readOnly: true
|
|
6896
|
+
});
|
|
6897
|
+
if (!audit.ok) {
|
|
6898
|
+
throw new AssetKeyMovesBlockedError2;
|
|
6899
|
+
}
|
|
6900
|
+
}
|
|
6901
|
+
async function moveTaskChainKeyInTx2(rootId, taskIds, key, changedBy) {
|
|
6902
|
+
if (!isInTransaction()) {
|
|
6903
|
+
throw new Error("moveTaskChainKeyInTx requires an active transaction");
|
|
6904
|
+
}
|
|
6905
|
+
const client = getDbClient2();
|
|
6906
|
+
const now = new Date().toISOString();
|
|
6907
|
+
const root = await getTaskById2(rootId);
|
|
6908
|
+
if (!root)
|
|
6909
|
+
return false;
|
|
6910
|
+
const tasks = [root];
|
|
6911
|
+
for (const id of taskIds) {
|
|
6912
|
+
const task = id === root.id ? null : await getTaskById2(id);
|
|
6913
|
+
if (task)
|
|
6914
|
+
tasks.push(task);
|
|
6915
|
+
}
|
|
6916
|
+
const movedTaskIds = [];
|
|
6917
|
+
for (const task of tasks) {
|
|
6918
|
+
if (task.key === key)
|
|
6919
|
+
continue;
|
|
6920
|
+
const mappedFiles = await client.query(`SELECT DISTINCT m.id, m."key" AS key
|
|
6921
|
+
FROM asset_key_mappings m
|
|
6922
|
+
JOIN task_attachments a
|
|
6923
|
+
ON m.provider_id = COALESCE(NULLIF(a.provider_id, ''), 'agent-fs')
|
|
6924
|
+
AND m.provider_org_id = COALESCE(a.agent_fs_org_id, '')
|
|
6925
|
+
AND m.provider_drive_id = COALESCE(a.agent_fs_drive_id, '')
|
|
6926
|
+
AND m.provider_key = COALESCE(NULLIF(a.provider_key, ''), a.path)
|
|
6927
|
+
WHERE a.task_id = ?
|
|
6928
|
+
AND (m.source_entity_type IS NOT 'task-attachment'
|
|
6929
|
+
OR m.source_entity_id IN (SELECT id FROM task_attachments WHERE task_id = ?))`, [task.id, task.id]);
|
|
6930
|
+
await client.run('UPDATE agent_tasks SET "key" = ?, updated_by = ? WHERE id = ?', [
|
|
6931
|
+
key,
|
|
6932
|
+
changedBy ?? null,
|
|
6933
|
+
task.id
|
|
6934
|
+
]);
|
|
6935
|
+
for (const mapping of mappedFiles) {
|
|
6936
|
+
if (mapping.key === key)
|
|
6937
|
+
continue;
|
|
6938
|
+
await client.run('UPDATE asset_key_mappings SET "key" = ?, updated_at = ?, updated_by = ? WHERE id = ?', [key, now, changedBy ?? null, mapping.id]);
|
|
6939
|
+
await insertAssetKeyHistory({
|
|
6940
|
+
entityType: "file",
|
|
6941
|
+
entityId: mapping.id,
|
|
6942
|
+
previousKey: mapping.key,
|
|
6943
|
+
newKey: key,
|
|
6944
|
+
changedBy
|
|
6945
|
+
});
|
|
6946
|
+
}
|
|
6947
|
+
await insertAssetKeyHistory({
|
|
6948
|
+
entityType: "task",
|
|
6949
|
+
entityId: task.id,
|
|
6950
|
+
previousKey: task.key,
|
|
6951
|
+
newKey: key,
|
|
6952
|
+
changedBy
|
|
6953
|
+
});
|
|
6954
|
+
movedTaskIds.push(task.id);
|
|
6955
|
+
}
|
|
6956
|
+
return movedTaskIds;
|
|
6957
|
+
}
|
|
6958
|
+
async function moveSessionChains(input) {
|
|
6959
|
+
const moved = [];
|
|
6960
|
+
for (const move of input.moves) {
|
|
6961
|
+
const taskIds = await getDbClient2().transaction(async () => moveTaskChainKeyInTx2(move.rootId, move.taskIds, move.key, input.changedBy));
|
|
6962
|
+
if (taskIds && taskIds.length > 0)
|
|
6963
|
+
moved.push(move.rootId);
|
|
6964
|
+
}
|
|
6965
|
+
return moved;
|
|
6966
|
+
}
|
|
6967
|
+
async function listPrefixRoots(input) {
|
|
6968
|
+
const { lo, hi } = keyPrefixRange(input.from);
|
|
6969
|
+
return getDbClient2().query(`SELECT r.id, r."key" FROM agent_tasks r
|
|
6970
|
+
WHERE r.parentTaskId IS NULL AND r."key" >= ? AND r."key" < ?
|
|
6971
|
+
${input.userId !== undefined ? "AND r.requestedByUserId = ?" : ""}
|
|
6972
|
+
ORDER BY r.id LIMIT ? OFFSET ?`, [lo, hi, ...input.userId !== undefined ? [input.userId] : [], input.limit, input.offset ?? 0]);
|
|
6973
|
+
}
|
|
6974
|
+
async function listSharedPrefixRoots(input) {
|
|
6975
|
+
const { lo, hi } = keyPrefixRange(input.from);
|
|
6976
|
+
const visibility = sessionViewerCondition({ userId: input.userId, scope: "shared" });
|
|
6977
|
+
return getDbClient2().query(`SELECT r.id FROM agent_tasks r
|
|
6978
|
+
WHERE r.parentTaskId IS NULL AND r."key" >= ? AND r."key" < ?
|
|
6979
|
+
AND ${visibility.sql} ORDER BY r.id`, [lo, hi, ...visibility.params]);
|
|
6980
|
+
}
|
|
6981
|
+
var insertAssetKeyHistory, auditAssetKeys2, AssetKeyMovesBlockedError2;
|
|
6982
|
+
var init_session_moves = __esm(() => {
|
|
6983
|
+
init_key();
|
|
6984
|
+
init_db_client();
|
|
6985
|
+
init_runtime();
|
|
6986
|
+
init_session_visibility();
|
|
6987
|
+
init_read();
|
|
6988
|
+
AssetKeyMovesBlockedError2 = class AssetKeyMovesBlockedError2 extends Error {
|
|
6989
|
+
constructor() {
|
|
6990
|
+
super("Asset namespace moves are blocked until structural errors, unknown personal users, or provider mapping drift are repaired.");
|
|
6991
|
+
this.name = "AssetKeyMovesBlockedError";
|
|
6992
|
+
}
|
|
6993
|
+
};
|
|
6994
|
+
});
|
|
6995
|
+
|
|
6996
|
+
// src/be/db/session-tree.ts
|
|
6997
|
+
function sessionReadStateSql(now = new Date().toISOString()) {
|
|
6998
|
+
return {
|
|
6999
|
+
sql: `CASE
|
|
7000
|
+
WHEN s.id IS NULL THEN CASE WHEN a.lastActivityAt > ? THEN 'unread' ELSE 'read' END
|
|
7001
|
+
WHEN s.status = 'dismissed' THEN 'done'
|
|
7002
|
+
WHEN s.status = 'done' THEN CASE WHEN a.lastActivityAt > s.lastUpdatedAt THEN 'unread' ELSE 'done' END
|
|
7003
|
+
WHEN s.status = 'snoozed' THEN CASE WHEN s.snoozeUntil > ? THEN 'later' ELSE 'unread' END
|
|
7004
|
+
WHEN a.lastActivityAt > COALESCE(s.lastReadAt, s.lastUpdatedAt) THEN 'unread'
|
|
7005
|
+
ELSE 'read'
|
|
7006
|
+
END`,
|
|
7007
|
+
params: [new Date(Date.parse(now) - 7 * 86400000).toISOString(), now]
|
|
7008
|
+
};
|
|
7009
|
+
}
|
|
7010
|
+
function groupCondition(group) {
|
|
7011
|
+
const { lo, hi } = keyPrefixRange(group);
|
|
7012
|
+
const start = [...lo].length + 1;
|
|
7013
|
+
return {
|
|
7014
|
+
sql: `(r."key" >= ? AND r."key" < ? AND (r."key" = ? OR (
|
|
7015
|
+
instr(substr(r."key", ?, length(r."key") - ?), '/') = 0 AND
|
|
7016
|
+
(${SESSION_LEAF_KINDS.map(() => 'substr(r."key", ?) GLOB ?').join(" OR ")})
|
|
7017
|
+
)))`,
|
|
7018
|
+
params: [
|
|
7019
|
+
lo,
|
|
7020
|
+
hi,
|
|
7021
|
+
lo,
|
|
7022
|
+
start,
|
|
7023
|
+
start,
|
|
7024
|
+
...SESSION_LEAF_KINDS.flatMap((kind) => [start, `${kind}:?*/`])
|
|
7025
|
+
]
|
|
7026
|
+
};
|
|
7027
|
+
}
|
|
7028
|
+
function sessionRootFilter(opts = {}) {
|
|
7029
|
+
const conditions = ["r.parentTaskId IS NULL"];
|
|
7030
|
+
const params = [];
|
|
7031
|
+
const add = (fragment) => {
|
|
7032
|
+
conditions.push(fragment.sql);
|
|
7033
|
+
params.push(...fragment.params);
|
|
7034
|
+
};
|
|
7035
|
+
if (opts.rootId)
|
|
7036
|
+
add({ sql: "r.id = ?", params: [opts.rootId] });
|
|
7037
|
+
const sources = opts.source?.filter(Boolean) ?? [];
|
|
7038
|
+
if (sources.length)
|
|
7039
|
+
add({ sql: `r.source IN (${sources.map(() => "?").join(",")})`, params: sources });
|
|
7040
|
+
if (opts.q?.trim()) {
|
|
7041
|
+
const like = `%${opts.q.trim().toLowerCase()}%`;
|
|
7042
|
+
add({
|
|
7043
|
+
sql: "(lower(r.task) LIKE ? OR lower(COALESCE(r.title, '')) LIKE ?)",
|
|
7044
|
+
params: [like, like]
|
|
7045
|
+
});
|
|
7046
|
+
}
|
|
7047
|
+
if (opts.requestedByUserId?.trim())
|
|
7048
|
+
add({ sql: "r.requestedByUserId = ?", params: [opts.requestedByUserId.trim()] });
|
|
7049
|
+
if (opts.contextKeyPrefix)
|
|
7050
|
+
add({
|
|
7051
|
+
sql: "r.contextKey LIKE ? ESCAPE '\\'",
|
|
7052
|
+
params: [literalPrefixPattern2(opts.contextKeyPrefix)]
|
|
7053
|
+
});
|
|
7054
|
+
if (opts.viewer) {
|
|
7055
|
+
add(sessionViewerCondition(opts.viewer));
|
|
7056
|
+
if (opts.tree)
|
|
7057
|
+
conditions.push("r.requestedByUserId IS NOT NULL");
|
|
7058
|
+
}
|
|
7059
|
+
if (opts.keyPrefix) {
|
|
7060
|
+
const { lo, hi } = keyPrefixRange(opts.keyPrefix);
|
|
7061
|
+
add({ sql: 'r."key" >= ? AND r."key" < ?', params: [lo, hi] });
|
|
7062
|
+
}
|
|
7063
|
+
if (opts.groupKey)
|
|
7064
|
+
add(groupCondition(normalizeAssetKey(opts.groupKey)));
|
|
7065
|
+
if (opts.noGroup) {
|
|
7066
|
+
const groups = [groupCondition("shared/")];
|
|
7067
|
+
if (opts.viewer?.userId)
|
|
7068
|
+
groups.push(groupCondition(`personal/${opts.viewer.userId}/`));
|
|
7069
|
+
add({
|
|
7070
|
+
sql: `(${groups.map((g) => g.sql).join(" OR ")})`,
|
|
7071
|
+
params: groups.flatMap((g) => g.params)
|
|
7072
|
+
});
|
|
7073
|
+
}
|
|
7074
|
+
if (opts.triage === "later" || opts.triage === "done") {
|
|
7075
|
+
add({
|
|
7076
|
+
sql: `r.id IN (SELECT itemId FROM inbox_item_state
|
|
7077
|
+
WHERE userId = ? AND itemType = 'to_read' AND status IN (${opts.triage === "later" ? "'snoozed'" : "'done','dismissed'"}))`,
|
|
7078
|
+
params: [opts.viewer?.userId ?? null]
|
|
7079
|
+
});
|
|
7080
|
+
}
|
|
7081
|
+
return { sql: conditions.join(" AND "), params };
|
|
7082
|
+
}
|
|
7083
|
+
function excludesTriaged(opts) {
|
|
7084
|
+
return !!(opts.viewer?.userId && (opts.groupKey || opts.keyPrefix || opts.noGroup));
|
|
7085
|
+
}
|
|
7086
|
+
function hasSessionChainFilter(opts) {
|
|
7087
|
+
return !!(opts.triage || opts.status || opts.withUserId || excludesTriaged(opts));
|
|
7088
|
+
}
|
|
7089
|
+
function sessionSummaryQuery(opts = {}) {
|
|
7090
|
+
const root = sessionRootFilter(opts);
|
|
7091
|
+
const read = opts.viewer?.userId ? sessionReadStateSql(opts.now) : { sql: "NULL", params: [] };
|
|
7092
|
+
const params = [...root.params];
|
|
7093
|
+
if (opts.withUserId)
|
|
7094
|
+
params.push(opts.withUserId);
|
|
7095
|
+
params.push(...read.params, opts.viewer?.userId ?? null);
|
|
7096
|
+
const filters = [];
|
|
7097
|
+
if (opts.triage === "unread")
|
|
7098
|
+
filters.push("readState = 'unread'");
|
|
7099
|
+
else if (opts.triage === "later" || opts.triage === "done") {
|
|
7100
|
+
filters.push("readState = ?");
|
|
7101
|
+
params.push(opts.triage);
|
|
7102
|
+
} else if (opts.triage === "inbox" || excludesTriaged(opts)) {
|
|
7103
|
+
filters.push("(readState IS NULL OR readState IN ('read','unread'))");
|
|
7104
|
+
}
|
|
7105
|
+
if (opts.status === "running")
|
|
7106
|
+
filters.push(runningSql);
|
|
7107
|
+
if (opts.status === "failed")
|
|
7108
|
+
filters.push("latestStatus = 'failed'");
|
|
7109
|
+
if (opts.status === "needs")
|
|
7110
|
+
filters.push("needsYou = 1");
|
|
7111
|
+
if (opts.withUserId) {
|
|
7112
|
+
filters.push(`(a.withUser > 0 OR EXISTS (SELECT 1 FROM session_shares sh
|
|
7113
|
+
WHERE sh.rootTaskId = a.root_id AND sh.revokedAt IS NULL AND sh.userId = ?))`);
|
|
7114
|
+
params.push(opts.withUserId);
|
|
7115
|
+
}
|
|
7116
|
+
return {
|
|
7117
|
+
sql: `WITH RECURSIVE chain(root_id, id, lastUpdatedAt, status, requestedByUserId) AS (
|
|
7118
|
+
SELECT r.id, r.id, r.lastUpdatedAt, r.status, r.requestedByUserId
|
|
7119
|
+
FROM agent_tasks r WHERE ${root.sql}
|
|
7120
|
+
UNION ALL
|
|
7121
|
+
SELECT c.root_id, t.id, t.lastUpdatedAt, t.status, t.requestedByUserId
|
|
7122
|
+
FROM chain c JOIN agent_tasks t ON t.parentTaskId = c.id
|
|
7123
|
+
), agg AS (
|
|
7124
|
+
SELECT root_id, COUNT(*) AS chainCount,
|
|
7125
|
+
status AS latestStatus, MAX(lastUpdatedAt) AS lastActivityAt,
|
|
7126
|
+
${opts.withUserId ? "SUM(requestedByUserId = ?) AS withUser," : ""}
|
|
7127
|
+
SUM(EXISTS (SELECT 1 FROM approval_requests ar
|
|
7128
|
+
WHERE ar.sourceTaskId = chain.id AND ar.status = 'pending')) AS pendingApproval
|
|
7129
|
+
FROM chain GROUP BY root_id
|
|
7130
|
+
), state AS (
|
|
7131
|
+
SELECT a.*, ${read.sql} AS readState, s.snoozeUntil
|
|
7132
|
+
FROM agg a LEFT JOIN inbox_item_state s
|
|
7133
|
+
ON s.userId = ? AND s.itemType = 'to_read' AND s.itemId = a.root_id
|
|
7134
|
+
), summary AS (
|
|
7135
|
+
SELECT *, (COALESCE(readState = 'unread' AND latestStatus = 'failed', 0) OR pendingApproval) AS needsYou
|
|
7136
|
+
FROM state
|
|
7137
|
+
)
|
|
7138
|
+
SELECT a.* FROM summary a ${filters.length ? `WHERE ${filters.join(" AND ")}` : ""}`,
|
|
7139
|
+
params
|
|
7140
|
+
};
|
|
7141
|
+
}
|
|
7142
|
+
async function getSessionReadState(rootId, userId, now) {
|
|
7143
|
+
const query = sessionSummaryQuery({ rootId, viewer: { userId, scope: "all" }, now });
|
|
7144
|
+
const row = await getDbClient2().get(`SELECT readState, lastActivityAt FROM (${query.sql})`, query.params);
|
|
7145
|
+
return row?.readState ? { readState: row.readState, lastActivityAt: row.lastActivityAt } : null;
|
|
7146
|
+
}
|
|
7147
|
+
function sessionCountQuery(opts = {}) {
|
|
7148
|
+
const chain = hasSessionChainFilter(opts);
|
|
7149
|
+
const query = chain ? sessionSummaryQuery(opts) : sessionRootFilter(opts);
|
|
7150
|
+
return {
|
|
7151
|
+
sql: chain ? `SELECT COUNT(*) AS count FROM (${query.sql})` : `SELECT COUNT(*) AS count FROM agent_tasks r WHERE ${query.sql}`,
|
|
7152
|
+
params: query.params
|
|
7153
|
+
};
|
|
7154
|
+
}
|
|
7155
|
+
async function sessionPageFields(roots) {
|
|
7156
|
+
const result = new Map;
|
|
7157
|
+
if (!roots.length)
|
|
7158
|
+
return result;
|
|
7159
|
+
const ids = roots.map((r) => r.id);
|
|
7160
|
+
const [tasks, shares] = await Promise.all([
|
|
7161
|
+
getDbClient2().query(`WITH RECURSIVE chain(root_id, id) AS (
|
|
7162
|
+
SELECT id, id FROM agent_tasks WHERE id IN (${ids.map(() => "?").join(",")})
|
|
7163
|
+
UNION ALL SELECT c.root_id, t.id FROM chain c JOIN agent_tasks t ON t.parentTaskId = c.id
|
|
7164
|
+
) SELECT c.root_id, t.requestedByUserId AS id, u.name,
|
|
7165
|
+
CASE WHEN t.source = 'system' AND t.taskType = 'follow-up' THEN NULL ELSE NULLIF(trim(substr(t.output, 1, 200)), '') END AS preview
|
|
7166
|
+
FROM chain c CROSS JOIN agent_tasks t ON t.id = c.id
|
|
7167
|
+
LEFT JOIN users u ON u.id = t.requestedByUserId
|
|
7168
|
+
ORDER BY t.lastUpdatedAt DESC, t.createdAt DESC, t.id DESC`, ids),
|
|
7169
|
+
getDbClient2().query(`SELECT sh.rootTaskId AS root_id, sh.userId AS id, u.name, sh.access FROM session_shares sh
|
|
7170
|
+
LEFT JOIN users u ON u.id = sh.userId
|
|
7171
|
+
WHERE sh.revokedAt IS NULL AND sh.rootTaskId IN (${ids.map(() => "?").join(",")})
|
|
7172
|
+
ORDER BY sh.createdAt, sh.id`, ids)
|
|
7173
|
+
]);
|
|
7174
|
+
const people = new Map;
|
|
7175
|
+
for (const root of roots) {
|
|
7176
|
+
result.set(root.id, { shared: false, preview: null, shares: [] });
|
|
7177
|
+
people.set(root.id, new Map);
|
|
7178
|
+
}
|
|
7179
|
+
for (const root of roots) {
|
|
7180
|
+
if (!root.requestedByUserId)
|
|
7181
|
+
continue;
|
|
7182
|
+
people.get(root.id).set(root.requestedByUserId, root.requestedByUserId);
|
|
7183
|
+
}
|
|
7184
|
+
for (const task of tasks) {
|
|
7185
|
+
if (task.id)
|
|
7186
|
+
people.get(task.root_id).set(task.id, task.name ?? task.id);
|
|
7187
|
+
const fields = result.get(task.root_id);
|
|
7188
|
+
if (fields.preview === null && task.preview !== null)
|
|
7189
|
+
fields.preview = task.preview;
|
|
7190
|
+
}
|
|
7191
|
+
for (const share of shares) {
|
|
7192
|
+
const fields = result.get(share.root_id);
|
|
7193
|
+
fields.shared = true;
|
|
7194
|
+
fields.shares.push({ userId: share.id, name: share.name, access: share.access });
|
|
7195
|
+
if (share.id)
|
|
7196
|
+
people.get(share.root_id).set(share.id, share.name ?? share.id);
|
|
7197
|
+
}
|
|
7198
|
+
for (const [id, members] of people) {
|
|
7199
|
+
Object.assign(result.get(id), {
|
|
7200
|
+
people: [...members].slice(0, 8).map(([id, name]) => ({ id, name })),
|
|
7201
|
+
peopleCount: members.size
|
|
7202
|
+
});
|
|
7203
|
+
}
|
|
7204
|
+
return result;
|
|
7205
|
+
}
|
|
7206
|
+
async function getSessionTree(actor, now) {
|
|
7207
|
+
const query = sessionSummaryQuery({
|
|
7208
|
+
...actor.kind === "user" ? { viewer: { userId: actor.userId, scope: "all" } } : {},
|
|
7209
|
+
now,
|
|
7210
|
+
tree: true
|
|
7211
|
+
});
|
|
7212
|
+
const rows = await getDbClient2().query(`SELECT r."key", a.lastActivityAt, a.latestStatus, a.readState, a.needsYou
|
|
7213
|
+
FROM (${query.sql}) a CROSS JOIN agent_tasks r ON r.id = a.root_id`, query.params);
|
|
7214
|
+
const counts = () => ({ total: 0, unread: 0, running: 0, needsYou: 0 });
|
|
7215
|
+
const result = {
|
|
7216
|
+
groups: [],
|
|
7217
|
+
inbox: counts(),
|
|
7218
|
+
later: counts(),
|
|
7219
|
+
done: counts(),
|
|
7220
|
+
noGroup: counts()
|
|
7221
|
+
};
|
|
7222
|
+
const groups = new Map;
|
|
7223
|
+
const add = (section, row) => {
|
|
7224
|
+
section.total++;
|
|
7225
|
+
if (row.readState === "unread")
|
|
7226
|
+
section.unread++;
|
|
7227
|
+
if (!isTerminalTaskStatus(row.latestStatus))
|
|
7228
|
+
section.running++;
|
|
7229
|
+
if (row.needsYou)
|
|
7230
|
+
section.needsYou++;
|
|
7231
|
+
};
|
|
7232
|
+
for (const row of rows) {
|
|
7233
|
+
const key = sessionGroupKey(row.key);
|
|
7234
|
+
const noGroup = key === "shared/" || actor.kind === "user" && key === `personal/${actor.userId}/`;
|
|
7235
|
+
let group;
|
|
7236
|
+
if (!noGroup) {
|
|
7237
|
+
group = groups.get(key);
|
|
7238
|
+
if (!group) {
|
|
7239
|
+
group = { key, ...counts(), lastActivityAt: row.lastActivityAt };
|
|
7240
|
+
groups.set(key, group);
|
|
7241
|
+
}
|
|
7242
|
+
if (row.lastActivityAt > group.lastActivityAt)
|
|
7243
|
+
group.lastActivityAt = row.lastActivityAt;
|
|
7244
|
+
}
|
|
7245
|
+
if (row.readState === "later" || row.readState === "done")
|
|
7246
|
+
add(result[row.readState], row);
|
|
7247
|
+
else {
|
|
7248
|
+
add(result.inbox, row);
|
|
7249
|
+
if (noGroup)
|
|
7250
|
+
add(result.noGroup, row);
|
|
7251
|
+
else if (group)
|
|
7252
|
+
add(group, row);
|
|
7253
|
+
}
|
|
7254
|
+
}
|
|
7255
|
+
result.groups = [...groups.values()].sort((a, b) => a.key.localeCompare(b.key));
|
|
7256
|
+
return result;
|
|
7257
|
+
}
|
|
7258
|
+
var runningSql;
|
|
7259
|
+
var init_session_tree = __esm(() => {
|
|
7260
|
+
init_key();
|
|
7261
|
+
init_types();
|
|
7262
|
+
init_db3();
|
|
7263
|
+
init_session_visibility();
|
|
7264
|
+
runningSql = `latestStatus NOT IN (${TERMINAL_TASK_STATUSES.map((s) => `'${s}'`).join(",")})`;
|
|
7265
|
+
});
|
|
7266
|
+
|
|
6838
7267
|
// src/be/db/tasks/human-free.ts
|
|
6839
7268
|
function humanFreeCase(parentFlag) {
|
|
6840
7269
|
return `CASE
|
|
@@ -7350,7 +7779,7 @@ async function completeTask2(id, output, options) {
|
|
|
7350
7779
|
});
|
|
7351
7780
|
} catch {}
|
|
7352
7781
|
getDbClient2().afterCommit(() => {
|
|
7353
|
-
import("./event-bus-
|
|
7782
|
+
import("./event-bus-3z78ep5n.js").then(({ workflowEventBus }) => {
|
|
7354
7783
|
workflowEventBus.emit("task.completed", {
|
|
7355
7784
|
taskId: id,
|
|
7356
7785
|
output: scrubbedOutput,
|
|
@@ -7405,7 +7834,7 @@ async function failTask2(id, reason, opts = {}) {
|
|
|
7405
7834
|
});
|
|
7406
7835
|
} catch {}
|
|
7407
7836
|
getDbClient2().afterCommit(() => {
|
|
7408
|
-
import("./event-bus-
|
|
7837
|
+
import("./event-bus-3z78ep5n.js").then(({ workflowEventBus }) => {
|
|
7409
7838
|
workflowEventBus.emit("task.failed", {
|
|
7410
7839
|
taskId: id,
|
|
7411
7840
|
failureReason: scrubbedReason,
|
|
@@ -7487,7 +7916,7 @@ async function cancelTask2(id, reason) {
|
|
|
7487
7916
|
});
|
|
7488
7917
|
} catch {}
|
|
7489
7918
|
getDbClient2().afterCommit(() => {
|
|
7490
|
-
import("./event-bus-
|
|
7919
|
+
import("./event-bus-3z78ep5n.js").then(({ workflowEventBus }) => {
|
|
7491
7920
|
workflowEventBus.emit("task.cancelled", {
|
|
7492
7921
|
taskId: id,
|
|
7493
7922
|
agentId: row.agentId,
|
|
@@ -7544,7 +7973,7 @@ async function supersedeTask2(id, args) {
|
|
|
7544
7973
|
});
|
|
7545
7974
|
} catch {}
|
|
7546
7975
|
getDbClient2().afterCommit(() => {
|
|
7547
|
-
import("./event-bus-
|
|
7976
|
+
import("./event-bus-3z78ep5n.js").then(({ workflowEventBus }) => {
|
|
7548
7977
|
workflowEventBus.emit("task.superseded", {
|
|
7549
7978
|
taskId: id,
|
|
7550
7979
|
reason: args.reason,
|
|
@@ -7758,7 +8187,7 @@ async function updateTaskProgress2(id, progress) {
|
|
|
7758
8187
|
});
|
|
7759
8188
|
} catch {}
|
|
7760
8189
|
getDbClient2().afterCommit(() => {
|
|
7761
|
-
import("./event-bus-
|
|
8190
|
+
import("./event-bus-3z78ep5n.js").then(({ workflowEventBus }) => {
|
|
7762
8191
|
workflowEventBus.emit("task.progress", {
|
|
7763
8192
|
taskId: id,
|
|
7764
8193
|
progress: scrubbedProgress,
|
|
@@ -7829,14 +8258,70 @@ function emitChildRunFinished(childRunId, parentStepId, status) {
|
|
|
7829
8258
|
}
|
|
7830
8259
|
function emitAfterCommit(childRunId, parentStepId) {
|
|
7831
8260
|
getDbClient2().afterCommit(() => {
|
|
7832
|
-
import("./event-bus-
|
|
8261
|
+
import("./event-bus-3z78ep5n.js").then(({ workflowEventBus }) => {
|
|
7833
8262
|
workflowEventBus.emit("workflow.child.finished", { childRunId, parentStepId });
|
|
7834
8263
|
}).catch((err) => console.error("[db] workflow.child.finished event not emitted:", scrubSecrets(err instanceof Error ? err.message : String(err))));
|
|
7835
8264
|
});
|
|
7836
8265
|
}
|
|
8266
|
+
async function createForeachChildSteps(runId, parentNodeId, rows) {
|
|
8267
|
+
if (rows.length === 0)
|
|
8268
|
+
return 0;
|
|
8269
|
+
const prefix = `${parentNodeId}#`;
|
|
8270
|
+
return getDbClient2().transaction(async (tx) => {
|
|
8271
|
+
const existing = await tx.query("SELECT DISTINCT nodeId FROM workflow_run_steps WHERE runId = ? AND substr(nodeId, 1, ?) = ?", [runId, prefix.length, prefix]);
|
|
8272
|
+
const existingNodeIds = new Set(existing.map((row) => row.nodeId));
|
|
8273
|
+
const now = new Date().toISOString();
|
|
8274
|
+
let created = 0;
|
|
8275
|
+
for (const row of rows) {
|
|
8276
|
+
if (existingNodeIds.has(row.nodeId))
|
|
8277
|
+
continue;
|
|
8278
|
+
await tx.run(`INSERT INTO workflow_run_steps (id, runId, nodeId, nodeType, status, startedAt, input, idempotencyKey)
|
|
8279
|
+
VALUES (?, ?, ?, ?, 'pending', ?, ?, ?)`, [
|
|
8280
|
+
row.id,
|
|
8281
|
+
runId,
|
|
8282
|
+
row.nodeId,
|
|
8283
|
+
row.nodeType,
|
|
8284
|
+
now,
|
|
8285
|
+
scrubJsonValue(row.input),
|
|
8286
|
+
row.idempotencyKey
|
|
8287
|
+
]);
|
|
8288
|
+
existingNodeIds.add(row.nodeId);
|
|
8289
|
+
created++;
|
|
8290
|
+
}
|
|
8291
|
+
return created;
|
|
8292
|
+
});
|
|
8293
|
+
}
|
|
8294
|
+
async function createForeachAttemptSteps(runId, rows) {
|
|
8295
|
+
if (rows.length === 0)
|
|
8296
|
+
return 0;
|
|
8297
|
+
return getDbClient2().transaction(async (tx) => {
|
|
8298
|
+
const now = new Date().toISOString();
|
|
8299
|
+
let created = 0;
|
|
8300
|
+
for (const row of rows) {
|
|
8301
|
+
const count = await tx.get("SELECT COUNT(*) AS n FROM workflow_run_steps WHERE runId = ? AND nodeId = ?", [runId, row.nodeId]);
|
|
8302
|
+
const attempt = count?.n ?? 0;
|
|
8303
|
+
const inserted = await tx.get(`INSERT INTO workflow_run_steps (id, runId, nodeId, nodeType, status, startedAt, input, idempotencyKey)
|
|
8304
|
+
VALUES (?, ?, ?, ?, 'pending', ?, ?, ?)
|
|
8305
|
+
ON CONFLICT(idempotencyKey) DO NOTHING
|
|
8306
|
+
RETURNING id`, [
|
|
8307
|
+
crypto.randomUUID(),
|
|
8308
|
+
runId,
|
|
8309
|
+
row.nodeId,
|
|
8310
|
+
row.nodeType,
|
|
8311
|
+
now,
|
|
8312
|
+
scrubJsonValue({ itemKey: row.itemKey, index: row.index, attempt }),
|
|
8313
|
+
`${runId}:${row.nodeId}:${attempt}`
|
|
8314
|
+
]);
|
|
8315
|
+
if (inserted)
|
|
8316
|
+
created++;
|
|
8317
|
+
}
|
|
8318
|
+
return created;
|
|
8319
|
+
});
|
|
8320
|
+
}
|
|
7837
8321
|
var TERMINAL_STATUSES;
|
|
7838
8322
|
var init_workflow_runs = __esm(() => {
|
|
7839
8323
|
init_secret_scrubber();
|
|
8324
|
+
init_scrub_json();
|
|
7840
8325
|
init_runtime();
|
|
7841
8326
|
TERMINAL_STATUSES = new Set([
|
|
7842
8327
|
"completed",
|
|
@@ -8559,6 +9044,7 @@ var init_swarm_config_guard = __esm(() => {
|
|
|
8559
9044
|
"GITHUB_DISABLE",
|
|
8560
9045
|
"GITLAB_DISABLE",
|
|
8561
9046
|
"AZURE_DEVOPS_DISABLE",
|
|
9047
|
+
"BITBUCKET_DISABLE",
|
|
8562
9048
|
"LINEAR_DISABLE",
|
|
8563
9049
|
"JIRA_DISABLE",
|
|
8564
9050
|
"AGENTMAIL_DISABLE",
|
|
@@ -19222,7 +19708,7 @@ async function loadSecretRegistry() {
|
|
|
19222
19708
|
result.failed += 1;
|
|
19223
19709
|
}
|
|
19224
19710
|
try {
|
|
19225
|
-
const { loadRuntimeControllerSecrets } = await import("./db-
|
|
19711
|
+
const { loadRuntimeControllerSecrets } = await import("./db-t86xrnes.js");
|
|
19226
19712
|
const loaded = await loadRuntimeControllerSecrets();
|
|
19227
19713
|
result.runtimeController = loaded.count;
|
|
19228
19714
|
result.failed += loaded.failed;
|
|
@@ -19537,6 +20023,7 @@ var init_script_runs = __esm(() => {
|
|
|
19537
20023
|
// src/be/db.ts
|
|
19538
20024
|
var exports_db = {};
|
|
19539
20025
|
__export(exports_db, {
|
|
20026
|
+
AssetKeyMovesBlockedError: () => AssetKeyMovesBlockedError2,
|
|
19540
20027
|
EXTENSION_AGENT_ROLE: () => EXTENSION_AGENT_ROLE2,
|
|
19541
20028
|
ExtensionAgentAssignmentError: () => ExtensionAgentAssignmentError2,
|
|
19542
20029
|
KvTypeCollisionError: () => KvTypeCollisionError2,
|
|
@@ -19551,6 +20038,7 @@ __export(exports_db, {
|
|
|
19551
20038
|
__resetSqliteVecExtensionPathCacheForTests: () => __resetSqliteVecExtensionPathCacheForTests2,
|
|
19552
20039
|
abandonSlackOutcomeDelivery: () => abandonSlackOutcomeDelivery2,
|
|
19553
20040
|
acceptTask: () => acceptTask2,
|
|
20041
|
+
assertAssetKeyMovesAllowed: () => assertAssetKeyMovesAllowed2,
|
|
19554
20042
|
assignUnassignedTaskPending: () => assignUnassignedTaskPending2,
|
|
19555
20043
|
autoEncryptLegacyPlaintextSecrets: () => autoEncryptLegacyPlaintextSecrets2,
|
|
19556
20044
|
backfillSupersedeTaskResumeTaskId: () => backfillSupersedeTaskResumeTaskId2,
|
|
@@ -19650,6 +20138,7 @@ __export(exports_db, {
|
|
|
19650
20138
|
extensionAgentAssignmentError: () => extensionAgentAssignmentError2,
|
|
19651
20139
|
failPendingResumeIfUnclaimed: () => failPendingResumeIfUnclaimed2,
|
|
19652
20140
|
failTask: () => failTask2,
|
|
20141
|
+
findActiveTasksByVcs: () => findActiveTasksByVcs2,
|
|
19653
20142
|
findCompletedTaskInThread: () => findCompletedTaskInThread2,
|
|
19654
20143
|
findExistingLinearTrackerContextWork: () => findExistingLinearTrackerContextWork2,
|
|
19655
20144
|
findRecentCancelledTaskInThread: () => findRecentCancelledTaskInThread2,
|
|
@@ -19770,6 +20259,7 @@ __export(exports_db, {
|
|
|
19770
20259
|
getPageVersions: () => getPageVersions2,
|
|
19771
20260
|
getPausedTasksForAgent: () => getPausedTasksForAgent2,
|
|
19772
20261
|
getPendingApprovalVoteState: () => getPendingApprovalVoteState2,
|
|
20262
|
+
getPendingApprovalsForTasks: () => getPendingApprovalsForTasks2,
|
|
19773
20263
|
getPendingChatRelayTasks: () => getPendingChatRelayTasks2,
|
|
19774
20264
|
getPendingEventWaitNames: () => getPendingEventWaitNames2,
|
|
19775
20265
|
getPendingSlackRelayTasks: () => getPendingSlackRelayTasks2,
|
|
@@ -19921,6 +20411,7 @@ __export(exports_db, {
|
|
|
19921
20411
|
listWorkflowRuns: () => listWorkflowRuns2,
|
|
19922
20412
|
listWorkflowRunsPage: () => listWorkflowRunsPage2,
|
|
19923
20413
|
listWorkflows: () => listWorkflows2,
|
|
20414
|
+
literalPrefixPattern: () => literalPrefixPattern2,
|
|
19924
20415
|
markChatRelayAttempted: () => markChatRelayAttempted2,
|
|
19925
20416
|
markChatRelayDelivered: () => markChatRelayDelivered2,
|
|
19926
20417
|
markChatRelayGivenUp: () => markChatRelayGivenUp2,
|
|
@@ -19940,6 +20431,7 @@ __export(exports_db, {
|
|
|
19940
20431
|
markTasksNotified: () => markTasksNotified2,
|
|
19941
20432
|
maskSecrets: () => maskSecrets2,
|
|
19942
20433
|
moveAssetKey: () => moveAssetKey2,
|
|
20434
|
+
moveTaskChainKeyInTx: () => moveTaskChainKeyInTx2,
|
|
19943
20435
|
moveTaskFromBacklog: () => moveTaskFromBacklog2,
|
|
19944
20436
|
moveTaskToBacklog: () => moveTaskToBacklog2,
|
|
19945
20437
|
normalizeSkillFilePath: () => normalizeSkillFilePath2,
|
|
@@ -20045,11 +20537,11 @@ __export(exports_db, {
|
|
|
20045
20537
|
upsertSwarmConfig: () => upsertSwarmConfig2,
|
|
20046
20538
|
withFavoriteFlags: () => withFavoriteFlags2
|
|
20047
20539
|
});
|
|
20048
|
-
function
|
|
20540
|
+
function literalPrefixPattern2(prefix) {
|
|
20049
20541
|
return `${prefix.replace(/[\\%_]/g, "\\$&")}%`;
|
|
20050
20542
|
}
|
|
20051
20543
|
function assetKeyPrefixPattern(input) {
|
|
20052
|
-
return
|
|
20544
|
+
return literalPrefixPattern2(normalizeAssetKey(input));
|
|
20053
20545
|
}
|
|
20054
20546
|
function emitTaskLifecycleTelemetryAfterCommit(event, props, verify, actorUserId) {
|
|
20055
20547
|
getDbClient2().afterCommit(() => {
|
|
@@ -20631,7 +21123,7 @@ function rowToAssetKeyMapping(row) {
|
|
|
20631
21123
|
updatedBy: row.updated_by ?? undefined
|
|
20632
21124
|
};
|
|
20633
21125
|
}
|
|
20634
|
-
async function
|
|
21126
|
+
async function insertAssetKeyHistory2(input) {
|
|
20635
21127
|
await getDbClient2().run(`INSERT INTO asset_key_history
|
|
20636
21128
|
(id, entity_type, entity_id, previous_key, new_key, changed_by)
|
|
20637
21129
|
VALUES (?, ?, ?, ?, ?, ?)`, [
|
|
@@ -20673,7 +21165,7 @@ async function upsertAssetKeyMapping2(input) {
|
|
|
20673
21165
|
if (!row)
|
|
20674
21166
|
throw new Error("Failed to update asset key mapping");
|
|
20675
21167
|
if (existing.key !== key) {
|
|
20676
|
-
await
|
|
21168
|
+
await insertAssetKeyHistory2({
|
|
20677
21169
|
entityType: "file",
|
|
20678
21170
|
entityId: existing.id,
|
|
20679
21171
|
previousKey: existing.key,
|
|
@@ -20705,7 +21197,7 @@ async function upsertAssetKeyMapping2(input) {
|
|
|
20705
21197
|
]);
|
|
20706
21198
|
if (!row)
|
|
20707
21199
|
throw new Error("Failed to create asset key mapping");
|
|
20708
|
-
await
|
|
21200
|
+
await insertAssetKeyHistory2({
|
|
20709
21201
|
entityType: "file",
|
|
20710
21202
|
entityId: id,
|
|
20711
21203
|
newKey: key,
|
|
@@ -20829,12 +21321,7 @@ async function currentAssetKey(entityType, id) {
|
|
|
20829
21321
|
}
|
|
20830
21322
|
async function moveAssetKey2(input) {
|
|
20831
21323
|
const key = normalizeAssetKey(input.key);
|
|
20832
|
-
|
|
20833
|
-
readOnly: true
|
|
20834
|
-
});
|
|
20835
|
-
if (!audit.ok) {
|
|
20836
|
-
throw new Error("Asset namespace moves are blocked until structural errors, unknown personal users, or provider mapping drift are repaired.");
|
|
20837
|
-
}
|
|
21324
|
+
await assertAssetKeyMovesAllowed2();
|
|
20838
21325
|
const previousKey = await currentAssetKey(input.entityType, input.id);
|
|
20839
21326
|
if (!previousKey)
|
|
20840
21327
|
return false;
|
|
@@ -20850,55 +21337,9 @@ async function moveAssetKey2(input) {
|
|
|
20850
21337
|
return getDbClient2().transaction(async (tx) => {
|
|
20851
21338
|
switch (input.entityType) {
|
|
20852
21339
|
case "task": {
|
|
20853
|
-
const
|
|
20854
|
-
if (
|
|
21340
|
+
const movedTaskIds = await moveTaskChainKeyInTx2(input.id, input.descendantTaskIds ?? [], key, input.changedBy);
|
|
21341
|
+
if (movedTaskIds === false)
|
|
20855
21342
|
return false;
|
|
20856
|
-
const tasks = [root];
|
|
20857
|
-
for (const id of input.descendantTaskIds ?? []) {
|
|
20858
|
-
const task = id === root.id ? null : await getTaskById2(id);
|
|
20859
|
-
if (task)
|
|
20860
|
-
tasks.push(task);
|
|
20861
|
-
}
|
|
20862
|
-
const movedTaskIds = [];
|
|
20863
|
-
for (const task of tasks) {
|
|
20864
|
-
if (task.key === key)
|
|
20865
|
-
continue;
|
|
20866
|
-
const mappedFiles = await tx.query(`SELECT DISTINCT m.id, m."key" AS key
|
|
20867
|
-
FROM asset_key_mappings m
|
|
20868
|
-
JOIN task_attachments a
|
|
20869
|
-
ON m.provider_id = COALESCE(NULLIF(a.provider_id, ''), 'agent-fs')
|
|
20870
|
-
AND m.provider_org_id = COALESCE(a.agent_fs_org_id, '')
|
|
20871
|
-
AND m.provider_drive_id = COALESCE(a.agent_fs_drive_id, '')
|
|
20872
|
-
AND m.provider_key = COALESCE(NULLIF(a.provider_key, ''), a.path)
|
|
20873
|
-
WHERE a.task_id = ?
|
|
20874
|
-
AND (m.source_entity_type IS NOT 'task-attachment'
|
|
20875
|
-
OR m.source_entity_id IN (SELECT id FROM task_attachments WHERE task_id = ?))`, [task.id, task.id]);
|
|
20876
|
-
await tx.run('UPDATE agent_tasks SET "key" = ?, updated_by = ? WHERE id = ?', [
|
|
20877
|
-
key,
|
|
20878
|
-
input.changedBy ?? null,
|
|
20879
|
-
task.id
|
|
20880
|
-
]);
|
|
20881
|
-
for (const mapping of mappedFiles) {
|
|
20882
|
-
if (mapping.key === key)
|
|
20883
|
-
continue;
|
|
20884
|
-
await tx.run('UPDATE asset_key_mappings SET "key" = ?, updated_at = ?, updated_by = ? WHERE id = ?', [key, now, input.changedBy ?? null, mapping.id]);
|
|
20885
|
-
await insertAssetKeyHistory({
|
|
20886
|
-
entityType: "file",
|
|
20887
|
-
entityId: mapping.id,
|
|
20888
|
-
previousKey: mapping.key,
|
|
20889
|
-
newKey: key,
|
|
20890
|
-
changedBy: input.changedBy
|
|
20891
|
-
});
|
|
20892
|
-
}
|
|
20893
|
-
await insertAssetKeyHistory({
|
|
20894
|
-
entityType: "task",
|
|
20895
|
-
entityId: task.id,
|
|
20896
|
-
previousKey: task.key,
|
|
20897
|
-
newKey: key,
|
|
20898
|
-
changedBy: input.changedBy
|
|
20899
|
-
});
|
|
20900
|
-
movedTaskIds.push(task.id);
|
|
20901
|
-
}
|
|
20902
21343
|
return { movedTaskIds };
|
|
20903
21344
|
}
|
|
20904
21345
|
case "workflow":
|
|
@@ -20934,7 +21375,7 @@ async function moveAssetKey2(input) {
|
|
|
20934
21375
|
await tx.run('UPDATE asset_key_mappings SET "key" = ?, updated_at = ?, updated_by = ? WHERE id = ?', [key, now, input.changedBy ?? null, input.id]);
|
|
20935
21376
|
break;
|
|
20936
21377
|
}
|
|
20937
|
-
await
|
|
21378
|
+
await insertAssetKeyHistory2({
|
|
20938
21379
|
entityType: input.entityType,
|
|
20939
21380
|
entityId: input.id,
|
|
20940
21381
|
previousKey,
|
|
@@ -21584,7 +22025,7 @@ async function createTaskExtended2(task, options) {
|
|
|
21584
22025
|
priority: row.priority
|
|
21585
22026
|
}, (task) => task !== null, row.requestedByUserId);
|
|
21586
22027
|
getDbClient2().afterCommit(() => {
|
|
21587
|
-
import("./event-bus-
|
|
22028
|
+
import("./event-bus-3z78ep5n.js").then(({ workflowEventBus }) => {
|
|
21588
22029
|
workflowEventBus.emit("task.created", {
|
|
21589
22030
|
taskId: row.id,
|
|
21590
22031
|
task: row.task,
|
|
@@ -21666,7 +22107,7 @@ async function releaseTask2(taskId, wakeSnapshot) {
|
|
|
21666
22107
|
} catch {}
|
|
21667
22108
|
if (isRuntimePoolsEnabled() && !wakeSnapshot)
|
|
21668
22109
|
getDbClient2().afterCommit(() => {
|
|
21669
|
-
import("./event-bus-
|
|
22110
|
+
import("./event-bus-3z78ep5n.js").then(({ workflowEventBus }) => workflowEventBus.emit("task.unassigned", { taskId })).catch((error) => console.error("[db] Routing event failed:", scrubSecrets(String(error))));
|
|
21670
22111
|
});
|
|
21671
22112
|
}
|
|
21672
22113
|
return row ? rowToAgentTask(row) : null;
|
|
@@ -21736,7 +22177,7 @@ async function rejectTask2(taskId, agentId, reason) {
|
|
|
21736
22177
|
} catch {}
|
|
21737
22178
|
if (isRuntimePoolsEnabled())
|
|
21738
22179
|
getDbClient2().afterCommit(() => {
|
|
21739
|
-
import("./event-bus-
|
|
22180
|
+
import("./event-bus-3z78ep5n.js").then(({ workflowEventBus }) => workflowEventBus.emit("task.unassigned", { taskId })).catch((error) => console.error("[db] Routing event failed:", scrubSecrets(String(error))));
|
|
21740
22181
|
});
|
|
21741
22182
|
}
|
|
21742
22183
|
return row ? rowToAgentTask(row) : null;
|
|
@@ -26897,120 +27338,33 @@ async function getRootTaskChain2(rootTaskId) {
|
|
|
26897
27338
|
ORDER BY t.createdAt, t.rowid`, [rootTaskId]);
|
|
26898
27339
|
return rows.map(rowToAgentTask);
|
|
26899
27340
|
}
|
|
26900
|
-
async function listRecentSessions2(opts) {
|
|
26901
|
-
const
|
|
26902
|
-
const
|
|
26903
|
-
|
|
26904
|
-
|
|
26905
|
-
|
|
26906
|
-
|
|
26907
|
-
|
|
26908
|
-
|
|
26909
|
-
|
|
26910
|
-
|
|
26911
|
-
}
|
|
26912
|
-
|
|
26913
|
-
|
|
26914
|
-
|
|
26915
|
-
|
|
26916
|
-
|
|
26917
|
-
|
|
26918
|
-
|
|
26919
|
-
|
|
26920
|
-
|
|
26921
|
-
|
|
26922
|
-
|
|
26923
|
-
params.push(literalPrefixPattern(opts.contextKeyPrefix));
|
|
26924
|
-
}
|
|
26925
|
-
if (opts?.viewer) {
|
|
26926
|
-
const viewer = sessionViewerCondition(opts.viewer);
|
|
26927
|
-
conditions.push(viewer.sql);
|
|
26928
|
-
params.push(...viewer.params);
|
|
26929
|
-
}
|
|
26930
|
-
params.push(limit, offset);
|
|
26931
|
-
const rootRows = await getDbClient2().query(`WITH RECURSIVE chain(root_id, id, lastUpdatedAt, status) AS (
|
|
26932
|
-
SELECT r.id, r.id, r.lastUpdatedAt, r.status
|
|
26933
|
-
FROM agent_tasks r
|
|
26934
|
-
WHERE ${conditions.join(" AND ")}
|
|
26935
|
-
UNION ALL
|
|
26936
|
-
SELECT c.root_id, t.id, t.lastUpdatedAt, t.status
|
|
26937
|
-
FROM agent_tasks t
|
|
26938
|
-
JOIN chain c ON t.parentTaskId = c.id
|
|
26939
|
-
),
|
|
26940
|
-
agg AS (
|
|
26941
|
-
SELECT
|
|
26942
|
-
root_id,
|
|
26943
|
-
COUNT(*) AS chainCount,
|
|
26944
|
-
MAX(lastUpdatedAt) AS lastActivityAt
|
|
26945
|
-
FROM chain
|
|
26946
|
-
GROUP BY root_id
|
|
26947
|
-
),
|
|
26948
|
-
latest_status AS (
|
|
26949
|
-
SELECT c.root_id, c.status AS latestStatus
|
|
26950
|
-
FROM chain c
|
|
26951
|
-
JOIN agg a ON c.root_id = a.root_id AND c.lastUpdatedAt = a.lastActivityAt
|
|
26952
|
-
GROUP BY c.root_id
|
|
26953
|
-
)
|
|
26954
|
-
SELECT
|
|
26955
|
-
r.*,
|
|
26956
|
-
a.chainCount AS __chainCount,
|
|
26957
|
-
a.lastActivityAt AS __lastActivityAt,
|
|
26958
|
-
COALESCE(ls.latestStatus, r.status) AS __latestStatus
|
|
26959
|
-
FROM agent_tasks r
|
|
26960
|
-
JOIN agg a ON a.root_id = r.id
|
|
26961
|
-
LEFT JOIN latest_status ls ON ls.root_id = r.id
|
|
26962
|
-
ORDER BY a.lastActivityAt DESC, r.createdAt DESC, r.id DESC
|
|
26963
|
-
LIMIT ? OFFSET ?`, params);
|
|
26964
|
-
if (opts?.slim) {
|
|
26965
|
-
return rootRows.map((row) => {
|
|
26966
|
-
const { __chainCount, __lastActivityAt, __latestStatus, ...taskRow } = row;
|
|
26967
|
-
return {
|
|
26968
|
-
root: rowToAgentTaskSummary(taskRow),
|
|
26969
|
-
chainTaskCount: __chainCount,
|
|
26970
|
-
lastActivityAt: __lastActivityAt ?? row.lastUpdatedAt,
|
|
26971
|
-
latestStatus: __latestStatus ?? row.status
|
|
26972
|
-
};
|
|
26973
|
-
});
|
|
26974
|
-
}
|
|
26975
|
-
return rootRows.map((row) => {
|
|
26976
|
-
const { __chainCount, __lastActivityAt, __latestStatus, ...taskRow } = row;
|
|
26977
|
-
return {
|
|
26978
|
-
root: rowToAgentTask(taskRow),
|
|
26979
|
-
chainTaskCount: __chainCount,
|
|
26980
|
-
lastActivityAt: __lastActivityAt ?? row.lastUpdatedAt,
|
|
26981
|
-
latestStatus: __latestStatus ?? row.status
|
|
26982
|
-
};
|
|
26983
|
-
});
|
|
27341
|
+
async function listRecentSessions2(opts = {}) {
|
|
27342
|
+
const query = sessionSummaryQuery(opts);
|
|
27343
|
+
const rootRows = await getDbClient2().query(`SELECT r.*, a.chainCount AS __chainCount, a.lastActivityAt AS __lastActivityAt,
|
|
27344
|
+
a.latestStatus AS __latestStatus, a.readState AS __readState,
|
|
27345
|
+
a.snoozeUntil AS __snoozeUntil, a.needsYou AS __needsYou
|
|
27346
|
+
FROM (${query.sql}) a CROSS JOIN agent_tasks r ON r.id = a.root_id
|
|
27347
|
+
ORDER BY ${opts.triage === "later" ? "a.snoozeUntil ASC," : ""}
|
|
27348
|
+
a.lastActivityAt DESC, r.createdAt DESC, r.id DESC LIMIT ? OFFSET ?`, [...query.params, opts.limit ?? 25, opts.offset ?? 0]);
|
|
27349
|
+
const fields = await sessionPageFields(rootRows.map((row) => ({
|
|
27350
|
+
id: row.id,
|
|
27351
|
+
requestedByUserId: row.requestedByUserId ?? undefined
|
|
27352
|
+
})));
|
|
27353
|
+
return rootRows.map((row) => ({
|
|
27354
|
+
root: opts.slim ? rowToAgentTaskSummary(row) : rowToAgentTask(row),
|
|
27355
|
+
chainTaskCount: row.__chainCount,
|
|
27356
|
+
lastActivityAt: row.__lastActivityAt,
|
|
27357
|
+
latestStatus: row.__latestStatus,
|
|
27358
|
+
...row.__readState ? { readState: row.__readState } : {},
|
|
27359
|
+
snoozeUntil: row.__snoozeUntil,
|
|
27360
|
+
needsYou: !!row.__needsYou,
|
|
27361
|
+
groupKey: sessionGroupKey(row.key),
|
|
27362
|
+
...fields.get(row.id)
|
|
27363
|
+
}));
|
|
26984
27364
|
}
|
|
26985
|
-
async function countSessions2(opts) {
|
|
26986
|
-
const
|
|
26987
|
-
const
|
|
26988
|
-
const requestedByUserId = opts?.requestedByUserId?.trim() || undefined;
|
|
26989
|
-
const conditions = ["r.parentTaskId IS NULL"];
|
|
26990
|
-
const params = [];
|
|
26991
|
-
if (sources.length > 0) {
|
|
26992
|
-
conditions.push(`r.source IN (${sources.map(() => "?").join(", ")})`);
|
|
26993
|
-
params.push(...sources);
|
|
26994
|
-
}
|
|
26995
|
-
if (q && q.length > 0) {
|
|
26996
|
-
conditions.push("(lower(r.task) LIKE ? OR lower(COALESCE(r.title, '')) LIKE ?)");
|
|
26997
|
-
const like = `%${q.toLowerCase()}%`;
|
|
26998
|
-
params.push(like, like);
|
|
26999
|
-
}
|
|
27000
|
-
if (requestedByUserId) {
|
|
27001
|
-
conditions.push("r.requestedByUserId = ?");
|
|
27002
|
-
params.push(requestedByUserId);
|
|
27003
|
-
}
|
|
27004
|
-
if (opts?.contextKeyPrefix) {
|
|
27005
|
-
conditions.push(`r.contextKey LIKE ? ESCAPE '\\'`);
|
|
27006
|
-
params.push(literalPrefixPattern(opts.contextKeyPrefix));
|
|
27007
|
-
}
|
|
27008
|
-
if (opts?.viewer) {
|
|
27009
|
-
const viewer = sessionViewerCondition(opts.viewer);
|
|
27010
|
-
conditions.push(viewer.sql);
|
|
27011
|
-
params.push(...viewer.params);
|
|
27012
|
-
}
|
|
27013
|
-
const row = await getDbClient2().get(`SELECT COUNT(*) AS count FROM agent_tasks r WHERE ${conditions.join(" AND ")}`, params);
|
|
27365
|
+
async function countSessions2(opts = {}) {
|
|
27366
|
+
const query = sessionCountQuery(opts);
|
|
27367
|
+
const row = await getDbClient2().get(query.sql, query.params);
|
|
27014
27368
|
return row?.count ?? 0;
|
|
27015
27369
|
}
|
|
27016
27370
|
function rowToBudget(row) {
|
|
@@ -27739,7 +28093,8 @@ var init_db3 = __esm(() => {
|
|
|
27739
28093
|
init_context_versions();
|
|
27740
28094
|
init_model_profiles();
|
|
27741
28095
|
init_runtime();
|
|
27742
|
-
|
|
28096
|
+
init_session_moves();
|
|
28097
|
+
init_session_tree();
|
|
27743
28098
|
init_human_free();
|
|
27744
28099
|
init_read();
|
|
27745
28100
|
init_write();
|
|
@@ -27758,6 +28113,7 @@ var init_db3 = __esm(() => {
|
|
|
27758
28113
|
init_approvals();
|
|
27759
28114
|
init_context_versions();
|
|
27760
28115
|
init_script_runs();
|
|
28116
|
+
init_session_moves();
|
|
27761
28117
|
init_runtime();
|
|
27762
28118
|
init_read();
|
|
27763
28119
|
init_write();
|
|
@@ -27775,6 +28131,10 @@ var init_db3 = __esm(() => {
|
|
|
27775
28131
|
promotePendingSteeringForTask: (...args) => promotePendingSteeringForTask(...args),
|
|
27776
28132
|
cascadeFailDependents: (...args) => cascadeFailDependents2(...args)
|
|
27777
28133
|
});
|
|
28134
|
+
configureSessionMoveDependencies({
|
|
28135
|
+
auditAssetKeys: () => auditAssetKeys(getDb2()),
|
|
28136
|
+
insertAssetKeyHistory: (...args) => insertAssetKeyHistory2(...args)
|
|
28137
|
+
});
|
|
27778
28138
|
configureTaskReadDependencies({
|
|
27779
28139
|
checkDependencies: (taskId) => checkDependencies2(taskId),
|
|
27780
28140
|
assetKeyPrefixPattern: (input) => assetKeyPrefixPattern(input),
|
|
@@ -27812,4 +28172,4 @@ var init_db3 = __esm(() => {
|
|
|
27812
28172
|
};
|
|
27813
28173
|
});
|
|
27814
28174
|
|
|
27815
|
-
export { slackContextKey, chatSdkContextKey, chatThreadOfContextKey, agentmailContextKey, githubContextKey, gitlabContextKey, azureDevOpsContextKey, azureDevOpsWorkItemContextKey, linearContextKey, buildJiraContextKey, scheduleContextKey, workflowContextKey, agentContextKey, pageContextKey, init_context_key, checkSlackRoutingCoherence, init_slack_routing, init_catalog, catalog_default, COMPANY_TEAM_SIZES, COMPANY_USE_CASES, USER_FUNCTIONS, init_company_profile, mapTriggerSurface, init_telemetry_context, TELEMETRY_PROXY_ORIGIN, normalizeOrgWebsite, orgLogoUrl, isFilledOrgLogoUrl, init_org_website, beginRequestAuthScope, setRequestAuth, getRequestAuth, getCurrentRequestAuth, runWithoutRequestAuth, getCurrentRequestUserId, init_request_auth_context, setTelemetryIngestObserver, isTelemetryEnabled, _resolveIntegrationType, _resolveIntegrationProvider, initTelemetry, setTelemetryRoleResolver, setTelemetryFunctionResolver, isTelemetryReady, track, trackRelayed, telemetry, emitIntegrationConnected, init_telemetry, auditAssetKeys, init_asset_key_audit, CredentialBindingSchema, placeholderForConfigKey, CredentialBroker, DEFAULT_CREDENTIAL_BINDINGS, assertUrlSafe, parseEgressAllowlist, init_egress_guard, init_credential_broker, encryptSecret, decryptSecret, getEncryptionKey, init_crypto, isInTransaction, init_db_client, breaksJsonValidity, scrubJsonValue, init_scrub_json, sealJson, init_sealed_json, getPromptTemplateDefaultDrift, init_default_drift, init_templates, init_templates2, isSqliteVecAvailable2, resolveSqliteVecExtensionPath2, __resetSqliteVecExtensionPathCacheForTests2, initDb2, getDb2, closeDb2, getDbClient2, init_runtime, cachedUserRole, cachedUserFunction, configureOrgDomainPersistence, recomputeOrgDomain, scheduleOrgDomainRecompute, init_telemetry_identity, resolveTriggerSurface, emitTaskTelemetry, init_telemetry_trigger, CODEX_AUTH_WATCH_NAMESPACE, codexAuthBenchMarkerKey, isCodexAuthFailureReason, init_codex_auth_failure, isEnvExportRestrictedKey, init_config_env_export, MASKED_SECRET_VALUE, init_config_secrets, HeartbeatExpiryError, init_heartbeat_expiry, isRuntimePoolsEnabled, init_runtime_pools_flag, normalizeDate, normalizeDateRequired, init_date_utils, rowToAgent, updateAgentCredentialState2, updateAgentCredentialMissing2, 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, listApprovalRequestSummaries2, getPendingApprovalVoteState2, recordApprovalVotes2, computeContentHash2, createContextVersion2, getLatestContextVersion2, getContextVersion2, getContextVersionHistory2, vcsRepoName, vcsRepoUrlMatches, init_vcs_repo_match, rowToAgentTask, getTaskById2, getChildTasks2, TASK_LINEAGE_LIMITS2, getTaskLineage2, hasNonTerminalResumeChild2, SUPERSEDED_RESUME_REPAIR_WINDOW_MS2, getSupersededTasksWithoutResume2, getSupersededTasksWithUnsettledDependents2, hasNonTerminalRerouteDecisionChild2, getTasksByAgentId2, getAgentCurrentTask2, getTasksByStatus2, findTaskByVcs2, 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, getLatestActiveTaskByContextKey2, getLatestLeadTaskByContextKey2, getMostRecentTaskInThread2, findCompletedTaskInThread2, findRecentCancelledTaskInThread2, init_read, MODEL_PROFILE_CONFIG_KEY, listModelProfiles, getModelProfileByName, createModelProfile, updateModelProfile, modelProfileReferences, modelProfileRefError, deleteModelProfile, getAgentDefaultProfileName, repoModelOverrideKeys, taskProfileError, init_model_profiles, setHumanFreeQueueListener, drainHumanFreeReclassifyQueue, init_human_free, onTaskStarted, init_task_lifecycle_events, channelTopic, addWorkerSubscription, removeWorkerSubscription, listSubscribedWorkerAgents, init_channels, publishWorkerNudge, init_worker_nudges, createTask2, getPendingTaskForAgent2, assignUnassignedTaskPending2, startTask2, updateTaskClaudeSessionId2, recordTaskProviderIfUnset2, updateTaskTitle2, completeTask2, failTask2, overwriteTerminalTaskResultText2, cancelTask2, supersedeTask2, settleSupersededTaskDependents2, backfillSupersedeTaskResumeTaskId2, pauseTask2, resumeTask2, getPausedTasksForAgent2, getOrphanedInProgressTasksForAgent2, resetOrphanedInProgressTasksForAgent2, getRecentlyCancelledTasksForAgent2, deleteTask2, updateTaskProgress2, getChildWorkflowRunId, getWorkflowRunParent, getWorkflowRunLineage, getSettledChildRunParentSteps, init_workflow_runs, 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, completedStatusIcon, init_reaction_shortcode, API_DRAINING_HEADER, API_DRAIN_MAX_MS_LIMIT, isApiDrainingResponse, init_api_drain, parseEnabledTools, init_enabled_tools, parseTaskToolManifest, CHAT_TASK_ONLY_TOOLS, isChatSdkTask, selectTaskTools, init_task_tool_manifest, tierConfigKey, init_model_tier_keys, isApiOnlyConfigKey, isInternalConfigKey, internalConfigKeyError, isReservedConfigKey, reservedKeyError, MAX_DB_RETENTION_DAYS, DB_RETENTION_TUNING_BOUNDS, APPS_JSON_COLUMN_MAX_BYTES_BOUNDS, CODEX_OAUTH_KEEP_WARM_MAX_AGE_HOURS_BOUNDS, validateRuntimeTokenTtlHours, validateControllerTokenTtlDays, validateControllerGraceSec, validateConfigValue, validateExportToEnv, init_swarm_config_guard, getDefaultAuthorizationIdForProvider, getOAuthApp, getOAuthAppById, getOAuthAppIdByProvider, createOAuthApp, updateOAuthAppById, upsertOAuthApp, listAuthorizationsForApp, getAuthorizationById, upsertAuthorization, updateAuthorizationTokens, updateAuthorizationIdentity, deleteAuthorizationById, deleteAuthorizationsForApp, createOAuthPending, consumeOAuthPending, gcOAuthPending, markAuthorizationRefreshFailed, getOAuthTokens, listAuthorizationSweepRows, listKeepAliveAuthorizations, deleteOAuthTokens, acquireOAuthRefreshLock, releaseOAuthRefreshLock, init_oauth, OpenAI2, init_openai, CANDIDATE_SET_MULTIPLIER, isGraphExpansionEnabled, EMBEDDING_DIMENSIONS, init_constants, LONGTERM_ROOT, MEMORY_KEY_PATTERN, MEMORY_KEY_PATTERN_MESSAGE, MEMORY_KEY_MAX_LENGTH, isLongtermKey, longtermKeyError, isConsolidatedKey, consolidatedKeyMessage, resolveStoreKey, init_key_paths, computeScore, rerank, init_reranker, searchMemoryCandidates, init_search_candidates, rowToCandidate, init_sqlite_store, getEmbeddingProvider2, resetEmbeddingProvider2, getMemoryStore2, init_memory, embeddingProvider, embedScript, searchScripts, reembedAllScripts, init_embeddings, upsertScriptByName, getScript, getScriptById, getScriptVersion, listScripts, listScriptVersions, deleteScript, touchScratchScriptLastUsed, restoreScratchScriptLastUsedIfUnchanged, createScriptApi, listScriptApisForScript, getScriptApiById, getScriptApiSecret, updateScriptApi, rotateScriptApiSecret, deleteScriptApi, recordScriptApiUsage, init_db2, oauthSecretName, registerStoredSecret, loadSecretRegistry, init_secret_registry, STEERING_MOVED_ERROR, SteeringRequestError, isSteeringEnabled, getTaskSteeringFields, getTaskSteeringFieldsForTasks, promotePendingSteeringForTask, markSteeringUndeliverable, carryUnhandledSteering, requestSteering, init_steering, WorkflowReplayStateError, init_workflow_replay, SESSION_ACTIVITY_REFRESH_MIN_INTERVAL_MS2, refreshActiveSessionOnActivity2, getActiveSessionById, init_active_sessions, recordKeySeatMismatch2, getScriptRunExecutionArgs2, 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_db3 };
|
|
28175
|
+
export { slackContextKey, chatSdkContextKey, chatThreadOfContextKey, agentmailContextKey, githubContextKey, gitlabContextKey, azureDevOpsContextKey, azureDevOpsWorkItemContextKey, bitbucketContextKey, linearContextKey, buildJiraContextKey, scheduleContextKey, workflowContextKey, agentContextKey, pageContextKey, init_context_key, checkSlackRoutingCoherence, init_slack_routing, init_catalog, catalog_default, COMPANY_TEAM_SIZES, COMPANY_USE_CASES, USER_FUNCTIONS, init_company_profile, mapTriggerSurface, init_telemetry_context, TELEMETRY_PROXY_ORIGIN, normalizeOrgWebsite, orgLogoUrl, isFilledOrgLogoUrl, init_org_website, beginRequestAuthScope, setRequestAuth, getRequestAuth, getCurrentRequestAuth, runWithoutRequestAuth, getCurrentRequestUserId, init_request_auth_context, setTelemetryIngestObserver, isTelemetryEnabled, _resolveIntegrationType, _resolveIntegrationProvider, initTelemetry, setTelemetryRoleResolver, setTelemetryFunctionResolver, isTelemetryReady, track, trackRelayed, telemetry, emitIntegrationConnected, init_telemetry, auditAssetKeys, init_asset_key_audit, CredentialBindingSchema, placeholderForConfigKey, CredentialBroker, DEFAULT_CREDENTIAL_BINDINGS, assertUrlSafe, parseEgressAllowlist, init_egress_guard, init_credential_broker, encryptSecret, decryptSecret, getEncryptionKey, init_crypto, isInTransaction, init_db_client, breaksJsonValidity, scrubJsonValue, init_scrub_json, sealJson, init_sealed_json, getPromptTemplateDefaultDrift, init_default_drift, init_templates, init_templates2, isSqliteVecAvailable2, resolveSqliteVecExtensionPath2, __resetSqliteVecExtensionPathCacheForTests2, initDb2, getDb2, closeDb2, getDbClient2, init_runtime, cachedUserRole, cachedUserFunction, configureOrgDomainPersistence, recomputeOrgDomain, scheduleOrgDomainRecompute, init_telemetry_identity, resolveTriggerSurface, emitTaskTelemetry, init_telemetry_trigger, CODEX_AUTH_WATCH_NAMESPACE, codexAuthBenchMarkerKey, isCodexAuthFailureReason, init_codex_auth_failure, isEnvExportRestrictedKey, init_config_env_export, MASKED_SECRET_VALUE, init_config_secrets, HeartbeatExpiryError, init_heartbeat_expiry, isRuntimePoolsEnabled, init_runtime_pools_flag, normalizeDate, normalizeDateRequired, init_date_utils, rowToAgent, updateAgentCredentialState2, updateAgentCredentialMissing2, 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, listApprovalRequestSummaries2, getPendingApprovalVoteState2, recordApprovalVotes2, getPendingApprovalsForTasks2, computeContentHash2, createContextVersion2, getLatestContextVersion2, getContextVersion2, getContextVersionHistory2, vcsRepoName, vcsRepoUrlMatches, init_vcs_repo_match, rowToAgentTask, getTaskById2, getChildTasks2, TASK_LINEAGE_LIMITS2, getTaskLineage2, hasNonTerminalResumeChild2, SUPERSEDED_RESUME_REPAIR_WINDOW_MS2, getSupersededTasksWithoutResume2, getSupersededTasksWithUnsettledDependents2, hasNonTerminalRerouteDecisionChild2, getTasksByAgentId2, 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, getLatestActiveTaskByContextKey2, getLatestLeadTaskByContextKey2, getMostRecentTaskInThread2, findCompletedTaskInThread2, findRecentCancelledTaskInThread2, init_read, MODEL_PROFILE_CONFIG_KEY, listModelProfiles, getModelProfileByName, createModelProfile, updateModelProfile, modelProfileReferences, modelProfileRefError, deleteModelProfile, getAgentDefaultProfileName, repoModelOverrideKeys, taskProfileError, init_model_profiles, AssetKeyMovesBlockedError2, assertAssetKeyMovesAllowed2, moveTaskChainKeyInTx2, moveSessionChains, listPrefixRoots, listSharedPrefixRoots, init_session_moves, getSessionReadState, getSessionTree, init_session_tree, setHumanFreeQueueListener, drainHumanFreeReclassifyQueue, init_human_free, onTaskStarted, init_task_lifecycle_events, channelTopic, addWorkerSubscription, removeWorkerSubscription, listSubscribedWorkerAgents, init_channels, publishWorkerNudge, init_worker_nudges, createTask2, getPendingTaskForAgent2, assignUnassignedTaskPending2, startTask2, updateTaskClaudeSessionId2, recordTaskProviderIfUnset2, updateTaskTitle2, completeTask2, failTask2, overwriteTerminalTaskResultText2, cancelTask2, supersedeTask2, settleSupersededTaskDependents2, backfillSupersedeTaskResumeTaskId2, pauseTask2, resumeTask2, getPausedTasksForAgent2, getOrphanedInProgressTasksForAgent2, resetOrphanedInProgressTasksForAgent2, getRecentlyCancelledTasksForAgent2, deleteTask2, updateTaskProgress2, getChildWorkflowRunId, getWorkflowRunParent, getWorkflowRunLineage, getSettledChildRunParentSteps, createForeachChildSteps, createForeachAttemptSteps, init_workflow_runs, 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, completedStatusIcon, init_reaction_shortcode, API_DRAINING_HEADER, API_DRAIN_MAX_MS_LIMIT, isApiDrainingResponse, init_api_drain, parseEnabledTools, init_enabled_tools, parseTaskToolManifest, CHAT_TASK_ONLY_TOOLS, isChatSdkTask, selectTaskTools, init_task_tool_manifest, tierConfigKey, init_model_tier_keys, isApiOnlyConfigKey, isInternalConfigKey, internalConfigKeyError, isReservedConfigKey, reservedKeyError, MAX_DB_RETENTION_DAYS, DB_RETENTION_TUNING_BOUNDS, APPS_JSON_COLUMN_MAX_BYTES_BOUNDS, CODEX_OAUTH_KEEP_WARM_MAX_AGE_HOURS_BOUNDS, validateRuntimeTokenTtlHours, validateControllerTokenTtlDays, validateControllerGraceSec, validateConfigValue, validateExportToEnv, init_swarm_config_guard, getDefaultAuthorizationIdForProvider, getOAuthApp, getOAuthAppById, getOAuthAppIdByProvider, createOAuthApp, updateOAuthAppById, upsertOAuthApp, listAuthorizationsForApp, getAuthorizationById, upsertAuthorization, updateAuthorizationTokens, updateAuthorizationIdentity, deleteAuthorizationById, deleteAuthorizationsForApp, createOAuthPending, consumeOAuthPending, gcOAuthPending, markAuthorizationRefreshFailed, getOAuthTokens, listAuthorizationSweepRows, listKeepAliveAuthorizations, deleteOAuthTokens, acquireOAuthRefreshLock, releaseOAuthRefreshLock, init_oauth, OpenAI2, init_openai, CANDIDATE_SET_MULTIPLIER, isGraphExpansionEnabled, EMBEDDING_DIMENSIONS, init_constants, LONGTERM_ROOT, MEMORY_KEY_PATTERN, MEMORY_KEY_PATTERN_MESSAGE, MEMORY_KEY_MAX_LENGTH, isLongtermKey, longtermKeyError, isConsolidatedKey, consolidatedKeyMessage, resolveStoreKey, init_key_paths, computeScore, rerank, init_reranker, searchMemoryCandidates, init_search_candidates, rowToCandidate, init_sqlite_store, getEmbeddingProvider2, resetEmbeddingProvider2, getMemoryStore2, init_memory, embeddingProvider, embedScript, searchScripts, reembedAllScripts, init_embeddings, upsertScriptByName, getScript, getScriptById, getScriptVersion, listScripts, listScriptVersions, deleteScript, touchScratchScriptLastUsed, restoreScratchScriptLastUsedIfUnchanged, createScriptApi, listScriptApisForScript, getScriptApiById, getScriptApiSecret, updateScriptApi, rotateScriptApiSecret, deleteScriptApi, recordScriptApiUsage, init_db2, oauthSecretName, registerStoredSecret, loadSecretRegistry, init_secret_registry, STEERING_MOVED_ERROR, SteeringRequestError, isSteeringEnabled, getTaskSteeringFields, getTaskSteeringFieldsForTasks, promotePendingSteeringForTask, markSteeringUndeliverable, carryUnhandledSteering, requestSteering, init_steering, WorkflowReplayStateError, init_workflow_replay, SESSION_ACTIVITY_REFRESH_MIN_INTERVAL_MS2, refreshActiveSessionOnActivity2, getActiveSessionById, init_active_sessions, recordKeySeatMismatch2, getScriptRunExecutionArgs2, 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_db3 };
|