@desplega.ai/agent-swarm 2.5.2 → 2.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{acp-adapter-csh0zz3b.js → acp-adapter-ek38cwsv.js} +5 -5
- package/dist/{actions-6xx079d1.js → actions-92mepq03.js} +19 -19
- package/dist/{amp-adapter-8n6f0hz8.js → amp-adapter-9gaxg015.js} +4 -4
- package/dist/{app-ft6r6v23.js → app-ctn8gsgx.js} +3 -3
- package/dist/{assistant-vt2cyfzd.js → assistant-zyr5kz47.js} +21 -21
- package/dist/{boot-reembed-tgrfy27t.js → boot-reembed-dwzfttdr.js} +1 -1
- package/dist/{boot-reembed-r3e808ky.js → boot-reembed-w75maga2.js} +1 -1
- package/dist/{boot-scrub-sweep-masdwxkm.js → boot-scrub-sweep-e9kq43kf.js} +3 -3
- package/dist/{boot-seeds-0n82qc7q.js → boot-seeds-x28v3fhb.js} +4 -4
- package/dist/{claude-adapter-s7j47k06.js → claude-adapter-f0afqnne.js} +5 -5
- package/dist/{claude-managed-adapter-gt6pa35d.js → claude-managed-adapter-x81a7r65.js} +3 -3
- package/dist/{claude-managed-setup-3hzrgrnk.js → claude-managed-setup-bqzwjd9x.js} +2 -2
- package/dist/{claude-sdk-session-0zrdzyx2.js → claude-sdk-session-7b7whkaq.js} +9307 -9254
- package/dist/{cli-a5ebc95n.js → cli-0shx9j93.js} +16 -13
- package/dist/{cli-4qkg9968.js → cli-19202kew.js} +4 -4
- package/dist/{cli-cyfgxnvb.js → cli-1r5ad7j5.js} +19 -17
- package/dist/{cli-jmcjbjkt.js → cli-25n3mv5d.js} +9 -7
- package/dist/cli-2655k16q.js +140 -0
- package/dist/{cli-wadzapwb.js → cli-277c31dw.js} +1 -1
- package/dist/{cli-n6kmqngw.js → cli-4b2z6n0m.js} +29 -7
- package/dist/{cli-7ccf7akh.js → cli-5bnsc0e1.js} +9 -7
- package/dist/{cli-qrjv7t18.js → cli-621ce7kw.js} +1 -1
- package/dist/{cli-xzge46sj.js → cli-64mh9mf3.js} +20 -6
- package/dist/{cli-b6tnjdvx.js → cli-6a1xg1p7.js} +6 -2
- package/dist/{cli-ydg6ep51.js → cli-6n8axjv1.js} +1 -1
- package/dist/{cli-e91vshb1.js → cli-7p4jxgtt.js} +5 -5
- package/dist/{cli-f3pfn4x3.js → cli-9j129brq.js} +9 -3
- package/dist/{cli-xw9q173h.js → cli-9s05422w.js} +1 -1
- package/dist/{cli-15xd0j7w.js → cli-abs8ndtr.js} +12 -12
- package/dist/{cli-h5d22pfs.js → cli-asq5ydm4.js} +219 -309
- package/dist/{cli-w9etnnxk.js → cli-bf8ma3f1.js} +120 -50
- package/dist/{cli-0vgy5wfw.js → cli-bvpgr9ny.js} +2 -2
- package/dist/{cli-3e9vs93g.js → cli-c61mbdds.js} +4 -4
- package/dist/{cli-e5bxnjps.js → cli-c952c7ac.js} +5 -5
- package/dist/{cli-p859hcc8.js → cli-dew6x255.js} +1 -1
- package/dist/{cli-tx00c0h6.js → cli-dqygeeh5.js} +17 -1
- package/dist/{cli-gpv60278.js → cli-e42vss7b.js} +2 -2
- package/dist/{cli-b63d08rs.js → cli-eftzyh9y.js} +1 -1
- package/dist/{cli-fgn7yg5r.js → cli-ethgy7ha.js} +1 -1
- package/dist/{cli-86zpfje5.js → cli-ff1tm9n9.js} +1 -1
- package/dist/{cli-cf63dnxj.js → cli-g9vd9ece.js} +37 -12
- package/dist/{cli-j3dwd4kz.js → cli-gbfxp48k.js} +770 -126
- package/dist/{cli-n2918sed.js → cli-gn5af0x5.js} +21 -21
- package/dist/{cli-d172svcw.js → cli-gwhjmh8g.js} +4 -4
- package/dist/{cli-stxdrqs2.js → cli-hh5we352.js} +24 -5
- package/dist/{cli-0ebey9hg.js → cli-j6rktc91.js} +1 -1
- package/dist/{cli-csh8fnbg.js → cli-jb30dzvk.js} +473 -58
- package/dist/{cli-vaxw3bg0.js → cli-jbnn4vxb.js} +3 -3
- package/dist/{cli-ha22h0eg.js → cli-k4tjsdx9.js} +45 -40
- package/dist/{cli-f55b6ky0.js → cli-m4ecdxvz.js} +40 -13
- package/dist/{cli-mntxtkhn.js → cli-mz9afxxf.js} +2 -1
- package/dist/{cli-ta8bd7th.js → cli-pzatvw94.js} +1 -1
- package/dist/{cli-3qv8naq8.js → cli-rr7zx19j.js} +1591 -353
- package/dist/{cli-b1tv22wr.js → cli-s682zgqz.js} +1 -1
- package/dist/{cli-bpbcpd8b.js → cli-sbwsxvtd.js} +1 -1
- package/dist/{cli-0xk505e8.js → cli-sxgtf5fw.js} +1 -1
- package/dist/{cli-6y43v79h.js → cli-tsma7p8v.js} +1 -1
- package/dist/{cli-edtm741g.js → cli-wghjkr0e.js} +5 -5
- package/dist/{cli-aaqnqpyw.js → cli-wx2nj19m.js} +30 -11
- package/dist/{cli-y3dzwyy3.js → cli-x0f2v69c.js} +180 -60
- package/dist/{cli-kcnwn85g.js → cli-xtrz6bzs.js} +7 -7
- package/dist/{cli-14v1sxxy.js → cli-xzfq4at3.js} +7 -7
- package/dist/cli.js +20 -20
- package/dist/{codex-adapter-brh2tcxr.js → codex-adapter-wch12q99.js} +3 -3
- package/dist/{codex-hook-e2he7aca.js → codex-hook-brpnycn5.js} +1 -1
- package/dist/{codex-session-runner-0dnj21qs.js → codex-session-runner-41pfcr95.js} +2 -2
- package/dist/{commands-1cnvseqx.js → commands-9849dkj6.js} +2 -2
- package/dist/{controller-kc7s9xhn.js → controller-ja0sd95p.js} +29 -3
- package/dist/{controllers-connect-jzx7t4bn.js → controllers-connect-xp05dj6x.js} +20 -20
- package/dist/{cursor-adapter-qpwp5sfg.js → cursor-adapter-623qxqew.js} +1 -2
- package/dist/{db-4vq88jkc.js → db-47vj40dy.js} +3 -3
- package/dist/{db-v5ytg5pw.js → db-w759qmx0.js} +2 -2
- package/dist/{dispatcher-trtcrqae.js → dispatcher-7b8e4z2j.js} +17 -17
- package/dist/{docker-nfy2gc8t.js → docker-s84hjs91.js} +2 -2
- package/dist/{dsh-adapter-f20xwn1z.js → dsh-adapter-2ezw3xea.js} +2 -3
- package/dist/{external-channel-n9bymc2n.js → external-channel-e2s028da.js} +2 -2
- package/dist/{grok-adapter-4kpmmnr6.js → grok-adapter-ys7gaqee.js} +6 -6
- package/dist/{handlers-ptsraqa8.js → handlers-wy1dr6ja.js} +20 -20
- package/dist/{heartbeat-60qtxtjf.js → heartbeat-w3mntghj.js} +20 -20
- package/dist/{hook-rbktcstg.js → hook-3jjywnpb.js} +9 -3
- package/dist/{hook-ngtvh729.js → hook-g7kvv6x9.js} +3 -2
- package/dist/{http-z8xy72gp.js → http-tkp7d4kb.js} +2984 -2483
- package/dist/{index-r70q0xjx.js → index-1ef1myq2.js} +17 -17
- package/dist/{index-a9nsavhx.js → index-3n8m9ea2.js} +1 -1
- package/dist/{index-cbxkmfc5.js → index-9pn1pfkf.js} +1 -1
- package/dist/{index-s193j5fh.js → index-nmm79qgr.js} +20 -20
- package/dist/{index-6srwvd5b.js → index-p4xfz37z.js} +1 -1
- package/dist/{index-06qkmcx6.js → index-q7m26kvs.js} +33 -23
- package/dist/{index-1cscynkb.js → index-xdaahthb.js} +17 -17
- package/dist/{keepalive-a9srcphj.js → keepalive-v4ta8wgg.js} +3 -3
- package/dist/{lead-3devneqy.js → lead-sawnyqxk.js} +35 -35
- package/dist/{maintenance-0er16h2y.js → maintenance-84n1ex21.js} +1 -1
- package/dist/{oauth-refresh-sweep-b65jcyw2.js → oauth-refresh-sweep-vjnnandw.js} +2 -2
- package/dist/{onboard-wqywz5py.js → onboard-sfmpe4np.js} +2 -2
- package/dist/{opencode-adapter-e56086m1.js → opencode-adapter-jmpst4q4.js} +4 -4
- package/dist/{otel-impl-vk32s884.js → otel-impl-v6cc0zve.js} +1 -1
- package/dist/{pi-mono-adapter-tzps8f38.js → pi-mono-adapter-fk8fkcf6.js} +33 -6
- package/dist/{pricing-refresh-t27anv4z.js → pricing-refresh-fsk1e1zc.js} +3 -3
- package/dist/{rbac-roles-452665y0.js → rbac-roles-prmkdnkw.js} +2 -2
- package/dist/{rbac-roles-bmcgsxjn.js → rbac-roles-zxmxqa39.js} +1 -1
- package/dist/{render-v2-0ttsk2j4.js → render-v2-pjwxvnkw.js} +3 -3
- package/dist/{resume-a26kvr41.js → resume-frdtgfa0.js} +9 -5
- package/dist/{session-access-dgh9nkwk.js → session-access-fpez4y5q.js} +4 -4
- package/dist/{setup-9vc9qahm.js → setup-mq6m3m8q.js} +1 -1
- package/dist/{work-objects-vn8nkxwn.js → work-objects-kfahhjsq.js} +20 -20
- package/dist/{worker-1x1h8vnm.js → worker-v5e5rxj3.js} +35 -35
- package/openapi.json +3078 -2424
- package/package.json +7 -7
- package/plugin/commands/create-pr.md +2 -2
- package/plugin/pi-skills/create-pr/SKILL.md +2 -2
- package/src/be/approval-config-question.ts +389 -0
- package/src/be/automation-preflight.ts +37 -3
- package/src/be/db/approvals.ts +48 -0
- package/src/be/db/session-tree.ts +73 -15
- package/src/be/db/skill-search.ts +87 -0
- package/src/be/db/tasks/read.ts +29 -2
- package/src/be/db/tasks/write.ts +15 -5
- package/src/be/db/workflow-idempotency.ts +183 -0
- package/src/be/db/workflow-runs.ts +366 -8
- package/src/be/db.ts +92 -22
- package/src/be/migrations/239_skills_fts.sql +40 -0
- package/src/be/migrations/240_workflow_run_parent_step_attempt.sql +37 -0
- package/src/be/migrations/241_skills_meta_fts.sql +39 -0
- package/src/be/migrations/242_workflow_idempotency_keys.sql +40 -0
- package/src/be/sealed-json.ts +1 -0
- package/src/be/seed-scripts/catalog/compound-insights.inline.ts +2 -2
- package/src/be/seed-scripts/catalog/compound-insights.ts +2 -2
- package/src/be/seed-skills/bundled-files.generated.json +1 -1
- package/src/be/sql-connections.ts +7 -1
- package/src/be/swarm-config-guard.ts +25 -0
- package/src/be/users.ts +9 -0
- package/src/commands/controller.ts +33 -0
- package/src/commands/runner.ts +6 -2
- package/src/extensions/apply-task-create.ts +57 -11
- package/src/extensions/catalog.generated.json +4 -4
- package/src/extensions/contract-types.generated.ts +1 -1
- package/src/extensions/contract.ts +25 -0
- package/src/extensions/dispatcher.ts +4 -0
- package/src/extensions/post-bridge.ts +8 -0
- package/src/hooks/context-bound-note.ts +196 -0
- package/src/hooks/hook.ts +12 -0
- package/src/http/approval-requests.ts +209 -38
- package/src/http/config.ts +70 -53
- package/src/http/idempotency-key.ts +117 -0
- package/src/http/sessions.ts +27 -2
- package/src/http/workflows.ts +129 -24
- package/src/integrations/chat-sdk/inbound.ts +5 -4
- package/src/prompts/context-bound-note.ts +48 -0
- package/src/prompts/session-templates.ts +25 -1
- package/src/providers/amp-adapter.ts +30 -8
- package/src/providers/claude-adapter.ts +29 -4
- package/src/providers/claude-managed-adapter.ts +26 -0
- package/src/providers/claude-sdk-session.ts +10 -0
- package/src/providers/claude-session-events.ts +13 -0
- package/src/providers/codex-adapter.ts +12 -0
- package/src/providers/dsh-adapter.ts +1 -1
- package/src/providers/opencode-adapter.ts +18 -0
- package/src/providers/pi-mono-adapter.ts +35 -0
- package/src/runtime-providers/docker.ts +6 -2
- package/src/scripts-runtime/types/swarm-extension.d.ts +35 -0
- package/src/tests/amp-adapter.test.ts +97 -0
- package/src/tests/approval-config-question.test.ts +702 -0
- package/src/tests/approval-requests.test.ts +10 -7
- package/src/tests/approval-sweeps.test.ts +12 -6
- package/src/tests/base-prompt.test.ts +1 -1
- package/src/tests/chat-sdk-inbound.test.ts +20 -0
- package/src/tests/claude-hook-output.test.ts +79 -1
- package/src/tests/claude-managed-adapter.test.ts +275 -0
- package/src/tests/codex-adapter.test.ts +163 -0
- package/src/tests/context-bound-note.test.ts +269 -0
- package/src/tests/dsh-adapter.test.ts +1 -1
- package/src/tests/entrypoint-gitlab-credential-helper.test.ts +273 -0
- package/src/tests/extensions-example-comms-adherence-gate.test.ts +321 -12
- package/src/tests/extensions-pre-task.test.ts +273 -0
- package/src/tests/fetch-resolved-env.test.ts +17 -0
- package/src/tests/fixtures/extensions/record-blocks/hooks.ts +10 -0
- package/src/tests/fixtures/extensions/record-blocks/manifest.json +7 -0
- package/src/tests/fixtures/fake-amp.ts +22 -8
- package/src/tests/fixtures/held-template-render.ts +42 -0
- package/src/tests/fixtures/workflow-idempotency-trigger.child.ts +73 -0
- package/src/tests/list-endpoint-slimming.test.ts +33 -0
- package/src/tests/migration-240-workflow-run-parent-step-attempt.test.ts +55 -0
- package/src/tests/openapi-route-headers.test.ts +2 -0
- package/src/tests/opencode-adapter.test.ts +134 -0
- package/src/tests/pi-mono-adapter.test.ts +105 -0
- package/src/tests/prompt-template-session.test.ts +4 -3
- package/src/tests/runner-push-delivery.test.ts +25 -0
- package/src/tests/runtime-controller-liveness.test.ts +133 -0
- package/src/tests/runtime-providers-docker.test.ts +2 -0
- package/src/tests/script-connections.test.ts +9 -0
- package/src/tests/script-run-config-scope.test.ts +91 -3
- package/src/tests/session-logs.test.ts +70 -0
- package/src/tests/sessions-tree.test.ts +205 -1
- package/src/tests/skill-search-long-content.test.ts +193 -0
- package/src/tests/skill-search.test.ts +173 -22
- package/src/tests/workflow-cascade-cancel.test.ts +1169 -0
- package/src/tests/workflow-foreach-supersede-retry.test.ts +488 -0
- package/src/tests/workflow-idempotency.test.ts +915 -0
- package/src/tests/workflow-sub-workflow.test.ts +538 -1
- package/src/tools/request-human-input.ts +27 -5
- package/src/tools/workflows/cancel-workflow-run.ts +1 -1
- package/src/types.ts +7 -0
- package/src/utils/context-window.ts +8 -6
- package/src/workflows/approval-cancel.ts +15 -13
- package/src/workflows/approval-notifications.ts +15 -4
- package/src/workflows/checkpoint.ts +72 -35
- package/src/workflows/engine.ts +262 -93
- package/src/workflows/executors/base.ts +6 -0
- package/src/workflows/executors/foreach.ts +2 -2
- package/src/workflows/executors/human-in-the-loop.ts +25 -1
- package/src/workflows/executors/sub-workflow.ts +45 -16
- package/src/workflows/foreach-driver.ts +10 -3
- package/src/workflows/foreach-join.ts +29 -6
- package/src/workflows/recovery.ts +68 -1
- package/src/workflows/resume.ts +228 -77
- package/src/workflows/retry-poller.ts +74 -7
- package/src/workflows/task-step-routing.ts +29 -7
- package/templates/ai-toolbox.manifest.json +8 -8
- package/templates/community/open-prompt-showreel/PLAYBOOK.md +5 -6
- package/templates/community/open-prompt-showreel/lead-prompt.md +1 -1
- package/templates/community/open-prompt-showreel/skills/open-prompt-showreel/SKILL.md +4 -4
- package/templates/extensions/comms-adherence-gate/README.md +38 -13
- package/templates/extensions/comms-adherence-gate/hooks.ts +272 -69
- package/templates/extensions/comms-adherence-gate/manifest.json +2 -2
- package/templates/skills/agent-browser/SKILL.md +4 -4
- package/templates/skills/agent-browser/content.md +4 -4
- package/templates/skills/code-quality/config.json +1 -1
- package/templates/skills/code-quality/content.md +2 -2
- package/templates/skills/delegate-work/content.md +29 -25
- package/templates/skills/delegate-work/files/scripts/codex-exec.sh +5 -5
- package/templates/skills/qa/content.md +2 -2
- package/templates/skills/researching/content.md +2 -0
- package/templates/skills/turso-interaction/content.md +1 -1
- package/templates/skills/work-on-task/SKILL.md +1 -1
- package/templates/skills/work-on-task/content.md +1 -1
- package/templates/skills/workflow-iterate/content.md +8 -1
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
VersionableFieldSchema,
|
|
27
27
|
SessionCostModelBreakdownSchema,
|
|
28
28
|
init_types
|
|
29
|
-
} from "./cli-
|
|
29
|
+
} from "./cli-mz9afxxf.js";
|
|
30
30
|
import {
|
|
31
31
|
generateDefaultClaudeMd2,
|
|
32
32
|
generateDefaultSoulMd2,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
init_identity_field_budget,
|
|
41
41
|
contentSha256,
|
|
42
42
|
init_profile_sync
|
|
43
|
-
} from "./cli-
|
|
43
|
+
} from "./cli-e42vss7b.js";
|
|
44
44
|
import {
|
|
45
45
|
isSlackConfigured,
|
|
46
46
|
init_config
|
|
@@ -55,15 +55,7 @@ import {
|
|
|
55
55
|
} from "./cli-zw88zjba.js";
|
|
56
56
|
import {
|
|
57
57
|
init_templates3
|
|
58
|
-
} from "./cli-
|
|
59
|
-
import {
|
|
60
|
-
registerTemplate,
|
|
61
|
-
getAllTemplateDefinitions,
|
|
62
|
-
init_registry,
|
|
63
|
-
configureDbResolver,
|
|
64
|
-
init_resolver,
|
|
65
|
-
init_session_templates
|
|
66
|
-
} from "./cli-tx00c0h6.js";
|
|
58
|
+
} from "./cli-j6rktc91.js";
|
|
67
59
|
import {
|
|
68
60
|
activeModelBlock,
|
|
69
61
|
init_model_rate_limit_windows
|
|
@@ -78,6 +70,14 @@ import {
|
|
|
78
70
|
getOpenRouterAttributionHeaders,
|
|
79
71
|
init_openrouter_base_url
|
|
80
72
|
} from "./cli-dfyv0jdy.js";
|
|
73
|
+
import {
|
|
74
|
+
registerTemplate,
|
|
75
|
+
getAllTemplateDefinitions,
|
|
76
|
+
init_registry,
|
|
77
|
+
configureDbResolver,
|
|
78
|
+
init_resolver,
|
|
79
|
+
init_session_templates
|
|
80
|
+
} from "./cli-dqygeeh5.js";
|
|
81
81
|
import {
|
|
82
82
|
runtimeHarnessSections,
|
|
83
83
|
init_runtime_model_catalog
|
|
@@ -109,7 +109,7 @@ import {
|
|
|
109
109
|
import {
|
|
110
110
|
init_package,
|
|
111
111
|
package_default
|
|
112
|
-
} from "./cli-
|
|
112
|
+
} from "./cli-xtrz6bzs.js";
|
|
113
113
|
import {
|
|
114
114
|
realtimeBus,
|
|
115
115
|
init_bus
|
|
@@ -4206,7 +4206,8 @@ var init_sealed_json = __esm(() => {
|
|
|
4206
4206
|
{ table: "script_run_journal", column: "result" },
|
|
4207
4207
|
{ table: "workflow_run_steps", column: "output_replay" },
|
|
4208
4208
|
{ table: "workflow_runs", column: "context_replay" },
|
|
4209
|
-
{ table: "approval_requests", column: "responses" }
|
|
4209
|
+
{ table: "approval_requests", column: "responses" },
|
|
4210
|
+
{ table: "workflow_idempotency_keys", column: "responseBody" }
|
|
4210
4211
|
];
|
|
4211
4212
|
});
|
|
4212
4213
|
|
|
@@ -4871,7 +4872,7 @@ var init_runtime = __esm(() => {
|
|
|
4871
4872
|
// src/telemetry-identity.ts
|
|
4872
4873
|
async function loadUserRole(userId) {
|
|
4873
4874
|
try {
|
|
4874
|
-
const { getUserGrant } = await import("./rbac-roles-
|
|
4875
|
+
const { getUserGrant } = await import("./rbac-roles-prmkdnkw.js");
|
|
4875
4876
|
const grant = await getUserGrant(userId);
|
|
4876
4877
|
const role = grant.grantsAll ? "admin" : "member";
|
|
4877
4878
|
const user = await getDbClient2().get("SELECT json_extract(metadata, '$.jobFunction') AS jobFunction FROM users WHERE id = ? AND json_valid(metadata)", [userId]);
|
|
@@ -5625,6 +5626,27 @@ async function getPendingApprovalsForTasks2(taskIds) {
|
|
|
5625
5626
|
WHERE sourceTaskId IN (${taskIds.map(() => "?").join(",")}) AND status = 'pending'
|
|
5626
5627
|
ORDER BY createdAt, id`, taskIds);
|
|
5627
5628
|
}
|
|
5629
|
+
function approvalCancellationNotificationKey(target, messageTs) {
|
|
5630
|
+
return `${target}:${messageTs}`;
|
|
5631
|
+
}
|
|
5632
|
+
async function listUndeliveredCancelledApprovalRequestIds(runIds) {
|
|
5633
|
+
const ids = [];
|
|
5634
|
+
for (let i = 0;i < runIds.length; i += 500) {
|
|
5635
|
+
const chunk = runIds.slice(i, i + 500);
|
|
5636
|
+
const rows = await getDbClient2().query(`SELECT id, notificationChannels, cancellationNotificationClaims AS claims
|
|
5637
|
+
FROM approval_requests
|
|
5638
|
+
WHERE workflowRunId IN (${chunk.map(() => "?").join(", ")})
|
|
5639
|
+
AND status = 'cancelled' AND notificationChannels IS NOT NULL`, chunk);
|
|
5640
|
+
for (const row of rows) {
|
|
5641
|
+
const claims = row.claims ? JSON.parse(row.claims) : {};
|
|
5642
|
+
const channels = JSON.parse(row.notificationChannels);
|
|
5643
|
+
const undelivered = channels.some((n) => n.channel === "slack" && n.target && n.messageTs && claims[approvalCancellationNotificationKey(n.target, n.messageTs)] !== "delivered");
|
|
5644
|
+
if (undelivered)
|
|
5645
|
+
ids.push(row.id);
|
|
5646
|
+
}
|
|
5647
|
+
}
|
|
5648
|
+
return ids;
|
|
5649
|
+
}
|
|
5628
5650
|
var init_approvals = __esm(() => {
|
|
5629
5651
|
init_secret_scrubber();
|
|
5630
5652
|
init_date_utils();
|
|
@@ -5726,8 +5748,19 @@ var init_provider_metadata = () => {};
|
|
|
5726
5748
|
function configureTaskReadDependencies(value) {
|
|
5727
5749
|
dependencies2 = value;
|
|
5728
5750
|
}
|
|
5751
|
+
function skipSiblingBlock(text) {
|
|
5752
|
+
if (!text.startsWith(SIBLING_OPEN))
|
|
5753
|
+
return text;
|
|
5754
|
+
const close = text.indexOf(SIBLING_CLOSE);
|
|
5755
|
+
if (close === -1)
|
|
5756
|
+
return text;
|
|
5757
|
+
const end = close + SIBLING_CLOSE.length;
|
|
5758
|
+
return text.slice(text.startsWith(`
|
|
5759
|
+
|
|
5760
|
+
`, end) ? end + 2 : end);
|
|
5761
|
+
}
|
|
5729
5762
|
function taskPreview(task) {
|
|
5730
|
-
const text = task instanceof Uint8Array ? taskPreviewDecoder.decode(task) : task;
|
|
5763
|
+
const text = task instanceof Uint8Array ? taskPreviewDecoder.decode(task) : skipSiblingBlock(task ?? "");
|
|
5731
5764
|
return dependencies2.previewText(text, TASK_PREVIEW_LENGTH);
|
|
5732
5765
|
}
|
|
5733
5766
|
function rowToAgentTask(row) {
|
|
@@ -6669,7 +6702,7 @@ async function findRecentCancelledTaskInThread2(channelId, threadTs, windowMinut
|
|
|
6669
6702
|
LIMIT 1`, [channelId, threadTs, since]);
|
|
6670
6703
|
return row ? rowToAgentTask(row) : null;
|
|
6671
6704
|
}
|
|
6672
|
-
var dependencies2, TASK_PREVIEW_LENGTH = 300, TASK_PREVIEW_BYTES, TASK_PREVIEW_SQL, taskPreviewDecoder, LIST_COLUMNS, TASK_LINEAGE_LIMITS2, LINEAGE_COLUMNS, SUPERSEDED_RESUME_REPAIR_WINDOW_MS2, NEVER_STARTED_TASK_STATUSES, findTaskByGitHub2, CHAT_RELAY_ELIGIBLE_SQL = `(obligation.last_attempt_at IS NULL
|
|
6705
|
+
var dependencies2, TASK_PREVIEW_LENGTH = 300, TASK_PREVIEW_BYTES, SIBLING_OPEN = "<sibling_tasks_in_progress>", SIBLING_CLOSE = "</sibling_tasks_in_progress>", TASK_BLOB = "CAST(agent_tasks.task AS BLOB)", SIBLING_CLOSE_AT, SIBLING_END, TASK_PREVIEW_START, TASK_PREVIEW_SQL, taskPreviewDecoder, LIST_COLUMNS, TASK_LINEAGE_LIMITS2, LINEAGE_COLUMNS, SUPERSEDED_RESUME_REPAIR_WINDOW_MS2, NEVER_STARTED_TASK_STATUSES, findTaskByGitHub2, CHAT_RELAY_ELIGIBLE_SQL = `(obligation.last_attempt_at IS NULL
|
|
6673
6706
|
OR (julianday(?) - julianday(obligation.last_attempt_at)) * 86400000.0 >=
|
|
6674
6707
|
CASE WHEN obligation.attempt_count >= 8 THEN 600000
|
|
6675
6708
|
ELSE 3000 * (1 << obligation.attempt_count) END)`, LINEAR_TRACKER_CONTEXT_KEY_PREFIX = "task:trackers:linear:";
|
|
@@ -6681,7 +6714,14 @@ var init_read = __esm(() => {
|
|
|
6681
6714
|
init_agents();
|
|
6682
6715
|
init_runtime();
|
|
6683
6716
|
TASK_PREVIEW_BYTES = 4 * (TASK_PREVIEW_LENGTH + 1);
|
|
6684
|
-
|
|
6717
|
+
SIBLING_CLOSE_AT = `instr(${TASK_BLOB}, CAST('${SIBLING_CLOSE}' AS BLOB))`;
|
|
6718
|
+
SIBLING_END = `(${SIBLING_CLOSE_AT} + ${SIBLING_CLOSE.length})`;
|
|
6719
|
+
TASK_PREVIEW_START = `CASE
|
|
6720
|
+
WHEN substr(${TASK_BLOB}, 1, ${SIBLING_OPEN.length}) = CAST('${SIBLING_OPEN}' AS BLOB)
|
|
6721
|
+
AND ${SIBLING_CLOSE_AT} > 0
|
|
6722
|
+
THEN ${SIBLING_END} + (substr(${TASK_BLOB}, ${SIBLING_END}, 2) = x'0a0a') * 2
|
|
6723
|
+
ELSE 1 END`;
|
|
6724
|
+
TASK_PREVIEW_SQL = `substr(${TASK_BLOB}, ${TASK_PREVIEW_START}, ${TASK_PREVIEW_BYTES}) AS task`;
|
|
6685
6725
|
taskPreviewDecoder = new TextDecoder("utf-8", { ignoreBOM: true });
|
|
6686
6726
|
LIST_COLUMNS = {
|
|
6687
6727
|
full: "agent_tasks.*",
|
|
@@ -7019,7 +7059,7 @@ function sessionReadStateSql(now = new Date().toISOString()) {
|
|
|
7019
7059
|
sql: `CASE
|
|
7020
7060
|
WHEN s.id IS NULL THEN CASE WHEN a.lastActivityAt > ? THEN 'unread' ELSE 'read' END
|
|
7021
7061
|
WHEN s.status = 'dismissed' THEN 'done'
|
|
7022
|
-
WHEN s.status = 'done' THEN CASE WHEN a.
|
|
7062
|
+
WHEN s.status = 'done' THEN CASE WHEN a.reopensDone > 0 THEN 'unread' ELSE 'done' END
|
|
7023
7063
|
WHEN s.status = 'snoozed' THEN CASE WHEN s.snoozeUntil > ? THEN 'later' ELSE 'unread' END
|
|
7024
7064
|
WHEN a.lastActivityAt > COALESCE(s.lastReadAt, s.lastUpdatedAt) THEN 'unread'
|
|
7025
7065
|
ELSE 'read'
|
|
@@ -7060,6 +7100,10 @@ function sessionRootFilter(opts = {}) {
|
|
|
7060
7100
|
const hidden = opts.hideSource?.filter(Boolean) ?? [];
|
|
7061
7101
|
if (hidden.length)
|
|
7062
7102
|
add({ sql: `r.source NOT IN (${hidden.map(() => "?").join(",")})`, params: hidden });
|
|
7103
|
+
if (opts.showSource) {
|
|
7104
|
+
const shown = opts.showSource.filter(Boolean);
|
|
7105
|
+
add(shown.length ? { sql: `r.source IN (${shown.map(() => "?").join(",")})`, params: shown } : { sql: "0", params: [] });
|
|
7106
|
+
}
|
|
7063
7107
|
if (opts.q?.trim()) {
|
|
7064
7108
|
const like = `%${opts.q.trim().toLowerCase()}%`;
|
|
7065
7109
|
add({
|
|
@@ -7117,7 +7161,7 @@ function sessionSummaryQuery(opts = {}) {
|
|
|
7117
7161
|
const params = [...root.params];
|
|
7118
7162
|
if (opts.withUserId)
|
|
7119
7163
|
params.push(opts.withUserId);
|
|
7120
|
-
params.push(...read.params, opts.viewer?.userId ?? null);
|
|
7164
|
+
params.push(opts.viewer?.userId ?? null, ...read.params, opts.viewer?.userId ?? null);
|
|
7121
7165
|
const filters = [];
|
|
7122
7166
|
if (opts.triage === "unread")
|
|
7123
7167
|
filters.push("readState = 'unread'");
|
|
@@ -7139,19 +7183,25 @@ function sessionSummaryQuery(opts = {}) {
|
|
|
7139
7183
|
params.push(opts.withUserId);
|
|
7140
7184
|
}
|
|
7141
7185
|
return {
|
|
7142
|
-
sql: `WITH RECURSIVE chain(root_id, id, lastUpdatedAt, status, requestedByUserId
|
|
7143
|
-
|
|
7186
|
+
sql: `WITH RECURSIVE chain(root_id, id, lastUpdatedAt, status, requestedByUserId,
|
|
7187
|
+
createdAt, source, requestedByUserIdInherited) AS (
|
|
7188
|
+
SELECT r.id, r.id, r.lastUpdatedAt, r.status, r.requestedByUserId,
|
|
7189
|
+
r.createdAt, r.source, r.requestedByUserIdInherited
|
|
7144
7190
|
FROM agent_tasks r WHERE ${root.sql}
|
|
7145
7191
|
UNION ALL
|
|
7146
|
-
SELECT c.root_id, t.id, t.lastUpdatedAt, t.status, t.requestedByUserId
|
|
7192
|
+
SELECT c.root_id, t.id, t.lastUpdatedAt, t.status, t.requestedByUserId,
|
|
7193
|
+
t.createdAt, t.source, t.requestedByUserIdInherited
|
|
7147
7194
|
FROM chain c JOIN agent_tasks t ON t.parentTaskId = c.id
|
|
7148
7195
|
), agg AS (
|
|
7149
|
-
SELECT root_id, COUNT(*) AS chainCount,
|
|
7150
|
-
status AS latestStatus, MAX(lastUpdatedAt) AS lastActivityAt,
|
|
7151
|
-
${opts.withUserId ? "SUM(requestedByUserId = ?) AS withUser," : ""}
|
|
7196
|
+
SELECT chain.root_id, COUNT(*) AS chainCount,
|
|
7197
|
+
chain.status AS latestStatus, MAX(chain.lastUpdatedAt) AS lastActivityAt,
|
|
7198
|
+
${opts.withUserId ? "SUM(chain.requestedByUserId = ?) AS withUser," : ""}
|
|
7152
7199
|
SUM(EXISTS (SELECT 1 FROM approval_requests ar
|
|
7153
|
-
WHERE ar.sourceTaskId = chain.id AND ar.status = 'pending')) AS pendingApproval
|
|
7154
|
-
|
|
7200
|
+
WHERE ar.sourceTaskId = chain.id AND ar.status = 'pending')) AS pendingApproval,
|
|
7201
|
+
SUM(${reopensDoneSql}) AS reopensDone
|
|
7202
|
+
FROM chain LEFT JOIN inbox_item_state d
|
|
7203
|
+
ON d.userId = ? AND d.itemType = 'to_read' AND d.itemId = chain.root_id AND d.status = 'done'
|
|
7204
|
+
GROUP BY chain.root_id
|
|
7155
7205
|
), state AS (
|
|
7156
7206
|
SELECT a.*, ${read.sql} AS readState, s.snoozeUntil
|
|
7157
7207
|
FROM agg a LEFT JOIN inbox_item_state s
|
|
@@ -7247,6 +7297,7 @@ async function getSessionTree(actor, now, opts = {}) {
|
|
|
7247
7297
|
sources: []
|
|
7248
7298
|
};
|
|
7249
7299
|
const hidden = new Set(opts.hideSource);
|
|
7300
|
+
const shown = opts.showSource ? new Set(opts.showSource) : null;
|
|
7250
7301
|
const sources = new Map;
|
|
7251
7302
|
const groups = new Map;
|
|
7252
7303
|
const add = (section, row) => {
|
|
@@ -7260,7 +7311,7 @@ async function getSessionTree(actor, now, opts = {}) {
|
|
|
7260
7311
|
};
|
|
7261
7312
|
for (const row of rows) {
|
|
7262
7313
|
sources.set(row.source, (sources.get(row.source) ?? 0) + 1);
|
|
7263
|
-
if (hidden.has(row.source))
|
|
7314
|
+
if (hidden.has(row.source) || shown && !shown.has(row.source))
|
|
7264
7315
|
continue;
|
|
7265
7316
|
const key = sessionGroupKey(row.key);
|
|
7266
7317
|
const noGroup = key === "shared/" || actor.kind === "user" && key === `personal/${actor.userId}/`;
|
|
@@ -7321,13 +7372,65 @@ async function triageSessionList(userId, filters, action) {
|
|
|
7321
7372
|
]);
|
|
7322
7373
|
return result.changes;
|
|
7323
7374
|
}
|
|
7324
|
-
var runningSql, UNREAD_CURSOR = "1970-01-01T00:00:00.000Z";
|
|
7375
|
+
var runningSql, AGENT_TASK_SOURCES, reopensDoneSql, UNREAD_CURSOR = "1970-01-01T00:00:00.000Z";
|
|
7325
7376
|
var init_session_tree = __esm(() => {
|
|
7326
7377
|
init_key();
|
|
7327
7378
|
init_types();
|
|
7328
7379
|
init_db3();
|
|
7329
7380
|
init_session_visibility();
|
|
7330
7381
|
runningSql = `latestStatus NOT IN (${TERMINAL_TASK_STATUSES.map((s) => `'${s}'`).join(",")})`;
|
|
7382
|
+
AGENT_TASK_SOURCES = ["mcp", "system", "schedule", "workflow"];
|
|
7383
|
+
reopensDoneSql = `(d.id IS NOT NULL AND (
|
|
7384
|
+
(chain.createdAt > d.lastUpdatedAt
|
|
7385
|
+
AND chain.requestedByUserId IS NOT NULL
|
|
7386
|
+
AND chain.requestedByUserIdInherited = 0
|
|
7387
|
+
AND COALESCE(chain.source, '') NOT IN (${AGENT_TASK_SOURCES.map((s) => `'${s}'`).join(",")}))
|
|
7388
|
+
OR EXISTS (SELECT 1 FROM task_steering_messages sm
|
|
7389
|
+
WHERE sm.task_id = chain.id AND sm.created_by_kind = 'user'
|
|
7390
|
+
AND sm.status != 'cancelled' AND sm.created_at > d.lastUpdatedAt)
|
|
7391
|
+
OR EXISTS (SELECT 1 FROM approval_requests ar
|
|
7392
|
+
WHERE ar.sourceTaskId = chain.id AND ar.status = 'pending' AND ar.createdAt > d.lastUpdatedAt)
|
|
7393
|
+
))`;
|
|
7394
|
+
});
|
|
7395
|
+
|
|
7396
|
+
// src/be/db/skill-search.ts
|
|
7397
|
+
function buildSkillsFtsMatch(query) {
|
|
7398
|
+
const terms = query.split(/[^\p{L}\p{N}_-]+/u).filter((term) => /[\p{L}\p{N}]/u.test(term) && !STOPWORDS.has(term.toLowerCase())).slice(0, 12);
|
|
7399
|
+
if (terms.length === 0)
|
|
7400
|
+
return null;
|
|
7401
|
+
return terms.map((term) => `"${term.replaceAll('"', '""')}"`).join(" OR ");
|
|
7402
|
+
}
|
|
7403
|
+
async function searchSkillRowsRanked(query, limit, columns) {
|
|
7404
|
+
const match = buildSkillsFtsMatch(query);
|
|
7405
|
+
if (!match)
|
|
7406
|
+
return [];
|
|
7407
|
+
const exactName = query.trim();
|
|
7408
|
+
try {
|
|
7409
|
+
return await getDbClient2().query(`WITH hits AS (
|
|
7410
|
+
SELECT skill_id, ${SKILLS_FTS_BM25} AS score FROM skills_fts WHERE skills_fts MATCH ?
|
|
7411
|
+
),
|
|
7412
|
+
meta AS (
|
|
7413
|
+
SELECT skill_id, ${SKILLS_META_FTS_BM25} AS score
|
|
7414
|
+
FROM skills_meta_fts WHERE skills_meta_fts MATCH ?
|
|
7415
|
+
)
|
|
7416
|
+
SELECT ${columns} FROM skills
|
|
7417
|
+
LEFT JOIN hits ON hits.skill_id = skills.id
|
|
7418
|
+
LEFT JOIN meta ON meta.skill_id = skills.id
|
|
7419
|
+
WHERE skills.isEnabled = 1
|
|
7420
|
+
AND (hits.skill_id IS NOT NULL OR lower(skills.name) = lower(?))
|
|
7421
|
+
ORDER BY lower(skills.name) = lower(?) DESC,
|
|
7422
|
+
COALESCE(hits.score, 0) + ${META_SCORE_MULTIPLE} * COALESCE(meta.score, 0) ASC,
|
|
7423
|
+
skills.name ASC
|
|
7424
|
+
LIMIT ?`, [match, match, exactName, exactName, limit]);
|
|
7425
|
+
} catch (err) {
|
|
7426
|
+
console.warn("[skills-fts] ranked query failed, using substring match:", err.message);
|
|
7427
|
+
return [];
|
|
7428
|
+
}
|
|
7429
|
+
}
|
|
7430
|
+
var SKILLS_FTS_BM25 = "bm25(skills_fts, 0.0, 3.0, 2.0, 1.0)", SKILLS_META_FTS_BM25 = "bm25(skills_meta_fts, 0.0, 3.0, 2.0)", META_SCORE_MULTIPLE = 3, STOPWORDS;
|
|
7431
|
+
var init_skill_search = __esm(() => {
|
|
7432
|
+
init_runtime();
|
|
7433
|
+
STOPWORDS = new Set(("a an and are as at be but by can do does for from get got have how i if in into is it its " + "me my need of on or our should so that the their them then there these this to use using " + "want was we what when where which who why will with would you your").split(" "));
|
|
7331
7434
|
});
|
|
7332
7435
|
|
|
7333
7436
|
// src/be/db/tasks/human-free.ts
|
|
@@ -7945,7 +8048,7 @@ async function overwriteTerminalTaskResultText2(id, patch) {
|
|
|
7945
8048
|
});
|
|
7946
8049
|
return row ? rowToAgentTask(row) : task;
|
|
7947
8050
|
}
|
|
7948
|
-
async function cancelTask2(id, reason) {
|
|
8051
|
+
async function cancelTask2(id, reason, options = {}) {
|
|
7949
8052
|
const oldTask = await getTaskById2(id);
|
|
7950
8053
|
if (!oldTask)
|
|
7951
8054
|
return null;
|
|
@@ -7996,10 +8099,12 @@ async function cancelTask2(id, reason) {
|
|
|
7996
8099
|
} catch (error) {
|
|
7997
8100
|
console.error("[cancelTask] pending steering promotion error:", scrubSecrets(error instanceof Error ? error.message : String(error)));
|
|
7998
8101
|
}
|
|
7999
|
-
|
|
8000
|
-
|
|
8001
|
-
|
|
8002
|
-
|
|
8102
|
+
if (options.cascadeDependents !== false) {
|
|
8103
|
+
try {
|
|
8104
|
+
await dependencies3.cascadeFailDependents(id, "cancelled");
|
|
8105
|
+
} catch (err) {
|
|
8106
|
+
console.error("[cancelTask] cascade-fail dependents error:", err);
|
|
8107
|
+
}
|
|
8003
8108
|
}
|
|
8004
8109
|
}
|
|
8005
8110
|
return row ? rowToAgentTask(row) : null;
|
|
@@ -8280,11 +8385,269 @@ var init_write = __esm(() => {
|
|
|
8280
8385
|
lastAffinityDispatchSkipLoggedAt = new Map;
|
|
8281
8386
|
});
|
|
8282
8387
|
|
|
8388
|
+
// src/be/db/workflow-idempotency.ts
|
|
8389
|
+
function sha256(text) {
|
|
8390
|
+
const hasher = new Bun.CryptoHasher("sha256");
|
|
8391
|
+
hasher.update(text);
|
|
8392
|
+
return hasher.digest("hex");
|
|
8393
|
+
}
|
|
8394
|
+
function sortKeys(value) {
|
|
8395
|
+
if (Array.isArray(value))
|
|
8396
|
+
return value.map(sortKeys);
|
|
8397
|
+
if (!value || typeof value !== "object")
|
|
8398
|
+
return value;
|
|
8399
|
+
return Object.fromEntries(Object.entries(value).filter(([, nested]) => nested !== undefined).sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0).map(([key, nested]) => [key, sortKeys(nested)]));
|
|
8400
|
+
}
|
|
8401
|
+
function workflowRequestFingerprint(operation, body) {
|
|
8402
|
+
return sha256(`${operation}
|
|
8403
|
+
${JSON.stringify(sortKeys(body ?? null))}`);
|
|
8404
|
+
}
|
|
8405
|
+
function scopeParams(scope) {
|
|
8406
|
+
return [scope.principal, scope.operation, scope.targetId, sha256(scope.key)];
|
|
8407
|
+
}
|
|
8408
|
+
async function findAcceptedWorkflowOperation(scope) {
|
|
8409
|
+
const row = await getDbClient2().get(`SELECT requestFingerprint, responseStatus, responseBody, resourceDeletedAt
|
|
8410
|
+
FROM workflow_idempotency_keys WHERE ${SCOPE_WHERE}`, scopeParams(scope));
|
|
8411
|
+
if (!row)
|
|
8412
|
+
return null;
|
|
8413
|
+
return {
|
|
8414
|
+
fingerprint: row.requestFingerprint,
|
|
8415
|
+
status: row.responseStatus,
|
|
8416
|
+
body: row.responseBody === null ? null : openSealedJson(row.responseBody),
|
|
8417
|
+
resourceDeletedAt: row.resourceDeletedAt
|
|
8418
|
+
};
|
|
8419
|
+
}
|
|
8420
|
+
async function assertWorkflowIdempotencyKeyUnused(scope) {
|
|
8421
|
+
const taken = await getDbClient2().get(`SELECT 1 FROM workflow_idempotency_keys WHERE ${SCOPE_WHERE}`, scopeParams(scope));
|
|
8422
|
+
if (taken)
|
|
8423
|
+
throw new IdempotencyKeyTakenError;
|
|
8424
|
+
}
|
|
8425
|
+
async function recordAcceptedWorkflowOperation(claim, accepted) {
|
|
8426
|
+
await assertWorkflowIdempotencyKeyUnused(claim);
|
|
8427
|
+
const actor = getCurrentRequestUserId() ?? null;
|
|
8428
|
+
try {
|
|
8429
|
+
await getDbClient2().run(`INSERT INTO workflow_idempotency_keys
|
|
8430
|
+
(id, principal, operation, targetId, keyHash, requestFingerprint, workflowId, runId,
|
|
8431
|
+
responseStatus, responseBody, createdAt, created_by, updated_by)
|
|
8432
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
8433
|
+
crypto.randomUUID(),
|
|
8434
|
+
...scopeParams(claim),
|
|
8435
|
+
claim.fingerprint,
|
|
8436
|
+
accepted.workflowId,
|
|
8437
|
+
accepted.runId ?? null,
|
|
8438
|
+
accepted.status,
|
|
8439
|
+
sealJson(accepted.body),
|
|
8440
|
+
new Date().toISOString(),
|
|
8441
|
+
actor,
|
|
8442
|
+
actor
|
|
8443
|
+
]);
|
|
8444
|
+
} catch (err) {
|
|
8445
|
+
if (err instanceof Error && err.message.includes("UNIQUE constraint failed")) {
|
|
8446
|
+
throw new IdempotencyKeyTakenError;
|
|
8447
|
+
}
|
|
8448
|
+
throw err;
|
|
8449
|
+
}
|
|
8450
|
+
}
|
|
8451
|
+
async function tombstoneWorkflowIdempotencyKeys(workflowId) {
|
|
8452
|
+
await getDbClient2().run(`UPDATE workflow_idempotency_keys
|
|
8453
|
+
SET responseBody = NULL, resourceDeletedAt = ?, updated_by = ?
|
|
8454
|
+
WHERE workflowId = ? AND resourceDeletedAt IS NULL`, [new Date().toISOString(), getCurrentRequestUserId() ?? null, workflowId]);
|
|
8455
|
+
}
|
|
8456
|
+
var IdempotencyKeyTakenError, SCOPE_WHERE = "principal = ? AND operation = ? AND targetId = ? AND keyHash = ?";
|
|
8457
|
+
var init_workflow_idempotency = __esm(() => {
|
|
8458
|
+
init_request_auth_context();
|
|
8459
|
+
init_sealed_json();
|
|
8460
|
+
init_runtime();
|
|
8461
|
+
IdempotencyKeyTakenError = class IdempotencyKeyTakenError extends Error {
|
|
8462
|
+
constructor() {
|
|
8463
|
+
super("Idempotency-Key was accepted by a concurrent request");
|
|
8464
|
+
this.name = "IdempotencyKeyTakenError";
|
|
8465
|
+
}
|
|
8466
|
+
};
|
|
8467
|
+
});
|
|
8468
|
+
|
|
8283
8469
|
// src/be/db/workflow-runs.ts
|
|
8284
|
-
async function
|
|
8285
|
-
const
|
|
8470
|
+
async function getRunLineageBlock(runId) {
|
|
8471
|
+
const rows = await getDbClient2().query(`WITH RECURSIVE lineage(id, status, parentStepId, depth) AS (
|
|
8472
|
+
SELECT id, status, parentStepId, 0 FROM workflow_runs WHERE id = ?
|
|
8473
|
+
UNION ALL
|
|
8474
|
+
SELECT r.id, r.status, r.parentStepId, l.depth + 1
|
|
8475
|
+
FROM lineage l
|
|
8476
|
+
JOIN workflow_run_steps s ON s.id = l.parentStepId
|
|
8477
|
+
JOIN workflow_runs r ON r.id = s.runId
|
|
8478
|
+
WHERE l.depth < ?
|
|
8479
|
+
)
|
|
8480
|
+
SELECT id, status, parentStepId, depth FROM lineage ORDER BY depth`, [runId, WORKFLOW_RUN_TREE_MAX_DEPTH]);
|
|
8481
|
+
if (rows.length === 0)
|
|
8482
|
+
return `Workflow run ${runId} is missing`;
|
|
8483
|
+
const seen = new Set;
|
|
8484
|
+
for (const row of rows) {
|
|
8485
|
+
if (seen.has(row.id))
|
|
8486
|
+
return `Workflow run ${runId} has a cycle in its parent links`;
|
|
8487
|
+
seen.add(row.id);
|
|
8488
|
+
if (row.status === "cancelled") {
|
|
8489
|
+
return row.id === runId ? `Workflow run ${runId} is cancelled` : `Ancestor workflow run ${row.id} is cancelled`;
|
|
8490
|
+
}
|
|
8491
|
+
}
|
|
8492
|
+
const top = rows[rows.length - 1];
|
|
8493
|
+
if (top.parentStepId == null)
|
|
8494
|
+
return null;
|
|
8495
|
+
if (top.depth >= WORKFLOW_RUN_TREE_MAX_DEPTH) {
|
|
8496
|
+
return `Workflow run ${runId} is nested deeper than ${WORKFLOW_RUN_TREE_MAX_DEPTH} levels`;
|
|
8497
|
+
}
|
|
8498
|
+
return `Parent step ${top.parentStepId} of workflow run ${top.id} is missing`;
|
|
8499
|
+
}
|
|
8500
|
+
async function getWorkflowRunTreeIds(rootId, bounds = {}) {
|
|
8501
|
+
const maxDepth = bounds.maxDepth ?? WORKFLOW_RUN_TREE_MAX_DEPTH;
|
|
8502
|
+
const ids = [rootId];
|
|
8503
|
+
const seen = new Set(ids);
|
|
8504
|
+
let level = [rootId];
|
|
8505
|
+
for (let depth = 1;level.length > 0; depth++) {
|
|
8506
|
+
const next = [];
|
|
8507
|
+
for (let i = 0;i < level.length; i += TREE_QUERY_CHUNK) {
|
|
8508
|
+
const chunk = level.slice(i, i + TREE_QUERY_CHUNK);
|
|
8509
|
+
const rows = await getDbClient2().query(`SELECT c.id
|
|
8510
|
+
FROM workflow_run_steps s
|
|
8511
|
+
JOIN workflow_runs c ON c.parentStepId = s.id
|
|
8512
|
+
WHERE s.runId IN (${chunk.map(() => "?").join(", ")})`, chunk);
|
|
8513
|
+
for (const { id } of rows) {
|
|
8514
|
+
if (seen.has(id)) {
|
|
8515
|
+
throw new WorkflowRunTreeError(`Workflow run tree of ${rootId} has a cycle at run ${id}`);
|
|
8516
|
+
}
|
|
8517
|
+
seen.add(id);
|
|
8518
|
+
next.push(id);
|
|
8519
|
+
}
|
|
8520
|
+
}
|
|
8521
|
+
if (next.length > 0 && depth > maxDepth) {
|
|
8522
|
+
throw new WorkflowRunTreeError(`Workflow run tree of ${rootId} is nested deeper than ${maxDepth} levels`);
|
|
8523
|
+
}
|
|
8524
|
+
ids.push(...next);
|
|
8525
|
+
level = next;
|
|
8526
|
+
}
|
|
8527
|
+
return ids;
|
|
8528
|
+
}
|
|
8529
|
+
async function getWorkflowRunStatus(runId) {
|
|
8530
|
+
const row = await getDbClient2().get("SELECT status FROM workflow_runs WHERE id = ?", [runId]);
|
|
8531
|
+
return row?.status ?? null;
|
|
8532
|
+
}
|
|
8533
|
+
async function forEachChunk(ids, fn) {
|
|
8534
|
+
for (let i = 0;i < ids.length; i += TREE_QUERY_CHUNK) {
|
|
8535
|
+
const chunk = ids.slice(i, i + TREE_QUERY_CHUNK);
|
|
8536
|
+
await fn(chunk, chunk.map(() => "?").join(", "));
|
|
8537
|
+
}
|
|
8538
|
+
}
|
|
8539
|
+
async function getOpenWorkflowTreeTaskIds(runIds) {
|
|
8540
|
+
const ids = [];
|
|
8541
|
+
const terminal = TERMINAL_TASK_STATUSES.map(() => "?").join(", ");
|
|
8542
|
+
await forEachChunk(runIds, async (chunk, placeholders) => {
|
|
8543
|
+
const rows = await getDbClient2().query(`SELECT id FROM agent_tasks
|
|
8544
|
+
WHERE workflowRunId IN (${placeholders}) AND status NOT IN (${terminal})`, [...chunk, ...TERMINAL_TASK_STATUSES]);
|
|
8545
|
+
for (const row of rows)
|
|
8546
|
+
ids.push(row.id);
|
|
8547
|
+
});
|
|
8548
|
+
return ids;
|
|
8549
|
+
}
|
|
8550
|
+
async function getTaskIdsWithDependents() {
|
|
8551
|
+
const rows = await getDbClient2().query(`SELECT DISTINCT dep.value AS id
|
|
8552
|
+
FROM agent_tasks t, json_each(t.dependsOn) AS dep
|
|
8553
|
+
WHERE t.status NOT IN (${TERMINAL_TASK_STATUSES.map(() => "?").join(", ")})
|
|
8554
|
+
AND t.dependsOn IS NOT NULL AND t.dependsOn != '[]'`, [...TERMINAL_TASK_STATUSES]);
|
|
8555
|
+
return new Set(rows.map((row) => row.id));
|
|
8556
|
+
}
|
|
8557
|
+
async function workflowRunTreeHasOpenWork(runIds) {
|
|
8558
|
+
const terminal = TERMINAL_TASK_STATUSES.map(() => "?").join(", ");
|
|
8559
|
+
const probes = [
|
|
8560
|
+
{
|
|
8561
|
+
sql: (ids) => `SELECT 1 FROM workflow_runs WHERE id IN (${ids}) AND status IN ('running', 'waiting') LIMIT 1`,
|
|
8562
|
+
params: []
|
|
8563
|
+
},
|
|
8564
|
+
{
|
|
8565
|
+
sql: (ids) => `SELECT 1 FROM workflow_run_steps
|
|
8566
|
+
WHERE runId IN (${ids})
|
|
8567
|
+
AND (status IN ('pending', 'running', 'waiting')
|
|
8568
|
+
OR (status = 'failed' AND nextRetryAt IS NOT NULL))
|
|
8569
|
+
LIMIT 1`,
|
|
8570
|
+
params: []
|
|
8571
|
+
},
|
|
8572
|
+
{
|
|
8573
|
+
sql: (ids) => `SELECT 1 FROM agent_tasks WHERE workflowRunId IN (${ids}) AND status NOT IN (${terminal}) LIMIT 1`,
|
|
8574
|
+
params: [...TERMINAL_TASK_STATUSES]
|
|
8575
|
+
},
|
|
8576
|
+
{
|
|
8577
|
+
sql: (ids) => `SELECT 1 FROM approval_requests WHERE workflowRunId IN (${ids}) AND status = 'pending' LIMIT 1`,
|
|
8578
|
+
params: []
|
|
8579
|
+
}
|
|
8580
|
+
];
|
|
8581
|
+
let open = false;
|
|
8582
|
+
await forEachChunk(runIds, async (chunk, placeholders) => {
|
|
8583
|
+
for (const probe of probes) {
|
|
8584
|
+
if (open)
|
|
8585
|
+
return;
|
|
8586
|
+
if (await getDbClient2().get(probe.sql(placeholders), [...chunk, ...probe.params])) {
|
|
8587
|
+
open = true;
|
|
8588
|
+
}
|
|
8589
|
+
}
|
|
8590
|
+
});
|
|
8591
|
+
return open;
|
|
8592
|
+
}
|
|
8593
|
+
async function cancelOpenWorkflowTreeSteps(runIds, reason, finishedAt) {
|
|
8594
|
+
await forEachChunk(runIds, async (chunk, placeholders) => {
|
|
8595
|
+
await getDbClient2().run(`UPDATE workflow_run_steps
|
|
8596
|
+
SET status = 'cancelled', error = ?, finishedAt = ?
|
|
8597
|
+
WHERE runId IN (${placeholders}) AND status IN ('pending', 'running', 'waiting')`, [scrubSecrets(reason), finishedAt, ...chunk]);
|
|
8598
|
+
});
|
|
8599
|
+
}
|
|
8600
|
+
async function disarmWorkflowTreeRetries(runIds, finishedAt) {
|
|
8601
|
+
await forEachChunk(runIds, async (chunk, placeholders) => {
|
|
8602
|
+
await getDbClient2().run(`UPDATE workflow_run_steps
|
|
8603
|
+
SET nextRetryAt = NULL, finishedAt = COALESCE(finishedAt, ?)
|
|
8604
|
+
WHERE runId IN (${placeholders}) AND status = 'failed' AND nextRetryAt IS NOT NULL`, [finishedAt, ...chunk]);
|
|
8605
|
+
});
|
|
8606
|
+
}
|
|
8607
|
+
async function cancelLiveWorkflowTreeRuns(runIds, reason, finishedAt) {
|
|
8608
|
+
await forEachChunk(runIds, async (chunk, placeholders) => {
|
|
8609
|
+
await getDbClient2().run(`UPDATE workflow_runs
|
|
8610
|
+
SET status = 'cancelled', error = ?, finishedAt = ?, lastUpdatedAt = ?
|
|
8611
|
+
WHERE id IN (${placeholders}) AND status IN ('running', 'waiting')`, [scrubSecrets(reason), finishedAt, finishedAt, ...chunk]);
|
|
8612
|
+
});
|
|
8613
|
+
}
|
|
8614
|
+
async function getChildWorkflowRunId(parentStepId, attempt) {
|
|
8615
|
+
const row = await getDbClient2().get("SELECT id FROM workflow_runs WHERE parentStepId = ? AND parentStepAttempt = ?", [parentStepId, attempt]);
|
|
8286
8616
|
return row?.id ?? null;
|
|
8287
8617
|
}
|
|
8618
|
+
async function isParentStepAttemptCurrent(parentStepId, attempt) {
|
|
8619
|
+
const row = await getDbClient2().get(`SELECT r.id AS runId
|
|
8620
|
+
FROM workflow_run_steps s
|
|
8621
|
+
JOIN workflow_runs r ON r.id = s.runId
|
|
8622
|
+
WHERE s.id = ? AND s.status = 'running' AND s.retryCount = ?
|
|
8623
|
+
AND r.status IN ('running', 'waiting')`, [parentStepId, attempt]);
|
|
8624
|
+
return row != null && await getRunLineageBlock(row.runId) == null;
|
|
8625
|
+
}
|
|
8626
|
+
async function getStepExecutionBlock(stepId) {
|
|
8627
|
+
const row = await getDbClient2().get(`SELECT s.status AS stepStatus, r.id AS runId, r.status AS runStatus
|
|
8628
|
+
FROM workflow_run_steps s
|
|
8629
|
+
JOIN workflow_runs r ON r.id = s.runId
|
|
8630
|
+
WHERE s.id = ?`, [stepId]);
|
|
8631
|
+
if (!row)
|
|
8632
|
+
return "the step or its run is missing";
|
|
8633
|
+
if (row.runStatus !== "running" && row.runStatus !== "waiting") {
|
|
8634
|
+
return `its run is ${row.runStatus}`;
|
|
8635
|
+
}
|
|
8636
|
+
if (row.stepStatus !== "running")
|
|
8637
|
+
return `the step is ${row.stepStatus}`;
|
|
8638
|
+
return getRunLineageBlock(row.runId);
|
|
8639
|
+
}
|
|
8640
|
+
async function getRunningSubWorkflowSteps() {
|
|
8641
|
+
return getDbClient2().query(`SELECT s.id AS stepId, s.runId AS runId, s.nodeId AS nodeId
|
|
8642
|
+
FROM workflow_run_steps s
|
|
8643
|
+
JOIN workflow_runs r ON r.id = s.runId
|
|
8644
|
+
WHERE s.status = 'running' AND s.nodeType = 'sub-workflow'
|
|
8645
|
+
AND r.status IN ('running', 'waiting')
|
|
8646
|
+
AND s.rowid = (
|
|
8647
|
+
SELECT MAX(rowid) FROM workflow_run_steps
|
|
8648
|
+
WHERE runId = s.runId AND nodeId = s.nodeId
|
|
8649
|
+
)`);
|
|
8650
|
+
}
|
|
8288
8651
|
async function getWorkflowRunParent(parentStepId) {
|
|
8289
8652
|
const row = await getDbClient2().get(`SELECT s.runId AS runId, r.workflowId AS workflowId, s.id AS stepId, s.nodeId AS nodeId
|
|
8290
8653
|
FROM workflow_run_steps s
|
|
@@ -8308,7 +8671,8 @@ async function getWorkflowRunLineage(runId, maxDepth) {
|
|
|
8308
8671
|
async function getSettledChildRunParentSteps() {
|
|
8309
8672
|
const rows = await getDbClient2().query(`SELECT s.id
|
|
8310
8673
|
FROM workflow_run_steps s
|
|
8311
|
-
LEFT JOIN workflow_runs c
|
|
8674
|
+
LEFT JOIN workflow_runs c
|
|
8675
|
+
ON c.parentStepId = s.id AND c.parentStepAttempt = s.retryCount
|
|
8312
8676
|
WHERE s.status = 'waiting' AND s.nodeType = 'sub-workflow'
|
|
8313
8677
|
AND (c.id IS NULL OR c.status IN ('completed', 'failed', 'cancelled', 'skipped'))`);
|
|
8314
8678
|
return rows.map((row) => row.id);
|
|
@@ -8384,8 +8748,9 @@ async function createForeachAttemptSteps(runId, rows) {
|
|
|
8384
8748
|
return created;
|
|
8385
8749
|
});
|
|
8386
8750
|
}
|
|
8387
|
-
var TERMINAL_STATUSES;
|
|
8751
|
+
var TERMINAL_STATUSES, WORKFLOW_RUN_TREE_MAX_DEPTH = 32, WorkflowRunTreeError, WorkflowStepNotExecutableError, TREE_QUERY_CHUNK = 500;
|
|
8388
8752
|
var init_workflow_runs = __esm(() => {
|
|
8753
|
+
init_types();
|
|
8389
8754
|
init_secret_scrubber();
|
|
8390
8755
|
init_scrub_json();
|
|
8391
8756
|
init_runtime();
|
|
@@ -8395,6 +8760,18 @@ var init_workflow_runs = __esm(() => {
|
|
|
8395
8760
|
"cancelled",
|
|
8396
8761
|
"skipped"
|
|
8397
8762
|
]);
|
|
8763
|
+
WorkflowRunTreeError = class WorkflowRunTreeError extends Error {
|
|
8764
|
+
constructor(message) {
|
|
8765
|
+
super(message);
|
|
8766
|
+
this.name = "WorkflowRunTreeError";
|
|
8767
|
+
}
|
|
8768
|
+
};
|
|
8769
|
+
WorkflowStepNotExecutableError = class WorkflowStepNotExecutableError extends Error {
|
|
8770
|
+
constructor(stepId, reason) {
|
|
8771
|
+
super(`Workflow step ${stepId} may not start new work: ${reason}`);
|
|
8772
|
+
this.name = "WorkflowStepNotExecutableError";
|
|
8773
|
+
}
|
|
8774
|
+
};
|
|
8398
8775
|
});
|
|
8399
8776
|
|
|
8400
8777
|
// src/integrations/chat-sdk/schema.ts
|
|
@@ -8905,6 +9282,18 @@ function validateConfigValue(key, value) {
|
|
|
8905
9282
|
const validator = VALIDATED_KEYS[key.toUpperCase()];
|
|
8906
9283
|
return validator ? validator(value) : null;
|
|
8907
9284
|
}
|
|
9285
|
+
function validateConfigEntry(entry) {
|
|
9286
|
+
if (entry.scope === "global" && entry.scopeId)
|
|
9287
|
+
return "Global scope must not have scopeId";
|
|
9288
|
+
if ((entry.scope === "agent" || entry.scope === "repo") && !entry.scopeId) {
|
|
9289
|
+
return "Agent/repo scope requires scopeId";
|
|
9290
|
+
}
|
|
9291
|
+
if (isReservedConfigKey(entry.key))
|
|
9292
|
+
return reservedKeyError(entry.key).message;
|
|
9293
|
+
if (isInternalConfigKey(entry.key))
|
|
9294
|
+
return internalConfigKeyError(entry.key).message;
|
|
9295
|
+
return validateConfigValue(entry.key, entry.value) ?? validateExportToEnv(entry.key, entry.exportToEnv);
|
|
9296
|
+
}
|
|
8908
9297
|
function validateExportToEnv(key, exportToEnv) {
|
|
8909
9298
|
return exportToEnv === true && isEnvExportRestrictedKey(key) ? envExportRestrictedError(key) : null;
|
|
8910
9299
|
}
|
|
@@ -9185,6 +9574,7 @@ var init_swarm_config_guard = __esm(() => {
|
|
|
9185
9574
|
...boundedIntegerValidators(["CHAT_SDK_BUFFER_MS"], 1, 600000),
|
|
9186
9575
|
...boundedIntegerValidators(["CHAT_SDK_OWNER_WINDOW_MIN"], 0, 1440),
|
|
9187
9576
|
...boundedIntegerValidators(["CONTEXT_PREAMBLE_MAX_TOKENS"], 100, 20000),
|
|
9577
|
+
...boundedIntegerValidators(["CONTEXT_BOUND_NOTE_TOKENS"], 0, 1e7),
|
|
9188
9578
|
MEMORY_MIN_SIMILARITY: (value) => validateFloatRange("MEMORY_MIN_SIMILARITY", value, 0, 1, "between 0 and 1 inclusive"),
|
|
9189
9579
|
MEMORY_ACCESS_BOOST_MAX: (value) => validateFloatRange("MEMORY_ACCESS_BOOST_MAX", value, 1, Number.POSITIVE_INFINITY, "a number >= 1")
|
|
9190
9580
|
};
|
|
@@ -19774,7 +20164,7 @@ async function loadSecretRegistry() {
|
|
|
19774
20164
|
result.failed += 1;
|
|
19775
20165
|
}
|
|
19776
20166
|
try {
|
|
19777
|
-
const { loadRuntimeControllerSecrets } = await import("./db-
|
|
20167
|
+
const { loadRuntimeControllerSecrets } = await import("./db-47vj40dy.js");
|
|
19778
20168
|
const loaded = await loadRuntimeControllerSecrets();
|
|
19779
20169
|
result.runtimeController = loaded.count;
|
|
19780
20170
|
result.failed += loaded.failed;
|
|
@@ -21958,6 +22348,11 @@ async function createTaskExtended2(task, options) {
|
|
|
21958
22348
|
const auditUserId = getCurrentRequestUserId() ?? null;
|
|
21959
22349
|
const assetKey = normalizeAssetKey(options?.key ?? defaultAssetKey("task", id));
|
|
21960
22350
|
const claim = await getDbClient2().transaction(async () => {
|
|
22351
|
+
if (options?.workflowRunStepId) {
|
|
22352
|
+
const blocked = await getStepExecutionBlock(options.workflowRunStepId);
|
|
22353
|
+
if (blocked)
|
|
22354
|
+
throw new WorkflowStepNotExecutableError(options.workflowRunStepId, blocked);
|
|
22355
|
+
}
|
|
21961
22356
|
const existingTrackerWork = options?.bypassTrackerContextDedup ? null : await findExistingLinearTrackerContextWork2(options?.contextKey);
|
|
21962
22357
|
if (existingTrackerWork)
|
|
21963
22358
|
return { existing: existingTrackerWork };
|
|
@@ -23088,10 +23483,13 @@ async function createSessionLogs2(logs) {
|
|
|
23088
23483
|
const line = logs.lines[i];
|
|
23089
23484
|
if (line === undefined)
|
|
23090
23485
|
continue;
|
|
23091
|
-
batch.push(
|
|
23486
|
+
batch.push(scrubSecrets(line));
|
|
23092
23487
|
}
|
|
23093
23488
|
await getDbClient2().transaction(async (tx) => {
|
|
23094
|
-
|
|
23489
|
+
const last = await tx.get(`SELECT lineNumber FROM session_logs WHERE sessionId = ? AND iteration = ?
|
|
23490
|
+
ORDER BY rowid DESC LIMIT 1`, [logs.sessionId, logs.iteration]);
|
|
23491
|
+
let lineNumber = last ? last.lineNumber + 1 : 0;
|
|
23492
|
+
for (const content of batch) {
|
|
23095
23493
|
await tx.run(`INSERT INTO session_logs (id, taskId, sessionId, iteration, cli, content, lineNumber, createdAt)
|
|
23096
23494
|
VALUES (?, ?, ?, ?, ?, ?, ?, strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))`, [
|
|
23097
23495
|
crypto.randomUUID(),
|
|
@@ -23100,7 +23498,7 @@ async function createSessionLogs2(logs) {
|
|
|
23100
23498
|
logs.iteration,
|
|
23101
23499
|
logs.cli,
|
|
23102
23500
|
content,
|
|
23103
|
-
lineNumber
|
|
23501
|
+
lineNumber++
|
|
23104
23502
|
]);
|
|
23105
23503
|
}
|
|
23106
23504
|
});
|
|
@@ -23109,17 +23507,17 @@ async function createSessionLogs2(logs) {
|
|
|
23109
23507
|
async function getSessionLogsByTaskId2(taskId, limit) {
|
|
23110
23508
|
if (typeof limit === "number" && limit > 0) {
|
|
23111
23509
|
const rows = await getDbClient2().query(`SELECT * FROM (
|
|
23112
|
-
SELECT * FROM session_logs WHERE taskId = ?
|
|
23113
|
-
ORDER BY
|
|
23510
|
+
SELECT rowid AS seq, * FROM session_logs WHERE taskId = ?
|
|
23511
|
+
ORDER BY rowid DESC
|
|
23114
23512
|
LIMIT ?
|
|
23115
|
-
) ORDER BY
|
|
23513
|
+
) ORDER BY seq ASC`, [taskId, limit]);
|
|
23116
23514
|
return rows.map(rowToSessionLog);
|
|
23117
23515
|
}
|
|
23118
|
-
const rows = await getDbClient2().query("SELECT * FROM session_logs WHERE taskId = ? ORDER BY
|
|
23516
|
+
const rows = await getDbClient2().query("SELECT * FROM session_logs WHERE taskId = ? ORDER BY rowid ASC", [taskId]);
|
|
23119
23517
|
return rows.map(rowToSessionLog);
|
|
23120
23518
|
}
|
|
23121
23519
|
async function getSessionLogsBySession2(sessionId, iteration) {
|
|
23122
|
-
const rows = await getDbClient2().query("SELECT * FROM session_logs WHERE sessionId = ? AND iteration = ? ORDER BY
|
|
23520
|
+
const rows = await getDbClient2().query("SELECT * FROM session_logs WHERE sessionId = ? AND iteration = ? ORDER BY rowid ASC", [sessionId, iteration]);
|
|
23123
23521
|
return rows.map(rowToSessionLog);
|
|
23124
23522
|
}
|
|
23125
23523
|
function rowToSessionCost(row) {
|
|
@@ -24684,6 +25082,7 @@ async function deleteWorkflowRows(id, source) {
|
|
|
24684
25082
|
await client.run("DELETE FROM workflow_runs WHERE workflowId = ?", [id]);
|
|
24685
25083
|
await reclassifyTaskHumanFree(linkedTaskIds);
|
|
24686
25084
|
await client.run("DELETE FROM user_favorites WHERE itemType = 'workflow' AND itemId = ?", [id]);
|
|
25085
|
+
await tombstoneWorkflowIdempotencyKeys(id);
|
|
24687
25086
|
const result = await client.run("DELETE FROM workflows WHERE id = ?", [id]);
|
|
24688
25087
|
const deleted = result.changes > 0;
|
|
24689
25088
|
if (deleted) {
|
|
@@ -24711,7 +25110,8 @@ function rowToWorkflowRun(row, view = "replay") {
|
|
|
24711
25110
|
startedAt: normalizeDateRequired(row.startedAt),
|
|
24712
25111
|
lastUpdatedAt: normalizeDateRequired(row.lastUpdatedAt),
|
|
24713
25112
|
finishedAt: normalizeDate(row.finishedAt) ?? undefined,
|
|
24714
|
-
parentStepId: row.parentStepId ?? undefined
|
|
25113
|
+
parentStepId: row.parentStepId ?? undefined,
|
|
25114
|
+
parentStepAttempt: row.parentStepId ? row.parentStepAttempt ?? 0 : undefined
|
|
24715
25115
|
};
|
|
24716
25116
|
return defineWorkflowPayload(run, "context", row.context, row.context_replay, view, {
|
|
24717
25117
|
runId: row.id,
|
|
@@ -24720,14 +25120,15 @@ function rowToWorkflowRun(row, view = "replay") {
|
|
|
24720
25120
|
}
|
|
24721
25121
|
async function createWorkflowRun2(data) {
|
|
24722
25122
|
const now = new Date().toISOString();
|
|
24723
|
-
const row = await getDbClient2().get(`INSERT INTO workflow_runs (id, workflowId, triggerType, startedAt, triggerData, created_by, parentStepId) VALUES (?, ?, ?, ?, ?, ?, ?) RETURNING *`, [
|
|
25123
|
+
const row = await getDbClient2().get(`INSERT INTO workflow_runs (id, workflowId, triggerType, startedAt, triggerData, created_by, parentStepId, parentStepAttempt) VALUES (?, ?, ?, ?, ?, ?, ?, ?) RETURNING *`, [
|
|
24724
25124
|
data.id,
|
|
24725
25125
|
data.workflowId,
|
|
24726
25126
|
data.triggerType ?? "manual",
|
|
24727
25127
|
now,
|
|
24728
25128
|
data.triggerData ? scrubJsonValue(data.triggerData) : null,
|
|
24729
25129
|
data.createdBy ?? null,
|
|
24730
|
-
data.parentStepId ?? null
|
|
25130
|
+
data.parentStepId ?? null,
|
|
25131
|
+
data.parentStepAttempt ?? 0
|
|
24731
25132
|
]);
|
|
24732
25133
|
if (!row)
|
|
24733
25134
|
throw new Error("Failed to create workflow run");
|
|
@@ -25637,15 +26038,22 @@ async function createApprovalRequest2(data) {
|
|
|
25637
26038
|
const row = await getDbClient2().transaction(async () => {
|
|
25638
26039
|
let status = "pending";
|
|
25639
26040
|
let resolutionReason = null;
|
|
25640
|
-
|
|
25641
|
-
|
|
25642
|
-
|
|
26041
|
+
const actionable = data.requireActionableWorkflow && data.workflowRunStepId;
|
|
26042
|
+
const run = data.workflowRunId ? await getWorkflowRun2(data.workflowRunId, "display") : null;
|
|
26043
|
+
if (data.workflowRunId && (run || actionable)) {
|
|
26044
|
+
const step = actionable ? await getWorkflowRunStep2(data.workflowRunStepId) : undefined;
|
|
25643
26045
|
if (!run || run.status !== "running" && run.status !== "waiting") {
|
|
25644
26046
|
status = "cancelled";
|
|
25645
26047
|
resolutionReason = run?.error ?? `Workflow run is ${run?.status ?? "missing"}`;
|
|
25646
|
-
} else if (!step || step.runId !== run.id || step.status !== "running") {
|
|
26048
|
+
} else if (step !== undefined && (!step || step.runId !== run.id || step.status !== "running")) {
|
|
25647
26049
|
status = "cancelled";
|
|
25648
26050
|
resolutionReason = `Human-in-the-loop step is ${step?.status ?? "missing"}`;
|
|
26051
|
+
} else {
|
|
26052
|
+
const blocked = await getRunLineageBlock(run.id);
|
|
26053
|
+
if (blocked) {
|
|
26054
|
+
status = "cancelled";
|
|
26055
|
+
resolutionReason = blocked;
|
|
26056
|
+
}
|
|
25649
26057
|
}
|
|
25650
26058
|
}
|
|
25651
26059
|
return getDbClient2().get(`INSERT INTO approval_requests
|
|
@@ -26343,6 +26751,9 @@ async function listSkills2(filters) {
|
|
|
26343
26751
|
return rows.map(rowToSkill);
|
|
26344
26752
|
}
|
|
26345
26753
|
async function searchSkills2(query, limit = 20, includeContent = true) {
|
|
26754
|
+
const ranked = await searchSkillRowsRanked(query, limit, includeContent === false ? SKILL_SLIM_COLUMNS : "skills.*");
|
|
26755
|
+
if (ranked.length > 0)
|
|
26756
|
+
return ranked.map(rowToSkill);
|
|
26346
26757
|
const tokens = query.split(/\s+/).filter(Boolean);
|
|
26347
26758
|
const columns = includeContent === false ? SKILL_SLIM_COLUMNS : "*";
|
|
26348
26759
|
const searchClauses = tokens.map(() => "(name LIKE ? OR description LIKE ? OR content LIKE ?)");
|
|
@@ -26350,7 +26761,7 @@ async function searchSkills2(query, limit = 20, includeContent = true) {
|
|
|
26350
26761
|
const term = `%${token}%`;
|
|
26351
26762
|
return [term, term, term];
|
|
26352
26763
|
});
|
|
26353
|
-
const rows = await getDbClient2().query(`SELECT ${columns} FROM skills WHERE ${[...searchClauses, "isEnabled = 1"].join(" AND ")} ORDER BY name ASC LIMIT ?`, [...params, limit]);
|
|
26764
|
+
const rows = await getDbClient2().query(`SELECT ${columns} FROM skills WHERE ${[...searchClauses, "isEnabled = 1"].join(" AND ")} ORDER BY lower(name) = lower(?) DESC, name ASC LIMIT ?`, [...params, query.trim(), limit]);
|
|
26354
26765
|
return rows.map(rowToSkill);
|
|
26355
26766
|
}
|
|
26356
26767
|
async function installSkill2(agentId, skillId) {
|
|
@@ -27399,7 +27810,9 @@ async function getRootTaskChain2(rootTaskId) {
|
|
|
27399
27810
|
SELECT t.id FROM agent_tasks t
|
|
27400
27811
|
JOIN chain c ON t.parentTaskId = c.id
|
|
27401
27812
|
)
|
|
27402
|
-
SELECT t
|
|
27813
|
+
SELECT t.*,
|
|
27814
|
+
(SELECT SUM(totalCostUsd) FROM session_costs WHERE session_costs.taskId = t.id) AS totalCostUsd
|
|
27815
|
+
FROM chain
|
|
27403
27816
|
CROSS JOIN agent_tasks t ON t.id = chain.id
|
|
27404
27817
|
ORDER BY t.createdAt, t.rowid`, [rootTaskId]);
|
|
27405
27818
|
return rows.map(rowToAgentTask);
|
|
@@ -28128,7 +28541,7 @@ var VERSIONABLE_FIELDS2, BUDGETED_IDENTITY_FIELDS, PENDING_SLACK_MESSAGE_TS_PREF
|
|
|
28128
28541
|
LEFT JOIN agents a ON m.created_by_kind = 'agent' AND a.id = m.created_by_agent_id`, ROUTING_HOLDER_SQL = `CASE
|
|
28129
28542
|
WHEN status IN ('draft', 'offered', 'reviewing') AND offeredTo IS NOT NULL THEN offeredTo
|
|
28130
28543
|
ELSE COALESCE(agentId, offeredTo)
|
|
28131
|
-
END`, ELIGIBILITY_SCAN_BATCH_SIZE, ELIGIBILITY_SCAN_CAP, UNATTRIBUTED_USER_ID2 = "unattributed", HUMAN_FREE_SQL = "(COALESCE(t.isHumanFree, 0) = 1)", SCHEDULE_TEMPLATE_PREVIEW_LENGTH = 280, RESERVED_CONFIG_PLACEHOLDER = "[reserved key stored in swarm_config; delete this row]", WORKFLOW_RUN_SUMMARY_COLUMNS = "id, workflowId, status, triggerType, triggerData, error, created_by, startedAt, lastUpdatedAt, finishedAt", SKILL_FILE_LIMITS2, BINARY_SKILL_FILE_PLACEHOLDER = "[binary file - not synced]", SKILL_SLIM_COLUMNS = "id, name, description, type, scope, ownerAgentId, sourceUrl, sourceRepo, sourcePath, sourceBranch, sourceHash, isComplex, allowedTools, model, effort, context, agent, disableModelInvocation, userInvocable, version, isEnabled, systemDefault, invocationCount, lastInvokedAt, createdAt, lastUpdatedAt, lastFetchedAt, '' as content", WEEK_SECONDS, KvTypeCollisionError2;
|
|
28544
|
+
END`, ELIGIBILITY_SCAN_BATCH_SIZE, ELIGIBILITY_SCAN_CAP, UNATTRIBUTED_USER_ID2 = "unattributed", HUMAN_FREE_SQL = "(COALESCE(t.isHumanFree, 0) = 1)", SCHEDULE_TEMPLATE_PREVIEW_LENGTH = 280, RESERVED_CONFIG_PLACEHOLDER = "[reserved key stored in swarm_config; delete this row]", WORKFLOW_RUN_SUMMARY_COLUMNS = "id, workflowId, status, triggerType, triggerData, error, created_by, startedAt, lastUpdatedAt, finishedAt, parentStepId, parentStepAttempt", SKILL_FILE_LIMITS2, BINARY_SKILL_FILE_PLACEHOLDER = "[binary file - not synced]", SKILL_SLIM_COLUMNS = "id, name, description, type, scope, ownerAgentId, sourceUrl, sourceRepo, sourcePath, sourceBranch, sourceHash, isComplex, allowedTools, model, effort, context, agent, disableModelInvocation, userInvocable, version, isEnabled, systemDefault, invocationCount, lastInvokedAt, createdAt, lastUpdatedAt, lastFetchedAt, '' as content", WEEK_SECONDS, KvTypeCollisionError2;
|
|
28132
28545
|
var init_db3 = __esm(() => {
|
|
28133
28546
|
init_package();
|
|
28134
28547
|
init_key();
|
|
@@ -28161,9 +28574,11 @@ var init_db3 = __esm(() => {
|
|
|
28161
28574
|
init_runtime();
|
|
28162
28575
|
init_session_moves();
|
|
28163
28576
|
init_session_tree();
|
|
28577
|
+
init_skill_search();
|
|
28164
28578
|
init_human_free();
|
|
28165
28579
|
init_read();
|
|
28166
28580
|
init_write();
|
|
28581
|
+
init_workflow_idempotency();
|
|
28167
28582
|
init_workflow_runs();
|
|
28168
28583
|
init_scrub_json();
|
|
28169
28584
|
init_sealed_json();
|
|
@@ -28238,4 +28653,4 @@ var init_db3 = __esm(() => {
|
|
|
28238
28653
|
};
|
|
28239
28654
|
});
|
|
28240
28655
|
|
|
28241
|
-
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, invalidateTelemetryUserRole, 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, triageSessionList, 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 };
|
|
28656
|
+
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, invalidateTelemetryUserRole, 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, approvalCancellationNotificationKey, listUndeliveredCancelledApprovalRequestIds, init_approvals, 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, triageSessionList, 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, IdempotencyKeyTakenError, workflowRequestFingerprint, findAcceptedWorkflowOperation, assertWorkflowIdempotencyKeyUnused, recordAcceptedWorkflowOperation, init_workflow_idempotency, getRunLineageBlock, getWorkflowRunTreeIds, getWorkflowRunStatus, getOpenWorkflowTreeTaskIds, getTaskIdsWithDependents, workflowRunTreeHasOpenWork, cancelOpenWorkflowTreeSteps, disarmWorkflowTreeRetries, cancelLiveWorkflowTreeRuns, getChildWorkflowRunId, isParentStepAttemptCurrent, getRunningSubWorkflowSteps, 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, validateConfigEntry, 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 };
|