@desplega.ai/agent-swarm 2.5.3 → 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.
Files changed (197) hide show
  1. package/dist/{acp-adapter-gr2fcyyj.js → acp-adapter-ek38cwsv.js} +4 -4
  2. package/dist/{actions-wv766ghf.js → actions-92mepq03.js} +17 -17
  3. package/dist/{amp-adapter-speb906t.js → amp-adapter-9gaxg015.js} +2 -2
  4. package/dist/{app-ag29n14f.js → app-ctn8gsgx.js} +3 -3
  5. package/dist/{assistant-3x8bz3eg.js → assistant-zyr5kz47.js} +19 -19
  6. package/dist/{boot-reembed-jsmfrpzf.js → boot-reembed-dwzfttdr.js} +1 -1
  7. package/dist/{boot-reembed-5b3d2eea.js → boot-reembed-w75maga2.js} +1 -1
  8. package/dist/{boot-scrub-sweep-s73gerxy.js → boot-scrub-sweep-e9kq43kf.js} +3 -3
  9. package/dist/{boot-seeds-5zmax2wr.js → boot-seeds-x28v3fhb.js} +4 -4
  10. package/dist/{claude-adapter-hswdnm3t.js → claude-adapter-f0afqnne.js} +4 -4
  11. package/dist/{claude-managed-adapter-cvbzj1h6.js → claude-managed-adapter-x81a7r65.js} +3 -3
  12. package/dist/{claude-managed-setup-3k8m3hhc.js → claude-managed-setup-bqzwjd9x.js} +1 -1
  13. package/dist/{claude-sdk-session-fkbyk66x.js → claude-sdk-session-7b7whkaq.js} +9307 -9254
  14. package/dist/{cli-a5ebc95n.js → cli-0shx9j93.js} +16 -13
  15. package/dist/{cli-vwn81jbs.js → cli-19202kew.js} +3 -3
  16. package/dist/{cli-svrj71pg.js → cli-1r5ad7j5.js} +7 -7
  17. package/dist/{cli-hhxjnjzs.js → cli-25n3mv5d.js} +8 -6
  18. package/dist/cli-2655k16q.js +140 -0
  19. package/dist/{cli-hcpj2xqz.js → cli-277c31dw.js} +1 -1
  20. package/dist/{cli-35gtk1p6.js → cli-4b2z6n0m.js} +29 -7
  21. package/dist/{cli-40jsnrjm.js → cli-5bnsc0e1.js} +7 -5
  22. package/dist/{cli-fzcn3d87.js → cli-621ce7kw.js} +1 -1
  23. package/dist/{cli-s49hpn37.js → cli-64mh9mf3.js} +19 -5
  24. package/dist/{cli-e8jyq7d8.js → cli-6a1xg1p7.js} +6 -2
  25. package/dist/{cli-p9rafdrb.js → cli-7p4jxgtt.js} +4 -4
  26. package/dist/{cli-w1zwctj2.js → cli-9j129brq.js} +9 -3
  27. package/dist/{cli-ce0ak9ms.js → cli-abs8ndtr.js} +11 -11
  28. package/dist/{cli-aecdcr77.js → cli-asq5ydm4.js} +123 -50
  29. package/dist/{cli-n45mr7zh.js → cli-bvpgr9ny.js} +2 -2
  30. package/dist/{cli-210xd1f4.js → cli-c61mbdds.js} +3 -3
  31. package/dist/{cli-e5bxnjps.js → cli-c952c7ac.js} +5 -5
  32. package/dist/{cli-p859hcc8.js → cli-dew6x255.js} +1 -1
  33. package/dist/{cli-tx00c0h6.js → cli-dqygeeh5.js} +17 -1
  34. package/dist/{cli-gpv60278.js → cli-e42vss7b.js} +2 -2
  35. package/dist/{cli-s53vp709.js → cli-eftzyh9y.js} +1 -1
  36. package/dist/{cli-3ngdk5te.js → cli-ethgy7ha.js} +1 -1
  37. package/dist/{cli-99xgw26r.js → cli-ff1tm9n9.js} +1 -1
  38. package/dist/{cli-ewm3pwbq.js → cli-g9vd9ece.js} +37 -12
  39. package/dist/{cli-jjznk3f7.js → cli-gbfxp48k.js} +62 -28
  40. package/dist/{cli-z21whrrg.js → cli-gn5af0x5.js} +14 -14
  41. package/dist/{cli-1fc85mvt.js → cli-gwhjmh8g.js} +4 -4
  42. package/dist/{cli-avdvgcay.js → cli-hh5we352.js} +24 -5
  43. package/dist/{cli-0ebey9hg.js → cli-j6rktc91.js} +1 -1
  44. package/dist/{cli-kxawjrxg.js → cli-jb30dzvk.js} +332 -36
  45. package/dist/{cli-25j01dpj.js → cli-jbnn4vxb.js} +3 -3
  46. package/dist/{cli-qzme5949.js → cli-k4tjsdx9.js} +44 -39
  47. package/dist/{cli-8s5wx3nz.js → cli-m4ecdxvz.js} +40 -13
  48. package/dist/{cli-ta8bd7th.js → cli-pzatvw94.js} +1 -1
  49. package/dist/{cli-p6zs9h4y.js → cli-rr7zx19j.js} +767 -249
  50. package/dist/{cli-502eqv93.js → cli-s682zgqz.js} +1 -1
  51. package/dist/{cli-fsdprwrg.js → cli-sbwsxvtd.js} +1 -1
  52. package/dist/{cli-0xk505e8.js → cli-sxgtf5fw.js} +1 -1
  53. package/dist/{cli-egjggehm.js → cli-tsma7p8v.js} +1 -1
  54. package/dist/{cli-qgf8emrn.js → cli-wghjkr0e.js} +5 -5
  55. package/dist/{cli-p0rzjkya.js → cli-wx2nj19m.js} +29 -10
  56. package/dist/{cli-e2ar4bp1.js → cli-x0f2v69c.js} +111 -42
  57. package/dist/{cli-y561h5a9.js → cli-xtrz6bzs.js} +5 -5
  58. package/dist/{cli-gpsz7g88.js → cli-xzfq4at3.js} +7 -7
  59. package/dist/cli.js +18 -18
  60. package/dist/{codex-adapter-n8ka66vf.js → codex-adapter-wch12q99.js} +2 -2
  61. package/dist/{codex-hook-e2he7aca.js → codex-hook-brpnycn5.js} +1 -1
  62. package/dist/{codex-session-runner-fsebts37.js → codex-session-runner-41pfcr95.js} +2 -2
  63. package/dist/{commands-t04rt2pc.js → commands-9849dkj6.js} +2 -2
  64. package/dist/{controller-rgna04r2.js → controller-ja0sd95p.js} +27 -1
  65. package/dist/{controllers-connect-bqm1rtft.js → controllers-connect-xp05dj6x.js} +16 -16
  66. package/dist/{cursor-adapter-swr2k95y.js → cursor-adapter-623qxqew.js} +1 -2
  67. package/dist/{db-a4m7haw0.js → db-47vj40dy.js} +3 -3
  68. package/dist/{db-24ck09xy.js → db-w759qmx0.js} +2 -2
  69. package/dist/{dispatcher-nwf9ss0q.js → dispatcher-7b8e4z2j.js} +15 -15
  70. package/dist/{docker-nfy2gc8t.js → docker-s84hjs91.js} +2 -2
  71. package/dist/{dsh-adapter-kpdnhjst.js → dsh-adapter-2ezw3xea.js} +1 -2
  72. package/dist/{external-channel-j1e2p34p.js → external-channel-e2s028da.js} +2 -2
  73. package/dist/{grok-adapter-qtjz0whk.js → grok-adapter-ys7gaqee.js} +5 -5
  74. package/dist/{handlers-19xr6dnz.js → handlers-wy1dr6ja.js} +18 -18
  75. package/dist/{heartbeat-vtesda5d.js → heartbeat-w3mntghj.js} +17 -17
  76. package/dist/{hook-8wqaszda.js → hook-3jjywnpb.js} +9 -3
  77. package/dist/{hook-b2hhj6rd.js → hook-g7kvv6x9.js} +3 -2
  78. package/dist/{http-mxcqhhcs.js → http-tkp7d4kb.js} +267 -75
  79. package/dist/{index-srg522m6.js → index-1ef1myq2.js} +15 -15
  80. package/dist/{index-1r8wfpzs.js → index-3n8m9ea2.js} +1 -1
  81. package/dist/{index-kw2mmat7.js → index-nmm79qgr.js} +17 -17
  82. package/dist/{index-n1vbvta9.js → index-q7m26kvs.js} +24 -22
  83. package/dist/{index-spwxjgay.js → index-xdaahthb.js} +15 -15
  84. package/dist/{keepalive-dsd8rtgx.js → keepalive-v4ta8wgg.js} +3 -3
  85. package/dist/{lead-zyerk1x2.js → lead-sawnyqxk.js} +33 -33
  86. package/dist/{maintenance-jqmqwnet.js → maintenance-84n1ex21.js} +1 -1
  87. package/dist/{oauth-refresh-sweep-q2c3bnvm.js → oauth-refresh-sweep-vjnnandw.js} +2 -2
  88. package/dist/{onboard-w4yd7s8t.js → onboard-sfmpe4np.js} +2 -2
  89. package/dist/{opencode-adapter-9tppvxar.js → opencode-adapter-jmpst4q4.js} +3 -3
  90. package/dist/{otel-impl-f36byzbd.js → otel-impl-v6cc0zve.js} +1 -1
  91. package/dist/{pi-mono-adapter-tqsge1ay.js → pi-mono-adapter-fk8fkcf6.js} +33 -6
  92. package/dist/{pricing-refresh-xvak5p4v.js → pricing-refresh-fsk1e1zc.js} +3 -3
  93. package/dist/{rbac-roles-gfn30fb8.js → rbac-roles-prmkdnkw.js} +2 -2
  94. package/dist/{rbac-roles-682k2mt5.js → rbac-roles-zxmxqa39.js} +1 -1
  95. package/dist/{render-v2-hgytz8nn.js → render-v2-pjwxvnkw.js} +3 -3
  96. package/dist/{resume-2dvq348g.js → resume-frdtgfa0.js} +8 -6
  97. package/dist/{session-access-7f21ekq9.js → session-access-fpez4y5q.js} +4 -4
  98. package/dist/{setup-epffxtbk.js → setup-mq6m3m8q.js} +1 -1
  99. package/dist/{work-objects-xz1a5rqk.js → work-objects-kfahhjsq.js} +18 -18
  100. package/dist/{worker-42t8emjt.js → worker-v5e5rxj3.js} +33 -33
  101. package/openapi.json +68 -3
  102. package/package.json +5 -5
  103. package/plugin/commands/create-pr.md +2 -2
  104. package/plugin/pi-skills/create-pr/SKILL.md +2 -2
  105. package/src/be/db/approvals.ts +48 -0
  106. package/src/be/db/tasks/write.ts +15 -5
  107. package/src/be/db/workflow-idempotency.ts +183 -0
  108. package/src/be/db/workflow-runs.ts +318 -7
  109. package/src/be/db.ts +67 -17
  110. package/src/be/migrations/242_workflow_idempotency_keys.sql +40 -0
  111. package/src/be/sealed-json.ts +1 -0
  112. package/src/be/seed-scripts/catalog/compound-insights.inline.ts +2 -2
  113. package/src/be/seed-scripts/catalog/compound-insights.ts +2 -2
  114. package/src/be/seed-skills/bundled-files.generated.json +1 -1
  115. package/src/be/sql-connections.ts +7 -1
  116. package/src/be/swarm-config-guard.ts +2 -0
  117. package/src/be/users.ts +9 -0
  118. package/src/commands/controller.ts +33 -0
  119. package/src/commands/runner.ts +6 -2
  120. package/src/extensions/apply-task-create.ts +57 -11
  121. package/src/extensions/contract-types.generated.ts +1 -1
  122. package/src/extensions/contract.ts +25 -0
  123. package/src/extensions/dispatcher.ts +4 -0
  124. package/src/extensions/post-bridge.ts +8 -0
  125. package/src/hooks/context-bound-note.ts +196 -0
  126. package/src/hooks/hook.ts +12 -0
  127. package/src/http/config.ts +48 -16
  128. package/src/http/idempotency-key.ts +117 -0
  129. package/src/http/workflows.ts +129 -24
  130. package/src/prompts/context-bound-note.ts +48 -0
  131. package/src/prompts/session-templates.ts +25 -1
  132. package/src/providers/amp-adapter.ts +30 -8
  133. package/src/providers/claude-adapter.ts +29 -4
  134. package/src/providers/claude-managed-adapter.ts +26 -0
  135. package/src/providers/claude-sdk-session.ts +10 -0
  136. package/src/providers/claude-session-events.ts +13 -0
  137. package/src/providers/codex-adapter.ts +12 -0
  138. package/src/providers/opencode-adapter.ts +18 -0
  139. package/src/providers/pi-mono-adapter.ts +35 -0
  140. package/src/runtime-providers/docker.ts +6 -2
  141. package/src/scripts-runtime/types/swarm-extension.d.ts +35 -0
  142. package/src/tests/amp-adapter.test.ts +97 -0
  143. package/src/tests/approval-requests.test.ts +10 -7
  144. package/src/tests/approval-sweeps.test.ts +12 -6
  145. package/src/tests/base-prompt.test.ts +1 -1
  146. package/src/tests/claude-hook-output.test.ts +79 -1
  147. package/src/tests/claude-managed-adapter.test.ts +275 -0
  148. package/src/tests/codex-adapter.test.ts +163 -0
  149. package/src/tests/context-bound-note.test.ts +269 -0
  150. package/src/tests/extensions-pre-task.test.ts +273 -0
  151. package/src/tests/fetch-resolved-env.test.ts +17 -0
  152. package/src/tests/fixtures/extensions/record-blocks/hooks.ts +10 -0
  153. package/src/tests/fixtures/extensions/record-blocks/manifest.json +7 -0
  154. package/src/tests/fixtures/fake-amp.ts +22 -8
  155. package/src/tests/fixtures/held-template-render.ts +42 -0
  156. package/src/tests/fixtures/workflow-idempotency-trigger.child.ts +73 -0
  157. package/src/tests/openapi-route-headers.test.ts +2 -0
  158. package/src/tests/opencode-adapter.test.ts +134 -0
  159. package/src/tests/pi-mono-adapter.test.ts +105 -0
  160. package/src/tests/prompt-template-session.test.ts +4 -3
  161. package/src/tests/runner-push-delivery.test.ts +25 -0
  162. package/src/tests/runtime-controller-liveness.test.ts +133 -0
  163. package/src/tests/runtime-providers-docker.test.ts +2 -0
  164. package/src/tests/script-connections.test.ts +3 -0
  165. package/src/tests/script-run-config-scope.test.ts +91 -3
  166. package/src/tests/session-logs.test.ts +70 -0
  167. package/src/tests/sessions-tree.test.ts +37 -0
  168. package/src/tests/workflow-cascade-cancel.test.ts +1169 -0
  169. package/src/tests/workflow-foreach-supersede-retry.test.ts +488 -0
  170. package/src/tests/workflow-idempotency.test.ts +915 -0
  171. package/src/tools/workflows/cancel-workflow-run.ts +1 -1
  172. package/src/utils/context-window.ts +8 -6
  173. package/src/workflows/approval-cancel.ts +15 -13
  174. package/src/workflows/approval-notifications.ts +5 -1
  175. package/src/workflows/checkpoint.ts +6 -3
  176. package/src/workflows/engine.ts +30 -8
  177. package/src/workflows/executors/foreach.ts +2 -2
  178. package/src/workflows/foreach-driver.ts +10 -3
  179. package/src/workflows/foreach-join.ts +29 -6
  180. package/src/workflows/recovery.ts +6 -1
  181. package/src/workflows/resume.ts +168 -56
  182. package/src/workflows/retry-poller.ts +49 -3
  183. package/src/workflows/task-step-routing.ts +29 -7
  184. package/templates/ai-toolbox.manifest.json +8 -8
  185. package/templates/community/open-prompt-showreel/PLAYBOOK.md +5 -6
  186. package/templates/community/open-prompt-showreel/lead-prompt.md +1 -1
  187. package/templates/community/open-prompt-showreel/skills/open-prompt-showreel/SKILL.md +4 -4
  188. package/templates/skills/agent-browser/SKILL.md +4 -4
  189. package/templates/skills/agent-browser/content.md +4 -4
  190. package/templates/skills/code-quality/config.json +1 -1
  191. package/templates/skills/code-quality/content.md +2 -2
  192. package/templates/skills/delegate-work/content.md +29 -25
  193. package/templates/skills/delegate-work/files/scripts/codex-exec.sh +5 -5
  194. package/templates/skills/qa/content.md +2 -2
  195. package/templates/skills/researching/content.md +2 -0
  196. package/templates/skills/work-on-task/SKILL.md +1 -1
  197. package/templates/skills/work-on-task/content.md +1 -1
@@ -40,7 +40,7 @@ import {
40
40
  init_identity_field_budget,
41
41
  contentSha256,
42
42
  init_profile_sync
43
- } from "./cli-gpv60278.js";
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-0ebey9hg.js";
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-y561h5a9.js";
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-gfn30fb8.js");
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();
@@ -8026,7 +8048,7 @@ async function overwriteTerminalTaskResultText2(id, patch) {
8026
8048
  });
8027
8049
  return row ? rowToAgentTask(row) : task;
8028
8050
  }
8029
- async function cancelTask2(id, reason) {
8051
+ async function cancelTask2(id, reason, options = {}) {
8030
8052
  const oldTask = await getTaskById2(id);
8031
8053
  if (!oldTask)
8032
8054
  return null;
@@ -8077,10 +8099,12 @@ async function cancelTask2(id, reason) {
8077
8099
  } catch (error) {
8078
8100
  console.error("[cancelTask] pending steering promotion error:", scrubSecrets(error instanceof Error ? error.message : String(error)));
8079
8101
  }
8080
- try {
8081
- await dependencies3.cascadeFailDependents(id, "cancelled");
8082
- } catch (err) {
8083
- console.error("[cancelTask] cascade-fail dependents error:", err);
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
+ }
8084
8108
  }
8085
8109
  }
8086
8110
  return row ? rowToAgentTask(row) : null;
@@ -8361,18 +8385,257 @@ var init_write = __esm(() => {
8361
8385
  lastAffinityDispatchSkipLoggedAt = new Map;
8362
8386
  });
8363
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
+
8364
8469
  // src/be/db/workflow-runs.ts
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
+ }
8365
8614
  async function getChildWorkflowRunId(parentStepId, attempt) {
8366
8615
  const row = await getDbClient2().get("SELECT id FROM workflow_runs WHERE parentStepId = ? AND parentStepAttempt = ?", [parentStepId, attempt]);
8367
8616
  return row?.id ?? null;
8368
8617
  }
8369
8618
  async function isParentStepAttemptCurrent(parentStepId, attempt) {
8370
- const row = await getDbClient2().get(`SELECT 1 AS found
8619
+ const row = await getDbClient2().get(`SELECT r.id AS runId
8371
8620
  FROM workflow_run_steps s
8372
8621
  JOIN workflow_runs r ON r.id = s.runId
8373
8622
  WHERE s.id = ? AND s.status = 'running' AND s.retryCount = ?
8374
8623
  AND r.status IN ('running', 'waiting')`, [parentStepId, attempt]);
8375
- return row != null;
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);
8376
8639
  }
8377
8640
  async function getRunningSubWorkflowSteps() {
8378
8641
  return getDbClient2().query(`SELECT s.id AS stepId, s.runId AS runId, s.nodeId AS nodeId
@@ -8485,8 +8748,9 @@ async function createForeachAttemptSteps(runId, rows) {
8485
8748
  return created;
8486
8749
  });
8487
8750
  }
8488
- var TERMINAL_STATUSES;
8751
+ var TERMINAL_STATUSES, WORKFLOW_RUN_TREE_MAX_DEPTH = 32, WorkflowRunTreeError, WorkflowStepNotExecutableError, TREE_QUERY_CHUNK = 500;
8489
8752
  var init_workflow_runs = __esm(() => {
8753
+ init_types();
8490
8754
  init_secret_scrubber();
8491
8755
  init_scrub_json();
8492
8756
  init_runtime();
@@ -8496,6 +8760,18 @@ var init_workflow_runs = __esm(() => {
8496
8760
  "cancelled",
8497
8761
  "skipped"
8498
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
+ };
8499
8775
  });
8500
8776
 
8501
8777
  // src/integrations/chat-sdk/schema.ts
@@ -9298,6 +9574,7 @@ var init_swarm_config_guard = __esm(() => {
9298
9574
  ...boundedIntegerValidators(["CHAT_SDK_BUFFER_MS"], 1, 600000),
9299
9575
  ...boundedIntegerValidators(["CHAT_SDK_OWNER_WINDOW_MIN"], 0, 1440),
9300
9576
  ...boundedIntegerValidators(["CONTEXT_PREAMBLE_MAX_TOKENS"], 100, 20000),
9577
+ ...boundedIntegerValidators(["CONTEXT_BOUND_NOTE_TOKENS"], 0, 1e7),
9301
9578
  MEMORY_MIN_SIMILARITY: (value) => validateFloatRange("MEMORY_MIN_SIMILARITY", value, 0, 1, "between 0 and 1 inclusive"),
9302
9579
  MEMORY_ACCESS_BOOST_MAX: (value) => validateFloatRange("MEMORY_ACCESS_BOOST_MAX", value, 1, Number.POSITIVE_INFINITY, "a number >= 1")
9303
9580
  };
@@ -19887,7 +20164,7 @@ async function loadSecretRegistry() {
19887
20164
  result.failed += 1;
19888
20165
  }
19889
20166
  try {
19890
- const { loadRuntimeControllerSecrets } = await import("./db-a4m7haw0.js");
20167
+ const { loadRuntimeControllerSecrets } = await import("./db-47vj40dy.js");
19891
20168
  const loaded = await loadRuntimeControllerSecrets();
19892
20169
  result.runtimeController = loaded.count;
19893
20170
  result.failed += loaded.failed;
@@ -22071,6 +22348,11 @@ async function createTaskExtended2(task, options) {
22071
22348
  const auditUserId = getCurrentRequestUserId() ?? null;
22072
22349
  const assetKey = normalizeAssetKey(options?.key ?? defaultAssetKey("task", id));
22073
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
+ }
22074
22356
  const existingTrackerWork = options?.bypassTrackerContextDedup ? null : await findExistingLinearTrackerContextWork2(options?.contextKey);
22075
22357
  if (existingTrackerWork)
22076
22358
  return { existing: existingTrackerWork };
@@ -23201,10 +23483,13 @@ async function createSessionLogs2(logs) {
23201
23483
  const line = logs.lines[i];
23202
23484
  if (line === undefined)
23203
23485
  continue;
23204
- batch.push({ content: scrubSecrets(line), lineNumber: i });
23486
+ batch.push(scrubSecrets(line));
23205
23487
  }
23206
23488
  await getDbClient2().transaction(async (tx) => {
23207
- for (const { content, lineNumber } of batch) {
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) {
23208
23493
  await tx.run(`INSERT INTO session_logs (id, taskId, sessionId, iteration, cli, content, lineNumber, createdAt)
23209
23494
  VALUES (?, ?, ?, ?, ?, ?, ?, strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))`, [
23210
23495
  crypto.randomUUID(),
@@ -23213,7 +23498,7 @@ async function createSessionLogs2(logs) {
23213
23498
  logs.iteration,
23214
23499
  logs.cli,
23215
23500
  content,
23216
- lineNumber
23501
+ lineNumber++
23217
23502
  ]);
23218
23503
  }
23219
23504
  });
@@ -23222,17 +23507,17 @@ async function createSessionLogs2(logs) {
23222
23507
  async function getSessionLogsByTaskId2(taskId, limit) {
23223
23508
  if (typeof limit === "number" && limit > 0) {
23224
23509
  const rows = await getDbClient2().query(`SELECT * FROM (
23225
- SELECT * FROM session_logs WHERE taskId = ?
23226
- ORDER BY iteration DESC, lineNumber DESC
23510
+ SELECT rowid AS seq, * FROM session_logs WHERE taskId = ?
23511
+ ORDER BY rowid DESC
23227
23512
  LIMIT ?
23228
- ) ORDER BY iteration ASC, lineNumber ASC`, [taskId, limit]);
23513
+ ) ORDER BY seq ASC`, [taskId, limit]);
23229
23514
  return rows.map(rowToSessionLog);
23230
23515
  }
23231
- const rows = await getDbClient2().query("SELECT * FROM session_logs WHERE taskId = ? ORDER BY iteration ASC, lineNumber ASC", [taskId]);
23516
+ const rows = await getDbClient2().query("SELECT * FROM session_logs WHERE taskId = ? ORDER BY rowid ASC", [taskId]);
23232
23517
  return rows.map(rowToSessionLog);
23233
23518
  }
23234
23519
  async function getSessionLogsBySession2(sessionId, iteration) {
23235
- const rows = await getDbClient2().query("SELECT * FROM session_logs WHERE sessionId = ? AND iteration = ? ORDER BY lineNumber ASC", [sessionId, iteration]);
23520
+ const rows = await getDbClient2().query("SELECT * FROM session_logs WHERE sessionId = ? AND iteration = ? ORDER BY rowid ASC", [sessionId, iteration]);
23236
23521
  return rows.map(rowToSessionLog);
23237
23522
  }
23238
23523
  function rowToSessionCost(row) {
@@ -24797,6 +25082,7 @@ async function deleteWorkflowRows(id, source) {
24797
25082
  await client.run("DELETE FROM workflow_runs WHERE workflowId = ?", [id]);
24798
25083
  await reclassifyTaskHumanFree(linkedTaskIds);
24799
25084
  await client.run("DELETE FROM user_favorites WHERE itemType = 'workflow' AND itemId = ?", [id]);
25085
+ await tombstoneWorkflowIdempotencyKeys(id);
24800
25086
  const result = await client.run("DELETE FROM workflows WHERE id = ?", [id]);
24801
25087
  const deleted = result.changes > 0;
24802
25088
  if (deleted) {
@@ -25752,15 +26038,22 @@ async function createApprovalRequest2(data) {
25752
26038
  const row = await getDbClient2().transaction(async () => {
25753
26039
  let status = "pending";
25754
26040
  let resolutionReason = null;
25755
- if (data.requireActionableWorkflow && data.workflowRunId && data.workflowRunStepId) {
25756
- const run = await getWorkflowRun2(data.workflowRunId);
25757
- const step = await getWorkflowRunStep2(data.workflowRunStepId);
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;
25758
26045
  if (!run || run.status !== "running" && run.status !== "waiting") {
25759
26046
  status = "cancelled";
25760
26047
  resolutionReason = run?.error ?? `Workflow run is ${run?.status ?? "missing"}`;
25761
- } else if (!step || step.runId !== run.id || step.status !== "running") {
26048
+ } else if (step !== undefined && (!step || step.runId !== run.id || step.status !== "running")) {
25762
26049
  status = "cancelled";
25763
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
+ }
25764
26057
  }
25765
26058
  }
25766
26059
  return getDbClient2().get(`INSERT INTO approval_requests
@@ -27517,7 +27810,9 @@ async function getRootTaskChain2(rootTaskId) {
27517
27810
  SELECT t.id FROM agent_tasks t
27518
27811
  JOIN chain c ON t.parentTaskId = c.id
27519
27812
  )
27520
- SELECT t.* FROM chain
27813
+ SELECT t.*,
27814
+ (SELECT SUM(totalCostUsd) FROM session_costs WHERE session_costs.taskId = t.id) AS totalCostUsd
27815
+ FROM chain
27521
27816
  CROSS JOIN agent_tasks t ON t.id = chain.id
27522
27817
  ORDER BY t.createdAt, t.rowid`, [rootTaskId]);
27523
27818
  return rows.map(rowToAgentTask);
@@ -28283,6 +28578,7 @@ var init_db3 = __esm(() => {
28283
28578
  init_human_free();
28284
28579
  init_read();
28285
28580
  init_write();
28581
+ init_workflow_idempotency();
28286
28582
  init_workflow_runs();
28287
28583
  init_scrub_json();
28288
28584
  init_sealed_json();
@@ -28357,4 +28653,4 @@ var init_db3 = __esm(() => {
28357
28653
  };
28358
28654
  });
28359
28655
 
28360
- 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, 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 };
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 };
@@ -2,17 +2,17 @@ import {
2
2
  getKv2,
3
3
  upsertKv2,
4
4
  init_db3
5
- } from "./cli-kxawjrxg.js";
5
+ } from "./cli-jb30dzvk.js";
6
6
  import {
7
7
  resolveIdentity,
8
8
  recordUnmappedIdentity
9
- } from "./cli-aecdcr77.js";
9
+ } from "./cli-asq5ydm4.js";
10
10
  import {
11
11
  findUserByExternalId,
12
12
  findOrCreateUserByEmail,
13
13
  linkIdentity,
14
14
  init_users
15
- } from "./cli-e8jyq7d8.js";
15
+ } from "./cli-6a1xg1p7.js";
16
16
 
17
17
  // src/slack/enrich.ts
18
18
  init_db3();