@desplega.ai/agent-swarm 2.8.2 → 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 (558) hide show
  1. package/dist/acp-adapter-jqn86aam.js +16 -0
  2. package/dist/acp-targets-swxq55dr.js +23 -0
  3. package/dist/{actions-kxek041g.js → actions-pb678g3e.js} +22 -20
  4. package/dist/agent-fs-provision-dmhnc38q.js +27 -0
  5. package/dist/{amp-adapter-ce7jjke4.js → amp-adapter-3pa66q27.js} +3 -3
  6. package/dist/{anthropic-messages-jkva0zps.js → anthropic-messages-x2cp5fvf.js} +41 -41
  7. package/dist/{app-v6zz8yh0.js → app-17d12ev4.js} +6 -4
  8. package/dist/approval-notifications-h7vd9pmg.js +20 -0
  9. package/dist/{assistant-m0sw9xx2.js → assistant-t7k39ree.js} +56 -34
  10. package/dist/{azure-openai-responses-wgtqkbr3.js → azure-openai-responses-590s1eea.js} +10 -10
  11. package/dist/{boot-args-schema-66bk37wv.js → boot-args-schema-0gqmkfbe.js} +1 -1
  12. package/dist/{boot-reembed-edjpwsc1.js → boot-reembed-f064w382.js} +1 -1
  13. package/dist/{boot-reembed-y27n09tz.js → boot-reembed-n6anc01d.js} +1 -1
  14. package/dist/{boot-scrub-sweep-1xc35965.js → boot-scrub-sweep-ejd5dnrz.js} +84 -13
  15. package/dist/{boot-seeds-7hjj91qj.js → boot-seeds-f99fjs5q.js} +4 -4
  16. package/dist/{boxd-ent8ch04.js → boxd-wn235q80.js} +7 -7
  17. package/dist/claude-adapter-gvznwxgc.js +28 -0
  18. package/dist/{claude-managed-adapter-jh6c523j.js → claude-managed-adapter-pbrbvc64.js} +4 -4
  19. package/dist/{claude-managed-setup-y6z2perp.js → claude-managed-setup-kdxttvc3.js} +11 -11
  20. package/dist/{claude-sdk-session-vvya8wqk.js → claude-sdk-session-0t2teq6n.js} +9386 -9197
  21. package/dist/{cli-yjdgea32.js → cli-1jx0srjt.js} +17 -17
  22. package/dist/{cli-rmzsadkf.js → cli-1tvdx9t5.js} +2 -2
  23. package/dist/{cli-3vmb0n58.js → cli-25nstr34.js} +1 -1
  24. package/dist/{cli-959kp5h2.js → cli-2kg31ted.js} +45 -38
  25. package/dist/{cli-4vzgeta4.js → cli-2tnbc3gw.js} +375 -127
  26. package/dist/{cli-tekytdq9.js → cli-3zxdz9r7.js} +9 -9
  27. package/dist/{cli-bsywb58a.js → cli-4ghh072d.js} +16 -16
  28. package/dist/{cli-9mb2q6pb.js → cli-57pvhnyt.js} +4 -4
  29. package/dist/{cli-d84byzn8.js → cli-5a6pqy45.js} +441 -53
  30. package/dist/{cli-jrzkw01m.js → cli-5gpqgs8b.js} +2 -2
  31. package/dist/{cli-0cq8y6m7.js → cli-5gygrr67.js} +9 -9
  32. package/dist/{cli-z1w943va.js → cli-5kcmxwxv.js} +3 -3
  33. package/dist/{cli-3e875j5p.js → cli-5ntc4we6.js} +3189 -328
  34. package/dist/{cli-bst1vp7e.js → cli-5y2fvw4z.js} +13 -5
  35. package/dist/{cli-mrt48bx7.js → cli-6237rnyr.js} +1 -1
  36. package/dist/cli-6dp0jkfj.js +754 -0
  37. package/dist/{cli-b98a65ed.js → cli-7831nhaw.js} +5 -5
  38. package/dist/{cli-kjtwrhea.js → cli-7cgf614g.js} +10 -10
  39. package/dist/{cli-fwy8kfd6.js → cli-7fx9jyfs.js} +942 -63
  40. package/dist/{cli-28fq781p.js → cli-7zm3b3f5.js} +1 -1
  41. package/dist/{cli-v1dv1r37.js → cli-812paz57.js} +143 -9
  42. package/dist/{cli-837vfs2x.js → cli-8axx8vnw.js} +4 -4
  43. package/dist/cli-8x8y70av.js +103 -0
  44. package/dist/{cli-vj75tyaw.js → cli-95930z69.js} +15 -7
  45. package/dist/{cli-j24zbska.js → cli-9a2rtd77.js} +16 -14
  46. package/dist/cli-9ttx00s3.js +137 -0
  47. package/dist/{cli-6ek0hff4.js → cli-a9hfzg2r.js} +3 -3
  48. package/dist/{cli-dzpc6en0.js → cli-aa8s22gn.js} +19 -14
  49. package/dist/{cli-x1wa213s.js → cli-bk9v1xrv.js} +21 -21
  50. package/dist/{cli-a0z912j7.js → cli-c07v0qfa.js} +194 -75
  51. package/dist/{cli-1qkz151v.js → cli-c5cspahx.js} +28 -36
  52. package/dist/{cli-vdektqgf.js → cli-cw7mc1je.js} +4 -4
  53. package/dist/{cli-n6vtrcht.js → cli-dd37e0cm.js} +2 -2
  54. package/dist/cli-dqgnbnxs.js +132 -0
  55. package/dist/{cli-kc7v1nfv.js → cli-dx439zpg.js} +1 -1
  56. package/dist/{cli-q6mfk1ej.js → cli-dzzh58sy.js} +2 -2
  57. package/dist/{cli-f6bahpn5.js → cli-e9973bf0.js} +8 -6
  58. package/dist/{cli-2znm3dzj.js → cli-eds5xnsz.js} +2 -2
  59. package/dist/{cli-6rc5frdm.js → cli-eepnpee7.js} +34 -37
  60. package/dist/{cli-rvhdmjvt.js → cli-eg437b5p.js} +1 -1
  61. package/dist/cli-faf46gdq.js +714 -0
  62. package/dist/{cli-f4r3g076.js → cli-fgphc007.js} +2 -2
  63. package/dist/{cli-5y340nzn.js → cli-fnh4b12r.js} +24 -18
  64. package/dist/{cli-fsgttth8.js → cli-g0vv9dg4.js} +13 -13
  65. package/dist/{cli-e1p3n5gq.js → cli-g3zzby8t.js} +13 -13
  66. package/dist/{cli-3vjhs18n.js → cli-gabsjg8x.js} +3 -1
  67. package/dist/{cli-1pz0330a.js → cli-gddgcnav.js} +3 -3
  68. package/dist/{cli-97ae65rz.js → cli-h474mvp5.js} +11 -11
  69. package/dist/{cli-m88rpzkh.js → cli-hnamkvnc.js} +2 -2
  70. package/dist/{cli-8bpgbr8k.js → cli-j49yqpvh.js} +6 -6
  71. package/dist/{cli-w401b9tq.js → cli-jd3kxppb.js} +1 -1
  72. package/dist/{cli-m9s2qff2.js → cli-jg5txpm6.js} +187 -93
  73. package/dist/{cli-8aes17e4.js → cli-js8zrfyg.js} +3 -3
  74. package/dist/{cli-pfs8adn4.js → cli-k09cxm6m.js} +9 -7
  75. package/dist/{cli-q24n86d2.js → cli-k7pt28ad.js} +10 -3
  76. package/dist/{cli-zh9rsbqf.js → cli-kaa4bd7x.js} +11 -8
  77. package/dist/cli-kj0hyr43.js +51 -0
  78. package/dist/{cli-g70vxtjh.js → cli-kmvcm34h.js} +2 -2
  79. package/dist/{cli-t2tma8gb.js → cli-kqh27v2y.js} +2 -2
  80. package/dist/{cli-mxn1qvbn.js → cli-m1fbz2wj.js} +32 -57
  81. package/dist/{cli-2kvhc7x8.js → cli-mc1fx4xd.js} +51 -90
  82. package/dist/{cli-pchypa1s.js → cli-me4maa4j.js} +61 -6
  83. package/dist/{cli-504akrp9.js → cli-meydjstb.js} +3 -3
  84. package/dist/{cli-n30e0hcp.js → cli-mna6pmfx.js} +2 -2
  85. package/dist/cli-nhq5js1b.js +142 -0
  86. package/dist/cli-nmcpzbty.js +296 -0
  87. package/dist/cli-nr46j5pw.js +78 -0
  88. package/dist/{cli-5mrq3ake.js → cli-pn1v1pb0.js} +1 -1
  89. package/dist/{cli-f4e8r23x.js → cli-pwsax0vp.js} +11 -6
  90. package/dist/{cli-gyt3zydq.js → cli-pz1c00aa.js} +9 -754
  91. package/dist/{cli-eddnyg3t.js → cli-q2d3e1k1.js} +1 -1
  92. package/dist/{cli-fpjmegdb.js → cli-q8cfh1t9.js} +2 -2
  93. package/dist/{cli-vqva1teb.js → cli-qe909n63.js} +2 -2
  94. package/dist/{cli-2r0jcc3k.js → cli-qj39vrc6.js} +1 -1
  95. package/dist/{cli-0agcv1v5.js → cli-rqx70rcz.js} +2 -2
  96. package/dist/{cli-0jzra9ad.js → cli-rts1qvb4.js} +2 -2
  97. package/dist/{cli-3rkdne1h.js → cli-sn4pc4qx.js} +2 -2
  98. package/dist/{cli-98rwmcyc.js → cli-snxhtehz.js} +3 -3
  99. package/dist/{cli-d829z3xc.js → cli-spfz393q.js} +6 -6
  100. package/dist/{cli-6wj7p986.js → cli-spzkdgtg.js} +3 -3
  101. package/dist/{cli-m2z8jagn.js → cli-srtkr1h2.js} +18 -18
  102. package/dist/{cli-2gxeg5gr.js → cli-ssvdrk4y.js} +1 -1
  103. package/dist/{cli-jdknh18m.js → cli-svc803vq.js} +69 -816
  104. package/dist/{cli-7349va39.js → cli-t9ga4qmb.js} +935 -445
  105. package/dist/{cli-m5akxq8q.js → cli-vs9vdpy0.js} +1 -1
  106. package/dist/{cli-26ctbcdp.js → cli-vvgaz8t6.js} +93 -44
  107. package/dist/{cli-3sy2xags.js → cli-vw5x18yj.js} +39 -69
  108. package/dist/{cli-kchjb7qy.js → cli-w16kwbzw.js} +1 -1
  109. package/dist/cli-w7dxb2fj.js +921 -0
  110. package/dist/{cli-x6t50dmw.js → cli-wr1h0k28.js} +3 -3
  111. package/dist/{cli-d6521kb5.js → cli-x40a0w9j.js} +1 -1
  112. package/dist/{cli-k28wkapa.js → cli-xf1wn5ns.js} +2 -2
  113. package/dist/{cli-rh15cakt.js → cli-xwsm6xkr.js} +1 -1
  114. package/dist/{cli-rcecc3yq.js → cli-ymct0ycy.js} +321 -111
  115. package/dist/{cli-xzm9vcfg.js → cli-zg3z63x3.js} +2 -2
  116. package/dist/cli.js +29 -26
  117. package/dist/{codex-adapter-zerf5qsp.js → codex-adapter-44yq2fkn.js} +9 -9
  118. package/dist/{codex-hook-30gyhzxe.js → codex-hook-h1zb7cfk.js} +6 -6
  119. package/dist/{codex-login-bcda78ge.js → codex-login-cdyrr5y1.js} +1 -1
  120. package/dist/{codex-session-runner-89s304py.js → codex-session-runner-zbh26gbw.js} +10 -10
  121. package/dist/{commands-jeh1b51j.js → commands-54f02v5b.js} +3 -3
  122. package/dist/{controller-mctfbrse.js → controller-9gpwcdek.js} +6 -6
  123. package/dist/{controllers-connect-nxa1ddwn.js → controllers-connect-61re6k1n.js} +26 -25
  124. package/dist/{cursor-adapter-qj8vehv6.js → cursor-adapter-7e4g81vd.js} +2 -2
  125. package/dist/{db-b36qn6k3.js → db-dg2gc7fd.js} +17 -13
  126. package/dist/{db-2dvay0es.js → db-wnh0qjy1.js} +3 -3
  127. package/dist/{devin-adapter-xedz98zv.js → devin-adapter-zp4tqq53.js} +1 -1
  128. package/dist/{dispatcher-gndbta01.js → dispatcher-jrm24r43.js} +19 -18
  129. package/dist/{docker-866qpzt9.js → docker-9aq30pp2.js} +5 -5
  130. package/dist/{dsh-adapter-f75sz821.js → dsh-adapter-1yqk267c.js} +2 -2
  131. package/dist/{e2b-3gpc2n3w.js → e2b-3v1e745x.js} +6 -6
  132. package/dist/{e2b-jbm7mj93.js → e2b-sm28k0k3.js} +6 -6
  133. package/dist/{easter-egg-3d-533knw22.js → easter-egg-3d-r4h9cs9m.js} +1 -1
  134. package/dist/{embedding-space-4p05vb2x.js → embedding-space-bafjr5f7.js} +6 -6
  135. package/dist/{embeddings-m6768mgh.js → embeddings-7xmgqe0e.js} +1 -1
  136. package/dist/{event-bus-e66gh7cc.js → event-bus-xr83x566.js} +1 -1
  137. package/dist/{execute-b3mrb1mv.js → execute-d6jg5ns0.js} +1 -1
  138. package/dist/{external-channel-gjv3jne3.js → external-channel-frq1xvq2.js} +2 -2
  139. package/dist/fx-adapter-0zrkfbkd.js +19 -0
  140. package/dist/{getMachineId-bsd-nfgrzarv.js → getMachineId-bsd-637a7rbk.js} +3 -3
  141. package/dist/{getMachineId-darwin-wz886dsk.js → getMachineId-darwin-9vytrcnn.js} +3 -3
  142. package/dist/{getMachineId-linux-1nng3p1p.js → getMachineId-linux-mkzsvyyz.js} +3 -3
  143. package/dist/{getMachineId-unsupported-a0428vw9.js → getMachineId-unsupported-4cfs2n11.js} +3 -3
  144. package/dist/{getMachineId-win-h45922nq.js → getMachineId-win-154s3qma.js} +3 -3
  145. package/dist/{google-generative-ai-h7s3e9kk.js → google-generative-ai-hh7strj3.js} +1 -1
  146. package/dist/{google-vertex-fhxaafzw.js → google-vertex-fy5bw2pm.js} +5 -5
  147. package/dist/grok-adapter-3db1c538.js +19 -0
  148. package/dist/handlers-k22n8mnn.js +33 -0
  149. package/dist/{heartbeat-a1tv60gt.js → heartbeat-6bpa611t.js} +22 -21
  150. package/dist/{hook-8h5dzcgq.js → hook-hvm5nf46.js} +5 -5
  151. package/dist/{hook-cyaps9ba.js → hook-w12k146y.js} +14 -14
  152. package/dist/{http-t15mhbd9.js → http-43tthdvs.js} +5838 -2600
  153. package/dist/{index-d6wkh8ar.js → index-1f0vypbg.js} +2 -2
  154. package/dist/{index-enn321kd.js → index-42jq9yy3.js} +3 -3
  155. package/dist/{index-khe3gp0k.js → index-4b1q8kan.js} +20 -20
  156. package/dist/{index-hjhfk3ra.js → index-585gyczt.js} +1 -1
  157. package/dist/index-8xcyd3mc.js +33 -0
  158. package/dist/index-9sy2bh6n.js +38 -0
  159. package/dist/{index-2skqtd76.js → index-b24j7t2m.js} +30 -28
  160. package/dist/{index-gjwaqaq8.js → index-cret47a5.js} +6 -6
  161. package/dist/{index-qwj6ntem.js → index-e3krvkh2.js} +4 -4
  162. package/dist/{index-w1zqf680.js → index-fn054vsf.js} +1 -1
  163. package/dist/{index-qav6455f.js → index-ftywhyr0.js} +214 -152
  164. package/dist/{index-tvfafeyy.js → index-mhq4sh5w.js} +1 -1
  165. package/dist/index-tx9mc2ap.js +570 -0
  166. package/dist/index-wjd56k1v.js +34 -0
  167. package/dist/{keepalive-91s7hzrb.js → keepalive-rk0j0jvh.js} +4 -4
  168. package/dist/lead-atxf3q6e.js +72 -0
  169. package/dist/{maintenance-7pjmy5xy.js → maintenance-g6z6kaxw.js} +1 -1
  170. package/dist/{node-4c5jqxr3.js → node-7qsx5kvm.js} +1 -1
  171. package/dist/{node-252anz2h.js → node-jftbyawr.js} +4 -4
  172. package/dist/{node-ray25snp.js → node-zd6shky9.js} +3 -3
  173. package/dist/{oauth-refresh-sweep-rzqfm94j.js → oauth-refresh-sweep-2k3g2q4w.js} +3 -3
  174. package/dist/{onboard-74st7pag.js → onboard-6fdbvh3v.js} +8 -8
  175. package/dist/{openai-codex-responses-k9gapdze.js → openai-codex-responses-bkcd8pjj.js} +9 -9
  176. package/dist/{openai-responses-4d5dx3c7.js → openai-responses-gbh0wfqe.js} +13 -13
  177. package/dist/{opencode-adapter-arn7gm8q.js → opencode-adapter-fdbsvts7.js} +7 -7
  178. package/dist/{otel-impl-rnzey8cb.js → otel-impl-rvwtc09q.js} +110 -110
  179. package/dist/pending-sqkrb836.js +80 -0
  180. package/dist/{pi-mono-adapter-6mkwq64n.js → pi-mono-adapter-asqayqcg.js} +13 -13
  181. package/dist/{pricing-refresh-ha21jhk7.js → pricing-refresh-f5tkgmw2.js} +2 -2
  182. package/dist/{rbac-roles-wqhma4dr.js → rbac-roles-06s555fa.js} +3 -3
  183. package/dist/{rbac-roles-59dxachk.js → rbac-roles-szxsg8t1.js} +10 -3
  184. package/dist/{render-v2-14kpzx12.js → render-v2-103p266q.js} +4 -4
  185. package/dist/{resume-gsa5fb5f.js → resume-v7kjewt9.js} +8 -7
  186. package/dist/{runtime-1hv06jsn.js → runtime-f1gmk0b7.js} +1 -1
  187. package/dist/{session-access-skm7bnp6.js → session-access-6shev8ts.js} +4 -4
  188. package/dist/{session-source-backfill-pbqzbncv.js → session-source-backfill-bd7spzjd.js} +3 -3
  189. package/dist/{setup-5yermsem.js → setup-kmxmztdb.js} +1 -1
  190. package/dist/thread-buffer-4yz236d0.js +36 -0
  191. package/dist/{virtual-modules-gazyapte.js → virtual-modules-57eje5wy.js} +5 -5
  192. package/dist/{work-objects-xj0ck0w4.js → work-objects-zr47ygmf.js} +23 -21
  193. package/dist/{worker-follow-up-911xc0b8.js → worker-follow-up-grrr3fda.js} +19 -18
  194. package/dist/worker-p4hbtcy3.js +72 -0
  195. package/dist/{x-2fyrt5pp.js → x-wg164ss9.js} +2 -2
  196. package/openapi.json +4518 -2356
  197. package/package.json +11 -8
  198. package/plugin/commands/create-pr.md +1 -1
  199. package/plugin/pi-skills/create-pr/SKILL.md +1 -1
  200. package/src/apps/action-runner.ts +21 -1
  201. package/src/apps/catalog.generated.json +626 -17
  202. package/src/apps/page-validator.ts +314 -8
  203. package/src/assets/key.ts +6 -0
  204. package/src/be/agent-fs-user-keys.ts +186 -0
  205. package/src/be/audit-user.ts +27 -13
  206. package/src/be/automation-preflight.test.ts +14 -14
  207. package/src/be/automation-preflight.ts +24 -16
  208. package/src/be/boot-scrub-sweep.ts +143 -14
  209. package/src/be/caller-session-group.ts +86 -0
  210. package/src/be/checklist.ts +375 -0
  211. package/src/be/db/agents.ts +12 -1
  212. package/src/be/db/approvals.ts +26 -0
  213. package/src/be/db/session-moves.ts +23 -0
  214. package/src/be/db/session-tree.ts +78 -19
  215. package/src/be/db/tasks/eligibility-scan.ts +14 -0
  216. package/src/be/db/tasks/read.ts +33 -0
  217. package/src/be/db/tasks/slack-fold.ts +116 -0
  218. package/src/be/db/tasks/write.ts +34 -0
  219. package/src/be/db-queries/mcp-servers.ts +13 -0
  220. package/src/be/db-queries/oauth.ts +6 -0
  221. package/src/be/db-queries/task-artifacts.ts +10 -8
  222. package/src/be/db.ts +74 -22
  223. package/src/be/extensions/assets.ts +17 -13
  224. package/src/be/import/config.ts +54 -0
  225. package/src/be/import/dir-source.ts +372 -0
  226. package/src/be/import/index.ts +149 -0
  227. package/src/be/import/pending.ts +71 -0
  228. package/src/be/import/schema.ts +137 -0
  229. package/src/be/import/seeders.ts +462 -0
  230. package/src/be/migrations/289_automation_savings_daily.sql +47 -0
  231. package/src/be/migrations/291_task_slack_participants.sql +4 -0
  232. package/src/be/migrations/293_savings_component_links.sql +58 -0
  233. package/src/be/migrations/296_automation_savings_daily_read_index.sql +6 -0
  234. package/src/be/migrations/297_import_ownership.sql +34 -0
  235. package/src/be/migrations/301_favorites_key_type.sql +36 -0
  236. package/src/be/migrations/302_checklist_items.sql +23 -0
  237. package/src/be/model-profile-check.ts +10 -2
  238. package/src/be/multi-runtime.ts +8 -1
  239. package/src/be/rbac-roles.ts +8 -1
  240. package/src/be/runtime-pools/demand.ts +20 -2
  241. package/src/be/runtime-pools/reachability.ts +31 -0
  242. package/src/be/runtime-pools/routing.ts +8 -1
  243. package/src/be/runtime-pools/supervisor.ts +6 -7
  244. package/src/be/savings/compute.ts +511 -16
  245. package/src/be/savings/model.ts +282 -14
  246. package/src/be/savings/read.ts +1502 -0
  247. package/src/be/savings/rollup.ts +571 -0
  248. package/src/be/script-credential-broker.ts +2 -2
  249. package/src/be/scripts/run-credential.ts +15 -3
  250. package/src/be/scripts/typecheck.ts +90 -8
  251. package/src/be/seed/agent-fs-provision.ts +104 -19
  252. package/src/be/seed/index.ts +1 -1
  253. package/src/be/seed/registry.ts +27 -8
  254. package/src/be/seed/runner.ts +1 -1
  255. package/src/be/seed/schedules-seeder.ts +24 -6
  256. package/src/be/seed/seed-toggle.ts +32 -0
  257. package/src/be/seed/types.ts +6 -0
  258. package/src/be/seed-scripts/catalog/dreaming-gather.ts +2 -2
  259. package/src/be/seed-scripts/catalog/dreaming-learnings.ts +10 -2
  260. package/src/be/seed-scripts/catalog/dreaming-memtax-create.ts +70 -4
  261. package/src/be/steering.ts +27 -4
  262. package/src/be/swarm-config-guard.ts +38 -0
  263. package/src/be/task-citations.ts +8 -5
  264. package/src/be/users.ts +29 -2
  265. package/src/commands/onboard/agent-fs-version.ts +1 -1
  266. package/src/commands/runner.ts +219 -42
  267. package/src/e2b/env.ts +2 -0
  268. package/src/extensions/catalog.generated.json +17 -0
  269. package/src/extensions/contract-types.generated.ts +1 -1
  270. package/src/github/app.ts +10 -1
  271. package/src/github/handlers.ts +6 -3
  272. package/src/github/reactions.ts +12 -14
  273. package/src/heartbeat/heartbeat.ts +14 -4
  274. package/src/http/agents.ts +19 -10
  275. package/src/http/all-routes.ts +2 -0
  276. package/src/http/approval-requests.ts +24 -4
  277. package/src/http/apps.ts +69 -5
  278. package/src/http/checklist.ts +176 -0
  279. package/src/http/db-query-bounded.ts +256 -11
  280. package/src/http/db-query-shared.ts +9 -0
  281. package/src/http/favorites.ts +14 -2
  282. package/src/http/fs.ts +346 -1
  283. package/src/http/index.ts +37 -2
  284. package/src/http/kv.ts +13 -0
  285. package/src/http/mcp-oauth.ts +1 -1
  286. package/src/http/mcp-servers.ts +15 -2
  287. package/src/http/onboarding.ts +2 -9
  288. package/src/http/poll.ts +59 -1
  289. package/src/http/requested-by.ts +97 -1
  290. package/src/http/savings.ts +676 -190
  291. package/src/http/script-connections.ts +1 -0
  292. package/src/http/scripts.ts +26 -15
  293. package/src/http/sessions.ts +17 -0
  294. package/src/http/slack-events.ts +101 -0
  295. package/src/http/status.ts +25 -7
  296. package/src/http/task-requester.ts +46 -0
  297. package/src/http/tasks.ts +107 -42
  298. package/src/http/users.ts +14 -0
  299. package/src/http/webhooks.ts +15 -0
  300. package/src/integrations/cards/index.ts +151 -0
  301. package/src/integrations/chat-sdk/outbound.ts +39 -13
  302. package/src/integrations/chat-sdk/runtime.ts +7 -1
  303. package/src/integrations/chat-sdk/status.ts +17 -0
  304. package/src/integrations/chat-sdk/telegram-api.ts +6 -1
  305. package/src/kv-reserved-namespaces.ts +17 -2
  306. package/src/oauth/presets.ts +29 -2
  307. package/src/prompts/base-prompt.ts +17 -4
  308. package/src/prompts/session-templates.ts +163 -9
  309. package/src/providers/acp-targets.ts +2 -2
  310. package/src/providers/amp-adapter.ts +1 -1
  311. package/src/providers/claude-adapter.ts +0 -20
  312. package/src/providers/claude-flag-settings.ts +12 -10
  313. package/src/providers/claude-managed-adapter.ts +5 -1
  314. package/src/providers/codex-adapter.ts +10 -35
  315. package/src/providers/codex-app-server.ts +2 -11
  316. package/src/providers/opencode-adapter.ts +41 -31
  317. package/src/providers/runtime-dependencies.ts +158 -0
  318. package/src/rbac/legacy-policy.ts +2 -0
  319. package/src/rbac/permissions.ts +10 -1
  320. package/src/scheduler/scheduler.ts +20 -14
  321. package/src/scripts-runtime/credential-broker/default-bindings.ts +19 -11
  322. package/src/scripts-runtime/credential-broker/index.ts +1 -1
  323. package/src/scripts-runtime/ctx.ts +1 -1
  324. package/src/scripts-runtime/egress-secrets.ts +2 -2
  325. package/src/scripts-runtime/executors/quickjs-bundle.ts +1 -0
  326. package/src/scripts-runtime/executors/quickjs-prelude.ts +162 -2
  327. package/src/scripts-runtime/executors/quickjs-runner.ts +4 -1
  328. package/src/scripts-runtime/stdlib/fetch.ts +113 -15
  329. package/src/scripts-runtime/stdlib/index.ts +3 -1
  330. package/src/scripts-runtime/stdlib/retry.ts +174 -0
  331. package/src/scripts-runtime/swarm-sdk.ts +187 -17
  332. package/src/scripts-runtime/types/stdlib.d.ts +97 -8
  333. package/src/scripts-runtime/types/swarm-extension.d.ts +27 -1
  334. package/src/scripts-runtime/types/swarm-sdk.d.ts +71 -6
  335. package/src/server.ts +4 -4
  336. package/src/slack/actions.ts +1 -0
  337. package/src/slack/app.ts +87 -46
  338. package/src/slack/assistant.ts +35 -7
  339. package/src/slack/enrich.ts +144 -50
  340. package/src/slack/handlers.ts +43 -99
  341. package/src/slack/http-receiver.ts +284 -0
  342. package/src/slack/inbound-dispatch.ts +43 -7
  343. package/src/slack/inbound-files.ts +33 -14
  344. package/src/slack/message-text.ts +47 -4
  345. package/src/slack/render-v2.ts +2 -1
  346. package/src/slack/socket-ack.ts +17 -10
  347. package/src/slack/steering.ts +5 -0
  348. package/src/slack/templates.ts +9 -0
  349. package/src/slack/thread-buffer-store.ts +58 -0
  350. package/src/slack/thread-buffer.ts +367 -109
  351. package/src/slack/thread-participants.ts +187 -0
  352. package/src/tasks/context-key.ts +24 -0
  353. package/src/tasks/sibling-awareness.ts +13 -1
  354. package/src/tests/agent-fs-live-url.test.ts +15 -0
  355. package/src/tests/agent-fs-provision-seeder.test.ts +140 -0
  356. package/src/tests/agent-fs-user-keys.test.ts +483 -0
  357. package/src/tests/agentfs-proxy.test.ts +8 -8
  358. package/src/tests/approval-card-resolution.test.ts +396 -0
  359. package/src/tests/approval-requests-notifications.test.ts +1 -1
  360. package/src/tests/approval-respond-auth.test.ts +28 -0
  361. package/src/tests/apps-action-parent-task.test.ts +140 -0
  362. package/src/tests/apps-catalog-additions.test.ts +315 -0
  363. package/src/tests/apps-catalog-files.test.ts +114 -0
  364. package/src/tests/apps-catalog-hitl.test.ts +117 -0
  365. package/src/tests/apps-catalog-inputs.test.ts +86 -0
  366. package/src/tests/apps-catalog-table.test.ts +47 -0
  367. package/src/tests/apps-chart-shell.test.ts +1 -1
  368. package/src/tests/apps-element-assembly.test.ts +52 -3
  369. package/src/tests/apps-session-thread.test.ts +182 -0
  370. package/src/tests/asset-key-invariants.test.ts +14 -0
  371. package/src/tests/base-prompt.test.ts +108 -23
  372. package/src/tests/boot-scrub-sweep.test.ts +172 -0
  373. package/src/tests/caller-session-group.test.ts +199 -0
  374. package/src/tests/cards.test.ts +169 -0
  375. package/src/tests/chat-sdk-status-route.test.ts +16 -3
  376. package/src/tests/chat-sdk-telegram-token.test.ts +76 -0
  377. package/src/tests/chat-sdk-tools.test.ts +147 -0
  378. package/src/tests/checklist-nudge.test.ts +208 -0
  379. package/src/tests/checklist.test.ts +686 -0
  380. package/src/tests/claude-adapter-binary.test.ts +7 -1
  381. package/src/tests/claude-adapter.test.ts +10 -64
  382. package/src/tests/claude-flag-settings.test.ts +15 -11
  383. package/src/tests/claude-hook-credentials.test.ts +0 -1
  384. package/src/tests/claude-sdk-lifecycle.test.ts +5 -1
  385. package/src/tests/codex-adapter.test.ts +17 -78
  386. package/src/tests/codex-app-server.test.ts +16 -0
  387. package/src/tests/comb-config-guard.test.ts +21 -0
  388. package/src/tests/comb-default.test.ts +59 -97
  389. package/src/tests/comb-links.test.ts +86 -16
  390. package/src/tests/comb-status.test.ts +24 -27
  391. package/src/tests/create-page-tool.test.ts +101 -1
  392. package/src/tests/create-schedule-key.test.ts +105 -0
  393. package/src/tests/create-task-vcs-repo.test.ts +136 -0
  394. package/src/tests/credential-broker.test.ts +2 -2
  395. package/src/tests/db-query.test.ts +87 -1
  396. package/src/tests/db-task-read-contract.test.ts +3 -0
  397. package/src/tests/db-task-write-contract.test.ts +3 -1
  398. package/src/tests/docs-index-footprint.test.js +3 -3
  399. package/src/tests/dreaming-learnings.test.ts +104 -0
  400. package/src/tests/entrypoint-github-enterprise.test.ts +158 -0
  401. package/src/tests/extensions-assets.test.ts +7 -3
  402. package/src/tests/extensions-catalog.test.ts +1 -0
  403. package/src/tests/extensions-example-sql-admin-only.test.ts +198 -0
  404. package/src/tests/extensions-pre-task.test.ts +7 -5
  405. package/src/tests/extensions-steering.test.ts +14 -2
  406. package/src/tests/favorites-agent-fs-path.test.ts +124 -0
  407. package/src/tests/fetch-resolved-env.test.ts +115 -1
  408. package/src/tests/fixtures/import-package.ts +32 -0
  409. package/src/tests/fixtures/runner-missing-dependency.ts +129 -0
  410. package/src/tests/fs-routes.test.ts +505 -2
  411. package/src/tests/github-ghes-mock.test.ts +196 -0
  412. package/src/tests/github-host.test.ts +285 -0
  413. package/src/tests/heartbeat-supersede-resume.test.ts +73 -0
  414. package/src/tests/heartbeat.test.ts +56 -0
  415. package/src/tests/import-config.test.ts +209 -0
  416. package/src/tests/import.test.ts +464 -0
  417. package/src/tests/invites-http.test.ts +144 -1
  418. package/src/tests/kv-http.test.ts +11 -0
  419. package/src/tests/literal-matcher.test.ts +58 -0
  420. package/src/tests/mcp-oauth-manual-client.test.ts +1 -1
  421. package/src/tests/oauth-presets.test.ts +12 -0
  422. package/src/tests/opencode-adapter.test.ts +53 -6
  423. package/src/tests/pool-affinity.test.ts +50 -0
  424. package/src/tests/prompt-template-session.test.ts +69 -6
  425. package/src/tests/provider-registration.test.ts +2 -55
  426. package/src/tests/provider-runtime-dependencies.test.ts +212 -0
  427. package/src/tests/rbac-admission.test.ts +19 -0
  428. package/src/tests/rbac-charact-misc-tools.test.ts +31 -0
  429. package/src/tests/rbac-engine.test.ts +2 -0
  430. package/src/tests/rbac-roles.test.ts +2 -0
  431. package/src/tests/runner-missing-dependency.test.ts +61 -0
  432. package/src/tests/runner-requester-profile.test.ts +139 -1
  433. package/src/tests/runtime-pool-reachability.test.ts +135 -1
  434. package/src/tests/runtime-pool-routing.test.ts +52 -0
  435. package/src/tests/runtime-stale-threshold.test.ts +40 -0
  436. package/src/tests/savings-compound.test.ts +774 -0
  437. package/src/tests/savings-compute.test.ts +7 -198
  438. package/src/tests/savings-fleet-latency.test.ts +143 -0
  439. package/src/tests/savings-fleet-read.test.ts +195 -0
  440. package/src/tests/savings-fleet-scale.test.ts +222 -0
  441. package/src/tests/savings-fleet-slices.test.ts +122 -0
  442. package/src/tests/savings-model.test.ts +212 -0
  443. package/src/tests/savings-read.test.ts +408 -0
  444. package/src/tests/savings-rollup.test.ts +766 -0
  445. package/src/tests/savings-scripts.test.ts +617 -0
  446. package/src/tests/script-connections.test.ts +4 -0
  447. package/src/tests/script-executor-conformance.test.ts +481 -0
  448. package/src/tests/scripts-http.test.ts +55 -0
  449. package/src/tests/scripts-runtime-fetch.test.ts +2 -2
  450. package/src/tests/secret-rules.test.ts +124 -1
  451. package/src/tests/secret-scrub-gate.test.ts +257 -0
  452. package/src/tests/secret-scrubber.test.ts +1 -1
  453. package/src/tests/seed-registry.test.ts +142 -9
  454. package/src/tests/session-source-keys.test.ts +42 -1
  455. package/src/tests/sessions-move.test.ts +70 -0
  456. package/src/tests/sessions-tree.test.ts +98 -0
  457. package/src/tests/sessions.test.ts +69 -0
  458. package/src/tests/slack-config.test.ts +4 -18
  459. package/src/tests/slack-dm-implicit-mention.test.ts +20 -1
  460. package/src/tests/slack-http-receiver.test.ts +472 -0
  461. package/src/tests/slack-identity-resolution.test.ts +23 -0
  462. package/src/tests/slack-inbound-files.test.ts +2 -1
  463. package/src/tests/slack-inbound-logging.test.ts +64 -0
  464. package/src/tests/slack-leave-thread.test.ts +1 -1
  465. package/src/tests/slack-message-text.test.ts +104 -0
  466. package/src/tests/slack-mode-lifecycle.test.ts +6 -4
  467. package/src/tests/slack-render-v2.test.ts +48 -0
  468. package/src/tests/slack-skip-reaction.test.ts +2 -2
  469. package/src/tests/slack-steering.test.ts +22 -10
  470. package/src/tests/slack-thread-buffer-context.test.ts +1 -1
  471. package/src/tests/slack-thread-buffer-fold.test.ts +417 -0
  472. package/src/tests/slack-thread-buffer-restore.test.ts +198 -0
  473. package/src/tests/slack-thread-buffer-startup-restore.test.ts +86 -0
  474. package/src/tests/slack-thread-buffer.test.ts +34 -34
  475. package/src/tests/slack-thread-participants.test.ts +447 -0
  476. package/src/tests/slack-tool-blocks.test.ts +167 -0
  477. package/src/tests/status.test.ts +32 -6
  478. package/src/tests/steering-core.test.ts +13 -0
  479. package/src/tests/steering-enabled.test.ts +7 -1
  480. package/src/tests/steering-promotion.test.ts +24 -0
  481. package/src/tests/swarm-config-reserved-keys.test.ts +17 -0
  482. package/src/tests/system-one-hosts-ui-mirror.test.ts +67 -0
  483. package/src/tests/task-artifacts.test.ts +50 -0
  484. package/src/tests/task-session-prompts.test.ts +95 -1
  485. package/src/tests/tool-annotations.test.ts +30 -0
  486. package/src/tests/workflow-system-one-extraction.test.ts +149 -1
  487. package/src/tools/chat-post.ts +19 -4
  488. package/src/tools/chat-reply.ts +20 -4
  489. package/src/tools/create-page.ts +21 -4
  490. package/src/tools/get-swarm.ts +18 -2
  491. package/src/tools/join-swarm.ts +2 -1
  492. package/src/tools/kv/kv-write-auth.ts +17 -1
  493. package/src/tools/schedules/create-schedule.ts +22 -4
  494. package/src/tools/slack-post.ts +40 -7
  495. package/src/tools/slack-reply.ts +50 -14
  496. package/src/types.ts +74 -2
  497. package/src/utils/constants.ts +60 -138
  498. package/src/utils/github-host.ts +217 -0
  499. package/src/utils/github-pull-request.ts +8 -5
  500. package/src/utils/literal-matcher.ts +118 -0
  501. package/src/utils/mcp-server-fetcher.test.ts +89 -0
  502. package/src/utils/mcp-server-fetcher.ts +13 -5
  503. package/src/utils/request-auth-context.ts +24 -0
  504. package/src/utils/secret-rules.generated.ts +1 -1
  505. package/src/utils/secret-scrubber.ts +485 -54
  506. package/src/utils/task-attachment-links.ts +9 -12
  507. package/src/vcs/index.ts +3 -0
  508. package/src/workflows/approval-notifications.ts +188 -12
  509. package/src/workflows/executors/swarm-script.ts +23 -19
  510. package/src/workflows/executors/system-one-extraction.ts +14 -7
  511. package/src/workflows/executors/system-one-providers.ts +22 -1
  512. package/templates/community/open-prompt-showreel/PLAYBOOK.md +1 -1
  513. package/templates/community/open-prompt-showreel/skills/open-prompt-showreel/SKILL.md +1 -1
  514. package/templates/extensions/README.md +1 -0
  515. package/templates/extensions/sql-admin-only/README.md +19 -0
  516. package/templates/extensions/sql-admin-only/hooks.ts +96 -0
  517. package/templates/extensions/sql-admin-only/manifest.json +8 -0
  518. package/templates/import/manifest.schema.json +136 -0
  519. package/templates/import/sources.schema.json +44 -0
  520. package/templates/skills/agent-browser/SKILL.md +1 -1
  521. package/templates/skills/agent-browser/content.md +1 -1
  522. package/templates/skills/apps/SKILL.md +122 -12
  523. package/templates/skills/apps/content.md +122 -12
  524. package/templates/skills/asset-namespaces/content.md +2 -1
  525. package/templates/skills/chat-sdk/content.md +17 -0
  526. package/templates/skills/db-query-guidance/content.md +2 -1
  527. package/templates/skills/scheduling/content.md +27 -0
  528. package/templates/skills/slack-interaction/content.md +12 -2
  529. package/templates/skills/swarm-docs/content.md +1 -0
  530. package/templates/skills/swarm-extensions/config.json +1 -1
  531. package/templates/skills/swarm-extensions/content.md +33 -23
  532. package/templates/skills/swarm-scripts/SKILL.md +18 -4
  533. package/templates/skills/swarm-scripts/content.md +18 -4
  534. package/templates/skills/work-on-task/SKILL.md +1 -1
  535. package/templates/skills/work-on-task/content.md +1 -1
  536. package/templates/skills/workflow-iterate/content.md +4 -7
  537. package/templates/workflows/dreaming/content.md +3 -3
  538. package/dist/acp-adapter-fqzkxyra.js +0 -15
  539. package/dist/claude-adapter-stw7jdcf.js +0 -25
  540. package/dist/cli-4bd1rck6.js +0 -4
  541. package/dist/cli-dns0y538.js +0 -194
  542. package/dist/cli-g5mtmf6t.js +0 -432
  543. package/dist/cli-xf3qw745.js +0 -104
  544. package/dist/fx-adapter-rpsgb1tw.js +0 -18
  545. package/dist/grok-adapter-n2m3zjg1.js +0 -18
  546. package/dist/handlers-nv8edn19.js +0 -32
  547. package/dist/index-ksmyd6kc.js +0 -37
  548. package/dist/index-rjnrje98.js +0 -32
  549. package/dist/index-tv3413wy.js +0 -33
  550. package/dist/lead-3hmddvrm.js +0 -70
  551. package/dist/worker-qgg0m2gw.js +0 -70
  552. package/src/providers/ctx-mode-env.ts +0 -10
  553. package/src/tests/entrypoint-acp-target-binary.test.ts +0 -439
  554. package/dist/{cli-4caa1x7d.js → cli-tsa40663.js} +4 -4
  555. package/dist/{index-0rvk3vd4.js → index-bs7gw5fd.js} +3 -3
  556. package/dist/{mistral-conversations-a45tx39a.js → mistral-conversations-0c30em7t.js} +4 -4
  557. package/dist/{openai-completions-xd579js7.js → openai-completions-f3n69rep.js} +18 -18
  558. 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-1pz0330a.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,
@@ -33,6 +42,7 @@ import {
33
42
  PROVIDER_STEER_CAPABILITIES,
34
43
  FollowUpConfigSchema,
35
44
  RoutingAffinitySchema,
45
+ TaskSlackParticipantsSchema,
36
46
  CreateTaskOptionsSchema,
37
47
  SERVER_GENERATED_ATTACHMENT_CAPABILITY,
38
48
  AgentAvatarSchema,
@@ -40,15 +50,14 @@ import {
40
50
  VersionableFieldSchema,
41
51
  SessionCostModelBreakdownSchema,
42
52
  PageThemeTokensSchema,
43
- init_types4
44
- } from "./cli-pchypa1s.js";
53
+ init_types5
54
+ } from "./cli-me4maa4j.js";
45
55
  import {
46
- CODEX_AUTH_FAILURE_BENCH_THRESHOLD,
47
- CODEX_AUTH_FAILURE_BENCH_MS,
48
- CODEX_AUTH_WATCH_NAMESPACE,
49
- codexAuthBenchMarkerKey,
50
- init_codex_auth_failure
51
- } from "./cli-fw2w0kva.js";
56
+ resolveGitHubHost,
57
+ getGitHubLinkConfig,
58
+ getGitHubHostForSql,
59
+ init_github_host
60
+ } from "./cli-9ttx00s3.js";
52
61
  import {
53
62
  generateDefaultClaudeMd2,
54
63
  generateDefaultSoulMd2,
@@ -63,7 +72,7 @@ import {
63
72
  init_identity_field_budget,
64
73
  contentSha256,
65
74
  init_profile_sync
66
- } from "./cli-dzpc6en0.js";
75
+ } from "./cli-aa8s22gn.js";
67
76
  import {
68
77
  isSlackConfigured,
69
78
  init_config4
@@ -95,7 +104,7 @@ import {
95
104
  splitCredentialPool,
96
105
  selectCredential,
97
106
  init_credentials2
98
- } from "./cli-5mrq3ake.js";
107
+ } from "./cli-pn1v1pb0.js";
99
108
  import {
100
109
  registerTemplate,
101
110
  getAllTemplateDefinitions,
@@ -103,12 +112,12 @@ import {
103
112
  configureDbResolver,
104
113
  init_resolver,
105
114
  init_session_templates
106
- } from "./cli-v1dv1r37.js";
115
+ } from "./cli-812paz57.js";
107
116
  import {
108
117
  setRuntimeModelCatalog,
109
118
  runtimeHarnessSections,
110
119
  init_runtime_model_catalog
111
- } from "./cli-2r0jcc3k.js";
120
+ } from "./cli-qj39vrc6.js";
112
121
  import {
113
122
  init_zod
114
123
  } from "./cli-zcfpsfzf.js";
@@ -129,22 +138,22 @@ import {
129
138
  literal2,
130
139
  exports_iso
131
140
  } from "./cli-hg42n3hx.js";
132
- import {
133
- init_package,
134
- package_default
135
- } from "./cli-zh9rsbqf.js";
136
- import {
137
- realtimeBus,
138
- init_bus
139
- } from "./cli-syfdvhkc.js";
140
141
  import {
141
142
  isEnvFlagEnabled,
142
143
  init_env_flag
143
144
  } from "./cli-cebvbc9t.js";
145
+ import {
146
+ init_package,
147
+ package_default
148
+ } from "./cli-kaa4bd7x.js";
144
149
  import {
145
150
  getNodeEnv,
146
151
  init_node_env
147
152
  } from "./cli-rgeadyvq.js";
153
+ import {
154
+ realtimeBus,
155
+ init_bus
156
+ } from "./cli-syfdvhkc.js";
148
157
  import {
149
158
  chatgptSubscriptionModelId,
150
159
  isAlias,
@@ -167,7 +176,7 @@ import {
167
176
  registerVolatileSecret,
168
177
  registerSensitiveKeyName,
169
178
  init_secret_scrubber
170
- } from "./cli-d84byzn8.js";
179
+ } from "./cli-5a6pqy45.js";
171
180
  import {
172
181
  __toCommonJS,
173
182
  __commonJS,
@@ -299,6 +308,14 @@ function pageContextKey(input) {
299
308
  const pageId = assertSafePart(input.pageId, "pageId");
300
309
  return ["task", "page", pageId].join(SEPARATOR);
301
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
+ }
302
319
  function parseContextKey(key) {
303
320
  if (typeof key !== "string" || key.length === 0) {
304
321
  throw new Error("context-key: key must be a non-empty string");
@@ -459,8 +476,10 @@ function parseContextKey(key) {
459
476
  throw new Error(`context-key: unknown family "${family}": ${JSON.stringify(key)}`);
460
477
  }
461
478
  }
462
- var SEPARATOR = ":";
463
- 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
+ });
464
483
 
465
484
  // src/assets/source-key.ts
466
485
  function sessionSourceKey({
@@ -2701,6 +2720,14 @@ function isOperatorAuth(auth) {
2701
2720
  function getCurrentRequestUserId() {
2702
2721
  return authUserId(getCurrentRequestAuth());
2703
2722
  }
2723
+ function getCurrentRunProvenance() {
2724
+ const auth = getCurrentRequestAuth();
2725
+ if (auth?.kind !== "agent")
2726
+ return null;
2727
+ const sourceStepId = auth.sourceStepId ?? null;
2728
+ const sourceScriptRunId = auth.sourceScriptRunId ?? null;
2729
+ return sourceStepId || sourceScriptRunId ? { sourceStepId, sourceScriptRunId } : null;
2730
+ }
2704
2731
  var requestAuth, authStorage;
2705
2732
  var init_request_auth_context = __esm(() => {
2706
2733
  requestAuth = new WeakMap;
@@ -3407,12 +3434,14 @@ var init_broker = __esm(() => {
3407
3434
  });
3408
3435
 
3409
3436
  // src/scripts-runtime/credential-broker/default-bindings.ts
3410
- var DEFAULT_CREDENTIAL_BINDINGS;
3411
- var init_default_bindings = __esm(() => {
3412
- DEFAULT_CREDENTIAL_BINDINGS = [
3437
+ var defaultCredentialBindings = () => {
3438
+ const host = resolveGitHubHost();
3439
+ if (!host.ok)
3440
+ return [];
3441
+ return [
3413
3442
  {
3414
3443
  configKey: "GITHUB_TOKEN",
3415
- allowedHosts: ["api.github.com"],
3444
+ allowedHosts: [host.config.apiHost],
3416
3445
  headerTemplate: "Authorization: Bearer [REDACTED:GITHUB_TOKEN]",
3417
3446
  scope: "global",
3418
3447
  scopeId: null,
@@ -3420,6 +3449,9 @@ var init_default_bindings = __esm(() => {
3420
3449
  authKind: "config"
3421
3450
  }
3422
3451
  ];
3452
+ };
3453
+ var init_default_bindings = __esm(() => {
3454
+ init_github_host();
3423
3455
  });
3424
3456
 
3425
3457
  // src/utils/egress-guard.ts
@@ -5231,7 +5263,7 @@ function seedContextVersions() {
5231
5263
  var db = null, sqliteVecAvailable = false, cachedSqliteVecExtensionPath = null, dbClientInstance = null, VERSIONABLE_FIELDS;
5232
5264
  var init_runtime2 = __esm(() => {
5233
5265
  init_resolver();
5234
- init_types4();
5266
+ init_types5();
5235
5267
  init_asset_key_audit();
5236
5268
  init_connection_bindings_blob_migration();
5237
5269
  init_crypto();
@@ -5245,7 +5277,7 @@ var init_runtime2 = __esm(() => {
5245
5277
  // src/telemetry-identity.ts
5246
5278
  async function loadUserRole(userId) {
5247
5279
  try {
5248
- const { getUserGrant } = await import("./rbac-roles-wqhma4dr.js");
5280
+ const { getUserGrant } = await import("./rbac-roles-06s555fa.js");
5249
5281
  const grant = await getUserGrant(userId);
5250
5282
  const role = grant.grantsAll ? "admin" : "member";
5251
5283
  const user = await getDbClient2().get("SELECT json_extract(metadata, '$.jobFunction') AS jobFunction FROM users WHERE id = ? AND json_valid(metadata)", [userId]);
@@ -5458,7 +5490,8 @@ var init_config_secrets = () => {};
5458
5490
  function parseGitHubPullRequestToken(token) {
5459
5491
  const candidate = token.replace(TRAILING_PROSE_PUNCTUATION_RE, "");
5460
5492
  const lowerCandidate = candidate.toLowerCase();
5461
- 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}/`)) {
5462
5495
  return null;
5463
5496
  }
5464
5497
  const withScheme = /^https?:\/\//i.test(candidate) ? candidate : `https://${candidate}`;
@@ -5468,7 +5501,7 @@ function parseGitHubPullRequestToken(token) {
5468
5501
  } catch {
5469
5502
  return null;
5470
5503
  }
5471
- 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) {
5472
5505
  return null;
5473
5506
  }
5474
5507
  const [owner, repo, pull, numberText] = parsed.pathname.split("/").filter(Boolean);
@@ -5476,7 +5509,7 @@ function parseGitHubPullRequestToken(token) {
5476
5509
  return null;
5477
5510
  }
5478
5511
  return {
5479
- url: `https://github.com/${owner}/${repo}/pull/${numberText}`,
5512
+ url: `${webUrl}/${owner}/${repo}/pull/${numberText}`,
5480
5513
  owner,
5481
5514
  repo,
5482
5515
  number: Number(numberText)
@@ -5501,6 +5534,7 @@ function extractGitHubPullRequestUrls(text) {
5501
5534
  }
5502
5535
  var CANDIDATE_TOKEN_RE, TRAILING_PROSE_PUNCTUATION_RE, GITHUB_PATH_SEGMENT_RE;
5503
5536
  var init_github_pull_request = __esm(() => {
5537
+ init_github_host();
5504
5538
  CANDIDATE_TOKEN_RE = /[^\s()[\]{}<>"'`]+/g;
5505
5539
  TRAILING_PROSE_PUNCTUATION_RE = /[)\]},.;:!]+$/;
5506
5540
  GITHUB_PATH_SEGMENT_RE = /^[\w.-]+$/;
@@ -5701,6 +5735,12 @@ async function createAgent2(agent) {
5701
5735
  } catch (err) {
5702
5736
  console.warn("[db] Failed to install system-default skills for new agent:", err.message);
5703
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
+ }
5704
5744
  try {
5705
5745
  await dependencies.createLogEntry({
5706
5746
  eventType: "agent_joined",
@@ -5708,7 +5748,7 @@ async function createAgent2(agent) {
5708
5748
  newValue: agent.status
5709
5749
  });
5710
5750
  } catch {}
5711
- return rowToAgent(row);
5751
+ return importChanged ? await getAgentById2(id) ?? rowToAgent(row) : rowToAgent(row);
5712
5752
  }
5713
5753
  async function getAgentById2(id) {
5714
5754
  const row = await getDbClient2().get("SELECT * FROM agents WHERE id = ?", [id]);
@@ -5916,7 +5956,7 @@ async function getAgentDailyTaskCounts2(agentId, days) {
5916
5956
  }
5917
5957
  var dependencies, EXTENSION_AGENT_ROLE2 = "extension", NOT_EXTENSION_AGENT_SQL2, ReservedAgentRoleError2, ExtensionAgentAssignmentError2, MAX_EMPTY_POLLS2 = 2;
5918
5958
  var init_agents = __esm(() => {
5919
- init_types4();
5959
+ init_types5();
5920
5960
  init_env_flag();
5921
5961
  init_runtime2();
5922
5962
  NOT_EXTENSION_AGENT_SQL2 = `COALESCE(role, '') != '${EXTENSION_AGENT_ROLE2}'`;
@@ -6019,6 +6059,12 @@ async function listUndeliveredCancelledApprovalRequestIds(runIds) {
6019
6059
  }
6020
6060
  return ids;
6021
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
+ }
6022
6068
  var init_approvals = __esm(() => {
6023
6069
  init_secret_scrubber();
6024
6070
  init_date_utils();
@@ -6337,6 +6383,8 @@ var init_legacy_policy = __esm(() => {
6337
6383
  "session.read.all": operatorOrUser,
6338
6384
  "task.progress.write": taskProgressWrite,
6339
6385
  "favorite.write.own": anyAuthenticated,
6386
+ "checklist.write.own": anyAuthenticated,
6387
+ "checklist.write.agent": leadOnly,
6340
6388
  "memory.learning.inject": leadOnly,
6341
6389
  "memory.edit.any": leadOrResourceOwner,
6342
6390
  "memory.write.consolidated": leadOnly,
@@ -6533,6 +6581,14 @@ var init_permissions = __esm(() => {
6533
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.",
6534
6582
  namespace: "task"
6535
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
+ },
6536
6592
  "favorite.write.own": {
6537
6593
  description: "Set a favorite the caller owns.",
6538
6594
  namespace: "favorite"
@@ -6726,7 +6782,7 @@ var init_permissions = __esm(() => {
6726
6782
  namespace: "mcp-oauth"
6727
6783
  },
6728
6784
  "kv.write.any": {
6729
- 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:*).",
6730
6786
  namespace: "kv"
6731
6787
  },
6732
6788
  "comb.presence": {
@@ -7836,7 +7892,7 @@ function validateTierConfigValue(key, value) {
7836
7892
  var TIER_CONFIG_KEY_RE;
7837
7893
  var init_model_tier_keys = __esm(() => {
7838
7894
  init_src2();
7839
- init_types4();
7895
+ init_types5();
7840
7896
  init_runtime_model_catalog();
7841
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("|")})$`);
7842
7898
  });
@@ -8236,7 +8292,7 @@ var DEFAULT_MODEL_LATEST_SOAK_DAYS = 2, OverridesSchema, CATALOG_TTL_MS = 30000,
8236
8292
  var init_model_tier_resolution = __esm(() => {
8237
8293
  init_src2();
8238
8294
  init_zod();
8239
- init_types4();
8295
+ init_types5();
8240
8296
  init_db4();
8241
8297
  init_model_profiles();
8242
8298
  init_harness_model_support();
@@ -8398,8 +8454,13 @@ function runtimeReadsRepoSecrets(agent) {
8398
8454
  async function vcsRepoId(vcsRepo) {
8399
8455
  if (!vcsRepo?.trim())
8400
8456
  return null;
8401
- const repos = await getDbClient2().query("SELECT id, url FROM swarm_repos WHERE name = ? ORDER BY name ASC", [vcsRepoName(vcsRepo)]);
8402
- return repos.find((r) => vcsRepoUrlMatches(r.url, vcsRepo))?.id ?? null;
8457
+ const client = getDbClient2();
8458
+ const named = await client.query("SELECT id, url FROM swarm_repos WHERE name = ? ORDER BY name ASC", [vcsRepoName(vcsRepo)]);
8459
+ const match = named.find((r) => vcsRepoUrlMatches(r.url, vcsRepo));
8460
+ if (match)
8461
+ return match.id;
8462
+ const all = await client.query("SELECT id, url FROM swarm_repos ORDER BY name ASC");
8463
+ return all.find((r) => vcsRepoUrlMatches(r.url, vcsRepo))?.id ?? null;
8403
8464
  }
8404
8465
  async function configPools(agentId, { vcsRepo, includeRepoSecrets = true }) {
8405
8466
  const pools = new Map;
@@ -8798,6 +8859,16 @@ function parseFallbackHops(value) {
8798
8859
  return;
8799
8860
  }
8800
8861
  }
8862
+ function parseSlackParticipants(value) {
8863
+ if (!value)
8864
+ return;
8865
+ try {
8866
+ const parsed = TaskSlackParticipantsSchema.safeParse(JSON.parse(value));
8867
+ return parsed.success ? parsed.data : undefined;
8868
+ } catch {
8869
+ return;
8870
+ }
8871
+ }
8801
8872
  function rowToAgentTask(row) {
8802
8873
  let followUpConfig;
8803
8874
  if (row.followUpConfig) {
@@ -8854,6 +8925,7 @@ function rowToAgentTask(row) {
8854
8925
  slackThreadTs: row.slackThreadTs ?? undefined,
8855
8926
  slackTriggerMessageTs: row.slackTriggerMessageTs ?? undefined,
8856
8927
  slackUserId: row.slackUserId ?? undefined,
8928
+ slackParticipants: parseSlackParticipants(row.slackParticipants),
8857
8929
  slackReplySent: !!row.slackReplySent,
8858
8930
  slackProgressMessageTs: row.slackProgressMessageTs ?? undefined,
8859
8931
  slackTreeRootMessageTs: row.slackTreeRootMessageTs ?? undefined,
@@ -9797,6 +9869,14 @@ async function getLatestLeadTaskByContextKey2(contextKey, source) {
9797
9869
  LIMIT 1`, [contextKey, source ?? null, source ?? null, source ?? null]);
9798
9870
  return row ? rowToAgentTask(row) : null;
9799
9871
  }
9872
+ async function getFirstTaskInThread2(channelId, threadTs) {
9873
+ const row = await getDbClient2().get(`SELECT * FROM agent_tasks
9874
+ WHERE slackChannelId = ?
9875
+ AND slackThreadTs = ?
9876
+ ORDER BY createdAt ASC
9877
+ LIMIT 1`, [channelId, threadTs]);
9878
+ return row ? rowToAgentTask(row) : null;
9879
+ }
9800
9880
  async function getMostRecentTaskInThread2(channelId, threadTs) {
9801
9881
  const row = await getDbClient2().get(`SELECT * FROM agent_tasks
9802
9882
  WHERE slackChannelId = ?
@@ -9876,7 +9956,7 @@ var dependencies2, TASK_PREVIEW_LENGTH = 300, TASK_PREVIEW_BYTES, SIBLING_OPEN =
9876
9956
  ELSE 3000 * (1 << obligation.attempt_count) END)`, SLACK_MISSING_TREE_WINDOW_MS, LINEAR_TRACKER_CONTEXT_KEY_PREFIX = "task:trackers:linear:";
9877
9957
  var init_read = __esm(() => {
9878
9958
  init_key();
9879
- init_types4();
9959
+ init_types5();
9880
9960
  init_output_schema();
9881
9961
  init_provider_metadata();
9882
9962
  init_secret_scrubber();
@@ -10199,7 +10279,7 @@ var MODEL_PROFILE_CONFIG_KEY = "MODEL_PROFILE", unreadableAllowlists, TASK_HOLDS
10199
10279
  SELECT 1 FROM model_profiles o, json_each(CASE WHEN json_valid(o.fallbacks) THEN o.fallbacks ELSE '[]' END) j
10200
10280
  WHERE j.value = model_profiles.name AND o.name <> model_profiles.name)`, MAX_MODEL_PROFILE_FALLBACKS = 10;
10201
10281
  var init_model_profiles = __esm(() => {
10202
- init_types4();
10282
+ init_types5();
10203
10283
  init_model_profile_check();
10204
10284
  init_runtime2();
10205
10285
  init_read();
@@ -10230,7 +10310,7 @@ function parsePageThemeTokens(raw) {
10230
10310
  }
10231
10311
  }
10232
10312
  var init_page_theme_tokens = __esm(() => {
10233
- init_types4();
10313
+ init_types5();
10234
10314
  });
10235
10315
 
10236
10316
  // src/be/db/session-visibility.ts
@@ -10347,6 +10427,16 @@ async function moveSessionChains(input) {
10347
10427
  }
10348
10428
  return moved;
10349
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
+ }
10350
10440
  async function listPrefixRoots(input) {
10351
10441
  const { lo, hi } = keyPrefixRange(input.from);
10352
10442
  return getDbClient2().query(`SELECT r.id, r."key" FROM agent_tasks r
@@ -10496,6 +10586,9 @@ function effectiveSourceSql() {
10496
10586
  params: ranges.flatMap(({ source, lo, hi }) => [lo, hi, source])
10497
10587
  };
10498
10588
  }
10589
+ function showsScheduleRuns(groupKey) {
10590
+ return isGroupKey(groupKey) && !sourceOfKey(groupKey) && !isResourceGroupPrefix(groupKey);
10591
+ }
10499
10592
  function sessionRootFilter(opts = {}) {
10500
10593
  const conditions = [];
10501
10594
  const params = [];
@@ -10503,6 +10596,11 @@ function sessionRootFilter(opts = {}) {
10503
10596
  conditions.push(fragment.sql);
10504
10597
  params.push(...fragment.params);
10505
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
+ });
10506
10604
  if (opts.rootId)
10507
10605
  add({ sql: "r.id = ?", params: [opts.rootId] });
10508
10606
  const sources = opts.source?.filter(Boolean) ?? [];
@@ -10519,10 +10617,10 @@ function sessionRootFilter(opts = {}) {
10519
10617
  if (opts.showSource) {
10520
10618
  const shown = opts.showSource.filter(Boolean);
10521
10619
  const source = effectiveSourceSql();
10522
- add(shown.length ? {
10620
+ add(includeScheduled(shown.length ? {
10523
10621
  sql: `${source.sql} IN (${shown.map(() => "?").join(",")})`,
10524
10622
  params: [...source.params, ...shown]
10525
- } : { sql: "0", params: [] });
10623
+ } : { sql: "0", params: [] }));
10526
10624
  }
10527
10625
  if (opts.q?.trim()) {
10528
10626
  const like = `%${opts.q.trim().toLowerCase()}%`;
@@ -10542,14 +10640,21 @@ function sessionRootFilter(opts = {}) {
10542
10640
  if (opts.viewer) {
10543
10641
  add(sessionViewerCondition(opts.viewer));
10544
10642
  if (opts.tree)
10545
- conditions.push("+r.requestedByUserId IS NOT NULL");
10643
+ add(includeScheduled({ sql: "+r.requestedByUserId IS NOT NULL", params: [] }));
10546
10644
  if (opts.mine)
10547
- add(sessionMineCondition(opts.viewer.userId, opts.viewer.readAll));
10645
+ add(includeScheduled(sessionMineCondition(opts.viewer.userId, opts.viewer.readAll)));
10548
10646
  }
10549
10647
  if (opts.keyPrefix) {
10550
10648
  const { lo, hi } = keyPrefixRange(opts.keyPrefix);
10551
10649
  add({ sql: 'r."key" >= ? AND r."key" < ?', params: [lo, hi] });
10552
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
+ }
10553
10658
  if (opts.groupKey)
10554
10659
  add(groupCondition(normalizeAssetKey(opts.groupKey)));
10555
10660
  if (opts.noGroup)
@@ -10568,7 +10673,7 @@ function sessionRootFilter(opts = {}) {
10568
10673
  return { sql: conditions.length ? conditions.join(" AND ") : "1", params };
10569
10674
  }
10570
10675
  function excludesTriaged(opts) {
10571
- return !!(opts.viewer?.userId && (opts.groupKey || opts.keyPrefix || opts.noGroup));
10676
+ return !!(opts.viewer?.userId && (opts.groupKey || opts.keyPrefix || opts.keyPrefixes?.length || opts.noGroup));
10572
10677
  }
10573
10678
  function hasSessionChainFilter(opts) {
10574
10679
  return !!(opts.triage || opts.status || opts.withUserId || excludesTriaged(opts));
@@ -10698,16 +10803,23 @@ function threadPromptPreview(prompt) {
10698
10803
  return text.length > THREAD_LABEL_LENGTH ? `${text.slice(0, THREAD_LABEL_LENGTH)}…` : text;
10699
10804
  }
10700
10805
  async function getSessionTree(actor, now, opts = {}) {
10701
- const query = sessionSummaryQuery({
10806
+ const filterOpts = {
10702
10807
  ...actor.kind === "user" ? { viewer: { userId: actor.userId, scope: "all", readAll: actor.readAll } } : {},
10703
10808
  now,
10704
10809
  tree: true,
10705
10810
  mine: opts.mine
10706
- });
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: [] };
10707
10819
  const [rows, threadRoots] = await Promise.all([
10708
10820
  getDbClient2().query(`SELECT a.root_id, a."key", a.source, a.slackChannelId, a.lastActivityAt, a.latestStatus,
10709
- a.readState, a.needsYou
10710
- 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]),
10711
10823
  threadRootCounts()
10712
10824
  ]);
10713
10825
  const counts = () => ({ total: 0, unread: 0, running: 0, needsYou: 0 });
@@ -10742,9 +10854,12 @@ async function getSessionTree(actor, now, opts = {}) {
10742
10854
  };
10743
10855
  for (const row of rows) {
10744
10856
  const source = effectiveSource(row.key, row.source);
10745
- sources.set(source, (sources.get(source) ?? 0) + 1);
10746
10857
  const rowThreadRoots = threadRoots.get(row.key) ?? 0;
10747
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);
10748
10863
  const sourceGroupKey = sessionGroupKey(row.key);
10749
10864
  const channelId = /^shared\/slack\/([^/]+)\/$/.exec(sourceGroupKey)?.[1];
10750
10865
  if (channelId && row.slackChannelId?.toLowerCase() === channelId) {
@@ -10759,8 +10874,9 @@ async function getSessionTree(actor, now, opts = {}) {
10759
10874
  const resource = sessionResourceGroupOf(key);
10760
10875
  if (resource)
10761
10876
  resourceGroups.add(key).add(resource.resourceKey);
10762
- if (hidden.has(source) || shown && !shown.has(source))
10877
+ if (hidden.has(source) || shown && !shown.has(source) && !groupedSchedule)
10763
10878
  continue;
10879
+ const sectionVisible = !!row.defaultVisible && (!shown || shown.has(source));
10764
10880
  const noGroup = key === "shared/" || actor.kind === "user" && key === `personal/${actor.userId}/`;
10765
10881
  let group;
10766
10882
  if (!noGroup) {
@@ -10772,11 +10888,13 @@ async function getSessionTree(actor, now, opts = {}) {
10772
10888
  if (row.lastActivityAt > group.lastActivityAt)
10773
10889
  group.lastActivityAt = row.lastActivityAt;
10774
10890
  }
10775
- if (row.readState === "later" || row.readState === "done")
10776
- add(result[row.readState], row);
10777
- else {
10891
+ if (row.readState === "later" || row.readState === "done") {
10892
+ if (sectionVisible)
10893
+ add(result[row.readState], row);
10894
+ } else {
10778
10895
  const viewer = actor.kind === "user" ? actor.userId : null;
10779
- if (noGroup || sourceOfKey(key) || inResourceScope(row.key, viewer))
10896
+ const inInbox = noGroup || sourceOfKey(key) || inResourceScope(row.key, viewer);
10897
+ if (sectionVisible && inInbox)
10780
10898
  add(result.inbox, row);
10781
10899
  if (noGroup)
10782
10900
  add(result.noGroup, row);
@@ -10836,7 +10954,7 @@ var AUTO_DONE_QUIET_MS, LEGACY_READ_STATE_COLUMNS, SESSION_ROOTS = "(SELECT root
10836
10954
  var init_session_tree = __esm(() => {
10837
10955
  init_key();
10838
10956
  init_source_key();
10839
- init_types4();
10957
+ init_types5();
10840
10958
  init_db4();
10841
10959
  init_session_visibility();
10842
10960
  AUTO_DONE_QUIET_MS = 24 * 3600000;
@@ -11012,6 +11130,14 @@ var init_slack_trees = __esm(() => {
11012
11130
  init_db4();
11013
11131
  });
11014
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
+
11015
11141
  // src/be/db/tasks/human-free.ts
11016
11142
  function humanFreeCase(parentFlag) {
11017
11143
  return `CASE
@@ -11279,7 +11405,7 @@ async function dropSessionDescendants(taskId) {
11279
11405
  }
11280
11406
  var OPEN_TASK_SQL;
11281
11407
  var init_session_summaries = __esm(() => {
11282
- init_types4();
11408
+ init_types5();
11283
11409
  init_runtime2();
11284
11410
  OPEN_TASK_SQL = `t.status NOT IN (${TERMINAL_TASK_STATUSES.map((s) => `'${s}'`).join(", ")})`;
11285
11411
  });
@@ -11487,6 +11613,24 @@ async function updateTaskTitle2(taskId, title) {
11487
11613
  const row = await getDbClient2().get("UPDATE agent_tasks SET title = ? WHERE id = ? RETURNING *", [normalized, taskId]);
11488
11614
  return row ? rowToAgentTask(row) : null;
11489
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
+ }
11490
11634
  async function setTaskTitleIfUnset2(taskId, title) {
11491
11635
  const normalized = title.trim();
11492
11636
  if (!normalized)
@@ -11552,7 +11696,7 @@ async function completeTask2(id, output, options) {
11552
11696
  });
11553
11697
  } catch {}
11554
11698
  getDbClient2().afterCommit(() => {
11555
- import("./event-bus-e66gh7cc.js").then(({ workflowEventBus }) => {
11699
+ import("./event-bus-xr83x566.js").then(({ workflowEventBus }) => {
11556
11700
  workflowEventBus.emit("task.completed", {
11557
11701
  taskId: id,
11558
11702
  output: scrubbedOutput,
@@ -11607,7 +11751,7 @@ async function failTask2(id, reason, opts = {}) {
11607
11751
  });
11608
11752
  } catch {}
11609
11753
  getDbClient2().afterCommit(() => {
11610
- import("./event-bus-e66gh7cc.js").then(({ workflowEventBus }) => {
11754
+ import("./event-bus-xr83x566.js").then(({ workflowEventBus }) => {
11611
11755
  workflowEventBus.emit("task.failed", {
11612
11756
  taskId: id,
11613
11757
  failureReason: scrubbedReason,
@@ -11689,7 +11833,7 @@ async function cancelTask2(id, reason, options = {}) {
11689
11833
  });
11690
11834
  } catch {}
11691
11835
  getDbClient2().afterCommit(() => {
11692
- import("./event-bus-e66gh7cc.js").then(({ workflowEventBus }) => {
11836
+ import("./event-bus-xr83x566.js").then(({ workflowEventBus }) => {
11693
11837
  workflowEventBus.emit("task.cancelled", {
11694
11838
  taskId: id,
11695
11839
  agentId: row.agentId,
@@ -11701,7 +11845,7 @@ async function cancelTask2(id, reason, options = {}) {
11701
11845
  if (row.source === "schedule" && row.taskType === "deferred" && row.parentTaskId) {
11702
11846
  getDbClient2().afterCommit(async () => {
11703
11847
  try {
11704
- const { createWorkerTaskFollowUp } = await import("./worker-follow-up-911xc0b8.js");
11848
+ const { createWorkerTaskFollowUp } = await import("./worker-follow-up-grrr3fda.js");
11705
11849
  await createWorkerTaskFollowUp({
11706
11850
  task: rowToAgentTask(row),
11707
11851
  status: "failed",
@@ -11750,7 +11894,7 @@ async function skipTask2(id, reason) {
11750
11894
  });
11751
11895
  } catch {}
11752
11896
  getDbClient2().afterCommit(() => {
11753
- import("./event-bus-e66gh7cc.js").then(({ workflowEventBus }) => {
11897
+ import("./event-bus-xr83x566.js").then(({ workflowEventBus }) => {
11754
11898
  workflowEventBus.emit("task.skipped", {
11755
11899
  taskId: id,
11756
11900
  failureReason: skipReason,
@@ -11802,7 +11946,7 @@ async function supersedeTask2(id, args) {
11802
11946
  });
11803
11947
  } catch {}
11804
11948
  getDbClient2().afterCommit(() => {
11805
- import("./event-bus-e66gh7cc.js").then(({ workflowEventBus }) => {
11949
+ import("./event-bus-xr83x566.js").then(({ workflowEventBus }) => {
11806
11950
  workflowEventBus.emit("task.superseded", {
11807
11951
  taskId: id,
11808
11952
  reason: args.reason,
@@ -12017,7 +12161,7 @@ async function updateTaskProgress2(id, progress) {
12017
12161
  });
12018
12162
  } catch {}
12019
12163
  getDbClient2().afterCommit(() => {
12020
- import("./event-bus-e66gh7cc.js").then(({ workflowEventBus }) => {
12164
+ import("./event-bus-xr83x566.js").then(({ workflowEventBus }) => {
12021
12165
  workflowEventBus.emit("task.progress", {
12022
12166
  taskId: id,
12023
12167
  progress: scrubbedProgress,
@@ -12033,7 +12177,7 @@ var init_write = __esm(() => {
12033
12177
  init_package();
12034
12178
  init_key();
12035
12179
  init_source_key();
12036
- init_types4();
12180
+ init_types5();
12037
12181
  init_secret_scrubber();
12038
12182
  init_task_lifecycle_events();
12039
12183
  init_worker_nudges();
@@ -12545,7 +12689,7 @@ function emitRunFinished(runId, workflowId, status) {
12545
12689
  }
12546
12690
  function emitBusEventAfterCommit(event, payload) {
12547
12691
  getDbClient2().afterCommit(() => {
12548
- import("./event-bus-e66gh7cc.js").then(({ workflowEventBus }) => {
12692
+ import("./event-bus-xr83x566.js").then(({ workflowEventBus }) => {
12549
12693
  workflowEventBus.emit(event, payload);
12550
12694
  }).catch((err) => console.error(`[db] ${event} event not emitted:`, scrubSecrets(err instanceof Error ? err.message : String(err))));
12551
12695
  });
@@ -12607,7 +12751,7 @@ async function createForeachAttemptSteps(runId, rows) {
12607
12751
  }
12608
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";
12609
12753
  var init_workflow_runs = __esm(() => {
12610
- init_types4();
12754
+ init_types5();
12611
12755
  init_secret_scrubber();
12612
12756
  init_date_utils();
12613
12757
  init_scrub_json();
@@ -13145,13 +13289,13 @@ function validateConfigEntry(entry) {
13145
13289
  function validateExportToEnv(key, exportToEnv) {
13146
13290
  return exportToEnv === true && isEnvExportRestrictedKey(key) ? envExportRestrictedError(key) : null;
13147
13291
  }
13148
- 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;
13149
13293
  var init_swarm_config_guard = __esm(() => {
13150
13294
  init_schema();
13151
13295
  init_telemetry_ranking();
13152
13296
  init_quickjs_pool_config();
13153
13297
  init_reaction_shortcode();
13154
- init_types4();
13298
+ init_types5();
13155
13299
  init_api_drain2();
13156
13300
  init_company_profile();
13157
13301
  init_config_env_export();
@@ -13178,7 +13322,9 @@ var init_swarm_config_guard = __esm(() => {
13178
13322
  "CHAT_SDK_API_URL_OVERRIDES",
13179
13323
  "CODEX_OAUTH_DEVICE_BASE_URL",
13180
13324
  "DESPLEGA_TELEMETRY_ENDPOINT",
13181
- "CLOUDFLARE_API_BASE_URL"
13325
+ "CLOUDFLARE_API_BASE_URL",
13326
+ "GITHUB_URL",
13327
+ "GITHUB_API_URL"
13182
13328
  ]);
13183
13329
  API_ONLY_CONFIG_KEYS = new Set([
13184
13330
  "API_AGENT_FS_API_KEY",
@@ -13205,6 +13351,7 @@ var init_swarm_config_guard = __esm(() => {
13205
13351
  "openai",
13206
13352
  "cloudflare"
13207
13353
  ];
13354
+ SYSTEM_ONE_EXTRACT_DEFAULT_PROVIDER_OPTIONS = ["cloudflare"];
13208
13355
  validateControllerTokenTtlDays = boundedIntegerValidators(["RUNTIME_CONTROLLER_TOKEN_TTL_DAYS"], 1, 3650).RUNTIME_CONTROLLER_TOKEN_TTL_DAYS;
13209
13356
  validateControllerGraceSec = boundedIntegerValidators(["RUNTIME_CONTROLLER_GRACE_SEC"], 0, 86400).RUNTIME_CONTROLLER_GRACE_SEC;
13210
13357
  VALIDATED_KEYS = {
@@ -13260,6 +13407,7 @@ var init_swarm_config_guard = __esm(() => {
13260
13407
  return "Invalid SWARM_ENABLED_TOOLS (expected comma-separated tool names or a JSON array of strings)";
13261
13408
  }
13262
13409
  },
13410
+ COMPANY_EMAIL_DOMAINS: (value) => typeof value === "string" && value.split(",").map((domain) => domain.trim()).every((domain) => domain === "" || /^[a-z0-9-]+(\.[a-z0-9-]+)+$/i.test(domain)) ? null : "Invalid COMPANY_EMAIL_DOMAINS (expected comma-separated domains, e.g. example.com,example.dev)",
13263
13411
  FEEDBACK_ENDPOINT: (value) => {
13264
13412
  if (typeof value !== "string") {
13265
13413
  return "Invalid FEEDBACK_ENDPOINT (must use HTTPS, or HTTP on a loopback host)";
@@ -13277,6 +13425,15 @@ var init_swarm_config_guard = __esm(() => {
13277
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)"),
13278
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)"),
13279
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
+ },
13280
13437
  HARNESS_PROVIDER: (value) => {
13281
13438
  const parsed = ProviderNameSchema.safeParse(value);
13282
13439
  if (parsed.success)
@@ -13285,6 +13442,7 @@ var init_swarm_config_guard = __esm(() => {
13285
13442
  },
13286
13443
  ...enumValidator("CLAUDE_TRANSPORT", ["cli", "sdk"]),
13287
13444
  ...enumValidator("SCRIPT_EXECUTOR", ["native", "quickjs"]),
13445
+ ...enumValidator("BOOT_SCRUB_MODE", ["backfill", "forward-only"]),
13288
13446
  ...enumValidator("TRANSCRIPTION_PROVIDER", ["openai", "elevenlabs", "groq"]),
13289
13447
  SCRIPT_QUICKJS_POOL_SIZE: validateQuickJSPoolSize,
13290
13448
  ...booleanValidators(["SCRIPT_EGRESS_ALLOW_PRIVATE"]),
@@ -13299,6 +13457,9 @@ var init_swarm_config_guard = __esm(() => {
13299
13457
  return parseFollowUpGateScheduleIds(value).every(isFollowUpGateScheduleId) ? null : message;
13300
13458
  },
13301
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
+ ]),
13302
13463
  CODEX_CREDITS_EXHAUSTED_COOLDOWN_MS: (value) => {
13303
13464
  const str = String(value).trim();
13304
13465
  if (!/^\d+$/.test(str) || Number(str) <= 0) {
@@ -13370,6 +13531,10 @@ var init_swarm_config_guard = __esm(() => {
13370
13531
  "SLACK_LEAVE_THREAD_DISABLE",
13371
13532
  "RBAC_ENABLED",
13372
13533
  "SEED_AUTOMATIONS_ENABLED",
13534
+ "SEED_SCRIPTS_ENABLED",
13535
+ "SEED_SKILLS_ENABLED",
13536
+ "SEED_WORKFLOWS_ENABLED",
13537
+ "SEED_SCHEDULES_ENABLED",
13373
13538
  "RBAC_AUDIT_DISABLED",
13374
13539
  "EXTENSION_ALLOW_INLINE_INSTALL",
13375
13540
  "BUDGET_ADMISSION_DISABLED",
@@ -13380,6 +13545,7 @@ var init_swarm_config_guard = __esm(() => {
13380
13545
  "IMPROVEMENTS_ENABLED",
13381
13546
  "SWARM_HIDE_CLOUD_PROMO",
13382
13547
  "DB_QUERY_BOUNDED_ENABLED",
13548
+ "DB_QUERY_WORKER_POOL_ENABLED",
13383
13549
  "CLAUDE_TRUST_PRESEED",
13384
13550
  "DB_RETENTION_DRY_RUN",
13385
13551
  "MODEL_AUTO_UPGRADE",
@@ -13856,6 +14022,10 @@ async function markAuthorizationRefreshFailed(id, message) {
13856
14022
  WHERE id = ? AND status != 'revoked'`, [message, id]);
13857
14023
  return result.changes === 1 ? await getAuthorizationById(id) : null;
13858
14024
  }
14025
+ async function hasOAuthTokens(provider) {
14026
+ const row = await rawDefaultAuthorizationForProvider(provider);
14027
+ return row !== null && row.status !== "revoked";
14028
+ }
13859
14029
  async function getOAuthTokens(provider) {
13860
14030
  const row = await rawDefaultAuthorizationForProvider(provider);
13861
14031
  if (!row)
@@ -22080,7 +22250,7 @@ function noteEmbeddingSuccess() {
22080
22250
  const report = (what) => (err) => {
22081
22251
  console.error(`[memory] ${what} backfill after embeddings recovered failed:`, err.message);
22082
22252
  };
22083
- backfill2 = import("./embedding-space-4p05vb2x.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(() => {
22084
22254
  backfill2 = null;
22085
22255
  });
22086
22256
  }
@@ -24273,7 +24443,7 @@ async function loadSecretRegistry() {
24273
24443
  result.failed += 1;
24274
24444
  }
24275
24445
  try {
24276
- const { loadRuntimeControllerSecrets } = await import("./db-2dvay0es.js");
24446
+ const { loadRuntimeControllerSecrets } = await import("./db-wnh0qjy1.js");
24277
24447
  const loaded = await loadRuntimeControllerSecrets();
24278
24448
  result.runtimeController = loaded.count;
24279
24449
  result.failed += loaded.failed;
@@ -24293,18 +24463,20 @@ var init_secret_registry = __esm(() => {
24293
24463
  function isSteeringEnabled() {
24294
24464
  return isSteeringEnabled2();
24295
24465
  }
24466
+ function resolveSteerProvider(task, agent) {
24467
+ return agent?.harnessProvider ?? agent?.provider ?? task.provider ?? "claude";
24468
+ }
24296
24469
  async function providerForTask(task) {
24297
24470
  const agent = task.agentId ? await getAgentById2(task.agentId) : null;
24298
- return agent?.harnessProvider ?? agent?.provider ?? task.provider ?? "claude";
24471
+ return resolveSteerProvider(task, agent);
24299
24472
  }
24300
24473
  function supportedModesForTask(task, provider) {
24301
24474
  return provider === "claude" && task.providerMeta?.transport === "sdk" ? ["steer", "queue"] : PROVIDER_STEER_CAPABILITIES[provider];
24302
24475
  }
24303
24476
  function steeringFieldsFor(task, agent) {
24304
- const provider = agent?.harnessProvider ?? agent?.provider ?? task.provider;
24305
24477
  return {
24306
24478
  isLeadTask: agent?.isLead ?? false,
24307
- supportedSteerModes: provider ? supportedModesForTask(task, provider) : []
24479
+ supportedSteerModes: supportedModesForTask(task, resolveSteerProvider(task, agent))
24308
24480
  };
24309
24481
  }
24310
24482
  async function getTaskSteeringFields(task) {
@@ -24330,13 +24502,20 @@ async function getTaskSteeringFieldsForTasks(tasks) {
24330
24502
  steeringFieldsFor(task, task.agentId ? agents.get(task.agentId) ?? null : null)
24331
24503
  ]));
24332
24504
  }
24505
+ function promotedTaskSource(source) {
24506
+ if (source === "script")
24507
+ return "api";
24508
+ if (source === "app-page")
24509
+ return "ui";
24510
+ return source;
24511
+ }
24333
24512
  async function promoteSteeringToTask(task, message) {
24334
24513
  return await createTaskExtended2(message.body, {
24335
24514
  agentId: task.agentId,
24336
24515
  routingReason: task.agentId ? "continuity" : undefined,
24337
24516
  routingSource: task.agentId ? "engine_default" : undefined,
24338
24517
  creatorAgentId: message.createdByAgentId,
24339
- source: message.source === "script" ? "api" : message.source,
24518
+ source: promotedTaskSource(message.source),
24340
24519
  taskType: "follow-up",
24341
24520
  parentTaskId: task.id,
24342
24521
  requestedByUserId: message.createdByUserId,
@@ -24425,7 +24604,7 @@ async function requestSteering(args) {
24425
24604
  }
24426
24605
  const requestedMode = args.mode ?? "queue";
24427
24606
  const onUnsupported = args.onUnsupported ?? "degrade";
24428
- const { dispatchPre, extensionIdForAgent } = await import("./dispatcher-gndbta01.js");
24607
+ const { dispatchPre, extensionIdForAgent } = await import("./dispatcher-jrm24r43.js");
24429
24608
  const preSteer = await dispatchPre("pre.task.steer", {
24430
24609
  task,
24431
24610
  message: args.message,
@@ -24493,7 +24672,7 @@ async function requestSteering(args) {
24493
24672
  var STEERING_MOVED_ERROR = "Steering message moved to another task", SteeringRequestError, SteeringBlockedError, steeringModifySchema, AGENT_ID_CHUNK = 500;
24494
24673
  var init_steering2 = __esm(() => {
24495
24674
  init_zod();
24496
- init_types4();
24675
+ init_types5();
24497
24676
  init_secret_scrubber();
24498
24677
  init_steering_enabled();
24499
24678
  init_db4();
@@ -24835,6 +25014,7 @@ __export(exports_db, {
24835
25014
  getDueWaitStates: () => getDueWaitStates2,
24836
25015
  getExpiredPendingApprovals: () => getExpiredPendingApprovals2,
24837
25016
  getFavoriteItemIdSet: () => getFavoriteItemIdSet2,
25017
+ getFirstTaskInThread: () => getFirstTaskInThread2,
24838
25018
  getIdleWorkersWithCapacity: () => getIdleWorkersWithCapacity2,
24839
25019
  getInProgressSlackTasks: () => getInProgressSlackTasks2,
24840
25020
  getInProgressTasksByContextKey: () => getInProgressTasksByContextKey2,
@@ -25150,6 +25330,7 @@ __export(exports_db, {
25150
25330
  updateSwarmRepo: () => updateSwarmRepo2,
25151
25331
  updateTaskClaudeSessionId: () => updateTaskClaudeSessionId2,
25152
25332
  updateTaskProgress: () => updateTaskProgress2,
25333
+ updateTaskTags: () => updateTaskTags2,
25153
25334
  updateTaskTitle: () => updateTaskTitle2,
25154
25335
  updateTaskVcs: () => updateTaskVcs2,
25155
25336
  updateUser: () => updateUser2,
@@ -26340,6 +26521,9 @@ async function createTaskExtended2(task, options) {
26340
26521
  if (parent.slackUserId && !options.slackUserId && !explicitForeignChannel) {
26341
26522
  options.slackUserId = parent.slackUserId;
26342
26523
  }
26524
+ if (parent.slackParticipants && !options.slackParticipants && !explicitForeignChannel) {
26525
+ options.slackParticipants = parent.slackParticipants;
26526
+ }
26343
26527
  if (parent.agentmailInboxId && !options.agentmailInboxId) {
26344
26528
  options.agentmailInboxId = parent.agentmailInboxId;
26345
26529
  }
@@ -26527,16 +26711,18 @@ async function createTaskExtended2(task, options) {
26527
26711
  parentTaskId: options?.parentTaskId,
26528
26712
  workflowRunId: options?.workflowRunId
26529
26713
  });
26714
+ const provenance = getCurrentRunProvenance();
26530
26715
  const inserted = await getDbClient2().get(`INSERT INTO agent_tasks (
26531
26716
  id, "key", agentId, creatorAgentId, task, status, source, routing_reason, routing_source, routing_note,
26532
26717
  taskType, tags, priority, dependsOn, offeredTo, offeredAt,
26533
- slackChannelId, slackThreadTs, slackTriggerMessageTs, slackUserId,
26718
+ slackChannelId, slackThreadTs, slackTriggerMessageTs, slackUserId, slackParticipants,
26534
26719
  vcsProvider, vcsRepo, vcsEventType, vcsNumber, vcsCommentId, vcsAuthor, vcsUrl,
26535
26720
  vcsInstallationId, vcsNodeId,
26536
26721
  agentmailInboxId, agentmailMessageId, agentmailThreadId,
26537
26722
  mentionMessageId, mentionChannelId, dir, parentTaskId, dispatchedByTaskId, model, modelTier, effort, profile, fallbackHops, scheduleId,
26538
- workflowRunId, workflowRunStepId, outputSchema, followUpConfig, requestedByUserId, requestedByUserIdInherited, contextKey, routingAffinity, swarmVersion, createdAt, lastUpdatedAt, created_by, updated_by, isHumanFree
26539
- ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING *`, [
26723
+ workflowRunId, workflowRunStepId, outputSchema, followUpConfig, requestedByUserId, requestedByUserIdInherited, contextKey, routingAffinity, swarmVersion, createdAt, lastUpdatedAt, created_by, updated_by, isHumanFree,
26724
+ sourceStepId, sourceScriptRunId
26725
+ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING *`, [
26540
26726
  id,
26541
26727
  insertKey,
26542
26728
  options?.agentId ?? null,
@@ -26557,6 +26743,7 @@ async function createTaskExtended2(task, options) {
26557
26743
  options?.slackThreadTs ?? null,
26558
26744
  options?.slackTriggerMessageTs ?? null,
26559
26745
  options?.slackUserId ?? null,
26746
+ options?.slackParticipants ? JSON.stringify(options.slackParticipants) : null,
26560
26747
  options?.vcsProvider ?? null,
26561
26748
  options?.vcsRepo ?? null,
26562
26749
  options?.vcsEventType ?? null,
@@ -26593,7 +26780,9 @@ async function createTaskExtended2(task, options) {
26593
26780
  now,
26594
26781
  auditUserId,
26595
26782
  auditUserId,
26596
- isHumanFree ? 1 : 0
26783
+ isHumanFree ? 1 : 0,
26784
+ options?.workflowRunId ? null : provenance?.sourceStepId ?? null,
26785
+ options?.workflowRunId ? null : provenance?.sourceScriptRunId ?? null
26597
26786
  ]);
26598
26787
  if (!inserted)
26599
26788
  throw new Error("Failed to create task");
@@ -26644,7 +26833,7 @@ async function createTaskExtended2(task, options) {
26644
26833
  priority: row.priority
26645
26834
  }, (task) => task !== null, row.requestedByUserId);
26646
26835
  getDbClient2().afterCommit(() => {
26647
- import("./event-bus-e66gh7cc.js").then(({ workflowEventBus }) => {
26836
+ import("./event-bus-xr83x566.js").then(({ workflowEventBus }) => {
26648
26837
  workflowEventBus.emit("task.created", {
26649
26838
  taskId: row.id,
26650
26839
  task: row.task,
@@ -26726,7 +26915,7 @@ async function releaseTask2(taskId, wakeSnapshot) {
26726
26915
  } catch {}
26727
26916
  if (isRuntimePoolsEnabled() && !wakeSnapshot)
26728
26917
  getDbClient2().afterCommit(() => {
26729
- import("./event-bus-e66gh7cc.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))));
26730
26919
  });
26731
26920
  }
26732
26921
  return row ? rowToAgentTask(row) : null;
@@ -26796,7 +26985,7 @@ async function rejectTask2(taskId, agentId, reason) {
26796
26985
  } catch {}
26797
26986
  if (isRuntimePoolsEnabled())
26798
26987
  getDbClient2().afterCommit(() => {
26799
- import("./event-bus-e66gh7cc.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))));
26800
26989
  });
26801
26990
  }
26802
26991
  return row ? rowToAgentTask(row) : null;
@@ -26967,8 +27156,9 @@ async function getUnassignedTaskIdsForAgent2(agentId, limit = 10, accept) {
26967
27156
  return [];
26968
27157
  const batchSize = Math.max(limit * 5, ELIGIBILITY_SCAN_BATCH_SIZE);
26969
27158
  const eligible = [];
27159
+ const scanCap = getEligibilityScanCap();
26970
27160
  let offset = 0;
26971
- while (eligible.length < limit && offset < ELIGIBILITY_SCAN_CAP) {
27161
+ while (eligible.length < limit && offset < scanCap) {
26972
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]);
26973
27163
  if (rows.length === 0)
26974
27164
  break;
@@ -27968,6 +28158,7 @@ async function getAttributionByPerson2(opts) {
27968
28158
  }
27969
28159
  }
27970
28160
  const where = `WHERE ${conditions.join(" AND ")}`;
28161
+ const githubHost = getGitHubHostForSql();
27971
28162
  const rootRows = await getDbClient2().query(`WITH RECURSIVE selected_roots(id, requestedByUserId, status) AS (
27972
28163
  SELECT t.id, t.requestedByUserId, t.status
27973
28164
  FROM agent_tasks t
@@ -28005,7 +28196,7 @@ async function getAttributionByPerson2(opts) {
28005
28196
  OR (
28006
28197
  ta.kind = 'url'
28007
28198
  AND (
28008
- ta.url LIKE '%github.com/%/pull/%'
28199
+ ta.url LIKE '%${githubHost}/%/pull/%'
28009
28200
  OR ta.url LIKE '%/-/merge_requests/%'
28010
28201
  )
28011
28202
  )
@@ -28017,7 +28208,7 @@ async function getAttributionByPerson2(opts) {
28017
28208
  -- CROSS JOIN pins the order (tree outer, task by id). Left to itself the
28018
28209
  -- planner scans every task's output and probes the tree instead.
28019
28210
  CROSS JOIN agent_tasks described ON described.id = tree.taskId
28020
- WHERE described.output LIKE '%github.com/%/pull/%'
28211
+ WHERE described.output LIKE '%${githubHost}/%/pull/%'
28021
28212
  OR described.output LIKE '%/-/merge_requests/%'
28022
28213
  )
28023
28214
  SELECT
@@ -28487,7 +28678,7 @@ async function deleteScheduledTask2(id) {
28487
28678
  const parent = await getTaskById2(deferred.parentTaskId);
28488
28679
  if (!parent?.deferredAt)
28489
28680
  return;
28490
- const { createWorkerTaskFollowUp } = await import("./worker-follow-up-911xc0b8.js");
28681
+ const { createWorkerTaskFollowUp } = await import("./worker-follow-up-grrr3fda.js");
28491
28682
  await createWorkerTaskFollowUp({
28492
28683
  task: parent,
28493
28684
  status: "failed",
@@ -29311,7 +29502,7 @@ async function getWorkflowsByScheduleId2(scheduleId) {
29311
29502
  }
29312
29503
  async function createWorkflowRun2(data) {
29313
29504
  const now = new Date().toISOString();
29314
- const row = await getDbClient2().get(`INSERT INTO workflow_runs (id, workflowId, triggerType, startedAt, triggerData, created_by, parentStepId, parentStepAttempt, triggeredByAgentId, definitionHash) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING *`, [
29505
+ const row = await getDbClient2().get(`INSERT INTO workflow_runs (id, workflowId, triggerType, startedAt, triggerData, created_by, parentStepId, parentStepAttempt, triggeredByAgentId, definitionHash, sourceStepId) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING *`, [
29315
29506
  data.id,
29316
29507
  data.workflowId,
29317
29508
  data.triggerType ?? "manual",
@@ -29321,7 +29512,8 @@ async function createWorkflowRun2(data) {
29321
29512
  data.parentStepId ?? null,
29322
29513
  data.parentStepAttempt ?? 0,
29323
29514
  data.triggeredByAgentId ?? null,
29324
- data.definitionHash ?? null
29515
+ data.definitionHash ?? null,
29516
+ data.parentStepId || data.triggerType !== "api" && (data.triggerType ?? "manual") !== "manual" ? null : getCurrentRunProvenance()?.sourceStepId ?? null
29325
29517
  ]);
29326
29518
  if (!row)
29327
29519
  throw new Error("Failed to create workflow run");
@@ -30319,7 +30511,11 @@ async function resolveApprovalRequest2(id, data, options) {
30319
30511
  now,
30320
30512
  id
30321
30513
  ]);
30322
- return row ? rowToApprovalRequest(row) : null;
30514
+ if (!row)
30515
+ return null;
30516
+ const resolved = rowToApprovalRequest(row);
30517
+ scheduleApprovalCardUpdates([resolved]);
30518
+ return resolved;
30323
30519
  }
30324
30520
  async function cancelApprovalRequestById2(id, data) {
30325
30521
  const now = new Date().toISOString();
@@ -30327,7 +30523,11 @@ async function cancelApprovalRequestById2(id, data) {
30327
30523
  SET status = 'cancelled', resolutionReason = ?, resolvedBy = ?, resolvedAt = ?, updatedAt = ?
30328
30524
  WHERE id = ? AND status = 'pending'
30329
30525
  RETURNING *`, [scrubSecrets(data.reason), data.resolvedBy, now, now, id]);
30330
- return row ? rowToApprovalRequest(row) : null;
30526
+ if (!row)
30527
+ return null;
30528
+ const cancelled = rowToApprovalRequest(row);
30529
+ scheduleApprovalCardUpdates([cancelled]);
30530
+ return cancelled;
30331
30531
  }
30332
30532
  async function cancelPendingApprovalRequestsForRun2(workflowRunId, reason) {
30333
30533
  const now = new Date().toISOString();
@@ -30335,7 +30535,9 @@ async function cancelPendingApprovalRequestsForRun2(workflowRunId, reason) {
30335
30535
  SET status = 'cancelled', resolutionReason = ?, resolvedAt = ?, updatedAt = ?
30336
30536
  WHERE workflowRunId = ? AND status = 'pending'
30337
30537
  RETURNING *`, [scrubSecrets(reason), now, now, workflowRunId]);
30338
- return rows.map(rowToApprovalRequest);
30538
+ const cancelled = rows.map(rowToApprovalRequest);
30539
+ scheduleApprovalCardUpdates(cancelled);
30540
+ return cancelled;
30339
30541
  }
30340
30542
  async function listCancelledApprovalRequestsForRun2(workflowRunId) {
30341
30543
  const rows = await getDbClient2().query(`SELECT * FROM approval_requests
@@ -30347,9 +30549,10 @@ async function listCancelledApprovalRequestsForStep2(workflowRunStepId) {
30347
30549
  WHERE workflowRunStepId = ? AND status = 'cancelled'`, [workflowRunStepId]);
30348
30550
  return rows.map(rowToApprovalRequest);
30349
30551
  }
30350
- async function claimApprovalCancellationNotification2(id, notificationKey) {
30552
+ async function claimApprovalCancellationNotification2(id, notificationKey, options) {
30553
+ const statusClause = options?.anyTerminal ? "status <> 'pending'" : "status = 'cancelled'";
30351
30554
  return getDbClient2().transaction(async () => {
30352
- 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]);
30353
30556
  if (!row)
30354
30557
  return null;
30355
30558
  const claims = row.cancellationNotificationClaims ? JSON.parse(row.cancellationNotificationClaims) : {};
@@ -30364,7 +30567,7 @@ async function claimApprovalCancellationNotification2(id, notificationKey) {
30364
30567
  claims[notificationKey] = { claimedAt: now, leaseToken };
30365
30568
  await getDbClient2().run(`UPDATE approval_requests
30366
30569
  SET cancellationNotificationClaims = ?, updatedAt = ?
30367
- WHERE id = ? AND status = 'cancelled'`, [JSON.stringify(claims), now, id]);
30570
+ WHERE id = ? AND ${statusClause}`, [JSON.stringify(claims), now, id]);
30368
30571
  return { approval: rowToApprovalRequest(row), leaseToken };
30369
30572
  });
30370
30573
  }
@@ -30388,7 +30591,7 @@ async function updateApprovalCancellationNotificationClaim(id, notificationKey,
30388
30591
  claims[notificationKey] = value;
30389
30592
  await getDbClient2().run(`UPDATE approval_requests
30390
30593
  SET cancellationNotificationClaims = ?, updatedAt = ?
30391
- 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]);
30392
30595
  });
30393
30596
  }
30394
30597
  async function updateApprovalRequestNotifications2(id, notificationChannels) {
@@ -31956,8 +32159,9 @@ async function getFavoriteItemIdSet2(opts) {
31956
32159
  return new Set(favorites.map((favorite) => favorite.itemId));
31957
32160
  }
31958
32161
  async function setFavorite2(opts) {
32162
+ const itemId = opts.itemId;
31959
32163
  if (!opts.favorite) {
31960
- 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]);
31961
32165
  return null;
31962
32166
  }
31963
32167
  const now = new Date().toISOString();
@@ -31969,7 +32173,7 @@ async function setFavorite2(opts) {
31969
32173
  ON CONFLICT(favoriteScope, itemType, itemId) DO UPDATE SET
31970
32174
  lastUpdatedAt = excluded.lastUpdatedAt,
31971
32175
  updated_by = excluded.updated_by
31972
- 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]);
31973
32177
  if (!row)
31974
32178
  throw new Error("Failed to set favorite");
31975
32179
  return rowToUserFavorite(row);
@@ -32585,10 +32789,12 @@ async function createScriptRun2(data) {
32585
32789
  async function recordInlineScriptRun2(data) {
32586
32790
  const args = scrubJsonValue(data.args ?? null);
32587
32791
  const output = data.output === undefined ? null : scrubJsonValue(data.output);
32792
+ const provenance = getCurrentRunProvenance();
32588
32793
  const row = await getDbClient2().get(`INSERT INTO script_runs
32589
32794
  (id, agentId, scriptName, source, args, kind, status, output, error,
32590
- startedAt, finishedAt, requestedByUserId, created_by, updated_by, apiEndpointId)
32591
- VALUES (?, ?, ?, ?, ?, 'inline', ?, ?, ?, ?, ?, ?, ?, ?, ?)
32795
+ startedAt, finishedAt, requestedByUserId, created_by, updated_by, apiEndpointId,
32796
+ sourceStepId, parentScriptRunId)
32797
+ VALUES (?, ?, ?, ?, ?, 'inline', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
32592
32798
  RETURNING *`, [
32593
32799
  data.id,
32594
32800
  data.agentId,
@@ -32603,7 +32809,9 @@ async function recordInlineScriptRun2(data) {
32603
32809
  data.requestedByUserId ?? null,
32604
32810
  data.createdBy ?? null,
32605
32811
  data.createdBy ?? null,
32606
- data.apiEndpointId ?? null
32812
+ data.apiEndpointId ?? null,
32813
+ provenance?.sourceStepId ?? null,
32814
+ provenance?.sourceScriptRunId ?? null
32607
32815
  ]);
32608
32816
  if (!row)
32609
32817
  throw new Error("Failed to record inline script run");
@@ -32789,7 +32997,7 @@ var VERSIONABLE_FIELDS2, BUDGETED_IDENTITY_FIELDS, PENDING_SLACK_MESSAGE_TS_PREF
32789
32997
  LEFT JOIN agents a ON m.created_by_kind = 'agent' AND a.id = m.created_by_agent_id`, ROUTING_HOLDER_SQL = `CASE
32790
32998
  WHEN status IN ('draft', 'offered', 'reviewing') AND offeredTo IS NOT NULL THEN offeredTo
32791
32999
  ELSE COALESCE(agentId, offeredTo)
32792
- 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;
32793
33001
  var init_db4 = __esm(() => {
32794
33002
  init_src2();
32795
33003
  init_package();
@@ -32801,11 +33009,12 @@ var init_db4 = __esm(() => {
32801
33009
  init_telemetry();
32802
33010
  init_telemetry_identity();
32803
33011
  init_telemetry_trigger();
32804
- init_types4();
33012
+ init_types5();
32805
33013
  init_codex_auth_failure();
32806
33014
  init_config_env_export();
32807
33015
  init_config_secrets();
32808
33016
  init_credentials2();
33017
+ init_github_host();
32809
33018
  init_github_pull_request();
32810
33019
  init_heartbeat_expiry();
32811
33020
  init_identity_field_budget();
@@ -32829,6 +33038,7 @@ var init_db4 = __esm(() => {
32829
33038
  init_session_tree();
32830
33039
  init_skill_search();
32831
33040
  init_slack_trees();
33041
+ init_eligibility_scan();
32832
33042
  init_human_free();
32833
33043
  init_read();
32834
33044
  init_write();
@@ -32856,7 +33066,8 @@ var init_db4 = __esm(() => {
32856
33066
  init_defaults();
32857
33067
  configureAgentDependencies({
32858
33068
  createLogEntry: (entry) => createLogEntry2(entry),
32859
- installSystemDefaultSkillsForAgent: (agentId) => installSystemDefaultSkillsForAgent2(agentId)
33069
+ installSystemDefaultSkillsForAgent: (agentId) => installSystemDefaultSkillsForAgent2(agentId),
33070
+ resolvePendingImportAssignments: async (agent) => (await import("./pending-sqkrb836.js")).resolvePendingImportAssignments(agent)
32860
33071
  });
32861
33072
  configureTaskWriteDependencies({
32862
33073
  createLogEntry: (...args) => createLogEntry2(...args),
@@ -32891,7 +33102,6 @@ var init_db4 = __esm(() => {
32891
33102
  "toolsMd"
32892
33103
  ];
32893
33104
  ELIGIBILITY_SCAN_BATCH_SIZE = Number(process.env.ELIGIBILITY_SCAN_BATCH_SIZE) || 25;
32894
- ELIGIBILITY_SCAN_CAP = Number(process.env.ELIGIBILITY_SCAN_CAP) || 500;
32895
33105
  SKILL_FILE_LIMITS2 = {
32896
33106
  maxCount: Number(process.env.SKILL_FILES_MAX_COUNT ?? 100),
32897
33107
  maxTotalBytes: Number(process.env.SKILL_FILES_MAX_TOTAL_BYTES ?? 10 * 1024 * 1024),
@@ -32908,4 +33118,4 @@ var init_db4 = __esm(() => {
32908
33118
  };
32909
33119
  });
32910
33120
 
32911
- 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, 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, 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, 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 };