@desplega.ai/agent-swarm 2.12.0 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (327) hide show
  1. package/dist/acp-adapter-cn53011z.js +17 -0
  2. package/dist/{acp-targets-311gcyvw.js → acp-targets-86f0sh6g.js} +9 -8
  3. package/dist/{actions-c4chgxp6.js → actions-zv8vcxvr.js} +24 -23
  4. package/dist/{agent-fs-provision-0b9awm5n.js → agent-fs-provision-jqshb33y.js} +4 -4
  5. package/dist/{amp-adapter-r0veq6x5.js → amp-adapter-gt503ywc.js} +2 -2
  6. package/dist/{app-hn5fftf5.js → app-6t4k5rh1.js} +6 -4
  7. package/dist/{approval-notifications-3g6yc8nv.js → approval-notifications-fcfw063h.js} +7 -6
  8. package/dist/{assistant-cpjgpjvp.js → assistant-9dzybh12.js} +25 -24
  9. package/dist/{boot-args-schema-hce1av1h.js → boot-args-schema-xzfp2feg.js} +1 -1
  10. package/dist/{boot-reembed-d7xcym0j.js → boot-reembed-3jz0p2jk.js} +1 -1
  11. package/dist/{boot-reembed-bztbxc4z.js → boot-reembed-r88wngfg.js} +5 -2
  12. package/dist/{boot-scrub-sweep-mkmm16gk.js → boot-scrub-sweep-scrqhw48.js} +2 -2
  13. package/dist/{boot-seeds-arrkbe8t.js → boot-seeds-vb2dcrrb.js} +4 -4
  14. package/dist/{claude-adapter-ykpyr5p8.js → claude-adapter-h3mp9hgs.js} +7 -6
  15. package/dist/{claude-managed-adapter-ssg6z4bt.js → claude-managed-adapter-kpbyj2vb.js} +3 -3
  16. package/dist/{claude-managed-setup-trd59v7b.js → claude-managed-setup-0efr3wkg.js} +5 -5
  17. package/dist/{claude-sdk-session-yjcze0j1.js → claude-sdk-session-03dw669q.js} +7 -6
  18. package/dist/{cli-e3ahxq5y.js → cli-0b655smz.js} +4 -4
  19. package/dist/{cli-mcymtvwn.js → cli-0dg7ytxm.js} +89 -11
  20. package/dist/cli-0jkenasr.js +148 -0
  21. package/dist/{cli-c7j31hq9.js → cli-0pazkmd4.js} +3 -3
  22. package/dist/{cli-5tg94mdw.js → cli-117g15t4.js} +8 -11
  23. package/dist/{cli-r14ac1y0.js → cli-1dbv9mj9.js} +1 -1
  24. package/dist/{cli-q8tc22bj.js → cli-1v82d2w6.js} +3 -3
  25. package/dist/{cli-pe3yxedk.js → cli-2jk4s7z1.js} +2 -2
  26. package/dist/{cli-0pp1yjg2.js → cli-2skf1mdf.js} +8 -8
  27. package/dist/{cli-2tw284hj.js → cli-48nvk6sb.js} +1 -1
  28. package/dist/{cli-en6dmkxd.js → cli-49f5jyhh.js} +2 -2
  29. package/dist/{cli-2z2c4k6q.js → cli-50w82h6m.js} +21 -0
  30. package/dist/{cli-dd2k2mcd.js → cli-6a40p4kv.js} +1 -1
  31. package/dist/{cli-yegz2g06.js → cli-6h88mn9q.js} +3 -3
  32. package/dist/{cli-52nfye5j.js → cli-7dbhnsj9.js} +23 -15
  33. package/dist/{cli-04zc3f7b.js → cli-9fsagra4.js} +1 -1
  34. package/dist/{cli-nja15knq.js → cli-9m9kyw77.js} +3 -3
  35. package/dist/{cli-k5jx8jya.js → cli-ajjvqhf3.js} +1 -1
  36. package/dist/{cli-hbvgzjq4.js → cli-avqkr20b.js} +2 -2
  37. package/dist/{cli-yfpc6qy9.js → cli-avxh26pd.js} +46 -15
  38. package/dist/{cli-q2dywc8h.js → cli-b2jh3dyb.js} +4 -4
  39. package/dist/{cli-m5qtmrbc.js → cli-c8v2yvej.js} +2 -2
  40. package/dist/{cli-gfy6hbd9.js → cli-ct8sz3np.js} +17 -10
  41. package/dist/{cli-bz97ff9n.js → cli-dka73bak.js} +1 -1
  42. package/dist/{cli-dkvtfgn4.js → cli-dkejt425.js} +75 -16
  43. package/dist/{cli-sv2r3bw8.js → cli-dnh64e8e.js} +2 -2
  44. package/dist/{cli-kwr5qv5g.js → cli-eb279wn3.js} +2 -2
  45. package/dist/{cli-hhc47ack.js → cli-f1952kjy.js} +2 -2
  46. package/dist/{cli-5z0g0e8v.js → cli-f8rcvf2x.js} +49 -13
  47. package/dist/{cli-eq4kew31.js → cli-fhvk2nvp.js} +24 -11
  48. package/dist/{cli-xf4z5bdn.js → cli-fz9pcjsw.js} +2 -2
  49. package/dist/{cli-fxd1mwtr.js → cli-g6j6ac3h.js} +1 -1
  50. package/dist/{cli-ya3kf4gs.js → cli-gfcv679k.js} +1 -1
  51. package/dist/{cli-55tc8cj4.js → cli-hbq0kwxz.js} +4 -4
  52. package/dist/{cli-39qm0rtm.js → cli-hc6e4tac.js} +28 -149
  53. package/dist/{cli-j5gtytvg.js → cli-hgsxnjyg.js} +13 -10
  54. package/dist/{cli-h70a2mxy.js → cli-hpb9x72z.js} +48 -8
  55. package/dist/{cli-7yn42w6m.js → cli-j53hpbsm.js} +1 -1
  56. package/dist/{cli-12vek61e.js → cli-jj3c5nyb.js} +471 -119
  57. package/dist/{cli-fy4gb74g.js → cli-kde4ky90.js} +1 -1
  58. package/dist/{cli-9qe5y107.js → cli-kspxjftk.js} +1 -1
  59. package/dist/{cli-bp6k9acz.js → cli-mh7pdxe0.js} +16 -16
  60. package/dist/{cli-v9ya390t.js → cli-mz34pxbk.js} +8 -8
  61. package/dist/{cli-ma9ys8rt.js → cli-nc6a8b5b.js} +7 -4
  62. package/dist/{cli-1htmtqc2.js → cli-prf7kz78.js} +49 -49
  63. package/dist/{cli-01tvvtad.js → cli-qec9bynj.js} +3 -3
  64. package/dist/{cli-t75xngj1.js → cli-qhhb30e8.js} +7 -7
  65. package/dist/{cli-73q4g5nx.js → cli-qm3ntjqs.js} +12 -12
  66. package/dist/{cli-tm60vtax.js → cli-rfejbpe1.js} +1 -1
  67. package/dist/{cli-agjbj5x0.js → cli-sdh61g52.js} +37 -19
  68. package/dist/{cli-9y4tgrkf.js → cli-skd2c4ej.js} +2 -1
  69. package/dist/{cli-5x03v6en.js → cli-sq913bh1.js} +8 -8
  70. package/dist/{cli-b93d81yg.js → cli-t35hx078.js} +1 -1
  71. package/dist/{cli-r0mz92by.js → cli-tn91wc6e.js} +1 -1
  72. package/dist/{cli-wvjqaqcp.js → cli-tstj6e8e.js} +1113 -227
  73. package/dist/{cli-xm34qj8m.js → cli-w14j2z4k.js} +2 -2
  74. package/dist/{cli-eqq0hwvx.js → cli-wndegmns.js} +1 -1
  75. package/dist/{cli-0k1a0sde.js → cli-wrhbym01.js} +6 -6
  76. package/dist/{cli-fyaq4zdv.js → cli-wv20kbr3.js} +6 -6
  77. package/dist/{cli-mq2fbgva.js → cli-wxwv3t11.js} +2 -2
  78. package/dist/{cli-krbcr00p.js → cli-xfjn2kyq.js} +58 -4
  79. package/dist/{cli-5r95eqbh.js → cli-y260hgep.js} +1 -1
  80. package/dist/{cli-cjqyse9q.js → cli-y4a4458j.js} +3 -3
  81. package/dist/{cli-2amwhyv2.js → cli-y518qkjg.js} +5 -3
  82. package/dist/{cli-0vcqcwfn.js → cli-yfvhvw8m.js} +2 -0
  83. package/dist/cli-yn4kt85g.js +148 -0
  84. package/dist/{cli-n8f0fs3c.js → cli-ytc7fpza.js} +8 -8
  85. package/dist/{cli-e8n0hdzd.js → cli-z64t9pe6.js} +1 -1
  86. package/dist/{cli-72yms3ey.js → cli-zqmmy073.js} +198 -18
  87. package/dist/cli.js +18 -16
  88. package/dist/{codex-adapter-wc6e4wct.js → codex-adapter-f3yp0kaj.js} +5 -5
  89. package/dist/{codex-hook-aqtj17yr.js → codex-hook-262cekfp.js} +73 -2
  90. package/dist/{codex-session-runner-ppfgjd97.js → codex-session-runner-ns4mv70p.js} +5 -5
  91. package/dist/{commands-tsv2vx5b.js → commands-5bzf2tfw.js} +3 -3
  92. package/dist/{controller-ye4sdwsy.js → controller-5xt7kvfm.js} +2 -2
  93. package/dist/{controllers-connect-zn4dg69h.js → controllers-connect-0gg13mzp.js} +24 -23
  94. package/dist/core-0fqtbrxa.js +42 -0
  95. package/dist/{cursor-adapter-q2g9vwts.js → cursor-adapter-p0c5zv6r.js} +1 -1
  96. package/dist/{db-g111qn9j.js → db-2s68ycq7.js} +3 -3
  97. package/dist/{db-3r1fyr2n.js → db-q7q639k5.js} +4 -2
  98. package/dist/{dispatcher-4q8s0mx8.js → dispatcher-j2y1q7ae.js} +24 -21
  99. package/dist/{dsh-adapter-mmcw1z5s.js → dsh-adapter-pgnkf4st.js} +1 -1
  100. package/dist/{easter-egg-3d-04ke6hcp.js → easter-egg-3d-0kea97jf.js} +1 -1
  101. package/dist/{embedding-space-kcdn52vz.js → embedding-space-3n6mhhmy.js} +6 -6
  102. package/dist/{embeddings-jnzcd91a.js → embeddings-jfmj6yme.js} +1 -1
  103. package/dist/{execute-74amghty.js → execute-tjrej979.js} +1 -1
  104. package/dist/{external-channel-v9zgxnxz.js → external-channel-jy8w2gg3.js} +2 -2
  105. package/dist/fx-adapter-k6w3jvz9.js +20 -0
  106. package/dist/grok-adapter-4q5tssw0.js +20 -0
  107. package/dist/handlers-qxgfvvsf.js +41 -0
  108. package/dist/{heartbeat-p8pk1msj.js → heartbeat-6tr2w2da.js} +25 -24
  109. package/dist/{hook-p5reemds.js → hook-bpnncsec.js} +76 -17
  110. package/dist/{hook-k1h73zd7.js → hook-fv1jwrv7.js} +6 -5
  111. package/dist/{http-ms1z5xxy.js → http-bpa26czn.js} +785 -181
  112. package/dist/index-0mcxjdsa.js +44 -0
  113. package/dist/{index-kn63q1gr.js → index-52tgbhrw.js} +29 -28
  114. package/dist/index-dz4q23ag.js +40 -0
  115. package/dist/{index-76zzxtzf.js → index-mpj0z9e0.js} +1 -1
  116. package/dist/index-s175jckx.js +39 -0
  117. package/dist/{index-gjn6qfgn.js → index-s8re7mvq.js} +1 -1
  118. package/dist/{index-fbkqhvvj.js → index-w216g9y9.js} +198 -160
  119. package/dist/{keepalive-031js8jz.js → keepalive-d6z12s04.js} +3 -3
  120. package/dist/lead-p3hx7h35.js +79 -0
  121. package/dist/{maintenance-sq9v3qx9.js → maintenance-7kac6g2g.js} +1 -1
  122. package/dist/{oauth-refresh-sweep-zqmnyvs8.js → oauth-refresh-sweep-t1xjetbh.js} +2 -2
  123. package/dist/{object-webhooks-r24wwb5y.js → object-webhooks-6rdagg0r.js} +7 -7
  124. package/dist/{onboard-p25yhh7t.js → onboard-32y1cfxy.js} +3 -3
  125. package/dist/{opencode-adapter-wcjc4zdk.js → opencode-adapter-enp3v31n.js} +7 -6
  126. package/dist/{otel-impl-ff1gf20m.js → otel-impl-k0tm5ptj.js} +1 -1
  127. package/dist/{pending-hxj5yatb.js → pending-24zebgvs.js} +23 -22
  128. package/dist/{pi-mono-adapter-vkp4zz7p.js → pi-mono-adapter-yj72xxxe.js} +85 -16
  129. package/dist/{pricing-refresh-9w7gx41w.js → pricing-refresh-cf25x38j.js} +2 -2
  130. package/dist/{rbac-roles-84aw10nz.js → rbac-roles-0wydd22m.js} +3 -3
  131. package/dist/{rbac-roles-hz74vckp.js → rbac-roles-at6crb3r.js} +7 -4
  132. package/dist/{registry-eeyx1201.js → registry-zv0zvxsx.js} +1 -1
  133. package/dist/{render-v2-nrdkg9gf.js → render-v2-nvcw0jd7.js} +8 -4
  134. package/dist/{resume-s6ey36rh.js → resume-y4w0k5v3.js} +9 -8
  135. package/dist/{runtime-x0b4pyam.js → runtime-vpe43hx0.js} +1 -1
  136. package/dist/{session-access-xv49tk14.js → session-access-gkyvnfye.js} +5 -4
  137. package/dist/{session-source-backfill-r5j988ah.js → session-source-backfill-3w2st4m2.js} +2 -2
  138. package/dist/{setup-mj0krk1p.js → setup-axxvqtys.js} +1 -1
  139. package/dist/thread-buffer-rwa7d4dx.js +42 -0
  140. package/dist/{tree-visibility-cbrsfaar.js → tree-visibility-y4fqvab5.js} +2 -2
  141. package/dist/{user-merge-jobs-f9d8nwnw.js → user-merge-jobs-kcmwvrc6.js} +3 -3
  142. package/dist/{virtual-modules-ns0ryw05.js → virtual-modules-7d92dct1.js} +3 -3
  143. package/dist/{work-objects-pydhzast.js → work-objects-f708e069.js} +27 -25
  144. package/dist/worker-8rg9gz74.js +79 -0
  145. package/dist/{worker-follow-up-9z2xec5e.js → worker-follow-up-0by8wztc.js} +22 -21
  146. package/dist/xlsx-9acfmxr1.js +31534 -0
  147. package/openapi.json +1385 -204
  148. package/package.json +5 -3
  149. package/src/agentmail/handlers.ts +26 -19
  150. package/src/apps/catalog.generated.json +31 -0
  151. package/src/apps/row-store.ts +37 -14
  152. package/src/azure-devops/handlers.ts +2 -0
  153. package/src/be/audit-user.ts +46 -6
  154. package/src/be/db/kv-windows.ts +22 -0
  155. package/src/be/db/session-moves.ts +3 -3
  156. package/src/be/db/session-tree.ts +52 -5
  157. package/src/be/db/skill-audit.ts +17 -0
  158. package/src/be/db/tasks/write.ts +18 -3
  159. package/src/be/db.ts +114 -23
  160. package/src/be/extensions/assets.ts +11 -7
  161. package/src/be/memory/demotion-evidence.ts +2 -2
  162. package/src/be/memory/providers/sqlite-store.ts +151 -18
  163. package/src/be/memory/search-read-worker.ts +60 -0
  164. package/src/be/memory/search-reader.ts +223 -0
  165. package/src/be/migrations/337_favorites_session_hidden_key.sql +39 -0
  166. package/src/be/migrations/338_audit_agent_columns.sql +30 -0
  167. package/src/be/migrations/339_deferred_event_waits.sql +26 -0
  168. package/src/be/model-tier-resolution.ts +18 -1
  169. package/src/be/multi-runtime.ts +17 -0
  170. package/src/be/primitives/object-embed.ts +250 -0
  171. package/src/be/primitives/objects.ts +29 -9
  172. package/src/be/primitives/sheets/service.ts +138 -6
  173. package/src/be/primitives/sheets/xlsx.ts +367 -0
  174. package/src/be/rbac-roles.ts +3 -0
  175. package/src/be/repo-checked-update.ts +4 -4
  176. package/src/be/repo-merge-policy.ts +26 -9
  177. package/src/be/scripts/boot-reembed.ts +6 -0
  178. package/src/be/scripts/db.ts +17 -5
  179. package/src/be/scripts/embeddings.ts +6 -0
  180. package/src/be/scripts/typecheck.ts +43 -2
  181. package/src/be/seed/schedules-seeder.ts +9 -1
  182. package/src/be/seed/workflows-seeder.ts +9 -1
  183. package/src/be/seed-scripts/index.ts +2 -0
  184. package/src/be/seed-skills/index.ts +12 -0
  185. package/src/be/swarm-config-guard.ts +1 -0
  186. package/src/be/unmapped-identities.ts +95 -1
  187. package/src/bitbucket/handlers.ts +2 -0
  188. package/src/commands/onboard/agent-fs-version.ts +1 -1
  189. package/src/event-waits/github.ts +43 -0
  190. package/src/event-waits/index.ts +29 -0
  191. package/src/event-waits/types.ts +51 -0
  192. package/src/extensions/contract-types.generated.ts +1 -1
  193. package/src/extensions/dispatcher.ts +9 -0
  194. package/src/fs/agent-fs-provider.ts +4 -1
  195. package/src/github/handlers.ts +3 -1
  196. package/src/github/pull-request-state.ts +34 -0
  197. package/src/gitlab/handlers.ts +12 -7
  198. package/src/hooks/codex-hook.ts +99 -1
  199. package/src/hooks/hook.ts +85 -11
  200. package/src/hooks/native-tool-hooks.ts +245 -0
  201. package/src/http/all-routes.ts +1 -0
  202. package/src/http/assets.ts +4 -3
  203. package/src/http/comb.ts +2 -2
  204. package/src/http/favorite-owner.ts +2 -2
  205. package/src/http/favorites.ts +3 -2
  206. package/src/http/fs.ts +13 -4
  207. package/src/http/index.ts +2 -0
  208. package/src/http/mcp-bridge.ts +4 -0
  209. package/src/http/objects.ts +265 -0
  210. package/src/http/pages.ts +3 -3
  211. package/src/http/poll.ts +43 -12
  212. package/src/http/repos.ts +7 -6
  213. package/src/http/schedules.ts +10 -6
  214. package/src/http/script-connections.ts +2 -2
  215. package/src/http/scripts.ts +9 -0
  216. package/src/http/sessions.ts +30 -12
  217. package/src/http/skills.ts +17 -0
  218. package/src/http/task-requester.ts +2 -2
  219. package/src/http/tasks.ts +13 -3
  220. package/src/http/tool-hooks.ts +24 -2
  221. package/src/http/trackers/authorize-gate.ts +2 -2
  222. package/src/http/users.ts +136 -1
  223. package/src/http/workflow-events.ts +13 -0
  224. package/src/http/workflows.ts +21 -11
  225. package/src/linear/sync.ts +3 -1
  226. package/src/prompts/base-prompt.ts +35 -13
  227. package/src/prompts/session-templates.ts +25 -0
  228. package/src/providers/acp-targets.ts +1 -1
  229. package/src/providers/amp-adapter.ts +1 -1
  230. package/src/providers/dsh-adapter.ts +1 -1
  231. package/src/providers/opencode-adapter.ts +1 -0
  232. package/src/providers/opencode-swarm-plugin.ts +50 -1
  233. package/src/providers/pi-mono-adapter.ts +139 -9
  234. package/src/providers/pi-mono-extension.ts +69 -0
  235. package/src/providers/runtime-dependencies.ts +1 -1
  236. package/src/rbac/legacy-policy.ts +3 -0
  237. package/src/rbac/permissions.ts +11 -1
  238. package/src/scheduler/deferred-task-waits.ts +170 -13
  239. package/src/scripts-runtime/executors/types.ts +5 -0
  240. package/src/scripts-runtime/loader.ts +8 -0
  241. package/src/scripts-runtime/mcp-client.ts +4 -0
  242. package/src/scripts-runtime/sdk-allowlist.ts +14 -1
  243. package/src/scripts-runtime/swarm-config.ts +8 -0
  244. package/src/scripts-runtime/swarm-sdk.ts +4 -0
  245. package/src/scripts-runtime/types/stdlib.d.ts +47 -4
  246. package/src/scripts-runtime/types/swarm-extension.d.ts +1 -0
  247. package/src/scripts-runtime/types/swarm-sdk.d.ts +47 -4
  248. package/src/server.ts +4 -0
  249. package/src/slack/enrich.ts +81 -21
  250. package/src/slack/handlers.test.ts +55 -2
  251. package/src/slack/handlers.ts +38 -3
  252. package/src/slack/render-v2.ts +19 -0
  253. package/src/slack/session-mirror.ts +208 -0
  254. package/src/slack/thread-participants.ts +0 -5
  255. package/src/slack/watcher.ts +3 -0
  256. package/src/slack/work-objects.test.ts +2 -1
  257. package/src/slack/work-objects.ts +7 -2
  258. package/src/tests/agentmail-filters.test.ts +4 -3
  259. package/src/tests/audit-agent-person.test.ts +825 -0
  260. package/src/tests/audit-updated-by.test.ts +19 -12
  261. package/src/tests/claude-hook-output.test.ts +107 -2
  262. package/src/tests/claude-managed-setup.test.ts +1 -1
  263. package/src/tests/codex-adapter.test.ts +6 -6
  264. package/src/tests/codex-gpt6-release.test.ts +4 -4
  265. package/src/tests/db-task-read-contract.test.ts +1 -0
  266. package/src/tests/db-task-write-contract.test.ts +1 -0
  267. package/src/tests/dsh-adapter.test.ts +1 -1
  268. package/src/tests/extensions-catalog.test.ts +33 -25
  269. package/src/tests/fixtures/sheets/eocd-count-mismatch.xlsx +0 -0
  270. package/src/tests/fixtures/sheets/rich-budget.xlsx +0 -0
  271. package/src/tests/fixtures/sheets/tracker-export.xlsx +0 -0
  272. package/src/tests/kv-storage.test.ts +3 -0
  273. package/src/tests/memory-search-reader.test.ts +258 -0
  274. package/src/tests/memory-search-stall.test.ts +197 -20
  275. package/src/tests/model-control.test.ts +4 -4
  276. package/src/tests/model-tier-resolution.test.ts +2 -2
  277. package/src/tests/multi-runtime-registration.test.ts +8 -2
  278. package/src/tests/native-tool-hooks.test.ts +188 -0
  279. package/src/tests/opencode-swarm-plugin.test.ts +6 -1
  280. package/src/tests/pi-provider-runtime-keys.test.ts +163 -0
  281. package/src/tests/poll-probe-readonly.test.ts +108 -0
  282. package/src/tests/primitives-sheets-xlsx.test.ts +549 -0
  283. package/src/tests/prompt-template-session.test.ts +3 -2
  284. package/src/tests/rbac-roles.test.ts +3 -0
  285. package/src/tests/script-connections.test.ts +4 -0
  286. package/src/tests/seed-model-profiles.test.ts +1 -1
  287. package/src/tests/sessions-tree.test.ts +10 -2
  288. package/src/tests/slack-thread-participants.test.ts +66 -4
  289. package/src/tests/tool-registrar-no-input.test.ts +1 -0
  290. package/src/tools/defer-task.ts +154 -12
  291. package/src/tools/objects.ts +10 -5
  292. package/src/tools/repos/update-repo.ts +6 -6
  293. package/src/tools/schedules/create-schedule.ts +1 -0
  294. package/src/tools/schedules/list-schedules.ts +3 -0
  295. package/src/tools/schedules/patch-schedule.ts +12 -3
  296. package/src/tools/schedules/update-schedule.ts +12 -3
  297. package/src/tools/sheets.ts +66 -0
  298. package/src/tools/skills/skill-create.ts +6 -0
  299. package/src/tools/skills/skill-install-remote.ts +6 -0
  300. package/src/tools/skills/skill-sync-remote.ts +9 -0
  301. package/src/tools/skills/skill-update.ts +9 -1
  302. package/src/tools/tool-config.ts +3 -1
  303. package/src/tools/utils.ts +15 -0
  304. package/src/tools/workflows/create-workflow.ts +9 -4
  305. package/src/tools/workflows/patch-workflow-node.ts +1 -1
  306. package/src/tools/workflows/patch-workflow.ts +5 -2
  307. package/src/tools/workflows/update-workflow.ts +13 -7
  308. package/src/types.ts +96 -12
  309. package/src/workflows/input.ts +12 -5
  310. package/src/workflows/patch-definition.ts +13 -5
  311. package/src/workflows/triggers.ts +11 -6
  312. package/src/workflows/version.ts +7 -1
  313. package/templates/skills/boards-and-sheets/config.json +14 -0
  314. package/templates/skills/boards-and-sheets/content.md +163 -0
  315. package/templates/skills/swarm-docs/content.md +9 -0
  316. package/dist/acp-adapter-11m13kx4.js +0 -16
  317. package/dist/core-dxcy02sc.js +0 -41
  318. package/dist/fx-adapter-0ar6pqm3.js +0 -19
  319. package/dist/grok-adapter-t6m74fb1.js +0 -19
  320. package/dist/handlers-9kwcrc4k.js +0 -38
  321. package/dist/index-23cdfzr6.js +0 -39
  322. package/dist/index-g7kkjs5b.js +0 -38
  323. package/dist/index-stk36pa5.js +0 -43
  324. package/dist/lead-mfggjtfk.js +0 -77
  325. package/dist/thread-buffer-temgaqsy.js +0 -41
  326. package/dist/worker-efcemc22.js +0 -77
  327. /package/dist/{cli-cah298e5.js → cli-m4ejz4nj.js} +0 -0
@@ -1,3 +1,7 @@
1
+ import {
2
+ ALL_TOOLS,
3
+ init_tool_config
4
+ } from "./cli-yfvhvw8m.js";
1
5
  import {
2
6
  assertProviderQuotaCapacity,
3
7
  parseProviderAccount,
@@ -5,6 +9,13 @@ import {
5
9
  scrubProviderQuotaReport,
6
10
  init_provider_account_telemetry
7
11
  } from "./cli-7wy8gbwb.js";
12
+ import {
13
+ CODEX_AUTH_FAILURE_BENCH_THRESHOLD,
14
+ CODEX_AUTH_FAILURE_BENCH_MS,
15
+ CODEX_AUTH_WATCH_NAMESPACE,
16
+ codexAuthBenchMarkerKey,
17
+ init_codex_auth_failure
18
+ } from "./cli-fw2w0kva.js";
8
19
  import {
9
20
  resolveGitHubHost,
10
21
  getGitHubLinkConfig,
@@ -16,56 +27,7 @@ import {
16
27
  ampPinCatalogError,
17
28
  ampModelError,
18
29
  init_amp_models
19
- } from "./cli-tm60vtax.js";
20
- import {
21
- normalizeAssetKey,
22
- defaultAssetKey,
23
- keyPrefixRange,
24
- SESSION_RESOURCE_KINDS,
25
- SESSION_LEAF_KINDS,
26
- NO_GROUP_LEAF_KINDS,
27
- isGroupKey,
28
- isResourceGroupPrefix,
29
- sessionResourceGroupOf,
30
- sessionGroupKey,
31
- parseAssetKey,
32
- isCanonicalAssetKey,
33
- init_key,
34
- MODEL_TIERS,
35
- ReasoningEffortSchema,
36
- DEFAULT_MODEL_TIER_MAP,
37
- parseModelTier,
38
- TERMINAL_TASK_STATUSES,
39
- isTerminalTaskStatus,
40
- OPEN_TASK_STATUSES,
41
- ProviderNameSchema,
42
- ModelProfileCredentialsSchema,
43
- FallbackHopSchema,
44
- PROVIDER_STEER_CAPABILITIES,
45
- FollowUpConfigSchema,
46
- RoutingAffinitySchema,
47
- TaskSlackParticipantsSchema,
48
- CreateTaskOptionsSchema,
49
- SERVER_GENERATED_ATTACHMENT_CAPABILITY,
50
- AgentAvatarSchema,
51
- AgentSlackIconSchema,
52
- VersionableFieldSchema,
53
- SessionCostModelBreakdownSchema,
54
- SUPERSEDED_WORKFLOW_TASK_REASON,
55
- PageThemeTokensSchema,
56
- init_types5
57
- } from "./cli-5z0g0e8v.js";
58
- import {
59
- ALL_TOOLS,
60
- init_tool_config
61
- } from "./cli-0vcqcwfn.js";
62
- import {
63
- CODEX_AUTH_FAILURE_BENCH_THRESHOLD,
64
- CODEX_AUTH_FAILURE_BENCH_MS,
65
- CODEX_AUTH_WATCH_NAMESPACE,
66
- codexAuthBenchMarkerKey,
67
- init_codex_auth_failure
68
- } from "./cli-fw2w0kva.js";
30
+ } from "./cli-rfejbpe1.js";
69
31
  import {
70
32
  init_templates4,
71
33
  generateDefaultClaudeMd2,
@@ -80,15 +42,15 @@ import {
80
42
  init_identity_field_budget,
81
43
  contentSha256,
82
44
  init_profile_sync
83
- } from "./cli-agjbj5x0.js";
84
- import {
85
- isSteeringEnabled2,
86
- init_steering_enabled
87
- } from "./cli-4sydckyj.js";
45
+ } from "./cli-sdh61g52.js";
88
46
  import {
89
47
  isSlackConfigured,
90
48
  init_config4
91
49
  } from "./cli-eetzmsy5.js";
50
+ import {
51
+ isSteeringEnabled2,
52
+ init_steering_enabled
53
+ } from "./cli-4sydckyj.js";
92
54
  import {
93
55
  kindForModelString,
94
56
  init_models2
@@ -120,7 +82,45 @@ import {
120
82
  configureDbResolver,
121
83
  init_resolver,
122
84
  init_session_templates
123
- } from "./cli-2z2c4k6q.js";
85
+ } from "./cli-50w82h6m.js";
86
+ import {
87
+ normalizeAssetKey,
88
+ defaultAssetKey,
89
+ keyPrefixRange,
90
+ SESSION_RESOURCE_KINDS,
91
+ SESSION_LEAF_KINDS,
92
+ NO_GROUP_LEAF_KINDS,
93
+ isGroupKey,
94
+ isResourceGroupPrefix,
95
+ sessionResourceGroupOf,
96
+ sessionGroupKey,
97
+ parseAssetKey,
98
+ isCanonicalAssetKey,
99
+ init_key,
100
+ MODEL_TIERS,
101
+ ReasoningEffortSchema,
102
+ DEFAULT_MODEL_TIER_MAP,
103
+ parseModelTier,
104
+ TERMINAL_TASK_STATUSES,
105
+ isTerminalTaskStatus,
106
+ OPEN_TASK_STATUSES,
107
+ ProviderNameSchema,
108
+ ModelProfileCredentialsSchema,
109
+ FallbackHopSchema,
110
+ PROVIDER_STEER_CAPABILITIES,
111
+ FollowUpConfigSchema,
112
+ RoutingAffinitySchema,
113
+ TaskSlackParticipantsSchema,
114
+ CreateTaskOptionsSchema,
115
+ SERVER_GENERATED_ATTACHMENT_CAPABILITY,
116
+ AgentAvatarSchema,
117
+ AgentSlackIconSchema,
118
+ VersionableFieldSchema,
119
+ SessionCostModelBreakdownSchema,
120
+ SUPERSEDED_WORKFLOW_TASK_REASON,
121
+ PageThemeTokensSchema,
122
+ init_types5
123
+ } from "./cli-f8rcvf2x.js";
124
124
  import {
125
125
  setRuntimeModelCatalog,
126
126
  runtimeHarnessSections,
@@ -153,7 +153,7 @@ import {
153
153
  import {
154
154
  init_package,
155
155
  package_default
156
- } from "./cli-2amwhyv2.js";
156
+ } from "./cli-y518qkjg.js";
157
157
  import {
158
158
  getNodeEnv,
159
159
  init_node_env
@@ -5691,7 +5691,7 @@ var init_telemetry = __esm(() => {
5691
5691
  // src/telemetry-identity.ts
5692
5692
  async function loadUserRole(userId) {
5693
5693
  try {
5694
- const { getUserGrant } = await import("./rbac-roles-84aw10nz.js");
5694
+ const { getUserGrant } = await import("./rbac-roles-0wydd22m.js");
5695
5695
  const grant = await getUserGrant(userId);
5696
5696
  const role = grant.grantsAll ? "admin" : "member";
5697
5697
  const user = await getDbClient2().get("SELECT json_extract(metadata, '$.jobFunction') AS jobFunction FROM users WHERE id = ? AND json_valid(metadata)", [userId]);
@@ -6579,7 +6579,7 @@ function scheduleApprovalCardUpdates(approvals) {
6579
6579
  const posted = approvals.filter((approval) => approval.notificationChannels?.some((n) => n.channel === "slack" && n.messageTs));
6580
6580
  if (posted.length === 0)
6581
6581
  return;
6582
- getDbClient2().afterCommit(() => import("./approval-notifications-3g6yc8nv.js").then(({ updateResolvedApprovalCards }) => updateResolvedApprovalCards(posted)).catch((err) => console.error("[HITL] Slack card update not run:", scrubSecrets(err instanceof Error ? err.message : String(err)))));
6582
+ getDbClient2().afterCommit(() => import("./approval-notifications-fcfw063h.js").then(({ updateResolvedApprovalCards }) => updateResolvedApprovalCards(posted)).catch((err) => console.error("[HITL] Slack card update not run:", scrubSecrets(err instanceof Error ? err.message : String(err)))));
6583
6583
  }
6584
6584
  var init_approvals = __esm(() => {
6585
6585
  init_secret_scrubber();
@@ -6953,6 +6953,8 @@ var init_legacy_policy = __esm(() => {
6953
6953
  "comb.presence": operatorOrUser,
6954
6954
  "fs.join.own": anyAuthenticated,
6955
6955
  "page.delete.any": leadOrResourceOwner,
6956
+ "objects.read": operatorOrUser,
6957
+ "objects.write": operatorOrUser,
6956
6958
  "app.manage": anyAuthenticated,
6957
6959
  "app.use": anyAuthenticated,
6958
6960
  "script.global.write": leadOnly,
@@ -7140,7 +7142,7 @@ var init_permissions = __esm(() => {
7140
7142
  namespace: "channel"
7141
7143
  },
7142
7144
  "repo.merge-policy.write": {
7143
- description: "Change a repo's allowMerge guideline, which tells agents whether they may merge a PR themselves.",
7145
+ description: "Change a repo's merge policy (the allowMerge guideline or the mergePolicy record), which tells agents whether they may merge a PR themselves and which PRs the swarm may auto-merge.",
7144
7146
  namespace: "repo"
7145
7147
  },
7146
7148
  "integration.kapso.manage": {
@@ -7323,6 +7325,14 @@ var init_permissions = __esm(() => {
7323
7325
  description: "Delete a page the caller does not own.",
7324
7326
  namespace: "page"
7325
7327
  },
7328
+ "objects.read": {
7329
+ description: "Read a board or sheet on the swarm's shared agent-fs drive through the object routes.",
7330
+ namespace: "objects"
7331
+ },
7332
+ "objects.write": {
7333
+ description: "Save a board or edit sheet cells on the swarm's shared agent-fs drive through the object routes.",
7334
+ namespace: "objects"
7335
+ },
7326
7336
  "app.manage": {
7327
7337
  description: "Create, update, delete, or roll back apps, and inspect app version history.",
7328
7338
  namespace: "app"
@@ -8464,8 +8474,16 @@ async function getAgentModelTierOverrides(agentId) {
8464
8474
  return {};
8465
8475
  }
8466
8476
  }
8477
+ function storedModelTierOverrides(overrides) {
8478
+ return Object.keys(overrides).length > 0 ? JSON.stringify(overrides) : null;
8479
+ }
8480
+ async function modelTierOverridesDiffer(agentId, overrides) {
8481
+ const next = storedModelTierOverrides(overrides);
8482
+ const row = await getDbClient2().get("SELECT id FROM agents WHERE id = ? AND modelTierOverrides IS NOT ?", [agentId, next]);
8483
+ return row !== null;
8484
+ }
8467
8485
  async function setAgentModelTierOverrides(agentId, overrides) {
8468
- const next = Object.keys(overrides).length > 0 ? JSON.stringify(overrides) : null;
8486
+ const next = storedModelTierOverrides(overrides);
8469
8487
  await getDbClient2().run("UPDATE agents SET modelTierOverrides = ? WHERE id = ? AND modelTierOverrides IS NOT ?", [next, agentId, next]);
8470
8488
  }
8471
8489
  function mergeFacts2(base, overlay) {
@@ -10997,7 +11015,7 @@ async function moveSessionChains(input) {
10997
11015
  async function moveKeyFavorites(input) {
10998
11016
  const { lo, hi } = keyPrefixRange(input.from);
10999
11017
  const scoped = input.scope !== undefined;
11000
- const range = `itemType = 'key' AND itemId >= ? AND itemId < ?${scoped ? " AND favoriteScope = ?" : ""}`;
11018
+ const range = `itemType IN ('key','hidden-key') AND itemId >= ? AND itemId < ?${scoped ? " AND favoriteScope = ?" : ""}`;
11001
11019
  const rangeParams = [lo, hi, ...scoped ? [input.scope] : []];
11002
11020
  await getDbClient2().transaction(async () => {
11003
11021
  await getDbClient2().run(`UPDATE OR IGNORE user_favorites SET itemId = ? || substr(itemId, ?) WHERE ${range}`, [input.to, lo.length + 1, ...rangeParams]);
@@ -11170,6 +11188,15 @@ function sessionRootFilter(opts = {}) {
11170
11188
  });
11171
11189
  if (opts.rootId)
11172
11190
  add({ sql: "r.id = ?", params: [opts.rootId] });
11191
+ if (opts.rootIds) {
11192
+ add(opts.rootIds.length ? { sql: `r.id IN (${opts.rootIds.map(() => "?").join(",")})`, params: opts.rootIds } : { sql: "0", params: [] });
11193
+ }
11194
+ if (opts.exceptRootIds?.length) {
11195
+ add({
11196
+ sql: `r.id NOT IN (${opts.exceptRootIds.map(() => "?").join(",")})`,
11197
+ params: opts.exceptRootIds
11198
+ });
11199
+ }
11173
11200
  const sources = opts.source?.filter(Boolean) ?? [];
11174
11201
  if (sources.length)
11175
11202
  add({ sql: `r.source IN (${sources.map(() => "?").join(",")})`, params: sources });
@@ -11226,8 +11253,9 @@ function sessionRootFilter(opts = {}) {
11226
11253
  add(groupCondition(normalizeAssetKey(opts.groupKey)));
11227
11254
  if (opts.noGroup)
11228
11255
  add(noGroupCondition(opts.viewer?.userId));
11229
- if (opts.triage === "inbox")
11256
+ if (opts.triage === "inbox" || opts.triage === "working") {
11230
11257
  add(inboxScopeCondition(opts.viewer?.userId));
11258
+ }
11231
11259
  if (opts.triage === "later" || opts.triage === "done") {
11232
11260
  const marked = {
11233
11261
  sql: `r.id IN (SELECT itemId FROM inbox_item_state
@@ -11240,6 +11268,8 @@ function sessionRootFilter(opts = {}) {
11240
11268
  return { sql: conditions.length ? conditions.join(" AND ") : "1", params };
11241
11269
  }
11242
11270
  function excludesTriaged(opts) {
11271
+ if (sourceOfKey(opts.groupKey ?? opts.keyPrefix ?? ""))
11272
+ return false;
11243
11273
  return !!(opts.viewer?.userId && (opts.groupKey || opts.keyPrefix || opts.keyPrefixes?.length || opts.noGroup));
11244
11274
  }
11245
11275
  function hasSessionChainFilter(opts) {
@@ -11253,9 +11283,13 @@ function summaryRowFilters(opts) {
11253
11283
  else if (opts.triage === "later" || opts.triage === "done") {
11254
11284
  filters.push("readState = ?");
11255
11285
  params.push(opts.triage);
11256
- } else if (opts.triage === "inbox" || excludesTriaged(opts)) {
11286
+ } else if (opts.triage === "inbox" || opts.triage === "working" || excludesTriaged(opts)) {
11257
11287
  filters.push("(readState IS NULL OR readState IN ('read','unread'))");
11258
11288
  }
11289
+ if (opts.triage === "inbox")
11290
+ filters.push(`NOT (${workingSql})`);
11291
+ if (opts.triage === "working")
11292
+ filters.push(workingSql);
11259
11293
  if (opts.status === "running")
11260
11294
  filters.push(runningSql);
11261
11295
  if (opts.status === "failed")
@@ -11393,6 +11427,7 @@ async function getSessionTree(actor, now, opts = {}) {
11393
11427
  const result = {
11394
11428
  groups: [],
11395
11429
  inbox: counts(),
11430
+ working: counts(),
11396
11431
  later: counts(),
11397
11432
  done: counts(),
11398
11433
  noGroup: counts(),
@@ -11458,11 +11493,14 @@ async function getSessionTree(actor, now, opts = {}) {
11458
11493
  if (row.readState === "later" || row.readState === "done") {
11459
11494
  if (sectionVisible)
11460
11495
  add(result[row.readState], row);
11496
+ if (group && sourceOfKey(key))
11497
+ add(group, row);
11461
11498
  } else {
11462
11499
  const viewer = actor.kind === "user" ? actor.userId : null;
11463
11500
  const inInbox = noGroup || sourceOfKey(key) || inResourceScope(row.key, viewer);
11501
+ const working = !isTerminalTaskStatus(row.latestStatus) && !row.needsYou;
11464
11502
  if (sectionVisible && inInbox)
11465
- add(result.inbox, row);
11503
+ add(working ? result.working : result.inbox, row);
11466
11504
  if (noGroup)
11467
11505
  add(result.noGroup, row);
11468
11506
  else if (group)
@@ -11517,7 +11555,7 @@ async function triageSessionList(userId, filters, action, readAll) {
11517
11555
  ]);
11518
11556
  return result.changes;
11519
11557
  }
11520
- var AUTO_DONE_QUIET_MS, LEGACY_READ_STATE_COLUMNS, SESSION_ROOTS = "(SELECT rootId AS id, * FROM session_summaries)", terminalSql, runningSql, openTaskSql, AGENT_TASK_SOURCES, reopensDoneSql, THREAD_OPEN = "<thread_context>", THREAD_CLOSE = "</thread_context>", THREAD_OPEN_AT, THREAD_CLOSE_AT, THREAD_LABEL_LENGTH = 300, THREAD_LABEL_TRIM_MARGIN = 100, THREAD_PROMPT_SQL, UNREAD_CURSOR = "1970-01-01T00:00:00.000Z";
11558
+ var AUTO_DONE_QUIET_MS, LEGACY_READ_STATE_COLUMNS, SESSION_ROOTS = "(SELECT rootId AS id, * FROM session_summaries)", terminalSql, runningSql, workingSql, openTaskSql, AGENT_TASK_SOURCES, reopensDoneSql, THREAD_OPEN = "<thread_context>", THREAD_CLOSE = "</thread_context>", THREAD_OPEN_AT, THREAD_CLOSE_AT, THREAD_LABEL_LENGTH = 300, THREAD_LABEL_TRIM_MARGIN = 100, THREAD_PROMPT_SQL, UNREAD_CURSOR = "1970-01-01T00:00:00.000Z";
11521
11559
  var init_session_tree = __esm(() => {
11522
11560
  init_key();
11523
11561
  init_source_key();
@@ -11533,6 +11571,7 @@ var init_session_tree = __esm(() => {
11533
11571
  };
11534
11572
  terminalSql = TERMINAL_TASK_STATUSES.map((s) => `'${s}'`).join(",");
11535
11573
  runningSql = `latestStatus NOT IN (${terminalSql})`;
11574
+ workingSql = `(${runningSql} AND needsYou = 0)`;
11536
11575
  openTaskSql = `chain.status NOT IN (${terminalSql})`;
11537
11576
  AGENT_TASK_SOURCES = ["mcp", "system", "schedule", "workflow"];
11538
11577
  reopensDoneSql = `(d.id IS NOT NULL AND (
@@ -12135,12 +12174,16 @@ async function createTask2(agentId, task, options) {
12135
12174
  } catch {}
12136
12175
  return rowToAgentTask(row);
12137
12176
  }
12138
- async function logAffinityDispatchSkip(agent, task) {
12177
+ async function logAffinityDispatchSkip(agent, task, probe) {
12139
12178
  const now = Date.now();
12140
12179
  const lastLoggedAt = lastAffinityDispatchSkipLoggedAt.get(task.id);
12141
12180
  if (lastLoggedAt !== undefined && now - lastLoggedAt < AFFINITY_DISPATCH_SKIP_LOG_COOLDOWN_MS) {
12142
12181
  return;
12143
12182
  }
12183
+ if (probe) {
12184
+ probe.skipLogDue = true;
12185
+ return;
12186
+ }
12144
12187
  lastAffinityDispatchSkipLoggedAt.set(task.id, now);
12145
12188
  try {
12146
12189
  await dependencies3.createLogEntry({
@@ -12157,7 +12200,7 @@ async function logAffinityDispatchSkip(agent, task) {
12157
12200
  });
12158
12201
  } catch {}
12159
12202
  }
12160
- async function getPendingTaskForAgent2(agentId) {
12203
+ async function getPendingTaskForAgent2(agentId, probe) {
12161
12204
  const rows = await getDbClient2().query("SELECT * FROM agent_tasks WHERE agentId = ? AND status = 'pending' ORDER BY priority DESC, createdAt ASC", [agentId]);
12162
12205
  const agent = await getAgentById2(agentId);
12163
12206
  if (!agent)
@@ -12165,11 +12208,11 @@ async function getPendingTaskForAgent2(agentId) {
12165
12208
  for (const row of rows) {
12166
12209
  const task = rowToAgentTask(row);
12167
12210
  if (task.routingAffinityInvalid) {
12168
- await logAffinityDispatchSkip(agent, task);
12211
+ await logAffinityDispatchSkip(agent, task, probe);
12169
12212
  continue;
12170
12213
  }
12171
12214
  if (task.routingAffinity?.leadOnly && !isAgentEligibleForTask2(agent, task)) {
12172
- await logAffinityDispatchSkip(agent, task);
12215
+ await logAffinityDispatchSkip(agent, task, probe);
12173
12216
  continue;
12174
12217
  }
12175
12218
  const { ready } = await dependencies3.checkDependencies(task.id);
@@ -12385,6 +12428,7 @@ async function completeTask2(id, output, options) {
12385
12428
  import("./event-bus-v4ywhc2p.js").then(({ workflowEventBus }) => {
12386
12429
  workflowEventBus.emit("task.completed", {
12387
12430
  taskId: id,
12431
+ previousStatus: oldTask.status,
12388
12432
  output: scrubbedOutput,
12389
12433
  agentId: row.agentId,
12390
12434
  workflowRunId: row.workflowRunId,
@@ -12440,6 +12484,7 @@ async function failTask2(id, reason, opts = {}) {
12440
12484
  import("./event-bus-v4ywhc2p.js").then(({ workflowEventBus }) => {
12441
12485
  workflowEventBus.emit("task.failed", {
12442
12486
  taskId: id,
12487
+ previousStatus: oldTask.status,
12443
12488
  failureReason: scrubbedReason,
12444
12489
  agentId: row.agentId,
12445
12490
  workflowRunId: row.workflowRunId,
@@ -12522,6 +12567,7 @@ async function cancelTask2(id, reason, options = {}) {
12522
12567
  import("./event-bus-v4ywhc2p.js").then(({ workflowEventBus }) => {
12523
12568
  workflowEventBus.emit("task.cancelled", {
12524
12569
  taskId: id,
12570
+ previousStatus: oldTask.status,
12525
12571
  agentId: row.agentId,
12526
12572
  workflowRunId: row.workflowRunId,
12527
12573
  workflowRunStepId: row.workflowRunStepId
@@ -12531,7 +12577,7 @@ async function cancelTask2(id, reason, options = {}) {
12531
12577
  if (row.source === "schedule" && row.taskType === "deferred" && row.parentTaskId) {
12532
12578
  getDbClient2().afterCommit(async () => {
12533
12579
  try {
12534
- const { createWorkerTaskFollowUp } = await import("./worker-follow-up-9z2xec5e.js");
12580
+ const { createWorkerTaskFollowUp } = await import("./worker-follow-up-0by8wztc.js");
12535
12581
  await createWorkerTaskFollowUp({
12536
12582
  task: rowToAgentTask(row),
12537
12583
  status: "failed",
@@ -14377,6 +14423,7 @@ var init_swarm_config_guard = __esm(() => {
14377
14423
  ...enumValidator("SLACK_MODE", ["socket", "http"]),
14378
14424
  ...enumValidator("SLACK_THREAD_STEERING", ["off", "lead", "all"]),
14379
14425
  ...enumValidator("SLACK_THREAD_STEERING_MODE", ["steer", "queue"]),
14426
+ ...enumValidator("SLACK_SESSION_MIRROR", ["off", "reply", "both"]),
14380
14427
  ...shortcodeValidators([
14381
14428
  "SLACK_REACTION_ACCEPTED",
14382
14429
  "SLACK_REACTION_BUFFERED",
@@ -23069,7 +23116,7 @@ function noteEmbeddingSuccess() {
23069
23116
  const report = (what) => (err) => {
23070
23117
  console.error(`[memory] ${what} backfill after embeddings recovered failed:`, err.message);
23071
23118
  };
23072
- backfill2 = import("./embedding-space-kcdn52vz.js").then(({ runEmbeddingMaintenance }) => runEmbeddingMaintenance({ backfill: true })).catch(report("Embedding")).finally(() => {
23119
+ backfill2 = import("./embedding-space-3n6mhhmy.js").then(({ runEmbeddingMaintenance }) => runEmbeddingMaintenance({ backfill: true })).catch(report("Embedding")).finally(() => {
23073
23120
  backfill2 = null;
23074
23121
  });
23075
23122
  }
@@ -23550,6 +23597,163 @@ var init_search_candidates = __esm(() => {
23550
23597
  init_review_recall_filter();
23551
23598
  });
23552
23599
 
23600
+ // src/be/memory/search-reader.ts
23601
+ function workerSpecifier() {
23602
+ if (import.meta.url.includes("/$bunfs/"))
23603
+ return "./be/memory/search-read-worker.ts";
23604
+ return new URL("./search-read-worker.ts", import.meta.url).href;
23605
+ }
23606
+ function spawnWorker(file, vecExtensionPath) {
23607
+ return new Promise((resolve, reject) => {
23608
+ const worker = new Worker(workerSpecifier());
23609
+ worker.unref?.();
23610
+ const fail = (message) => {
23611
+ clearTimeout(timer);
23612
+ worker.terminate();
23613
+ reject(new Error(message));
23614
+ };
23615
+ const timer = setTimeout(() => fail("timed out starting"), START_TIMEOUT_MS);
23616
+ worker.addEventListener("message", function onReady(event) {
23617
+ worker.removeEventListener("message", onReady);
23618
+ if (event.data.type === "ready") {
23619
+ clearTimeout(timer);
23620
+ resolve(worker);
23621
+ } else
23622
+ fail(event.data.type === "fatal" ? event.data.message : "unexpected first message");
23623
+ });
23624
+ worker.addEventListener("error", (event) => fail(event.message), { once: true });
23625
+ worker.postMessage({ type: "init", file, vecExtensionPath });
23626
+ });
23627
+ }
23628
+
23629
+ class SearchReadPool {
23630
+ idle;
23631
+ queue = [];
23632
+ slots;
23633
+ nextId = 1;
23634
+ broken = false;
23635
+ constructor(workers) {
23636
+ this.slots = workers.map((worker) => ({ worker, job: null }));
23637
+ this.idle = [...this.slots];
23638
+ for (const slot of this.slots) {
23639
+ slot.worker.addEventListener("message", (event) => this.settle(slot, event.data));
23640
+ slot.worker.addEventListener("error", (event) => this.stop(`worker error: ${event.message}`));
23641
+ slot.worker.addEventListener("close", () => this.stop("worker exited"));
23642
+ }
23643
+ }
23644
+ get stats() {
23645
+ return {
23646
+ workers: this.slots.length,
23647
+ busy: this.slots.filter((slot) => slot.job).length,
23648
+ queued: this.queue.length
23649
+ };
23650
+ }
23651
+ read(mode, sql, params) {
23652
+ if (this.broken)
23653
+ return Promise.reject(new WorkerGoneError("pool stopped"));
23654
+ return new Promise((resolve, reject) => {
23655
+ this.queue.push({ id: this.nextId++, mode, sql, params, resolve, reject });
23656
+ this.pump();
23657
+ });
23658
+ }
23659
+ pump() {
23660
+ while (this.idle.length > 0 && this.queue.length > 0) {
23661
+ const slot = this.idle.pop();
23662
+ const job = this.queue.shift();
23663
+ slot.job = job;
23664
+ slot.worker.ref?.();
23665
+ const request = {
23666
+ type: "read",
23667
+ id: job.id,
23668
+ mode: job.mode,
23669
+ sql: job.sql,
23670
+ params: job.params
23671
+ };
23672
+ slot.worker.postMessage(request);
23673
+ }
23674
+ }
23675
+ settle(slot, message) {
23676
+ const job = slot.job;
23677
+ if (!job || message.type !== "result" && message.type !== "error" || message.id !== job.id) {
23678
+ return;
23679
+ }
23680
+ slot.job = null;
23681
+ slot.worker.unref?.();
23682
+ this.idle.push(slot);
23683
+ if (message.type === "result")
23684
+ job.resolve(message.rows);
23685
+ else
23686
+ job.reject(new Error(message.message));
23687
+ this.pump();
23688
+ }
23689
+ stop(reason, log = true) {
23690
+ if (this.broken)
23691
+ return;
23692
+ this.broken = true;
23693
+ if (log)
23694
+ console.warn(`[memory-search] read workers stopped (${reason}); reads run in-process`);
23695
+ const pending = [...this.slots.flatMap((slot) => slot.job ? [slot.job] : []), ...this.queue];
23696
+ this.queue.length = 0;
23697
+ for (const slot of this.slots) {
23698
+ slot.job = null;
23699
+ slot.worker.terminate();
23700
+ }
23701
+ for (const job of pending)
23702
+ job.reject(new WorkerGoneError(reason));
23703
+ }
23704
+ }
23705
+ function poolForCurrentDb() {
23706
+ const db = getDb2();
23707
+ if (current?.db === db)
23708
+ return current.pool;
23709
+ current?.pool.then((pool) => pool?.stop("database handle changed", false));
23710
+ const file = db.filename;
23711
+ const pool = !file || file === ":memory:" ? Promise.resolve(null) : startPool(file, isSqliteVecAvailable2() ? resolveSqliteVecExtensionPath2() : undefined);
23712
+ current = { db, pool };
23713
+ return pool;
23714
+ }
23715
+ async function startPool(file, vecExtensionPath) {
23716
+ const started = await Promise.allSettled(Array.from({ length: SEARCH_READ_WORKERS }, () => spawnWorker(file, vecExtensionPath)));
23717
+ const failed = started.find((result) => result.status === "rejected");
23718
+ if (failed) {
23719
+ for (const result of started)
23720
+ if (result.status === "fulfilled")
23721
+ result.value.terminate();
23722
+ console.warn(`[memory-search] read workers failed to start (${failed.reason.message}); reads run in-process`);
23723
+ return null;
23724
+ }
23725
+ console.log(`[memory-search] read workers started workers=${SEARCH_READ_WORKERS}`);
23726
+ return new SearchReadPool(started.map((result) => result.value));
23727
+ }
23728
+ function readInProcess(mode, sql, params) {
23729
+ return mode === "all" ? getDbClient2().query(sql, params) : getDbClient2().get(sql, params);
23730
+ }
23731
+ async function read(mode, sql, params) {
23732
+ if (inProcessOnly || isInTransaction())
23733
+ return readInProcess(mode, sql, params);
23734
+ const pool = await poolForCurrentDb();
23735
+ if (!pool || pool.broken)
23736
+ return readInProcess(mode, sql, params);
23737
+ try {
23738
+ return await pool.read(mode, sql, params);
23739
+ } catch (err) {
23740
+ if (err instanceof WorkerGoneError)
23741
+ return readInProcess(mode, sql, params);
23742
+ throw err;
23743
+ }
23744
+ }
23745
+ var SEARCH_READ_WORKERS = 2, START_TIMEOUT_MS = 1e4, WorkerGoneError, current = null, inProcessOnly = false, memorySearchReader;
23746
+ var init_search_reader = __esm(() => {
23747
+ init_db4();
23748
+ init_db_client();
23749
+ WorkerGoneError = class WorkerGoneError extends Error {
23750
+ };
23751
+ memorySearchReader = {
23752
+ query: (sql, params = []) => read("all", sql, params),
23753
+ get: (sql, params = []) => read("get", sql, params)
23754
+ };
23755
+ });
23756
+
23553
23757
  // src/be/memory/providers/sqlite-store.ts
23554
23758
  var exports_sqlite_store = {};
23555
23759
  __export(exports_sqlite_store, {
@@ -23641,6 +23845,8 @@ class SqliteMemoryStore {
23641
23845
  ftsPopulate = null;
23642
23846
  lastPopulate = null;
23643
23847
  searchHealthCache = null;
23848
+ searchHealthRefresh = null;
23849
+ searchHealthGeneration = 0;
23644
23850
  constructor() {
23645
23851
  this.ensureVecTable();
23646
23852
  this.ensureFtsTable();
@@ -23827,7 +24033,7 @@ class SqliteMemoryStore {
23827
24033
  }
23828
24034
  }
23829
24035
  const afterCount = this.getVecCount();
23830
- this.searchHealthCache = null;
24036
+ this.dropSearchHealth();
23831
24037
  this.lastPopulate = {
23832
24038
  attempted,
23833
24039
  inserted,
@@ -23975,7 +24181,7 @@ class SqliteMemoryStore {
23975
24181
  minSimilarity: options.minSimilarity
23976
24182
  });
23977
24183
  }
23978
- const health = this.searchHealth();
24184
+ const health = await this.searchHealth();
23979
24185
  if (isHybridSearchEnabled() && options.queryText && this.ftsInitialized && await this.getFtsTableSchema() && health.retrievalMode === "vec" && embedding.length === EMBEDDING_DIMENSIONS) {
23980
24186
  console.log(`[memory-search] retrieval_path=hybrid scope=${scope} limit=${limit} vec_rows=${health.counts.memoryVec} searchable=${health.counts.searchable}`);
23981
24187
  return this.searchHybrid(embedding, options.queryText, agentId, {
@@ -24067,7 +24273,7 @@ class SqliteMemoryStore {
24067
24273
  const missing = ids.filter((id) => !cosines.has(id));
24068
24274
  if (missing.length === 0)
24069
24275
  return;
24070
- const rows = await getDbClient2().query(`SELECT id, embedding FROM agent_memory WHERE id IN (${missing.map(() => "?").join(",")})`, missing);
24276
+ const rows = await memorySearchReader.query(`SELECT id, embedding FROM agent_memory WHERE id IN (${missing.map(() => "?").join(",")})`, missing);
24071
24277
  for (const row of rows) {
24072
24278
  if (!row.embedding)
24073
24279
  continue;
@@ -24096,7 +24302,7 @@ class SqliteMemoryStore {
24096
24302
  }
24097
24303
  try {
24098
24304
  const sqlLimit = armFetchLimit(limit);
24099
- const rows = await getDbClient2().query(`SELECT m.*, bm25(memory_fts) AS rank
24305
+ const rows = await memorySearchReader.query(`SELECT m.*, bm25(memory_fts) AS rank
24100
24306
  FROM memory_fts
24101
24307
  JOIN agent_memory m ON m.id = memory_fts.memory_id
24102
24308
  WHERE ${conditions.join(" AND ")}
@@ -24142,7 +24348,7 @@ class SqliteMemoryStore {
24142
24348
  }
24143
24349
  conditions.push("v.k = ?");
24144
24350
  params.push(knnLimit);
24145
- const rows = await getDbClient2().query(`SELECT m.*, v.distance
24351
+ const rows = await memorySearchReader.query(`SELECT m.*, v.distance
24146
24352
  FROM memory_vec v
24147
24353
  JOIN agent_memory m ON m.id = v.memory_id
24148
24354
  WHERE ${conditions.join(" AND ")}
@@ -24181,7 +24387,7 @@ class SqliteMemoryStore {
24181
24387
  console.log(`[memory-search] retrieval_path=exhaustive scope=${scope} limit=${limit} scanned=${scanned} hits=${top.length}${scanned >= EXHAUSTIVE_SEARCH_MAX_ROWS ? " capped=true" : ""}`);
24182
24388
  if (top.length === 0)
24183
24389
  return [];
24184
- const rows = await getDbClient2().query(`SELECT * FROM agent_memory WHERE id IN (${top.map(() => "?").join(", ")})`, top.map((hit) => hit.id));
24390
+ const rows = await memorySearchReader.query(`SELECT * FROM agent_memory WHERE id IN (${top.map(() => "?").join(", ")})`, top.map((hit) => hit.id));
24185
24391
  const byId = new Map(rows.map((row) => [row.id, row]));
24186
24392
  const candidates = [];
24187
24393
  for (const hit of top) {
@@ -24192,7 +24398,7 @@ class SqliteMemoryStore {
24192
24398
  return candidates;
24193
24399
  }
24194
24400
  async scoreCappedInSql(queryEmbedding, capped, cappedParams, floor, limit) {
24195
- const db = getDbClient2();
24401
+ const db = memorySearchReader;
24196
24402
  const counted = await db.get(`SELECT COUNT(*) AS n FROM (SELECT 1 ${capped})`, cappedParams);
24197
24403
  const queryBuffer = serializeEmbedding(queryEmbedding);
24198
24404
  const top = await db.query(`SELECT id, similarity FROM (
@@ -24207,7 +24413,7 @@ class SqliteMemoryStore {
24207
24413
  return { scanned: counted?.n ?? 0, top };
24208
24414
  }
24209
24415
  async scoreCappedInJs(queryEmbedding, capped, cappedParams, floor, limit) {
24210
- const rows = await getDbClient2().query(`SELECT id, embedding ${capped}`, cappedParams);
24416
+ const rows = await memorySearchReader.query(`SELECT id, embedding ${capped}`, cappedParams);
24211
24417
  const scored = [];
24212
24418
  for (const row of rows) {
24213
24419
  const emb = deserializeEmbedding(row.embedding);
@@ -24236,7 +24442,7 @@ class SqliteMemoryStore {
24236
24442
  conditions.push("(expiresAt IS NULL OR expiresAt > datetime('now'))");
24237
24443
  }
24238
24444
  const whereClause = conditions.length > 0 ? `WHERE ${conditions.join(" AND ")}` : "";
24239
- const rows = await getDbClient2().query(`SELECT * FROM agent_memory ${whereClause}`, params);
24445
+ const rows = await memorySearchReader.query(`SELECT * FROM agent_memory ${whereClause}`, params);
24240
24446
  const candidates = [];
24241
24447
  for (const row of rows) {
24242
24448
  if (!row.embedding)
@@ -24542,7 +24748,7 @@ class SqliteMemoryStore {
24542
24748
  this.noteVecWrite();
24543
24749
  } catch (err) {
24544
24750
  console.error(`[memory-vec] update failed memory_id=${id}: ${err.message}`);
24545
- this.searchHealthCache = null;
24751
+ this.invalidateSearchHealth();
24546
24752
  }
24547
24753
  }
24548
24754
  });
@@ -24610,6 +24816,36 @@ class SqliteMemoryStore {
24610
24816
  expired: expired?.count ?? 0
24611
24817
  };
24612
24818
  }
24819
+ async getHealthCountsOffLoop() {
24820
+ const tableUsable = this.getVecTableSchema() !== null && isSqliteVecAvailable2();
24821
+ const valid = `embedding IS NOT NULL AND length(embedding) = ${VECTOR_BYTES}`;
24822
+ const row = await memorySearchReader.get(`SELECT
24823
+ (SELECT COUNT(*) FROM agent_memory) AS total,
24824
+ (SELECT COUNT(*) FROM agent_memory WHERE embedding IS NOT NULL) AS withEmbedding,
24825
+ (SELECT COUNT(*) FROM agent_memory WHERE ${valid}) AS validEmbedding,
24826
+ (SELECT COUNT(*) FROM agent_memory
24827
+ WHERE embedding IS NOT NULL AND length(embedding) != ${VECTOR_BYTES}) AS invalidEmbedding,
24828
+ (SELECT COUNT(*) FROM agent_memory
24829
+ WHERE ${valid} AND (expiresAt IS NULL OR expiresAt > datetime('now'))) AS searchable,
24830
+ ${tableUsable ? "(SELECT COUNT(*) FROM memory_vec)" : "0"} AS memoryVec,
24831
+ ${tableUsable ? `(SELECT COUNT(*) FROM agent_memory WHERE ${valid})
24832
+ - (SELECT COUNT(*) FROM memory_vec v CROSS JOIN agent_memory m ON m.id = v.memory_id
24833
+ WHERE m.embedding IS NOT NULL AND length(m.embedding) = ${VECTOR_BYTES})` : `(SELECT COUNT(*) FROM agent_memory WHERE ${valid})`} AS missingFromVec,
24834
+ ${tableUsable ? `(SELECT COUNT(*) FROM memory_vec v LEFT JOIN agent_memory m ON m.id = v.memory_id
24835
+ WHERE m.id IS NULL)` : "0"} AS extraInVec`);
24836
+ if (!row)
24837
+ throw new Error("health counts returned no row");
24838
+ return {
24839
+ total: row.total,
24840
+ withEmbedding: row.withEmbedding,
24841
+ validEmbedding: row.validEmbedding,
24842
+ invalidEmbedding: row.invalidEmbedding,
24843
+ searchable: row.searchable,
24844
+ memoryVec: row.memoryVec,
24845
+ missingFromVec: row.missingFromVec,
24846
+ extraInVec: row.extraInVec
24847
+ };
24848
+ }
24613
24849
  getHealthCounts() {
24614
24850
  const db = getDb2();
24615
24851
  const tableExists = this.getVecTableSchema() !== null;
@@ -24637,23 +24873,76 @@ class SqliteMemoryStore {
24637
24873
  WHERE m.id IS NULL`) : 0
24638
24874
  };
24639
24875
  }
24640
- searchHealth() {
24876
+ async searchHealth() {
24641
24877
  const db = getDb2();
24642
24878
  const cached = this.searchHealthCache;
24643
- if (cached && cached.db === db && Date.now() - cached.at < SEARCH_HEALTH_TTL_MS) {
24644
- return cached.health;
24879
+ const inTransaction = isInTransaction();
24880
+ if (cached && cached.db === db) {
24881
+ if (Date.now() - cached.at < SEARCH_HEALTH_TTL_MS)
24882
+ return cached.health;
24883
+ if (cached.health.retrievalMode === "vec" && !inTransaction) {
24884
+ if (!this.searchHealthRefresh)
24885
+ this.startSearchHealthRefresh(db).promise.catch(() => {});
24886
+ return cached.health;
24887
+ }
24888
+ }
24889
+ if (inTransaction)
24890
+ return this.getHealth();
24891
+ return this.currentSearchHealth();
24892
+ }
24893
+ async currentSearchHealth() {
24894
+ for (let attempt = 0;attempt < SEARCH_HEALTH_MAX_REFRESHES; attempt++) {
24895
+ const db = getDb2();
24896
+ const generation = this.searchHealthGeneration;
24897
+ const inFlight = this.searchHealthRefresh;
24898
+ const refresh = inFlight && inFlight.db === db && inFlight.generation === generation ? inFlight : this.startSearchHealthRefresh(db);
24899
+ const health = await refresh.promise;
24900
+ if (getDb2() === db && this.searchHealthGeneration === generation)
24901
+ return health;
24645
24902
  }
24646
24903
  const health = this.getHealth();
24647
- this.searchHealthCache = { health, db, at: Date.now() };
24904
+ this.searchHealthCache = { health, db: getDb2(), at: Date.now() };
24648
24905
  return health;
24649
24906
  }
24907
+ startSearchHealthRefresh(db) {
24908
+ const generation = this.searchHealthGeneration;
24909
+ const promise = (async () => {
24910
+ let health;
24911
+ try {
24912
+ health = this.healthFromCounts(await this.getHealthCountsOffLoop());
24913
+ } catch (err) {
24914
+ console.warn("[memory-search] health counts failed:", err.message);
24915
+ health = this.getHealth();
24916
+ }
24917
+ if (getDb2() === db && generation === this.searchHealthGeneration)
24918
+ this.searchHealthCache = { health, db, at: Date.now() };
24919
+ return health;
24920
+ })().finally(() => {
24921
+ if (this.searchHealthRefresh === entry)
24922
+ this.searchHealthRefresh = null;
24923
+ });
24924
+ const entry = { db, generation, promise };
24925
+ this.searchHealthRefresh = entry;
24926
+ return entry;
24927
+ }
24650
24928
  noteVecWrite() {
24651
24929
  if (this.searchHealthCache?.health.retrievalMode !== "vec")
24652
- this.searchHealthCache = null;
24930
+ this.invalidateSearchHealth();
24931
+ }
24932
+ invalidateSearchHealth() {
24933
+ this.dropSearchHealth();
24934
+ if (isInTransaction())
24935
+ getDbClient2().afterCommit(() => this.dropSearchHealth());
24936
+ }
24937
+ dropSearchHealth() {
24938
+ this.searchHealthCache = null;
24939
+ this.searchHealthGeneration++;
24653
24940
  }
24654
24941
  getHealth() {
24942
+ return this.healthFromCounts(this.getHealthCounts());
24943
+ }
24944
+ healthFromCounts(counts) {
24655
24945
  const schema = this.getVecTableSchema();
24656
- const counts = this.getHealthCounts();
24657
24946
  const reasons = [];
24658
24947
  if (!isSqliteVecAvailable2())
24659
24948
  reasons.push("sqlite_vec_extension_unavailable");
@@ -24687,18 +24976,20 @@ var VECTOR_BYTES, FTS_SCAN_BATCH_SQL = `SELECT rowid AS rowid, memory_id AS memo
24687
24976
  memory_id IS NOT NULL
24688
24977
  AND NOT EXISTS (SELECT 1 FROM agent_memory m WHERE m.id = memory_fts.memory_id) AS orphan
24689
24978
  FROM memory_fts WHERE rowid > ? ORDER BY rowid LIMIT ?`, MEMORY_ID_BATCH_SQL = `SELECT rowid AS rowid, id FROM agent_memory
24690
- WHERE rowid > ? ORDER BY rowid LIMIT ?`, SEARCH_HEALTH_TTL_MS = 60000, FTS_SCAN_BATCH_SIZE = 1000, FTS_POPULATE_BATCH_SIZE = 500;
24979
+ WHERE rowid > ? ORDER BY rowid LIMIT ?`, SEARCH_HEALTH_TTL_MS = 60000, SEARCH_HEALTH_MAX_REFRESHES = 3, FTS_SCAN_BATCH_SIZE = 1000, FTS_POPULATE_BATCH_SIZE = 500;
24691
24980
  var init_sqlite_store = __esm(() => {
24692
24981
  init_db4();
24693
24982
  init_embedding();
24694
24983
  init_profile_sync();
24695
24984
  init_secret_scrubber();
24985
+ init_db_client();
24696
24986
  init_event_loop_lag();
24697
24987
  init_constants2();
24698
24988
  init_key_paths();
24699
24989
  init_reranker();
24700
24990
  init_review_recall_filter();
24701
24991
  init_search_candidates();
24992
+ init_search_reader();
24702
24993
  VECTOR_BYTES = EMBEDDING_DIMENSIONS * Float32Array.BYTES_PER_ELEMENT;
24703
24994
  });
24704
24995
 
@@ -24749,6 +25040,9 @@ function rowToScript(row) {
24749
25040
  fsMode: row.fsMode,
24750
25041
  executor: row.executor ?? null,
24751
25042
  createdByAgentId: row.createdByAgentId ?? null,
25043
+ updatedByAgentId: row.updatedByAgentId ?? null,
25044
+ createdBy: row.created_by ?? null,
25045
+ updatedBy: row.updated_by ?? null,
24752
25046
  createdAt: row.createdAt,
24753
25047
  updatedAt: row.updatedAt
24754
25048
  };
@@ -24904,7 +25198,10 @@ function rowToScript2(row) {
24904
25198
  isScratch: row.isScratch === 1,
24905
25199
  typeChecked: row.typeChecked === 1,
24906
25200
  executor: row.executor ?? null,
24907
- createdByAgentId: row.createdByAgentId ?? null
25201
+ createdByAgentId: row.createdByAgentId ?? null,
25202
+ updatedByAgentId: row.updatedByAgentId ?? null,
25203
+ createdBy: row.created_by ?? null,
25204
+ updatedBy: row.updated_by ?? null
24908
25205
  };
24909
25206
  }
24910
25207
  function rowToScriptVersion(row) {
@@ -24946,9 +25243,9 @@ async function insertScript(args) {
24946
25243
  const row = await tx.get(`INSERT INTO scripts (
24947
25244
  id, "key", name, scope, scopeId, source, description, intent, signatureJson,
24948
25245
  argsJsonSchema, contentHash, isScratch, typeChecked, fsMode, executor, createdByAgentId, createdAt, updatedAt,
24949
- created_by, updated_by
25246
+ created_by, updated_by, updatedByAgentId
24950
25247
  )
24951
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
25248
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
24952
25249
  RETURNING *`, [
24953
25250
  id,
24954
25251
  defaultAssetKey("script", id),
@@ -24969,7 +25266,8 @@ async function insertScript(args) {
24969
25266
  now,
24970
25267
  now,
24971
25268
  args.createdBy ?? null,
24972
- args.createdBy ?? null
25269
+ args.createdBy ?? null,
25270
+ args.agentId ?? null
24973
25271
  ]);
24974
25272
  if (!row)
24975
25273
  throw new Error("Failed to insert script");
@@ -25014,7 +25312,8 @@ async function upsertScriptByName(args) {
25014
25312
  if (fsMode !== existing.fsMode || executor !== existing.executor || isScratch !== existing.isScratch || typeChecked !== existing.typeChecked || trackedMetadataChanged || refreshScratchLastUsed) {
25015
25313
  const row = await getDbClient2().get(`UPDATE scripts
25016
25314
  SET description = ?, intent = ?, signatureJson = ?, argsJsonSchema = ?,
25017
- isScratch = ?, typeChecked = ?, fsMode = ?, executor = ?, updatedAt = ?, updated_by = ?
25315
+ isScratch = ?, typeChecked = ?, fsMode = ?, executor = ?, updatedAt = ?, updated_by = ?,
25316
+ updatedByAgentId = ?
25018
25317
  WHERE id = ?
25019
25318
  RETURNING *`, [
25020
25319
  args.description,
@@ -25027,6 +25326,7 @@ async function upsertScriptByName(args) {
25027
25326
  executor ?? null,
25028
25327
  new Date().toISOString(),
25029
25328
  args.createdBy ?? null,
25329
+ args.agentId ?? null,
25030
25330
  existing.id
25031
25331
  ]);
25032
25332
  if (!row)
@@ -25057,7 +25357,8 @@ async function upsertScriptByName(args) {
25057
25357
  const script = await getDbClient2().transaction(async (tx) => {
25058
25358
  const row = await tx.get(`UPDATE scripts
25059
25359
  SET source = ?, description = ?, intent = ?, signatureJson = ?, argsJsonSchema = ?,
25060
- contentHash = ?, version = ?, isScratch = ?, typeChecked = ?, fsMode = ?, executor = ?, updatedAt = ?, updated_by = ?
25360
+ contentHash = ?, version = ?, isScratch = ?, typeChecked = ?, fsMode = ?, executor = ?, updatedAt = ?, updated_by = ?,
25361
+ updatedByAgentId = ?
25061
25362
  WHERE id = ?
25062
25363
  RETURNING *`, [
25063
25364
  args.source,
@@ -25073,6 +25374,7 @@ async function upsertScriptByName(args) {
25073
25374
  executor ?? null,
25074
25375
  now,
25075
25376
  args.createdBy ?? null,
25377
+ args.agentId ?? null,
25076
25378
  existing.id
25077
25379
  ]);
25078
25380
  if (!row)
@@ -25383,7 +25685,7 @@ async function loadSecretRegistry() {
25383
25685
  result.failed += 1;
25384
25686
  }
25385
25687
  try {
25386
- const { loadRuntimeControllerSecrets } = await import("./db-g111qn9j.js");
25688
+ const { loadRuntimeControllerSecrets } = await import("./db-2s68ycq7.js");
25387
25689
  const loaded = await loadRuntimeControllerSecrets();
25388
25690
  result.runtimeController = loaded.count;
25389
25691
  result.failed += loaded.failed;
@@ -25544,7 +25846,7 @@ async function requestSteering(args) {
25544
25846
  }
25545
25847
  const requestedMode = args.mode ?? "queue";
25546
25848
  const onUnsupported = args.onUnsupported ?? "degrade";
25547
- const { dispatchPre, extensionIdForAgent } = await import("./dispatcher-4q8s0mx8.js");
25849
+ const { dispatchPre, extensionIdForAgent } = await import("./dispatcher-j2y1q7ae.js");
25548
25850
  const preSteer = await dispatchPre("pre.task.steer", {
25549
25851
  task,
25550
25852
  message: args.message,
@@ -25758,6 +26060,18 @@ var init_script_runs = __esm(() => {
25758
26060
  init_runtime2();
25759
26061
  });
25760
26062
 
26063
+ // src/be/db/skill-audit.ts
26064
+ async function setSkillUpdatedBy2(skillId, actor) {
26065
+ await getDbClient2().run("UPDATE skills SET updated_by = ?, updatedByAgentId = ? WHERE id = ?", [
26066
+ actor.userId,
26067
+ actor.agentId,
26068
+ skillId
26069
+ ]);
26070
+ }
26071
+ var init_skill_audit = __esm(() => {
26072
+ init_runtime2();
26073
+ });
26074
+
25761
26075
  // src/be/db.ts
25762
26076
  var exports_db = {};
25763
26077
  __export(exports_db, {
@@ -26235,6 +26549,7 @@ __export(exports_db, {
26235
26549
  setBudgetRefusalFollowUpTaskId: () => setBudgetRefusalFollowUpTaskId2,
26236
26550
  setFavorite: () => setFavorite2,
26237
26551
  setScriptRunFollowUpGuard: () => setScriptRunFollowUpGuard2,
26552
+ setSkillUpdatedBy: () => setSkillUpdatedBy2,
26238
26553
  setSlackMessageTracking: () => setSlackMessageTracking2,
26239
26554
  setTaskTitleIfUnset: () => setTaskTitleIfUnset2,
26240
26555
  setUserFavorite: () => setUserFavorite2,
@@ -27062,10 +27377,10 @@ async function moveAssetKey2(input) {
27062
27377
  return { movedTaskIds };
27063
27378
  }
27064
27379
  case "workflow":
27065
- await tx.run('UPDATE workflows SET "key" = ?, lastUpdatedAt = ?, updated_by = ? WHERE id = ?', [key, now, input.changedBy ?? null, input.id]);
27380
+ await tx.run('UPDATE workflows SET "key" = ?, lastUpdatedAt = ?, updated_by = ?, updatedByAgentId = ? WHERE id = ?', [key, now, input.changedBy ?? null, input.changedByAgentId ?? null, input.id]);
27066
27381
  break;
27067
27382
  case "schedule":
27068
- await tx.run('UPDATE scheduled_tasks SET "key" = ?, lastUpdatedAt = ?, updated_by = ? WHERE id = ?', [key, now, input.changedBy ?? null, input.id]);
27383
+ await tx.run('UPDATE scheduled_tasks SET "key" = ?, lastUpdatedAt = ?, updated_by = ?, updatedByAgentId = ? WHERE id = ?', [key, now, input.changedBy ?? null, input.changedByAgentId ?? null, input.id]);
27069
27384
  break;
27070
27385
  case "page":
27071
27386
  await tx.run('UPDATE pages SET "key" = ?, updatedAt = ?, updated_by = ? WHERE id = ?', [
@@ -27083,12 +27398,7 @@ async function moveAssetKey2(input) {
27083
27398
  ]);
27084
27399
  break;
27085
27400
  case "script":
27086
- await tx.run('UPDATE scripts SET "key" = ?, updatedAt = ?, updated_by = ? WHERE id = ?', [
27087
- key,
27088
- now,
27089
- input.changedBy ?? null,
27090
- input.id
27091
- ]);
27401
+ await tx.run('UPDATE scripts SET "key" = ?, updatedAt = ?, updated_by = ?, updatedByAgentId = ? WHERE id = ?', [key, now, input.changedBy ?? null, input.changedByAgentId ?? null, input.id]);
27092
27402
  break;
27093
27403
  case "file":
27094
27404
  await tx.run('UPDATE asset_key_mappings SET "key" = ?, updated_at = ?, updated_by = ? WHERE id = ?', [key, now, input.changedBy ?? null, input.id]);
@@ -28550,7 +28860,7 @@ async function getInboxSummary2(agentId) {
28550
28860
  recentMentions
28551
28861
  };
28552
28862
  }
28553
- async function claimMentions2(agentId) {
28863
+ async function claimMentions2(agentId, opts) {
28554
28864
  const now = new Date().toISOString();
28555
28865
  const client = getDbClient2();
28556
28866
  const channels = await getAllChannels2();
@@ -28565,6 +28875,14 @@ async function claimMentions2(agentId) {
28565
28875
  const mentionCountRow = await client.get(`SELECT COUNT(*) as count FROM channel_messages m
28566
28876
  WHERE m.channelId = ? AND m.mentions LIKE ? ${baseCondition}`, [channel.id, `%"${agentId}"%`]);
28567
28877
  if (mentionCountRow && mentionCountRow.count > 0) {
28878
+ if (opts?.dryRun) {
28879
+ claimedChannels.push({
28880
+ channelId: channel.id,
28881
+ lastReadAt,
28882
+ mentionsCount: mentionCountRow.count
28883
+ });
28884
+ continue;
28885
+ }
28568
28886
  const result = await client.run(`INSERT INTO channel_read_state (agentId, channelId, lastReadAt, processing_since)
28569
28887
  VALUES (?, ?, ?, ?)
28570
28888
  ON CONFLICT(agentId, channelId) DO UPDATE SET
@@ -29298,6 +29616,7 @@ function rowToScheduledTask(row) {
29298
29616
  lastRunAt: normalizeDate(row.lastRunAt) ?? undefined,
29299
29617
  nextRunAt: normalizeDate(row.nextRunAt) ?? undefined,
29300
29618
  createdByAgentId: row.createdByAgentId ?? undefined,
29619
+ updatedByAgentId: row.updatedByAgentId ?? undefined,
29301
29620
  parentTaskId: row.parentTaskId ?? undefined,
29302
29621
  requestedDelayMs: row.requestedDelayMs ?? undefined,
29303
29622
  requestedRunAt: normalizeDate(row.requestedRunAt) ?? undefined,
@@ -29401,8 +29720,8 @@ async function createScheduledTask2(data) {
29401
29720
  timezone, model, modelTier, profile, scheduleType,
29402
29721
  targetType, workflowId, scriptName, scriptArgs, params, requiredParams, requires,
29403
29722
  createdAt, lastUpdatedAt,
29404
- created_by, updated_by
29405
- ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING *`, [
29723
+ created_by, updated_by, updatedByAgentId
29724
+ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING *`, [
29406
29725
  id,
29407
29726
  normalizeAssetKey(data.key ?? defaultAssetKey("schedule", id)),
29408
29727
  data.name,
@@ -29435,7 +29754,8 @@ async function createScheduledTask2(data) {
29435
29754
  now,
29436
29755
  now,
29437
29756
  data.createdBy ?? null,
29438
- data.createdBy ?? null
29757
+ data.createdBy ?? null,
29758
+ data.createdByAgentId ?? null
29439
29759
  ]);
29440
29760
  if (!row)
29441
29761
  throw new Error("Failed to create scheduled task");
@@ -29560,6 +29880,10 @@ async function updateScheduledTask2(id, data) {
29560
29880
  updates.push("updated_by = ?");
29561
29881
  params.push(data.updatedBy);
29562
29882
  }
29883
+ if (data.updatedByAgentId !== undefined) {
29884
+ updates.push("updatedByAgentId = ?");
29885
+ params.push(data.updatedByAgentId);
29886
+ }
29563
29887
  if (updates.length === 0) {
29564
29888
  return getScheduledTaskById2(id);
29565
29889
  }
@@ -29582,7 +29906,7 @@ async function deleteScheduledTask2(id) {
29582
29906
  const parent = await getTaskById2(deferred.parentTaskId);
29583
29907
  if (!parent?.deferredAt)
29584
29908
  return;
29585
- const { createWorkerTaskFollowUp } = await import("./worker-follow-up-9z2xec5e.js");
29909
+ const { createWorkerTaskFollowUp } = await import("./worker-follow-up-0by8wztc.js");
29586
29910
  await createWorkerTaskFollowUp({
29587
29911
  task: parent,
29588
29912
  status: "failed",
@@ -30189,6 +30513,7 @@ function rowToWorkflow(row) {
30189
30513
  dir: row.dir ?? undefined,
30190
30514
  vcsRepo: row.vcs_repo ?? undefined,
30191
30515
  createdByAgentId: row.createdByAgentId ?? undefined,
30516
+ updatedByAgentId: row.updatedByAgentId ?? undefined,
30192
30517
  createdAt: normalizeDateRequired(row.createdAt),
30193
30518
  lastUpdatedAt: normalizeDateRequired(row.lastUpdatedAt),
30194
30519
  createdBy: row.created_by ?? undefined,
@@ -30197,8 +30522,8 @@ function rowToWorkflow(row) {
30197
30522
  }
30198
30523
  async function createWorkflow2(data, source) {
30199
30524
  const id = crypto.randomUUID();
30200
- const row = await getDbClient2().get(`INSERT INTO workflows (id, "key", name, description, definition, triggers, cooldown, input, triggerSchema, params, requiredParams, requires, dir, vcs_repo, createdByAgentId, created_by, updated_by, enabled)
30201
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING *`, [
30525
+ const row = await getDbClient2().get(`INSERT INTO workflows (id, "key", name, description, definition, triggers, cooldown, input, triggerSchema, params, requiredParams, requires, dir, vcs_repo, createdByAgentId, updatedByAgentId, created_by, updated_by, enabled)
30526
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING *`, [
30202
30527
  id,
30203
30528
  normalizeAssetKey(data.key ?? defaultAssetKey("workflow", id)),
30204
30529
  data.name,
@@ -30214,6 +30539,7 @@ async function createWorkflow2(data, source) {
30214
30539
  data.dir ?? null,
30215
30540
  data.vcsRepo ?? null,
30216
30541
  data.createdByAgentId ?? null,
30542
+ data.createdByAgentId ?? null,
30217
30543
  data.createdBy ?? null,
30218
30544
  data.createdBy ?? null,
30219
30545
  data.enabled === false ? 0 : 1
@@ -30250,8 +30576,11 @@ function rowToWorkflowSummary(row) {
30250
30576
  dir: row.dir ?? undefined,
30251
30577
  vcsRepo: row.vcs_repo ?? undefined,
30252
30578
  createdByAgentId: row.createdByAgentId ?? undefined,
30579
+ updatedByAgentId: row.updatedByAgentId ?? undefined,
30253
30580
  createdAt: normalizeDateRequired(row.createdAt),
30254
30581
  lastUpdatedAt: normalizeDateRequired(row.lastUpdatedAt),
30582
+ createdBy: row.created_by ?? undefined,
30583
+ updatedBy: row.updated_by ?? undefined,
30255
30584
  nodeCount
30256
30585
  };
30257
30586
  }
@@ -30365,6 +30694,10 @@ async function updateWorkflow2(id, data) {
30365
30694
  updates.push("updated_by = ?");
30366
30695
  params.push(data.updatedBy);
30367
30696
  }
30697
+ if (data.updatedByAgentId !== undefined) {
30698
+ updates.push("updatedByAgentId = ?");
30699
+ params.push(data.updatedByAgentId);
30700
+ }
30368
30701
  if (updates.length === 0)
30369
30702
  return await getWorkflow2(id);
30370
30703
  updates.push("lastUpdatedAt = ?");
@@ -31705,6 +32038,10 @@ function rowToSkill(row) {
31705
32038
  systemDefault: row.systemDefault === 1,
31706
32039
  invocationCount: row.invocationCount,
31707
32040
  lastInvokedAt: row.lastInvokedAt,
32041
+ createdByAgentId: row.createdByAgentId ?? null,
32042
+ updatedByAgentId: row.updatedByAgentId ?? null,
32043
+ createdBy: row.created_by ?? null,
32044
+ updatedBy: row.updated_by ?? null,
31708
32045
  createdAt: row.createdAt,
31709
32046
  lastUpdatedAt: row.lastUpdatedAt,
31710
32047
  lastFetchedAt: row.lastFetchedAt
@@ -31801,8 +32138,9 @@ async function createSkill2(data) {
31801
32138
  id, name, description, content, type, scope, ownerAgentId,
31802
32139
  sourceUrl, sourceRepo, sourcePath, sourceBranch, sourceHash, isComplex,
31803
32140
  allowedTools, model, effort, context, agent, disableModelInvocation, userInvocable,
31804
- version, isEnabled, systemDefault, createdAt, lastUpdatedAt
31805
- ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, ?, ?, ?, ?) RETURNING *`, [
32141
+ version, isEnabled, systemDefault, createdAt, lastUpdatedAt,
32142
+ createdByAgentId, updatedByAgentId, created_by, updated_by
32143
+ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING *`, [
31806
32144
  id,
31807
32145
  data.name,
31808
32146
  data.description,
@@ -31826,7 +32164,11 @@ async function createSkill2(data) {
31826
32164
  data.isEnabled === false ? 0 : 1,
31827
32165
  data.systemDefault ? 1 : 0,
31828
32166
  now,
31829
- now
32167
+ now,
32168
+ data.createdByAgentId ?? null,
32169
+ data.createdByAgentId ?? null,
32170
+ data.createdBy ?? null,
32171
+ data.createdBy ?? null
31830
32172
  ]);
31831
32173
  if (!row)
31832
32174
  throw new Error("Failed to create skill");
@@ -31919,6 +32261,14 @@ async function updateSkill2(id, updates) {
31919
32261
  sets.push("lastFetchedAt = ?");
31920
32262
  params.push(updates.lastFetchedAt);
31921
32263
  }
32264
+ if (updates.updatedBy !== undefined) {
32265
+ sets.push("updated_by = ?");
32266
+ params.push(updates.updatedBy);
32267
+ }
32268
+ if (updates.updatedByAgentId !== undefined) {
32269
+ sets.push("updatedByAgentId = ?");
32270
+ params.push(updates.updatedByAgentId);
32271
+ }
31922
32272
  if (updates.content !== undefined) {
31923
32273
  sets.push("version = version + 1");
31924
32274
  }
@@ -33558,7 +33908,8 @@ function kvJsonFieldConditions(filters) {
33558
33908
  }
33559
33909
  async function listKv2(namespace, opts) {
33560
33910
  const now = Date.now();
33561
- const prefix = kvPrefixCondition(opts.prefix);
33911
+ const upper = opts.prefix === undefined ? null : kvPrefixUpperBound2(opts.prefix);
33912
+ const prefix = opts.keyAfter === undefined ? kvPrefixCondition(opts.prefix) : opts.keyThrough !== undefined ? { sql: "AND key > ? AND key <= ?", params: [opts.keyAfter, opts.keyThrough] } : upper === null ? { sql: "AND key > ?", params: [opts.keyAfter] } : { sql: "AND key > ? AND key < ?", params: [opts.keyAfter, upper] };
33562
33913
  const json = kvJsonFieldConditions(opts.jsonFieldEquals);
33563
33914
  const rows = await getDbClient2().query(`SELECT namespace, key, value, value_type, expires_at, created_at, updated_at
33564
33915
  FROM kv_entries
@@ -33859,7 +34210,7 @@ var VERSIONABLE_FIELDS2, BUDGETED_IDENTITY_FIELDS, PENDING_SLACK_MESSAGE_TS_PREF
33859
34210
  LEFT JOIN agents a ON m.created_by_kind = 'agent' AND a.id = m.created_by_agent_id`, ROUTING_HOLDER_SQL = `CASE
33860
34211
  WHEN status IN ('draft', 'offered', 'reviewing') AND offeredTo IS NOT NULL THEN offeredTo
33861
34212
  ELSE COALESCE(agentId, offeredTo)
33862
- END`, ELIGIBILITY_SCAN_BATCH_SIZE, 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]", 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", KvTypeCollisionError2;
34213
+ END`, ELIGIBILITY_SCAN_BATCH_SIZE, 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]", 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, createdByAgentId, updatedByAgentId, created_by, updated_by, createdAt, lastUpdatedAt, lastFetchedAt, '' as content", KvTypeCollisionError2;
33863
34214
  var init_db4 = __esm(() => {
33864
34215
  init_session_costs();
33865
34216
  init_session_costs();
@@ -33927,6 +34278,7 @@ var init_db4 = __esm(() => {
33927
34278
  init_context_versions();
33928
34279
  init_script_runs();
33929
34280
  init_session_moves();
34281
+ init_skill_audit();
33930
34282
  init_workflow_run_definitions();
33931
34283
  init_runtime2();
33932
34284
  init_read();
@@ -33935,7 +34287,7 @@ var init_db4 = __esm(() => {
33935
34287
  configureAgentDependencies({
33936
34288
  createLogEntry: (entry) => createLogEntry2(entry),
33937
34289
  installSystemDefaultSkillsForAgent: (agentId) => installSystemDefaultSkillsForAgent2(agentId),
33938
- resolvePendingImportAssignments: async (agent) => (await import("./pending-hxj5yatb.js")).resolvePendingImportAssignments(agent)
34290
+ resolvePendingImportAssignments: async (agent) => (await import("./pending-24zebgvs.js")).resolvePendingImportAssignments(agent)
33939
34291
  });
33940
34292
  configureTaskWriteDependencies({
33941
34293
  createLogEntry: (...args) => createLogEntry2(...args),
@@ -33985,4 +34337,4 @@ var init_db4 = __esm(() => {
33985
34337
  };
33986
34338
  });
33987
34339
 
33988
- export { auditAssetKeys, init_asset_key_audit, CredentialBindingSchema, placeholderForConfigKey, CredentialBroker, defaultCredentialBindings, isPrivateAddress, assertUrlSafe, EgressDeniedError, createGuardedFetch, parseEgressAllowlist, init_egress_guard, init_credential_broker, encryptSecret, decryptSecret, init_secrets_cipher, getEncryptionKey, init_key_bootstrap, init_crypto, withLoopPath, bindLoopPath, startEventLoopLagProbe, stopEventLoopLagProbe, init_event_loop_lag, DbTransactionDeadlineError, isInTransaction, init_db_client, breaksJsonValidity, scrubJsonValue, foldHexCopies, init_scrub_json, sealJson, openSealedJson, init_sealed_json, getPromptTemplateDefaultDrift, init_default_drift, init_templates2, init_templates3, wasDbCreatedThisBoot, isSqliteVecAvailable2, resolveSqliteVecExtensionPath2, __resetSqliteVecExtensionPathCacheForTests2, initDb2, getDb2, closeDb2, getDbClient2, init_runtime2, SessionCostConflictError2, insertSessionCost2, slackContextKey, chatSdkContextKey, chatThreadOfContextKey, agentmailContextKey, githubContextKey, gitlabContextKey, azureDevOpsContextKey, azureDevOpsWorkItemContextKey, bitbucketContextKey, linearContextKey, buildJiraContextKey, scheduleContextKey, workflowContextKey, agentContextKey, pageContextKey, APP_SESSION_KEY_PATTERN, appSessionContextKey, init_context_key, sessionSourceKey, sourceOfKey, SOURCE_GROUPS_READ_ONLY, sourceMoveError, init_source_key, TaskCreationBlockedError, TaskRoutingAuthorizationError, init_errors2, checkSlackRoutingCoherence, init_slack_routing, init_catalog, catalog_default, COMPANY_TEAM_SIZES, COMPANY_USE_CASES, USER_FUNCTIONS, reportedUseCase, reportedUserFunction, init_company_profile, mapTriggerSurface, init_telemetry_context, TELEMETRY_PROXY_ORIGIN, normalizeOrgWebsite, orgLogoUrl, isFilledOrgLogoUrl, init_org_website, beginRequestAuthScope, setRequestAuth, getRequestAuth, runWithoutRequestAuth, authUserId, authUser, isOperatorAuth, getCurrentRequestUserId, getCurrentRunProvenance, init_request_auth_context, setTelemetryIngestObserver, isTelemetryEnabled, _resolveIntegrationType, _resolveIntegrationProvider, initTelemetry, setTelemetryRoleResolver, setTelemetryFunctionResolver, isTelemetryReady, track, trackRelayed, telemetry, emitIntegrationConnected, init_telemetry, isRbacEnabled, decideAdmission, decideToolAdmission, grantLeadEquivalence, revokeLeadEquivalence, init_elevated_agents, LEGACY_RULES, setAuditSink, clearAuditSink, can, init_can, PermissionVerbSchema, init_rbac, randomChars, init_short_id, CHAT_SDK_ADAPTER_NAMES, CHAT_SDK_ADAPTER_SCHEMAS, ChatSdkAdaptersDraftSchema, firstIssueText, isAdapterEntryEnabled, init_schema, TELEMETRY_RANKING_KEY, PUBLIC_RANKING_ENABLED_KEY, RANKING_CATEGORIES, readTelemetryRanking, rankingFormSchema, buildListing, init_telemetry_ranking, resolveQuickJSPoolSize, init_quickjs_pool_config, SLACK_REACTION_DEFAULTS, SLACK_REACTION_CONFIG_KEYS, reactionName, isSlackIconConfigKey, reactionStatusIcon, iconPrefix, completedStatusIcon, init_reaction_shortcode, UI_SPEC_SCRIPT_ACTIONS_KEY, parseScriptActionAllowlist, init_script_allowlist, API_DRAINING_HEADER, API_DRAIN_MAX_MS_LIMIT, isApiDrainingResponse, init_api_drain2, isEnvExportRestrictedKey, init_config_env_export, parseEnabledTools, init_enabled_tools, parseFollowUpGateScheduleIds, isFollowUpGateScheduleId, init_follow_up_gate_schedule_ids, parseTaskToolManifest, CHAT_TASK_ONLY_TOOLS, isChatSdkTask, selectTaskTools, init_task_tool_manifest, tierConfigKey, init_model_tier_keys, isApiOnlyConfigKey, isInternalConfigKey, internalConfigKeyError, isHumanOnlyConfigKey, humanOnlyConfigKeyError, humanOnlyConfigKeyPageError, isReservedConfigKey, reservedKeyError, MAX_DB_RETENTION_DAYS, DB_RETENTION_TUNING_BOUNDS, APPS_JSON_COLUMN_MAX_BYTES_BOUNDS, CODEX_OAUTH_KEEP_WARM_MAX_AGE_HOURS_BOUNDS, validateRuntimeTokenTtlHours, validateControllerTokenTtlDays, validateControllerGraceSec, validateConfigValue, validateConfigEntry, validateExportToEnv, init_swarm_config_guard, cachedUserRole, cachedUserFunction, invalidateTelemetryUserRole, configureOrgDomainPersistence, recomputeOrgDomain, scheduleOrgDomainRecompute, init_telemetry_identity, resolveTriggerSurface, emitTaskTelemetry, init_telemetry_trigger, MASKED_SECRET_VALUE, init_config_secrets, HeartbeatExpiryError, init_heartbeat_expiry, isEffectiveOutputSchema, init_output_schema, isRuntimePoolsEnabled, init_runtime_pools_flag, normalizeDate, normalizeDateRequired, init_date_utils, rowToAgent, updateAgentCredentialState2, updateAgentCredentialMissing2, AgentDeletedError2, isAgentDeleted2, createAgent2, getAgentById2, EXTENSION_AGENT_ROLE2, NOT_EXTENSION_AGENT_SQL2, isExtensionAgent2, extensionAgentAssignmentError2, ReservedAgentRoleError2, reservedRoleViolation2, ExtensionAgentAssignmentError2, getAllAgents2, getAgentStatusCounts2, getLeadAgent2, updateAgentStatus2, updateAgentMaxTasks2, updateAgentProvider2, setAgentHarnessProvider2, updateAgentCredStatus2, listAgentsWithCredStatusByProvider2, getAgentHarnessProviders2, updateAgentActivity2, MAX_EMPTY_POLLS2, incrementEmptyPollCount2, resetEmptyPollCount2, shouldBlockPolling2, deleteAgent2, getActiveTaskCount2, hasCapacity2, getRemainingCapacity2, updateAgentStatusFromCapacity2, isPoolAffinityEnforcementEnabled2, buildRoutingAffinityFromAgent2, isAgentEligibleForTask2, getAgentDailyTaskCounts2, init_agents, closeSlackTreeIfSettled, getSlackThreadsOfTasks, slackThreadHasBotReplySince, slackThreadHasOutcomeWork, observeSlackTreeVisibility, getSlackProcessingThreads, init_slack_trees, WorkflowReplayStateError, init_workflow_replay, getWorkflowRunTriggeredByAgentId, getWorkflowRunSummary, getWorkflowRunStepsSlimByRunId, WORKFLOW_RUN_TREE_MAX_DEPTH, WorkflowRunTreeError, getRunLineageBlock, getWorkflowRunTreeIds, getWorkflowRunStatus, getOpenWorkflowTreeTaskIds, getTaskIdsWithDependents, workflowRunTreeHasOpenWork, getWorkflowRunTree, cancelOpenWorkflowTreeSteps, disarmWorkflowTreeRetries, cancelLiveWorkflowTreeRuns, getChildWorkflowRunId, isParentStepAttemptCurrent, getRunningSubWorkflowSteps, getWorkflowRunParent, getWorkflowRunLineage, getSettledChildRunParentSteps, emitRunFinished, createForeachChildSteps, createForeachAttemptSteps, init_workflow_runs, OpenAI2, init_openai2, LEARNING_TTL_DAYS, LEARNING_DUPLICATE_MIN_SIMILARITY, CANDIDATE_SET_MULTIPLIER, isGraphExpansionEnabled, EMBEDDING_DIMENSIONS, init_constants2, LONGTERM_ROOT, LEARNINGS_ROOT, MEMORY_KEY_PATTERN, MEMORY_KEY_PATTERN_MESSAGE, MEMORY_KEY_MAX_LENGTH, isLongtermKey, longtermKeyError, isConsolidatedKey, consolidatedKeyMessage, resolveStoreKey, init_key_paths, computeScore, rerank, init_reranker, isReviewTaskId, dropReviewTaskCompletions, init_review_recall_filter, searchMemoryCandidates, init_search_candidates, rowToCandidate, init_sqlite_store, getEmbeddingProvider2, resetEmbeddingProvider2, getMemoryStore2, init_memory, embeddingProvider2, computeScriptEmbedding2, writeScriptEmbedding2, embedScript2, searchScripts2, reembedAllScripts2, init_embeddings, upsertScriptByName, getScript, getGlobalScriptContentHashes, getScriptById, getScriptVersion, listScripts, listScriptVersions, deleteScript, touchScratchScriptLastUsed, restoreScratchScriptLastUsedIfUnchanged, createScriptApi, listScriptApisForScript, getScriptApiById, getScriptApiSecret, updateScriptApi, rotateScriptApiSecret, deleteScriptApi, recordScriptApiUsage, init_db3, oauthSecretName, registerStoredSecret, loadSecretRegistry, init_secret_registry, getDefaultAuthorizationIdForProvider, getOAuthApp, getOAuthAppById, getOAuthAppIdByProvider, createOAuthApp, updateOAuthAppById, upsertOAuthApp, listAuthorizationsForApp, getAuthorizationById, upsertAuthorization, updateAuthorizationTokens, updateAuthorizationIdentity, deleteAuthorizationById, deleteAuthorizationsForApp, createOAuthPending, consumeOAuthPending, gcOAuthPending, markAuthorizationRefreshFailed, hasOAuthTokens, getOAuthTokens, listAuthorizationSweepRows, listKeepAliveAuthorizations, deleteOAuthTokens, acquireOAuthRefreshLock, releaseOAuthRefreshLock, init_oauth, normalizeVcsRepo, vcsRepoName, vcsRepoUrlMatches, init_vcs_repo_match, taskModelPin, resumedTaskModelSelection, init_model_pin, normalizeModelKey, init_pricing_normalize, buildModelsDevSeedRows, seedPricingFromModelsDev, init_seed_pricing, buildCatalogEntries, replaceModelCatalog, touchModelCatalogCheckedAt, countModelCatalog, getModelCatalogMeta, updateModelCatalogMeta, upsertModelCatalogOverlay, deleteModelCatalogOverlay, expireMatchedOverlays, applyOverlayPricingRows, reloadModelsCatalog, loadModelsCatalog, init_model_catalog_store, listHarnessModelSupport, recordHarnessModelSupport, agentRanModel, getAgentHarnessCliVersion, setAgentHarnessCliVersion, init_harness_model_support, sanitizeModelTierOverrides, parseModelTierOverridesHeader, setAgentModelTierOverrides, previewModelTiers, recordClaimModelResolution, init_model_tier_resolution, harnessModelErrorFor, poolTaskRunsOnHarness, explicitModelError, explicitModelErrorForAgent, init_model_validation2, runtimeReadsRepoSecrets, configPools, checkProfileForAgent, formatProfileCheckFailures, init_model_profile_check, startTaskSearchBackfill, stopTaskSearchBackfill, init_search_index, rowToAgentTask, getTaskById2, getChildTasks2, TASK_LINEAGE_LIMITS2, getTaskLineage2, hasNonTerminalResumeChild2, SUPERSEDED_RESUME_REPAIR_WINDOW_MS2, getSupersededTasksWithoutResume2, getSupersededTasksWithUnsettledDependents2, hasNonTerminalRerouteDecisionChild2, getTasksByAgentId2, getTasksDispatchedFrom2, getAgentCurrentTask2, getTasksByStatus2, findTaskByVcs2, findActiveTasksByVcs2, findTaskByGitHub2, readableSessionCondition, getAllTasks2, getTasksCount2, getTaskStats2, getCompletedSlackTasks2, getPendingSlackRelayTasks2, markSlackRelayAttempted2, markSlackRelayDelivered2, markFinalizedSlackRelaysDelivered2, getPendingChatRelayTasks2, giveUpStaleChatRelays2, markChatRelayAttempted2, recordChatRelayError2, markChatRelayDelivered2, markChatRelayGivenUp2, getRecentlyFinishedWorkerTasks2, markTasksNotified2, resetTasksNotified2, getInProgressSlackTasks2, getSlackTasksMissingTree2, getInProgressTasksByContextKey2, isLinearTrackerContextKey2, findExistingLinearTrackerContextWork2, getLatestTaskByContextKey2, getLatestScriptRunStepTaskByContextKey2, getAgentWorkingOnThread2, getLatestActiveTaskInThread2, getLatestLeadTaskInThread2, getAgentWorkingOnContextKey2, getLatestTaskByContextKeyPrefix2, getLatestActiveTaskByContextKey2, getLatestLeadTaskByContextKey2, getFirstTaskInThread2, getMostRecentTaskInThread2, findCompletedTasksInThread2, findRecentFailedTaskInThread2, countAgentDispatchesInThread2, findRecentCancelledTaskInThread2, init_read, MODEL_PROFILE_CONFIG_KEY, hasUnreadableCredentialAllowlist, listModelProfiles, getModelProfileByName, createModelProfile, updateModelProfile, TASK_HOLDS_PROFILE_SQL, repairWindowStart, modelProfileReferences, modelProfileRefError, isModelNameTakenError, deleteModelProfile, MAX_MODEL_PROFILE_FALLBACKS, modelProfileFallbacksError, taskProfileError, scheduleProfileUpdate, init_model_profiles, SESSION_ACTIVITY_REFRESH_MIN_INTERVAL_MS2, refreshActiveSessionOnActivity2, getActiveSessionById, init_active_sessions, STEERING_MOVED_ERROR, SteeringRequestError, SteeringBlockedError, isSteeringEnabled, getTaskSteeringFields, getTaskSteeringFieldsForTasks, promotePendingSteeringForTask, markSteeringUndeliverable, carryUnhandledSteering, requestSteering, init_steering2, onTaskStarted, init_task_lifecycle_events, listApprovalRequestSummaries2, getPendingApprovalVoteState2, recordApprovalVotes2, getPendingApprovalsForTasks2, approvalCancellationNotificationKey, listUndeliveredCancelledApprovalRequestIds, init_approvals, computeContentHash2, createContextVersion2, getLatestContextVersion2, getContextVersion2, getContextVersionHistory2, AssetKeyMovesBlockedError2, assertAssetKeyMovesAllowed2, moveTaskChainKeyInTx2, moveSessionChains, moveKeyFavorites, listPrefixRoots, listSharedPrefixRoots, init_session_moves, getSessionGroupKey, sessionSummaryQuery, getSessionReadState, getSessionTree, triageSessionList, init_session_tree, setHumanFreeQueueListener, reclassifyTaskHumanFree, drainHumanFreeReclassifyQueue, init_human_free, channelTopic, addWorkerSubscription, removeWorkerSubscription, listSubscribedWorkerAgents, init_channels, publishWorkerNudge, init_worker_nudges, createTask2, getPendingTaskForAgent2, assignUnassignedTaskPending2, startTask2, updateTaskClaudeSessionId2, recordTaskProviderIfUnset2, updateTaskTitle2, updateTaskTags2, setTaskTitleIfUnset2, completeTask2, failTask2, overwriteTerminalTaskResultText2, cancelTask2, skipTask2, supersedeTask2, markWorkflowStepTaskSuperseded2, settleSupersededTaskDependents2, backfillSupersedeTaskResumeTaskId2, pauseTask2, resumeTask2, getPausedTasksForAgent2, getOrphanedInProgressTasksForAgent2, resetOrphanedInProgressTasksForAgent2, getRecentlyCancelledTasksForAgent2, deleteTask2, updateTaskProgress2, init_write, quoteSqlIdentifier, USER_REFERENCE_COLUMNS_SQL, userReferenceRewriteSql, WORKFLOW_CONTEXT_REQUESTER_SQL, init_user_references, IdempotencyKeyTakenError, workflowRequestFingerprint, findAcceptedWorkflowOperation, assertWorkflowIdempotencyKeyUnused, recordAcceptedWorkflowOperation, init_workflow_idempotency, PINNED_WORKFLOW_KEYS2, toPinnedDefinition2, pinWorkflowDefinition2, getRunWorkflow2, deleteOrphanedRunDefinitions, init_workflow_run_definitions, recordKeySeatMismatch2, recordKeyValidation2, retirePoolKeyStatus, init_api_keys, getScriptRunExecutionArgs2, getScriptRunFollowUpGuard2, setScriptRunFollowUpGuard2, literalPrefixPattern2, getSlackRenderV2ActivatedAt2, ensureSlackRenderV2Activation2, getSlackDelegationActivatedAt2, ensureSlackDelegationActivation2, isPendingSlackMessage2, isSettledSlackMessage2, recordSlackMessage2, reserveSlackMessage2, bindSlackMessageTimestamp2, updateSlackMessageRecord2, markSlackTreeRendered2, deleteSlackMessageRecord2, getSlackTreeMessage2, getSlackTreeMessageByThread2, getSlackOutcomeMessage2, getResolvableDeferralOutcomes2, markSlackDeferralResolved2, noteSlackOutcomeDeliveryFailure2, abandonSlackOutcomeDelivery2, getSlackTreeMessages2, getSlackMessageByChannelTs2, getSlackTasksInThread2, listSlackThreadsAwaitingHuman2, isSlackThreadAwaitingHuman2, markTaskSlackReplySent2, setSlackMessageTracking2, updateTaskVcs2, insertTaskAttachment2, recordTaskPullRequestAttachments2, getAssetKeyMappingByProvider2, upsertAssetKeyMapping2, getAssetKeyMapping2, listAssetSummaries2, moveAssetKey2, deleteTaskAttachment2, replaceTaskAttachment2, getTaskAttachments2, createSteeringMessage2, getSteeringMessagesForTask2, getSteeringMessageById2, getPendingSteeringForTask2, getPendingSteeringForAgent2, markSteeringDelivered2, markSteeringHandled2, markSteeringPromoted2, cancelPendingSteeringForTask2, hasPendingSteering2, getAgentWithTasks2, getAllAgentsWithTasks2, createLogEntry2, getLogsByAgentId2, getLogsByTaskId2, getLogsByTaskIdAndEventType2, getLogsByTaskIdChronological2, getLogsByEventType2, getAllLogs2, findRecentSimilarTasks2, createTaskExtended2, claimTask2, releaseTask2, acceptTask2, rejectTask2, moveTaskToBacklog2, moveTaskFromBacklog2, promoteDraftTask2, refreshDraftTaskLease2, promoteAbandonedDraftTasks2, releaseStaleReviewingTasks2, releaseStaleOfferedTasksForOfflineAgents2, getOfferedTasksForAgent2, claimOfferedTask2, getUnassignedTasksCount2, getUnassignedTaskIds2, getUnassignedTaskIdsForAgent2, checkDependencies2, getDependentTasks2, cascadeFailDependents2, updateAgentProfile2, updateAgentName2, createChannel2, getMessageById2, getChannelById2, getChannelByName2, getAllChannels2, deleteChannel2, postMessage2, getChannelMessages2, updateReadState2, getLastReadAt2, getUnreadMessages2, getMentionsForAgent2, getInboxSummary2, claimMentions2, releaseMentionProcessing2, releaseStaleMentionProcessing2, createService2, getServiceById2, getServiceByAgentAndName2, getServicesByAgentId2, getAllServices2, updateServiceStatus2, deleteService2, upsertService2, deleteServicesByAgentId2, createSessionLogs2, getSessionLogsByTaskId2, getSessionLogsBySession2, createSessionCost2, getSessionCostsByTaskId2, getSessionCostsByAgentId2, getAllSessionCosts2, getSessionCostsFiltered2, UNATTRIBUTED_USER_ID2, getSessionCostSummary2, getAttributionByPerson2, getDashboardCostSummary2, createInboxMessage2, getInboxMessageById2, getUnreadInboxMessages2, claimInboxMessages2, markInboxMessageRead2, markInboxMessageResponded2, markInboxMessageDelegated2, releaseStaleProcessingInbox2, getConcurrentContext2, getScheduledTasks2, getScheduledTaskById2, getScheduledTaskByName2, createScheduledTask2, updateScheduledTask2, deleteScheduledTask2, getDueScheduledTasks2, autoEncryptLegacyPlaintextSecrets2, maskSecrets2, getSwarmConfigs2, getInjectableGlobalConfigs2, getSwarmConfigById2, getSwarmConfigLookupById2, upsertSwarmConfig2, emitBuiltInIntegrationConnectedOnce2, deleteSwarmConfig2, deleteSwarmConfigByKey2, getResolvedConfig2, getSwarmRepos2, getSwarmRepoById2, getSwarmRepoByName2, getSwarmRepoByUrl2, createSwarmRepo2, updateSwarmRepo2, deleteSwarmRepo2, getAgentMailInboxMapping2, getAgentMailInboxMappingsByAgent2, getAllAgentMailInboxMappings2, createAgentMailInboxMapping2, deleteAgentMailInboxMapping2, findTaskByAgentMailThread2, insertActiveSession2, deleteActiveSession2, deleteActiveSessionById2, getActiveSessions2, heartbeatActiveSession2, cleanupStaleSessions2, cleanupAgentSessions2, updateActiveSessionProviderSessionId2, getActiveSessionForTask2, reassociateSessionLogs2, getStalledInProgressTasks2, getStalePinnedResumes2, failPendingResumeIfUnclaimed2, getIdleWorkersWithCapacity2, getUnassignedPoolTasks2, getStaleUnassignedAffinityTasks2, getRecentFailedTasks2, getRecentCompletedCount2, getRecentFailedCount2, createWorkflow2, getWorkflow2, listWorkflows2, updateWorkflow2, deleteWorkflow2, getWorkflowsByScheduleId2, createWorkflowRun2, getWorkflowRun2, updateWorkflowRun2, listWorkflowRuns2, countWorkflowRuns2, listWorkflowRunsPage2, createWorkflowRunStep2, getWorkflowRunStep2, updateWorkflowRunStep2, getWorkflowRunStepsByRunId2, getStuckWorkflowRuns2, getLastSuccessfulRun2, getLastRunStart2, getRetryableSteps2, getCompletedStepNodeIds2, getTaskByWorkflowRunStepId2, detachTaskFromWorkflowRunStep2, getStepByIdempotencyKey2, getStepCountForNode2, getLatestStepForNode2, getCurrentStepForNode2, createWorkflowVersion2, getWorkflowVersions2, getWorkflowVersion2, createAppVersion2, getAppVersions2, getAppVersion2, createPage2, getPage2, getPageBySlug2, getLatestPageBySlug2, listPagesByAgent2, listAllPages2, countAllPages2, countPagesByAgent2, updatePage2, deletePage2, incrementPageViewCount2, createPageVersion2, getPageVersions2, getPageVersion2, createMetric2, getMetric2, getMetricBySlug2, listMetricsByAgent2, listAllMetrics2, countAllMetrics2, countMetricsByAgent2, updateMetric2, deleteMetric2, createMetricVersion2, getMetricVersions2, getMetricVersion2, getPromptTemplates2, getPromptTemplateById2, upsertPromptTemplate2, deletePromptTemplate2, resetPromptTemplateToDefault2, getPromptTemplateHistory2, resolvePromptTemplate2, checkoutPromptTemplate2, getAllChannelActivityCursors2, getChannelActivityCursor2, upsertChannelActivityCursor2, createApprovalRequest2, getApprovalRequestById2, resolveApprovalRequest2, cancelApprovalRequestById2, cancelPendingApprovalRequestsForRun2, listCancelledApprovalRequestsForRun2, listCancelledApprovalRequestsForStep2, claimApprovalCancellationNotification2, completeApprovalCancellationNotificationClaim2, releaseApprovalCancellationNotificationClaim2, updateApprovalRequestNotifications2, listApprovalRequests2, getStuckApprovalRuns2, getApprovalRequestByStepId2, getExpiredPendingApprovals2, getStaleApprovalRequests2, createWaitState2, getWaitStateById2, getWaitStateByStepId2, getDueWaitStates2, getPendingEventWaitNames2, getPendingWaitsByEvent2, resolveWaitState2, getStuckWaitRuns2, SKILL_FILE_LIMITS2, normalizeSkillFilePath2, createSkill2, updateSkill2, listSkillFileManifest2, getSkillFiles2, getSkillFile2, upsertSkillFile2, upsertSkillFiles2, deleteSkillFile2, deleteSkill2, getSkillById2, getSkillByName2, listSkills2, searchSkills2, installSkill2, getSystemDefaultSkills2, installSystemDefaultSkillsForAgent2, uninstallSkill2, getAgentSkills2, toggleAgentSkill2, createMcpServer2, emitMcpServerConnectedTelemetry2, updateMcpServer2, deleteMcpServer2, getMcpServerById2, getMcpServerByName2, listMcpServers2, installMcpServer2, uninstallMcpServer2, getAgentMcpServers2, createContextSnapshot2, getContextSnapshotsByTaskId2, getContextSnapshotsBySessionId2, getContextSummaryByTaskId2, getAvailableKeyIndices2, recordKeyUsage2, setApiKeyPlan2, markKeyRateLimited2, recordKeyAuthFailure2, recordKeyRateLimitWindows2, setApiKeyName2, clearKeyRateLimit2, getKeyStatuses2, getKeyCostSummary2, getUserById2, getAllUsers2, createUser2, updateUser2, deleteUser2, listInboxState2, upsertInboxState2, listFavorites2, listUserFavorites2, getFavoriteItemIdSet2, setFavorite2, setUserFavorite2, withFavoriteFlags2, listTaskTemplates2, getRootTaskChain2, listRecentSessions2, countSessions2, getBudget2, getBudgets2, upsertBudget2, deleteBudget2, getAllPricingRows2, getPricingRows2, getActivePricingRow2, insertPricingRow2, deletePricingRow2, getDailySpendForAgent2, getDailySpendGlobal2, getDailySpendForUser2, recordBudgetRefusalNotification2, getBudgetRefusalNotification2, getRecentBudgetRefusalNotifications2, hasBudgetRefusalNotificationToday2, setBudgetRefusalFollowUpTaskId2, getLiveAgentCounts2, getReadyAgentCounts2, getInstanceActivity2, getSwarmMetrics2, hasFirstCompletedTask2, getKv2, sweepExpiredKv2, sweepExpiredKvPrefix2, upsertKv2, claimKv2, deleteKv2, KvTypeCollisionError2, incrKv2, kvPrefixUpperBound2, listKv2, countKv2, createScriptRun2, recordInlineScriptRun2, getScriptRun2, getScriptRunByIdempotencyKey2, listScriptRuns2, countScriptRuns2, countActiveScriptRuns2, updateScriptRun2, updateScriptRunIfNotTerminal2, updateScriptRunIfRunning2, getRunningScriptRuns2, getScriptRunJournalStep2, upsertScriptRunJournalStep2, listScriptRunJournalSteps2, countScriptRunJournalSteps2, countScriptRunJournalAgentTaskSteps2, exports_db, init_db4 };
34340
+ export { auditAssetKeys, init_asset_key_audit, CredentialBindingSchema, placeholderForConfigKey, CredentialBroker, defaultCredentialBindings, isPrivateAddress, assertUrlSafe, EgressDeniedError, createGuardedFetch, parseEgressAllowlist, init_egress_guard, init_credential_broker, encryptSecret, decryptSecret, init_secrets_cipher, getEncryptionKey, init_key_bootstrap, init_crypto, withLoopPath, bindLoopPath, startEventLoopLagProbe, stopEventLoopLagProbe, init_event_loop_lag, DbTransactionDeadlineError, isInTransaction, init_db_client, breaksJsonValidity, scrubJsonValue, foldHexCopies, init_scrub_json, sealJson, openSealedJson, init_sealed_json, getPromptTemplateDefaultDrift, init_default_drift, init_templates2, init_templates3, wasDbCreatedThisBoot, isSqliteVecAvailable2, resolveSqliteVecExtensionPath2, __resetSqliteVecExtensionPathCacheForTests2, initDb2, getDb2, closeDb2, getDbClient2, init_runtime2, SessionCostConflictError2, insertSessionCost2, slackContextKey, chatSdkContextKey, chatThreadOfContextKey, agentmailContextKey, githubContextKey, gitlabContextKey, azureDevOpsContextKey, azureDevOpsWorkItemContextKey, bitbucketContextKey, linearContextKey, buildJiraContextKey, scheduleContextKey, workflowContextKey, agentContextKey, pageContextKey, APP_SESSION_KEY_PATTERN, appSessionContextKey, init_context_key, sessionSourceKey, sourceOfKey, SOURCE_GROUPS_READ_ONLY, sourceMoveError, init_source_key, TaskCreationBlockedError, TaskRoutingAuthorizationError, init_errors2, checkSlackRoutingCoherence, init_slack_routing, init_catalog, catalog_default, COMPANY_TEAM_SIZES, COMPANY_USE_CASES, USER_FUNCTIONS, reportedUseCase, reportedUserFunction, init_company_profile, mapTriggerSurface, init_telemetry_context, TELEMETRY_PROXY_ORIGIN, normalizeOrgWebsite, orgLogoUrl, isFilledOrgLogoUrl, init_org_website, beginRequestAuthScope, setRequestAuth, getRequestAuth, getCurrentRequestAuth, runWithoutRequestAuth, authUserId, authUser, isOperatorAuth, getCurrentRequestUserId, getCurrentRunProvenance, init_request_auth_context, setTelemetryIngestObserver, isTelemetryEnabled, _resolveIntegrationType, _resolveIntegrationProvider, initTelemetry, setTelemetryRoleResolver, setTelemetryFunctionResolver, isTelemetryReady, track, trackRelayed, telemetry, emitIntegrationConnected, init_telemetry, isRbacEnabled, decideAdmission, decideToolAdmission, grantLeadEquivalence, revokeLeadEquivalence, init_elevated_agents, LEGACY_RULES, setAuditSink, clearAuditSink, can, init_can, PermissionVerbSchema, init_rbac, randomChars, init_short_id, CHAT_SDK_ADAPTER_NAMES, CHAT_SDK_ADAPTER_SCHEMAS, ChatSdkAdaptersDraftSchema, firstIssueText, isAdapterEntryEnabled, init_schema, TELEMETRY_RANKING_KEY, PUBLIC_RANKING_ENABLED_KEY, RANKING_CATEGORIES, readTelemetryRanking, rankingFormSchema, buildListing, init_telemetry_ranking, resolveQuickJSPoolSize, init_quickjs_pool_config, SLACK_REACTION_DEFAULTS, SLACK_REACTION_CONFIG_KEYS, reactionName, isSlackIconConfigKey, reactionStatusIcon, iconPrefix, completedStatusIcon, init_reaction_shortcode, UI_SPEC_SCRIPT_ACTIONS_KEY, parseScriptActionAllowlist, init_script_allowlist, API_DRAINING_HEADER, API_DRAIN_MAX_MS_LIMIT, isApiDrainingResponse, init_api_drain2, isEnvExportRestrictedKey, init_config_env_export, parseEnabledTools, init_enabled_tools, parseFollowUpGateScheduleIds, isFollowUpGateScheduleId, init_follow_up_gate_schedule_ids, parseTaskToolManifest, CHAT_TASK_ONLY_TOOLS, isChatSdkTask, selectTaskTools, init_task_tool_manifest, tierConfigKey, init_model_tier_keys, isApiOnlyConfigKey, isInternalConfigKey, internalConfigKeyError, isHumanOnlyConfigKey, humanOnlyConfigKeyError, humanOnlyConfigKeyPageError, isReservedConfigKey, reservedKeyError, MAX_DB_RETENTION_DAYS, DB_RETENTION_TUNING_BOUNDS, APPS_JSON_COLUMN_MAX_BYTES_BOUNDS, CODEX_OAUTH_KEEP_WARM_MAX_AGE_HOURS_BOUNDS, validateRuntimeTokenTtlHours, validateControllerTokenTtlDays, validateControllerGraceSec, validateConfigValue, validateConfigEntry, validateExportToEnv, init_swarm_config_guard, cachedUserRole, cachedUserFunction, invalidateTelemetryUserRole, configureOrgDomainPersistence, recomputeOrgDomain, scheduleOrgDomainRecompute, init_telemetry_identity, resolveTriggerSurface, emitTaskTelemetry, init_telemetry_trigger, MASKED_SECRET_VALUE, init_config_secrets, HeartbeatExpiryError, init_heartbeat_expiry, isEffectiveOutputSchema, init_output_schema, isRuntimePoolsEnabled, init_runtime_pools_flag, normalizeDate, normalizeDateRequired, init_date_utils, rowToAgent, updateAgentCredentialState2, updateAgentCredentialMissing2, AgentDeletedError2, isAgentDeleted2, createAgent2, getAgentById2, EXTENSION_AGENT_ROLE2, NOT_EXTENSION_AGENT_SQL2, isExtensionAgent2, extensionAgentAssignmentError2, ReservedAgentRoleError2, reservedRoleViolation2, ExtensionAgentAssignmentError2, getAllAgents2, getAgentStatusCounts2, getLeadAgent2, updateAgentStatus2, updateAgentMaxTasks2, updateAgentProvider2, setAgentHarnessProvider2, updateAgentCredStatus2, listAgentsWithCredStatusByProvider2, getAgentHarnessProviders2, updateAgentActivity2, MAX_EMPTY_POLLS2, incrementEmptyPollCount2, resetEmptyPollCount2, shouldBlockPolling2, deleteAgent2, getActiveTaskCount2, hasCapacity2, getRemainingCapacity2, updateAgentStatusFromCapacity2, isPoolAffinityEnforcementEnabled2, buildRoutingAffinityFromAgent2, isAgentEligibleForTask2, getAgentDailyTaskCounts2, init_agents, closeSlackTreeIfSettled, getSlackThreadsOfTasks, slackThreadHasBotReplySince, slackThreadHasOutcomeWork, observeSlackTreeVisibility, getSlackProcessingThreads, init_slack_trees, WorkflowReplayStateError, init_workflow_replay, getWorkflowRunTriggeredByAgentId, getWorkflowRunSummary, getWorkflowRunStepsSlimByRunId, WORKFLOW_RUN_TREE_MAX_DEPTH, WorkflowRunTreeError, getRunLineageBlock, getWorkflowRunTreeIds, getWorkflowRunStatus, getOpenWorkflowTreeTaskIds, getTaskIdsWithDependents, workflowRunTreeHasOpenWork, getWorkflowRunTree, cancelOpenWorkflowTreeSteps, disarmWorkflowTreeRetries, cancelLiveWorkflowTreeRuns, getChildWorkflowRunId, isParentStepAttemptCurrent, getRunningSubWorkflowSteps, getWorkflowRunParent, getWorkflowRunLineage, getSettledChildRunParentSteps, emitRunFinished, createForeachChildSteps, createForeachAttemptSteps, init_workflow_runs, OpenAI2, init_openai2, LEARNING_TTL_DAYS, LEARNING_DUPLICATE_MIN_SIMILARITY, CANDIDATE_SET_MULTIPLIER, isGraphExpansionEnabled, EMBEDDING_DIMENSIONS, init_constants2, LONGTERM_ROOT, LEARNINGS_ROOT, MEMORY_KEY_PATTERN, MEMORY_KEY_PATTERN_MESSAGE, MEMORY_KEY_MAX_LENGTH, isLongtermKey, longtermKeyError, isConsolidatedKey, consolidatedKeyMessage, resolveStoreKey, init_key_paths, computeScore, rerank, init_reranker, isReviewTaskId, dropReviewTaskCompletions, init_review_recall_filter, searchMemoryCandidates, init_search_candidates, memorySearchReader, init_search_reader, rowToCandidate, init_sqlite_store, getEmbeddingProvider2, resetEmbeddingProvider2, getMemoryStore2, init_memory, embeddingProvider2, computeScriptEmbedding2, writeScriptEmbedding2, embedScript2, searchScripts2, reembedAllScripts2, init_embeddings, upsertScriptByName, getScript, getGlobalScriptContentHashes, getScriptById, getScriptVersion, listScripts, listScriptVersions, deleteScript, touchScratchScriptLastUsed, restoreScratchScriptLastUsedIfUnchanged, createScriptApi, listScriptApisForScript, getScriptApiById, getScriptApiSecret, updateScriptApi, rotateScriptApiSecret, deleteScriptApi, recordScriptApiUsage, init_db3, oauthSecretName, registerStoredSecret, loadSecretRegistry, init_secret_registry, getDefaultAuthorizationIdForProvider, getOAuthApp, getOAuthAppById, getOAuthAppIdByProvider, createOAuthApp, updateOAuthAppById, upsertOAuthApp, listAuthorizationsForApp, getAuthorizationById, upsertAuthorization, updateAuthorizationTokens, updateAuthorizationIdentity, deleteAuthorizationById, deleteAuthorizationsForApp, createOAuthPending, consumeOAuthPending, gcOAuthPending, markAuthorizationRefreshFailed, hasOAuthTokens, getOAuthTokens, listAuthorizationSweepRows, listKeepAliveAuthorizations, deleteOAuthTokens, acquireOAuthRefreshLock, releaseOAuthRefreshLock, init_oauth, normalizeVcsRepo, vcsRepoName, vcsRepoUrlMatches, init_vcs_repo_match, taskModelPin, resumedTaskModelSelection, init_model_pin, normalizeModelKey, init_pricing_normalize, buildModelsDevSeedRows, seedPricingFromModelsDev, init_seed_pricing, buildCatalogEntries, replaceModelCatalog, touchModelCatalogCheckedAt, countModelCatalog, getModelCatalogMeta, updateModelCatalogMeta, upsertModelCatalogOverlay, deleteModelCatalogOverlay, expireMatchedOverlays, applyOverlayPricingRows, reloadModelsCatalog, loadModelsCatalog, init_model_catalog_store, listHarnessModelSupport, recordHarnessModelSupport, agentRanModel, getAgentHarnessCliVersion, setAgentHarnessCliVersion, init_harness_model_support, sanitizeModelTierOverrides, parseModelTierOverridesHeader, modelTierOverridesDiffer, setAgentModelTierOverrides, previewModelTiers, recordClaimModelResolution, init_model_tier_resolution, harnessModelErrorFor, poolTaskRunsOnHarness, explicitModelError, explicitModelErrorForAgent, init_model_validation2, runtimeReadsRepoSecrets, configPools, checkProfileForAgent, formatProfileCheckFailures, init_model_profile_check, startTaskSearchBackfill, stopTaskSearchBackfill, init_search_index, rowToAgentTask, getTaskById2, getChildTasks2, TASK_LINEAGE_LIMITS2, getTaskLineage2, hasNonTerminalResumeChild2, SUPERSEDED_RESUME_REPAIR_WINDOW_MS2, getSupersededTasksWithoutResume2, getSupersededTasksWithUnsettledDependents2, hasNonTerminalRerouteDecisionChild2, getTasksByAgentId2, getTasksDispatchedFrom2, getAgentCurrentTask2, getTasksByStatus2, findTaskByVcs2, findActiveTasksByVcs2, findTaskByGitHub2, readableSessionCondition, getAllTasks2, getTasksCount2, getTaskStats2, getCompletedSlackTasks2, getPendingSlackRelayTasks2, markSlackRelayAttempted2, markSlackRelayDelivered2, markFinalizedSlackRelaysDelivered2, getPendingChatRelayTasks2, giveUpStaleChatRelays2, markChatRelayAttempted2, recordChatRelayError2, markChatRelayDelivered2, markChatRelayGivenUp2, getRecentlyFinishedWorkerTasks2, markTasksNotified2, resetTasksNotified2, getInProgressSlackTasks2, getSlackTasksMissingTree2, getInProgressTasksByContextKey2, isLinearTrackerContextKey2, findExistingLinearTrackerContextWork2, getLatestTaskByContextKey2, getLatestScriptRunStepTaskByContextKey2, getAgentWorkingOnThread2, getLatestActiveTaskInThread2, getLatestLeadTaskInThread2, getAgentWorkingOnContextKey2, getLatestTaskByContextKeyPrefix2, getLatestActiveTaskByContextKey2, getLatestLeadTaskByContextKey2, getFirstTaskInThread2, getMostRecentTaskInThread2, findCompletedTasksInThread2, findRecentFailedTaskInThread2, countAgentDispatchesInThread2, findRecentCancelledTaskInThread2, init_read, MODEL_PROFILE_CONFIG_KEY, hasUnreadableCredentialAllowlist, listModelProfiles, getModelProfileByName, createModelProfile, updateModelProfile, TASK_HOLDS_PROFILE_SQL, repairWindowStart, modelProfileReferences, modelProfileRefError, isModelNameTakenError, deleteModelProfile, MAX_MODEL_PROFILE_FALLBACKS, modelProfileFallbacksError, taskProfileError, scheduleProfileUpdate, init_model_profiles, SESSION_ACTIVITY_REFRESH_MIN_INTERVAL_MS2, refreshActiveSessionOnActivity2, getActiveSessionById, init_active_sessions, STEERING_MOVED_ERROR, SteeringRequestError, SteeringBlockedError, isSteeringEnabled, getTaskSteeringFields, getTaskSteeringFieldsForTasks, promotePendingSteeringForTask, markSteeringUndeliverable, carryUnhandledSteering, requestSteering, init_steering2, onTaskStarted, init_task_lifecycle_events, listApprovalRequestSummaries2, getPendingApprovalVoteState2, recordApprovalVotes2, getPendingApprovalsForTasks2, approvalCancellationNotificationKey, listUndeliveredCancelledApprovalRequestIds, init_approvals, computeContentHash2, createContextVersion2, getLatestContextVersion2, getContextVersion2, getContextVersionHistory2, AssetKeyMovesBlockedError2, assertAssetKeyMovesAllowed2, moveTaskChainKeyInTx2, moveSessionChains, moveKeyFavorites, listPrefixRoots, listSharedPrefixRoots, init_session_moves, getSessionGroupKey, sessionSummaryQuery, getSessionReadState, getSessionTree, triageSessionList, init_session_tree, setHumanFreeQueueListener, reclassifyTaskHumanFree, drainHumanFreeReclassifyQueue, init_human_free, channelTopic, addWorkerSubscription, removeWorkerSubscription, listSubscribedWorkerAgents, init_channels, publishWorkerNudge, init_worker_nudges, createTask2, getPendingTaskForAgent2, assignUnassignedTaskPending2, startTask2, updateTaskClaudeSessionId2, recordTaskProviderIfUnset2, updateTaskTitle2, updateTaskTags2, setTaskTitleIfUnset2, completeTask2, failTask2, overwriteTerminalTaskResultText2, cancelTask2, skipTask2, supersedeTask2, markWorkflowStepTaskSuperseded2, settleSupersededTaskDependents2, backfillSupersedeTaskResumeTaskId2, pauseTask2, resumeTask2, getPausedTasksForAgent2, getOrphanedInProgressTasksForAgent2, resetOrphanedInProgressTasksForAgent2, getRecentlyCancelledTasksForAgent2, deleteTask2, updateTaskProgress2, init_write, quoteSqlIdentifier, USER_REFERENCE_COLUMNS_SQL, userReferenceRewriteSql, WORKFLOW_CONTEXT_REQUESTER_SQL, init_user_references, IdempotencyKeyTakenError, workflowRequestFingerprint, findAcceptedWorkflowOperation, assertWorkflowIdempotencyKeyUnused, recordAcceptedWorkflowOperation, init_workflow_idempotency, PINNED_WORKFLOW_KEYS2, toPinnedDefinition2, pinWorkflowDefinition2, getRunWorkflow2, deleteOrphanedRunDefinitions, init_workflow_run_definitions, recordKeySeatMismatch2, recordKeyValidation2, retirePoolKeyStatus, init_api_keys, getScriptRunExecutionArgs2, getScriptRunFollowUpGuard2, setScriptRunFollowUpGuard2, setSkillUpdatedBy2, literalPrefixPattern2, getSlackRenderV2ActivatedAt2, ensureSlackRenderV2Activation2, getSlackDelegationActivatedAt2, ensureSlackDelegationActivation2, isPendingSlackMessage2, isSettledSlackMessage2, recordSlackMessage2, reserveSlackMessage2, bindSlackMessageTimestamp2, updateSlackMessageRecord2, markSlackTreeRendered2, deleteSlackMessageRecord2, getSlackTreeMessage2, getSlackTreeMessageByThread2, getSlackOutcomeMessage2, getResolvableDeferralOutcomes2, markSlackDeferralResolved2, noteSlackOutcomeDeliveryFailure2, abandonSlackOutcomeDelivery2, getSlackTreeMessages2, getSlackMessageByChannelTs2, getSlackTasksInThread2, listSlackThreadsAwaitingHuman2, isSlackThreadAwaitingHuman2, markTaskSlackReplySent2, setSlackMessageTracking2, updateTaskVcs2, insertTaskAttachment2, recordTaskPullRequestAttachments2, getAssetKeyMappingByProvider2, upsertAssetKeyMapping2, getAssetKeyMapping2, listAssetSummaries2, moveAssetKey2, deleteTaskAttachment2, replaceTaskAttachment2, getTaskAttachments2, createSteeringMessage2, getSteeringMessagesForTask2, getSteeringMessageById2, getPendingSteeringForTask2, getPendingSteeringForAgent2, markSteeringDelivered2, markSteeringHandled2, markSteeringPromoted2, cancelPendingSteeringForTask2, hasPendingSteering2, getAgentWithTasks2, getAllAgentsWithTasks2, createLogEntry2, getLogsByAgentId2, getLogsByTaskId2, getLogsByTaskIdAndEventType2, getLogsByTaskIdChronological2, getLogsByEventType2, getAllLogs2, findRecentSimilarTasks2, createTaskExtended2, claimTask2, releaseTask2, acceptTask2, rejectTask2, moveTaskToBacklog2, moveTaskFromBacklog2, promoteDraftTask2, refreshDraftTaskLease2, promoteAbandonedDraftTasks2, releaseStaleReviewingTasks2, releaseStaleOfferedTasksForOfflineAgents2, getOfferedTasksForAgent2, claimOfferedTask2, getUnassignedTasksCount2, getUnassignedTaskIds2, getUnassignedTaskIdsForAgent2, checkDependencies2, getDependentTasks2, cascadeFailDependents2, updateAgentProfile2, updateAgentName2, createChannel2, getMessageById2, getChannelById2, getChannelByName2, getAllChannels2, deleteChannel2, postMessage2, getChannelMessages2, updateReadState2, getLastReadAt2, getUnreadMessages2, getMentionsForAgent2, getInboxSummary2, claimMentions2, releaseMentionProcessing2, releaseStaleMentionProcessing2, createService2, getServiceById2, getServiceByAgentAndName2, getServicesByAgentId2, getAllServices2, updateServiceStatus2, deleteService2, upsertService2, deleteServicesByAgentId2, createSessionLogs2, getSessionLogsByTaskId2, getSessionLogsBySession2, createSessionCost2, getSessionCostsByTaskId2, getSessionCostsByAgentId2, getAllSessionCosts2, getSessionCostsFiltered2, UNATTRIBUTED_USER_ID2, getSessionCostSummary2, getAttributionByPerson2, getDashboardCostSummary2, createInboxMessage2, getInboxMessageById2, getUnreadInboxMessages2, claimInboxMessages2, markInboxMessageRead2, markInboxMessageResponded2, markInboxMessageDelegated2, releaseStaleProcessingInbox2, getConcurrentContext2, getScheduledTasks2, getScheduledTaskById2, getScheduledTaskByName2, createScheduledTask2, updateScheduledTask2, deleteScheduledTask2, getDueScheduledTasks2, autoEncryptLegacyPlaintextSecrets2, maskSecrets2, getSwarmConfigs2, getInjectableGlobalConfigs2, getSwarmConfigById2, getSwarmConfigLookupById2, upsertSwarmConfig2, emitBuiltInIntegrationConnectedOnce2, deleteSwarmConfig2, deleteSwarmConfigByKey2, getResolvedConfig2, getSwarmRepos2, getSwarmRepoById2, getSwarmRepoByName2, getSwarmRepoByUrl2, createSwarmRepo2, updateSwarmRepo2, deleteSwarmRepo2, getAgentMailInboxMapping2, getAgentMailInboxMappingsByAgent2, getAllAgentMailInboxMappings2, createAgentMailInboxMapping2, deleteAgentMailInboxMapping2, findTaskByAgentMailThread2, insertActiveSession2, deleteActiveSession2, deleteActiveSessionById2, getActiveSessions2, heartbeatActiveSession2, cleanupStaleSessions2, cleanupAgentSessions2, updateActiveSessionProviderSessionId2, getActiveSessionForTask2, reassociateSessionLogs2, getStalledInProgressTasks2, getStalePinnedResumes2, failPendingResumeIfUnclaimed2, getIdleWorkersWithCapacity2, getUnassignedPoolTasks2, getStaleUnassignedAffinityTasks2, getRecentFailedTasks2, getRecentCompletedCount2, getRecentFailedCount2, createWorkflow2, getWorkflow2, listWorkflows2, updateWorkflow2, deleteWorkflow2, getWorkflowsByScheduleId2, createWorkflowRun2, getWorkflowRun2, updateWorkflowRun2, listWorkflowRuns2, countWorkflowRuns2, listWorkflowRunsPage2, createWorkflowRunStep2, getWorkflowRunStep2, updateWorkflowRunStep2, getWorkflowRunStepsByRunId2, getStuckWorkflowRuns2, getLastSuccessfulRun2, getLastRunStart2, getRetryableSteps2, getCompletedStepNodeIds2, getTaskByWorkflowRunStepId2, detachTaskFromWorkflowRunStep2, getStepByIdempotencyKey2, getStepCountForNode2, getLatestStepForNode2, getCurrentStepForNode2, createWorkflowVersion2, getWorkflowVersions2, getWorkflowVersion2, createAppVersion2, getAppVersions2, getAppVersion2, createPage2, getPage2, getPageBySlug2, getLatestPageBySlug2, listPagesByAgent2, listAllPages2, countAllPages2, countPagesByAgent2, updatePage2, deletePage2, incrementPageViewCount2, createPageVersion2, getPageVersions2, getPageVersion2, createMetric2, getMetric2, getMetricBySlug2, listMetricsByAgent2, listAllMetrics2, countAllMetrics2, countMetricsByAgent2, updateMetric2, deleteMetric2, createMetricVersion2, getMetricVersions2, getMetricVersion2, getPromptTemplates2, getPromptTemplateById2, upsertPromptTemplate2, deletePromptTemplate2, resetPromptTemplateToDefault2, getPromptTemplateHistory2, resolvePromptTemplate2, checkoutPromptTemplate2, getAllChannelActivityCursors2, getChannelActivityCursor2, upsertChannelActivityCursor2, createApprovalRequest2, getApprovalRequestById2, resolveApprovalRequest2, cancelApprovalRequestById2, cancelPendingApprovalRequestsForRun2, listCancelledApprovalRequestsForRun2, listCancelledApprovalRequestsForStep2, claimApprovalCancellationNotification2, completeApprovalCancellationNotificationClaim2, releaseApprovalCancellationNotificationClaim2, updateApprovalRequestNotifications2, listApprovalRequests2, getStuckApprovalRuns2, getApprovalRequestByStepId2, getExpiredPendingApprovals2, getStaleApprovalRequests2, createWaitState2, getWaitStateById2, getWaitStateByStepId2, getDueWaitStates2, getPendingEventWaitNames2, getPendingWaitsByEvent2, resolveWaitState2, getStuckWaitRuns2, SKILL_FILE_LIMITS2, normalizeSkillFilePath2, createSkill2, updateSkill2, listSkillFileManifest2, getSkillFiles2, getSkillFile2, upsertSkillFile2, upsertSkillFiles2, deleteSkillFile2, deleteSkill2, getSkillById2, getSkillByName2, listSkills2, searchSkills2, installSkill2, getSystemDefaultSkills2, installSystemDefaultSkillsForAgent2, uninstallSkill2, getAgentSkills2, toggleAgentSkill2, createMcpServer2, emitMcpServerConnectedTelemetry2, updateMcpServer2, deleteMcpServer2, getMcpServerById2, getMcpServerByName2, listMcpServers2, installMcpServer2, uninstallMcpServer2, getAgentMcpServers2, createContextSnapshot2, getContextSnapshotsByTaskId2, getContextSnapshotsBySessionId2, getContextSummaryByTaskId2, getAvailableKeyIndices2, recordKeyUsage2, setApiKeyPlan2, markKeyRateLimited2, recordKeyAuthFailure2, recordKeyRateLimitWindows2, setApiKeyName2, clearKeyRateLimit2, getKeyStatuses2, getKeyCostSummary2, getUserById2, getAllUsers2, createUser2, updateUser2, deleteUser2, listInboxState2, upsertInboxState2, listFavorites2, listUserFavorites2, getFavoriteItemIdSet2, setFavorite2, setUserFavorite2, withFavoriteFlags2, listTaskTemplates2, getRootTaskChain2, listRecentSessions2, countSessions2, getBudget2, getBudgets2, upsertBudget2, deleteBudget2, getAllPricingRows2, getPricingRows2, getActivePricingRow2, insertPricingRow2, deletePricingRow2, getDailySpendForAgent2, getDailySpendGlobal2, getDailySpendForUser2, recordBudgetRefusalNotification2, getBudgetRefusalNotification2, getRecentBudgetRefusalNotifications2, hasBudgetRefusalNotificationToday2, setBudgetRefusalFollowUpTaskId2, getLiveAgentCounts2, getReadyAgentCounts2, getInstanceActivity2, getSwarmMetrics2, hasFirstCompletedTask2, getKv2, sweepExpiredKv2, sweepExpiredKvPrefix2, upsertKv2, claimKv2, deleteKv2, KvTypeCollisionError2, incrKv2, kvPrefixUpperBound2, listKv2, countKv2, createScriptRun2, recordInlineScriptRun2, getScriptRun2, getScriptRunByIdempotencyKey2, listScriptRuns2, countScriptRuns2, countActiveScriptRuns2, updateScriptRun2, updateScriptRunIfNotTerminal2, updateScriptRunIfRunning2, getRunningScriptRuns2, getScriptRunJournalStep2, upsertScriptRunJournalStep2, listScriptRunJournalSteps2, countScriptRunJournalSteps2, countScriptRunJournalAgentTaskSteps2, exports_db, init_db4 };