@desplega.ai/agent-swarm 2.8.1 → 2.8.3

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 (318) hide show
  1. package/dist/acp-adapter-xq6s2z6t.js +14 -0
  2. package/dist/{actions-pwjpn0j6.js → actions-ewz7bp4g.js} +20 -19
  3. package/dist/{amp-adapter-cq9jgj6x.js → amp-adapter-f25tqhnf.js} +3 -3
  4. package/dist/{app-cnfffgwg.js → app-mkptw0k7.js} +4 -4
  5. package/dist/{assistant-kpn317y1.js → assistant-c47rfe77.js} +23 -22
  6. package/dist/{boot-args-schema-pbbnhmc3.js → boot-args-schema-4vb0xsat.js} +1 -1
  7. package/dist/{boot-reembed-9m0ysxma.js → boot-reembed-1ghy2sab.js} +1 -1
  8. package/dist/{boot-reembed-majbn53m.js → boot-reembed-htr73hbs.js} +1 -1
  9. package/dist/{boot-scrub-sweep-app8g8ym.js → boot-scrub-sweep-yrytg42z.js} +4 -4
  10. package/dist/{boot-seeds-pbtmvcjm.js → boot-seeds-n2b3dx4e.js} +4 -4
  11. package/dist/{boxd-qbkxy6ap.js → boxd-jmfqgkqa.js} +2 -2
  12. package/dist/{claude-adapter-wn1g3qp5.js → claude-adapter-r33pqnzx.js} +8 -9
  13. package/dist/{claude-managed-adapter-jh6c523j.js → claude-managed-adapter-hddmxjyj.js} +4 -4
  14. package/dist/{claude-managed-setup-pd47nzch.js → claude-managed-setup-hfvry1bd.js} +5 -5
  15. package/dist/{claude-sdk-session-3a2a6589.js → claude-sdk-session-0hamqzc7.js} +10 -11
  16. package/dist/{cli-v1dv1r37.js → cli-0bcgyj5b.js} +74 -3
  17. package/dist/{cli-a3b239vq.js → cli-0vksaxvr.js} +2 -2
  18. package/dist/{cli-mrt48bx7.js → cli-15204js0.js} +1 -1
  19. package/dist/{cli-8aes17e4.js → cli-1m96dc36.js} +3 -3
  20. package/dist/{cli-2r0jcc3k.js → cli-2d0cghfn.js} +1 -1
  21. package/dist/{cli-wk18cm92.js → cli-4ax9mvvg.js} +4 -4
  22. package/dist/{cli-9wngrawf.js → cli-4dpkjc2e.js} +6 -6
  23. package/dist/{cli-x1wa213s.js → cli-4e1hfbpq.js} +5 -5
  24. package/dist/{cli-7349va39.js → cli-500c09j9.js} +921 -431
  25. package/dist/{cli-m4dqmnbp.js → cli-54qr8mcd.js} +2 -2
  26. package/dist/{cli-m88rpzkh.js → cli-5a7szzfh.js} +2 -2
  27. package/dist/{cli-bst1vp7e.js → cli-5y2fvw4z.js} +13 -5
  28. package/dist/{cli-vj75tyaw.js → cli-6yygkr0w.js} +7 -7
  29. package/dist/{cli-7b8sbmag.js → cli-7c5tgqhf.js} +5 -5
  30. package/dist/{cli-2gxeg5gr.js → cli-8476gtwf.js} +1 -1
  31. package/dist/{cli-yncmerje.js → cli-922z7gwm.js} +4 -4
  32. package/dist/{cli-jrzkw01m.js → cli-93t5s4zq.js} +2 -2
  33. package/dist/{cli-sn7rtnj4.js → cli-9zmb7ptc.js} +9 -9
  34. package/dist/{cli-tk7cjj8h.js → cli-am1ptset.js} +3 -3
  35. package/dist/{cli-cyhbbd1z.js → cli-awwptga4.js} +1 -1
  36. package/dist/{cli-89cqnasv.js → cli-bhsfbmk8.js} +19 -7
  37. package/dist/{cli-9vhebtjz.js → cli-bj6qhgte.js} +15 -32
  38. package/dist/{cli-g70vxtjh.js → cli-c0xjnr8z.js} +2 -2
  39. package/dist/{cli-vqptjbr7.js → cli-c3ng0mb4.js} +14 -14
  40. package/dist/{cli-re4raaj0.js → cli-c71n3bxq.js} +11 -6
  41. package/dist/{cli-7p1kvkck.js → cli-crpf163n.js} +25 -18
  42. package/dist/{cli-k0wwfqbg.js → cli-dns0y538.js} +4 -0
  43. package/dist/{cli-d3p5vwbk.js → cli-dpsfwh7n.js} +13 -21
  44. package/dist/{cli-xzm9vcfg.js → cli-dtdht77h.js} +2 -2
  45. package/dist/{cli-bb431xey.js → cli-e2w34h6z.js} +231 -68
  46. package/dist/{cli-eddnyg3t.js → cli-emekyyhr.js} +1 -1
  47. package/dist/{cli-d84byzn8.js → cli-f1kwb5fc.js} +109 -33
  48. package/dist/{cli-0jzra9ad.js → cli-gn9y6fn7.js} +2 -2
  49. package/dist/{cli-tqegb8eq.js → cli-gpz1d0t2.js} +4 -4
  50. package/dist/{cli-7w69ne2f.js → cli-h9yy18gy.js} +239 -67
  51. package/dist/{cli-m5akxq8q.js → cli-j8cjdzan.js} +1 -1
  52. package/dist/{cli-m9s2qff2.js → cli-jg5txpm6.js} +187 -93
  53. package/dist/{cli-k26bkr9t.js → cli-k2rw11py.js} +3 -3
  54. package/dist/{cli-93k32c37.js → cli-k96cecs7.js} +377 -61
  55. package/dist/{cli-3vjhs18n.js → cli-kd56bmk4.js} +1 -1
  56. package/dist/{cli-k0615eh8.js → cli-kmemts3w.js} +13 -13
  57. package/dist/{cli-pcad4cb1.js → cli-knva3nmx.js} +2 -2
  58. package/dist/{cli-b085njxz.js → cli-kw44j53p.js} +15 -14
  59. package/dist/{cli-bsywb58a.js → cli-mdpbjnzq.js} +10 -10
  60. package/dist/{cli-syybb0p1.js → cli-me0r8gzr.js} +35 -76
  61. package/dist/{cli-4r05hnqa.js → cli-mwwmka77.js} +15 -15
  62. package/dist/{cli-1xh9a7hn.js → cli-n5t077me.js} +2 -2
  63. package/dist/{cli-rvhdmjvt.js → cli-nx2n3z6p.js} +1 -1
  64. package/dist/{cli-28fq781p.js → cli-pe4d96rb.js} +1 -1
  65. package/dist/{cli-3rkdne1h.js → cli-pxwtcgcp.js} +2 -2
  66. package/dist/{cli-zcsw143p.js → cli-qmqt520k.js} +2 -2
  67. package/dist/{cli-2zp0et3v.js → cli-qps8je6j.js} +70 -19
  68. package/dist/{cli-xae4g51r.js → cli-rh15cakt.js} +1 -1
  69. package/dist/{cli-k93bq1wq.js → cli-rjvsf9qa.js} +5 -5
  70. package/dist/{cli-6mma83xa.js → cli-rqfvkx5t.js} +7 -7
  71. package/dist/{cli-dy32zecz.js → cli-s7zz734a.js} +1 -1
  72. package/dist/{cli-yn2bbre9.js → cli-s8p8hhty.js} +2 -2
  73. package/dist/{cli-vbh10fqa.js → cli-sdvcrq5x.js} +5 -5
  74. package/dist/{cli-b5rs97a6.js → cli-sg27rk2t.js} +5 -5
  75. package/dist/{cli-d6521kb5.js → cli-skmhsnqh.js} +1 -1
  76. package/dist/{cli-5mrq3ake.js → cli-t4dv07kr.js} +1 -1
  77. package/dist/{cli-hxpyc9sn.js → cli-t5ys4ebm.js} +3 -3
  78. package/dist/{cli-qmqk2yc2.js → cli-tas6ckky.js} +2 -2
  79. package/dist/{cli-p1w18yhx.js → cli-tf79ryyy.js} +1 -1
  80. package/dist/{cli-kc7v1nfv.js → cli-tnzebztn.js} +1 -1
  81. package/dist/{cli-gax7fk3t.js → cli-vx421edw.js} +3 -3
  82. package/dist/{cli-kchjb7qy.js → cli-x3ex5bqf.js} +1 -1
  83. package/dist/cli-yss07azk.js +142 -0
  84. package/dist/{cli-0ntbxyaa.js → cli-z8cvws4c.js} +363 -47
  85. package/dist/{cli-tacge1w0.js → cli-zdaypkq9.js} +146 -52
  86. package/dist/{cli-b8e9nb04.js → cli-zeaehgyd.js} +2 -2
  87. package/dist/{cli-jcpr5smb.js → cli-ztq5z4e1.js} +4 -4
  88. package/dist/cli.js +21 -21
  89. package/dist/{codex-adapter-nha71q3n.js → codex-adapter-2brxx5ta.js} +7 -8
  90. package/dist/{codex-hook-h3vk6xzr.js → codex-hook-c930c3ea.js} +2 -2
  91. package/dist/{codex-login-bcda78ge.js → codex-login-cbrs1h5w.js} +1 -1
  92. package/dist/{codex-session-runner-ak9x1k1h.js → codex-session-runner-y9anfj0r.js} +8 -9
  93. package/dist/{commands-f587qpq8.js → commands-wn9q06qr.js} +3 -3
  94. package/dist/{controller-hxx8wwy1.js → controller-fw608czd.js} +4 -4
  95. package/dist/{controllers-connect-k5sg9m9h.js → controllers-connect-63j5rdcm.js} +20 -20
  96. package/dist/{cursor-adapter-n5nc3mfe.js → cursor-adapter-6mb9jme8.js} +2 -2
  97. package/dist/{db-nzf8zb5z.js → db-0m6v5tq4.js} +3 -3
  98. package/dist/{db-amm8w15a.js → db-y4wfrzbm.js} +4 -2
  99. package/dist/{devin-adapter-xedz98zv.js → devin-adapter-r0yx3gv8.js} +1 -1
  100. package/dist/{dispatcher-89zrts8f.js → dispatcher-9tq2zzdj.js} +17 -17
  101. package/dist/{docker-866qpzt9.js → docker-j75atvpt.js} +2 -2
  102. package/dist/{dsh-adapter-nrhbrjz8.js → dsh-adapter-t09sv4tq.js} +2 -2
  103. package/dist/{e2b-s16txnpx.js → e2b-7s9dscap.js} +3 -3
  104. package/dist/{e2b-jkwfhbcv.js → e2b-a7vzs2vj.js} +3 -3
  105. package/dist/{easter-egg-3d-533knw22.js → easter-egg-3d-fbwvmwhe.js} +1 -1
  106. package/dist/{embedding-space-ezwenjmj.js → embedding-space-wh8de1t9.js} +6 -6
  107. package/dist/{embeddings-np74ht6g.js → embeddings-3hpbdtjr.js} +1 -1
  108. package/dist/{event-bus-e66gh7cc.js → event-bus-tr6h3gv8.js} +1 -1
  109. package/dist/{execute-b3mrb1mv.js → execute-4bdf8sdy.js} +1 -1
  110. package/dist/{external-channel-z46yx9d7.js → external-channel-ts2fwqh0.js} +2 -2
  111. package/dist/fx-adapter-1rnxnf56.js +17 -0
  112. package/dist/grok-adapter-efhmf1r8.js +17 -0
  113. package/dist/handlers-anrr3py9.js +32 -0
  114. package/dist/{heartbeat-dt9qw9c8.js → heartbeat-2ze5fzpc.js} +20 -20
  115. package/dist/{hook-8k6fbz9b.js → hook-ca54yd4s.js} +5 -5
  116. package/dist/{hook-jgcgygex.js → hook-gaehe2w5.js} +8 -8
  117. package/dist/{http-haw4r8ne.js → http-jfg8t2yk.js} +3839 -122
  118. package/dist/{index-tvfafeyy.js → index-3gv6sc4z.js} +1 -1
  119. package/dist/{index-tez78qj3.js → index-3yvzbhxd.js} +100 -23
  120. package/dist/index-8w2aznds.js +33 -0
  121. package/dist/{index-5gk12my8.js → index-csgrxedz.js} +1 -1
  122. package/dist/index-qnjvr362.js +37 -0
  123. package/dist/index-yzxd3sn9.js +32 -0
  124. package/dist/{keepalive-xn6s7rmg.js → keepalive-k2a3qe73.js} +4 -4
  125. package/dist/lead-zhxqbfdv.js +69 -0
  126. package/dist/{maintenance-vdts800b.js → maintenance-gb5sd5nc.js} +1 -1
  127. package/dist/{node-4c5jqxr3.js → node-7qsx5kvm.js} +1 -1
  128. package/dist/{oauth-refresh-sweep-094c8wfk.js → oauth-refresh-sweep-y7rm6bkb.js} +3 -3
  129. package/dist/{onboard-v99eh56m.js → onboard-jmc5qerv.js} +4 -4
  130. package/dist/{opencode-adapter-dsagkhtw.js → opencode-adapter-7eade9ev.js} +6 -7
  131. package/dist/{otel-impl-q7yr9yp0.js → otel-impl-8j1xhxqd.js} +2 -2
  132. package/dist/{pi-mono-adapter-546cd1cc.js → pi-mono-adapter-yqmaf32x.js} +14 -13
  133. package/dist/{pricing-refresh-7dh2yase.js → pricing-refresh-1nj722h6.js} +2 -2
  134. package/dist/{rbac-roles-mdmc96p4.js → rbac-roles-b1mtr6dr.js} +3 -3
  135. package/dist/{rbac-roles-npbmdh77.js → rbac-roles-n1f3frk1.js} +2 -2
  136. package/dist/{render-v2-twhhwmms.js → render-v2-1gfpd8rj.js} +4 -4
  137. package/dist/{resume-5gsrjd5e.js → resume-w1s1eh5v.js} +7 -7
  138. package/dist/{runtime-1hv06jsn.js → runtime-84g5egsc.js} +1 -1
  139. package/dist/{session-access-m191x30x.js → session-access-y6z1txk4.js} +4 -4
  140. package/dist/{session-source-backfill-nt923ask.js → session-source-backfill-gxxwfh12.js} +3 -3
  141. package/dist/{setup-wv467afy.js → setup-r91gstyk.js} +1 -1
  142. package/dist/{virtual-modules-gazyapte.js → virtual-modules-cgnj6kme.js} +3 -3
  143. package/dist/{work-objects-8zkrpy13.js → work-objects-qcxzg61c.js} +20 -20
  144. package/dist/worker-7j2907g6.js +69 -0
  145. package/dist/{worker-follow-up-cecqszem.js → worker-follow-up-y2d2h7km.js} +19 -17
  146. package/dist/{x-2fyrt5pp.js → x-qhxq2ama.js} +2 -2
  147. package/openapi.json +2908 -351
  148. package/package.json +4 -4
  149. package/src/apps/catalog.generated.json +120 -1
  150. package/src/apps/definition.ts +38 -11
  151. package/src/apps/page-validator.ts +88 -0
  152. package/src/be/db/model-profiles.ts +110 -11
  153. package/src/be/db/tasks/read.ts +53 -0
  154. package/src/be/db/workflow-run-definitions.ts +19 -8
  155. package/src/be/db-client.ts +43 -5
  156. package/src/be/db.ts +40 -9
  157. package/src/be/migrations/284_model_profile_fallbacks.sql +9 -0
  158. package/src/be/migrations/289_automation_savings_daily.sql +47 -0
  159. package/src/be/migrations/291_task_slack_participants.sql +4 -0
  160. package/src/be/migrations/293_savings_component_links.sql +58 -0
  161. package/src/be/migrations/296_automation_savings_daily_read_index.sql +6 -0
  162. package/src/be/model-profile-check.ts +53 -20
  163. package/src/be/runtime-pools/routing.ts +1 -0
  164. package/src/be/savings/calibrate.ts +468 -0
  165. package/src/be/savings/compute.ts +677 -0
  166. package/src/be/savings/model.ts +674 -0
  167. package/src/be/savings/read.ts +1500 -0
  168. package/src/be/savings/rollup.ts +571 -0
  169. package/src/be/scripts/run-credential.ts +15 -3
  170. package/src/be/scripts/typecheck.ts +91 -4
  171. package/src/be/seed/agent-fs-provision.ts +48 -11
  172. package/src/be/seed/workflows-seeder.ts +67 -23
  173. package/src/be/seed-scripts/catalog/dreaming-learnings.ts +10 -2
  174. package/src/be/seed-scripts/catalog/dreaming-memtax-create.ts +70 -4
  175. package/src/be/skill-parser.ts +19 -7
  176. package/src/be/swarm-config-guard.ts +8 -0
  177. package/src/be/users.ts +29 -2
  178. package/src/commands/onboard/agent-fs-version.ts +1 -1
  179. package/src/commands/provider-error-class.ts +97 -0
  180. package/src/commands/runner.ts +258 -58
  181. package/src/extensions/contract-types.generated.ts +1 -1
  182. package/src/http/all-routes.ts +2 -0
  183. package/src/http/fs.ts +8 -2
  184. package/src/http/index.ts +11 -0
  185. package/src/http/model-profiles.ts +43 -10
  186. package/src/http/poll.ts +15 -1
  187. package/src/http/requested-by.ts +97 -1
  188. package/src/http/savings-calibration.ts +277 -0
  189. package/src/http/savings.ts +849 -0
  190. package/src/http/scripts.ts +26 -15
  191. package/src/http/tasks.ts +89 -9
  192. package/src/http/trackers/authorize-gate.ts +41 -0
  193. package/src/http/trackers/jira.ts +26 -4
  194. package/src/http/trackers/linear.ts +26 -4
  195. package/src/integrations/chat-sdk/limits.ts +6 -1
  196. package/src/jira/oauth.ts +7 -1
  197. package/src/linear/README.md +2 -1
  198. package/src/linear/oauth.ts +7 -1
  199. package/src/prompts/session-templates.ts +80 -3
  200. package/src/providers/acp-targets.ts +1 -1
  201. package/src/providers/amp-adapter.ts +1 -1
  202. package/src/providers/claude-adapter.ts +0 -20
  203. package/src/providers/claude-flag-settings.ts +12 -10
  204. package/src/providers/codex-adapter.ts +12 -34
  205. package/src/providers/opencode-adapter.ts +34 -12
  206. package/src/providers/pi-mono-adapter.ts +6 -5
  207. package/src/providers/types.ts +7 -0
  208. package/src/scheduler/scheduler.ts +20 -14
  209. package/src/scripts-runtime/ctx.ts +1 -1
  210. package/src/scripts-runtime/executors/quickjs-bundle.ts +1 -0
  211. package/src/scripts-runtime/executors/quickjs-prelude.ts +162 -2
  212. package/src/scripts-runtime/executors/quickjs-runner.ts +4 -1
  213. package/src/scripts-runtime/sdk-allowlist.ts +11 -1
  214. package/src/scripts-runtime/stdlib/fetch.ts +113 -15
  215. package/src/scripts-runtime/stdlib/index.ts +3 -1
  216. package/src/scripts-runtime/stdlib/retry.ts +174 -0
  217. package/src/scripts-runtime/swarm-sdk.ts +192 -17
  218. package/src/scripts-runtime/types/stdlib.d.ts +95 -4
  219. package/src/scripts-runtime/types/swarm-extension.d.ts +60 -0
  220. package/src/scripts-runtime/types/swarm-sdk.d.ts +69 -2
  221. package/src/slack/actions.ts +1 -0
  222. package/src/slack/assistant.ts +2 -0
  223. package/src/slack/enrich.ts +144 -50
  224. package/src/slack/handlers.ts +37 -95
  225. package/src/slack/templates.ts +9 -0
  226. package/src/slack/thread-buffer.ts +45 -71
  227. package/src/slack/thread-participants.ts +187 -0
  228. package/src/tasks/worker-follow-up.ts +142 -3
  229. package/src/tests/agent-fs-provision-seeder.test.ts +81 -0
  230. package/src/tests/apps-chart-shell.test.ts +170 -0
  231. package/src/tests/apps-icon.test.ts +156 -2
  232. package/src/tests/base-prompt.test.ts +5 -4
  233. package/src/tests/chat-sdk-relay.test.ts +12 -0
  234. package/src/tests/claude-adapter-binary.test.ts +7 -1
  235. package/src/tests/claude-adapter.test.ts +10 -64
  236. package/src/tests/claude-flag-settings.test.ts +15 -11
  237. package/src/tests/claude-hook-credentials.test.ts +0 -1
  238. package/src/tests/claude-sdk-lifecycle.test.ts +5 -1
  239. package/src/tests/codex-adapter.test.ts +28 -78
  240. package/src/tests/comb-default.test.ts +6 -0
  241. package/src/tests/core-auth.test.ts +7 -6
  242. package/src/tests/create-task-vcs-repo.test.ts +136 -0
  243. package/src/tests/db-client-busy-retry.test.ts +58 -6
  244. package/src/tests/db-task-read-contract.test.ts +2 -0
  245. package/src/tests/db-task-write-contract.test.ts +1 -0
  246. package/src/tests/deploy-guard.test.ts +154 -0
  247. package/src/tests/docs-index-footprint.test.js +3 -3
  248. package/src/tests/dreaming-learnings.test.ts +104 -0
  249. package/src/tests/extensions-pre-task.test.ts +4 -2
  250. package/src/tests/fetch-resolved-env.test.ts +47 -1
  251. package/src/tests/fixtures/app-shell-charts-definition.json.txt +180 -0
  252. package/src/tests/model-profile-fallbacks.test.ts +482 -0
  253. package/src/tests/model-profiles-api.test.ts +1 -0
  254. package/src/tests/opencode-adapter.test.ts +53 -6
  255. package/src/tests/pi-mono-session-cost-on-abort.test.ts +115 -0
  256. package/src/tests/prompt-template-session.test.ts +17 -1
  257. package/src/tests/provider-error-class.test.ts +174 -0
  258. package/src/tests/runner-provider-fallback.test.ts +197 -0
  259. package/src/tests/runner-requester-profile.test.ts +139 -1
  260. package/src/tests/savings-calibration-api.test.ts +264 -0
  261. package/src/tests/savings-calibration.test.ts +201 -0
  262. package/src/tests/savings-compound.test.ts +774 -0
  263. package/src/tests/savings-compute.test.ts +215 -0
  264. package/src/tests/savings-fleet-latency.test.ts +143 -0
  265. package/src/tests/savings-fleet-read.test.ts +195 -0
  266. package/src/tests/savings-fleet-scale.test.ts +222 -0
  267. package/src/tests/savings-model.test.ts +499 -0
  268. package/src/tests/savings-read.test.ts +367 -0
  269. package/src/tests/savings-rollup.test.ts +766 -0
  270. package/src/tests/savings-scripts.test.ts +611 -0
  271. package/src/tests/script-connections.test.ts +4 -0
  272. package/src/tests/script-executor-conformance.test.ts +444 -0
  273. package/src/tests/scripts-http.test.ts +55 -0
  274. package/src/tests/scripts-runtime-fetch.test.ts +2 -2
  275. package/src/tests/sdk-allowlist.test.ts +40 -0
  276. package/src/tests/secret-rules.test.ts +124 -1
  277. package/src/tests/secret-scrubber.test.ts +1 -1
  278. package/src/tests/seed-workflows.test.ts +167 -11
  279. package/src/tests/skill-parser.test.ts +45 -0
  280. package/src/tests/slack-dm-implicit-mention.test.ts +20 -1
  281. package/src/tests/slack-identity-resolution.test.ts +23 -0
  282. package/src/tests/slack-inbound-files.test.ts +2 -1
  283. package/src/tests/slack-thread-participants.test.ts +429 -0
  284. package/src/tests/tool-annotations.test.ts +30 -0
  285. package/src/tests/tracker-oauth-authorize-auth.test.ts +262 -0
  286. package/src/tests/workflow-definition-pinning.test.ts +128 -3
  287. package/src/tests/workflow-script-principal.test.ts +94 -4
  288. package/src/tools/app-upsert.ts +1 -1
  289. package/src/tools/model-profiles/list-model-profiles.ts +4 -2
  290. package/src/tools/update-profile.ts +1 -1
  291. package/src/types.ts +146 -33
  292. package/src/utils/constants.ts +2 -0
  293. package/src/utils/mcp-server-fetcher.test.ts +89 -0
  294. package/src/utils/mcp-server-fetcher.ts +13 -5
  295. package/src/utils/request-auth-context.ts +24 -0
  296. package/src/utils/secret-rules.generated.ts +1 -1
  297. package/src/utils/secret-scrubber.ts +154 -29
  298. package/src/workflows/executors/swarm-script.ts +23 -19
  299. package/templates/skills/apps/SKILL.md +62 -3
  300. package/templates/skills/apps/content.md +62 -3
  301. package/templates/skills/swarm-docs/content.md +2 -0
  302. package/templates/skills/swarm-scripts/SKILL.md +5 -4
  303. package/templates/skills/swarm-scripts/content.md +5 -4
  304. package/templates/skills/work-on-task/SKILL.md +1 -1
  305. package/templates/skills/work-on-task/content.md +1 -1
  306. package/templates/workflows/dreaming/content.md +1 -1
  307. package/dist/acp-adapter-pdy3qsvg.js +0 -15
  308. package/dist/cli-4bd1rck6.js +0 -4
  309. package/dist/cli-jywyhqws.js +0 -104
  310. package/dist/fx-adapter-3q12snn6.js +0 -18
  311. package/dist/grok-adapter-ahb1w033.js +0 -18
  312. package/dist/handlers-vbww69re.js +0 -32
  313. package/dist/index-4xwaf5th.js +0 -32
  314. package/dist/index-f0hcrs8e.js +0 -33
  315. package/dist/index-s4ewdma4.js +0 -37
  316. package/dist/lead-6ygbfhbh.js +0 -70
  317. package/dist/worker-mz5z7kj0.js +0 -70
  318. package/src/providers/ctx-mode-env.ts +0 -10
@@ -9,7 +9,7 @@ import {
9
9
  isSensitiveKey,
10
10
  scrubSecrets,
11
11
  init_secret_scrubber
12
- } from "./cli-d84byzn8.js";
12
+ } from "./cli-f1kwb5fc.js";
13
13
  import {
14
14
  __esm
15
15
  } from "./cli-242037k3.js";
@@ -4,7 +4,7 @@ import {
4
4
  CONTROLLER_COMMAND_TIMEOUT_MS,
5
5
  RuntimeHandleSchema,
6
6
  ControllerStatusResultSchema
7
- } from "./cli-m4dqmnbp.js";
7
+ } from "./cli-54qr8mcd.js";
8
8
  import {
9
9
  getDbClient2,
10
10
  validateControllerGraceSec,
@@ -21,7 +21,7 @@ import {
21
21
  upsertSwarmConfig2,
22
22
  getResolvedConfig2,
23
23
  init_db4
24
- } from "./cli-7w69ne2f.js";
24
+ } from "./cli-h9yy18gy.js";
25
25
  import {
26
26
  getPoolCache,
27
27
  reconcileCacheReleases,
@@ -35,17 +35,17 @@ import {
35
35
  getPoolForAgent2,
36
36
  resolvePoolDelivery2,
37
37
  init_db2
38
- } from "./cli-k93bq1wq.js";
38
+ } from "./cli-rjvsf9qa.js";
39
39
  import {
40
40
  workflowEventBus2,
41
41
  init_event_bus
42
- } from "./cli-eddnyg3t.js";
42
+ } from "./cli-emekyyhr.js";
43
43
  import {
44
44
  createWorkerTaskFollowUp2,
45
45
  init_worker_follow_up,
46
46
  canClaim,
47
47
  init_budget_admission
48
- } from "./cli-93k32c37.js";
48
+ } from "./cli-k96cecs7.js";
49
49
  import {
50
50
  runtimeStaleThresholdMinutes,
51
51
  getRuntimeInstanceById,
@@ -54,7 +54,7 @@ import {
54
54
  listRuntimeInstancesForAgent,
55
55
  listRuntimeInstancesForPool,
56
56
  init_multi_runtime
57
- } from "./cli-vqptjbr7.js";
57
+ } from "./cli-c3ng0mb4.js";
58
58
  import {
59
59
  isMultiRuntimeEnabled,
60
60
  init_multi_runtime2
@@ -63,7 +63,7 @@ import {
63
63
  canProvisionKind,
64
64
  createRuntimeProvider,
65
65
  init_runtime_providers
66
- } from "./cli-hxpyc9sn.js";
66
+ } from "./cli-t5ys4ebm.js";
67
67
  import {
68
68
  import_websocket,
69
69
  init_wrapper2
@@ -71,12 +71,12 @@ import {
71
71
  import {
72
72
  mintRuntimeToken,
73
73
  init_users
74
- } from "./cli-re4raaj0.js";
74
+ } from "./cli-c71n3bxq.js";
75
75
  import {
76
76
  TERMINAL_TASK_STATUSES,
77
77
  isTerminalTaskStatus,
78
78
  init_types4
79
- } from "./cli-2zp0et3v.js";
79
+ } from "./cli-qps8je6j.js";
80
80
  import {
81
81
  init_zod
82
82
  } from "./cli-zcfpsfzf.js";
@@ -92,11 +92,11 @@ import {
92
92
  import {
93
93
  buildImageTemplate,
94
94
  init_dispatch
95
- } from "./cli-kchjb7qy.js";
95
+ } from "./cli-x3ex5bqf.js";
96
96
  import {
97
97
  resolveWorkerApiUrl,
98
98
  init_worker_api_url
99
- } from "./cli-xae4g51r.js";
99
+ } from "./cli-rh15cakt.js";
100
100
  import {
101
101
  RUNTIME_LABELS,
102
102
  init_types5
@@ -105,7 +105,7 @@ import {
105
105
  scrubSecrets,
106
106
  registerVolatileSecret,
107
107
  init_secret_scrubber
108
- } from "./cli-d84byzn8.js";
108
+ } from "./cli-f1kwb5fc.js";
109
109
 
110
110
  // src/be/runtime-pools/supervisor.ts
111
111
  init_runtime_providers();
@@ -546,7 +546,7 @@ async function recoverSessions(runtimeId, reason) {
546
546
  }
547
547
  if (!sessions.length)
548
548
  return;
549
- const { remediateTaskForDeadRuntime } = await import("./heartbeat-dt9qw9c8.js");
549
+ const { remediateTaskForDeadRuntime } = await import("./heartbeat-2ze5fzpc.js");
550
550
  for (const session of sessions) {
551
551
  try {
552
552
  const task = await getTaskById2(session.taskId);
@@ -2,7 +2,7 @@ import {
2
2
  isGrokOpenRouterModel,
3
3
  grokTargetProfile,
4
4
  ACPAdapter2
5
- } from "./cli-sn7rtnj4.js";
5
+ } from "./cli-9zmb7ptc.js";
6
6
  import {
7
7
  getOpenRouterBaseUrl,
8
8
  getOpenRouterAttributionHeaders,
@@ -13,7 +13,7 @@ import {
13
13
  init_src2,
14
14
  registerVolatileSecret,
15
15
  init_secret_scrubber
16
- } from "./cli-d84byzn8.js";
16
+ } from "./cli-f1kwb5fc.js";
17
17
 
18
18
  // src/providers/grok-adapter.ts
19
19
  init_src2();
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  workflowEventBus2,
3
3
  init_event_bus
4
- } from "./cli-eddnyg3t.js";
4
+ } from "./cli-emekyyhr.js";
5
5
  import {
6
6
  withLoopPath,
7
7
  init_event_loop_lag,
@@ -70,19 +70,19 @@ import {
70
70
  getStaleApprovalRequests2,
71
71
  upsertKv2,
72
72
  init_db4
73
- } from "./cli-7w69ne2f.js";
73
+ } from "./cli-h9yy18gy.js";
74
74
  import {
75
75
  listRuntimePools2,
76
76
  init_db2
77
- } from "./cli-k93bq1wq.js";
77
+ } from "./cli-rjvsf9qa.js";
78
78
  import {
79
79
  userHoldsOperatorGrantedRole2,
80
80
  assertMayActOnOperatorGrantedTarget2,
81
81
  init_rbac_roles
82
- } from "./cli-1xh9a7hn.js";
82
+ } from "./cli-n5t077me.js";
83
83
  import {
84
84
  remediateStalledRuntime
85
- } from "./cli-k0615eh8.js";
85
+ } from "./cli-kmemts3w.js";
86
86
  import {
87
87
  repointTrackerSyncBySwarmId,
88
88
  init_tracker,
@@ -110,13 +110,13 @@ import {
110
110
  init_approval_cancel,
111
111
  canClaim,
112
112
  init_budget_admission
113
- } from "./cli-93k32c37.js";
113
+ } from "./cli-k96cecs7.js";
114
114
  import {
115
115
  runScriptWithRunCredential,
116
116
  init_run_credential,
117
117
  runSavedScriptAsAgent,
118
118
  init_run_saved
119
- } from "./cli-0ntbxyaa.js";
119
+ } from "./cli-z8cvws4c.js";
120
120
  import {
121
121
  runtimeStaleThresholdMinutes,
122
122
  countActiveRuntimeInstancesForAgent,
@@ -126,7 +126,7 @@ import {
126
126
  init_multi_runtime,
127
127
  createApprovalFollowUpTask,
128
128
  init_approval_notifications
129
- } from "./cli-vqptjbr7.js";
129
+ } from "./cli-c3ng0mb4.js";
130
130
  import {
131
131
  isMultiRuntimeEnabled,
132
132
  init_multi_runtime2
@@ -135,13 +135,13 @@ import {
135
135
  recordIdentityEvent,
136
136
  mintToken,
137
137
  init_users
138
- } from "./cli-re4raaj0.js";
138
+ } from "./cli-c71n3bxq.js";
139
139
  import {
140
140
  TERMINAL_TASK_STATUSES,
141
141
  OPEN_TASK_STATUSES,
142
142
  SUPERSEDED_WORKFLOW_TASK_REASON,
143
143
  init_types4
144
- } from "./cli-2zp0et3v.js";
144
+ } from "./cli-qps8je6j.js";
145
145
  import {
146
146
  DEFAULT_OPENROUTER_BASE_URL,
147
147
  getOpenRouterBaseUrl,
@@ -152,11 +152,11 @@ import {
152
152
  init_registry3,
153
153
  resolveTemplate,
154
154
  init_resolver
155
- } from "./cli-v1dv1r37.js";
155
+ } from "./cli-0bcgyj5b.js";
156
156
  import {
157
157
  init_package,
158
158
  package_default
159
- } from "./cli-yncmerje.js";
159
+ } from "./cli-922z7gwm.js";
160
160
  import {
161
161
  isEnvFlagEnabled,
162
162
  init_env_flag
@@ -164,7 +164,7 @@ import {
164
164
  import {
165
165
  scrubSecrets,
166
166
  init_secret_scrubber
167
- } from "./cli-d84byzn8.js";
167
+ } from "./cli-f1kwb5fc.js";
168
168
 
169
169
  // src/be/runtime-pools/routing.ts
170
170
  init_multi_runtime2();
@@ -306,7 +306,8 @@ async function routePoolTasks(opts = {}) {
306
306
  if (ok === undefined) {
307
307
  const result = await checkProfileForAgent(agent.id, task.profile, {
308
308
  vcsRepo: task.vcsRepo,
309
- includeRepoSecrets
309
+ includeRepoSecrets,
310
+ fallbacks: false
310
311
  });
311
312
  ok = result?.ok !== false;
312
313
  profileOk.set(memoKey, ok);
@@ -148,7 +148,7 @@ import {
148
148
  Instantiate,
149
149
  Evaluate2,
150
150
  Priority
151
- } from "./cli-8aes17e4.js";
151
+ } from "./cli-1m96dc36.js";
152
152
  import {
153
153
  require_index_min
154
154
  } from "./cli-t9wbrgm4.js";
@@ -162,7 +162,7 @@ import {
162
162
  retryDelayMs,
163
163
  retryAssistantCall,
164
164
  isRetryableAssistantError,
165
- init_retry,
165
+ init_retry2,
166
166
  str,
167
167
  num,
168
168
  int,
@@ -193,7 +193,7 @@ import {
193
193
  streamSimple2,
194
194
  completeSimple,
195
195
  init_compat
196
- } from "./cli-x1wa213s.js";
196
+ } from "./cli-4e1hfbpq.js";
197
197
  import {
198
198
  cleanupSessionResources,
199
199
  uuidv7
@@ -41114,7 +41114,7 @@ function configureHttpDispatcher(timeoutMs = DEFAULT_HTTP_IDLE_TIMEOUT_MS) {
41114
41114
  }
41115
41115
 
41116
41116
  // node_modules/@earendil-works/pi-coding-agent/dist/core/settings-defaults.js
41117
- init_retry();
41117
+ init_retry2();
41118
41118
  var SETTINGS_DEFAULTS = {
41119
41119
  transport: "auto",
41120
41120
  sessionShareDestination: "auto",
@@ -59445,7 +59445,7 @@ function loadAllHighlightLanguages() {
59445
59445
  if (!allLanguagesPromise) {
59446
59446
  allLanguagesPromise = new Promise((resolve) => {
59447
59447
  setImmediate(() => {
59448
- import("./index-tvfafeyy.js").then((m)=>__toESM(m.default,1)).then(() => resolve(), () => {
59448
+ import("./index-3gv6sc4z.js").then((m)=>__toESM(m.default,1)).then(() => resolve(), () => {
59449
59449
  resolve();
59450
59450
  });
59451
59451
  });
@@ -65717,7 +65717,7 @@ function getCreateJiti() {
65717
65717
  }
65718
65718
  var virtualModulesPromise;
65719
65719
  function getVirtualModules() {
65720
- virtualModulesPromise ??= import("./virtual-modules-gazyapte.js").then((module) => module.VIRTUAL_MODULES);
65720
+ virtualModulesPromise ??= import("./virtual-modules-cgnj6kme.js").then((module) => module.VIRTUAL_MODULES);
65721
65721
  return virtualModulesPromise;
65722
65722
  }
65723
65723
  var _aliases = null;
@@ -89500,7 +89500,7 @@ function parseCodemodeSource(input) {
89500
89500
  }
89501
89501
 
89502
89502
  // node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/execute.lazy.js
89503
- var loadCodemodeExecutor = () => import("./execute-b3mrb1mv.js");
89503
+ var loadCodemodeExecutor = () => import("./execute-4bdf8sdy.js");
89504
89504
 
89505
89505
  // node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/renderer.js
89506
89506
  var CODE_PREVIEW_LINES = 10;
@@ -90701,7 +90701,7 @@ function createMcpResourceToolDefinitions(options) {
90701
90701
  }
90702
90702
 
90703
90703
  // node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/runtime.lazy.js
90704
- var loadMcpRuntime = () => import("./runtime-1hv06jsn.js");
90704
+ var loadMcpRuntime = () => import("./runtime-84g5egsc.js");
90705
90705
 
90706
90706
  // node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard.js
90707
90707
  import { randomUUID as randomUUID3 } from "node:crypto";
@@ -95891,7 +95891,7 @@ var builtInExtensions = [
95891
95891
  ];
95892
95892
 
95893
95893
  // node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/cli.lazy.js
95894
- var loadMcpCommand = () => import("./cli-0jzra9ad.js");
95894
+ var loadMcpCommand = () => import("./cli-gn9y6fn7.js");
95895
95895
 
95896
95896
  // node_modules/@earendil-works/pi-coding-agent/dist/migrations.js
95897
95897
  import { existsSync as existsSync22, mkdirSync as mkdirSync11, readdirSync as readdirSync10, readFileSync as readFileSync17, renameSync as renameSync2, rmSync as rmSync3, writeFileSync as writeFileSync11 } from "fs";
@@ -98455,7 +98455,7 @@ function playEasterEgg3d(tui, egg) {
98455
98455
  if (tui.hasOverlay())
98456
98456
  return true;
98457
98457
  const screen = tui.getScreenLines();
98458
- import("./easter-egg-3d-533knw22.js").then((module) => module.playEasterEgg3d(tui, screen, egg), () => {});
98458
+ import("./easter-egg-3d-fbwvmwhe.js").then((module) => module.playEasterEgg3d(tui, screen, egg), () => {});
98459
98459
  return true;
98460
98460
  }
98461
98461
  function playPiLogo3d(tui, column, row) {
@@ -12,7 +12,7 @@ import {
12
12
  SteeringBlockedError,
13
13
  init_steering2,
14
14
  init_db4
15
- } from "./cli-7w69ne2f.js";
15
+ } from "./cli-h9yy18gy.js";
16
16
  import {
17
17
  isBlockExternalEnabled2,
18
18
  invalidateChannelExternality2,
@@ -20,11 +20,11 @@ import {
20
20
  shouldBlockChannel2,
21
21
  leaveExternalChannel2,
22
22
  init_external_channel
23
- } from "./cli-b8e9nb04.js";
23
+ } from "./cli-zeaehgyd.js";
24
24
  import {
25
25
  workflowEventBus2,
26
26
  init_event_bus
27
- } from "./cli-eddnyg3t.js";
27
+ } from "./cli-emekyyhr.js";
28
28
  import {
29
29
  noteSlackInboundSideEffect,
30
30
  ignoreSlackInbound,
@@ -40,7 +40,7 @@ import {
40
40
  init_render_v2,
41
41
  registerTreeMessage,
42
42
  init_watcher
43
- } from "./cli-4r05hnqa.js";
43
+ } from "./cli-mwwmka77.js";
44
44
  import {
45
45
  TaskCreationBlockedError,
46
46
  init_errors2,
@@ -55,30 +55,30 @@ import {
55
55
  routeMessage,
56
56
  extractTaskFromMessage,
57
57
  init_router,
58
- extractSlackMessageText,
59
58
  slackInboundMessageText,
60
59
  collectSlackMessageFiles,
61
60
  init_message_text,
62
61
  dispatchPre2,
63
62
  init_dispatcher
64
- } from "./cli-93k32c37.js";
63
+ } from "./cli-k96cecs7.js";
65
64
  import {
66
65
  wasEventSeen,
67
66
  init_event_dedup,
68
67
  requestSlackThreadSteering,
69
68
  formatSlackSteeringAck,
70
69
  init_steering,
70
+ buildSlackThreadSnapshot,
71
+ init_thread_participants,
71
72
  bufferThreadMessage,
72
73
  getBufferMessageCount,
73
74
  instantFlush,
74
75
  init_thread_buffer
75
- } from "./cli-tacge1w0.js";
76
+ } from "./cli-zdaypkq9.js";
76
77
  import {
77
78
  enrichSlackUserEmail,
78
79
  resolveSlackUserId,
79
- rewriteSlackMentions,
80
80
  init_enrich
81
- } from "./cli-jywyhqws.js";
81
+ } from "./cli-yss07azk.js";
82
82
  import {
83
83
  isSlackLeaveThreadDisabled,
84
84
  SLACK_LEFT_THREAD_CONFIRMATION,
@@ -86,11 +86,7 @@ import {
86
86
  leaveSlackThread,
87
87
  shouldSkipLeftSlackThread,
88
88
  init_left_threads
89
- } from "./cli-dy32zecz.js";
90
- import {
91
- resolveTemplate,
92
- init_resolver
93
- } from "./cli-v1dv1r37.js";
89
+ } from "./cli-s7zz734a.js";
94
90
  import {
95
91
  init_zod
96
92
  } from "./cli-zcfpsfzf.js";
@@ -107,7 +103,7 @@ import {
107
103
  import {
108
104
  scrubSecrets,
109
105
  init_secret_scrubber
110
- } from "./cli-d84byzn8.js";
106
+ } from "./cli-f1kwb5fc.js";
111
107
  import {
112
108
  __esm,
113
109
  __using,
@@ -202,41 +198,15 @@ async function wasThreadStartedBySwarm(client, channelId, threadTs) {
202
198
  async function hasSwarmThreadActivity(client, channelId, threadTs) {
203
199
  return await getAgentWorkingOnThread2(channelId, threadTs) !== null || await wasThreadStartedBySwarm(client, channelId, threadTs);
204
200
  }
205
- async function getThreadContext(client, channel, threadTs, currentTs, botUserId) {
206
- if (!threadTs)
207
- return "";
208
- try {
209
- const result = await client.conversations.replies({
210
- channel,
211
- ts: threadTs,
212
- limit: 20
213
- });
214
- const messages = result.messages || [];
215
- const previousMessages = messages.filter((m) => {
216
- if (m.ts === currentTs)
217
- return false;
218
- return extractSlackMessageText(m) !== "";
219
- });
220
- if (previousMessages.length === 0)
221
- return "";
222
- const formattedMessages = [];
223
- for (const m of previousMessages) {
224
- const isBotMessage = m.user === botUserId || m.bot_id !== undefined || m.subtype === "bot_message";
225
- const text = extractSlackMessageText(m);
226
- if (isBotMessage) {
227
- const truncatedText = text.length > 500 ? `${text.slice(0, 500)}...` : text;
228
- formattedMessages.push(`[Agent]: ${truncatedText}`);
229
- } else {
230
- const authorTag = m.user ? `<@${m.user}>` : "Unknown";
231
- formattedMessages.push(`${authorTag}: ${text}`);
232
- }
233
- }
234
- return await rewriteSlackMentions(formattedMessages.join(`
235
- `), botUserId);
236
- } catch (error) {
237
- console.error("[Slack] Failed to fetch thread context:", error);
238
- return "";
239
- }
201
+ function getThreadContext(client, msg, botUserId) {
202
+ return buildSlackThreadSnapshot(client, {
203
+ channelId: msg.channel,
204
+ threadTs: msg.thread_ts,
205
+ excludeTs: new Set([msg.ts]),
206
+ botUserId,
207
+ senders: [{ userId: msg.user, text: msg.text ?? "", userTeam: msg.user_team }],
208
+ sampleEventType: "thread_participant"
209
+ });
240
210
  }
241
211
  function isMessageProcessed(messageKey) {
242
212
  if (processedMessages.has(messageKey)) {
@@ -327,7 +297,8 @@ function registerMessageHandler2(app) {
327
297
  }
328
298
  const requestedByUserId = await resolveSlackUserId(client, msg.user, {
329
299
  sampleEventType: "message",
330
- sampleContext: msg.text ?? ""
300
+ sampleContext: msg.text ?? "",
301
+ userTeam: msg.user_team
331
302
  });
332
303
  noteSlackInboundSideEffect("workflow_event");
333
304
  workflowEventBus2.emit("slack.message", {
@@ -358,7 +329,7 @@ function registerMessageHandler2(app) {
358
329
  console.log(`[Slack] !now command detected in thread ${threadKey}${nowMessage ? ` with message: "${nowMessage}"` : ""}`);
359
330
  noteSlackInboundSideEffect("thread_flush");
360
331
  if (nowMessage || hasFiles) {
361
- bufferThreadMessage(msg.channel, msg.thread_ts, nowMessage, msg.user, msg.ts, messageFiles, botUserId);
332
+ bufferThreadMessage(msg.channel, msg.thread_ts, nowMessage, msg.user, msg.ts, messageFiles, botUserId, msg.user_team);
362
333
  }
363
334
  await instantFlush(threadKey);
364
335
  await ackSlackMessage(client, msg.channel, msg.ts, reactionName("now"), "now");
@@ -374,7 +345,7 @@ function registerMessageHandler2(app) {
374
345
  if (hasSwarmActivity) {
375
346
  const threadKey = `${msg.channel}:${msg.thread_ts}`;
376
347
  noteSlackInboundSideEffect("thread_buffer");
377
- bufferThreadMessage(msg.channel, msg.thread_ts, messageText, msg.user, msg.ts, messageFiles, botUserId);
348
+ bufferThreadMessage(msg.channel, msg.thread_ts, messageText, msg.user, msg.ts, messageFiles, botUserId, msg.user_team);
378
349
  const count = getBufferMessageCount(threadKey);
379
350
  const event = count === 1 ? "accepted" : "buffered";
380
351
  const name = reactionName(event);
@@ -457,18 +428,10 @@ function registerMessageHandler2(app) {
457
428
  return ignoreSlackInbound("empty_task");
458
429
  }
459
430
  const threadTs = msg.thread_ts || msg.ts;
460
- const threadContext = await getThreadContext(client, msg.channel, msg.thread_ts, msg.ts, botUserId);
461
- let fullTaskDescription;
462
- if (threadContext) {
463
- const ctxResult = resolveTemplate("slack.message.thread_context", {
464
- thread_messages: threadContext
465
- });
466
- fullTaskDescription = `${ctxResult.text}
431
+ const { threadContext, participants: slackParticipants } = await getThreadContext(client, { ...msg, user: msg.user }, botUserId);
432
+ const fullTaskDescription = threadContext ? `${threadContext}
467
433
 
468
- ${taskDescription}`;
469
- } else {
470
- fullTaskDescription = taskDescription;
471
- }
434
+ ${taskDescription}` : taskDescription;
472
435
  const lead = await getLeadAgent2();
473
436
  const { task, unattached } = await createSlackTaskWithFiles(fullTaskDescription, {
474
437
  agentId: lead?.id,
@@ -479,6 +442,7 @@ ${taskDescription}`;
479
442
  slackThreadTs: threadTs,
480
443
  slackTriggerMessageTs: msg.ts,
481
444
  slackUserId: msg.user,
445
+ slackParticipants,
482
446
  requestedByUserId,
483
447
  contextKey: slackContextKey({ channelId: msg.channel, threadTs })
484
448
  }, inbound, slack);
@@ -521,18 +485,10 @@ ${taskDescription}`;
521
485
  return ignoreSlackInbound("empty_task");
522
486
  }
523
487
  const threadTs = msg.thread_ts || msg.ts;
524
- const threadContext = await getThreadContext(client, msg.channel, msg.thread_ts, msg.ts, botUserId);
525
- let fullTaskDescription;
526
- if (threadContext) {
527
- const ctxResult = resolveTemplate("slack.message.thread_context", {
528
- thread_messages: threadContext
529
- });
530
- fullTaskDescription = `${ctxResult.text}
488
+ const { threadContext, participants: slackParticipants } = await getThreadContext(client, { ...msg, user: msg.user }, botUserId);
489
+ const fullTaskDescription = threadContext ? `${threadContext}
531
490
 
532
- ${taskDescription}`;
533
- } else {
534
- fullTaskDescription = taskDescription;
535
- }
491
+ ${taskDescription}` : taskDescription;
536
492
  const results = { assigned: [], queued: [], steered: [], failed: [] };
537
493
  const unattached = [];
538
494
  for (const match of matches) {
@@ -571,8 +527,10 @@ ${taskDescription}`;
571
527
  slackThreadTs: threadTs,
572
528
  slackTriggerMessageTs: msg.ts,
573
529
  slackUserId: msg.user,
530
+ slackParticipants,
574
531
  parentTaskId: latestTask?.id,
575
532
  inheritParentOutputSchema: false,
533
+ inheritParentRequester: false,
576
534
  requestedByUserId,
577
535
  contextKey: slackContextKey({ channelId: msg.channel, threadTs })
578
536
  }, inbound, slack);
@@ -591,6 +549,7 @@ ${taskDescription}`;
591
549
  slackThreadTs: threadTs,
592
550
  slackTriggerMessageTs: msg.ts,
593
551
  slackUserId: msg.user,
552
+ slackParticipants,
594
553
  requestedByUserId,
595
554
  contextKey: slackContextKey({ channelId: msg.channel, threadTs })
596
555
  }, inbound, slack);
@@ -746,7 +705,6 @@ var init_handlers = __esm(() => {
746
705
  init_db4();
747
706
  init_steering2();
748
707
  init_dispatcher();
749
- init_resolver();
750
708
  init_context_key();
751
709
  init_errors2();
752
710
  init_secret_scrubber();
@@ -766,6 +724,7 @@ var init_handlers = __esm(() => {
766
724
  init_render_v2();
767
725
  init_steering();
768
726
  init_thread_buffer();
727
+ init_thread_participants();
769
728
  init_watcher();
770
729
  SlackRouteModifySchema = object2({
771
730
  target: discriminatedUnion("kind", [
@@ -56,15 +56,15 @@ import {
56
56
  checkDependencies2,
57
57
  emitBuiltInIntegrationConnectedOnce2,
58
58
  init_db4
59
- } from "./cli-7w69ne2f.js";
59
+ } from "./cli-h9yy18gy.js";
60
60
  import {
61
61
  getChannelBlockReason2,
62
62
  init_external_channel
63
- } from "./cli-b8e9nb04.js";
63
+ } from "./cli-zeaehgyd.js";
64
64
  import {
65
65
  workflowEventBus2,
66
66
  init_event_bus
67
- } from "./cli-eddnyg3t.js";
67
+ } from "./cli-emekyyhr.js";
68
68
  import {
69
69
  require_jsonwebtoken,
70
70
  require_dist6,
@@ -90,11 +90,11 @@ import {
90
90
  import {
91
91
  isTerminalTaskStatus,
92
92
  init_types4
93
- } from "./cli-2zp0et3v.js";
93
+ } from "./cli-qps8je6j.js";
94
94
  import {
95
95
  taskAttachmentDisplayUrl,
96
96
  init_task_attachment_links
97
- } from "./cli-tk7cjj8h.js";
97
+ } from "./cli-am1ptset.js";
98
98
  import {
99
99
  getSlackConfiguration,
100
100
  init_config4
@@ -112,7 +112,7 @@ import {
112
112
  import {
113
113
  getAppUrl,
114
114
  init_constants3
115
- } from "./cli-k0wwfqbg.js";
115
+ } from "./cli-dns0y538.js";
116
116
  import {
117
117
  isEnvFlagEnabled,
118
118
  init_env_flag
@@ -125,7 +125,7 @@ import {
125
125
  scrubSecrets,
126
126
  scrubObject,
127
127
  init_secret_scrubber
128
- } from "./cli-d84byzn8.js";
128
+ } from "./cli-f1kwb5fc.js";
129
129
  import {
130
130
  __toESM,
131
131
  __commonJS,
@@ -12155,7 +12155,7 @@ async function initOtel(serviceRole = process.env.AGENT_ROLE || "api") {
12155
12155
  return;
12156
12156
  initialized = true;
12157
12157
  try {
12158
- const impl = await import("./otel-impl-q7yr9yp0.js");
12158
+ const impl = await import("./otel-impl-8j1xhxqd.js");
12159
12159
  await impl.boot(serviceRole, {
12160
12160
  exportConsoleLogs: serviceRole === "api" && isApiLogExportEnabled()
12161
12161
  });
@@ -16341,17 +16341,17 @@ async function initSlackApp2() {
16341
16341
  installSocketWorkspaceGate(receiver.client);
16342
16342
  initialized2 = true;
16343
16343
  app.use(slackInboundOutcomeMiddleware());
16344
- const { registerMessageHandler } = await import("./handlers-vbww69re.js");
16345
- const { registerCommandHandler } = await import("./commands-f587qpq8.js");
16346
- const { registerActionHandlers } = await import("./actions-pwjpn0j6.js");
16347
- const { registerWorkObjectHandlers } = await import("./work-objects-8zkrpy13.js");
16344
+ const { registerMessageHandler } = await import("./handlers-anrr3py9.js");
16345
+ const { registerCommandHandler } = await import("./commands-wn9q06qr.js");
16346
+ const { registerActionHandlers } = await import("./actions-ewz7bp4g.js");
16347
+ const { registerWorkObjectHandlers } = await import("./work-objects-qcxzg61c.js");
16348
16348
  registerMessageHandler(app);
16349
16349
  registerCommandHandler(app);
16350
16350
  registerActionHandlers(app);
16351
16351
  registerWorkObjectHandlers(app);
16352
- const { createAssistant } = await import("./assistant-kpn317y1.js");
16352
+ const { createAssistant } = await import("./assistant-c47rfe77.js");
16353
16353
  app.assistant(createAssistant());
16354
- const { isBlockExternalEnabled, scanExternalChannelsOnBoot } = await import("./external-channel-z46yx9d7.js");
16354
+ const { isBlockExternalEnabled, scanExternalChannelsOnBoot } = await import("./external-channel-ts2fwqh0.js");
16355
16355
  if (isBlockExternalEnabled()) {
16356
16356
  scanExternalChannelsOnBoot(app.client).catch((error) => {
16357
16357
  console.error("[Slack] External channel boot scan failed:", error);
@@ -16378,7 +16378,7 @@ async function startSlackApp2() {
16378
16378
  }
16379
16379
  startRetryAttempt = 0;
16380
16380
  startSocketWatchdog();
16381
- const { isSlackRenderV2Enabled } = await import("./render-v2-twhhwmms.js");
16381
+ const { isSlackRenderV2Enabled } = await import("./render-v2-1gfpd8rj.js");
16382
16382
  if (isSlackRenderV2Enabled())
16383
16383
  await ensureSlackRenderV2Activation2();
16384
16384
  await recoverSlackInboundAfterRestart();
@@ -8,12 +8,12 @@ import {
8
8
  invalidateTelemetryUserRole,
9
9
  init_telemetry_identity,
10
10
  init_db4
11
- } from "./cli-7w69ne2f.js";
11
+ } from "./cli-h9yy18gy.js";
12
12
  import {
13
13
  revokeAllUserCredentials,
14
14
  isLiveUserToken,
15
15
  init_users
16
- } from "./cli-re4raaj0.js";
16
+ } from "./cli-c71n3bxq.js";
17
17
  import {
18
18
  init_env_flag
19
19
  } from "./cli-cebvbc9t.js";