@desplega.ai/agent-swarm 2.8.3 → 2.9.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 (491) hide show
  1. package/dist/acp-adapter-jqn86aam.js +16 -0
  2. package/dist/acp-targets-swxq55dr.js +23 -0
  3. package/dist/{actions-ewz7bp4g.js → actions-pb678g3e.js} +20 -19
  4. package/dist/agent-fs-provision-dmhnc38q.js +27 -0
  5. package/dist/{amp-adapter-f25tqhnf.js → amp-adapter-3pa66q27.js} +3 -3
  6. package/dist/{anthropic-messages-jkva0zps.js → anthropic-messages-x2cp5fvf.js} +41 -41
  7. package/dist/{app-mkptw0k7.js → app-17d12ev4.js} +6 -4
  8. package/dist/approval-notifications-h7vd9pmg.js +20 -0
  9. package/dist/{assistant-c47rfe77.js → assistant-t7k39ree.js} +54 -33
  10. package/dist/{azure-openai-responses-wgtqkbr3.js → azure-openai-responses-590s1eea.js} +10 -10
  11. package/dist/{boot-args-schema-4vb0xsat.js → boot-args-schema-0gqmkfbe.js} +1 -1
  12. package/dist/{boot-reembed-1ghy2sab.js → boot-reembed-f064w382.js} +1 -1
  13. package/dist/{boot-reembed-htr73hbs.js → boot-reembed-n6anc01d.js} +1 -1
  14. package/dist/{boot-scrub-sweep-yrytg42z.js → boot-scrub-sweep-ejd5dnrz.js} +84 -13
  15. package/dist/{boot-seeds-n2b3dx4e.js → boot-seeds-f99fjs5q.js} +4 -4
  16. package/dist/{boxd-jmfqgkqa.js → boxd-wn235q80.js} +7 -7
  17. package/dist/claude-adapter-gvznwxgc.js +28 -0
  18. package/dist/{claude-managed-adapter-hddmxjyj.js → claude-managed-adapter-pbrbvc64.js} +4 -4
  19. package/dist/{claude-managed-setup-hfvry1bd.js → claude-managed-setup-kdxttvc3.js} +10 -10
  20. package/dist/{claude-sdk-session-0hamqzc7.js → claude-sdk-session-0t2teq6n.js} +9386 -9196
  21. package/dist/{cli-yjdgea32.js → cli-1jx0srjt.js} +17 -17
  22. package/dist/{cli-s8p8hhty.js → cli-1tvdx9t5.js} +2 -2
  23. package/dist/{cli-s7zz734a.js → cli-25nstr34.js} +1 -1
  24. package/dist/{cli-kw44j53p.js → cli-2kg31ted.js} +45 -38
  25. package/dist/{cli-mwwmka77.js → cli-2tnbc3gw.js} +375 -127
  26. package/dist/{cli-4dpkjc2e.js → cli-3zxdz9r7.js} +9 -9
  27. package/dist/{cli-mdpbjnzq.js → cli-4ghh072d.js} +14 -14
  28. package/dist/{cli-54qr8mcd.js → cli-57pvhnyt.js} +4 -4
  29. package/dist/{cli-f1kwb5fc.js → cli-5a6pqy45.js} +333 -21
  30. package/dist/{cli-93t5s4zq.js → cli-5gpqgs8b.js} +2 -2
  31. package/dist/{cli-4ax9mvvg.js → cli-5gygrr67.js} +9 -9
  32. package/dist/{cli-t5ys4ebm.js → cli-5kcmxwxv.js} +3 -3
  33. package/dist/{cli-k96cecs7.js → cli-5ntc4we6.js} +2948 -316
  34. package/dist/{cli-15204js0.js → cli-6237rnyr.js} +1 -1
  35. package/dist/cli-6dp0jkfj.js +754 -0
  36. package/dist/{cli-k2rw11py.js → cli-7831nhaw.js} +5 -5
  37. package/dist/{cli-7c5tgqhf.js → cli-7cgf614g.js} +10 -10
  38. package/dist/{cli-z8cvws4c.js → cli-7fx9jyfs.js} +852 -55
  39. package/dist/{cli-pe4d96rb.js → cli-7zm3b3f5.js} +1 -1
  40. package/dist/{cli-0bcgyj5b.js → cli-812paz57.js} +69 -6
  41. package/dist/{cli-ztq5z4e1.js → cli-8axx8vnw.js} +4 -4
  42. package/dist/cli-8x8y70av.js +103 -0
  43. package/dist/{cli-6yygkr0w.js → cli-95930z69.js} +15 -7
  44. package/dist/{cli-sdvcrq5x.js → cli-9a2rtd77.js} +16 -14
  45. package/dist/cli-9ttx00s3.js +137 -0
  46. package/dist/{cli-6ek0hff4.js → cli-a9hfzg2r.js} +3 -3
  47. package/dist/{cli-am1ptset.js → cli-aa8s22gn.js} +19 -14
  48. package/dist/{cli-4e1hfbpq.js → cli-bk9v1xrv.js} +19 -19
  49. package/dist/{cli-e2w34h6z.js → cli-c07v0qfa.js} +98 -54
  50. package/dist/{cli-dpsfwh7n.js → cli-c5cspahx.js} +24 -24
  51. package/dist/{cli-gpz1d0t2.js → cli-cw7mc1je.js} +4 -4
  52. package/dist/{cli-qmqt520k.js → cli-dd37e0cm.js} +2 -2
  53. package/dist/cli-dqgnbnxs.js +132 -0
  54. package/dist/{cli-tnzebztn.js → cli-dx439zpg.js} +1 -1
  55. package/dist/{cli-q6mfk1ej.js → cli-dzzh58sy.js} +2 -2
  56. package/dist/{cli-knva3nmx.js → cli-e9973bf0.js} +8 -6
  57. package/dist/{cli-2znm3dzj.js → cli-eds5xnsz.js} +2 -2
  58. package/dist/{cli-crpf163n.js → cli-eepnpee7.js} +16 -26
  59. package/dist/{cli-nx2n3z6p.js → cli-eg437b5p.js} +1 -1
  60. package/dist/{cli-zdaypkq9.js → cli-faf46gdq.js} +285 -97
  61. package/dist/{cli-tas6ckky.js → cli-fgphc007.js} +2 -2
  62. package/dist/{cli-sg27rk2t.js → cli-fnh4b12r.js} +24 -18
  63. package/dist/{cli-fsgttth8.js → cli-g0vv9dg4.js} +13 -13
  64. package/dist/{cli-rqfvkx5t.js → cli-g3zzby8t.js} +13 -13
  65. package/dist/{cli-kd56bmk4.js → cli-gabsjg8x.js} +3 -1
  66. package/dist/{cli-tf79ryyy.js → cli-gddgcnav.js} +3 -3
  67. package/dist/{cli-rjvsf9qa.js → cli-h474mvp5.js} +11 -11
  68. package/dist/{cli-5a7szzfh.js → cli-hnamkvnc.js} +2 -2
  69. package/dist/{cli-8bpgbr8k.js → cli-j49yqpvh.js} +6 -6
  70. package/dist/{cli-awwptga4.js → cli-jd3kxppb.js} +1 -1
  71. package/dist/{cli-1m96dc36.js → cli-js8zrfyg.js} +3 -3
  72. package/dist/{cli-vx421edw.js → cli-k09cxm6m.js} +9 -7
  73. package/dist/{cli-n5t077me.js → cli-k7pt28ad.js} +10 -3
  74. package/dist/{cli-922z7gwm.js → cli-kaa4bd7x.js} +9 -6
  75. package/dist/cli-kj0hyr43.js +51 -0
  76. package/dist/{cli-c0xjnr8z.js → cli-kmvcm34h.js} +2 -2
  77. package/dist/{cli-0vksaxvr.js → cli-kqh27v2y.js} +2 -2
  78. package/dist/{cli-bj6qhgte.js → cli-m1fbz2wj.js} +30 -37
  79. package/dist/{cli-me0r8gzr.js → cli-mc1fx4xd.js} +27 -25
  80. package/dist/{cli-qps8je6j.js → cli-me4maa4j.js} +46 -6
  81. package/dist/{cli-504akrp9.js → cli-meydjstb.js} +3 -3
  82. package/dist/{cli-n30e0hcp.js → cli-mna6pmfx.js} +2 -2
  83. package/dist/{cli-yss07azk.js → cli-nhq5js1b.js} +3 -3
  84. package/dist/cli-nmcpzbty.js +296 -0
  85. package/dist/cli-nr46j5pw.js +78 -0
  86. package/dist/{cli-t4dv07kr.js → cli-pn1v1pb0.js} +1 -1
  87. package/dist/{cli-c71n3bxq.js → cli-pwsax0vp.js} +2 -2
  88. package/dist/{cli-9zmb7ptc.js → cli-pz1c00aa.js} +8 -753
  89. package/dist/{cli-emekyyhr.js → cli-q2d3e1k1.js} +1 -1
  90. package/dist/{cli-zeaehgyd.js → cli-q8cfh1t9.js} +2 -2
  91. package/dist/{cli-vqva1teb.js → cli-qe909n63.js} +2 -2
  92. package/dist/{cli-2d0cghfn.js → cli-qj39vrc6.js} +1 -1
  93. package/dist/{cli-0agcv1v5.js → cli-rqx70rcz.js} +2 -2
  94. package/dist/{cli-gn9y6fn7.js → cli-rts1qvb4.js} +2 -2
  95. package/dist/{cli-pxwtcgcp.js → cli-sn4pc4qx.js} +2 -2
  96. package/dist/{cli-98rwmcyc.js → cli-snxhtehz.js} +3 -3
  97. package/dist/{cli-d829z3xc.js → cli-spfz393q.js} +6 -6
  98. package/dist/{cli-6wj7p986.js → cli-spzkdgtg.js} +3 -3
  99. package/dist/{cli-m2z8jagn.js → cli-srtkr1h2.js} +18 -18
  100. package/dist/{cli-8476gtwf.js → cli-ssvdrk4y.js} +1 -1
  101. package/dist/{cli-c3ng0mb4.js → cli-svc803vq.js} +69 -816
  102. package/dist/{cli-500c09j9.js → cli-t9ga4qmb.js} +14 -14
  103. package/dist/{cli-j8cjdzan.js → cli-vs9vdpy0.js} +1 -1
  104. package/dist/{cli-bhsfbmk8.js → cli-vvgaz8t6.js} +93 -44
  105. package/dist/{cli-kmemts3w.js → cli-vw5x18yj.js} +39 -69
  106. package/dist/{cli-x3ex5bqf.js → cli-w16kwbzw.js} +1 -1
  107. package/dist/cli-w7dxb2fj.js +921 -0
  108. package/dist/{cli-x6t50dmw.js → cli-wr1h0k28.js} +3 -3
  109. package/dist/{cli-skmhsnqh.js → cli-x40a0w9j.js} +1 -1
  110. package/dist/{cli-k28wkapa.js → cli-xf1wn5ns.js} +2 -2
  111. package/dist/{cli-rh15cakt.js → cli-xwsm6xkr.js} +1 -1
  112. package/dist/{cli-h9yy18gy.js → cli-ymct0ycy.js} +262 -100
  113. package/dist/{cli-dtdht77h.js → cli-zg3z63x3.js} +2 -2
  114. package/dist/cli.js +27 -24
  115. package/dist/{codex-adapter-2brxx5ta.js → codex-adapter-44yq2fkn.js} +9 -8
  116. package/dist/{codex-hook-c930c3ea.js → codex-hook-h1zb7cfk.js} +6 -6
  117. package/dist/{codex-login-cbrs1h5w.js → codex-login-cdyrr5y1.js} +1 -1
  118. package/dist/{codex-session-runner-y9anfj0r.js → codex-session-runner-zbh26gbw.js} +10 -9
  119. package/dist/{commands-wn9q06qr.js → commands-54f02v5b.js} +3 -3
  120. package/dist/{controller-fw608czd.js → controller-9gpwcdek.js} +6 -6
  121. package/dist/{controllers-connect-63j5rdcm.js → controllers-connect-61re6k1n.js} +26 -25
  122. package/dist/{cursor-adapter-6mb9jme8.js → cursor-adapter-7e4g81vd.js} +2 -2
  123. package/dist/{db-y4wfrzbm.js → db-dg2gc7fd.js} +15 -13
  124. package/dist/{db-0m6v5tq4.js → db-wnh0qjy1.js} +3 -3
  125. package/dist/{devin-adapter-r0yx3gv8.js → devin-adapter-zp4tqq53.js} +1 -1
  126. package/dist/{dispatcher-9tq2zzdj.js → dispatcher-jrm24r43.js} +19 -18
  127. package/dist/{docker-j75atvpt.js → docker-9aq30pp2.js} +5 -5
  128. package/dist/{dsh-adapter-t09sv4tq.js → dsh-adapter-1yqk267c.js} +2 -2
  129. package/dist/{e2b-a7vzs2vj.js → e2b-3v1e745x.js} +6 -6
  130. package/dist/{e2b-7s9dscap.js → e2b-sm28k0k3.js} +6 -6
  131. package/dist/{easter-egg-3d-fbwvmwhe.js → easter-egg-3d-r4h9cs9m.js} +1 -1
  132. package/dist/{embedding-space-wh8de1t9.js → embedding-space-bafjr5f7.js} +6 -6
  133. package/dist/{embeddings-3hpbdtjr.js → embeddings-7xmgqe0e.js} +1 -1
  134. package/dist/{event-bus-tr6h3gv8.js → event-bus-xr83x566.js} +1 -1
  135. package/dist/{execute-4bdf8sdy.js → execute-d6jg5ns0.js} +1 -1
  136. package/dist/{external-channel-ts2fwqh0.js → external-channel-frq1xvq2.js} +2 -2
  137. package/dist/fx-adapter-0zrkfbkd.js +19 -0
  138. package/dist/{getMachineId-bsd-nfgrzarv.js → getMachineId-bsd-637a7rbk.js} +3 -3
  139. package/dist/{getMachineId-darwin-wz886dsk.js → getMachineId-darwin-9vytrcnn.js} +3 -3
  140. package/dist/{getMachineId-linux-1nng3p1p.js → getMachineId-linux-mkzsvyyz.js} +3 -3
  141. package/dist/{getMachineId-unsupported-a0428vw9.js → getMachineId-unsupported-4cfs2n11.js} +3 -3
  142. package/dist/{getMachineId-win-h45922nq.js → getMachineId-win-154s3qma.js} +3 -3
  143. package/dist/{google-generative-ai-h7s3e9kk.js → google-generative-ai-hh7strj3.js} +1 -1
  144. package/dist/{google-vertex-fhxaafzw.js → google-vertex-fy5bw2pm.js} +5 -5
  145. package/dist/grok-adapter-3db1c538.js +19 -0
  146. package/dist/handlers-k22n8mnn.js +33 -0
  147. package/dist/{heartbeat-2ze5fzpc.js → heartbeat-6bpa611t.js} +22 -21
  148. package/dist/{hook-ca54yd4s.js → hook-hvm5nf46.js} +5 -5
  149. package/dist/{hook-gaehe2w5.js → hook-w12k146y.js} +14 -14
  150. package/dist/{http-jfg8t2yk.js → http-43tthdvs.js} +1684 -509
  151. package/dist/{index-d6wkh8ar.js → index-1f0vypbg.js} +2 -2
  152. package/dist/{index-enn321kd.js → index-42jq9yy3.js} +3 -3
  153. package/dist/{index-khe3gp0k.js → index-4b1q8kan.js} +20 -20
  154. package/dist/{index-hjhfk3ra.js → index-585gyczt.js} +1 -1
  155. package/dist/index-8xcyd3mc.js +33 -0
  156. package/dist/index-9sy2bh6n.js +38 -0
  157. package/dist/{index-2skqtd76.js → index-b24j7t2m.js} +30 -28
  158. package/dist/{index-gjwaqaq8.js → index-cret47a5.js} +6 -6
  159. package/dist/{index-qwj6ntem.js → index-e3krvkh2.js} +4 -4
  160. package/dist/{index-csgrxedz.js → index-fn054vsf.js} +1 -1
  161. package/dist/{index-3yvzbhxd.js → index-ftywhyr0.js} +129 -142
  162. package/dist/{index-3gv6sc4z.js → index-mhq4sh5w.js} +1 -1
  163. package/dist/index-tx9mc2ap.js +570 -0
  164. package/dist/index-wjd56k1v.js +34 -0
  165. package/dist/{keepalive-k2a3qe73.js → keepalive-rk0j0jvh.js} +4 -4
  166. package/dist/lead-atxf3q6e.js +72 -0
  167. package/dist/{maintenance-gb5sd5nc.js → maintenance-g6z6kaxw.js} +1 -1
  168. package/dist/{node-252anz2h.js → node-jftbyawr.js} +4 -4
  169. package/dist/{node-ray25snp.js → node-zd6shky9.js} +3 -3
  170. package/dist/{oauth-refresh-sweep-y7rm6bkb.js → oauth-refresh-sweep-2k3g2q4w.js} +3 -3
  171. package/dist/{onboard-jmc5qerv.js → onboard-6fdbvh3v.js} +8 -8
  172. package/dist/{openai-codex-responses-k9gapdze.js → openai-codex-responses-bkcd8pjj.js} +9 -9
  173. package/dist/{openai-responses-4d5dx3c7.js → openai-responses-gbh0wfqe.js} +13 -13
  174. package/dist/{opencode-adapter-7eade9ev.js → opencode-adapter-fdbsvts7.js} +7 -6
  175. package/dist/{otel-impl-8j1xhxqd.js → otel-impl-rvwtc09q.js} +110 -110
  176. package/dist/pending-sqkrb836.js +80 -0
  177. package/dist/{pi-mono-adapter-yqmaf32x.js → pi-mono-adapter-asqayqcg.js} +12 -12
  178. package/dist/{pricing-refresh-1nj722h6.js → pricing-refresh-f5tkgmw2.js} +2 -2
  179. package/dist/{rbac-roles-b1mtr6dr.js → rbac-roles-06s555fa.js} +3 -3
  180. package/dist/{rbac-roles-n1f3frk1.js → rbac-roles-szxsg8t1.js} +10 -3
  181. package/dist/{render-v2-1gfpd8rj.js → render-v2-103p266q.js} +4 -4
  182. package/dist/{resume-w1s1eh5v.js → resume-v7kjewt9.js} +8 -7
  183. package/dist/{runtime-84g5egsc.js → runtime-f1gmk0b7.js} +1 -1
  184. package/dist/{session-access-y6z1txk4.js → session-access-6shev8ts.js} +4 -4
  185. package/dist/{session-source-backfill-gxxwfh12.js → session-source-backfill-bd7spzjd.js} +3 -3
  186. package/dist/{setup-r91gstyk.js → setup-kmxmztdb.js} +1 -1
  187. package/dist/thread-buffer-4yz236d0.js +36 -0
  188. package/dist/{virtual-modules-cgnj6kme.js → virtual-modules-57eje5wy.js} +5 -5
  189. package/dist/{work-objects-qcxzg61c.js → work-objects-zr47ygmf.js} +23 -21
  190. package/dist/{worker-follow-up-y2d2h7km.js → worker-follow-up-grrr3fda.js} +19 -18
  191. package/dist/worker-p4hbtcy3.js +72 -0
  192. package/dist/{x-qhxq2ama.js → x-wg164ss9.js} +2 -2
  193. package/openapi.json +1211 -155
  194. package/package.json +9 -6
  195. package/plugin/commands/create-pr.md +1 -1
  196. package/plugin/pi-skills/create-pr/SKILL.md +1 -1
  197. package/src/apps/action-runner.ts +21 -1
  198. package/src/apps/catalog.generated.json +626 -17
  199. package/src/apps/page-validator.ts +314 -8
  200. package/src/assets/key.ts +6 -0
  201. package/src/be/agent-fs-user-keys.ts +186 -0
  202. package/src/be/audit-user.ts +27 -13
  203. package/src/be/automation-preflight.test.ts +14 -14
  204. package/src/be/automation-preflight.ts +24 -16
  205. package/src/be/boot-scrub-sweep.ts +143 -14
  206. package/src/be/caller-session-group.ts +86 -0
  207. package/src/be/checklist.ts +375 -0
  208. package/src/be/db/agents.ts +12 -1
  209. package/src/be/db/approvals.ts +26 -0
  210. package/src/be/db/session-moves.ts +23 -0
  211. package/src/be/db/session-tree.ts +78 -19
  212. package/src/be/db/tasks/eligibility-scan.ts +14 -0
  213. package/src/be/db/tasks/slack-fold.ts +116 -0
  214. package/src/be/db/tasks/write.ts +34 -0
  215. package/src/be/db-queries/mcp-servers.ts +13 -0
  216. package/src/be/db-queries/oauth.ts +6 -0
  217. package/src/be/db-queries/task-artifacts.ts +10 -8
  218. package/src/be/db.ts +42 -15
  219. package/src/be/extensions/assets.ts +17 -13
  220. package/src/be/import/config.ts +54 -0
  221. package/src/be/import/dir-source.ts +372 -0
  222. package/src/be/import/index.ts +149 -0
  223. package/src/be/import/pending.ts +71 -0
  224. package/src/be/import/schema.ts +137 -0
  225. package/src/be/import/seeders.ts +462 -0
  226. package/src/be/migrations/297_import_ownership.sql +34 -0
  227. package/src/be/migrations/301_favorites_key_type.sql +36 -0
  228. package/src/be/migrations/302_checklist_items.sql +23 -0
  229. package/src/be/multi-runtime.ts +8 -1
  230. package/src/be/rbac-roles.ts +8 -1
  231. package/src/be/runtime-pools/demand.ts +20 -2
  232. package/src/be/runtime-pools/reachability.ts +31 -0
  233. package/src/be/runtime-pools/routing.ts +8 -1
  234. package/src/be/runtime-pools/supervisor.ts +6 -7
  235. package/src/be/savings/read.ts +8 -6
  236. package/src/be/script-credential-broker.ts +2 -2
  237. package/src/be/scripts/typecheck.ts +4 -4
  238. package/src/be/seed/agent-fs-provision.ts +104 -19
  239. package/src/be/seed/index.ts +1 -1
  240. package/src/be/seed/registry.ts +27 -8
  241. package/src/be/seed/runner.ts +1 -1
  242. package/src/be/seed/schedules-seeder.ts +24 -6
  243. package/src/be/seed/seed-toggle.ts +32 -0
  244. package/src/be/seed/types.ts +6 -0
  245. package/src/be/seed-scripts/catalog/dreaming-gather.ts +2 -2
  246. package/src/be/steering.ts +27 -4
  247. package/src/be/swarm-config-guard.ts +30 -0
  248. package/src/be/task-citations.ts +8 -5
  249. package/src/commands/onboard/agent-fs-version.ts +1 -1
  250. package/src/commands/runner.ts +61 -2
  251. package/src/e2b/env.ts +2 -0
  252. package/src/extensions/catalog.generated.json +17 -0
  253. package/src/extensions/contract-types.generated.ts +1 -1
  254. package/src/github/app.ts +10 -1
  255. package/src/github/handlers.ts +6 -3
  256. package/src/github/reactions.ts +12 -14
  257. package/src/heartbeat/heartbeat.ts +14 -4
  258. package/src/http/agents.ts +19 -10
  259. package/src/http/all-routes.ts +2 -0
  260. package/src/http/approval-requests.ts +24 -4
  261. package/src/http/apps.ts +69 -5
  262. package/src/http/checklist.ts +176 -0
  263. package/src/http/db-query-bounded.ts +256 -11
  264. package/src/http/db-query-shared.ts +9 -0
  265. package/src/http/favorites.ts +14 -2
  266. package/src/http/fs.ts +346 -1
  267. package/src/http/index.ts +29 -1
  268. package/src/http/kv.ts +13 -0
  269. package/src/http/mcp-oauth.ts +1 -1
  270. package/src/http/mcp-servers.ts +15 -2
  271. package/src/http/onboarding.ts +2 -9
  272. package/src/http/poll.ts +45 -0
  273. package/src/http/script-connections.ts +1 -0
  274. package/src/http/sessions.ts +17 -0
  275. package/src/http/slack-events.ts +101 -0
  276. package/src/http/status.ts +25 -7
  277. package/src/http/task-requester.ts +46 -0
  278. package/src/http/tasks.ts +64 -37
  279. package/src/http/users.ts +14 -0
  280. package/src/http/webhooks.ts +15 -0
  281. package/src/integrations/cards/index.ts +151 -0
  282. package/src/integrations/chat-sdk/outbound.ts +39 -13
  283. package/src/integrations/chat-sdk/runtime.ts +7 -1
  284. package/src/integrations/chat-sdk/status.ts +17 -0
  285. package/src/integrations/chat-sdk/telegram-api.ts +6 -1
  286. package/src/kv-reserved-namespaces.ts +17 -2
  287. package/src/oauth/presets.ts +29 -2
  288. package/src/prompts/base-prompt.ts +17 -4
  289. package/src/prompts/session-templates.ts +83 -6
  290. package/src/providers/acp-targets.ts +1 -1
  291. package/src/providers/amp-adapter.ts +1 -1
  292. package/src/providers/claude-managed-adapter.ts +5 -1
  293. package/src/providers/codex-adapter.ts +1 -1
  294. package/src/providers/codex-app-server.ts +2 -11
  295. package/src/providers/opencode-adapter.ts +7 -19
  296. package/src/providers/runtime-dependencies.ts +158 -0
  297. package/src/rbac/legacy-policy.ts +2 -0
  298. package/src/rbac/permissions.ts +10 -1
  299. package/src/scripts-runtime/credential-broker/default-bindings.ts +19 -11
  300. package/src/scripts-runtime/credential-broker/index.ts +1 -1
  301. package/src/scripts-runtime/egress-secrets.ts +2 -2
  302. package/src/scripts-runtime/swarm-sdk.ts +3 -2
  303. package/src/scripts-runtime/types/stdlib.d.ts +11 -4
  304. package/src/scripts-runtime/types/swarm-extension.d.ts +1 -1
  305. package/src/scripts-runtime/types/swarm-sdk.d.ts +11 -4
  306. package/src/server.ts +4 -4
  307. package/src/slack/app.ts +87 -46
  308. package/src/slack/assistant.ts +33 -7
  309. package/src/slack/handlers.ts +6 -4
  310. package/src/slack/http-receiver.ts +284 -0
  311. package/src/slack/inbound-dispatch.ts +43 -7
  312. package/src/slack/inbound-files.ts +33 -14
  313. package/src/slack/message-text.ts +47 -4
  314. package/src/slack/render-v2.ts +2 -1
  315. package/src/slack/socket-ack.ts +17 -10
  316. package/src/slack/steering.ts +5 -0
  317. package/src/slack/thread-buffer-store.ts +58 -0
  318. package/src/slack/thread-buffer.ts +341 -57
  319. package/src/tasks/context-key.ts +24 -0
  320. package/src/tasks/sibling-awareness.ts +13 -1
  321. package/src/tests/agent-fs-live-url.test.ts +15 -0
  322. package/src/tests/agent-fs-provision-seeder.test.ts +140 -0
  323. package/src/tests/agent-fs-user-keys.test.ts +483 -0
  324. package/src/tests/agentfs-proxy.test.ts +8 -8
  325. package/src/tests/approval-card-resolution.test.ts +396 -0
  326. package/src/tests/approval-requests-notifications.test.ts +1 -1
  327. package/src/tests/approval-respond-auth.test.ts +28 -0
  328. package/src/tests/apps-action-parent-task.test.ts +140 -0
  329. package/src/tests/apps-catalog-additions.test.ts +315 -0
  330. package/src/tests/apps-catalog-files.test.ts +114 -0
  331. package/src/tests/apps-catalog-hitl.test.ts +117 -0
  332. package/src/tests/apps-catalog-inputs.test.ts +86 -0
  333. package/src/tests/apps-catalog-table.test.ts +47 -0
  334. package/src/tests/apps-chart-shell.test.ts +1 -1
  335. package/src/tests/apps-element-assembly.test.ts +52 -3
  336. package/src/tests/apps-session-thread.test.ts +182 -0
  337. package/src/tests/asset-key-invariants.test.ts +14 -0
  338. package/src/tests/base-prompt.test.ts +107 -23
  339. package/src/tests/boot-scrub-sweep.test.ts +172 -0
  340. package/src/tests/caller-session-group.test.ts +199 -0
  341. package/src/tests/cards.test.ts +169 -0
  342. package/src/tests/chat-sdk-status-route.test.ts +16 -3
  343. package/src/tests/chat-sdk-telegram-token.test.ts +76 -0
  344. package/src/tests/chat-sdk-tools.test.ts +147 -0
  345. package/src/tests/checklist-nudge.test.ts +208 -0
  346. package/src/tests/checklist.test.ts +686 -0
  347. package/src/tests/codex-app-server.test.ts +16 -0
  348. package/src/tests/comb-config-guard.test.ts +21 -0
  349. package/src/tests/comb-default.test.ts +59 -97
  350. package/src/tests/comb-links.test.ts +86 -16
  351. package/src/tests/comb-status.test.ts +24 -27
  352. package/src/tests/create-page-tool.test.ts +101 -1
  353. package/src/tests/create-schedule-key.test.ts +105 -0
  354. package/src/tests/credential-broker.test.ts +2 -2
  355. package/src/tests/db-query.test.ts +87 -1
  356. package/src/tests/db-task-read-contract.test.ts +1 -0
  357. package/src/tests/db-task-write-contract.test.ts +2 -1
  358. package/src/tests/docs-index-footprint.test.js +3 -3
  359. package/src/tests/entrypoint-github-enterprise.test.ts +158 -0
  360. package/src/tests/extensions-assets.test.ts +7 -3
  361. package/src/tests/extensions-catalog.test.ts +1 -0
  362. package/src/tests/extensions-example-sql-admin-only.test.ts +198 -0
  363. package/src/tests/extensions-pre-task.test.ts +3 -3
  364. package/src/tests/extensions-steering.test.ts +14 -2
  365. package/src/tests/favorites-agent-fs-path.test.ts +124 -0
  366. package/src/tests/fetch-resolved-env.test.ts +68 -0
  367. package/src/tests/fixtures/import-package.ts +32 -0
  368. package/src/tests/fixtures/runner-missing-dependency.ts +129 -0
  369. package/src/tests/fs-routes.test.ts +505 -2
  370. package/src/tests/github-ghes-mock.test.ts +196 -0
  371. package/src/tests/github-host.test.ts +285 -0
  372. package/src/tests/heartbeat-supersede-resume.test.ts +73 -0
  373. package/src/tests/heartbeat.test.ts +56 -0
  374. package/src/tests/import-config.test.ts +209 -0
  375. package/src/tests/import.test.ts +464 -0
  376. package/src/tests/invites-http.test.ts +144 -1
  377. package/src/tests/kv-http.test.ts +11 -0
  378. package/src/tests/literal-matcher.test.ts +58 -0
  379. package/src/tests/mcp-oauth-manual-client.test.ts +1 -1
  380. package/src/tests/oauth-presets.test.ts +12 -0
  381. package/src/tests/pool-affinity.test.ts +50 -0
  382. package/src/tests/prompt-template-session.test.ts +52 -5
  383. package/src/tests/provider-registration.test.ts +2 -55
  384. package/src/tests/provider-runtime-dependencies.test.ts +212 -0
  385. package/src/tests/rbac-admission.test.ts +19 -0
  386. package/src/tests/rbac-charact-misc-tools.test.ts +31 -0
  387. package/src/tests/rbac-engine.test.ts +2 -0
  388. package/src/tests/rbac-roles.test.ts +2 -0
  389. package/src/tests/runner-missing-dependency.test.ts +61 -0
  390. package/src/tests/runtime-pool-reachability.test.ts +135 -1
  391. package/src/tests/runtime-pool-routing.test.ts +52 -0
  392. package/src/tests/runtime-stale-threshold.test.ts +40 -0
  393. package/src/tests/savings-fleet-slices.test.ts +122 -0
  394. package/src/tests/savings-read.test.ts +41 -0
  395. package/src/tests/savings-scripts.test.ts +9 -3
  396. package/src/tests/script-connections.test.ts +2 -0
  397. package/src/tests/script-executor-conformance.test.ts +41 -4
  398. package/src/tests/secret-scrub-gate.test.ts +257 -0
  399. package/src/tests/seed-registry.test.ts +142 -9
  400. package/src/tests/session-source-keys.test.ts +42 -1
  401. package/src/tests/sessions-move.test.ts +70 -0
  402. package/src/tests/sessions-tree.test.ts +98 -0
  403. package/src/tests/sessions.test.ts +69 -0
  404. package/src/tests/slack-config.test.ts +4 -18
  405. package/src/tests/slack-http-receiver.test.ts +472 -0
  406. package/src/tests/slack-inbound-logging.test.ts +64 -0
  407. package/src/tests/slack-leave-thread.test.ts +1 -1
  408. package/src/tests/slack-message-text.test.ts +104 -0
  409. package/src/tests/slack-mode-lifecycle.test.ts +6 -4
  410. package/src/tests/slack-render-v2.test.ts +48 -0
  411. package/src/tests/slack-skip-reaction.test.ts +2 -2
  412. package/src/tests/slack-steering.test.ts +22 -10
  413. package/src/tests/slack-thread-buffer-context.test.ts +1 -1
  414. package/src/tests/slack-thread-buffer-fold.test.ts +417 -0
  415. package/src/tests/slack-thread-buffer-restore.test.ts +198 -0
  416. package/src/tests/slack-thread-buffer-startup-restore.test.ts +86 -0
  417. package/src/tests/slack-thread-buffer.test.ts +34 -34
  418. package/src/tests/slack-thread-participants.test.ts +23 -5
  419. package/src/tests/slack-tool-blocks.test.ts +167 -0
  420. package/src/tests/status.test.ts +32 -6
  421. package/src/tests/steering-core.test.ts +13 -0
  422. package/src/tests/steering-enabled.test.ts +7 -1
  423. package/src/tests/steering-promotion.test.ts +24 -0
  424. package/src/tests/swarm-config-reserved-keys.test.ts +17 -0
  425. package/src/tests/system-one-hosts-ui-mirror.test.ts +67 -0
  426. package/src/tests/task-artifacts.test.ts +50 -0
  427. package/src/tests/task-session-prompts.test.ts +95 -1
  428. package/src/tests/workflow-system-one-extraction.test.ts +149 -1
  429. package/src/tools/chat-post.ts +19 -4
  430. package/src/tools/chat-reply.ts +20 -4
  431. package/src/tools/create-page.ts +21 -4
  432. package/src/tools/get-swarm.ts +18 -2
  433. package/src/tools/join-swarm.ts +2 -1
  434. package/src/tools/kv/kv-write-auth.ts +17 -1
  435. package/src/tools/schedules/create-schedule.ts +22 -4
  436. package/src/tools/slack-post.ts +40 -7
  437. package/src/tools/slack-reply.ts +50 -14
  438. package/src/types.ts +43 -2
  439. package/src/utils/constants.ts +60 -138
  440. package/src/utils/github-host.ts +217 -0
  441. package/src/utils/github-pull-request.ts +8 -5
  442. package/src/utils/literal-matcher.ts +118 -0
  443. package/src/utils/secret-scrubber.ts +331 -25
  444. package/src/utils/task-attachment-links.ts +9 -12
  445. package/src/vcs/index.ts +3 -0
  446. package/src/workflows/approval-notifications.ts +188 -12
  447. package/src/workflows/executors/system-one-extraction.ts +14 -7
  448. package/src/workflows/executors/system-one-providers.ts +22 -1
  449. package/templates/community/open-prompt-showreel/PLAYBOOK.md +1 -1
  450. package/templates/community/open-prompt-showreel/skills/open-prompt-showreel/SKILL.md +1 -1
  451. package/templates/extensions/README.md +1 -0
  452. package/templates/extensions/sql-admin-only/README.md +19 -0
  453. package/templates/extensions/sql-admin-only/hooks.ts +96 -0
  454. package/templates/extensions/sql-admin-only/manifest.json +8 -0
  455. package/templates/import/manifest.schema.json +136 -0
  456. package/templates/import/sources.schema.json +44 -0
  457. package/templates/skills/agent-browser/SKILL.md +1 -1
  458. package/templates/skills/agent-browser/content.md +1 -1
  459. package/templates/skills/apps/SKILL.md +122 -12
  460. package/templates/skills/apps/content.md +122 -12
  461. package/templates/skills/asset-namespaces/content.md +2 -1
  462. package/templates/skills/chat-sdk/content.md +17 -0
  463. package/templates/skills/db-query-guidance/content.md +2 -1
  464. package/templates/skills/scheduling/content.md +27 -0
  465. package/templates/skills/slack-interaction/content.md +12 -2
  466. package/templates/skills/swarm-docs/content.md +1 -0
  467. package/templates/skills/swarm-extensions/config.json +1 -1
  468. package/templates/skills/swarm-extensions/content.md +33 -23
  469. package/templates/skills/swarm-scripts/SKILL.md +13 -0
  470. package/templates/skills/swarm-scripts/content.md +13 -0
  471. package/templates/skills/work-on-task/SKILL.md +1 -1
  472. package/templates/skills/work-on-task/content.md +1 -1
  473. package/templates/skills/workflow-iterate/content.md +4 -7
  474. package/templates/workflows/dreaming/content.md +2 -2
  475. package/dist/acp-adapter-xq6s2z6t.js +0 -14
  476. package/dist/claude-adapter-r33pqnzx.js +0 -24
  477. package/dist/cli-dns0y538.js +0 -194
  478. package/dist/fx-adapter-1rnxnf56.js +0 -17
  479. package/dist/grok-adapter-efhmf1r8.js +0 -17
  480. package/dist/handlers-anrr3py9.js +0 -32
  481. package/dist/index-8w2aznds.js +0 -33
  482. package/dist/index-qnjvr362.js +0 -37
  483. package/dist/index-yzxd3sn9.js +0 -32
  484. package/dist/lead-zhxqbfdv.js +0 -69
  485. package/dist/worker-7j2907g6.js +0 -69
  486. package/src/tests/entrypoint-acp-target-binary.test.ts +0 -439
  487. package/dist/{cli-4caa1x7d.js → cli-tsa40663.js} +4 -4
  488. package/dist/{index-0rvk3vd4.js → index-bs7gw5fd.js} +3 -3
  489. package/dist/{mistral-conversations-a45tx39a.js → mistral-conversations-0c30em7t.js} +4 -4
  490. package/dist/{openai-completions-xd579js7.js → openai-completions-f3n69rep.js} +18 -18
  491. package/dist/{pi-messages-hjbv8v10.js → pi-messages-zebyt7gb.js} +5 -5
@@ -3,11 +3,18 @@ import {
3
3
  ampPinCatalogError,
4
4
  ampModelError,
5
5
  init_amp_models
6
- } from "./cli-tf79ryyy.js";
6
+ } from "./cli-gddgcnav.js";
7
7
  import {
8
8
  ALL_TOOLS,
9
9
  init_tool_config
10
10
  } from "./cli-0b4zam62.js";
11
+ import {
12
+ CODEX_AUTH_FAILURE_BENCH_THRESHOLD,
13
+ CODEX_AUTH_FAILURE_BENCH_MS,
14
+ CODEX_AUTH_WATCH_NAMESPACE,
15
+ codexAuthBenchMarkerKey,
16
+ init_codex_auth_failure
17
+ } from "./cli-fw2w0kva.js";
11
18
  import {
12
19
  normalizeAssetKey,
13
20
  defaultAssetKey,
@@ -15,6 +22,8 @@ import {
15
22
  SESSION_RESOURCE_KINDS,
16
23
  SESSION_LEAF_KINDS,
17
24
  NO_GROUP_LEAF_KINDS,
25
+ isGroupKey,
26
+ isResourceGroupPrefix,
18
27
  sessionResourceGroupOf,
19
28
  sessionGroupKey,
20
29
  parseAssetKey,
@@ -41,15 +50,14 @@ import {
41
50
  VersionableFieldSchema,
42
51
  SessionCostModelBreakdownSchema,
43
52
  PageThemeTokensSchema,
44
- init_types4
45
- } from "./cli-qps8je6j.js";
53
+ init_types5
54
+ } from "./cli-me4maa4j.js";
46
55
  import {
47
- CODEX_AUTH_FAILURE_BENCH_THRESHOLD,
48
- CODEX_AUTH_FAILURE_BENCH_MS,
49
- CODEX_AUTH_WATCH_NAMESPACE,
50
- codexAuthBenchMarkerKey,
51
- init_codex_auth_failure
52
- } from "./cli-fw2w0kva.js";
56
+ resolveGitHubHost,
57
+ getGitHubLinkConfig,
58
+ getGitHubHostForSql,
59
+ init_github_host
60
+ } from "./cli-9ttx00s3.js";
53
61
  import {
54
62
  generateDefaultClaudeMd2,
55
63
  generateDefaultSoulMd2,
@@ -64,7 +72,7 @@ import {
64
72
  init_identity_field_budget,
65
73
  contentSha256,
66
74
  init_profile_sync
67
- } from "./cli-am1ptset.js";
75
+ } from "./cli-aa8s22gn.js";
68
76
  import {
69
77
  isSlackConfigured,
70
78
  init_config4
@@ -96,7 +104,7 @@ import {
96
104
  splitCredentialPool,
97
105
  selectCredential,
98
106
  init_credentials2
99
- } from "./cli-t4dv07kr.js";
107
+ } from "./cli-pn1v1pb0.js";
100
108
  import {
101
109
  registerTemplate,
102
110
  getAllTemplateDefinitions,
@@ -104,12 +112,12 @@ import {
104
112
  configureDbResolver,
105
113
  init_resolver,
106
114
  init_session_templates
107
- } from "./cli-0bcgyj5b.js";
115
+ } from "./cli-812paz57.js";
108
116
  import {
109
117
  setRuntimeModelCatalog,
110
118
  runtimeHarnessSections,
111
119
  init_runtime_model_catalog
112
- } from "./cli-2d0cghfn.js";
120
+ } from "./cli-qj39vrc6.js";
113
121
  import {
114
122
  init_zod
115
123
  } from "./cli-zcfpsfzf.js";
@@ -130,22 +138,22 @@ import {
130
138
  literal2,
131
139
  exports_iso
132
140
  } from "./cli-hg42n3hx.js";
133
- import {
134
- init_package,
135
- package_default
136
- } from "./cli-922z7gwm.js";
137
- import {
138
- realtimeBus,
139
- init_bus
140
- } from "./cli-syfdvhkc.js";
141
141
  import {
142
142
  isEnvFlagEnabled,
143
143
  init_env_flag
144
144
  } from "./cli-cebvbc9t.js";
145
+ import {
146
+ init_package,
147
+ package_default
148
+ } from "./cli-kaa4bd7x.js";
145
149
  import {
146
150
  getNodeEnv,
147
151
  init_node_env
148
152
  } from "./cli-rgeadyvq.js";
153
+ import {
154
+ realtimeBus,
155
+ init_bus
156
+ } from "./cli-syfdvhkc.js";
149
157
  import {
150
158
  chatgptSubscriptionModelId,
151
159
  isAlias,
@@ -168,7 +176,7 @@ import {
168
176
  registerVolatileSecret,
169
177
  registerSensitiveKeyName,
170
178
  init_secret_scrubber
171
- } from "./cli-f1kwb5fc.js";
179
+ } from "./cli-5a6pqy45.js";
172
180
  import {
173
181
  __toCommonJS,
174
182
  __commonJS,
@@ -300,6 +308,14 @@ function pageContextKey(input) {
300
308
  const pageId = assertSafePart(input.pageId, "pageId");
301
309
  return ["task", "page", pageId].join(SEPARATOR);
302
310
  }
311
+ function appSessionContextKey(input) {
312
+ if (!APP_SESSION_KEY_PATTERN.test(input.sessionKey)) {
313
+ throw new Error("sessionKey must match ^[A-Za-z0-9_-]{1,128}$");
314
+ }
315
+ const appId = assertSafePart(input.appId, "appId");
316
+ const userId = assertSafePart(input.userId, "userId");
317
+ return ["task", "app", appId, input.sessionKey, "user", userId].join(SEPARATOR);
318
+ }
303
319
  function parseContextKey(key) {
304
320
  if (typeof key !== "string" || key.length === 0) {
305
321
  throw new Error("context-key: key must be a non-empty string");
@@ -460,8 +476,10 @@ function parseContextKey(key) {
460
476
  throw new Error(`context-key: unknown family "${family}": ${JSON.stringify(key)}`);
461
477
  }
462
478
  }
463
- var SEPARATOR = ":";
464
- var init_context_key = () => {};
479
+ var SEPARATOR = ":", APP_SESSION_KEY_PATTERN;
480
+ var init_context_key = __esm(() => {
481
+ APP_SESSION_KEY_PATTERN = /^[A-Za-z0-9_-]{1,128}$/;
482
+ });
465
483
 
466
484
  // src/assets/source-key.ts
467
485
  function sessionSourceKey({
@@ -3416,12 +3434,14 @@ var init_broker = __esm(() => {
3416
3434
  });
3417
3435
 
3418
3436
  // src/scripts-runtime/credential-broker/default-bindings.ts
3419
- var DEFAULT_CREDENTIAL_BINDINGS;
3420
- var init_default_bindings = __esm(() => {
3421
- DEFAULT_CREDENTIAL_BINDINGS = [
3437
+ var defaultCredentialBindings = () => {
3438
+ const host = resolveGitHubHost();
3439
+ if (!host.ok)
3440
+ return [];
3441
+ return [
3422
3442
  {
3423
3443
  configKey: "GITHUB_TOKEN",
3424
- allowedHosts: ["api.github.com"],
3444
+ allowedHosts: [host.config.apiHost],
3425
3445
  headerTemplate: "Authorization: Bearer [REDACTED:GITHUB_TOKEN]",
3426
3446
  scope: "global",
3427
3447
  scopeId: null,
@@ -3429,6 +3449,9 @@ var init_default_bindings = __esm(() => {
3429
3449
  authKind: "config"
3430
3450
  }
3431
3451
  ];
3452
+ };
3453
+ var init_default_bindings = __esm(() => {
3454
+ init_github_host();
3432
3455
  });
3433
3456
 
3434
3457
  // src/utils/egress-guard.ts
@@ -5240,7 +5263,7 @@ function seedContextVersions() {
5240
5263
  var db = null, sqliteVecAvailable = false, cachedSqliteVecExtensionPath = null, dbClientInstance = null, VERSIONABLE_FIELDS;
5241
5264
  var init_runtime2 = __esm(() => {
5242
5265
  init_resolver();
5243
- init_types4();
5266
+ init_types5();
5244
5267
  init_asset_key_audit();
5245
5268
  init_connection_bindings_blob_migration();
5246
5269
  init_crypto();
@@ -5254,7 +5277,7 @@ var init_runtime2 = __esm(() => {
5254
5277
  // src/telemetry-identity.ts
5255
5278
  async function loadUserRole(userId) {
5256
5279
  try {
5257
- const { getUserGrant } = await import("./rbac-roles-b1mtr6dr.js");
5280
+ const { getUserGrant } = await import("./rbac-roles-06s555fa.js");
5258
5281
  const grant = await getUserGrant(userId);
5259
5282
  const role = grant.grantsAll ? "admin" : "member";
5260
5283
  const user = await getDbClient2().get("SELECT json_extract(metadata, '$.jobFunction') AS jobFunction FROM users WHERE id = ? AND json_valid(metadata)", [userId]);
@@ -5467,7 +5490,8 @@ var init_config_secrets = () => {};
5467
5490
  function parseGitHubPullRequestToken(token) {
5468
5491
  const candidate = token.replace(TRAILING_PROSE_PUNCTUATION_RE, "");
5469
5492
  const lowerCandidate = candidate.toLowerCase();
5470
- if (!lowerCandidate.startsWith("https://github.com/") && !lowerCandidate.startsWith("http://github.com/") && !lowerCandidate.startsWith("github.com/")) {
5493
+ const { host, webUrl } = getGitHubLinkConfig();
5494
+ if (!lowerCandidate.startsWith(`https://${host}/`) && !lowerCandidate.startsWith(`http://${host}/`) && !lowerCandidate.startsWith(`${host}/`)) {
5471
5495
  return null;
5472
5496
  }
5473
5497
  const withScheme = /^https?:\/\//i.test(candidate) ? candidate : `https://${candidate}`;
@@ -5477,7 +5501,7 @@ function parseGitHubPullRequestToken(token) {
5477
5501
  } catch {
5478
5502
  return null;
5479
5503
  }
5480
- if (parsed.host.toLowerCase() !== "github.com" || parsed.username.length > 0 || parsed.password.length > 0) {
5504
+ if (parsed.host.toLowerCase() !== host || parsed.username.length > 0 || parsed.password.length > 0) {
5481
5505
  return null;
5482
5506
  }
5483
5507
  const [owner, repo, pull, numberText] = parsed.pathname.split("/").filter(Boolean);
@@ -5485,7 +5509,7 @@ function parseGitHubPullRequestToken(token) {
5485
5509
  return null;
5486
5510
  }
5487
5511
  return {
5488
- url: `https://github.com/${owner}/${repo}/pull/${numberText}`,
5512
+ url: `${webUrl}/${owner}/${repo}/pull/${numberText}`,
5489
5513
  owner,
5490
5514
  repo,
5491
5515
  number: Number(numberText)
@@ -5510,6 +5534,7 @@ function extractGitHubPullRequestUrls(text) {
5510
5534
  }
5511
5535
  var CANDIDATE_TOKEN_RE, TRAILING_PROSE_PUNCTUATION_RE, GITHUB_PATH_SEGMENT_RE;
5512
5536
  var init_github_pull_request = __esm(() => {
5537
+ init_github_host();
5513
5538
  CANDIDATE_TOKEN_RE = /[^\s()[\]{}<>"'`]+/g;
5514
5539
  TRAILING_PROSE_PUNCTUATION_RE = /[)\]},.;:!]+$/;
5515
5540
  GITHUB_PATH_SEGMENT_RE = /^[\w.-]+$/;
@@ -5710,6 +5735,12 @@ async function createAgent2(agent) {
5710
5735
  } catch (err) {
5711
5736
  console.warn("[db] Failed to install system-default skills for new agent:", err.message);
5712
5737
  }
5738
+ let importChanged = false;
5739
+ try {
5740
+ importChanged = await dependencies.resolvePendingImportAssignments({ id, name: agent.name });
5741
+ } catch (err) {
5742
+ console.warn("[db] Failed to apply pending import assignments for new agent:", err.message);
5743
+ }
5713
5744
  try {
5714
5745
  await dependencies.createLogEntry({
5715
5746
  eventType: "agent_joined",
@@ -5717,7 +5748,7 @@ async function createAgent2(agent) {
5717
5748
  newValue: agent.status
5718
5749
  });
5719
5750
  } catch {}
5720
- return rowToAgent(row);
5751
+ return importChanged ? await getAgentById2(id) ?? rowToAgent(row) : rowToAgent(row);
5721
5752
  }
5722
5753
  async function getAgentById2(id) {
5723
5754
  const row = await getDbClient2().get("SELECT * FROM agents WHERE id = ?", [id]);
@@ -5925,7 +5956,7 @@ async function getAgentDailyTaskCounts2(agentId, days) {
5925
5956
  }
5926
5957
  var dependencies, EXTENSION_AGENT_ROLE2 = "extension", NOT_EXTENSION_AGENT_SQL2, ReservedAgentRoleError2, ExtensionAgentAssignmentError2, MAX_EMPTY_POLLS2 = 2;
5927
5958
  var init_agents = __esm(() => {
5928
- init_types4();
5959
+ init_types5();
5929
5960
  init_env_flag();
5930
5961
  init_runtime2();
5931
5962
  NOT_EXTENSION_AGENT_SQL2 = `COALESCE(role, '') != '${EXTENSION_AGENT_ROLE2}'`;
@@ -6028,6 +6059,12 @@ async function listUndeliveredCancelledApprovalRequestIds(runIds) {
6028
6059
  }
6029
6060
  return ids;
6030
6061
  }
6062
+ function scheduleApprovalCardUpdates(approvals) {
6063
+ const posted = approvals.filter((approval) => approval.notificationChannels?.some((n) => n.channel === "slack" && n.messageTs));
6064
+ if (posted.length === 0)
6065
+ return;
6066
+ getDbClient2().afterCommit(() => import("./approval-notifications-h7vd9pmg.js").then(({ updateResolvedApprovalCards }) => updateResolvedApprovalCards(posted)).catch((err) => console.error("[HITL] Slack card update not run:", scrubSecrets(err instanceof Error ? err.message : String(err)))));
6067
+ }
6031
6068
  var init_approvals = __esm(() => {
6032
6069
  init_secret_scrubber();
6033
6070
  init_date_utils();
@@ -6346,6 +6383,8 @@ var init_legacy_policy = __esm(() => {
6346
6383
  "session.read.all": operatorOrUser,
6347
6384
  "task.progress.write": taskProgressWrite,
6348
6385
  "favorite.write.own": anyAuthenticated,
6386
+ "checklist.write.own": anyAuthenticated,
6387
+ "checklist.write.agent": leadOnly,
6349
6388
  "memory.learning.inject": leadOnly,
6350
6389
  "memory.edit.any": leadOrResourceOwner,
6351
6390
  "memory.write.consolidated": leadOnly,
@@ -6542,6 +6581,14 @@ var init_permissions = __esm(() => {
6542
6581
  description: "Opt in to read every user's tasks and sessions (the dashboard's All users scope). Read-only: writes and steering still need the principal's own access.",
6543
6582
  namespace: "task"
6544
6583
  },
6584
+ "checklist.write.own": {
6585
+ description: "Edit checklist items the caller owns.",
6586
+ namespace: "checklist"
6587
+ },
6588
+ "checklist.write.agent": {
6589
+ description: "Change a user's checklist items as an agent. Only the Lead.",
6590
+ namespace: "checklist"
6591
+ },
6545
6592
  "favorite.write.own": {
6546
6593
  description: "Set a favorite the caller owns.",
6547
6594
  namespace: "favorite"
@@ -6735,7 +6782,7 @@ var init_permissions = __esm(() => {
6735
6782
  namespace: "mcp-oauth"
6736
6783
  },
6737
6784
  "kv.write.any": {
6738
- description: "Write another agent's task:agent: KV namespace.",
6785
+ description: "Write another agent's task:agent: KV namespace, or a lead-only family (usecase:*).",
6739
6786
  namespace: "kv"
6740
6787
  },
6741
6788
  "comb.presence": {
@@ -7845,7 +7892,7 @@ function validateTierConfigValue(key, value) {
7845
7892
  var TIER_CONFIG_KEY_RE;
7846
7893
  var init_model_tier_keys = __esm(() => {
7847
7894
  init_src2();
7848
- init_types4();
7895
+ init_types5();
7849
7896
  init_runtime_model_catalog();
7850
7897
  TIER_CONFIG_KEY_RE = new RegExp(`^MODEL_TIER_(${ProviderNameSchema.options.map((p) => p.toUpperCase().replace(/-/g, "_")).join("|")})_(${MODEL_TIERS.map((t) => t.toUpperCase()).join("|")})$`);
7851
7898
  });
@@ -8245,7 +8292,7 @@ var DEFAULT_MODEL_LATEST_SOAK_DAYS = 2, OverridesSchema, CATALOG_TTL_MS = 30000,
8245
8292
  var init_model_tier_resolution = __esm(() => {
8246
8293
  init_src2();
8247
8294
  init_zod();
8248
- init_types4();
8295
+ init_types5();
8249
8296
  init_db4();
8250
8297
  init_model_profiles();
8251
8298
  init_harness_model_support();
@@ -9909,7 +9956,7 @@ var dependencies2, TASK_PREVIEW_LENGTH = 300, TASK_PREVIEW_BYTES, SIBLING_OPEN =
9909
9956
  ELSE 3000 * (1 << obligation.attempt_count) END)`, SLACK_MISSING_TREE_WINDOW_MS, LINEAR_TRACKER_CONTEXT_KEY_PREFIX = "task:trackers:linear:";
9910
9957
  var init_read = __esm(() => {
9911
9958
  init_key();
9912
- init_types4();
9959
+ init_types5();
9913
9960
  init_output_schema();
9914
9961
  init_provider_metadata();
9915
9962
  init_secret_scrubber();
@@ -10232,7 +10279,7 @@ var MODEL_PROFILE_CONFIG_KEY = "MODEL_PROFILE", unreadableAllowlists, TASK_HOLDS
10232
10279
  SELECT 1 FROM model_profiles o, json_each(CASE WHEN json_valid(o.fallbacks) THEN o.fallbacks ELSE '[]' END) j
10233
10280
  WHERE j.value = model_profiles.name AND o.name <> model_profiles.name)`, MAX_MODEL_PROFILE_FALLBACKS = 10;
10234
10281
  var init_model_profiles = __esm(() => {
10235
- init_types4();
10282
+ init_types5();
10236
10283
  init_model_profile_check();
10237
10284
  init_runtime2();
10238
10285
  init_read();
@@ -10263,7 +10310,7 @@ function parsePageThemeTokens(raw) {
10263
10310
  }
10264
10311
  }
10265
10312
  var init_page_theme_tokens = __esm(() => {
10266
- init_types4();
10313
+ init_types5();
10267
10314
  });
10268
10315
 
10269
10316
  // src/be/db/session-visibility.ts
@@ -10380,6 +10427,16 @@ async function moveSessionChains(input) {
10380
10427
  }
10381
10428
  return moved;
10382
10429
  }
10430
+ async function moveKeyFavorites(input) {
10431
+ const { lo, hi } = keyPrefixRange(input.from);
10432
+ const scoped = input.scope !== undefined;
10433
+ const range = `itemType = 'key' AND itemId >= ? AND itemId < ?${scoped ? " AND favoriteScope = ?" : ""}`;
10434
+ const rangeParams = [lo, hi, ...scoped ? [input.scope] : []];
10435
+ await getDbClient2().transaction(async () => {
10436
+ await getDbClient2().run(`UPDATE OR IGNORE user_favorites SET itemId = ? || substr(itemId, ?) WHERE ${range}`, [input.to, lo.length + 1, ...rangeParams]);
10437
+ await getDbClient2().run(`DELETE FROM user_favorites WHERE ${range}`, rangeParams);
10438
+ });
10439
+ }
10383
10440
  async function listPrefixRoots(input) {
10384
10441
  const { lo, hi } = keyPrefixRange(input.from);
10385
10442
  return getDbClient2().query(`SELECT r.id, r."key" FROM agent_tasks r
@@ -10529,6 +10586,9 @@ function effectiveSourceSql() {
10529
10586
  params: ranges.flatMap(({ source, lo, hi }) => [lo, hi, source])
10530
10587
  };
10531
10588
  }
10589
+ function showsScheduleRuns(groupKey) {
10590
+ return isGroupKey(groupKey) && !sourceOfKey(groupKey) && !isResourceGroupPrefix(groupKey);
10591
+ }
10532
10592
  function sessionRootFilter(opts = {}) {
10533
10593
  const conditions = [];
10534
10594
  const params = [];
@@ -10536,6 +10596,11 @@ function sessionRootFilter(opts = {}) {
10536
10596
  conditions.push(fragment.sql);
10537
10597
  params.push(...fragment.params);
10538
10598
  };
10599
+ const scheduleRuns = opts.includeScheduleRuns || !!opts.groupKey && showsScheduleRuns(opts.groupKey);
10600
+ const includeScheduled = (fragment) => ({
10601
+ ...fragment,
10602
+ sql: scheduleRuns ? `(${fragment.sql} OR r.scheduleId IS NOT NULL)` : fragment.sql
10603
+ });
10539
10604
  if (opts.rootId)
10540
10605
  add({ sql: "r.id = ?", params: [opts.rootId] });
10541
10606
  const sources = opts.source?.filter(Boolean) ?? [];
@@ -10552,10 +10617,10 @@ function sessionRootFilter(opts = {}) {
10552
10617
  if (opts.showSource) {
10553
10618
  const shown = opts.showSource.filter(Boolean);
10554
10619
  const source = effectiveSourceSql();
10555
- add(shown.length ? {
10620
+ add(includeScheduled(shown.length ? {
10556
10621
  sql: `${source.sql} IN (${shown.map(() => "?").join(",")})`,
10557
10622
  params: [...source.params, ...shown]
10558
- } : { sql: "0", params: [] });
10623
+ } : { sql: "0", params: [] }));
10559
10624
  }
10560
10625
  if (opts.q?.trim()) {
10561
10626
  const like = `%${opts.q.trim().toLowerCase()}%`;
@@ -10575,14 +10640,21 @@ function sessionRootFilter(opts = {}) {
10575
10640
  if (opts.viewer) {
10576
10641
  add(sessionViewerCondition(opts.viewer));
10577
10642
  if (opts.tree)
10578
- conditions.push("+r.requestedByUserId IS NOT NULL");
10643
+ add(includeScheduled({ sql: "+r.requestedByUserId IS NOT NULL", params: [] }));
10579
10644
  if (opts.mine)
10580
- add(sessionMineCondition(opts.viewer.userId, opts.viewer.readAll));
10645
+ add(includeScheduled(sessionMineCondition(opts.viewer.userId, opts.viewer.readAll)));
10581
10646
  }
10582
10647
  if (opts.keyPrefix) {
10583
10648
  const { lo, hi } = keyPrefixRange(opts.keyPrefix);
10584
10649
  add({ sql: 'r."key" >= ? AND r."key" < ?', params: [lo, hi] });
10585
10650
  }
10651
+ if (opts.keyPrefixes?.length) {
10652
+ const ranges = opts.keyPrefixes.map(keyPrefixRange);
10653
+ add({
10654
+ sql: `(${ranges.map(() => '(r."key" >= ? AND r."key" < ?)').join(" OR ")})`,
10655
+ params: ranges.flatMap(({ lo, hi }) => [lo, hi])
10656
+ });
10657
+ }
10586
10658
  if (opts.groupKey)
10587
10659
  add(groupCondition(normalizeAssetKey(opts.groupKey)));
10588
10660
  if (opts.noGroup)
@@ -10601,7 +10673,7 @@ function sessionRootFilter(opts = {}) {
10601
10673
  return { sql: conditions.length ? conditions.join(" AND ") : "1", params };
10602
10674
  }
10603
10675
  function excludesTriaged(opts) {
10604
- return !!(opts.viewer?.userId && (opts.groupKey || opts.keyPrefix || opts.noGroup));
10676
+ return !!(opts.viewer?.userId && (opts.groupKey || opts.keyPrefix || opts.keyPrefixes?.length || opts.noGroup));
10605
10677
  }
10606
10678
  function hasSessionChainFilter(opts) {
10607
10679
  return !!(opts.triage || opts.status || opts.withUserId || excludesTriaged(opts));
@@ -10731,16 +10803,23 @@ function threadPromptPreview(prompt) {
10731
10803
  return text.length > THREAD_LABEL_LENGTH ? `${text.slice(0, THREAD_LABEL_LENGTH)}…` : text;
10732
10804
  }
10733
10805
  async function getSessionTree(actor, now, opts = {}) {
10734
- const query = sessionSummaryQuery({
10806
+ const filterOpts = {
10735
10807
  ...actor.kind === "user" ? { viewer: { userId: actor.userId, scope: "all", readAll: actor.readAll } } : {},
10736
10808
  now,
10737
10809
  tree: true,
10738
10810
  mine: opts.mine
10739
- });
10811
+ };
10812
+ const query = sessionSummaryQuery({ ...filterOpts, includeScheduleRuns: true });
10813
+ const viewer = filterOpts.viewer;
10814
+ const mine = viewer && opts.mine ? sessionMineCondition(viewer.userId, viewer.readAll) : null;
10815
+ const defaultVisible = viewer ? {
10816
+ sql: `(r.requestedByUserId IS NOT NULL${mine ? ` AND ${mine.sql}` : ""})`,
10817
+ params: mine?.params ?? []
10818
+ } : { sql: "1", params: [] };
10740
10819
  const [rows, threadRoots] = await Promise.all([
10741
10820
  getDbClient2().query(`SELECT a.root_id, a."key", a.source, a.slackChannelId, a.lastActivityAt, a.latestStatus,
10742
- a.readState, a.needsYou
10743
- FROM (${query.sql}) a`, query.params),
10821
+ a.readState, a.needsYou, r.scheduleId, (${defaultVisible.sql}) AS defaultVisible
10822
+ FROM (${query.sql}) a JOIN ${SESSION_ROOTS} r ON r.id = a.root_id`, [...defaultVisible.params, ...query.params]),
10744
10823
  threadRootCounts()
10745
10824
  ]);
10746
10825
  const counts = () => ({ total: 0, unread: 0, running: 0, needsYou: 0 });
@@ -10775,9 +10854,12 @@ async function getSessionTree(actor, now, opts = {}) {
10775
10854
  };
10776
10855
  for (const row of rows) {
10777
10856
  const source = effectiveSource(row.key, row.source);
10778
- sources.set(source, (sources.get(source) ?? 0) + 1);
10779
10857
  const rowThreadRoots = threadRoots.get(row.key) ?? 0;
10780
10858
  const key = sessionThreadGroupKey(row.key, rowThreadRoots);
10859
+ const groupedSchedule = row.scheduleId !== null && showsScheduleRuns(key);
10860
+ if (!groupedSchedule && !row.defaultVisible)
10861
+ continue;
10862
+ sources.set(source, (sources.get(source) ?? 0) + 1);
10781
10863
  const sourceGroupKey = sessionGroupKey(row.key);
10782
10864
  const channelId = /^shared\/slack\/([^/]+)\/$/.exec(sourceGroupKey)?.[1];
10783
10865
  if (channelId && row.slackChannelId?.toLowerCase() === channelId) {
@@ -10792,8 +10874,9 @@ async function getSessionTree(actor, now, opts = {}) {
10792
10874
  const resource = sessionResourceGroupOf(key);
10793
10875
  if (resource)
10794
10876
  resourceGroups.add(key).add(resource.resourceKey);
10795
- if (hidden.has(source) || shown && !shown.has(source))
10877
+ if (hidden.has(source) || shown && !shown.has(source) && !groupedSchedule)
10796
10878
  continue;
10879
+ const sectionVisible = !!row.defaultVisible && (!shown || shown.has(source));
10797
10880
  const noGroup = key === "shared/" || actor.kind === "user" && key === `personal/${actor.userId}/`;
10798
10881
  let group;
10799
10882
  if (!noGroup) {
@@ -10805,11 +10888,13 @@ async function getSessionTree(actor, now, opts = {}) {
10805
10888
  if (row.lastActivityAt > group.lastActivityAt)
10806
10889
  group.lastActivityAt = row.lastActivityAt;
10807
10890
  }
10808
- if (row.readState === "later" || row.readState === "done")
10809
- add(result[row.readState], row);
10810
- else {
10891
+ if (row.readState === "later" || row.readState === "done") {
10892
+ if (sectionVisible)
10893
+ add(result[row.readState], row);
10894
+ } else {
10811
10895
  const viewer = actor.kind === "user" ? actor.userId : null;
10812
- if (noGroup || sourceOfKey(key) || inResourceScope(row.key, viewer))
10896
+ const inInbox = noGroup || sourceOfKey(key) || inResourceScope(row.key, viewer);
10897
+ if (sectionVisible && inInbox)
10813
10898
  add(result.inbox, row);
10814
10899
  if (noGroup)
10815
10900
  add(result.noGroup, row);
@@ -10869,7 +10954,7 @@ var AUTO_DONE_QUIET_MS, LEGACY_READ_STATE_COLUMNS, SESSION_ROOTS = "(SELECT root
10869
10954
  var init_session_tree = __esm(() => {
10870
10955
  init_key();
10871
10956
  init_source_key();
10872
- init_types4();
10957
+ init_types5();
10873
10958
  init_db4();
10874
10959
  init_session_visibility();
10875
10960
  AUTO_DONE_QUIET_MS = 24 * 3600000;
@@ -11045,6 +11130,14 @@ var init_slack_trees = __esm(() => {
11045
11130
  init_db4();
11046
11131
  });
11047
11132
 
11133
+ // src/be/db/tasks/eligibility-scan.ts
11134
+ function getEligibilityScanCap(raw = process.env.ELIGIBILITY_SCAN_CAP) {
11135
+ const value = Number(raw);
11136
+ return Number.isInteger(value) && value > 0 ? value : DEFAULT_ELIGIBILITY_SCAN_CAP;
11137
+ }
11138
+ var DEFAULT_ELIGIBILITY_SCAN_CAP = 500;
11139
+ var init_eligibility_scan = () => {};
11140
+
11048
11141
  // src/be/db/tasks/human-free.ts
11049
11142
  function humanFreeCase(parentFlag) {
11050
11143
  return `CASE
@@ -11312,7 +11405,7 @@ async function dropSessionDescendants(taskId) {
11312
11405
  }
11313
11406
  var OPEN_TASK_SQL;
11314
11407
  var init_session_summaries = __esm(() => {
11315
- init_types4();
11408
+ init_types5();
11316
11409
  init_runtime2();
11317
11410
  OPEN_TASK_SQL = `t.status NOT IN (${TERMINAL_TASK_STATUSES.map((s) => `'${s}'`).join(", ")})`;
11318
11411
  });
@@ -11520,6 +11613,24 @@ async function updateTaskTitle2(taskId, title) {
11520
11613
  const row = await getDbClient2().get("UPDATE agent_tasks SET title = ? WHERE id = ? RETURNING *", [normalized, taskId]);
11521
11614
  return row ? rowToAgentTask(row) : null;
11522
11615
  }
11616
+ async function updateTaskTags2(taskId, change) {
11617
+ const row = await getDbClient2().transaction(async () => {
11618
+ const current = await getDbClient2().get("SELECT tags FROM agent_tasks WHERE id = ?", [taskId]);
11619
+ if (!current)
11620
+ return null;
11621
+ const previousTagsJson = current.tags;
11622
+ const existing = previousTagsJson ? JSON.parse(previousTagsJson) : [];
11623
+ const removed = new Set(change.remove ?? []);
11624
+ const nextTags = Array.from(new Set([...existing, ...change.add ?? []])).filter((tag) => !removed.has(tag));
11625
+ const nextTagsJson = JSON.stringify(nextTags);
11626
+ const updated = await getDbClient2().get("UPDATE agent_tasks SET tags = ? WHERE id = ? RETURNING *", [nextTagsJson, taskId]);
11627
+ if (updated && tagWriteChangesHumanFree(previousTagsJson, nextTagsJson)) {
11628
+ await reclassifyTaskHumanFree([taskId]);
11629
+ }
11630
+ return updated;
11631
+ });
11632
+ return row ? rowToAgentTask(row) : null;
11633
+ }
11523
11634
  async function setTaskTitleIfUnset2(taskId, title) {
11524
11635
  const normalized = title.trim();
11525
11636
  if (!normalized)
@@ -11585,7 +11696,7 @@ async function completeTask2(id, output, options) {
11585
11696
  });
11586
11697
  } catch {}
11587
11698
  getDbClient2().afterCommit(() => {
11588
- import("./event-bus-tr6h3gv8.js").then(({ workflowEventBus }) => {
11699
+ import("./event-bus-xr83x566.js").then(({ workflowEventBus }) => {
11589
11700
  workflowEventBus.emit("task.completed", {
11590
11701
  taskId: id,
11591
11702
  output: scrubbedOutput,
@@ -11640,7 +11751,7 @@ async function failTask2(id, reason, opts = {}) {
11640
11751
  });
11641
11752
  } catch {}
11642
11753
  getDbClient2().afterCommit(() => {
11643
- import("./event-bus-tr6h3gv8.js").then(({ workflowEventBus }) => {
11754
+ import("./event-bus-xr83x566.js").then(({ workflowEventBus }) => {
11644
11755
  workflowEventBus.emit("task.failed", {
11645
11756
  taskId: id,
11646
11757
  failureReason: scrubbedReason,
@@ -11722,7 +11833,7 @@ async function cancelTask2(id, reason, options = {}) {
11722
11833
  });
11723
11834
  } catch {}
11724
11835
  getDbClient2().afterCommit(() => {
11725
- import("./event-bus-tr6h3gv8.js").then(({ workflowEventBus }) => {
11836
+ import("./event-bus-xr83x566.js").then(({ workflowEventBus }) => {
11726
11837
  workflowEventBus.emit("task.cancelled", {
11727
11838
  taskId: id,
11728
11839
  agentId: row.agentId,
@@ -11734,7 +11845,7 @@ async function cancelTask2(id, reason, options = {}) {
11734
11845
  if (row.source === "schedule" && row.taskType === "deferred" && row.parentTaskId) {
11735
11846
  getDbClient2().afterCommit(async () => {
11736
11847
  try {
11737
- const { createWorkerTaskFollowUp } = await import("./worker-follow-up-y2d2h7km.js");
11848
+ const { createWorkerTaskFollowUp } = await import("./worker-follow-up-grrr3fda.js");
11738
11849
  await createWorkerTaskFollowUp({
11739
11850
  task: rowToAgentTask(row),
11740
11851
  status: "failed",
@@ -11783,7 +11894,7 @@ async function skipTask2(id, reason) {
11783
11894
  });
11784
11895
  } catch {}
11785
11896
  getDbClient2().afterCommit(() => {
11786
- import("./event-bus-tr6h3gv8.js").then(({ workflowEventBus }) => {
11897
+ import("./event-bus-xr83x566.js").then(({ workflowEventBus }) => {
11787
11898
  workflowEventBus.emit("task.skipped", {
11788
11899
  taskId: id,
11789
11900
  failureReason: skipReason,
@@ -11835,7 +11946,7 @@ async function supersedeTask2(id, args) {
11835
11946
  });
11836
11947
  } catch {}
11837
11948
  getDbClient2().afterCommit(() => {
11838
- import("./event-bus-tr6h3gv8.js").then(({ workflowEventBus }) => {
11949
+ import("./event-bus-xr83x566.js").then(({ workflowEventBus }) => {
11839
11950
  workflowEventBus.emit("task.superseded", {
11840
11951
  taskId: id,
11841
11952
  reason: args.reason,
@@ -12050,7 +12161,7 @@ async function updateTaskProgress2(id, progress) {
12050
12161
  });
12051
12162
  } catch {}
12052
12163
  getDbClient2().afterCommit(() => {
12053
- import("./event-bus-tr6h3gv8.js").then(({ workflowEventBus }) => {
12164
+ import("./event-bus-xr83x566.js").then(({ workflowEventBus }) => {
12054
12165
  workflowEventBus.emit("task.progress", {
12055
12166
  taskId: id,
12056
12167
  progress: scrubbedProgress,
@@ -12066,7 +12177,7 @@ var init_write = __esm(() => {
12066
12177
  init_package();
12067
12178
  init_key();
12068
12179
  init_source_key();
12069
- init_types4();
12180
+ init_types5();
12070
12181
  init_secret_scrubber();
12071
12182
  init_task_lifecycle_events();
12072
12183
  init_worker_nudges();
@@ -12578,7 +12689,7 @@ function emitRunFinished(runId, workflowId, status) {
12578
12689
  }
12579
12690
  function emitBusEventAfterCommit(event, payload) {
12580
12691
  getDbClient2().afterCommit(() => {
12581
- import("./event-bus-tr6h3gv8.js").then(({ workflowEventBus }) => {
12692
+ import("./event-bus-xr83x566.js").then(({ workflowEventBus }) => {
12582
12693
  workflowEventBus.emit(event, payload);
12583
12694
  }).catch((err) => console.error(`[db] ${event} event not emitted:`, scrubSecrets(err instanceof Error ? err.message : String(err))));
12584
12695
  });
@@ -12640,7 +12751,7 @@ async function createForeachAttemptSteps(runId, rows) {
12640
12751
  }
12641
12752
  var WORKFLOW_RUN_SUMMARY_COLUMNS = "id, workflowId, status, triggerType, triggerData, error, created_by, startedAt, lastUpdatedAt, finishedAt, parentStepId, parentStepAttempt", WORKFLOW_RUN_STEP_SLIM_COLUMNS = "id, runId, nodeId, nodeType, status, output, error, startedAt, finishedAt, retryCount, maxRetries, nextRetryAt, idempotencyKey, diagnostics, nextPort", TERMINAL_STATUSES, WORKFLOW_RUN_TREE_MAX_DEPTH = 32, WorkflowRunTreeError, WorkflowStepNotExecutableError, TREE_QUERY_CHUNK = 500, WORKFLOW_RUN_FINISHED_EVENT = "workflow.run.finished";
12642
12753
  var init_workflow_runs = __esm(() => {
12643
- init_types4();
12754
+ init_types5();
12644
12755
  init_secret_scrubber();
12645
12756
  init_date_utils();
12646
12757
  init_scrub_json();
@@ -13178,13 +13289,13 @@ function validateConfigEntry(entry) {
13178
13289
  function validateExportToEnv(key, exportToEnv) {
13179
13290
  return exportToEnv === true && isEnvExportRestrictedKey(key) ? envExportRestrictedError(key) : null;
13180
13291
  }
13181
- var TEAMS_SDK_ENV_KEYS, RESERVED_KEYS, API_ONLY_CONFIG_KEYS, INTERNAL_CONFIG_KEYS, BOOLEAN_LITERALS, MAX_DB_RETENTION_DAYS = 1e6, DB_RETENTION_TUNING_BOUNDS, APPS_JSON_COLUMN_MAX_BYTES_BOUNDS, CODEX_OAUTH_KEEP_WARM_MAX_AGE_HOURS_BOUNDS, SYSTEM_ONE_DEFAULT_PROVIDER_OPTIONS, validateControllerTokenTtlDays, validateControllerGraceSec, VALIDATED_KEYS;
13292
+ var TEAMS_SDK_ENV_KEYS, RESERVED_KEYS, API_ONLY_CONFIG_KEYS, INTERNAL_CONFIG_KEYS, BOOLEAN_LITERALS, MAX_DB_RETENTION_DAYS = 1e6, DB_RETENTION_TUNING_BOUNDS, APPS_JSON_COLUMN_MAX_BYTES_BOUNDS, CODEX_OAUTH_KEEP_WARM_MAX_AGE_HOURS_BOUNDS, SYSTEM_ONE_DEFAULT_PROVIDER_OPTIONS, SYSTEM_ONE_EXTRACT_DEFAULT_PROVIDER_OPTIONS, validateControllerTokenTtlDays, validateControllerGraceSec, VALIDATED_KEYS;
13182
13293
  var init_swarm_config_guard = __esm(() => {
13183
13294
  init_schema();
13184
13295
  init_telemetry_ranking();
13185
13296
  init_quickjs_pool_config();
13186
13297
  init_reaction_shortcode();
13187
- init_types4();
13298
+ init_types5();
13188
13299
  init_api_drain2();
13189
13300
  init_company_profile();
13190
13301
  init_config_env_export();
@@ -13211,7 +13322,9 @@ var init_swarm_config_guard = __esm(() => {
13211
13322
  "CHAT_SDK_API_URL_OVERRIDES",
13212
13323
  "CODEX_OAUTH_DEVICE_BASE_URL",
13213
13324
  "DESPLEGA_TELEMETRY_ENDPOINT",
13214
- "CLOUDFLARE_API_BASE_URL"
13325
+ "CLOUDFLARE_API_BASE_URL",
13326
+ "GITHUB_URL",
13327
+ "GITHUB_API_URL"
13215
13328
  ]);
13216
13329
  API_ONLY_CONFIG_KEYS = new Set([
13217
13330
  "API_AGENT_FS_API_KEY",
@@ -13238,6 +13351,7 @@ var init_swarm_config_guard = __esm(() => {
13238
13351
  "openai",
13239
13352
  "cloudflare"
13240
13353
  ];
13354
+ SYSTEM_ONE_EXTRACT_DEFAULT_PROVIDER_OPTIONS = ["cloudflare"];
13241
13355
  validateControllerTokenTtlDays = boundedIntegerValidators(["RUNTIME_CONTROLLER_TOKEN_TTL_DAYS"], 1, 3650).RUNTIME_CONTROLLER_TOKEN_TTL_DAYS;
13242
13356
  validateControllerGraceSec = boundedIntegerValidators(["RUNTIME_CONTROLLER_GRACE_SEC"], 0, 86400).RUNTIME_CONTROLLER_GRACE_SEC;
13243
13357
  VALIDATED_KEYS = {
@@ -13311,6 +13425,15 @@ var init_swarm_config_guard = __esm(() => {
13311
13425
  OPENROUTER_BASE_URL: (value) => validateHttpBaseUrl(value, "Invalid OPENROUTER_BASE_URL (must be an http(s) URL with no query string or fragment, e.g. https://api.example.com/v1. Leave blank for openrouter.ai)"),
13312
13426
  AGENT_FS_PUBLIC_URL: (value) => validateHttpBaseUrl(value, "Invalid AGENT_FS_PUBLIC_URL (must be an http(s) URL with no query string or fragment, e.g. https://agent-fs.example.com. Leave blank to use AGENT_FS_API_URL)"),
13313
13427
  ...enumValidator("AGENT_FS_LINK_TARGET", ["dashboard", "live", ""]),
13428
+ APP_URL: (value) => {
13429
+ const invalid = "Invalid APP_URL (must be comma-separated http(s) URLs with no query string or fragment, e.g. https://app.example.com)";
13430
+ if (typeof value !== "string")
13431
+ return invalid;
13432
+ const entries = value.split(",").map((entry) => entry.trim());
13433
+ if (value.trim() && entries.some((entry) => !entry))
13434
+ return invalid;
13435
+ return entries.some((entry) => validateHttpBaseUrl(entry, invalid)) ? invalid : null;
13436
+ },
13314
13437
  HARNESS_PROVIDER: (value) => {
13315
13438
  const parsed = ProviderNameSchema.safeParse(value);
13316
13439
  if (parsed.success)
@@ -13319,6 +13442,7 @@ var init_swarm_config_guard = __esm(() => {
13319
13442
  },
13320
13443
  ...enumValidator("CLAUDE_TRANSPORT", ["cli", "sdk"]),
13321
13444
  ...enumValidator("SCRIPT_EXECUTOR", ["native", "quickjs"]),
13445
+ ...enumValidator("BOOT_SCRUB_MODE", ["backfill", "forward-only"]),
13322
13446
  ...enumValidator("TRANSCRIPTION_PROVIDER", ["openai", "elevenlabs", "groq"]),
13323
13447
  SCRIPT_QUICKJS_POOL_SIZE: validateQuickJSPoolSize,
13324
13448
  ...booleanValidators(["SCRIPT_EGRESS_ALLOW_PRIVATE"]),
@@ -13333,6 +13457,9 @@ var init_swarm_config_guard = __esm(() => {
13333
13457
  return parseFollowUpGateScheduleIds(value).every(isFollowUpGateScheduleId) ? null : message;
13334
13458
  },
13335
13459
  ...enumValidator("SYSTEM_ONE_DEFAULT_PROVIDER", [...SYSTEM_ONE_DEFAULT_PROVIDER_OPTIONS]),
13460
+ ...enumValidator("SYSTEM_ONE_EXTRACT_DEFAULT_PROVIDER", [
13461
+ ...SYSTEM_ONE_EXTRACT_DEFAULT_PROVIDER_OPTIONS
13462
+ ]),
13336
13463
  CODEX_CREDITS_EXHAUSTED_COOLDOWN_MS: (value) => {
13337
13464
  const str = String(value).trim();
13338
13465
  if (!/^\d+$/.test(str) || Number(str) <= 0) {
@@ -13404,6 +13531,10 @@ var init_swarm_config_guard = __esm(() => {
13404
13531
  "SLACK_LEAVE_THREAD_DISABLE",
13405
13532
  "RBAC_ENABLED",
13406
13533
  "SEED_AUTOMATIONS_ENABLED",
13534
+ "SEED_SCRIPTS_ENABLED",
13535
+ "SEED_SKILLS_ENABLED",
13536
+ "SEED_WORKFLOWS_ENABLED",
13537
+ "SEED_SCHEDULES_ENABLED",
13407
13538
  "RBAC_AUDIT_DISABLED",
13408
13539
  "EXTENSION_ALLOW_INLINE_INSTALL",
13409
13540
  "BUDGET_ADMISSION_DISABLED",
@@ -13414,6 +13545,7 @@ var init_swarm_config_guard = __esm(() => {
13414
13545
  "IMPROVEMENTS_ENABLED",
13415
13546
  "SWARM_HIDE_CLOUD_PROMO",
13416
13547
  "DB_QUERY_BOUNDED_ENABLED",
13548
+ "DB_QUERY_WORKER_POOL_ENABLED",
13417
13549
  "CLAUDE_TRUST_PRESEED",
13418
13550
  "DB_RETENTION_DRY_RUN",
13419
13551
  "MODEL_AUTO_UPGRADE",
@@ -13890,6 +14022,10 @@ async function markAuthorizationRefreshFailed(id, message) {
13890
14022
  WHERE id = ? AND status != 'revoked'`, [message, id]);
13891
14023
  return result.changes === 1 ? await getAuthorizationById(id) : null;
13892
14024
  }
14025
+ async function hasOAuthTokens(provider) {
14026
+ const row = await rawDefaultAuthorizationForProvider(provider);
14027
+ return row !== null && row.status !== "revoked";
14028
+ }
13893
14029
  async function getOAuthTokens(provider) {
13894
14030
  const row = await rawDefaultAuthorizationForProvider(provider);
13895
14031
  if (!row)
@@ -22114,7 +22250,7 @@ function noteEmbeddingSuccess() {
22114
22250
  const report = (what) => (err) => {
22115
22251
  console.error(`[memory] ${what} backfill after embeddings recovered failed:`, err.message);
22116
22252
  };
22117
- backfill2 = import("./embedding-space-wh8de1t9.js").then(({ runEmbeddingMaintenance }) => runEmbeddingMaintenance({ backfill: true })).catch(report("Embedding")).finally(() => {
22253
+ backfill2 = import("./embedding-space-bafjr5f7.js").then(({ runEmbeddingMaintenance }) => runEmbeddingMaintenance({ backfill: true })).catch(report("Embedding")).finally(() => {
22118
22254
  backfill2 = null;
22119
22255
  });
22120
22256
  }
@@ -24307,7 +24443,7 @@ async function loadSecretRegistry() {
24307
24443
  result.failed += 1;
24308
24444
  }
24309
24445
  try {
24310
- const { loadRuntimeControllerSecrets } = await import("./db-0m6v5tq4.js");
24446
+ const { loadRuntimeControllerSecrets } = await import("./db-wnh0qjy1.js");
24311
24447
  const loaded = await loadRuntimeControllerSecrets();
24312
24448
  result.runtimeController = loaded.count;
24313
24449
  result.failed += loaded.failed;
@@ -24327,18 +24463,20 @@ var init_secret_registry = __esm(() => {
24327
24463
  function isSteeringEnabled() {
24328
24464
  return isSteeringEnabled2();
24329
24465
  }
24466
+ function resolveSteerProvider(task, agent) {
24467
+ return agent?.harnessProvider ?? agent?.provider ?? task.provider ?? "claude";
24468
+ }
24330
24469
  async function providerForTask(task) {
24331
24470
  const agent = task.agentId ? await getAgentById2(task.agentId) : null;
24332
- return agent?.harnessProvider ?? agent?.provider ?? task.provider ?? "claude";
24471
+ return resolveSteerProvider(task, agent);
24333
24472
  }
24334
24473
  function supportedModesForTask(task, provider) {
24335
24474
  return provider === "claude" && task.providerMeta?.transport === "sdk" ? ["steer", "queue"] : PROVIDER_STEER_CAPABILITIES[provider];
24336
24475
  }
24337
24476
  function steeringFieldsFor(task, agent) {
24338
- const provider = agent?.harnessProvider ?? agent?.provider ?? task.provider;
24339
24477
  return {
24340
24478
  isLeadTask: agent?.isLead ?? false,
24341
- supportedSteerModes: provider ? supportedModesForTask(task, provider) : []
24479
+ supportedSteerModes: supportedModesForTask(task, resolveSteerProvider(task, agent))
24342
24480
  };
24343
24481
  }
24344
24482
  async function getTaskSteeringFields(task) {
@@ -24364,13 +24502,20 @@ async function getTaskSteeringFieldsForTasks(tasks) {
24364
24502
  steeringFieldsFor(task, task.agentId ? agents.get(task.agentId) ?? null : null)
24365
24503
  ]));
24366
24504
  }
24505
+ function promotedTaskSource(source) {
24506
+ if (source === "script")
24507
+ return "api";
24508
+ if (source === "app-page")
24509
+ return "ui";
24510
+ return source;
24511
+ }
24367
24512
  async function promoteSteeringToTask(task, message) {
24368
24513
  return await createTaskExtended2(message.body, {
24369
24514
  agentId: task.agentId,
24370
24515
  routingReason: task.agentId ? "continuity" : undefined,
24371
24516
  routingSource: task.agentId ? "engine_default" : undefined,
24372
24517
  creatorAgentId: message.createdByAgentId,
24373
- source: message.source === "script" ? "api" : message.source,
24518
+ source: promotedTaskSource(message.source),
24374
24519
  taskType: "follow-up",
24375
24520
  parentTaskId: task.id,
24376
24521
  requestedByUserId: message.createdByUserId,
@@ -24459,7 +24604,7 @@ async function requestSteering(args) {
24459
24604
  }
24460
24605
  const requestedMode = args.mode ?? "queue";
24461
24606
  const onUnsupported = args.onUnsupported ?? "degrade";
24462
- const { dispatchPre, extensionIdForAgent } = await import("./dispatcher-9tq2zzdj.js");
24607
+ const { dispatchPre, extensionIdForAgent } = await import("./dispatcher-jrm24r43.js");
24463
24608
  const preSteer = await dispatchPre("pre.task.steer", {
24464
24609
  task,
24465
24610
  message: args.message,
@@ -24527,7 +24672,7 @@ async function requestSteering(args) {
24527
24672
  var STEERING_MOVED_ERROR = "Steering message moved to another task", SteeringRequestError, SteeringBlockedError, steeringModifySchema, AGENT_ID_CHUNK = 500;
24528
24673
  var init_steering2 = __esm(() => {
24529
24674
  init_zod();
24530
- init_types4();
24675
+ init_types5();
24531
24676
  init_secret_scrubber();
24532
24677
  init_steering_enabled();
24533
24678
  init_db4();
@@ -25185,6 +25330,7 @@ __export(exports_db, {
25185
25330
  updateSwarmRepo: () => updateSwarmRepo2,
25186
25331
  updateTaskClaudeSessionId: () => updateTaskClaudeSessionId2,
25187
25332
  updateTaskProgress: () => updateTaskProgress2,
25333
+ updateTaskTags: () => updateTaskTags2,
25188
25334
  updateTaskTitle: () => updateTaskTitle2,
25189
25335
  updateTaskVcs: () => updateTaskVcs2,
25190
25336
  updateUser: () => updateUser2,
@@ -26687,7 +26833,7 @@ async function createTaskExtended2(task, options) {
26687
26833
  priority: row.priority
26688
26834
  }, (task) => task !== null, row.requestedByUserId);
26689
26835
  getDbClient2().afterCommit(() => {
26690
- import("./event-bus-tr6h3gv8.js").then(({ workflowEventBus }) => {
26836
+ import("./event-bus-xr83x566.js").then(({ workflowEventBus }) => {
26691
26837
  workflowEventBus.emit("task.created", {
26692
26838
  taskId: row.id,
26693
26839
  task: row.task,
@@ -26769,7 +26915,7 @@ async function releaseTask2(taskId, wakeSnapshot) {
26769
26915
  } catch {}
26770
26916
  if (isRuntimePoolsEnabled() && !wakeSnapshot)
26771
26917
  getDbClient2().afterCommit(() => {
26772
- import("./event-bus-tr6h3gv8.js").then(({ workflowEventBus }) => workflowEventBus.emit("task.unassigned", { taskId })).catch((error) => console.error("[db] Routing event failed:", scrubSecrets(String(error))));
26918
+ import("./event-bus-xr83x566.js").then(({ workflowEventBus }) => workflowEventBus.emit("task.unassigned", { taskId })).catch((error) => console.error("[db] Routing event failed:", scrubSecrets(String(error))));
26773
26919
  });
26774
26920
  }
26775
26921
  return row ? rowToAgentTask(row) : null;
@@ -26839,7 +26985,7 @@ async function rejectTask2(taskId, agentId, reason) {
26839
26985
  } catch {}
26840
26986
  if (isRuntimePoolsEnabled())
26841
26987
  getDbClient2().afterCommit(() => {
26842
- import("./event-bus-tr6h3gv8.js").then(({ workflowEventBus }) => workflowEventBus.emit("task.unassigned", { taskId })).catch((error) => console.error("[db] Routing event failed:", scrubSecrets(String(error))));
26988
+ import("./event-bus-xr83x566.js").then(({ workflowEventBus }) => workflowEventBus.emit("task.unassigned", { taskId })).catch((error) => console.error("[db] Routing event failed:", scrubSecrets(String(error))));
26843
26989
  });
26844
26990
  }
26845
26991
  return row ? rowToAgentTask(row) : null;
@@ -27010,8 +27156,9 @@ async function getUnassignedTaskIdsForAgent2(agentId, limit = 10, accept) {
27010
27156
  return [];
27011
27157
  const batchSize = Math.max(limit * 5, ELIGIBILITY_SCAN_BATCH_SIZE);
27012
27158
  const eligible = [];
27159
+ const scanCap = getEligibilityScanCap();
27013
27160
  let offset = 0;
27014
- while (eligible.length < limit && offset < ELIGIBILITY_SCAN_CAP) {
27161
+ while (eligible.length < limit && offset < scanCap) {
27015
27162
  const rows = await getDbClient2().query("SELECT * FROM agent_tasks WHERE status = 'unassigned' ORDER BY priority DESC, createdAt ASC, rowid ASC LIMIT ? OFFSET ?", [batchSize, offset]);
27016
27163
  if (rows.length === 0)
27017
27164
  break;
@@ -28011,6 +28158,7 @@ async function getAttributionByPerson2(opts) {
28011
28158
  }
28012
28159
  }
28013
28160
  const where = `WHERE ${conditions.join(" AND ")}`;
28161
+ const githubHost = getGitHubHostForSql();
28014
28162
  const rootRows = await getDbClient2().query(`WITH RECURSIVE selected_roots(id, requestedByUserId, status) AS (
28015
28163
  SELECT t.id, t.requestedByUserId, t.status
28016
28164
  FROM agent_tasks t
@@ -28048,7 +28196,7 @@ async function getAttributionByPerson2(opts) {
28048
28196
  OR (
28049
28197
  ta.kind = 'url'
28050
28198
  AND (
28051
- ta.url LIKE '%github.com/%/pull/%'
28199
+ ta.url LIKE '%${githubHost}/%/pull/%'
28052
28200
  OR ta.url LIKE '%/-/merge_requests/%'
28053
28201
  )
28054
28202
  )
@@ -28060,7 +28208,7 @@ async function getAttributionByPerson2(opts) {
28060
28208
  -- CROSS JOIN pins the order (tree outer, task by id). Left to itself the
28061
28209
  -- planner scans every task's output and probes the tree instead.
28062
28210
  CROSS JOIN agent_tasks described ON described.id = tree.taskId
28063
- WHERE described.output LIKE '%github.com/%/pull/%'
28211
+ WHERE described.output LIKE '%${githubHost}/%/pull/%'
28064
28212
  OR described.output LIKE '%/-/merge_requests/%'
28065
28213
  )
28066
28214
  SELECT
@@ -28530,7 +28678,7 @@ async function deleteScheduledTask2(id) {
28530
28678
  const parent = await getTaskById2(deferred.parentTaskId);
28531
28679
  if (!parent?.deferredAt)
28532
28680
  return;
28533
- const { createWorkerTaskFollowUp } = await import("./worker-follow-up-y2d2h7km.js");
28681
+ const { createWorkerTaskFollowUp } = await import("./worker-follow-up-grrr3fda.js");
28534
28682
  await createWorkerTaskFollowUp({
28535
28683
  task: parent,
28536
28684
  status: "failed",
@@ -30363,7 +30511,11 @@ async function resolveApprovalRequest2(id, data, options) {
30363
30511
  now,
30364
30512
  id
30365
30513
  ]);
30366
- return row ? rowToApprovalRequest(row) : null;
30514
+ if (!row)
30515
+ return null;
30516
+ const resolved = rowToApprovalRequest(row);
30517
+ scheduleApprovalCardUpdates([resolved]);
30518
+ return resolved;
30367
30519
  }
30368
30520
  async function cancelApprovalRequestById2(id, data) {
30369
30521
  const now = new Date().toISOString();
@@ -30371,7 +30523,11 @@ async function cancelApprovalRequestById2(id, data) {
30371
30523
  SET status = 'cancelled', resolutionReason = ?, resolvedBy = ?, resolvedAt = ?, updatedAt = ?
30372
30524
  WHERE id = ? AND status = 'pending'
30373
30525
  RETURNING *`, [scrubSecrets(data.reason), data.resolvedBy, now, now, id]);
30374
- return row ? rowToApprovalRequest(row) : null;
30526
+ if (!row)
30527
+ return null;
30528
+ const cancelled = rowToApprovalRequest(row);
30529
+ scheduleApprovalCardUpdates([cancelled]);
30530
+ return cancelled;
30375
30531
  }
30376
30532
  async function cancelPendingApprovalRequestsForRun2(workflowRunId, reason) {
30377
30533
  const now = new Date().toISOString();
@@ -30379,7 +30535,9 @@ async function cancelPendingApprovalRequestsForRun2(workflowRunId, reason) {
30379
30535
  SET status = 'cancelled', resolutionReason = ?, resolvedAt = ?, updatedAt = ?
30380
30536
  WHERE workflowRunId = ? AND status = 'pending'
30381
30537
  RETURNING *`, [scrubSecrets(reason), now, now, workflowRunId]);
30382
- return rows.map(rowToApprovalRequest);
30538
+ const cancelled = rows.map(rowToApprovalRequest);
30539
+ scheduleApprovalCardUpdates(cancelled);
30540
+ return cancelled;
30383
30541
  }
30384
30542
  async function listCancelledApprovalRequestsForRun2(workflowRunId) {
30385
30543
  const rows = await getDbClient2().query(`SELECT * FROM approval_requests
@@ -30391,9 +30549,10 @@ async function listCancelledApprovalRequestsForStep2(workflowRunStepId) {
30391
30549
  WHERE workflowRunStepId = ? AND status = 'cancelled'`, [workflowRunStepId]);
30392
30550
  return rows.map(rowToApprovalRequest);
30393
30551
  }
30394
- async function claimApprovalCancellationNotification2(id, notificationKey) {
30552
+ async function claimApprovalCancellationNotification2(id, notificationKey, options) {
30553
+ const statusClause = options?.anyTerminal ? "status <> 'pending'" : "status = 'cancelled'";
30395
30554
  return getDbClient2().transaction(async () => {
30396
- const row = await getDbClient2().get("SELECT * FROM approval_requests WHERE id = ? AND status = 'cancelled'", [id]);
30555
+ const row = await getDbClient2().get(`SELECT * FROM approval_requests WHERE id = ? AND ${statusClause}`, [id]);
30397
30556
  if (!row)
30398
30557
  return null;
30399
30558
  const claims = row.cancellationNotificationClaims ? JSON.parse(row.cancellationNotificationClaims) : {};
@@ -30408,7 +30567,7 @@ async function claimApprovalCancellationNotification2(id, notificationKey) {
30408
30567
  claims[notificationKey] = { claimedAt: now, leaseToken };
30409
30568
  await getDbClient2().run(`UPDATE approval_requests
30410
30569
  SET cancellationNotificationClaims = ?, updatedAt = ?
30411
- WHERE id = ? AND status = 'cancelled'`, [JSON.stringify(claims), now, id]);
30570
+ WHERE id = ? AND ${statusClause}`, [JSON.stringify(claims), now, id]);
30412
30571
  return { approval: rowToApprovalRequest(row), leaseToken };
30413
30572
  });
30414
30573
  }
@@ -30432,7 +30591,7 @@ async function updateApprovalCancellationNotificationClaim(id, notificationKey,
30432
30591
  claims[notificationKey] = value;
30433
30592
  await getDbClient2().run(`UPDATE approval_requests
30434
30593
  SET cancellationNotificationClaims = ?, updatedAt = ?
30435
- WHERE id = ? AND status = 'cancelled'`, [JSON.stringify(claims), new Date().toISOString(), id]);
30594
+ WHERE id = ? AND status <> 'pending'`, [JSON.stringify(claims), new Date().toISOString(), id]);
30436
30595
  });
30437
30596
  }
30438
30597
  async function updateApprovalRequestNotifications2(id, notificationChannels) {
@@ -32000,8 +32159,9 @@ async function getFavoriteItemIdSet2(opts) {
32000
32159
  return new Set(favorites.map((favorite) => favorite.itemId));
32001
32160
  }
32002
32161
  async function setFavorite2(opts) {
32162
+ const itemId = opts.itemId;
32003
32163
  if (!opts.favorite) {
32004
- await getDbClient2().run("DELETE FROM user_favorites WHERE favoriteScope = ? AND itemType = ? AND itemId = ?", [opts.favoriteScope, opts.itemType, opts.itemId]);
32164
+ await getDbClient2().run("DELETE FROM user_favorites WHERE favoriteScope = ? AND itemType = ? AND itemId = ?", [opts.favoriteScope, opts.itemType, itemId]);
32005
32165
  return null;
32006
32166
  }
32007
32167
  const now = new Date().toISOString();
@@ -32013,7 +32173,7 @@ async function setFavorite2(opts) {
32013
32173
  ON CONFLICT(favoriteScope, itemType, itemId) DO UPDATE SET
32014
32174
  lastUpdatedAt = excluded.lastUpdatedAt,
32015
32175
  updated_by = excluded.updated_by
32016
- RETURNING *`, [opts.favoriteScope, opts.userId ?? null, opts.itemType, opts.itemId, now, now, actor, actor]);
32176
+ RETURNING *`, [opts.favoriteScope, opts.userId ?? null, opts.itemType, itemId, now, now, actor, actor]);
32017
32177
  if (!row)
32018
32178
  throw new Error("Failed to set favorite");
32019
32179
  return rowToUserFavorite(row);
@@ -32837,7 +32997,7 @@ var VERSIONABLE_FIELDS2, BUDGETED_IDENTITY_FIELDS, PENDING_SLACK_MESSAGE_TS_PREF
32837
32997
  LEFT JOIN agents a ON m.created_by_kind = 'agent' AND a.id = m.created_by_agent_id`, ROUTING_HOLDER_SQL = `CASE
32838
32998
  WHEN status IN ('draft', 'offered', 'reviewing') AND offeredTo IS NOT NULL THEN offeredTo
32839
32999
  ELSE COALESCE(agentId, offeredTo)
32840
- END`, ELIGIBILITY_SCAN_BATCH_SIZE, ELIGIBILITY_SCAN_CAP, UNATTRIBUTED_USER_ID2 = "unattributed", HUMAN_FREE_SQL = "(COALESCE(t.isHumanFree, 0) = 1)", SCHEDULE_TEMPLATE_PREVIEW_LENGTH = 280, RESERVED_CONFIG_PLACEHOLDER = "[reserved key stored in swarm_config; delete this row]", SKILL_FILE_LIMITS2, BINARY_SKILL_FILE_PLACEHOLDER = "[binary file - not synced]", SKILL_SLIM_COLUMNS = "id, name, description, type, scope, ownerAgentId, sourceUrl, sourceRepo, sourcePath, sourceBranch, sourceHash, isComplex, allowedTools, model, effort, context, agent, disableModelInvocation, userInvocable, version, isEnabled, systemDefault, invocationCount, lastInvokedAt, createdAt, lastUpdatedAt, lastFetchedAt, '' as content", WEEK_SECONDS, KvTypeCollisionError2;
33000
+ 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", WEEK_SECONDS, KvTypeCollisionError2;
32841
33001
  var init_db4 = __esm(() => {
32842
33002
  init_src2();
32843
33003
  init_package();
@@ -32849,11 +33009,12 @@ var init_db4 = __esm(() => {
32849
33009
  init_telemetry();
32850
33010
  init_telemetry_identity();
32851
33011
  init_telemetry_trigger();
32852
- init_types4();
33012
+ init_types5();
32853
33013
  init_codex_auth_failure();
32854
33014
  init_config_env_export();
32855
33015
  init_config_secrets();
32856
33016
  init_credentials2();
33017
+ init_github_host();
32857
33018
  init_github_pull_request();
32858
33019
  init_heartbeat_expiry();
32859
33020
  init_identity_field_budget();
@@ -32877,6 +33038,7 @@ var init_db4 = __esm(() => {
32877
33038
  init_session_tree();
32878
33039
  init_skill_search();
32879
33040
  init_slack_trees();
33041
+ init_eligibility_scan();
32880
33042
  init_human_free();
32881
33043
  init_read();
32882
33044
  init_write();
@@ -32904,7 +33066,8 @@ var init_db4 = __esm(() => {
32904
33066
  init_defaults();
32905
33067
  configureAgentDependencies({
32906
33068
  createLogEntry: (entry) => createLogEntry2(entry),
32907
- installSystemDefaultSkillsForAgent: (agentId) => installSystemDefaultSkillsForAgent2(agentId)
33069
+ installSystemDefaultSkillsForAgent: (agentId) => installSystemDefaultSkillsForAgent2(agentId),
33070
+ resolvePendingImportAssignments: async (agent) => (await import("./pending-sqkrb836.js")).resolvePendingImportAssignments(agent)
32908
33071
  });
32909
33072
  configureTaskWriteDependencies({
32910
33073
  createLogEntry: (...args) => createLogEntry2(...args),
@@ -32939,7 +33102,6 @@ var init_db4 = __esm(() => {
32939
33102
  "toolsMd"
32940
33103
  ];
32941
33104
  ELIGIBILITY_SCAN_BATCH_SIZE = Number(process.env.ELIGIBILITY_SCAN_BATCH_SIZE) || 25;
32942
- ELIGIBILITY_SCAN_CAP = Number(process.env.ELIGIBILITY_SCAN_CAP) || 500;
32943
33105
  SKILL_FILE_LIMITS2 = {
32944
33106
  maxCount: Number(process.env.SKILL_FILES_MAX_COUNT ?? 100),
32945
33107
  maxTotalBytes: Number(process.env.SKILL_FILES_MAX_TOTAL_BYTES ?? 10 * 1024 * 1024),
@@ -32956,4 +33118,4 @@ var init_db4 = __esm(() => {
32956
33118
  };
32957
33119
  });
32958
33120
 
32959
- export { slackContextKey, chatSdkContextKey, chatThreadOfContextKey, agentmailContextKey, githubContextKey, gitlabContextKey, azureDevOpsContextKey, azureDevOpsWorkItemContextKey, bitbucketContextKey, linearContextKey, buildJiraContextKey, scheduleContextKey, workflowContextKey, agentContextKey, pageContextKey, init_context_key, sessionSourceKey, sourceOfKey, SOURCE_GROUPS_READ_ONLY, sourceMoveError, init_source_key, 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, auditAssetKeys, init_asset_key_audit, CredentialBindingSchema, placeholderForConfigKey, CredentialBroker, DEFAULT_CREDENTIAL_BINDINGS, isPrivateAddress, assertUrlSafe, parseEgressAllowlist, init_egress_guard, init_credential_broker, encryptSecret, decryptSecret, getEncryptionKey, init_crypto, withLoopPath, bindLoopPath, startEventLoopLagProbe, stopEventLoopLagProbe, init_event_loop_lag, DbTransactionDeadlineError, isInTransaction, init_db_client, breaksJsonValidity, scrubJsonValue, foldHexCopies, init_scrub_json, sealJson, init_sealed_json, getPromptTemplateDefaultDrift, init_default_drift, init_templates2, init_templates3, isSqliteVecAvailable2, resolveSqliteVecExtensionPath2, __resetSqliteVecExtensionPathCacheForTests2, initDb2, getDb2, closeDb2, getDbClient2, init_runtime2, isRbacEnabled, decideAdmission, decideToolAdmission, grantLeadEquivalence, revokeLeadEquivalence, init_elevated_agents, LEGACY_RULES, setAuditSink, clearAuditSink, can, PermissionVerbSchema, init_rbac, CHAT_SDK_ADAPTER_NAMES, CHAT_SDK_ADAPTER_SCHEMAS, ChatSdkAdaptersDraftSchema, firstIssueText, isAdapterEntryEnabled, init_schema, TELEMETRY_RANKING_KEY, PUBLIC_RANKING_ENABLED_KEY, RANKING_CATEGORIES, readTelemetryRanking, rankingFormSchema, buildListing, init_telemetry_ranking, resolveQuickJSPoolSize, init_quickjs_pool_config, SLACK_REACTION_DEFAULTS, SLACK_REACTION_CONFIG_KEYS, reactionName, completedStatusIcon, init_reaction_shortcode, API_DRAINING_HEADER, API_DRAIN_MAX_MS_LIMIT, isApiDrainingResponse, init_api_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, 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, createAgent2, getAgentById2, EXTENSION_AGENT_ROLE2, NOT_EXTENSION_AGENT_SQL2, isExtensionAgent2, extensionAgentAssignmentError2, ReservedAgentRoleError2, reservedRoleViolation2, ExtensionAgentAssignmentError2, getAllAgents2, getAgentStatusCounts2, getLeadAgent2, updateAgentStatus2, updateAgentMaxTasks2, updateAgentProvider2, setAgentHarnessProvider2, updateAgentCredStatus2, listAgentsWithCredStatusByProvider2, getAgentHarnessProviders2, updateAgentActivity2, MAX_EMPTY_POLLS2, incrementEmptyPollCount2, resetEmptyPollCount2, shouldBlockPolling2, deleteAgent2, getActiveTaskCount2, hasCapacity2, getRemainingCapacity2, updateAgentStatusFromCapacity2, isPoolAffinityEnforcementEnabled2, buildRoutingAffinityFromAgent2, isAgentEligibleForTask2, getAgentDailyTaskCounts2, init_agents, listApprovalRequestSummaries2, getPendingApprovalVoteState2, recordApprovalVotes2, getPendingApprovalsForTasks2, approvalCancellationNotificationKey, listUndeliveredCancelledApprovalRequestIds, init_approvals, computeContentHash2, createContextVersion2, getLatestContextVersion2, getContextVersion2, getContextVersionHistory2, 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, 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, modelProfileReferences, modelProfileRefError, deleteModelProfile, MAX_MODEL_PROFILE_FALLBACKS, modelProfileFallbacksError, taskProfileError, scheduleProfileUpdate, init_model_profiles, AssetKeyMovesBlockedError2, assertAssetKeyMovesAllowed2, moveTaskChainKeyInTx2, moveSessionChains, listPrefixRoots, listSharedPrefixRoots, init_session_moves, getSessionGroupKey, getSessionReadState, getSessionTree, triageSessionList, init_session_tree, closeSlackTreeIfSettled, getSlackThreadsOfTasks, slackThreadHasOutcomeWork, init_slack_trees, setHumanFreeQueueListener, drainHumanFreeReclassifyQueue, init_human_free, onTaskStarted, init_task_lifecycle_events, channelTopic, addWorkerSubscription, removeWorkerSubscription, listSubscribedWorkerAgents, init_channels, publishWorkerNudge, init_worker_nudges, getDefaultAuthorizationIdForProvider, getOAuthApp, getOAuthAppById, getOAuthAppIdByProvider, createOAuthApp, updateOAuthAppById, upsertOAuthApp, listAuthorizationsForApp, getAuthorizationById, upsertAuthorization, updateAuthorizationTokens, updateAuthorizationIdentity, deleteAuthorizationById, deleteAuthorizationsForApp, createOAuthPending, consumeOAuthPending, gcOAuthPending, markAuthorizationRefreshFailed, getOAuthTokens, listAuthorizationSweepRows, listKeepAliveAuthorizations, deleteOAuthTokens, acquireOAuthRefreshLock, releaseOAuthRefreshLock, init_oauth, OpenAI2, init_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, searchMemoryCandidates, init_search_candidates, rowToCandidate, init_sqlite_store, getEmbeddingProvider2, resetEmbeddingProvider2, getMemoryStore2, init_memory, embeddingProvider2, computeScriptEmbedding2, writeScriptEmbedding2, embedScript2, searchScripts2, reembedAllScripts2, init_embeddings, upsertScriptByName, getScript, getScriptById, getScriptVersion, listScripts, listScriptVersions, deleteScript, touchScratchScriptLastUsed, restoreScratchScriptLastUsedIfUnchanged, createScriptApi, listScriptApisForScript, getScriptApiById, getScriptApiSecret, updateScriptApi, rotateScriptApiSecret, deleteScriptApi, recordScriptApiUsage, init_db3, oauthSecretName, registerStoredSecret, loadSecretRegistry, init_secret_registry, 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, 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, createTask2, getPendingTaskForAgent2, assignUnassignedTaskPending2, startTask2, updateTaskClaudeSessionId2, recordTaskProviderIfUnset2, updateTaskTitle2, setTaskTitleIfUnset2, completeTask2, failTask2, overwriteTerminalTaskResultText2, cancelTask2, skipTask2, supersedeTask2, settleSupersededTaskDependents2, backfillSupersedeTaskResumeTaskId2, pauseTask2, resumeTask2, getPausedTasksForAgent2, getOrphanedInProgressTasksForAgent2, resetOrphanedInProgressTasksForAgent2, getRecentlyCancelledTasksForAgent2, deleteTask2, updateTaskProgress2, init_write, IdempotencyKeyTakenError, workflowRequestFingerprint, findAcceptedWorkflowOperation, assertWorkflowIdempotencyKeyUnused, recordAcceptedWorkflowOperation, init_workflow_idempotency, PINNED_WORKFLOW_KEYS2, toPinnedDefinition2, pinWorkflowDefinition2, getRunWorkflow2, 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 };
33121
+ export { 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, 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, auditAssetKeys, init_asset_key_audit, CredentialBindingSchema, placeholderForConfigKey, CredentialBroker, defaultCredentialBindings, isPrivateAddress, assertUrlSafe, parseEgressAllowlist, init_egress_guard, init_credential_broker, encryptSecret, decryptSecret, getEncryptionKey, init_crypto, withLoopPath, bindLoopPath, startEventLoopLagProbe, stopEventLoopLagProbe, init_event_loop_lag, DbTransactionDeadlineError, isInTransaction, init_db_client, breaksJsonValidity, scrubJsonValue, foldHexCopies, init_scrub_json, sealJson, init_sealed_json, getPromptTemplateDefaultDrift, init_default_drift, init_templates2, init_templates3, isSqliteVecAvailable2, resolveSqliteVecExtensionPath2, __resetSqliteVecExtensionPathCacheForTests2, initDb2, getDb2, closeDb2, getDbClient2, init_runtime2, isRbacEnabled, decideAdmission, decideToolAdmission, grantLeadEquivalence, revokeLeadEquivalence, init_elevated_agents, LEGACY_RULES, setAuditSink, clearAuditSink, can, PermissionVerbSchema, init_rbac, CHAT_SDK_ADAPTER_NAMES, CHAT_SDK_ADAPTER_SCHEMAS, ChatSdkAdaptersDraftSchema, firstIssueText, isAdapterEntryEnabled, init_schema, TELEMETRY_RANKING_KEY, PUBLIC_RANKING_ENABLED_KEY, RANKING_CATEGORIES, readTelemetryRanking, rankingFormSchema, buildListing, init_telemetry_ranking, resolveQuickJSPoolSize, init_quickjs_pool_config, SLACK_REACTION_DEFAULTS, SLACK_REACTION_CONFIG_KEYS, reactionName, completedStatusIcon, init_reaction_shortcode, API_DRAINING_HEADER, API_DRAIN_MAX_MS_LIMIT, isApiDrainingResponse, init_api_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, 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, 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, slackThreadHasOutcomeWork, 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, searchMemoryCandidates, init_search_candidates, rowToCandidate, init_sqlite_store, getEmbeddingProvider2, resetEmbeddingProvider2, getMemoryStore2, init_memory, embeddingProvider2, computeScriptEmbedding2, writeScriptEmbedding2, embedScript2, searchScripts2, reembedAllScripts2, init_embeddings, upsertScriptByName, getScript, 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, 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, modelProfileReferences, modelProfileRefError, 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, 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, drainHumanFreeReclassifyQueue, init_human_free, onTaskStarted, init_task_lifecycle_events, channelTopic, addWorkerSubscription, removeWorkerSubscription, listSubscribedWorkerAgents, init_channels, publishWorkerNudge, init_worker_nudges, createTask2, getPendingTaskForAgent2, assignUnassignedTaskPending2, startTask2, updateTaskClaudeSessionId2, recordTaskProviderIfUnset2, updateTaskTitle2, updateTaskTags2, setTaskTitleIfUnset2, completeTask2, failTask2, overwriteTerminalTaskResultText2, cancelTask2, skipTask2, supersedeTask2, settleSupersededTaskDependents2, backfillSupersedeTaskResumeTaskId2, pauseTask2, resumeTask2, getPausedTasksForAgent2, getOrphanedInProgressTasksForAgent2, resetOrphanedInProgressTasksForAgent2, getRecentlyCancelledTasksForAgent2, deleteTask2, updateTaskProgress2, init_write, IdempotencyKeyTakenError, workflowRequestFingerprint, findAcceptedWorkflowOperation, assertWorkflowIdempotencyKeyUnused, recordAcceptedWorkflowOperation, init_workflow_idempotency, PINNED_WORKFLOW_KEYS2, toPinnedDefinition2, pinWorkflowDefinition2, getRunWorkflow2, 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 };