@desplega.ai/agent-swarm 2.7.7 → 2.7.9

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 (401) hide show
  1. package/dist/acp-adapter-dn4gdsgr.js +16 -0
  2. package/dist/{actions-3tt153af.js → actions-g563mbn2.js} +19 -19
  3. package/dist/{amp-adapter-njpts0yr.js → amp-adapter-q61w05eb.js} +3 -3
  4. package/dist/{anthropic-messages-xey2skwx.js → anthropic-messages-jkva0zps.js} +68 -78
  5. package/dist/{app-nky4378f.js → app-a66ssc4k.js} +3 -3
  6. package/dist/{assistant-jnb669pa.js → assistant-p477rjwj.js} +22 -22
  7. package/dist/{azure-openai-responses-26t7j9ra.js → azure-openai-responses-wgtqkbr3.js} +5 -10
  8. package/dist/boot-args-schema-h4qj462e.js +89 -0
  9. package/dist/{boot-reembed-9mgvaztt.js → boot-reembed-n1ehfbsw.js} +1 -1
  10. package/dist/{boot-reembed-qs2djdej.js → boot-reembed-qw4mc0pt.js} +1 -1
  11. package/dist/{boot-scrub-sweep-yjpdj7s1.js → boot-scrub-sweep-9w9jp4sm.js} +4 -4
  12. package/dist/{boot-seeds-5cm6ambd.js → boot-seeds-qdaf3sdy.js} +5 -4
  13. package/dist/{boxd-nv507va8.js → boxd-qbkxy6ap.js} +1 -1
  14. package/dist/{claude-adapter-fn287zmm.js → claude-adapter-348p5hx9.js} +8 -8
  15. package/dist/{claude-managed-adapter-dvs2xw5n.js → claude-managed-adapter-h74d06yz.js} +4 -4
  16. package/dist/{claude-managed-setup-wtdz2mj2.js → claude-managed-setup-7787fxtp.js} +5 -5
  17. package/dist/{claude-sdk-session-x91kqyhm.js → claude-sdk-session-hbszbt8a.js} +7901 -7718
  18. package/dist/{cli-cb2a8pna.js → cli-09kmfkmq.js} +4 -6
  19. package/dist/{cli-m0da8j35.js → cli-0whpms1z.js} +15 -10
  20. package/dist/{cli-5zx699j9.js → cli-12xyjhws.js} +29 -12
  21. package/dist/{cli-snpj5zbj.js → cli-1z4qggfe.js} +9 -36
  22. package/dist/{cli-e0kmphd6.js → cli-21159vea.js} +35 -12
  23. package/dist/{cli-s0qnd4wv.js → cli-28fq781p.js} +1 -1
  24. package/dist/{cli-qh4d4tvk.js → cli-2a8py3sx.js} +6 -6
  25. package/dist/{cli-adeegh7d.js → cli-2ccpqyyf.js} +412 -116
  26. package/dist/{cli-1p89xny0.js → cli-2r0jcc3k.js} +1 -1
  27. package/dist/{cli-rvtm68yy.js → cli-2xv18ywz.js} +2 -2
  28. package/dist/{cli-5xaqj21p.js → cli-3kd08rej.js} +1 -1
  29. package/dist/{cli-1c6tzt8g.js → cli-3tqcamp6.js} +13 -13
  30. package/dist/{cli-ae7mrdf9.js → cli-3vjhs18n.js} +4 -6
  31. package/dist/{cli-vfym7wmz.js → cli-3xcwp3z8.js} +10 -12
  32. package/dist/{cli-az48n0nr.js → cli-4caa1x7d.js} +67 -64
  33. package/dist/{cli-5jnhv72d.js → cli-4t0fmf3z.js} +30 -7
  34. package/dist/{cli-5b456bpf.js → cli-530hkwdy.js} +7 -9
  35. package/dist/{cli-pz4rk021.js → cli-54vrpgm0.js} +1 -1
  36. package/dist/{cli-ddaanqkd.js → cli-587857ys.js} +7 -7
  37. package/dist/{cli-r9jqcehk.js → cli-5mpy301f.js} +38 -2
  38. package/dist/{cli-cppkf404.js → cli-605nn699.js} +80 -43
  39. package/dist/{cli-6pfd54vx.js → cli-650zv9q9.js} +10 -10
  40. package/dist/cli-6pzk82fd.js +778 -0
  41. package/dist/{cli-gz6q4eve.js → cli-715t1gx6.js} +9 -9
  42. package/dist/{cli-08bmz9z9.js → cli-9aezs55w.js} +10 -12
  43. package/dist/{cli-tgrv9cjx.js → cli-9r5gtwjr.js} +3 -3
  44. package/dist/{cli-pc6n7fre.js → cli-a0657jmf.js} +2 -2
  45. package/dist/{cli-pjctyea3.js → cli-agyaeef4.js} +3 -3
  46. package/dist/cli-b932gexn.js +5266 -0
  47. package/dist/{cli-e46hg0xw.js → cli-bc779n4v.js} +3 -3
  48. package/dist/{cli-jtjtabxe.js → cli-btc9cb4c.js} +78 -5
  49. package/dist/{cli-caj33vcq.js → cli-btf6fw39.js} +5 -5
  50. package/dist/{cli-q3tkegby.js → cli-cseh6f8w.js} +5 -5
  51. package/dist/{cli-n6bv12jn.js → cli-cvs2r2vq.js} +23 -14
  52. package/dist/{cli-tfyyvzx6.js → cli-cyn9v8zr.js} +17 -2
  53. package/dist/{cli-a22h291q.js → cli-d6521kb5.js} +1 -1
  54. package/dist/{cli-1b7btd38.js → cli-d84byzn8.js} +869 -5
  55. package/dist/{cli-wx3rhnm0.js → cli-eddnyg3t.js} +1 -1
  56. package/dist/{cli-nmzhp1b5.js → cli-ejkvvqbe.js} +55 -46
  57. package/dist/{cli-ftyxyspd.js → cli-eqtfgfr6.js} +1 -1
  58. package/dist/{cli-mthwvjre.js → cli-f2zenhja.js} +1 -1
  59. package/dist/{cli-ws19768n.js → cli-fayav105.js} +624 -227
  60. package/dist/{cli-ferkkrg9.js → cli-fjggej24.js} +2 -2
  61. package/dist/{cli-g7s47cc5.js → cli-fsgttth8.js} +123 -102
  62. package/dist/{cli-8305gbq0.js → cli-gce09r66.js} +5 -5
  63. package/dist/{cli-mkk9rnzz.js → cli-gxy8y1dt.js} +51 -4
  64. package/dist/{cli-fyt2g4wd.js → cli-hae9j8sv.js} +288 -76
  65. package/dist/{cli-agfm16v9.js → cli-hg42n3hx.js} +12 -12
  66. package/dist/{cli-qghe0h66.js → cli-hwprv9e4.js} +8 -10
  67. package/dist/{cli-yndmfxb3.js → cli-hxpyc9sn.js} +3 -3
  68. package/dist/{cli-72v799xn.js → cli-jfx48xrj.js} +10 -12
  69. package/dist/{cli-dhar9qay.js → cli-jrp1dt73.js} +2 -2
  70. package/dist/{cli-98rw5dt5.js → cli-jrzkw01m.js} +2 -2
  71. package/dist/{cli-ayayvfg4.js → cli-k70e3x9e.js} +24 -20
  72. package/dist/{cli-583frbyr.js → cli-kchjb7qy.js} +1 -1
  73. package/dist/{cli-cm5yqn35.js → cli-kf3pxxdg.js} +1 -0
  74. package/dist/{cli-fmjd0t1y.js → cli-m0cy2vyf.js} +2 -2
  75. package/dist/{cli-4zsenjhy.js → cli-m5akxq8q.js} +16 -3
  76. package/dist/{cli-73jzwksr.js → cli-m88rpzkh.js} +6 -3
  77. package/dist/{cli-95jzxcp3.js → cli-mnrkgg60.js} +4 -4
  78. package/dist/{cli-p82cnnjq.js → cli-ms5m5r1y.js} +1 -1
  79. package/dist/{cli-fy6x31ps.js → cli-n5yexkdg.js} +1 -0
  80. package/dist/{cli-wk5yrfwd.js → cli-neyag5p6.js} +191 -85
  81. package/dist/cli-p0m0p34z.js +9321 -0
  82. package/dist/{cli-yyj3j5m4.js → cli-p17970qv.js} +8 -10
  83. package/dist/{cli-6vcp76qk.js → cli-p74md7t8.js} +42 -23
  84. package/dist/{cli-rjcbm574.js → cli-pr0eze3x.js} +2 -2
  85. package/dist/{cli-35rsp8ye.js → cli-qkdmz8c8.js} +1 -1
  86. package/dist/{cli-rtt8g4v9.js → cli-qmd3mse0.js} +2 -2
  87. package/dist/{cli-je518txm.js → cli-qzt90yze.js} +20 -20
  88. package/dist/cli-rkc97c6a.js +39 -0
  89. package/dist/{cli-75gkpjvw.js → cli-rvhdmjvt.js} +8 -12
  90. package/dist/{cli-6g0hb4cp.js → cli-rwymrnaz.js} +18608 -9089
  91. package/dist/{cli-3fg0bdcv.js → cli-serm8zrx.js} +6 -6
  92. package/dist/{cli-g08zdaec.js → cli-sgs5k6yd.js} +1 -1
  93. package/dist/{cli-afkqkrtw.js → cli-sya22y84.js} +21 -9
  94. package/dist/{cli-318r69gq.js → cli-t73cas91.js} +440 -9
  95. package/dist/{cli-e5bzrn01.js → cli-tqq0hspb.js} +2 -2
  96. package/dist/{cli-pq73h5mz.js → cli-v3cf1ts9.js} +3 -3
  97. package/dist/{cli-bfv7vdg6.js → cli-varqt4d1.js} +28 -16
  98. package/dist/{cli-k899ehvh.js → cli-vxh6acp7.js} +6 -6
  99. package/dist/{cli-g83s9ewh.js → cli-xfjrc279.js} +1 -1
  100. package/dist/{cli-k1nje3v3.js → cli-xk879m3k.js} +129 -115
  101. package/dist/{cli-7cx2m6t2.js → cli-y5rbvxhc.js} +2 -2
  102. package/dist/{cli-8sckt74b.js → cli-y8nbefpb.js} +41 -19
  103. package/dist/{cli-81p9jd57.js → cli-yab6sh8p.js} +9 -3
  104. package/dist/{cli-srye3vdt.js → cli-ybjdc978.js} +1 -1
  105. package/dist/{cli-k5671be5.js → cli-zcfpsfzf.js} +5 -5
  106. package/dist/{cli-vf078p3e.js → cli-zfqg6fzn.js} +1 -1
  107. package/dist/{cli-k8196sh2.js → cli-zgv8gxgs.js} +9 -8
  108. package/dist/cli.js +34 -52
  109. package/dist/{cloudflare-workers-ai-system-one-ef2a980q.js → cloudflare-workers-ai-system-one-9y1zx3pt.js} +2 -2
  110. package/dist/{codex-adapter-cf2yxe9m.js → codex-adapter-ysq6bzha.js} +7 -7
  111. package/dist/{codex-hook-a0c6g6t6.js → codex-hook-fac6175r.js} +1 -1
  112. package/dist/{codex-login-y0pmff1c.js → codex-login-bcda78ge.js} +2 -2
  113. package/dist/{codex-session-runner-6vfzdgbd.js → codex-session-runner-qakzfx93.js} +8 -8
  114. package/dist/{commands-t3mfy7vn.js → commands-rs7hkv9r.js} +3 -3
  115. package/dist/{controller-q7xrbaz0.js → controller-r5x9bg6e.js} +4 -4
  116. package/dist/{controllers-connect-c6nm70kg.js → controllers-connect-498hrxvk.js} +24 -24
  117. package/dist/{cursor-adapter-ftd81ga8.js → cursor-adapter-d46qszer.js} +2 -2
  118. package/dist/{db-vemtpmcc.js → db-pm96nhdb.js} +6 -2
  119. package/dist/{db-dk572x25.js → db-s13dqhr6.js} +3 -3
  120. package/dist/{devin-adapter-r9phbnc9.js → devin-adapter-z46ep5ph.js} +1 -1
  121. package/dist/{dispatcher-kh7ecxh9.js → dispatcher-j3h81t7m.js} +18 -18
  122. package/dist/{docker-c1a3gqmf.js → docker-866qpzt9.js} +2 -2
  123. package/dist/{dsh-adapter-v8628r89.js → dsh-adapter-rw0d5rc4.js} +2 -2
  124. package/dist/{e2b-fr12yccx.js → e2b-jkwfhbcv.js} +2 -2
  125. package/dist/{e2b-x6ywzak3.js → e2b-s16txnpx.js} +2 -3
  126. package/dist/{easter-egg-3d-nenw4x63.js → easter-egg-3d-qtgfxgze.js} +1 -1
  127. package/dist/{embedding-space-0jepb239.js → embedding-space-xh8p4q4x.js} +6 -6
  128. package/dist/{embeddings-xxt49yxg.js → embeddings-wp745m91.js} +1 -1
  129. package/dist/{event-bus-g0ka3pbw.js → event-bus-e66gh7cc.js} +1 -1
  130. package/dist/{execute-1mhw6e4x.js → execute-2fzb9z74.js} +1 -1
  131. package/dist/{external-channel-55v12e60.js → external-channel-ys21h3sy.js} +2 -2
  132. package/dist/fx-adapter-vz0b9z3g.js +19 -0
  133. package/dist/{google-generative-ai-v94hr7h0.js → google-generative-ai-ytpgncx9.js} +7 -12
  134. package/dist/{google-vertex-g7vr6cf8.js → google-vertex-tqhze5j7.js} +7 -12
  135. package/dist/grok-adapter-spea7zkj.js +19 -0
  136. package/dist/handlers-crckt5dq.js +32 -0
  137. package/dist/{heartbeat-k42svnr0.js → heartbeat-8phn1kdq.js} +21 -21
  138. package/dist/{hook-6nphweh0.js → hook-amcj4s10.js} +16 -11
  139. package/dist/{hook-114m7hap.js → hook-bc6n49qn.js} +5 -5
  140. package/dist/{http-r8cc4wz7.js → http-7374brv5.js} +854 -332
  141. package/dist/index-4x08sjtk.js +30 -0
  142. package/dist/{index-6cxzwfen.js → index-5a9jtqde.js} +26 -26
  143. package/dist/index-8ybffts4.js +37 -0
  144. package/dist/{index-nh3wyqdt.js → index-c9y31ytf.js} +16 -16
  145. package/dist/{index-h39zbx67.js → index-hsad2t3r.js} +31 -31
  146. package/dist/index-nfy4kkg5.js +33 -0
  147. package/dist/{index-e3s8wmxy.js → index-p4hjwbvw.js} +1 -1
  148. package/dist/{index-k7fj52d3.js → index-q5cmtbz5.js} +6 -6
  149. package/dist/{index-fpk4bcd9.js → index-w4m9z29z.js} +1 -1
  150. package/dist/{keepalive-x060nt9p.js → keepalive-wy29kbrg.js} +4 -4
  151. package/dist/lead-zdqxsvjn.js +71 -0
  152. package/dist/{llama-cpp-classify-s5c47rwh.js → llama-cpp-classify-nfgswa1m.js} +2 -2
  153. package/dist/{maintenance-2xxfexhf.js → maintenance-h2ds9w6c.js} +1 -1
  154. package/dist/{mistral-conversations-3gjpdb4b.js → mistral-conversations-a45tx39a.js} +29 -51
  155. package/dist/{oauth-refresh-sweep-fckc4ar5.js → oauth-refresh-sweep-q7mtbyp3.js} +3 -3
  156. package/dist/{onboard-zc48j237.js → onboard-vw8r2fdw.js} +68 -16
  157. package/dist/{openai-codex-responses-8pbxq9h5.js → openai-codex-responses-k9gapdze.js} +7 -11
  158. package/dist/{openai-completions-rm00s912.js → openai-completions-xd579js7.js} +50 -58
  159. package/dist/{openai-decisions-8v957r2r.js → openai-decisions-q3hh60wr.js} +2 -2
  160. package/dist/{openai-responses-agxpf96k.js → openai-responses-4d5dx3c7.js} +5 -10
  161. package/dist/{opencode-adapter-r690h1cr.js → opencode-adapter-mtb0953j.js} +6 -6
  162. package/dist/{openrouter-images-3ecegv0d.js → openrouter-images-xr9gme9x.js} +4 -3
  163. package/dist/{otel-impl-r5xbh81q.js → otel-impl-j42czw3r.js} +2 -2
  164. package/dist/{pi-messages-pchtw4he.js → pi-messages-hjbv8v10.js} +28 -12
  165. package/dist/{pi-mono-adapter-c7v8sdec.js → pi-mono-adapter-zk8pg9jr.js} +30 -27
  166. package/dist/{pricing-refresh-3pmre11v.js → pricing-refresh-x7nhv23d.js} +3 -3
  167. package/dist/{rbac-roles-3vbshwsb.js → rbac-roles-9044425x.js} +16 -2
  168. package/dist/rbac-roles-bzvee6cf.js +37 -0
  169. package/dist/{render-v2-pxykkbab.js → render-v2-t7bn4skz.js} +3 -3
  170. package/dist/{resume-adda0bwy.js → resume-x94gemep.js} +7 -7
  171. package/dist/{runtime-fnbm7stk.js → runtime-breq6fmv.js} +1 -1
  172. package/dist/{session-access-2fvamrdc.js → session-access-q7dmqjvt.js} +7 -5
  173. package/dist/{session-source-backfill-08xvv0sm.js → session-source-backfill-440ysamr.js} +3 -3
  174. package/dist/{setup-1aqmvmh1.js → setup-07n4727s.js} +1 -1
  175. package/dist/{typesafe-system-one-0bmqcxfg.js → typesafe-system-one-f2en2knd.js} +2 -2
  176. package/dist/virtual-modules-z5h6mcyf.js +362 -0
  177. package/dist/{work-objects-9s0yrm5j.js → work-objects-pnq5y534.js} +21 -21
  178. package/dist/{worker-follow-up-3q78fqmr.js → worker-follow-up-7z1gfkr8.js} +18 -18
  179. package/dist/worker-y62rvvq3.js +71 -0
  180. package/dist/{x-vmmye1kb.js → x-2fyrt5pp.js} +2 -2
  181. package/openapi.json +1268 -276
  182. package/package.json +10 -10
  183. package/src/apps/catalog.generated.json +299 -82
  184. package/src/apps/page-validator.ts +115 -2
  185. package/src/be/connector-codes.ts +21 -6
  186. package/src/be/db/model-profiles.ts +1 -1
  187. package/src/be/db/session-tree.ts +9 -5
  188. package/src/be/db/session-visibility.ts +25 -9
  189. package/src/be/db/tasks/read.ts +33 -6
  190. package/src/be/db/tasks/write.ts +77 -7
  191. package/src/be/db-queries/tracker.ts +4 -2
  192. package/src/be/db.ts +53 -19
  193. package/src/be/improvements.ts +416 -0
  194. package/src/be/migrations/271_subscription_usage_model.sql +30 -0
  195. package/src/be/migrations/274_improvements.sql +27 -0
  196. package/src/be/migrations/275_task_dispatched_by.sql +8 -0
  197. package/src/be/model-validation.ts +19 -1
  198. package/src/be/rbac-roles.ts +144 -1
  199. package/src/be/runtime-pools/routing.ts +1 -1
  200. package/src/be/scripts/boot-args-schema.ts +95 -0
  201. package/src/be/scripts/extract-schema.ts +15 -10
  202. package/src/be/seed-scripts/catalog/boot-triage.inline.ts +1 -1
  203. package/src/be/seed-scripts/catalog/boot-triage.ts +1 -1
  204. package/src/be/seed-scripts/catalog/get-child-outputs.ts +1 -1
  205. package/src/be/seed-scripts/catalog/wait-for-task.ts +1 -1
  206. package/src/be/swarm-config-guard.ts +8 -0
  207. package/src/be/users.ts +64 -5
  208. package/src/cli.tsx +5 -25
  209. package/src/commands/claude-managed-setup.ts +1 -1
  210. package/src/commands/codex-login.ts +1 -1
  211. package/src/commands/e2b.ts +0 -1
  212. package/src/commands/onboard/agent-fs-version.ts +1 -1
  213. package/src/commands/onboard/compose-generator.ts +0 -1
  214. package/src/commands/onboard/dashboard-url.ts +31 -0
  215. package/src/commands/onboard/steps/generate.tsx +17 -1
  216. package/src/commands/onboard/steps/post-dashboard.tsx +9 -3
  217. package/src/commands/onboard.tsx +19 -6
  218. package/src/commands/runner.ts +143 -105
  219. package/src/extensions/contract-types.generated.ts +1 -1
  220. package/src/hooks/hook.ts +13 -5
  221. package/src/http/agents.ts +7 -1
  222. package/src/http/all-routes.ts +1 -0
  223. package/src/http/approval-requests.ts +32 -50
  224. package/src/http/auth.ts +5 -4
  225. package/src/http/codex-oauth-accounts.ts +31 -23
  226. package/src/http/codex-oauth-device.ts +3 -3
  227. package/src/http/codex-oauth-keep-warm.ts +1 -1
  228. package/src/http/improvements.ts +317 -0
  229. package/src/http/index.ts +10 -0
  230. package/src/http/mcp-oauth.ts +6 -0
  231. package/src/http/mcp-servers.ts +8 -0
  232. package/src/http/models-catalog.ts +1 -1
  233. package/src/http/operator-actor.ts +2 -1
  234. package/src/http/pages-public.ts +38 -1
  235. package/src/http/person-responder.ts +66 -0
  236. package/src/http/poll.ts +3 -4
  237. package/src/http/prompt-templates.ts +1 -1
  238. package/src/http/schedules.ts +4 -0
  239. package/src/http/script-runs.ts +6 -1
  240. package/src/http/session-access.ts +61 -6
  241. package/src/http/sessions.ts +67 -9
  242. package/src/http/tasks.ts +53 -9
  243. package/src/http/user-roles.ts +11 -2
  244. package/src/http/users.ts +224 -105
  245. package/src/http/utils.ts +2 -1
  246. package/src/http/workflows.ts +11 -7
  247. package/src/prompts/session-templates.ts +1 -0
  248. package/src/providers/acp-targets.ts +1 -1
  249. package/src/providers/amp-adapter.ts +1 -1
  250. package/src/providers/codex-adapter.ts +17 -3
  251. package/src/providers/codex-models.ts +4 -3
  252. package/src/providers/codex-oauth/auth-json.ts +14 -18
  253. package/src/providers/codex-oauth/device.ts +49 -15
  254. package/src/providers/codex-oauth/flow.ts +2 -1
  255. package/src/providers/codex-oauth/storage.ts +2 -2
  256. package/src/providers/pi-mono-adapter.ts +8 -0
  257. package/src/providers/pricing-sources.md +16 -1
  258. package/src/providers/swarm-events-shared.ts +15 -2
  259. package/src/rbac/legacy-policy.ts +3 -0
  260. package/src/rbac/permissions.ts +15 -0
  261. package/src/scheduler/deferred-task-waits.ts +9 -4
  262. package/src/scripts-runtime/extract-args-schema.ts +3 -1
  263. package/src/scripts-runtime/swarm-sdk.ts +1 -1
  264. package/src/scripts-runtime/types/swarm-extension.d.ts +31 -28
  265. package/src/server-user.ts +1 -1
  266. package/src/server.ts +2 -0
  267. package/src/slack/ack.ts +68 -26
  268. package/src/slack/blocks.ts +1 -0
  269. package/src/slack/reaction-shortcode.ts +8 -2
  270. package/src/slack/render-v2.ts +72 -20
  271. package/src/slack/task-output.ts +4 -1
  272. package/src/slack/thread-buffer.ts +2 -2
  273. package/src/tasks/task-skip.ts +28 -0
  274. package/src/tasks/terminal-result-guard.ts +3 -2
  275. package/src/telemetry.ts +28 -1
  276. package/src/tests/agentmail-inbox-mapping.test.ts +73 -0
  277. package/src/tests/api-drain-worker-e2e.test.ts +69 -2
  278. package/src/tests/approval-requests.test.ts +58 -0
  279. package/src/tests/apps-catalog-drift.test.ts +35 -0
  280. package/src/tests/apps-catalog-table.test.ts +203 -0
  281. package/src/tests/apps-element-assembly.test.ts +28 -0
  282. package/src/tests/apps-smart-links.test.ts +151 -0
  283. package/src/tests/apps-table-filters-migration.test.ts +96 -0
  284. package/src/tests/apps-table-selection-migration.test.ts +95 -0
  285. package/src/tests/chatgpt-subscription-session-bench.test.ts +2 -2
  286. package/src/tests/claude-managed-setup.test.ts +36 -0
  287. package/src/tests/claude-worker-parity.test.ts +2 -2
  288. package/src/tests/codex-adapter.test.ts +32 -2
  289. package/src/tests/codex-login.test.ts +2 -2
  290. package/src/tests/codex-oauth-accounts.test.ts +48 -12
  291. package/src/tests/codex-oauth-credential-info.test.ts +77 -1
  292. package/src/tests/codex-oauth-device.test.ts +61 -1
  293. package/src/tests/codex-oauth-keep-warm.test.ts +2 -2
  294. package/src/tests/codex-oauth.test.ts +25 -4
  295. package/src/tests/codex-pool.test.ts +2 -2
  296. package/src/tests/codex-swarm-events.test.ts +43 -1
  297. package/src/tests/context-window.test.ts +14 -0
  298. package/src/tests/db-queries-tracker.test.ts +2 -1
  299. package/src/tests/db-task-read-contract.test.ts +3 -0
  300. package/src/tests/db-task-write-contract.test.ts +3 -0
  301. package/src/tests/deferred-task-wake.test.ts +7 -2
  302. package/src/tests/deploy-one-box.test.ts +39 -1
  303. package/src/tests/docs-index-footprint.test.js +3 -3
  304. package/src/tests/e2e-coverage-contract.test.ts +235 -0
  305. package/src/tests/empty-output-schema.test.ts +160 -0
  306. package/src/tests/env-flag.test.ts +1 -0
  307. package/src/tests/explicit-model-validation.test.ts +14 -0
  308. package/src/tests/fixtures/onboard/content.compose.yml.txt +0 -4
  309. package/src/tests/fixtures/onboard/dev.compose.yml.txt +0 -3
  310. package/src/tests/fixtures/onboard/full-all.compose.yml.txt +0 -11
  311. package/src/tests/fixtures/onboard/full.compose.yml.txt +0 -11
  312. package/src/tests/fixtures/onboard/research.compose.yml.txt +0 -3
  313. package/src/tests/fixtures/onboard/solo.compose.yml.txt +0 -1
  314. package/src/tests/fixtures/prs-app-definition.json.txt +784 -0
  315. package/src/tests/fixtures/prs-filters-migration.patch.json.txt +318 -0
  316. package/src/tests/fixtures/prs-selection-migration.patch.json.txt +373 -0
  317. package/src/tests/fixtures/runner-identity-refresh.ts +3 -0
  318. package/src/tests/fixtures/runner-legacy-resume-prompt.ts +3 -0
  319. package/src/tests/fixtures/runner-task-start-reads.ts +140 -0
  320. package/src/tests/hook-ping-me-order.test.ts +85 -0
  321. package/src/tests/http-api-integration.test.ts +2 -2
  322. package/src/tests/http-users.test.ts +63 -0
  323. package/src/tests/improvements-payload.test.ts +200 -0
  324. package/src/tests/improvements-route.test.ts +419 -0
  325. package/src/tests/install-sh-setup-url.test.ts +190 -0
  326. package/src/tests/mcp-input-caps.test.ts +4 -3
  327. package/src/tests/merge-gate-detect-changes.test.ts +22 -0
  328. package/src/tests/onboard-dashboard-output.test.ts +109 -0
  329. package/src/tests/onboard-dashboard-url.test.ts +83 -0
  330. package/src/tests/operator-granted-credentials.test.ts +561 -0
  331. package/src/tests/operator-granted-role-wire.test.ts +222 -0
  332. package/src/tests/pages-authed-mode.test.ts +13 -2
  333. package/src/tests/pi-mono-adapter.test.ts +39 -4
  334. package/src/tests/rbac-engine.test.ts +3 -0
  335. package/src/tests/runner-context-usage.test.ts +118 -0
  336. package/src/tests/runner-legacy-options.test.ts +55 -0
  337. package/src/tests/runner-slot-reconcile.test.ts +38 -0
  338. package/src/tests/runner-task-start-reads.test.ts +58 -0
  339. package/src/tests/script-connections.test.ts +2 -0
  340. package/src/tests/script-executor-quickjs.test.ts +2 -0
  341. package/src/tests/script-runs-http.test.ts +57 -0
  342. package/src/tests/scripts-boot-args-schema.test.ts +181 -0
  343. package/src/tests/scripts-runtime.test.ts +24 -0
  344. package/src/tests/sdk-store-progress-skipped.test.ts +155 -0
  345. package/src/tests/send-task-dispatched-by.test.ts +129 -0
  346. package/src/tests/session-costs-model-key-normalize.test.ts +59 -0
  347. package/src/tests/session-dispatched-tasks.test.ts +115 -0
  348. package/src/tests/session-sharing.test.ts +402 -3
  349. package/src/tests/slack-file-tools-attachments.test.ts +95 -3
  350. package/src/tests/slack-reaction-config.test.ts +40 -0
  351. package/src/tests/slack-render-v2.test.ts +120 -0
  352. package/src/tests/slack-skip-reaction.test.ts +203 -0
  353. package/src/tests/store-progress-skipped.test.ts +159 -0
  354. package/src/tests/submit-improvement-tool.test.ts +82 -0
  355. package/src/tests/subscription-usage-migration.test.ts +57 -0
  356. package/src/tests/swarm-config-reserved-keys.test.ts +3 -0
  357. package/src/tests/telemetry-endpoint-override.test.ts +27 -0
  358. package/src/tests/tool-annotations.test.ts +1 -1
  359. package/src/tests/trigger-claiming.test.ts +2 -0
  360. package/src/tests/workflow-system-one-extraction.test.ts +29 -0
  361. package/src/tools/create-channel.ts +1 -1
  362. package/src/tools/defer-task.ts +1 -1
  363. package/src/tools/manage-user.ts +88 -58
  364. package/src/tools/register-agentmail-inbox.ts +5 -0
  365. package/src/tools/repos/update-repo.ts +1 -1
  366. package/src/tools/request-human-input.ts +1 -1
  367. package/src/tools/send-task.ts +4 -1
  368. package/src/tools/slack-read.ts +61 -33
  369. package/src/tools/store-progress.ts +39 -8
  370. package/src/tools/submit-improvement.ts +68 -0
  371. package/src/tools/tool-config.ts +3 -0
  372. package/src/tools/tracker/tracker-unlink.ts +2 -1
  373. package/src/tools/workflows/retry-workflow-run.ts +3 -0
  374. package/src/types.ts +16 -2
  375. package/src/utils/context-window.ts +6 -1
  376. package/src/utils/output-schema.ts +23 -0
  377. package/src/utils/request-auth-context.ts +6 -1
  378. package/src/workflows/executors/system-one-providers.ts +25 -6
  379. package/src/workflows/recovery.ts +8 -4
  380. package/src/workflows/resume.ts +19 -0
  381. package/templates/skills/apps/SKILL.md +22 -11
  382. package/templates/skills/apps/content.md +22 -11
  383. package/templates/skills/swarm-scripts/SKILL.md +1 -1
  384. package/templates/skills/swarm-scripts/content.md +1 -1
  385. package/templates/skills/work-on-task/SKILL.md +1 -1
  386. package/templates/skills/work-on-task/content.md +1 -1
  387. package/dist/acp-adapter-7b4vk3h5.js +0 -16
  388. package/dist/cli-5c4hjzne.js +0 -873
  389. package/dist/cli-excnnjg2.js +0 -20222
  390. package/dist/cli-pc5znp64.js +0 -364
  391. package/dist/cli-vz22fyqv.js +0 -428
  392. package/dist/fx-adapter-bs8wqrk5.js +0 -19
  393. package/dist/grok-adapter-gpjqmkcq.js +0 -19
  394. package/dist/handlers-zxmp1ta4.js +0 -32
  395. package/dist/index-a8phxqnk.js +0 -37
  396. package/dist/index-k6h00t4c.js +0 -30
  397. package/dist/index-xrz7te8h.js +0 -33
  398. package/dist/lead-956sd2yc.js +0 -71
  399. package/dist/rbac-roles-910mmkgz.js +0 -26
  400. package/dist/virtual-modules-d2pjk9j1.js +0 -59
  401. package/dist/worker-y15hy08h.js +0 -71
@@ -45,6 +45,30 @@ import {
45
45
  getDb2,
46
46
  getDbClient2,
47
47
  init_runtime2,
48
+ CHAT_SDK_ADAPTER_NAMES,
49
+ CHAT_SDK_ADAPTER_SCHEMAS,
50
+ ChatSdkAdaptersDraftSchema,
51
+ firstIssueText,
52
+ isAdapterEntryEnabled,
53
+ init_schema,
54
+ API_DRAIN_MAX_MS_LIMIT,
55
+ init_api_drain2,
56
+ parseEnabledTools,
57
+ init_enabled_tools,
58
+ parseFollowUpGateScheduleIds,
59
+ isFollowUpGateScheduleId,
60
+ init_follow_up_gate_schedule_ids,
61
+ tierConfigKey,
62
+ init_model_tier_keys,
63
+ isInternalConfigKey,
64
+ internalConfigKeyError,
65
+ isReservedConfigKey,
66
+ reservedKeyError,
67
+ validateConfigValue,
68
+ validateExportToEnv,
69
+ init_swarm_config_guard,
70
+ isEffectiveOutputSchema,
71
+ init_output_schema,
48
72
  isRuntimePoolsEnabled,
49
73
  init_runtime_pools_flag,
50
74
  normalizeDateRequired,
@@ -105,28 +129,6 @@ import {
105
129
  init_model_profiles,
106
130
  onTaskStarted,
107
131
  init_task_lifecycle_events,
108
- CHAT_SDK_ADAPTER_NAMES,
109
- CHAT_SDK_ADAPTER_SCHEMAS,
110
- ChatSdkAdaptersDraftSchema,
111
- firstIssueText,
112
- isAdapterEntryEnabled,
113
- init_schema,
114
- API_DRAIN_MAX_MS_LIMIT,
115
- init_api_drain2,
116
- parseEnabledTools,
117
- init_enabled_tools,
118
- parseFollowUpGateScheduleIds,
119
- isFollowUpGateScheduleId,
120
- init_follow_up_gate_schedule_ids,
121
- tierConfigKey,
122
- init_model_tier_keys,
123
- isInternalConfigKey,
124
- internalConfigKeyError,
125
- isReservedConfigKey,
126
- reservedKeyError,
127
- validateConfigValue,
128
- validateExportToEnv,
129
- init_swarm_config_guard,
130
132
  getOAuthApp,
131
133
  getOAuthAppById,
132
134
  getOAuthAppIdByProvider,
@@ -192,6 +194,7 @@ import {
192
194
  failTask2,
193
195
  overwriteTerminalTaskResultText2,
194
196
  cancelTask2,
197
+ skipTask2,
195
198
  getRecentlyCancelledTasksForAgent2,
196
199
  updateTaskProgress2,
197
200
  IdempotencyKeyTakenError,
@@ -354,17 +357,18 @@ import {
354
357
  recordInlineScriptRun2,
355
358
  exports_db,
356
359
  init_db4
357
- } from "./cli-wk5yrfwd.js";
360
+ } from "./cli-neyag5p6.js";
358
361
  import {
362
+ assertMayActOnOperatorGrantedTarget2,
359
363
  getUserGrant2,
360
364
  init_rbac_roles
361
- } from "./cli-jtjtabxe.js";
365
+ } from "./cli-btc9cb4c.js";
362
366
  import {
363
367
  ensurePricingSeeded2,
364
368
  ensureRbacSeeded2,
365
369
  ensureModelProfilesSeeded2,
366
370
  init_boot_seeds
367
- } from "./cli-qh4d4tvk.js";
371
+ } from "./cli-2a8py3sx.js";
368
372
  import {
369
373
  buildCatalogEntries,
370
374
  listModelCatalog,
@@ -376,11 +380,11 @@ import {
376
380
  requestModelCatalogRefresh2,
377
381
  startPricingRefreshLoop2,
378
382
  init_pricing_refresh
379
- } from "./cli-5b456bpf.js";
383
+ } from "./cli-530hkwdy.js";
380
384
  import {
381
385
  workflowEventBus2,
382
386
  init_event_bus
383
- } from "./cli-wx3rhnm0.js";
387
+ } from "./cli-eddnyg3t.js";
384
388
  import {
385
389
  slackCode,
386
390
  slackMissingScopeMessage,
@@ -389,7 +393,7 @@ import {
389
393
  externalChannelToolError2,
390
394
  getChannelBlockReason2,
391
395
  init_external_channel
392
- } from "./cli-rtt8g4v9.js";
396
+ } from "./cli-qmd3mse0.js";
393
397
  import {
394
398
  noteSlackInboundSideEffect,
395
399
  init_inbound_dispatch,
@@ -397,6 +401,8 @@ import {
397
401
  init_reaction_events,
398
402
  withSpan2,
399
403
  init_otel,
404
+ finalizeTerminalSlackReactions,
405
+ init_ack,
400
406
  getTaskLink,
401
407
  getTaskUrl,
402
408
  markdownToSlack,
@@ -424,7 +430,7 @@ import {
424
430
  startSlackApp2,
425
431
  stopSlackApp2,
426
432
  init_app3
427
- } from "./cli-cppkf404.js";
433
+ } from "./cli-605nn699.js";
428
434
  import {
429
435
  shapeApprovalResolution,
430
436
  init_approval_resolution,
@@ -448,7 +454,7 @@ import {
448
454
  resumeFromChildRun2,
449
455
  initWaitBusSubscriptions2,
450
456
  init_resume
451
- } from "./cli-afkqkrtw.js";
457
+ } from "./cli-sya22y84.js";
452
458
  import {
453
459
  FilesError,
454
460
  providerPath,
@@ -462,7 +468,7 @@ import {
462
468
  import {
463
469
  getRuntimePool2,
464
470
  init_db2
465
- } from "./cli-ddaanqkd.js";
471
+ } from "./cli-587857ys.js";
466
472
  import {
467
473
  duplicateGuardedQueryKey,
468
474
  parseQueryParams,
@@ -495,23 +501,23 @@ import {
495
501
  findRoute,
496
502
  route,
497
503
  init_route_def
498
- } from "./cli-8sckt74b.js";
504
+ } from "./cli-y8nbefpb.js";
499
505
  import {
500
506
  COMPOSIO_HTTP_METHODS,
501
507
  executeComposioRequest,
502
508
  composioArgsFromParts,
503
509
  init_composio
504
- } from "./cli-s0qnd4wv.js";
510
+ } from "./cli-28fq781p.js";
505
511
  import {
506
512
  ampPinProviderError,
507
513
  ampPinCatalogError,
508
514
  ampModelError,
509
515
  init_amp_models
510
- } from "./cli-35rsp8ye.js";
516
+ } from "./cli-qkdmz8c8.js";
511
517
  import {
512
518
  object,
513
519
  init_v4_mini
514
- } from "./cli-vf078p3e.js";
520
+ } from "./cli-zfqg6fzn.js";
515
521
  import {
516
522
  addMinutes,
517
523
  init_date_fns
@@ -524,11 +530,11 @@ import {
524
530
  init_types2,
525
531
  LlmRater,
526
532
  init_llm
527
- } from "./cli-rvtm68yy.js";
533
+ } from "./cli-2xv18ywz.js";
528
534
  import {
529
535
  loadModelsDevCache,
530
536
  init_modelsdev_cache
531
- } from "./cli-pc6n7fre.js";
537
+ } from "./cli-a0657jmf.js";
532
538
  import {
533
539
  require_dist2,
534
540
  ConnectionAuthInputSchema,
@@ -607,7 +613,7 @@ import {
607
613
  init_typecheck,
608
614
  parseSkillContent,
609
615
  init_skill_parser
610
- } from "./cli-adeegh7d.js";
616
+ } from "./cli-2ccpqyyf.js";
611
617
  import {
612
618
  detachedProcessGroup,
613
619
  registerProcessGroup,
@@ -622,7 +628,7 @@ import {
622
628
  ensureToken,
623
629
  ensureTokenOrThrow,
624
630
  init_ensure_token
625
- } from "./cli-q3tkegby.js";
631
+ } from "./cli-cseh6f8w.js";
626
632
  import {
627
633
  require_fast_deep_equal
628
634
  } from "./cli-bhp11egn.js";
@@ -717,7 +723,7 @@ import {
717
723
  validateDefinition,
718
724
  applyDefinitionPatch,
719
725
  init_definition2
720
- } from "./cli-nmzhp1b5.js";
726
+ } from "./cli-ejkvvqbe.js";
721
727
  import {
722
728
  isMultiRuntimeEnabled,
723
729
  init_multi_runtime2
@@ -729,7 +735,7 @@ import {
729
735
  } from "./cli-ytyvpye5.js";
730
736
  import {
731
737
  init_v4
732
- } from "./cli-5xaqj21p.js";
738
+ } from "./cli-3kd08rej.js";
733
739
  import {
734
740
  require_dist3
735
741
  } from "./cli-k28wkapa.js";
@@ -738,15 +744,24 @@ import {
738
744
  isSlackLeaveThreadDisabled,
739
745
  leaveSlackThread,
740
746
  init_left_threads
741
- } from "./cli-g08zdaec.js";
747
+ } from "./cli-sgs5k6yd.js";
742
748
  import {
743
749
  publicEndpointSsrfOptions,
744
750
  init_mcp_wrapper
745
- } from "./cli-caj33vcq.js";
751
+ } from "./cli-btf6fw39.js";
746
752
  import {
747
753
  canProvisionKind,
748
754
  init_runtime_providers
749
- } from "./cli-yndmfxb3.js";
755
+ } from "./cli-hxpyc9sn.js";
756
+ import {
757
+ isRbacEnabled,
758
+ decideAdmission,
759
+ grantLeadEquivalence,
760
+ revokeLeadEquivalence,
761
+ init_elevated_agents,
762
+ can,
763
+ init_rbac
764
+ } from "./cli-cyn9v8zr.js";
750
765
  import {
751
766
  findUserById,
752
767
  findUserByExternalId,
@@ -757,20 +772,11 @@ import {
757
772
  findOrCreateUserByEmail,
758
773
  linkIdentity,
759
774
  unlinkIdentity,
760
- resolveUserByToken,
775
+ resolveUserToken,
761
776
  resolveSessionToken,
762
777
  fingerprintApiKey,
763
778
  init_users
764
- } from "./cli-5jnhv72d.js";
765
- import {
766
- isRbacEnabled,
767
- decideAdmission,
768
- grantLeadEquivalence,
769
- revokeLeadEquivalence,
770
- init_elevated_agents,
771
- can,
772
- init_rbac
773
- } from "./cli-tfyyvzx6.js";
779
+ } from "./cli-4t0fmf3z.js";
774
780
  import {
775
781
  normalizeAssetKey,
776
782
  sessionGroupKey,
@@ -786,7 +792,7 @@ import {
786
792
  init_import,
787
793
  $OpenAPIRegistry,
788
794
  $OpenApiGeneratorV31,
789
- init_dist6,
795
+ init_dist7,
790
796
  init_zod_openapi,
791
797
  AssetKeySchema,
792
798
  ModelTierSchema,
@@ -838,7 +844,7 @@ import {
838
844
  KvNamespaceSchema,
839
845
  KvKeySchema,
840
846
  init_types4
841
- } from "./cli-n6bv12jn.js";
847
+ } from "./cli-cvs2r2vq.js";
842
848
  import {
843
849
  generateDefaultClaudeMd2,
844
850
  generateDefaultSoulMd2,
@@ -849,7 +855,7 @@ import {
849
855
  init_task_attachment_links,
850
856
  contentSha256,
851
857
  init_profile_sync
852
- } from "./cli-tgrv9cjx.js";
858
+ } from "./cli-9r5gtwjr.js";
853
859
  import {
854
860
  getSlackConfiguration,
855
861
  init_config4
@@ -861,7 +867,7 @@ import {
861
867
  import {
862
868
  selectCredential,
863
869
  init_credentials2
864
- } from "./cli-g83s9ewh.js";
870
+ } from "./cli-xfjrc279.js";
865
871
  import {
866
872
  findInterpolationTokens,
867
873
  interpolate,
@@ -871,10 +877,10 @@ import {
871
877
  init_registry3,
872
878
  resolveTemplate,
873
879
  init_resolver
874
- } from "./cli-cm5yqn35.js";
880
+ } from "./cli-kf3pxxdg.js";
875
881
  import {
876
882
  init_zod
877
- } from "./cli-k5671be5.js";
883
+ } from "./cli-zcfpsfzf.js";
878
884
  import {
879
885
  safeParse,
880
886
  safeParseAsync,
@@ -889,7 +895,7 @@ import {
889
895
  array2,
890
896
  object2,
891
897
  looseObject,
892
- union2,
898
+ union3,
893
899
  discriminatedUnion,
894
900
  intersection,
895
901
  record2,
@@ -902,11 +908,11 @@ import {
902
908
  ZodIssueCode,
903
909
  datetime,
904
910
  number3
905
- } from "./cli-agfm16v9.js";
911
+ } from "./cli-hg42n3hx.js";
906
912
  import {
907
913
  init_package,
908
914
  package_default
909
- } from "./cli-6pfd54vx.js";
915
+ } from "./cli-650zv9q9.js";
910
916
  import {
911
917
  realtimeBus,
912
918
  init_bus
@@ -938,15 +944,6 @@ import {
938
944
  getApiKey,
939
945
  init_api_key
940
946
  } from "./cli-pax9q4ff.js";
941
- import {
942
- scrubSecrets,
943
- scrubObject,
944
- createValueScrubber,
945
- refreshSecretScrubberCache,
946
- registerVolatileSecret,
947
- registerSensitiveKeyName,
948
- init_secret_scrubber
949
- } from "./cli-1b7btd38.js";
950
947
  import {
951
948
  chatgptSubscriptionModelId,
952
949
  isAlias,
@@ -960,8 +957,15 @@ import {
960
957
  harnessModelMismatch,
961
958
  openAICompatibleProviderIds,
962
959
  claudeCatalogModelId,
963
- init_src2
964
- } from "./cli-5c4hjzne.js";
960
+ init_src2,
961
+ scrubSecrets,
962
+ scrubObject,
963
+ createValueScrubber,
964
+ refreshSecretScrubberCache,
965
+ registerVolatileSecret,
966
+ registerSensitiveKeyName,
967
+ init_secret_scrubber
968
+ } from "./cli-d84byzn8.js";
965
969
  import {
966
970
  __toESM,
967
971
  __commonJS,
@@ -1152,7 +1156,7 @@ var init_types = __esm(() => {
1152
1156
  init_v4();
1153
1157
  SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
1154
1158
  AssertObjectSchema = custom((v) => v !== null && (typeof v === "object" || typeof v === "function"));
1155
- ProgressTokenSchema = union2([string2(), number2().int()]);
1159
+ ProgressTokenSchema = union3([string2(), number2().int()]);
1156
1160
  CursorSchema = string2();
1157
1161
  TaskCreationParamsSchema = looseObject({
1158
1162
  ttl: number2().optional(),
@@ -1188,7 +1192,7 @@ var init_types = __esm(() => {
1188
1192
  ResultSchema = looseObject({
1189
1193
  _meta: RequestMetaSchema.optional()
1190
1194
  });
1191
- RequestIdSchema = union2([string2(), number2().int()]);
1195
+ RequestIdSchema = union3([string2(), number2().int()]);
1192
1196
  JSONRPCRequestSchema = object2({
1193
1197
  jsonrpc: literal2(JSONRPC_VERSION),
1194
1198
  id: RequestIdSchema,
@@ -1222,13 +1226,13 @@ var init_types = __esm(() => {
1222
1226
  data: unknown().optional()
1223
1227
  })
1224
1228
  }).strict();
1225
- JSONRPCMessageSchema = union2([
1229
+ JSONRPCMessageSchema = union3([
1226
1230
  JSONRPCRequestSchema,
1227
1231
  JSONRPCNotificationSchema,
1228
1232
  JSONRPCResultResponseSchema,
1229
1233
  JSONRPCErrorResponseSchema
1230
1234
  ]);
1231
- JSONRPCResponseSchema = union2([JSONRPCResultResponseSchema, JSONRPCErrorResponseSchema]);
1235
+ JSONRPCResponseSchema = union3([JSONRPCResultResponseSchema, JSONRPCErrorResponseSchema]);
1232
1236
  EmptyResultSchema = ResultSchema.strict();
1233
1237
  CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({
1234
1238
  requestId: RequestIdSchema.optional(),
@@ -1373,7 +1377,7 @@ var init_types = __esm(() => {
1373
1377
  TaskSchema = object2({
1374
1378
  taskId: string2(),
1375
1379
  status: TaskStatusSchema,
1376
- ttl: union2([number2(), _null()]),
1380
+ ttl: union3([number2(), _null()]),
1377
1381
  createdAt: string2(),
1378
1382
  lastUpdatedAt: string2(),
1379
1383
  pollInterval: optional2(number2()),
@@ -1479,7 +1483,7 @@ var init_types = __esm(() => {
1479
1483
  params: ReadResourceRequestParamsSchema
1480
1484
  });
1481
1485
  ReadResourceResultSchema = ResultSchema.extend({
1482
- contents: array2(union2([TextResourceContentsSchema, BlobResourceContentsSchema]))
1486
+ contents: array2(union3([TextResourceContentsSchema, BlobResourceContentsSchema]))
1483
1487
  });
1484
1488
  ResourceListChangedNotificationSchema = NotificationSchema.extend({
1485
1489
  method: literal2("notifications/resources/list_changed"),
@@ -1557,14 +1561,14 @@ var init_types = __esm(() => {
1557
1561
  });
1558
1562
  EmbeddedResourceSchema = object2({
1559
1563
  type: literal2("resource"),
1560
- resource: union2([TextResourceContentsSchema, BlobResourceContentsSchema]),
1564
+ resource: union3([TextResourceContentsSchema, BlobResourceContentsSchema]),
1561
1565
  annotations: AnnotationsSchema.optional(),
1562
1566
  _meta: record2(string2(), unknown()).optional()
1563
1567
  });
1564
1568
  ResourceLinkSchema = ResourceSchema.extend({
1565
1569
  type: literal2("resource_link")
1566
1570
  });
1567
- ContentBlockSchema = union2([
1571
+ ContentBlockSchema = union3([
1568
1572
  TextContentSchema,
1569
1573
  ImageContentSchema,
1570
1574
  AudioContentSchema,
@@ -1688,7 +1692,7 @@ var init_types = __esm(() => {
1688
1692
  ]);
1689
1693
  SamplingMessageSchema = object2({
1690
1694
  role: RoleSchema,
1691
- content: union2([SamplingMessageContentBlockSchema, array2(SamplingMessageContentBlockSchema)]),
1695
+ content: union3([SamplingMessageContentBlockSchema, array2(SamplingMessageContentBlockSchema)]),
1692
1696
  _meta: record2(string2(), unknown()).optional()
1693
1697
  });
1694
1698
  CreateMessageRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
@@ -1717,7 +1721,7 @@ var init_types = __esm(() => {
1717
1721
  model: string2(),
1718
1722
  stopReason: optional2(_enum2(["endTurn", "stopSequence", "maxTokens", "toolUse"]).or(string2())),
1719
1723
  role: RoleSchema,
1720
- content: union2([SamplingMessageContentBlockSchema, array2(SamplingMessageContentBlockSchema)])
1724
+ content: union3([SamplingMessageContentBlockSchema, array2(SamplingMessageContentBlockSchema)])
1721
1725
  });
1722
1726
  BooleanSchemaSchema = object2({
1723
1727
  type: literal2("boolean"),
@@ -1767,7 +1771,7 @@ var init_types = __esm(() => {
1767
1771
  enumNames: array2(string2()).optional(),
1768
1772
  default: string2().optional()
1769
1773
  });
1770
- SingleSelectEnumSchemaSchema = union2([UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema]);
1774
+ SingleSelectEnumSchemaSchema = union3([UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema]);
1771
1775
  UntitledMultiSelectEnumSchemaSchema = object2({
1772
1776
  type: literal2("array"),
1773
1777
  title: string2().optional(),
@@ -1794,9 +1798,9 @@ var init_types = __esm(() => {
1794
1798
  }),
1795
1799
  default: array2(string2()).optional()
1796
1800
  });
1797
- MultiSelectEnumSchemaSchema = union2([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]);
1798
- EnumSchemaSchema = union2([LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema]);
1799
- PrimitiveSchemaDefinitionSchema = union2([EnumSchemaSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema]);
1801
+ MultiSelectEnumSchemaSchema = union3([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]);
1802
+ EnumSchemaSchema = union3([LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema]);
1803
+ PrimitiveSchemaDefinitionSchema = union3([EnumSchemaSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema]);
1800
1804
  ElicitRequestFormParamsSchema = TaskAugmentedRequestParamsSchema.extend({
1801
1805
  mode: literal2("form").optional(),
1802
1806
  message: string2(),
@@ -1812,7 +1816,7 @@ var init_types = __esm(() => {
1812
1816
  elicitationId: string2(),
1813
1817
  url: string2().url()
1814
1818
  });
1815
- ElicitRequestParamsSchema = union2([ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema]);
1819
+ ElicitRequestParamsSchema = union3([ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema]);
1816
1820
  ElicitRequestSchema = RequestSchema.extend({
1817
1821
  method: literal2("elicitation/create"),
1818
1822
  params: ElicitRequestParamsSchema
@@ -1826,7 +1830,7 @@ var init_types = __esm(() => {
1826
1830
  });
1827
1831
  ElicitResultSchema = ResultSchema.extend({
1828
1832
  action: _enum2(["accept", "decline", "cancel"]),
1829
- content: preprocess((val) => val === null ? undefined : val, record2(string2(), union2([string2(), number2(), boolean(), array2(string2())])).optional())
1833
+ content: preprocess((val) => val === null ? undefined : val, record2(string2(), union3([string2(), number2(), boolean(), array2(string2())])).optional())
1830
1834
  });
1831
1835
  ResourceTemplateReferenceSchema = object2({
1832
1836
  type: literal2("ref/resource"),
@@ -1837,7 +1841,7 @@ var init_types = __esm(() => {
1837
1841
  name: string2()
1838
1842
  });
1839
1843
  CompleteRequestParamsSchema = BaseRequestParamsSchema.extend({
1840
- ref: union2([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
1844
+ ref: union3([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
1841
1845
  argument: object2({
1842
1846
  name: string2(),
1843
1847
  value: string2()
@@ -1873,7 +1877,7 @@ var init_types = __esm(() => {
1873
1877
  method: literal2("notifications/roots/list_changed"),
1874
1878
  params: NotificationsParamsSchema.optional()
1875
1879
  });
1876
- ClientRequestSchema = union2([
1880
+ ClientRequestSchema = union3([
1877
1881
  PingRequestSchema,
1878
1882
  InitializeRequestSchema,
1879
1883
  CompleteRequestSchema,
@@ -1892,14 +1896,14 @@ var init_types = __esm(() => {
1892
1896
  ListTasksRequestSchema,
1893
1897
  CancelTaskRequestSchema
1894
1898
  ]);
1895
- ClientNotificationSchema = union2([
1899
+ ClientNotificationSchema = union3([
1896
1900
  CancelledNotificationSchema,
1897
1901
  ProgressNotificationSchema,
1898
1902
  InitializedNotificationSchema,
1899
1903
  RootsListChangedNotificationSchema,
1900
1904
  TaskStatusNotificationSchema
1901
1905
  ]);
1902
- ClientResultSchema = union2([
1906
+ ClientResultSchema = union3([
1903
1907
  EmptyResultSchema,
1904
1908
  CreateMessageResultSchema,
1905
1909
  CreateMessageResultWithToolsSchema,
@@ -1909,7 +1913,7 @@ var init_types = __esm(() => {
1909
1913
  ListTasksResultSchema,
1910
1914
  CreateTaskResultSchema
1911
1915
  ]);
1912
- ServerRequestSchema = union2([
1916
+ ServerRequestSchema = union3([
1913
1917
  PingRequestSchema,
1914
1918
  CreateMessageRequestSchema,
1915
1919
  ElicitRequestSchema,
@@ -1919,7 +1923,7 @@ var init_types = __esm(() => {
1919
1923
  ListTasksRequestSchema,
1920
1924
  CancelTaskRequestSchema
1921
1925
  ]);
1922
- ServerNotificationSchema = union2([
1926
+ ServerNotificationSchema = union3([
1923
1927
  CancelledNotificationSchema,
1924
1928
  ProgressNotificationSchema,
1925
1929
  LoggingMessageNotificationSchema,
@@ -1930,7 +1934,7 @@ var init_types = __esm(() => {
1930
1934
  TaskStatusNotificationSchema,
1931
1935
  ElicitationCompleteNotificationSchema
1932
1936
  ]);
1933
- ServerResultSchema = union2([
1937
+ ServerResultSchema = union3([
1934
1938
  EmptyResultSchema,
1935
1939
  InitializeResultSchema,
1936
1940
  CompleteResultSchema,
@@ -20350,6 +20354,12 @@ function isKnownCatalogModel(model, catalog) {
20350
20354
  const anthropic = catalog.anthropic?.models;
20351
20355
  return Object.hasOwn(buildClaudeShortnameMap(anthropic), id);
20352
20356
  }
20357
+ function claudeShortnameToCatalogId(model, catalog) {
20358
+ const anthropic = catalog.anthropic?.models;
20359
+ const shortnames = buildClaudeShortnameMap(anthropic);
20360
+ const bare = model.replace(CONTEXT_SUFFIX_RE, "");
20361
+ return Object.hasOwn(shortnames, bare) ? shortnames[bare] : model;
20362
+ }
20353
20363
  async function harnessModelErrorFor(model, harness) {
20354
20364
  const { providers } = await loadModelsCatalog();
20355
20365
  return harnessModelMismatch(model, harness, providers, {});
@@ -20381,7 +20391,8 @@ async function explicitModelError(check) {
20381
20391
  const { providers } = await loadModelsCatalog();
20382
20392
  const catalog = providers;
20383
20393
  if (check.harnessProvider) {
20384
- const mismatch = harnessModelMismatch(model, check.harnessProvider, catalog, { agentId: check.agentId, agentName: check.agentName });
20394
+ const harnessModel = harnessCatalogSection(check.harnessProvider) === "anthropic" ? model : claudeShortnameToCatalogId(model, catalog);
20395
+ const mismatch = harnessModelMismatch(harnessModel, check.harnessProvider, catalog, { agentId: check.agentId, agentName: check.agentName });
20385
20396
  if (mismatch)
20386
20397
  return mismatch;
20387
20398
  }
@@ -20623,6 +20634,13 @@ async function completeIfSettled(runId, ctx) {
20623
20634
  return true;
20624
20635
  });
20625
20636
  }
20637
+ function recoveredTaskReason(taskStatus) {
20638
+ if (taskStatus === "failed")
20639
+ return "Task failed (recovered)";
20640
+ if (taskStatus === "skipped")
20641
+ return "Task skipped (recovered)";
20642
+ return "Task cancelled (recovered)";
20643
+ }
20626
20644
  async function recoverWaitingRuns(registry) {
20627
20645
  const stuckRuns = await getStuckWorkflowRuns2();
20628
20646
  let recovered = 0;
@@ -20644,7 +20662,7 @@ async function recoverWaitingRuns(registry) {
20644
20662
  continue;
20645
20663
  }
20646
20664
  if (!taskCompleted && stepFailureMode(workflow.definition, stuck.nodeId) === "fail") {
20647
- const reason = stuck.taskStatus === "failed" ? "Task failed (recovered)" : "Task cancelled (recovered)";
20665
+ const reason = recoveredTaskReason(stuck.taskStatus);
20648
20666
  const failed = await failStepAndRunIfWaiting(workflow.definition, stuck.stepId, stuck.runId, reason, stuck.taskId, { registry });
20649
20667
  if (!failed.claimed)
20650
20668
  continue;
@@ -20652,7 +20670,7 @@ async function recoverWaitingRuns(registry) {
20652
20670
  continue;
20653
20671
  }
20654
20672
  const ctx = run.context ?? {};
20655
- const reason = stuck.taskStatus === "failed" ? "Task failed (recovered)" : "Task cancelled (recovered)";
20673
+ const reason = recoveredTaskReason(stuck.taskStatus);
20656
20674
  const stepOutput = {
20657
20675
  taskId: stuck.taskId,
20658
20676
  taskOutput: taskCompleted ? parseRecoveredTaskOutput(stuck.taskOutput) : `${FAILED_TASK_OUTPUT_PREFIX} ${reason}] This node failed or was cancelled.`
@@ -20889,7 +20907,7 @@ function startRetryPoller(registry, intervalMs = 5000) {
20889
20907
  if (!waiting)
20890
20908
  continue;
20891
20909
  if (result.waitFor === "workflow.child.finished") {
20892
- const { resumeFromChildRun } = await import("./resume-adda0bwy.js");
20910
+ const { resumeFromChildRun } = await import("./resume-x94gemep.js");
20893
20911
  await resumeFromChildRun(step.id, registry);
20894
20912
  }
20895
20913
  } else {
@@ -21602,7 +21620,7 @@ var init_notify = __esm(() => {
21602
21620
  }
21603
21621
  }
21604
21622
  case "slack": {
21605
- const { getSlackApp } = await import("./app-nky4378f.js");
21623
+ const { getSlackApp } = await import("./app-a66ssc4k.js");
21606
21624
  const app = getSlackApp();
21607
21625
  if (!app) {
21608
21626
  return {
@@ -21720,7 +21738,7 @@ var init_property_match = __esm(() => {
21720
21738
  async function executeRawLlm(config) {
21721
21739
  let modelName = config.model ?? "google/gemini-3-flash-preview";
21722
21740
  try {
21723
- const { createOpenAI } = await import("./index-h39zbx67.js");
21741
+ const { createOpenAI } = await import("./index-hsad2t3r.js");
21724
21742
  const llmConfig = await resolveWorkflowLlmConfig(config.model);
21725
21743
  modelName = llmConfig.model;
21726
21744
  const provider = createOpenAI({
@@ -21730,7 +21748,7 @@ async function executeRawLlm(config) {
21730
21748
  });
21731
21749
  const model = provider(llmConfig.model);
21732
21750
  if (config.schema) {
21733
- const { generateObject, jsonSchema } = await import("./index-6cxzwfen.js");
21751
+ const { generateObject, jsonSchema } = await import("./index-5a9jtqde.js");
21734
21752
  const { object } = await generateObject({
21735
21753
  model,
21736
21754
  schema: jsonSchema(config.schema),
@@ -21744,7 +21762,7 @@ async function executeRawLlm(config) {
21744
21762
  output: { result: object, model: modelName }
21745
21763
  };
21746
21764
  }
21747
- const { generateText } = await import("./index-6cxzwfen.js");
21765
+ const { generateText } = await import("./index-5a9jtqde.js");
21748
21766
  const { text } = await generateText({
21749
21767
  model,
21750
21768
  prompt: config.prompt
@@ -22301,8 +22319,8 @@ var init_validate2 = __esm(() => {
22301
22319
  const interpolatedPrompt = this.deps.interpolate(prompt, context);
22302
22320
  const outputStr = typeof targetOutput === "string" ? targetOutput : JSON.stringify(targetOutput);
22303
22321
  try {
22304
- const { createOpenAI } = await import("./index-h39zbx67.js");
22305
- const { generateObject, jsonSchema } = await import("./index-6cxzwfen.js");
22322
+ const { createOpenAI } = await import("./index-hsad2t3r.js");
22323
+ const { generateObject, jsonSchema } = await import("./index-5a9jtqde.js");
22306
22324
  const llmConfig = await resolveWorkflowLlmConfig();
22307
22325
  const provider = createOpenAI({
22308
22326
  baseURL: llmConfig.baseURL,
@@ -22376,7 +22394,7 @@ var init_vcs = __esm(() => {
22376
22394
  });
22377
22395
  VcsOutputSchema = object2({
22378
22396
  url: string2(),
22379
- id: union2([string2(), number2()])
22397
+ id: union3([string2(), number2()])
22380
22398
  });
22381
22399
  VcsExecutor = class VcsExecutor extends BaseExecutor {
22382
22400
  type = "vcs";
@@ -22612,7 +22630,7 @@ async function resolveWaitCause(scheduleId, reason) {
22612
22630
  ) AS deferred
22613
22631
  FROM deferred_task_wait_members m LEFT JOIN agent_tasks t ON t.id = m.taskId
22614
22632
  WHERE m.scheduleId = ?`, [scheduleId]);
22615
- const matched = members.filter((member) => !member.deferred && (member.taskStatus === "completed" || member.taskStatus === "failed" || member.taskStatus === "cancelled") && (wait.eventName === "settled" || wait.eventName === `task.${member.taskStatus}`));
22633
+ const matched = members.filter((member) => !member.deferred && (member.taskStatus === "completed" || member.taskStatus === "failed" || member.taskStatus === "cancelled" || member.taskStatus === "skipped") && (wait.eventName === "settled" || wait.eventName === `task.${member.taskStatus}`));
22616
22634
  if (!matched.length || wait.mode === "all" && matched.length !== members.length)
22617
22635
  return;
22618
22636
  const cause = members.length === 1 ? `task.${matched[0].taskStatus} for task ${matched[0].taskId}` : `${wait.mode} tasks matched ${wait.eventName}: ${matched.map((member) => `${member.taskId} (${member.taskStatus})`).join(", ")}`;
@@ -22727,7 +22745,7 @@ async function reconcileDeferredTaskWaits(taskId) {
22727
22745
  JOIN deferred_task_wait_members m ON m.scheduleId = w.scheduleId
22728
22746
  JOIN agent_tasks t ON t.id = m.taskId
22729
22747
  JOIN scheduled_tasks s ON s.id = w.scheduleId
22730
- WHERE w.status = 'pending' AND s.enabled = 1 AND t.status IN ('completed', 'failed', 'cancelled')
22748
+ WHERE w.status = 'pending' AND s.enabled = 1 AND t.status IN ('completed', 'failed', 'cancelled', 'skipped')
22731
22749
  AND NOT EXISTS (
22732
22750
  SELECT 1 FROM scheduled_tasks d
22733
22751
  WHERE d.parentTaskId = t.id AND d.taskType = 'deferred' AND d.enabled = 1
@@ -22765,6 +22783,7 @@ async function initDeferredTaskWaits() {
22765
22783
  workflowEventBus2.on("task.completed", onTaskEvent);
22766
22784
  workflowEventBus2.on("task.failed", onTaskEvent);
22767
22785
  workflowEventBus2.on("task.cancelled", onTaskEvent);
22786
+ workflowEventBus2.on("task.skipped", onTaskEvent);
22768
22787
  workflowEventBus2.on("task.superseded", onTaskEvent);
22769
22788
  workflowEventBus2.on("task.created", onTaskEvent);
22770
22789
  await reconcileDeferredTaskWaits();
@@ -22773,6 +22792,7 @@ function stopDeferredTaskWaits() {
22773
22792
  workflowEventBus2.off("task.completed", onTaskEvent);
22774
22793
  workflowEventBus2.off("task.failed", onTaskEvent);
22775
22794
  workflowEventBus2.off("task.cancelled", onTaskEvent);
22795
+ workflowEventBus2.off("task.skipped", onTaskEvent);
22776
22796
  workflowEventBus2.off("task.superseded", onTaskEvent);
22777
22797
  workflowEventBus2.off("task.created", onTaskEvent);
22778
22798
  }
@@ -24995,7 +25015,7 @@ function setPreloadedTools(server, names) {
24995
25015
  async function applyPreToolCall(name, args, requestInfo, inputSchema) {
24996
25016
  if (requestInfo.callOrigin !== "mcp")
24997
25017
  return { args };
24998
- const dispatcher = await import("./dispatcher-kh7ecxh9.js");
25018
+ const dispatcher = await import("./dispatcher-j3h81t7m.js");
24999
25019
  const result = await dispatcher.dispatchPre("pre.tool.call", { tool: name, args, requestInfo }, inputSchema ? {
25000
25020
  validateModify: async (data) => {
25001
25021
  const schema = normalizeObjectSchema(inputSchema) ?? inputSchema;
@@ -25632,7 +25652,7 @@ function bridgeRequestFor(name, args) {
25632
25652
  const taskId = typeof body.taskId === "string" ? body.taskId : undefined;
25633
25653
  if (!taskId)
25634
25654
  throw new Error("task_storeProgress requires string `taskId`");
25635
- if (body.status === "completed" || body.status === "failed") {
25655
+ if (body.status === "completed" || body.status === "failed" || body.status === "skipped") {
25636
25656
  return {
25637
25657
  method: "POST",
25638
25658
  path: `/api/tasks/${encodeURIComponent(taskId)}/finish`,
@@ -28370,7 +28390,8 @@ async function updateTrackerSync(id, data) {
28370
28390
  await getDbClient2().run(`UPDATE tracker_sync SET ${sets.join(", ")} WHERE id = ?`, values);
28371
28391
  }
28372
28392
  async function deleteTrackerSync(id) {
28373
- await getDbClient2().run("DELETE FROM tracker_sync WHERE id = ?", [id]);
28393
+ const result = await getDbClient2().run("DELETE FROM tracker_sync WHERE id = ?", [id]);
28394
+ return result.changes > 0;
28374
28395
  }
28375
28396
  async function hasTrackerDelivery(provider, deliveryId) {
28376
28397
  if (!deliveryId)
@@ -35973,7 +35994,7 @@ async function notifySlack(text) {
35973
35994
  return;
35974
35995
  }
35975
35996
  try {
35976
- const { getSlackApp } = await import("./app-nky4378f.js");
35997
+ const { getSlackApp } = await import("./app-a66ssc4k.js");
35977
35998
  const app = getSlackApp();
35978
35999
  if (!app) {
35979
36000
  console.warn("[Jira webhook keepalive] Slack not available, cannot send notification");
@@ -36044,7 +36065,7 @@ async function deleteJiraWebhook(webhookId) {
36044
36065
  console.log(`[Jira webhook keepalive] Deleted webhook id=${webhookId}`);
36045
36066
  }
36046
36067
  async function overwriteWebhookIds(next) {
36047
- const { getDbClient } = await import("./db-vemtpmcc.js");
36068
+ const { getDbClient } = await import("./db-pm96nhdb.js");
36048
36069
  await getDbClient().transaction(async (tx) => {
36049
36070
  const row = await tx.get("SELECT metadata FROM oauth_apps WHERE provider = 'jira'");
36050
36071
  if (!row) {
@@ -109351,9 +109372,10 @@ async function resolveHttpRequestAuth(req, apiKey, options = {}) {
109351
109372
  return { kind: "operator", fingerprint: fingerprintApiKey(bearer) };
109352
109373
  }
109353
109374
  if (bearer.startsWith("aswt_")) {
109354
- const user = await resolveUserByToken(bearer);
109355
- if (isActiveUser(user)) {
109356
- return { kind: "user", userId: user.id, user };
109375
+ const resolved = await resolveUserToken(bearer);
109376
+ const user = resolved?.user ?? null;
109377
+ if (resolved && isActiveUser(user)) {
109378
+ return { kind: "user", userId: user.id, user, tokenId: resolved.tokenId };
109357
109379
  }
109358
109380
  }
109359
109381
  if (bearer.startsWith("aseph_")) {
@@ -109484,7 +109506,7 @@ var ErrorResponseSchema, cachedSpec = null, SCALAR_HTML = `<!DOCTYPE html>
109484
109506
  </body>
109485
109507
  </html>`;
109486
109508
  var init_openapi = __esm(() => {
109487
- init_dist6();
109509
+ init_dist7();
109488
109510
  init_constants3();
109489
109511
  init_zod_openapi();
109490
109512
  init_route_def();
@@ -109538,7 +109560,7 @@ async function reloadGlobalConfigsAndIntegrations() {
109538
109560
  return runWithoutRequestAuth(() => reloadGlobalConfigsAndIntegrationsInner());
109539
109561
  }
109540
109562
  async function reloadGlobalConfigsAndIntegrationsInner() {
109541
- const { getEmbeddingProvider, resetEmbeddingProvider } = await import("./index-e3s8wmxy.js");
109563
+ const { getEmbeddingProvider, resetEmbeddingProvider } = await import("./index-p4hjwbvw.js");
109542
109564
  const wasEmbeddingsConfigured = getEmbeddingProvider().isConfigured();
109543
109565
  const updated = await loadGlobalConfigsIntoEnv(true);
109544
109566
  await syncTelemetryEnabled("settings").catch((err) => {
@@ -109554,7 +109576,7 @@ async function reloadGlobalConfigsAndIntegrationsInner() {
109554
109576
  integrations.push("embeddings");
109555
109577
  }
109556
109578
  if (isEmbeddingsConfigured) {
109557
- import("./embedding-space-0jepb239.js").then(({ runEmbeddingMaintenance }) => runEmbeddingMaintenance({ backfill: !wasEmbeddingsConfigured })).catch((err) => {
109579
+ import("./embedding-space-xh8p4q4x.js").then(({ runEmbeddingMaintenance }) => runEmbeddingMaintenance({ backfill: !wasEmbeddingsConfigured })).catch((err) => {
109558
109580
  console.error("[config-reload] embedding maintenance failed (non-fatal):", err);
109559
109581
  });
109560
109582
  }
@@ -111076,10 +111098,10 @@ var init_sync3 = __esm(() => {
111076
111098
  TransformError = class TransformError extends Error {
111077
111099
  };
111078
111100
  SourceRecordSchema = object2({
111079
- key: union2([string2().min(1), number2()]).transform(String),
111101
+ key: union3([string2().min(1), number2()]).transform(String),
111080
111102
  fields: record2(string2(), unknown())
111081
111103
  });
111082
- PullPayloadSchema = union2([
111104
+ PullPayloadSchema = union3([
111083
111105
  array2(SourceRecordSchema),
111084
111106
  object2({ records: array2(SourceRecordSchema), complete: boolean().optional() })
111085
111107
  ]);
@@ -111903,14 +111925,14 @@ var init_schema_migrate = __esm(() => {
111903
111925
  init_format_upgrades();
111904
111926
  init_row_store();
111905
111927
  init_sync3();
111906
- MigrationValueSchema = union2([
111928
+ MigrationValueSchema = union3([
111907
111929
  string2(),
111908
111930
  number2(),
111909
111931
  boolean(),
111910
111932
  record2(string2(), unknown()),
111911
111933
  array2(unknown())
111912
111934
  ]);
111913
- AppMigrationDirectiveSchema = union2([
111935
+ AppMigrationDirectiveSchema = union3([
111914
111936
  object2({ set: MigrationValueSchema }).strict(),
111915
111937
  object2({
111916
111938
  from: AppNameSchema,
@@ -113388,7 +113410,7 @@ var init_apps = __esm(() => {
113388
113410
  });
113389
113411
  valuesSchema = record2(string2(), unknown());
113390
113412
  AppValidationIssueSchema = object2({ path: string2(), message: string2() });
113391
- JsonValueSchema = union2([
113413
+ JsonValueSchema = union3([
113392
113414
  record2(string2(), unknown()),
113393
113415
  array2(unknown()),
113394
113416
  string2(),
@@ -113455,10 +113477,10 @@ var init_apps = __esm(() => {
113455
113477
  markedStale: number2(),
113456
113478
  error: string2().optional()
113457
113479
  });
113458
- UserConfigValuesSchema = record2(string2(), union2([string2(), number2(), boolean(), _null()]));
113480
+ UserConfigValuesSchema = record2(string2(), union3([string2(), number2(), boolean(), _null()]));
113459
113481
  AppUserConfigFieldSchema = object2({
113460
113482
  kind: ScalarColumnKindSchema,
113461
- default: union2([string2(), number2(), boolean()]).optional(),
113483
+ default: union3([string2(), number2(), boolean()]).optional(),
113462
113484
  enum: array2(string2()).optional(),
113463
113485
  label: string2().optional()
113464
113486
  });
@@ -113812,7 +113834,7 @@ var init_apps = __esm(() => {
113812
113834
  error: string2().optional(),
113813
113835
  durationMs: number2()
113814
113836
  });
113815
- runActionResultSchema = union2([
113837
+ runActionResultSchema = union3([
113816
113838
  runActionScriptResultSchema,
113817
113839
  runActionTaskResultSchema,
113818
113840
  runActionSyncResultSchema
@@ -113936,7 +113958,7 @@ ${JSON.stringify(syncStatus, null, 2)}` : JSON.stringify(app, null, 2);
113936
113958
  inputSchema: object2({
113937
113959
  appId: string2().min(1).describe("App ID containing the named query."),
113938
113960
  query: string2().min(1).describe("Declared query name."),
113939
- params: record2(string2(), union2([string2(), number2(), boolean()])).optional().describe("Values for any $param filters declared by the named query.")
113961
+ params: record2(string2(), union3([string2(), number2(), boolean()])).optional().describe("Values for any $param filters declared by the named query.")
113940
113962
  }),
113941
113963
  outputSchema: swarmToolOutputSchema({
113942
113964
  rows: array2(looseObject({})).optional(),
@@ -114458,7 +114480,7 @@ var init_app_rows = __esm(() => {
114458
114480
  base = { appId: string2().min(1), model: AppNameSchema };
114459
114481
  rowId = string2().min(1);
114460
114482
  values = record2(string2(), unknown());
114461
- equals = record2(string2(), union2([string2(), number2(), boolean()]));
114483
+ equals = record2(string2(), union3([string2(), number2(), boolean()]));
114462
114484
  limit = number2().int().min(1).max(1000);
114463
114485
  rowOutput = { row: looseObject({}).optional() };
114464
114486
  rowsOutput = { rows: array2(looseObject({})).optional() };
@@ -115590,7 +115612,7 @@ var ChannelOutputSchema, registerCreateChannelTool = (server) => {
115590
115612
  });
115591
115613
  }
115592
115614
  try {
115593
- const channel = createChannel2(name, {
115615
+ const channel = await createChannel2(name, {
115594
115616
  description,
115595
115617
  type: type ?? "public",
115596
115618
  createdBy: requestInfo.agentId,
@@ -119894,7 +119916,7 @@ var init_task_terminal_effects = __esm(() => {
119894
119916
 
119895
119917
  // src/tasks/terminal-result-guard.ts
119896
119918
  function getTaskOutputValidationError(outputSchema, output) {
119897
- if (!outputSchema || typeof outputSchema !== "object")
119919
+ if (!isEffectiveOutputSchema(outputSchema))
119898
119920
  return;
119899
119921
  const schema = outputSchema;
119900
119922
  if (!output) {
@@ -119980,6 +120002,7 @@ async function guardTerminalTaskResultWrite(task, write) {
119980
120002
  var init_terminal_result_guard = __esm(() => {
119981
120003
  init_db4();
119982
120004
  init_types4();
120005
+ init_output_schema();
119983
120006
  init_secret_scrubber();
119984
120007
  init_json_schema_validator();
119985
120008
  });
@@ -120081,7 +120104,7 @@ var DeferAbortedError, registerDeferTaskTool = (server) => {
120081
120104
  message: "Provide exactly one of wakeOn.taskId or wakeOn.taskIds."
120082
120105
  }).refine((wake) => !wake.taskIds || new Set(wake.taskIds).size === wake.taskIds.length, {
120083
120106
  message: "wakeOn.taskIds must not contain duplicates."
120084
- }).optional().describe("Wake early on a task event. Provide taskId or nonempty, unique taskIds. mode defaults to all (every member must match); any wakes on the first match. settled covers completed, failed, or cancelled. Deferred and superseded members follow their continuations; a superseded member without a resume child holds to the ceiling. Any already-terminal member rejects the request; one delayMs/runAt ceiling is still required for the whole set. The member whose settlement wakes you creates no separate lead follow-up for your agent unless its followUpConfig sets onCompleted/onFailed; an all-mode member that settles while others are pending still does."),
120107
+ }).optional().describe("Wake early on a task event. Provide taskId or nonempty, unique taskIds. mode defaults to all (every member must match); any wakes on the first match. settled covers completed, failed, cancelled, or skipped. Deferred and superseded members follow their continuations; a superseded member without a resume child holds to the ceiling. Any already-terminal member rejects the request; one delayMs/runAt ceiling is still required for the whole set. The member whose settlement wakes you creates no separate lead follow-up for your agent unless its followUpConfig sets onCompleted/onFailed; an all-mode member that settles while others are pending still does."),
120085
120108
  summary: string2().min(1).max(4000).describe("What you did so far and where things stand. Stored in the task log for tasks with an outputSchema; otherwise becomes the task's output."),
120086
120109
  output: string2().optional().describe("Required when the task has an outputSchema: a JSON string matching that schema, stored verbatim as terminal output. Ignored for tasks without an outputSchema."),
120087
120110
  note: string2().min(1).max(2000).describe("What is pending, and what to check on wake-up."),
@@ -122016,21 +122039,25 @@ var userOutputShape, IdentityEntry, InputSchema, registerManageUserTool = (serve
122016
122039
  }
122017
122040
  try {
122018
122041
  const metadata = mergeComms(input.metadata, input.comms) ?? undefined;
122019
- const user = await createUser2({
122020
- name: input.name,
122021
- email: input.email,
122022
- role: input.role,
122023
- notes: input.notes,
122024
- emailAliases: input.emailAliases,
122025
- preferredChannel: input.preferredChannel,
122026
- timezone: input.timezone,
122027
- dailyBudgetUsd: input.dailyBudgetUsd ?? undefined,
122028
- status: input.status,
122029
- metadata
122042
+ const name = input.name;
122043
+ const user = await getDbClient2().transaction(async () => {
122044
+ const created = await createUser2({
122045
+ name,
122046
+ email: input.email,
122047
+ role: input.role,
122048
+ notes: input.notes,
122049
+ emailAliases: input.emailAliases,
122050
+ preferredChannel: input.preferredChannel,
122051
+ timezone: input.timezone,
122052
+ dailyBudgetUsd: input.dailyBudgetUsd ?? undefined,
122053
+ status: input.status,
122054
+ metadata
122055
+ });
122056
+ for (const ident of input.identities ?? []) {
122057
+ await linkIdentity(created.id, ident.kind, ident.externalId, operatorActor);
122058
+ }
122059
+ return created;
122030
122060
  });
122031
- for (const ident of input.identities ?? []) {
122032
- await linkIdentity(user.id, ident.kind, ident.externalId, operatorActor);
122033
- }
122034
122061
  return toolOk(`User created: "${user.name}" (${user.id}).`, {
122035
122062
  details: JSON.stringify(user, null, 2),
122036
122063
  data: { user }
@@ -122050,46 +122077,56 @@ var userOutputShape, IdentityEntry, InputSchema, registerManageUserTool = (serve
122050
122077
  return toolErr(`User ${input.userId} not found.`);
122051
122078
  }
122052
122079
  const metadata = mergeComms(input.comms !== undefined && input.metadata === undefined ? before.metadata : input.metadata, input.comms);
122053
- const user = await updateUser2(input.userId, {
122054
- name: input.name,
122055
- email: input.email,
122056
- role: input.role,
122057
- notes: input.notes,
122058
- emailAliases: input.emailAliases,
122059
- preferredChannel: input.preferredChannel,
122060
- timezone: input.timezone,
122061
- dailyBudgetUsd: input.dailyBudgetUsd,
122062
- status: input.status,
122063
- metadata
122064
- });
122065
- if (!user) {
122066
- return toolErr(`User ${input.userId} not found.`);
122067
- }
122068
- if (input.identities !== undefined) {
122069
- const current = await getUserIdentities(input.userId);
122070
- const currentSet = new Set(current.map((i) => `${i.kind}:${i.externalId}`));
122071
- const desiredSet = new Set(input.identities.map((i) => `${i.kind}:${i.externalId}`));
122072
- for (const ident of input.identities) {
122073
- if (!currentSet.has(`${ident.kind}:${ident.externalId}`)) {
122074
- await linkIdentity(input.userId, ident.kind, ident.externalId, operatorActor);
122075
- }
122080
+ const userId = input.userId;
122081
+ const bindsIdentity = input.identities !== undefined || input.email !== undefined || input.emailAliases !== undefined;
122082
+ const user = await getDbClient2().transaction(async () => {
122083
+ if (bindsIdentity) {
122084
+ await assertMayActOnOperatorGrantedTarget2({ kind: "agent", id: callerAgent.id }, userId);
122076
122085
  }
122077
- for (const ident of current) {
122078
- if (!desiredSet.has(`${ident.kind}:${ident.externalId}`)) {
122079
- await unlinkIdentity(input.userId, ident.kind, ident.externalId, operatorActor);
122086
+ const updated = await updateUser2(userId, {
122087
+ name: input.name,
122088
+ email: input.email,
122089
+ role: input.role,
122090
+ notes: input.notes,
122091
+ emailAliases: input.emailAliases,
122092
+ preferredChannel: input.preferredChannel,
122093
+ timezone: input.timezone,
122094
+ dailyBudgetUsd: input.dailyBudgetUsd,
122095
+ status: input.status,
122096
+ metadata
122097
+ });
122098
+ if (!updated)
122099
+ return null;
122100
+ if (input.identities !== undefined) {
122101
+ const current = await getUserIdentities(userId);
122102
+ const currentSet = new Set(current.map((i) => `${i.kind}:${i.externalId}`));
122103
+ const desiredSet = new Set(input.identities.map((i) => `${i.kind}:${i.externalId}`));
122104
+ for (const ident of input.identities) {
122105
+ if (!currentSet.has(`${ident.kind}:${ident.externalId}`)) {
122106
+ await linkIdentity(userId, ident.kind, ident.externalId, operatorActor);
122107
+ }
122108
+ }
122109
+ for (const ident of current) {
122110
+ if (!desiredSet.has(`${ident.kind}:${ident.externalId}`)) {
122111
+ await unlinkIdentity(userId, ident.kind, ident.externalId, operatorActor);
122112
+ }
122080
122113
  }
122081
122114
  }
122082
- }
122083
- if (input.emailAliases !== undefined) {
122084
- const { added, removed } = diffAliases(before.emailAliases, input.emailAliases);
122085
- for (const alias of added) {
122086
- await recordIdentityEvent(input.userId, "email_added", operatorActor, null, {
122087
- alias
122088
- });
122089
- }
122090
- for (const alias of removed) {
122091
- await recordIdentityEvent(input.userId, "email_removed", operatorActor, { alias }, null);
122115
+ if (input.emailAliases !== undefined) {
122116
+ const { added, removed } = diffAliases(before.emailAliases, input.emailAliases);
122117
+ for (const alias of added) {
122118
+ await recordIdentityEvent(userId, "email_added", operatorActor, null, {
122119
+ alias
122120
+ });
122121
+ }
122122
+ for (const alias of removed) {
122123
+ await recordIdentityEvent(userId, "email_removed", operatorActor, { alias }, null);
122124
+ }
122092
122125
  }
122126
+ return updated;
122127
+ });
122128
+ if (!user) {
122129
+ return toolErr(`User ${input.userId} not found.`);
122093
122130
  }
122094
122131
  return toolOk(`User updated: "${user.name}" (${user.id}).`, {
122095
122132
  details: JSON.stringify(user, null, 2),
@@ -122115,6 +122152,7 @@ var userOutputShape, IdentityEntry, InputSchema, registerManageUserTool = (serve
122115
122152
  var init_manage_user = __esm(() => {
122116
122153
  init_zod();
122117
122154
  init_db4();
122155
+ init_rbac_roles();
122118
122156
  init_users();
122119
122157
  init_rbac();
122120
122158
  init_utils();
@@ -123454,7 +123492,7 @@ var registerMemoryStoreTool = (server) => {
123454
123492
  content: string2().min(1).describe("The memory body. Markdown is fine. State the fact, the context it applies to, and the evidence."),
123455
123493
  name: string2().min(1).max(200).optional().describe("Short title used in search results and the UI. Defaults to the first non-empty content line (up to 200 characters). A name that starts with /longterm/ is also used as the key when no key is given."),
123456
123494
  scope: AgentMemoryScopeSchema.default("agent").describe("'agent' (default): only you can recall it. 'swarm': every agent can recall it."),
123457
- tags: union2([array2(string2()), string2()]).optional().describe("Free-form tags as an array or a comma-separated string, for example a repo name or a topic."),
123495
+ tags: union3([array2(string2()), string2()]).optional().describe("Free-form tags as an array or a comma-separated string, for example a repo name or a topic."),
123458
123496
  taskId: uuid().optional().describe("The task this learning came from, when there is one."),
123459
123497
  intent: string2().min(1).optional().describe("Why this is worth remembering. Kept in the audit trail."),
123460
123498
  key: string2().max(MEMORY_KEY_MAX_LENGTH).regex(MEMORY_KEY_PATTERN, MEMORY_KEY_PATTERN_MESSAGE).optional().describe("Optional logical path for this memory, for example '/longterm/facts/swarm-runtime/sqlite-busy-retry'. Lowercase segments joined by '/', starting with '/'. Search it with memory-search keyPrefix and move it with memory-edit newKey. Fails when you already have a memory with this key in this scope. A key under /longterm marks the memory as curated: it never expires and is protected from cleanup. It must start with /longterm/company-story, /longterm/entities/people, /longterm/entities/customers, /longterm/facts, /longterm/decisions, /longterm/workstreams or /longterm/timeline. Paths under /longterm/company-story, /longterm/entities and /longterm/timeline are lead-only. Defaults to an auto key, which makes the memory inbox material.")
@@ -124659,6 +124697,11 @@ ${mappings.map((m) => ` - ${m.inboxId} (${m.inboxEmail ?? "no email"})`).join(`
124659
124697
  }
124660
124698
  if (action === "register") {
124661
124699
  const mapping = await createAgentMailInboxMapping2(inboxId, requestInfo.agentId, inboxEmail);
124700
+ if (!mapping) {
124701
+ return toolErr(`Inbox ${inboxId} is owned by another agent`, {
124702
+ data: { yourAgentId: requestInfo.agentId }
124703
+ });
124704
+ }
124662
124705
  const text = `Registered inbox ${inboxId} → agent ${agent.name} (${requestInfo.agentId})`;
124663
124706
  return toolOk(text, {
124664
124707
  data: { yourAgentId: requestInfo.agentId, mappings: [mapping] }
@@ -125241,7 +125284,7 @@ var swarmRepoOutputShape2, registerUpdateRepoTool = (server) => {
125241
125284
  clonePath: string2().optional().describe("New clone path."),
125242
125285
  defaultBranch: string2().optional().describe("New default branch."),
125243
125286
  autoClone: boolean().optional().describe("Whether to auto-clone."),
125244
- hooks: RepoHooksSchema.nullable().optional().describe("Repository hook install config. Set { enabled: true } to opt into best-effort worker hook installation, or null to disable."),
125287
+ hooks: RepoHooksSchema.nullable().optional().describe("Repository hook install config. Best-effort worker hook installation is enabled by default for new repos. Disable it with { enabled: false } (or null), or turn it back on with { enabled: true }."),
125245
125288
  guidelines: RepoGuidelinesInputSchema.nullable().optional().describe("Repository guidelines: prChecks (commands before PR), mergeChecks (conditions before merge), allowMerge (default false), review (guidance for reviewers). Pass null to clear.")
125246
125289
  }),
125247
125290
  outputSchema: swarmToolOutputSchema({
@@ -125370,7 +125413,7 @@ var init_request_human_input = __esm(() => {
125370
125413
  id: string2().describe("Unique ID for the question (used as key in responses)"),
125371
125414
  type: _enum2(["approval", "text", "single-select", "multi-select", "boolean", "config"]).describe("Question type"),
125372
125415
  label: string2().optional().describe("The question text displayed to the user (required except for config, which defaults to the key)"),
125373
- required: boolean().optional().describe("Whether this question is required (default: true)"),
125416
+ required: boolean().default(true).describe("Whether this question is required (default: true)"),
125374
125417
  description: string2().optional().describe("Optional help text, rendered as markdown (code fences, images)"),
125375
125418
  placeholder: string2().optional().describe("Placeholder text (for text type)"),
125376
125419
  multiline: boolean().optional().describe("Use textarea instead of input (for text type)"),
@@ -131148,7 +131191,7 @@ var init_document = __esm(() => {
131148
131191
  init_yjs();
131149
131192
  init_zod();
131150
131193
  UNSAFE_KEYS = new Set(["__proto__", "constructor", "prototype"]);
131151
- pathSegmentSchema = union2([
131194
+ pathSegmentSchema = union3([
131152
131195
  string2().min(1).max(512).refine((value) => !UNSAFE_KEYS.has(value), "unsafe path key"),
131153
131196
  number2().int().nonnegative()
131154
131197
  ]);
@@ -134618,6 +134661,7 @@ async function sendTaskHandler(ctx, {
134618
134661
  requestedByUserId,
134619
134662
  source: "mcp",
134620
134663
  sourceTaskId,
134664
+ dispatchedByTaskId: sourceTaskId,
134621
134665
  taskType,
134622
134666
  tags,
134623
134667
  priority,
@@ -134848,7 +134892,7 @@ var init_send_task = __esm(() => {
134848
134892
  overrideSlackContext: boolean().default(false).describe("Explicitly route this task's Slack updates to a different channel/thread than its parent/contextKey. Requires slackChannelId AND slackThreadTs. Use only for deliberate cross-channel dispatch (e.g. escalation to another human's DM); logged for audit. Without this flag, a slackChannelId/slackThreadTs that disagrees with the parent task or inherited contextKey is rejected — omit the three Slack fields to inherit them from the parent as a unit instead."),
134849
134893
  requestedByUserId: string2().regex(/^[a-f0-9]{32}$/, "Expected a registry user ID (32 lowercase hexadecimal characters).").optional().describe("Registered requester ID (32 lowercase hexadecimal characters). When omitted, inherited from the caller's current task so the attribution flows through multi-hop delegation automatically. Only lead agents can name a user other than the requester of their current task."),
134850
134894
  followUpConfig: FollowUpConfigSchema.optional().describe("Control the lead follow-up created when this task finishes. When to use `followUpConfig`: set `disabled: true` when you'll wait for this task to complete inline and no follow-up is needed; set `onCompleted` / `onFailed` with specific instructions when you need to follow up effectively on a particular outcome of a long-running flow; for normal one-shot tasks, leave it unset because defaults are fine. It is most valuable for long-running / complex flows."),
134851
- outputSchema: record2(string2(), unknown()).optional().describe("Optional JSON Schema the assignee's final output must satisfy. store-progress rejects a completion that does not match. Supported keywords: type, required, properties, enum, const, items.")
134895
+ outputSchema: record2(string2(), unknown()).optional().describe("Optional JSON Schema the assignee's final output must satisfy. store-progress rejects a completion that does not match. Supported keywords: type, required, properties, enum, const, items. When omitted, the child inherits the schema of its parent task (your current task by default). An empty object {} means no schema: the child stores none and inherits none.")
134852
134896
  }).superRefine((data, ctx) => {
134853
134897
  const hasChannel = !!data.slackChannelId;
134854
134898
  const hasThread = !!data.slackThreadTs;
@@ -137061,7 +137105,7 @@ var init_slack_post = __esm(() => {
137061
137105
  });
137062
137106
 
137063
137107
  // src/tools/slack-read.ts
137064
- var AUTO_DOWNLOAD_DIR = "/app/shared/downloads/slack", SlackFileSchema, SlackMessageSchema, registerSlackReadTool = (server) => {
137108
+ var AUTO_DOWNLOAD_DIR = "/app/shared/downloads/slack", USERS_INFO_CONCURRENCY = 4, SlackFileSchema, SlackMessageSchema, registerSlackReadTool = (server) => {
137065
137109
  createToolRegistrar(server)("slack-read", {
137066
137110
  title: "Read Slack thread/channel history",
137067
137111
  description: "Read messages from a Slack thread or channel. Use inboxMessageId or taskId to read from a thread you have context for, or provide channelId directly for channel history (leads only). From a task, files in the messages are stored as attachments of that task, each with a ready-to-run `fetchCommand`.",
@@ -137152,31 +137196,34 @@ var AUTO_DOWNLOAD_DIR = "/app/shared/downloads/slack", SlackFileSchema, SlackMes
137152
137196
  });
137153
137197
  }
137154
137198
  try {
137199
+ let getUserDisplayName = function(userId) {
137200
+ let name = userNameCache.get(userId);
137201
+ if (!name) {
137202
+ name = client.users.info({ user: userId }).then((result) => result.user?.profile?.display_name || result.user?.real_name || userId).catch(() => userId);
137203
+ userNameCache.set(userId, name);
137204
+ }
137205
+ return name;
137206
+ };
137155
137207
  const client = app.client;
137156
- let rawMessages = [];
137157
- if (slackThreadTs) {
137158
- const result = await withAutoJoin(client, slackChannelId, () => client.conversations.replies({ channel: slackChannelId, ts: slackThreadTs, limit }));
137159
- rawMessages = result.messages || [];
137160
- } else {
137161
- const result = await withAutoJoin(client, slackChannelId, () => client.conversations.history({ channel: slackChannelId, limit }));
137162
- rawMessages = result.messages || [];
137163
- }
137164
- const authResult = await client.auth.test();
137165
- const botUserId = authResult.user_id;
137208
+ const [fetchedSettled, authSettled] = await Promise.allSettled([
137209
+ slackThreadTs ? withAutoJoin(client, slackChannelId, () => client.conversations.replies({ channel: slackChannelId, ts: slackThreadTs, limit })) : withAutoJoin(client, slackChannelId, () => client.conversations.history({ channel: slackChannelId, limit })),
137210
+ client.auth.test()
137211
+ ]);
137212
+ if (fetchedSettled.status === "rejected")
137213
+ throw fetchedSettled.reason;
137214
+ if (authSettled.status === "rejected")
137215
+ throw authSettled.reason;
137216
+ const rawMessages = fetchedSettled.value.messages || [];
137217
+ const botUserId = authSettled.value.user_id;
137166
137218
  const userNameCache = new Map;
137167
- async function getUserDisplayName(userId) {
137168
- if (userNameCache.has(userId)) {
137169
- return userNameCache.get(userId);
137170
- }
137171
- try {
137172
- const result = await client.users.info({ user: userId });
137173
- const name = result.user?.profile?.display_name || result.user?.real_name || userId;
137174
- userNameCache.set(userId, name);
137175
- return name;
137176
- } catch {
137177
- return userId;
137219
+ const authorIds = [
137220
+ ...new Set(rawMessages.flatMap((m) => m.user && m.user !== botUserId && m.bot_id === undefined && m.subtype !== "bot_message" && (extractSlackMessageText(m) || collectSlackMessageFiles(m).length > 0) ? [m.user] : []))
137221
+ ];
137222
+ await Promise.all(Array.from({ length: Math.min(USERS_INFO_CONCURRENCY, authorIds.length) }, async () => {
137223
+ for (let id = authorIds.shift();id; id = authorIds.shift()) {
137224
+ await getUserDisplayName(id);
137178
137225
  }
137179
- }
137226
+ }));
137180
137227
  const token = process.env.SLACK_BOT_TOKEN;
137181
137228
  const attachTo = contextTask ?? await attachableTask(agent.id, taskId ?? requestInfo.sourceTaskId);
137182
137229
  if (taskId && !attachTo) {
@@ -138095,6 +138142,20 @@ var init_task_learning = __esm(() => {
138095
138142
  DUPLICATE_SEARCH_PREFIXES = [`${LEARNINGS_ROOT}/`, "/longterm/workstreams/"];
138096
138143
  });
138097
138144
 
138145
+ // src/tasks/task-skip.ts
138146
+ function skipReasonFrom(failureReason, output) {
138147
+ return (failureReason ?? output)?.replace(/\s+/g, " ").trim() || undefined;
138148
+ }
138149
+ function finalizeSkippedTaskReaction(task, caller) {
138150
+ if (!task.slackChannelId)
138151
+ return;
138152
+ finalizeTerminalSlackReactions([task]).catch((error) => console.error(`[${caller}] skip reaction failed:`, scrubSecrets(error instanceof Error ? error.message : String(error))));
138153
+ }
138154
+ var init_task_skip = __esm(() => {
138155
+ init_ack();
138156
+ init_secret_scrubber();
138157
+ });
138158
+
138098
138159
  // src/tools/store-progress.ts
138099
138160
  async function foreignTaskWriteError(caller, task, sourceTaskId) {
138100
138161
  const decision = can({
@@ -138123,17 +138184,17 @@ function learningSentence(result) {
138123
138184
  var BLOCKED_WAITING_PATTERN, BLOCKED_WAITING_MIN_ELAPSED_MS, storeProgressOutputSchema, registerStoreProgressTool = (server) => {
138124
138185
  createToolRegistrar(server)("store-progress", {
138125
138186
  title: "Store task progress",
138126
- description: "Stores the progress of a specific task. Can also mark task as completed or failed, which will set the agent back to idle.",
138187
+ description: "Stores the progress of a specific task. Can also mark task as completed, failed, or skipped, which will set the agent back to idle. Use skipped only when the work is not yours to handle, such as a Slack thread message addressed to someone else; never skip an explicit @mention of you or work assigned to you.",
138127
138188
  annotations: { idempotentHint: true },
138128
138189
  inputSchema: object2({
138129
138190
  taskId: uuid().optional().describe("Full task UUID. Defaults to the caller-owned task in X-Source-Task-Id; required outside task context."),
138130
138191
  progress: string2().optional().describe("The progress update to store."),
138131
- status: _enum2(["completed", "failed", "in_progress", "pending"]).optional().describe("Set to 'completed' or 'failed' to finish the task. 'in_progress' and 'pending' store progress only and do not change task status."),
138192
+ status: _enum2(["completed", "failed", "skipped", "in_progress", "pending"]).optional().describe("Set to 'completed' or 'failed' to finish the task. Set 'skipped' to end a task that is not yours to handle (a Slack thread message addressed to someone else, or one you have nothing to add to); it posts nothing to the thread, creates no follow-up, and needs a one-line reason in failureReason. Never skip an explicit @mention of you or work assigned to you. 'in_progress' and 'pending' store progress only and do not change task status."),
138132
138193
  output: string2().optional().describe("The task result (used when completing). For Slack-originated tasks, this is published verbatim in the thread's outcome card. Keep free-text output under 120 words by default. Name the result and every artifact link, plus any IDs the human needs. Link documents instead of inlining them; omit process narration, transcripts, and restatements of the brief. Exceed the target only when requested depth, enumerated results, essential evidence, caveats, or instructions require it, or when the task's outputSchema requires longer output. When the task carries an outputSchema, output must be JSON matching it."),
138133
- failureReason: string2().optional().describe("The reason for failure (used when failing)."),
138194
+ failureReason: string2().optional().describe("The reason for failure (used when failing), or the one-line reason for a skip (required with status 'skipped')."),
138134
138195
  attachments: array2(AttachmentInputSchema).max(20).optional().describe("Pointer-based artifacts produced by this step — agent-fs path, URL, shared-fs path, or swarm Page. No inline file data; upload to agent-fs first and attach by path. Agent-fs pointers are verified before task state changes, using the explicit org/drive pair or the registering agent's configured defaults. May be sent on any call (progress or completion) and accumulates across calls; duplicates are de-duped by sha256 (when present) or by (kind, pointer, name)."),
138135
138196
  citations: array2(CitationInputSchema).max(MAX_TASK_CITATIONS).catch([]).optional().describe('Claim sources, upserted by index across calls. Use only for factual claims the reader cannot already see in the thread or task tree, 1-2 sources; none on delegation, routing, acks, or status replies. Reference each one in output with [citation:N], or set general: true for a source that backs the whole answer (it renders under "General sources"). ref per kind: task = task UUID; memory = memory UUID (optional quote must appear verbatim in it); github = owner/repo#N, owner/repo@<sha>, or a github.com pull, issues, or commit URL; slack = permalink or channel/ts; agent-fs = file path; page = page id; script-run = script run id; url = http(s) URL. The first completing call is refused, and the task stays in progress, if a marker has no entry, a citation fails validation, or a non-general citation is unreferenced; the response lists each problem. After one refusal, completion proceeds and those markers and sources are dropped from rendered output. At most 50 citations per call/task, refs up to 2048 characters, labels up to 200. Invalid or oversized batches are ignored; existing indices can still be updated at capacity.'),
138136
- learning: union2([
138197
+ learning: union3([
138137
138198
  string2(),
138138
138199
  object2({
138139
138200
  text: string2(),
@@ -138170,7 +138231,13 @@ var BLOCKED_WAITING_PATTERN, BLOCKED_WAITING_MIN_ELAPSED_MS, storeProgressOutput
138170
138231
  return toolErr("Omitted taskId requires a source task assigned to the calling agent.");
138171
138232
  }
138172
138233
  }
138173
- const status = requestedStatus === "completed" || requestedStatus === "failed" ? requestedStatus : undefined;
138234
+ const status = requestedStatus === "completed" || requestedStatus === "failed" || requestedStatus === "skipped" ? requestedStatus : undefined;
138235
+ const skipReason = status === "skipped" ? skipReasonFrom(failureReason, output) : undefined;
138236
+ if (status === "skipped") {
138237
+ if (!skipReason) {
138238
+ return toolErr('Status "skipped" needs a one-line reason in failureReason. The task was not changed.');
138239
+ }
138240
+ }
138174
138241
  const leakedParameter = output?.match(/(?:<\/(?:output|parameter)>\s*)?<parameter name="([a-zA-Z_]+)">\s*([\s\S]*)$/);
138175
138242
  if (leakedParameter) {
138176
138243
  output = output?.slice(0, leakedParameter.index);
@@ -138331,8 +138398,7 @@ var BLOCKED_WAITING_PATTERN, BLOCKED_WAITING_MIN_ELAPSED_MS, storeProgressOutput
138331
138398
  }
138332
138399
  const terminalResultGuard = await guardTerminalTaskResultWrite(existingTask, {
138333
138400
  status,
138334
- output,
138335
- failureReason,
138401
+ ...status === "skipped" ? { failureReason: skipReason } : { output, failureReason },
138336
138402
  force
138337
138403
  });
138338
138404
  if (terminalResultGuard.handled) {
@@ -138428,6 +138494,14 @@ This check refuses once per task; the next completion is accepted and unfixed ci
138428
138494
  await updateAgentStatusFromCapacity2(existingTask.agentId);
138429
138495
  }
138430
138496
  }
138497
+ } else if (status === "skipped") {
138498
+ const result = await skipTask2(taskId, skipReason);
138499
+ if (result) {
138500
+ updatedTask = result;
138501
+ if (existingTask.agentId) {
138502
+ await updateAgentStatusFromCapacity2(existingTask.agentId);
138503
+ }
138504
+ }
138431
138505
  } else {
138432
138506
  if (existingTask.agentId) {
138433
138507
  await updateAgentStatusFromCapacity2(existingTask.agentId);
@@ -138441,7 +138515,7 @@ This check refuses once per task; the next completion is accepted and unfixed ci
138441
138515
  };
138442
138516
  });
138443
138517
  const shouldRunTerminalSideEffects = (status === "completed" || status === "failed") && result.success && result.task && !(("wasNoOp" in result) && result.wasNoOp) && !(("wasForcedOverwrite" in result) && result.wasForcedOverwrite);
138444
- if (shouldRunTerminalSideEffects && status) {
138518
+ if (shouldRunTerminalSideEffects && (status === "completed" || status === "failed")) {
138445
138519
  await runTaskTerminalEffects({
138446
138520
  task: result.task,
138447
138521
  status,
@@ -138451,6 +138525,9 @@ This check refuses once per task; the next completion is accepted and unfixed ci
138451
138525
  persistMemory
138452
138526
  });
138453
138527
  }
138528
+ const skipWasFresh = status === "skipped" && result.success && result.task?.status === "skipped" && !(("wasNoOp" in result) && result.wasNoOp) && !(("wasForcedOverwrite" in result) && result.wasForcedOverwrite);
138529
+ if (skipWasFresh && result.task)
138530
+ finalizeSkippedTaskReaction(result.task, "store-progress");
138454
138531
  const learningResult = await learningWrite;
138455
138532
  const { success } = result;
138456
138533
  const message = learningResult ? `${result.message} ${learningSentence(learningResult)}` : result.message;
@@ -138479,6 +138556,7 @@ var init_store_progress = __esm(() => {
138479
138556
  init_task_citations2();
138480
138557
  init_agent_fs_provider();
138481
138558
  init_rbac();
138559
+ init_task_skip();
138482
138560
  init_task_terminal_effects();
138483
138561
  init_terminal_result_guard();
138484
138562
  init_utils();
@@ -138509,6 +138587,318 @@ var init_store_progress = __esm(() => {
138509
138587
  });
138510
138588
  });
138511
138589
 
138590
+ // src/be/improvements.ts
138591
+ function isValidImprovementEmail(value) {
138592
+ const trimmed = value?.trim() ?? "";
138593
+ return trimmed.length > 0 && trimmed.length <= EMAIL_MAX && VALID_EMAIL_RE.test(trimmed);
138594
+ }
138595
+ function toImprovement(row) {
138596
+ return {
138597
+ id: row.id,
138598
+ text: row.text,
138599
+ email: row.email,
138600
+ status: row.status,
138601
+ source: row.source,
138602
+ requestedByAgentId: row.requested_by_agent_id,
138603
+ approvedBy: row.approved_by,
138604
+ approvedAt: row.approved_at,
138605
+ sentAt: row.sent_at,
138606
+ proxyStatus: row.proxy_status,
138607
+ proxyId: row.proxy_id,
138608
+ proxyError: row.proxy_error,
138609
+ createdAt: row.created_at,
138610
+ updatedAt: row.updated_at
138611
+ };
138612
+ }
138613
+ async function globalValue(key) {
138614
+ const stored = (await getSwarmConfigs2({ scope: "global", key }))?.[0]?.value;
138615
+ return (stored ?? process.env[key])?.trim() || undefined;
138616
+ }
138617
+ async function isImprovementsEnabled() {
138618
+ return parseEnvFlag(await globalValue(IMPROVEMENTS_ENABLED_KEY), true);
138619
+ }
138620
+ async function assertEnabled() {
138621
+ if (!await isImprovementsEnabled()) {
138622
+ throw new ImprovementError("improvements_disabled", "Improvements are turned off (IMPROVEMENTS_ENABLED=false).");
138623
+ }
138624
+ }
138625
+ function buildImprovementPayload(input) {
138626
+ return { install_id: input.installId, text: input.text, email: input.email };
138627
+ }
138628
+ async function improvementInstallId() {
138629
+ return getDbClient2().transaction(async () => {
138630
+ const existing = await globalValue(INSTALL_ID_KEY);
138631
+ if (existing)
138632
+ return existing;
138633
+ const minted = `install_${crypto.randomUUID().replace(/-/g, "").slice(0, 16)}`;
138634
+ await upsertSwarmConfig2({ scope: "global", key: INSTALL_ID_KEY, value: minted });
138635
+ return minted;
138636
+ });
138637
+ }
138638
+ async function getImprovement(id) {
138639
+ const row = await getDbClient2().get("SELECT * FROM improvements WHERE id = ?", [
138640
+ id
138641
+ ]);
138642
+ return row ? toImprovement(row) : null;
138643
+ }
138644
+ async function listImprovements(historyLimit = 100) {
138645
+ const rows = await getDbClient2().query(`SELECT * FROM improvements WHERE status IN ('pending_approval', 'failed')
138646
+ UNION ALL
138647
+ SELECT * FROM (
138648
+ SELECT * FROM improvements WHERE status NOT IN ('pending_approval', 'failed')
138649
+ ORDER BY created_at DESC, id DESC LIMIT ?
138650
+ )
138651
+ ORDER BY created_at DESC, id DESC`, [historyLimit]);
138652
+ return rows.map(toImprovement);
138653
+ }
138654
+ async function createImprovement(input) {
138655
+ await assertEnabled();
138656
+ const trimmed = input.text.trim();
138657
+ const scrubbed = scrubSecrets(trimmed);
138658
+ if (scrubbed.length === 0 || scrubbed.length > IMPROVEMENT_TEXT_MAX) {
138659
+ throw new ImprovementError("invalid_text", `Text must be 1 to ${IMPROVEMENT_TEXT_MAX} characters after trimming.`);
138660
+ }
138661
+ const id = crypto.randomUUID();
138662
+ const now = new Date().toISOString();
138663
+ await getDbClient2().run(`INSERT INTO improvements
138664
+ (id, text, status, source, requested_by_agent_id, created_at, updated_at, created_by, updated_by)
138665
+ VALUES (?, ?, 'pending_approval', ?, ?, ?, ?, ?, ?)`, [
138666
+ id,
138667
+ scrubbed,
138668
+ input.source,
138669
+ input.requestedByAgentId ?? null,
138670
+ now,
138671
+ now,
138672
+ input.createdBy ?? null,
138673
+ input.createdBy ?? null
138674
+ ]);
138675
+ const improvement = await getImprovement(id);
138676
+ if (!improvement)
138677
+ throw new Error(`Improvement ${id} vanished after insert`);
138678
+ return { improvement, scrubChanged: scrubbed !== trimmed };
138679
+ }
138680
+ async function approveAndSend(id, approval) {
138681
+ await assertEnabled();
138682
+ if (!isValidImprovementEmail(approval.email)) {
138683
+ throw new ImprovementError("invalid_email", "A valid email is required to send.");
138684
+ }
138685
+ const email = approval.email.trim();
138686
+ const installId = await improvementInstallId();
138687
+ const approvedAt = new Date().toISOString();
138688
+ const claimed = await getDbClient2().transaction(async (tx) => {
138689
+ const result = await tx.run(`UPDATE improvements
138690
+ SET status = 'sending', approved_by = ?, approved_at = ?, email = ?,
138691
+ proxy_status = NULL, proxy_id = NULL, proxy_error = NULL,
138692
+ updated_at = ?, updated_by = ?
138693
+ WHERE id = ? AND status IN ('pending_approval', 'failed')`, [approval.approvedBy, approvedAt, email, approvedAt, approval.updatedBy ?? null, id]);
138694
+ if (result.changes === 1) {
138695
+ return tx.get("SELECT * FROM improvements WHERE id = ?", [id]);
138696
+ }
138697
+ return null;
138698
+ });
138699
+ if (!claimed) {
138700
+ const existing = await getImprovement(id);
138701
+ if (!existing)
138702
+ throw new ImprovementError("not_found", `Improvement ${id} not found.`);
138703
+ throw new ImprovementError("conflict", `Improvement ${id} is ${existing.status}; only pending or failed improvements can be approved.`);
138704
+ }
138705
+ const payload = buildImprovementPayload({
138706
+ installId,
138707
+ text: claimed.text,
138708
+ email
138709
+ });
138710
+ let proxyStatus = null;
138711
+ let proxyId = null;
138712
+ let proxyError = null;
138713
+ try {
138714
+ const response = await fetch(approval.endpoint, {
138715
+ method: "POST",
138716
+ headers: { "Content-Type": "application/json" },
138717
+ body: JSON.stringify(payload),
138718
+ signal: AbortSignal.timeout(SEND_TIMEOUT_MS)
138719
+ });
138720
+ proxyStatus = response.status;
138721
+ const body = await response.text().catch(() => "");
138722
+ if (response.ok) {
138723
+ try {
138724
+ const parsed = JSON.parse(body);
138725
+ proxyId = typeof parsed.id === "string" ? parsed.id : null;
138726
+ } catch {
138727
+ proxyId = null;
138728
+ }
138729
+ } else {
138730
+ proxyError = body || `HTTP ${response.status}`;
138731
+ }
138732
+ } catch (error) {
138733
+ proxyError = error instanceof Error ? error.message : String(error);
138734
+ }
138735
+ const sent = proxyStatus !== null && proxyStatus >= 200 && proxyStatus < 300;
138736
+ const finishedAt = new Date().toISOString();
138737
+ await getDbClient2().run(`UPDATE improvements
138738
+ SET status = ?, sent_at = ?, proxy_status = ?, proxy_id = ?, proxy_error = ?, updated_at = ?
138739
+ WHERE id = ?`, [
138740
+ sent ? "sent" : "failed",
138741
+ sent ? finishedAt : null,
138742
+ proxyStatus,
138743
+ proxyId,
138744
+ proxyError ? scrubSecrets(proxyError).slice(0, PROXY_ERROR_MAX) : null,
138745
+ finishedAt,
138746
+ id
138747
+ ]);
138748
+ const finished = await getImprovement(id);
138749
+ if (!finished)
138750
+ throw new Error(`Improvement ${id} vanished after send`);
138751
+ return finished;
138752
+ }
138753
+ async function discardImprovement(id, options) {
138754
+ await assertEnabled();
138755
+ const now = new Date().toISOString();
138756
+ const result = await getDbClient2().run(`UPDATE improvements SET status = 'discarded', updated_at = ?, updated_by = ?
138757
+ WHERE id = ? AND status IN ('pending_approval', 'failed')`, [now, options?.updatedBy ?? null, id]);
138758
+ const existing = await getImprovement(id);
138759
+ if (!existing)
138760
+ throw new ImprovementError("not_found", `Improvement ${id} not found.`);
138761
+ if (result.changes !== 1) {
138762
+ throw new ImprovementError("conflict", `Improvement ${id} is ${existing.status}; only pending or failed improvements can be discarded.`);
138763
+ }
138764
+ return existing;
138765
+ }
138766
+ function hostOf(value) {
138767
+ if (!value)
138768
+ return null;
138769
+ try {
138770
+ return new URL(value.includes("://") ? value : `https://${value}`).host || null;
138771
+ } catch {
138772
+ return null;
138773
+ }
138774
+ }
138775
+ async function improvementLeakHints(text) {
138776
+ const client = getDbClient2();
138777
+ const [agents, repos, users] = await Promise.all([
138778
+ client.query("SELECT name FROM agents"),
138779
+ client.query("SELECT name, url FROM swarm_repos"),
138780
+ client.query("SELECT email FROM users WHERE email IS NOT NULL")
138781
+ ]);
138782
+ const terms = new Set;
138783
+ const add = (value) => {
138784
+ const trimmed = value?.trim();
138785
+ if (trimmed && trimmed.length >= 3)
138786
+ terms.add(trimmed);
138787
+ };
138788
+ for (const agent of agents)
138789
+ add(agent.name);
138790
+ for (const repo of repos) {
138791
+ add(repo.name);
138792
+ add(repo.url);
138793
+ }
138794
+ for (const user of users)
138795
+ add(user.email);
138796
+ add(hostOf(process.env.MCP_BASE_URL));
138797
+ add(hostOf(process.env.APP_URL));
138798
+ const orgName = await globalValue("SWARM_ORG_NAME");
138799
+ const orgWebsite = await globalValue("SWARM_ORG_WEBSITE");
138800
+ add(orgName);
138801
+ add(orgWebsite);
138802
+ add(hostOf(orgWebsite));
138803
+ const hits = [];
138804
+ const seen = new Set;
138805
+ const push = (hit) => {
138806
+ const key = hit.toLowerCase();
138807
+ if (seen.has(key) || hits.length >= LEAK_HINTS_MAX)
138808
+ return;
138809
+ seen.add(key);
138810
+ hits.push(hit);
138811
+ };
138812
+ const lower = text.toLowerCase();
138813
+ for (const term of terms) {
138814
+ const at = lower.indexOf(term.toLowerCase());
138815
+ if (at >= 0)
138816
+ push(text.slice(at, at + term.length));
138817
+ }
138818
+ for (const match of text.matchAll(URL_RE))
138819
+ push(match[0]);
138820
+ for (const match of text.matchAll(EMAIL_RE))
138821
+ push(match[0]);
138822
+ return hits;
138823
+ }
138824
+ var IMPROVEMENTS_ENABLED_KEY = "IMPROVEMENTS_ENABLED", IMPROVEMENT_TEXT_MAX = 4000, SEND_TIMEOUT_MS = 1e4, PROXY_ERROR_MAX = 1024, LEAK_HINTS_MAX = 50, INSTALL_ID_KEY = "telemetry_installation_id", EMAIL_MAX = 320, VALID_EMAIL_RE, IMPROVEMENT_STATUSES, IMPROVEMENT_SOURCES, ImprovementError, URL_RE, EMAIL_RE;
138825
+ var init_improvements = __esm(() => {
138826
+ init_env_flag();
138827
+ init_secret_scrubber();
138828
+ init_db4();
138829
+ VALID_EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
138830
+ IMPROVEMENT_STATUSES = [
138831
+ "pending_approval",
138832
+ "sending",
138833
+ "sent",
138834
+ "failed",
138835
+ "discarded"
138836
+ ];
138837
+ IMPROVEMENT_SOURCES = ["mcp", "api", "ui"];
138838
+ ImprovementError = class ImprovementError extends Error {
138839
+ code;
138840
+ constructor(code, message) {
138841
+ super(message);
138842
+ this.code = code;
138843
+ this.name = "ImprovementError";
138844
+ }
138845
+ };
138846
+ URL_RE = /\bhttps?:\/\/[^\s<>"')]+/gi;
138847
+ EMAIL_RE = /[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g;
138848
+ });
138849
+
138850
+ // src/tools/submit-improvement.ts
138851
+ var submitImprovementInputSchema, submitImprovementOutputSchema, registerSubmitImprovementTool = (server) => {
138852
+ createToolRegistrar(server)("submit-improvement", {
138853
+ title: "Draft a product improvement",
138854
+ description: "Draft a short product improvement for the agent-swarm team at desplega. It is stored as a pending draft and is never sent by this tool: a person must approve it from the Improvements button in the dashboard header. Only the text you write, the install id and the approver's email are sent.",
138855
+ annotations: { destructiveHint: false },
138856
+ inputSchema: submitImprovementInputSchema,
138857
+ outputSchema: submitImprovementOutputSchema
138858
+ }, async ({ text }, info) => {
138859
+ if (info.callOrigin === "script-sdk" || info.callOrigin === "extension") {
138860
+ return toolErr("Scripts and extensions cannot draft improvements.");
138861
+ }
138862
+ if (!info.agentId) {
138863
+ return toolErr('Agent ID not found. Set the "X-Agent-ID" header.');
138864
+ }
138865
+ const agent = await getAgentById2(info.agentId);
138866
+ const decision = can({
138867
+ principal: { kind: "agent", agentId: info.agentId, isLead: agent?.isLead ?? false },
138868
+ verb: "improvement.submit",
138869
+ source: "mcp"
138870
+ });
138871
+ if (!decision.allow)
138872
+ return toolErr(decision.reason);
138873
+ try {
138874
+ const { improvement } = await createImprovement({
138875
+ text,
138876
+ source: "mcp",
138877
+ requestedByAgentId: info.agentId
138878
+ });
138879
+ return toolOk(`Drafted improvement ${improvement.id}. A person must approve it from the Improvements button in the dashboard header before anything is sent.`, { data: { id: improvement.id, status: improvement.status } });
138880
+ } catch (error) {
138881
+ if (error instanceof ImprovementError)
138882
+ return toolErr(error.message);
138883
+ throw error;
138884
+ }
138885
+ });
138886
+ };
138887
+ var init_submit_improvement = __esm(() => {
138888
+ init_zod();
138889
+ init_db4();
138890
+ init_improvements();
138891
+ init_rbac();
138892
+ init_utils();
138893
+ submitImprovementInputSchema = object2({
138894
+ text: string2().min(1).max(IMPROVEMENT_TEXT_MAX).describe("The product improvement for desplega, in plain words. Do not include names, repos, hosts, customer details or secrets.")
138895
+ });
138896
+ submitImprovementOutputSchema = swarmToolOutputSchema({
138897
+ id: string2().optional(),
138898
+ status: string2().optional()
138899
+ });
138900
+ });
138901
+
138512
138902
  // src/tools/swarm-config/delete-config.ts
138513
138903
  var registerDeleteConfigTool = (server) => {
138514
138904
  createToolRegistrar(server)("delete-config", {
@@ -138972,7 +139362,7 @@ var init_swarm_x = __esm(() => {
138972
139362
  init_zod();
138973
139363
  init_composio();
138974
139364
  init_utils();
138975
- primitiveQueryValueSchema = union2([string2(), number2(), boolean()]);
139365
+ primitiveQueryValueSchema = union3([string2(), number2(), boolean()]);
138976
139366
  });
138977
139367
 
138978
139368
  // src/tools/system-one-decide.ts
@@ -138984,7 +139374,7 @@ var registerSystemOneDecideTool = (server) => {
138984
139374
  inputSchema: object2({
138985
139375
  provider: _enum2(SYSTEM_ONE_PROVIDER_IDS).optional().describe("Decision host (default: the SYSTEM_ONE_DEFAULT_PROVIDER global config, typesafe when unset)"),
138986
139376
  model: string2().min(1).optional().describe("Provider model id (default: the provider's)"),
138987
- state: union2([string2(), array2(string2()), record2(string2(), unknown())]).describe("The state to decide on"),
139377
+ state: union3([string2(), array2(string2()), record2(string2(), unknown())]).describe("The state to decide on"),
138988
139378
  questions: record2(string2(), record2(string2(), unknown())).describe("Questions by id, each `{ type: 'noul' | 'choice' | 'score', instructions, criteria }`"),
138989
139379
  timeoutMs: number2().int().optional().describe("Time budget for the call, retries included (default 30000)"),
138990
139380
  maxRetries: number2().int().optional().describe("Retries on transient failures inside the time budget (default 2)")
@@ -139159,7 +139549,7 @@ async function emitBudgetRefusalSideEffects(ctx, inserted) {
139159
139549
  console.warn(`[budget-refusal-notify] Failed to create follow-up task for budget refusal (task=${ctx.task.id.slice(0, 8)}): ${err}`);
139160
139550
  }
139161
139551
  }
139162
- import("./event-bus-g0ka3pbw.js").then(({ workflowEventBus }) => {
139552
+ import("./event-bus-e66gh7cc.js").then(({ workflowEventBus }) => {
139163
139553
  workflowEventBus.emit("task.budget_refused", {
139164
139554
  taskId: ctx.task.id,
139165
139555
  agentId: ctx.agentId,
@@ -139846,7 +140236,9 @@ var registerTrackerUnlinkTool = (server) => {
139846
140236
  outputSchema: swarmToolOutputSchema()
139847
140237
  }, async (args, _requestInfo, _meta) => {
139848
140238
  try {
139849
- await deleteTrackerSync(args.syncId);
140239
+ const removed = await deleteTrackerSync(args.syncId);
140240
+ if (!removed)
140241
+ return toolErr(`No tracker mapping ${args.syncId}`);
139850
140242
  return toolOk(`Removed tracker sync mapping ${args.syncId}.`);
139851
140243
  } catch (error) {
139852
140244
  const message = error instanceof Error ? error.message : "Unknown error";
@@ -140676,7 +141068,7 @@ var registerPatchWorkflowTool = (server) => {
140676
141068
  type: string2(),
140677
141069
  config: record2(string2(), unknown()),
140678
141070
  label: string2().optional(),
140679
- next: union2([string2(), array2(string2()), record2(string2(), string2())]).optional(),
141071
+ next: union3([string2(), array2(string2()), record2(string2(), string2())]).optional(),
140680
141072
  inputs: record2(string2(), string2()).optional()
140681
141073
  })).optional().describe("New nodes to add"),
140682
141074
  onNodeFailure: _enum2(["fail", "continue"]).optional().describe("Update onNodeFailure behavior"),
@@ -140838,6 +141230,8 @@ var registerRetryWorkflowRunTool = (server) => {
140838
141230
  outputSchema: swarmToolOutputSchema()
140839
141231
  }, async ({ runId }) => {
140840
141232
  try {
141233
+ if (!await getWorkflowRunSummary(runId))
141234
+ return toolErr(`Workflow run not found: ${runId}`);
140841
141235
  await retryFailedRun2(runId, getExecutorRegistry2());
140842
141236
  return toolOk(`Retrying workflow run ${runId}.`);
140843
141237
  } catch (err) {
@@ -140847,6 +141241,7 @@ var registerRetryWorkflowRunTool = (server) => {
140847
141241
  };
140848
141242
  var init_retry_workflow_run = __esm(() => {
140849
141243
  init_zod();
141244
+ init_workflow_runs();
140850
141245
  init_utils();
140851
141246
  init_workflows();
140852
141247
  });
@@ -141288,6 +141683,7 @@ async function createServer(opts = {}) {
141288
141683
  registerStoreProgressTool(server);
141289
141684
  registerMyAgentInfoTool(server);
141290
141685
  registerCancelTaskTool(server);
141686
+ registerSubmitImprovementTool(server);
141291
141687
  registerResolveUserTool(server);
141292
141688
  registerManageUserTool(server);
141293
141689
  registerDbQueryTool(server);
@@ -141607,6 +142003,7 @@ var init_server = __esm(() => {
141607
142003
  init_slack_upload_file();
141608
142004
  init_steer_task();
141609
142005
  init_store_progress();
142006
+ init_submit_improvement();
141610
142007
  init_swarm_config2();
141611
142008
  init_swarm_x();
141612
142009
  init_system_one_decide();
@@ -141664,4 +142061,4 @@ var init_server = __esm(() => {
141664
142061
  loggedToolAllowlistWarnings = new Set;
141665
142062
  });
141666
142063
 
141667
- export { DEFAULT_NEGOTIATED_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, isJSONRPCRequest, isJSONRPCResultResponse, isJSONRPCErrorResponse, JSONRPCMessageSchema, isInitializeRequest, init_types, McpServer, init_mcp, repointTrackerSyncBySwarmId, init_tracker, isRuntimePoolWakeable, isAgentReachable, init_reachability, referencedBundlePaths, skillDirs, init_manifest_format, TaskCreationBlockedError, init_errors2, resolveIdentity, renderIdentity, init_identity, recordUnmappedIdentity, init_unmapped_identities, MAX_TASK_ATTACHMENT_BYTES, recordTaskAttachmentUpload, scopeFromAttachment, backingProviderId, init_task_attachment_store, taskModelPin, resumedTaskModelSelection, init_model_pin, listHarnessModelSupport, recordHarnessModelSupport, agentRanModel, getAgentHarnessCliVersion, setAgentHarnessCliVersion, init_harness_model_support, sanitizeModelTierOverrides, parseModelTierOverridesHeader, setAgentModelTierOverrides, previewModelTiers, recordClaimModelResolution, init_model_tier_resolution, harnessModelErrorFor, poolTaskRunsOnHarness, explicitModelError, explicitModelErrorForAgent, init_model_validation, stripSiblingBlock, init_sibling_block, createTaskWithSiblingAwareness, init_sibling_awareness, transcribeAudioNotes, init_transcription, init_templates, buildEffectiveText, bufferedFileFailures, fetchSlackFiles, createSlackTaskWithFiles, notifySlackFileFailures, init_inbound_files, isAddressedToOtherUser, broadcastMatches, routeMessage, extractTaskFromMessage, init_router, extractSlackMessageText, slackInboundMessageText, collectSlackMessageFiles, init_message_text, createAdditiveBuffer, init_additive_buffer, recoverIncompleteRuns, init_recovery, handleWebhookTrigger, verifyHmacSignature, WebhookError, init_triggers, snapshotAndUpdateWorkflow, init_version, RawLlmConfigSchema, RawLlmOutputSchema, executeRawLlm, init_raw_llm, getExecutorRegistry2, initWorkflows2, init_workflows, dispatchScheduleTarget, calculateNextRun2, startScheduler2, stopScheduler2, runScheduleNow2, init_scheduler, ExtensionAssetConflictError, init_assets, ExtensionOwnershipError, getExtensionFiles, getExtensionById, getExtensionByName, listExtensions, listExtensionVersions, updateExtensionMeta, listExtensionRuns, init_db, SDK_ALLOWLIST, mcpToolNameForSdkMethod, init_sdk_allowlist, MCP_OVERFLOW_NAMESPACE, mcpOverflowAuthError, init_kv_overflow, hasKvViewArgs, resolveKvView, init_kv_view, COLOR_LITERAL_THRESHOLD, countColorLiterals, init_color_literals, toolErr, createToolRegistrar, init_utils, handleMcpBridge, init_mcp_bridge, Redacted, init_redacted, SCRIPT_SDK_RESPONSE_LIMIT_BYTES, readScriptSdkJsonResponse, init_response_limit, ExtensionConfigError, init_loader, ExtensionLifecycleError, setExtensionLoopbackBaseUrl, enableExtension, disableExtension, activateVersion, ExtensionAssetsInvalidError, installExtensionWithAssets, uninstallExtension, reloadExtension, loadEnabledExtensions, stopExtensionRuntime, init_lifecycle, ExtensionAbortedError2, isRegistered2, isExtensionAgentId2, getExtensionBridgeToken2, resolveBridgeCallOrigin2, extensionIdForAgent2, runContext2, registerLoaded2, unregister2, listRegistered2, dispatchPre2, dispatchPost2, init_dispatcher, REBOOT_RETRY_PIN_TAG2, getPinCandidateAgent2, resolveLeadOnlyRecoveryAssignment2, getResumeGeneration2, getNextResumeGeneration2, inheritedModelSelection2, createWorkerTaskFollowUp2, createResumeFollowUp2, createRerouteDecisionTask2, createPoolStarvationDecisionTask2, init_worker_follow_up, isGitHubEnabled, initGitHub, verifyWebhookSignature, isAgentMailEnabled, initAgentMail, verifyAgentMailWebhook, isInboxAllowed, isSenderAllowed, handleMessageReceived, init_agentmail, isAzureDevOpsEnabled, initAzureDevOps, verifyAzureDevOpsWebhook, isAzureDevOpsUrl, canonicalAzureDevOpsRepoUrl, parseAzureDevOpsRepoUrl, init_azure_devops, createdPullRequestOf, commentedPayloadOf, handlePullRequestCreated, handlePullRequestCommented, handleWorkItemCreated, handleWorkItemUpdated, handleWorkItemCommented, handleWorkItemDeleted, handleWorkItemRestored, initAzureDevOpsOutbound, init_azure_devops2, enqueueAuditRow, enqueueAdmissionRow, flushAuditBuffer, startAuditWriter, stopAuditWriter, startAuditGc, stopAuditGc, init_rbac_audit, getTelemetryIngestAnchor, init_telemetry_ingest_anchor, initApiTelemetry, syncTelemetryEnabled, init_telemetry_enable, isBitbucketEnabled, initBitbucket, verifyBitbucketWebhook, isDuplicateDelivery, markDeliveryProcessed, pullRequestEventOf, pullRequestCommentEventOf, handlePullRequestCreated2, handlePullRequestCommentCreated, handlePullRequestClosed, init_bitbucket, handlePullRequest, handleIssue, handleComment, handlePullRequestReview, handleCheckRun, handleCheckSuite, handleWorkflowRun, init_github, isGitLabEnabled, initGitLab, verifyGitLabWebhook, handleMergeRequest, handleIssue2, handleNote, handlePipeline, init_gitlab, isChatSdkEnabled, getChatSdkConfig, init_config, errorMessage, init_logger, resolveAdapterApiUrl, init_adapters, trackBackground, init_background, TelegramBotApiError, callTelegramBotApi, init_telegram_api, isTrustedTeamsServiceUrl, init_teams_origin, getSessionLabels, rememberSessionLabel, init_session_labels, isChatSdkStopping, startChatSdk, getChatInstance, isChatAdapterConfigured, getChatSdkHealth, stopChatSdk, init_runtime, getJiraMetadata, updateJiraMetadata, clearJiraMetadata, init_metadata, registerJiraWebhook, deleteJiraWebhook, init_webhook_lifecycle, isJiraEnabled, initJira, init_app, handleJiraWebhook, init_webhook, init_jira, handleAgentSessionEvent, handleIssueUpdate, handleIssueDelete, handleAgentSessionPrompted, init_sync, isLinearEnabled, initLinear, init_app2, init_linear, init_slack, isCookieSafePageId, extractPageSession, extractLegacyPageSession, extractAndVerifyCookie, isLocalDevPageRequest, pageSessionSetCookies, init_page_session, resolveHttpRequestAuth, init_auth, getDeploymentEnvValue, loadGlobalConfigsIntoEnv, reloadGlobalConfigsAndIntegrations, scheduleIntegrationsReload, handleCore, init_core, MCP_MAX_TOOL_INPUT_ELEMENTS, MCP_MAX_REQUEST_BODY_BYTES, init_mcp_limits, userCtx, init_task_tool_ctx, requestPrincipal, agentFirstPrincipal, requireAuthKind, rejectGuest, init_request_principal, handleApps, init_apps, cancelApprovalRequest, cancelApprovalRequestAndRun, init_approval_cancel, getUserCommsPrefs, init_requester_comms, getTaskDetailsInputSchema, getTaskDetailsOutputSchema, getTaskDetailsHandler, init_get_task_details, cancelTaskInputSchema, cancelTaskOutputSchema, cancelTaskHandler, init_cancel_task, executeReadOnlyQuery, assertSelectOnlyQuery, handleDbQuery, init_db_query, snapshotMetric, init_version2, AssetKeyAuthorizationError, authorizeAssetKeyWrite, init_asset_key_auth, getPageEditCounter, init_page_versions, snapshotPage, init_version3, DEFAULT_THEME_ID, THEME_PRESET_IDS, getThemePreset, init_presets, readThemeFields, init_page_fields, assertOAuthAppUrlsSafe, assertOAuthEgressUrlSafe, init_app_validation, listOAuthPresets, listOAuthPresetIds, getOAuthPreset, hydrateOAuthAppFromPreset, init_presets2, scopedResourceScopeIdSchema, resolveScopedResourceId, init_scoped_resource, MemoryKeyError, init_key_guard, refreshLinks, init_link_resolver, indexMemoryContent, init_index_content, dedupeMemoryDocumentIds, recordMemoryAccesses, recordRetrievals, init_retrieval, ExplicitSelfDuplicateError, applyRating, init_store, shouldPersistAutomaticTaskMemory, init_automatic_task_gate, guardTerminalTaskResultWrite, init_terminal_result_guard, getTasksInputSchema, getTasksOutputSchema, getTasksHandler, init_get_tasks, reservedNamespaceError, privateNamespaceError, reservedRoomKeyError, init_kv_reserved_namespaces, updateMcpServerChecked, init_mcp_server_checked_update, updateTouchesStdioExecution, init_mcp_server_stdio_gate, canReadMemory, init_access, getLinksForMemory, init_links_store, expandCandidatesWithGraph, init_graph_expansion, isApiDraining, drainApi, init_api_drain, markKapsoMessageRead, sendKapsoReaction, init_client, getKapsoConfig, getKapsoNumberMapping, markKapsoMessageSeen, init_config2, changesAllowMerge, init_repo_merge_policy, updateSwarmRepoChecked, init_repo_checked_update, getCombConfig, init_config3, resolveRoomNamespace, roomRequestInfo, authorizeRoomNamespace, sessionAccessTopic, sessionPresenceRoot, init_auth2, RoomOperationSchema, init_document, removeAwarenessStates, init_awareness, roomTopic, decodeRoomSnapshot, roomView, getRoom, changeRoom, applyRoomUpdate, resetRoom, sweepRooms, closeRooms, removeNamespaceRooms, init_rooms, init_scheduler2, MEMORY_KEYS_DEFAULT_PREFIX, MEMORY_KEYS_MAX_LIMIT, estimateTokens, posteriorMean, listMemoryKeys, checkChunkIntegrity, getMemoryChunks, getPosteriorsByIds, init_key_browser, createEvent, createEventsBatch, getEventCountsFiltered, getEventsFiltered, init_events, mergeScheduleTiming, validateRecurringTiming, init_validate, followUpThreadForSourceTask, evaluateFollowUpRedelegation, init_follow_up_redelegation_guard, checkOutputSchemaShape, sendTaskOutputSchema, sendTaskHandler, init_send_task, steerTaskUserInputSchema, steerTaskOutputSchema, steerTaskHandler, init_steer_task, canClaim, init_budget_admission, emitBudgetRefusalSideEffects, init_budget_refusal_notify, workflowModelErrors, init_model_validation2, patchWorkflowDefinition, init_patch_definition, idempotencyKeyHeader, readIdempotencyKey, replayAcceptedOperation, init_idempotency_key, resolveScriptsOnlyMode, init_scripts_only_mode, ALL_CAPABILITIES, hasCapability, getEnabledCapabilities, createServer, init_server };
142064
+ export { DEFAULT_NEGOTIATED_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, isJSONRPCRequest, isJSONRPCResultResponse, isJSONRPCErrorResponse, JSONRPCMessageSchema, isInitializeRequest, init_types, McpServer, init_mcp, repointTrackerSyncBySwarmId, init_tracker, isRuntimePoolWakeable, isAgentReachable, init_reachability, referencedBundlePaths, skillDirs, init_manifest_format, TaskCreationBlockedError, init_errors2, resolveIdentity, renderIdentity, init_identity, recordUnmappedIdentity, init_unmapped_identities, MAX_TASK_ATTACHMENT_BYTES, recordTaskAttachmentUpload, scopeFromAttachment, backingProviderId, init_task_attachment_store, taskModelPin, resumedTaskModelSelection, init_model_pin, listHarnessModelSupport, recordHarnessModelSupport, agentRanModel, getAgentHarnessCliVersion, setAgentHarnessCliVersion, init_harness_model_support, sanitizeModelTierOverrides, parseModelTierOverridesHeader, setAgentModelTierOverrides, previewModelTiers, recordClaimModelResolution, init_model_tier_resolution, harnessModelErrorFor, poolTaskRunsOnHarness, explicitModelError, explicitModelErrorForAgent, init_model_validation, stripSiblingBlock, init_sibling_block, createTaskWithSiblingAwareness, init_sibling_awareness, transcribeAudioNotes, init_transcription, init_templates, buildEffectiveText, bufferedFileFailures, fetchSlackFiles, createSlackTaskWithFiles, notifySlackFileFailures, init_inbound_files, isAddressedToOtherUser, broadcastMatches, routeMessage, extractTaskFromMessage, init_router, extractSlackMessageText, slackInboundMessageText, collectSlackMessageFiles, init_message_text, createAdditiveBuffer, init_additive_buffer, recoverIncompleteRuns, init_recovery, handleWebhookTrigger, verifyHmacSignature, WebhookError, init_triggers, snapshotAndUpdateWorkflow, init_version, RawLlmConfigSchema, RawLlmOutputSchema, executeRawLlm, init_raw_llm, getExecutorRegistry2, initWorkflows2, init_workflows, dispatchScheduleTarget, calculateNextRun2, startScheduler2, stopScheduler2, runScheduleNow2, init_scheduler, ExtensionAssetConflictError, init_assets, ExtensionOwnershipError, getExtensionFiles, getExtensionById, getExtensionByName, listExtensions, listExtensionVersions, updateExtensionMeta, listExtensionRuns, init_db, SDK_ALLOWLIST, mcpToolNameForSdkMethod, init_sdk_allowlist, MCP_OVERFLOW_NAMESPACE, mcpOverflowAuthError, init_kv_overflow, hasKvViewArgs, resolveKvView, init_kv_view, COLOR_LITERAL_THRESHOLD, countColorLiterals, init_color_literals, toolErr, createToolRegistrar, init_utils, handleMcpBridge, init_mcp_bridge, Redacted, init_redacted, SCRIPT_SDK_RESPONSE_LIMIT_BYTES, readScriptSdkJsonResponse, init_response_limit, ExtensionConfigError, init_loader, ExtensionLifecycleError, setExtensionLoopbackBaseUrl, enableExtension, disableExtension, activateVersion, ExtensionAssetsInvalidError, installExtensionWithAssets, uninstallExtension, reloadExtension, loadEnabledExtensions, stopExtensionRuntime, init_lifecycle, ExtensionAbortedError2, isRegistered2, isExtensionAgentId2, getExtensionBridgeToken2, resolveBridgeCallOrigin2, extensionIdForAgent2, runContext2, registerLoaded2, unregister2, listRegistered2, dispatchPre2, dispatchPost2, init_dispatcher, REBOOT_RETRY_PIN_TAG2, getPinCandidateAgent2, resolveLeadOnlyRecoveryAssignment2, getResumeGeneration2, getNextResumeGeneration2, inheritedModelSelection2, createWorkerTaskFollowUp2, createResumeFollowUp2, createRerouteDecisionTask2, createPoolStarvationDecisionTask2, init_worker_follow_up, isGitHubEnabled, initGitHub, verifyWebhookSignature, isAgentMailEnabled, initAgentMail, verifyAgentMailWebhook, isInboxAllowed, isSenderAllowed, handleMessageReceived, init_agentmail, isAzureDevOpsEnabled, initAzureDevOps, verifyAzureDevOpsWebhook, isAzureDevOpsUrl, canonicalAzureDevOpsRepoUrl, parseAzureDevOpsRepoUrl, init_azure_devops, createdPullRequestOf, commentedPayloadOf, handlePullRequestCreated, handlePullRequestCommented, handleWorkItemCreated, handleWorkItemUpdated, handleWorkItemCommented, handleWorkItemDeleted, handleWorkItemRestored, initAzureDevOpsOutbound, init_azure_devops2, enqueueAuditRow, enqueueAdmissionRow, flushAuditBuffer, startAuditWriter, stopAuditWriter, startAuditGc, stopAuditGc, init_rbac_audit, getTelemetryIngestAnchor, init_telemetry_ingest_anchor, initApiTelemetry, syncTelemetryEnabled, init_telemetry_enable, isBitbucketEnabled, initBitbucket, verifyBitbucketWebhook, isDuplicateDelivery, markDeliveryProcessed, pullRequestEventOf, pullRequestCommentEventOf, handlePullRequestCreated2, handlePullRequestCommentCreated, handlePullRequestClosed, init_bitbucket, handlePullRequest, handleIssue, handleComment, handlePullRequestReview, handleCheckRun, handleCheckSuite, handleWorkflowRun, init_github, isGitLabEnabled, initGitLab, verifyGitLabWebhook, handleMergeRequest, handleIssue2, handleNote, handlePipeline, init_gitlab, isChatSdkEnabled, getChatSdkConfig, init_config, errorMessage, init_logger, resolveAdapterApiUrl, init_adapters, trackBackground, init_background, TelegramBotApiError, callTelegramBotApi, init_telegram_api, isTrustedTeamsServiceUrl, init_teams_origin, getSessionLabels, rememberSessionLabel, init_session_labels, isChatSdkStopping, startChatSdk, getChatInstance, isChatAdapterConfigured, getChatSdkHealth, stopChatSdk, init_runtime, getJiraMetadata, updateJiraMetadata, clearJiraMetadata, init_metadata, registerJiraWebhook, deleteJiraWebhook, init_webhook_lifecycle, isJiraEnabled, initJira, init_app, handleJiraWebhook, init_webhook, init_jira, handleAgentSessionEvent, handleIssueUpdate, handleIssueDelete, handleAgentSessionPrompted, init_sync, isLinearEnabled, initLinear, init_app2, init_linear, init_slack, verifyPageSession, LEGACY_PAGE_SESSION_COOKIE, isCookieSafePageId, extractPageSession, extractLegacyPageSession, extractAndVerifyCookie, isLocalDevPageRequest, pageSessionSetCookies, init_page_session, resolveHttpRequestAuth, init_auth, getDeploymentEnvValue, loadGlobalConfigsIntoEnv, reloadGlobalConfigsAndIntegrations, scheduleIntegrationsReload, handleCore, init_core, MCP_MAX_TOOL_INPUT_ELEMENTS, MCP_MAX_REQUEST_BODY_BYTES, init_mcp_limits, userCtx, init_task_tool_ctx, requestPrincipal, agentFirstPrincipal, requireAuthKind, rejectGuest, init_request_principal, handleApps, init_apps, cancelApprovalRequest, cancelApprovalRequestAndRun, init_approval_cancel, getUserCommsPrefs, init_requester_comms, getTaskDetailsInputSchema, getTaskDetailsOutputSchema, getTaskDetailsHandler, init_get_task_details, cancelTaskInputSchema, cancelTaskOutputSchema, cancelTaskHandler, init_cancel_task, executeReadOnlyQuery, assertSelectOnlyQuery, handleDbQuery, init_db_query, snapshotMetric, init_version2, AssetKeyAuthorizationError, authorizeAssetKeyWrite, init_asset_key_auth, getPageEditCounter, init_page_versions, snapshotPage, init_version3, DEFAULT_THEME_ID, THEME_PRESET_IDS, getThemePreset, init_presets, readThemeFields, init_page_fields, assertOAuthAppUrlsSafe, assertOAuthEgressUrlSafe, init_app_validation, listOAuthPresets, listOAuthPresetIds, getOAuthPreset, hydrateOAuthAppFromPreset, init_presets2, scopedResourceScopeIdSchema, resolveScopedResourceId, init_scoped_resource, MemoryKeyError, init_key_guard, refreshLinks, init_link_resolver, indexMemoryContent, init_index_content, dedupeMemoryDocumentIds, recordMemoryAccesses, recordRetrievals, init_retrieval, ExplicitSelfDuplicateError, applyRating, init_store, shouldPersistAutomaticTaskMemory, init_automatic_task_gate, guardTerminalTaskResultWrite, init_terminal_result_guard, getTasksInputSchema, getTasksOutputSchema, getTasksHandler, init_get_tasks, reservedNamespaceError, privateNamespaceError, reservedRoomKeyError, init_kv_reserved_namespaces, updateMcpServerChecked, init_mcp_server_checked_update, updateTouchesStdioExecution, init_mcp_server_stdio_gate, canReadMemory, init_access, getLinksForMemory, init_links_store, expandCandidatesWithGraph, init_graph_expansion, isApiDraining, drainApi, init_api_drain, markKapsoMessageRead, sendKapsoReaction, init_client, getKapsoConfig, getKapsoNumberMapping, markKapsoMessageSeen, init_config2, changesAllowMerge, init_repo_merge_policy, updateSwarmRepoChecked, init_repo_checked_update, getCombConfig, init_config3, resolveRoomNamespace, roomRequestInfo, authorizeRoomNamespace, sessionAccessTopic, sessionPresenceRoot, init_auth2, RoomOperationSchema, init_document, removeAwarenessStates, init_awareness, roomTopic, decodeRoomSnapshot, roomView, getRoom, changeRoom, applyRoomUpdate, resetRoom, sweepRooms, closeRooms, removeNamespaceRooms, init_rooms, init_scheduler2, MEMORY_KEYS_DEFAULT_PREFIX, MEMORY_KEYS_MAX_LIMIT, estimateTokens, posteriorMean, listMemoryKeys, checkChunkIntegrity, getMemoryChunks, getPosteriorsByIds, init_key_browser, createEvent, createEventsBatch, getEventCountsFiltered, getEventsFiltered, init_events, mergeScheduleTiming, validateRecurringTiming, init_validate, followUpThreadForSourceTask, evaluateFollowUpRedelegation, init_follow_up_redelegation_guard, checkOutputSchemaShape, sendTaskOutputSchema, sendTaskHandler, init_send_task, steerTaskUserInputSchema, steerTaskOutputSchema, steerTaskHandler, init_steer_task, skipReasonFrom, finalizeSkippedTaskReaction, init_task_skip, IMPROVEMENT_TEXT_MAX, IMPROVEMENT_STATUSES, IMPROVEMENT_SOURCES, ImprovementError, isImprovementsEnabled, getImprovement, listImprovements, createImprovement, approveAndSend, discardImprovement, improvementLeakHints, init_improvements, canClaim, init_budget_admission, emitBudgetRefusalSideEffects, init_budget_refusal_notify, workflowModelErrors, init_model_validation2, patchWorkflowDefinition, init_patch_definition, idempotencyKeyHeader, readIdempotencyKey, replayAcceptedOperation, init_idempotency_key, resolveScriptsOnlyMode, init_scripts_only_mode, ALL_CAPABILITIES, hasCapability, getEnabledCapabilities, createServer, init_server };